Skip to content

Conversation

@bnoordhuis
Copy link
Contributor

We were emitting a gob of inefficient bytecode that created an arguments array on the stack, then applied it to the parent constructor.

Add a new opcode for initializing a derived class. Speeds up construction by 500%, although sadly that is not visible in the web-tooling-benchmark, only in microbenchmarks.

Fixes: #752

@bnoordhuis
Copy link
Contributor Author

Amusingly, the abort happens right in the code we were discussing the other day in #782 because sf->cur_pc is not set. What are the odds? :)

We were emitting a gob of inefficient bytecode that created an arguments
array on the stack, then applied it to the parent constructor.

Add a new opcode for initializing a derived class. Speeds up construction
by 500%, although sadly that is not visible in the web-tooling-benchmark,
only in microbenchmarks.

Fixes: quickjs-ng#752
@bnoordhuis bnoordhuis merged commit 5b609f1 into quickjs-ng:master Jan 5, 2025
59 checks passed
@bnoordhuis bnoordhuis deleted the fix752 branch January 5, 2025 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inefficient bytecode for constructor-less ES6 child classes

2 participants