Branch: refs/heads/main Home: https://github.com/WebKit/WebKit Commit: 76811693b10007dba19a08e3395e0c072c4bc0be https://github.com/WebKit/WebKit/commit/76811693b10007dba19a08e3395e0c072c4bc0be Author: Alexey Shvayka <ashva...@apple.com> Date: 2024-02-28 (Wed, 28 Feb 2024)
Changed paths: M JSTests/microbenchmarks/default-value-destructuring-array.js R JSTests/microbenchmarks/destructuring-array-literal.js M JSTests/microbenchmarks/destructuring-swap.js M JSTests/test262/expectations.yaml M Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp M Source/JavaScriptCore/parser/Nodes.h Log Message: ----------- [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 To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications _______________________________________________ webkit-changes mailing list webkit-changes@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-changes