Skip to content

Commit af7397b

Browse files
rmacnak-googleCommit Queue
authored andcommitted
[vm] Disable simulator when we detect we can JIT.
TEST=local Flutter engine build Bug: flutter/flutter#163984 Change-Id: Id16e75dada9571636b1ee3ef3988825beb67707b Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435640 Reviewed-by: Slava Egorov <[email protected]> Commit-Queue: Ryan Macnak <[email protected]>
1 parent 27ff411 commit af7397b

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

runtime/vm/virtual_memory_posix.cc

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -552,15 +552,23 @@ void VirtualMemory::Init() {
552552
page_size_ = CalculatePageSize();
553553

554554
#if defined(DART_ENABLE_RX_WORKAROUNDS)
555+
bool can_jit = true;
555556
if (IsAtLeastIOS26_0()) {
556557
should_dual_map_executable_pages_ = true;
557-
if (!CheckIfRXWorks()) {
558-
FATAL(
559-
"Unable to JIT: failed to create executable machine code dynamically "
560-
"due to OS restrictions");
561-
}
558+
can_jit = CheckIfRXWorks();
559+
}
560+
#if defined(DART_INCLUDE_SIMULATOR)
561+
FLAG_use_simulator = !can_jit;
562+
Syslog::PrintErr("Dart execution mode: %s\n",
563+
FLAG_use_simulator ? "simulator" : "JIT");
564+
#else
565+
if (!can_jit) {
566+
FATAL(
567+
"Unable to JIT: failed to create executable machine code dynamically "
568+
"due to OS restrictions");
562569
}
563570
#endif
571+
#endif
564572

565573
#if defined(DART_COMPRESSED_POINTERS)
566574
ASSERT(compressed_heap_ == nullptr);

0 commit comments

Comments
 (0)