Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[JSC] Use storage node in ArrayPush for SlowPutArray
https://bugs.webkit.org/show_bug.cgi?id=246405 rdar://problem/101081844 Reviewed by Justin Michaud. This patch fixes a bug that GetArrayLength gets nullptr crash when we convert ArrayPush+SlowPutArray with empty arguments to GetArrayLength because we are discarding butterfly storage for that case. But since SlowPutArray's ArrayPush is slow anyway, let's simplify our code and always get butterfly storage even for SlowPutArray case. * JSTests/stress/slow-put-array-empty-push.js: Added. (runNearStackLimit): (__f_6): (__f_32): * Source/JavaScriptCore/dfg/DFGFixupPhase.cpp: (JSC::DFG::FixupPhase::fixupNode): * Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp: * Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp: (JSC::FTL::DFG::LowerDFGToB3::compileArrayPush): Canonical link: https://commits.webkit.org/255454@main
- Loading branch information
1 parent
9ec3b6f
commit 1b4792d
Showing
4 changed files
with
71 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
//@ runDefault("--useConcurrentGC=0", "--returnEarlyFromInfiniteLoopsForFuzzing=1", "--earlyReturnFromInfiniteLoopsLimit=1000000", "--verifyGC=true", "--forceGCSlowPaths=true", "--forceEagerCompilation=1", "--jitPolicyScale=0", "--useConcurrentJIT=0") | ||
function runNearStackLimit() { | ||
__v_21 = [] | ||
try { | ||
try { | ||
__v_21.push()} catch {} | ||
} catch {} | ||
} | ||
function __f_6() { | ||
try { | ||
runNearStackLimit() | ||
} catch {} | ||
} | ||
try { | ||
__f_6() | ||
for (__v_19 = 0; __v_19 < 10; ++__v_19) | ||
try { | ||
Object.defineProperty(Array.prototype, __v_19, {})} catch {} | ||
} catch {} | ||
function __f_32() { | ||
try { | ||
__f_6() | ||
} catch {} | ||
} | ||
try { | ||
__f_32() | ||
__f_32()} catch {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters