-
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.
[JSC] Remove ArrayPatternNode::emitDirectBinding()
https://bugs.webkit.org/show_bug.cgi?id=187085 <rdar://problem/121959952> Reviewed by Yusuke Suzuki. This patch removes special bytecode generation path for code like `[a, b] = [b, a]` that wasn't spec-compliant: it skipped invocation of iterator protocol, which was observable when built-ins like `Array.prototype[Symbol.iterator]` were modified. There is no way to guard the special code path with some sort of built-ins check without bloating the bytecode size: we would still need to emit regular iterator protocol code, which actually isn't even slower after DFG / FTL, as demonstated by existing microbenchmark. Only very obscure / synthetic tests are recorded to be slower after this change. This patch was A/B tested not to affect JS3, SP2, and SP3. Aligns JSC with the spec, V8, and SpiderMonkey. ToT patch destructuring-swap 53.4546+-0.1895 ^ 51.3538+-0.2101 ^ definitely 1.0409x faster default-value-destructuring-array 36.5455+-0.4078 ! 105.0089+-0.4452 ! definitely 2.8734x slower * JSTests/microbenchmarks/default-value-destructuring-array.js: * JSTests/microbenchmarks/destructuring-array-literal.js: Removed, it was very synthetic test targeting emitDirectBinding(). * JSTests/microbenchmarks/destructuring-swap.js: * JSTests/test262/expectations.yaml: Mark 24 tests as passing. * Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp: (JSC::DestructuringAssignmentNode::emitBytecode): (JSC::ArrayPatternNode::emitDirectBinding): Deleted. * Source/JavaScriptCore/parser/Nodes.h: (JSC::DestructuringPatternNode::isRestParameter const): (JSC::DestructuringPatternNode::emitDirectBinding): Deleted. Canonical link: https://commits.webkit.org/275474@main
- Loading branch information
Alexey Shvayka
committed
Feb 29, 2024
1 parent
3ab87dc
commit 7681169
Showing
6 changed files
with
5 additions
and
90 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 was deleted.
Oops, something went wrong.
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
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