Disable code page write protection in debug mode (flutter/engine#3299)
This commit is contained in:
@@ -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));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user