Skip to content

Commit c5983a8

Browse files
committed
[JSC] Fix SequesteredArenaMalloc when compiling synchronously
https://bugs.webkit.org/show_bug.cgi?id=289003 rdar://146051685 Reviewed by Yusuke Suzuki and Keith Miller. The asynchronous compile paths have an ArenaLifetime in scope, but the synchronous paths did not. * Source/JavaScriptCore/jit/BaselineJITPlan.cpp: (JSC::BaselineJITPlan::compileSync): * Source/JavaScriptCore/jit/JITWorklist.cpp: (JSC::JITWorklist::enqueue): Canonical link: https://commits.webkit.org/291538@main
1 parent 51d0220 commit c5983a8

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

‎Source/JavaScriptCore/jit/JIT.cpp‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,6 +1025,10 @@ CompilationResult JIT::finalizeOnMainThread(CodeBlock* codeBlock, BaselineJITPla
10251025

10261026
CompilationResult JIT::compileSync(VM&, CodeBlock* codeBlock, JITCompilationEffort effort)
10271027
{
1028+
#if USE(PROTECTED_JIT)
1029+
// Must be constructed before we allocate anything using SequesteredArenaMalloc
1030+
ArenaLifetime saLifetime;
1031+
#endif
10281032
auto plan = adoptRef(*new BaselineJITPlan(codeBlock));
10291033
plan->compileSync(effort);
10301034
return plan->finalize();

‎Source/JavaScriptCore/jit/JITWorklist.cpp‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ JITWorklist& JITWorklist::ensureGlobalWorklist()
8484
CompilationResult JITWorklist::enqueue(Ref<JITPlan> plan)
8585
{
8686
if (!Options::useConcurrentJIT()) {
87+
#if USE(PROTECTED_JIT)
88+
// Must be constructed before we allocate anything using SequesteredArenaMalloc
89+
ArenaLifetime saLifetime;
90+
#endif
8791
plan->compileInThread(nullptr);
8892
return plan->finalize();
8993
}

0 commit comments

Comments
 (0)