Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge r228401 - DFG::emitCodeToGetArgumentsArrayLength needs to handl…
…e NewArrayBuffer/PhantomNewArrayBuffer https://bugs.webkit.org/show_bug.cgi?id=182706 <rdar://problem/36833681> Reviewed by Filip Pizlo. JSTests: * stress/get-array-length-phantom-new-array-buffer.js: Added. (effects): (foo): Source/JavaScriptCore: When we added support for PhantomNewArrayBuffer, we forgot to update the emitCodeToGetArgumentsArrayLength function to handle PhantomNewArrayBuffer. This patch adds that support. It's trivial to generate the length for a PhantomNewArrayBuffer node since it's a constant buffer, with a constant length. * dfg/DFGArgumentsUtilities.cpp: (JSC::DFG::emitCodeToGetArgumentsArrayLength):
- Loading branch information
1 parent
c8be3d9
commit 3c984f5
Showing
4 changed files
with
51 additions
and
2 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
14 changes: 14 additions & 0 deletions
14
JSTests/stress/get-array-length-phantom-new-array-buffer.js
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,14 @@ | ||
function effects() {} | ||
noInline(effects); | ||
|
||
function foo() { | ||
let x = [1,2,3]; | ||
effects(); | ||
return x.length; | ||
} | ||
noInline(foo); | ||
|
||
for (let i = 0; i < 100000; ++i) { | ||
if (foo() !== 3) | ||
throw new Error(); | ||
} |
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