Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[JSC] GetByVal on Undecided use its children before its OSR Exit
https://bugs.webkit.org/show_bug.cgi?id=157046 Patch by Benjamin Poulain <bpoulain@apple.com> on 2016-04-26 Reviewed by Mark Lam. Very silly bug: GetByVal on Undecided uses its children before the speculationCheck(). If we fail the speculation, we have already lost how to recover the values. The existing tests did not catch this because we tier up to B3 before such Exits happen. B3 has explicit liveness and did not suffer from this bug. The new test has a smaller warmup to exercise the OSR Exit in DFG instead of FTL. * dfg/DFGSpeculativeJIT64.cpp: (JSC::DFG::SpeculativeJIT::compile): * tests/stress/get-by-val-on-undecided-out-of-bounds.js: Added. (string_appeared_here.opaqueGetByValKnownArray): Canonical link: https://commits.webkit.org/175168@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@200113 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
with
45 additions
and 3 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
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
@@ -0,0 +1,20 @@ | ||
"use strict" | ||
|
||
function opaqueGetByValKnownArray(value) | ||
{ | ||
let array = []; | ||
return array[value]; | ||
} | ||
noInline(opaqueGetByValKnownArray); | ||
|
||
// Warm up without out-of-bounds access. | ||
for (let i = 0; i < 1e3; ++i) { | ||
if (opaqueGetByValKnownArray(0) !== undefined) | ||
throw "Failed opaqueGetByValKnownArray(0)"; | ||
} | ||
|
||
// Then access out of bounds. | ||
for (let i = 0; i < 1e3; ++i) { | ||
if (opaqueGetByValKnownArray(-1) !== undefined) | ||
throw "Failed opaqueGetByValKnownArray(-1)"; | ||
} |