-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Array iterator creation intrinsics need ToThis
https://bugs.webkit.org/show_bug.cgi?id=263408 rdar://113898245 Reviewed by Yusuke Suzuki. Currently, we don't ToThis the 'this' value when we intrinsicify the various Array iterator creation functions, which we should. This patch also changes `clobbersExitState` to say exit state is not clobbered if a node only writes to `HeapObjectCount`. Our previous behavior was overly conservative, which caused assertion failures as the `ToObject` following the `ToThis` would get converted to a `Check(Object)` when exit was invalid. * JSTests/stress/array-iterator-to-this.js: Added. (opt): (main): * Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::handleIntrinsicCall): * Source/JavaScriptCore/dfg/DFGClobbersExitState.cpp: (JSC::DFG::clobbersExitState): Originally-landed-as: 267815.357@safari-7617-branch (ae764a8). rdar://119597428 Canonical link: https://commits.webkit.org/272163@main
- Loading branch information
1 parent
7b97f35
commit ecb7da6
Showing
3 changed files
with
33 additions
and
5 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 @@ | ||
function opt(f, length = 5) { | ||
(function () { | ||
f; | ||
length; | ||
})(); | ||
|
||
return f(); | ||
} | ||
|
||
function main() { | ||
opt(function () {}); | ||
|
||
for (let i = 0; i < 10000; i++) { | ||
let threw = false; | ||
try { | ||
const iterator = opt(Array.prototype.keys); | ||
print([...iterator]); | ||
} catch { | ||
threw = true; | ||
} | ||
|
||
if (!threw) | ||
throw new Error(); | ||
} | ||
} | ||
|
||
main(); |
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