Open
Conversation
Inline immediately invoked function expressions (IIFEs) at compile time, eliminating function object allocation, call frame creation, and environment setup overhead. Supports arrow functions and function expressions with simple parameters, handling expression bodies, void/side-effect bodies (no return), and bodies with a trailing return. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Skip frame creation for empty functions (e.g., `function f() {}`) by
detecting them at compile time and using CallValue::Complete at runtime,
similar to native function calls.
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Skip frame creation for empty constructors (e.g., `function Foo() {}`)
that have no fields or private methods and are not derived. Creates the
object and returns it directly via CallValue::Complete, avoiding the
full frame push/pop cycle.
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Test262 conformance changes
Tested main commit: |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4918 +/- ##
===========================================
+ Coverage 47.24% 58.05% +10.80%
===========================================
Files 476 558 +82
Lines 46892 61174 +14282
===========================================
+ Hits 22154 35514 +13360
- Misses 24738 25660 +922 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…ions Functions with var-scoped declarations (hoisted functions, var statements) or Annex B block-scoped function declarations require function_declaration_instantiation setup that IIFE inlining skips. Add checks for both to prevent incorrect inlining. Fixes 417 test262 regressions in annexB/language/function-code/. Co-Authored-By: Claude Opus 4.6 <[email protected]>
The `arguments` object is created by function_declaration_instantiation which IIFE inlining skips. Functions that access `arguments` must not be inlined. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Function expressions have their own `this` binding which differs from the caller's. Reject inlining when the body references `this`, when the function's strictness differs from the caller, and when call arguments contain spread syntax (which the inliner cannot handle). Co-Authored-By: Claude Opus 4.6 <[email protected]>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
3 optimizations:
Inline immediately invoked function expressions (IIFEs) at compile time,
eliminating function object allocation, call frame creation, and
environment setup overhead. Supports arrow functions and function
expressions with simple parameters, handling expression bodies,
void/side-effect bodies (no return), and bodies with a trailing return.
Skip frame creation for empty functions (e.g.,
function f() {}) bydetecting them at compile time and using CallValue::Complete at runtime,
similar to native function calls.
Skip frame creation for empty constructors (e.g.,
function Foo() {})that have no fields or private methods and are not derived. Creates the
object and returns it directly via CallValue::Complete, avoiding the
full frame push/pop cycle.
This brings the
call.jsbenchmark to within 1.9x of QuickJS: