Revert "Remove the JIT entitlement from gen_snapshot."

This reverts commit 8dd61ee24b.

Reason for revert: gen_snapshot still flakily setting executable permissions?

Original change's description:
> Remove the JIT entitlement from gen_snapshot.
>
> gen_snapshot doesn't need the instructions it's generating to actually be executable.
>
> TEST=ci
> Change-Id: I6c542d4a07f6e6659feb22f77aca3819d7d26c78
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/509060
> Reviewed-by: Tess Strickland <sstrickl@google.com>
> Commit-Queue: Ryan Macnak <rmacnak@google.com>

No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: I91ed61d719a3d9eefa66b32b535079a07c92ab59
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/510080
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
This commit is contained in:
Ryan Macnak
2026-06-08 14:05:04 -07:00
committed by dart-scoped@luci-project-accounts.iam.gserviceaccount.com
parent 3a85655f91
commit 7b62c1be57
3 changed files with 16 additions and 13 deletions
@@ -2,5 +2,7 @@
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.cs.allow-jit</key>
<true/>
</dict>
</plist>
@@ -2,5 +2,7 @@
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.cs.allow-jit</key>
<true/>
</dict>
</plist>
+12 -13
View File
@@ -68,19 +68,13 @@ static intptr_t CacheIndex(uword flags) {
return (flags & Page::kExecutable) != 0 ? 1 : 0;
}
static bool ExecutesGeneratedCode() {
#if defined(DART_PRECOMPILER) && !defined(TESTING)
return false;
#elif defined(DART_INCLUDE_SIMULATOR)
return !FLAG_use_simulator;
#else
return true;
#endif
}
Page* Page::Allocate(intptr_t size, uword flags) {
const bool executable =
(flags & Page::kExecutable) != 0 && ExecutesGeneratedCode();
#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";
@@ -322,7 +316,12 @@ void Page::ResetProgressBar() {
void Page::WriteProtect(bool read_only) {
ASSERT(!is_image());
if (is_executable() && read_only && ExecutesGeneratedCode()) {
#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 {