[vm] Don't request executable memory for code pages when running the simulator.

Countermand the executably relatively late so the heap still tracks the pages separately.

TEST=ci
Change-Id: Id435c50739565af7ab3225d6060b10c255ddfd50
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/491922
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
This commit is contained in:
Ryan Macnak
2026-04-01 08:15:11 -07:00
committed by Commit Queue
parent 4cfd3da965
commit 7a69fd1b81
+12 -2
View File
@@ -69,7 +69,12 @@ static intptr_t CacheIndex(uword flags) {
}
Page* Page::Allocate(intptr_t size, uword flags) {
const bool executable = (flags & Page::kExecutable) != 0;
#if defined(DART_INCLUDE_SIMULATOR)
const bool using_simulator = FLAG_use_simulator;
#else
const bool using_simulator = false;
#endif
const bool executable = (flags & Page::kExecutable) != 0 && !using_simulator;
const bool compressed = !executable;
const char* name = executable ? "dart-code" : "dart-heap";
@@ -311,7 +316,12 @@ void Page::ResetProgressBar() {
void Page::WriteProtect(bool read_only) {
ASSERT(!is_image());
if (is_executable() && read_only) {
#if defined(DART_INCLUDE_SIMULATOR)
const bool using_simulator = FLAG_use_simulator;
#else
const bool using_simulator = false;
#endif
if (is_executable() && read_only && !using_simulator) {
// Handle making code executable in a special way.
memory_->WriteProtectCode();
} else {