13#if defined(DART_HOST_OS_MACOS) || defined(DART_HOST_OS_MACOS_IOS)
26 "Write protect jitted code");
28#if defined(TARGET_ARCH_IA32)
29WritableInstructionsScope::WritableInstructionsScope(
uword address,
31 : address_(address), size_(size) {
32 if (FLAG_write_protect_code) {
38WritableInstructionsScope::~WritableInstructionsScope() {
39 if (FLAG_write_protect_code) {
40 VirtualMemory::Protect(
reinterpret_cast<void*
>(address_), size_,
41 VirtualMemory::kReadExecute);
53 if (FLAG_support_rr)
return true;
55 uint8_t* bytes =
reinterpret_cast<uint8_t*
>(
end - size);
56 for (intptr_t i = 0; i < size; i++) {
57 int16_t val = pattern[i];
58 if ((val >= 0) && (val != bytes[i])) {
static void Protect(void *address, intptr_t size, Protection mode)
#define DEFINE_FLAG(type, name, default_value, comment)
bool MatchesPattern(uword end, const int16_t *pattern, intptr_t size)
static constexpr bool kShouldWriteProtectCodeByDefault