Branch: refs/heads/main Home: https://github.com/WebKit/WebKit Commit: 5fc313f94632beae308222510df47f48b9e6b866 https://github.com/WebKit/WebKit/commit/5fc313f94632beae308222510df47f48b9e6b866 Author: Tadeu Zagallo <tzaga...@apple.com> Date: 2023-02-23 (Thu, 23 Feb 2023)
Changed paths: M JSTests/stress/call-link-info-osrexit-repatch.js A JSTests/stress/hoisted-eval-different-scope.js M Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp M Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h Log Message: ----------- [JSC] Avoid saving top-level scope for non-module code https://bugs.webkit.org/show_bug.cgi?id=252674 rdar://105732218 Reviewed by Yusuke Suzuki. Avoid allocating a local variable and moving the scope to save the top-level scope. Re-loading the context is pretty cheap and this reduces the amount of bytecode overhead for small functions. Notice that we still allocate a variable for module code, which is necessary since we allocate a lexical environment, which needs the scope for variable resolution. * JSTests/stress/hoisted-eval-different-scope.js: Added. (i.with.g): (i.g.f): (i.g): * Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp: (JSC::BytecodeGenerator::BytecodeGenerator): (JSC::BytecodeGenerator::emitResolveScopeForHoistingFuncDeclInEval): (JSC::BytecodeGenerator::allocateAndEmitScope): (JSC::BytecodeGenerator::restoreScopeRegister): Canonical link: https://commits.webkit.org/260743@main _______________________________________________ webkit-changes mailing list webkit-changes@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-changes