Disable code page write protection in debug mode (flutter/engine#3299)

This commit is contained in:
John McCutchan
2016-12-08 15:06:13 -08:00
committed by GitHub
parent 5045f38837
commit c30259f646

View File

@@ -90,6 +90,10 @@ static const char* kDartBackgroundCompilationArgs[] = {
"--background_compilation",
};
static const char* kDartWriteProtectCodeArgs[] = {
"--no_write_protect_code",
};
static const char* kDartCheckedModeArgs[] = {
// clang-format off
"--enable_asserts",
@@ -634,6 +638,14 @@ void InitDartVM() {
const bool use_checked_mode = !IsRunningPrecompiledCode();
#endif
#if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DEBUG
// Debug mode uses the JIT, disable code page write protection to avoid
// memory page protection changes before and after every compilation.
PushBackAll(&args,
kDartWriteProtectCodeArgs,
arraysize(kDartWriteProtectCodeArgs));
#endif
if (use_checked_mode)
PushBackAll(&args, kDartCheckedModeArgs, arraysize(kDartCheckedModeArgs));