Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - Refactor the environment for runtime performance #1829

Closed
wants to merge 7 commits into from

Conversation

raskad
Copy link
Member

@raskad raskad commented Feb 8, 2022

This is an attempt to refactor the environments to be more performant at runtime. The idea is, to shift the dynamic hashmap environment lookups from runtime to compile time.

Currently the environments hold hashmaps that contain binding identifiers, values and additional information that is needed to identify some errors. Because bindings in outer environments are accessible from inner environments, this can lead to a traversal through all environments (in the worst case to the global environment).

This change to the environment structure pushes most of the work that is needed to access bindings to the compile time. At compile time, environments and bindings in the environments are being assigned indices. These indices are then stored instead of the Sym that is currently used to access bindings. At runtime, the indices are used to access bindings in a fixed size Vec per environment. This brings multiple benefits:

Additionally, this changes the global object to have it's bindings directly stored on the Realm. This should reduce some overhead from access trough gc objects and makes some optimizations for the global object possible.

The benchmarks look not that great on the first sight. But if you look closer, I think it is apparent, that this is a positive change. The difference is most apparent on Mini and Clean as they are longer (still not near any real life js but less specific that most other benchmarks):

Test Base PR %
Clean js (Compiler) 1929.1±5.37ns 4.1±0.02µs +112.53%
Clean js (Execution) 1487.4±7.50µs 987.3±3.78µs -33.62%

The compile time is up in all benchmarks, as expected. The percentage is huge, but if we look at the real numbers, we can see that this is an issue of orders of magnitude. While compile is up 112.53%, the real change is ~+2µs. Execution is only down 33.62%, but the real time changed by ~-500µs.

@github-actions
Copy link

github-actions bot commented Feb 8, 2022

Test262 conformance changes

VM implementation

Test result main count PR count difference
Total 87,912 87,912 0
Passed 40,956 41,366 +410
Ignored 21,153 21,153 0
Failed 25,803 25,393 -410
Panics 0 0 0
Conformance 46.59% 47.05% +0.47%
Fixed tests (490):
test/language/expressions/object/scope-meth-paramsbody-var-open.js [strict mode] (previously Failed)
test/language/expressions/object/scope-meth-paramsbody-var-open.js (previously Failed)
test/language/expressions/object/scope-setter-paramsbody-var-open.js [strict mode] (previously Failed)
test/language/expressions/object/scope-setter-paramsbody-var-open.js (previously Failed)
test/language/expressions/object/method-definition/meth-dflt-params-ref-later.js [strict mode] (previously Failed)
test/language/expressions/object/method-definition/meth-dflt-params-ref-later.js (previously Failed)
test/language/expressions/object/method-definition/meth-dflt-params-ref-self.js [strict mode] (previously Failed)
test/language/expressions/object/method-definition/meth-dflt-params-ref-self.js (previously Failed)
test/language/expressions/object/method-definition/meth-dflt-params-abrupt.js [strict mode] (previously Failed)
test/language/expressions/object/method-definition/meth-dflt-params-abrupt.js (previously Failed)
test/language/expressions/object/dstr/meth-dflt-obj-ptrn-prop-obj-value-null.js [strict mode] (previously Failed)
test/language/expressions/object/dstr/meth-dflt-obj-ptrn-prop-obj-value-null.js (previously Failed)
test/language/expressions/object/dstr/meth-dflt-obj-ptrn-list-err.js [strict mode] (previously Failed)
test/language/expressions/object/dstr/meth-dflt-obj-ptrn-list-err.js (previously Failed)
test/language/expressions/object/dstr/meth-dflt-obj-ptrn-id-init-unresolvable.js [strict mode] (previously Failed)
test/language/expressions/object/dstr/meth-dflt-obj-ptrn-id-init-unresolvable.js (previously Failed)
test/language/expressions/object/dstr/meth-dflt-obj-ptrn-prop-id-get-value-err.js [strict mode] (previously Failed)
test/language/expressions/object/dstr/meth-dflt-obj-ptrn-prop-id-get-value-err.js (previously Failed)
test/language/expressions/object/dstr/meth-dflt-obj-init-null.js [strict mode] (previously Failed)
test/language/expressions/object/dstr/meth-dflt-obj-init-null.js (previously Failed)
test/language/expressions/object/dstr/meth-dflt-obj-init-undefined.js [strict mode] (previously Failed)
test/language/expressions/object/dstr/meth-dflt-obj-init-undefined.js (previously Failed)
test/language/expressions/object/dstr/meth-dflt-obj-ptrn-prop-id-init-throws.js [strict mode] (previously Failed)
test/language/expressions/object/dstr/meth-dflt-obj-ptrn-prop-id-init-throws.js (previously Failed)
test/language/expressions/object/dstr/meth-dflt-obj-ptrn-prop-id-init-unresolvable.js [strict mode] (previously Failed)
test/language/expressions/object/dstr/meth-dflt-obj-ptrn-prop-id-init-unresolvable.js (previously Failed)
test/language/expressions/object/dstr/meth-dflt-obj-ptrn-prop-obj-value-undef.js [strict mode] (previously Failed)
test/language/expressions/object/dstr/meth-dflt-obj-ptrn-prop-obj-value-undef.js (previously Failed)
test/language/expressions/object/dstr/meth-dflt-obj-ptrn-prop-ary-value-null.js [strict mode] (previously Failed)
test/language/expressions/object/dstr/meth-dflt-obj-ptrn-prop-ary-value-null.js (previously Failed)
test/language/expressions/object/dstr/meth-dflt-obj-ptrn-id-get-value-err.js [strict mode] (previously Failed)
test/language/expressions/object/dstr/meth-dflt-obj-ptrn-id-get-value-err.js (previously Failed)
test/language/expressions/object/dstr/meth-dflt-obj-ptrn-id-init-throws.js [strict mode] (previously Failed)
test/language/expressions/object/dstr/meth-dflt-obj-ptrn-id-init-throws.js (previously Failed)
test/language/expressions/call/scope-var-open.js [strict mode] (previously Failed)
test/language/expressions/call/scope-var-open.js (previously Failed)
test/language/expressions/assignment/S11.13.1_A2.1_T1.js [strict mode] (previously Failed)
test/language/expressions/function/dflt-params-abrupt.js [strict mode] (previously Failed)
test/language/expressions/function/dflt-params-abrupt.js (previously Failed)
test/language/expressions/function/scope-paramsbody-var-open.js [strict mode] (previously Failed)
test/language/expressions/function/scope-paramsbody-var-open.js (previously Failed)
test/language/expressions/function/dflt-params-ref-later.js [strict mode] (previously Failed)
test/language/expressions/function/dflt-params-ref-later.js (previously Failed)
test/language/expressions/function/dflt-params-ref-self.js [strict mode] (previously Failed)
test/language/expressions/function/dflt-params-ref-self.js (previously Failed)
test/language/expressions/function/dstr/dflt-obj-ptrn-prop-ary-value-null.js [strict mode] (previously Failed)
test/language/expressions/function/dstr/dflt-obj-ptrn-prop-ary-value-null.js (previously Failed)
test/language/expressions/function/dstr/dflt-obj-ptrn-id-init-unresolvable.js [strict mode] (previously Failed)
test/language/expressions/function/dstr/dflt-obj-ptrn-id-init-unresolvable.js (previously Failed)
test/language/expressions/function/dstr/dflt-obj-init-undefined.js [strict mode] (previously Failed)
test/language/expressions/function/dstr/dflt-obj-init-undefined.js (previously Failed)
test/language/expressions/function/dstr/dflt-obj-init-null.js [strict mode] (previously Failed)
test/language/expressions/function/dstr/dflt-obj-init-null.js (previously Failed)
test/language/expressions/function/dstr/dflt-obj-ptrn-prop-id-get-value-err.js [strict mode] (previously Failed)
test/language/expressions/function/dstr/dflt-obj-ptrn-prop-id-get-value-err.js (previously Failed)
test/language/expressions/function/dstr/dflt-obj-ptrn-id-get-value-err.js [strict mode] (previously Failed)
test/language/expressions/function/dstr/dflt-obj-ptrn-id-get-value-err.js (previously Failed)
test/language/expressions/function/dstr/dflt-obj-ptrn-prop-id-init-throws.js [strict mode] (previously Failed)
test/language/expressions/function/dstr/dflt-obj-ptrn-prop-id-init-throws.js (previously Failed)
test/language/expressions/function/dstr/dflt-obj-ptrn-prop-obj-value-undef.js [strict mode] (previously Failed)
test/language/expressions/function/dstr/dflt-obj-ptrn-prop-obj-value-undef.js (previously Failed)
test/language/expressions/function/dstr/dflt-obj-ptrn-prop-id-init-unresolvable.js [strict mode] (previously Failed)
test/language/expressions/function/dstr/dflt-obj-ptrn-prop-id-init-unresolvable.js (previously Failed)
test/language/expressions/function/dstr/dflt-obj-ptrn-list-err.js [strict mode] (previously Failed)
test/language/expressions/function/dstr/dflt-obj-ptrn-list-err.js (previously Failed)
test/language/expressions/function/dstr/dflt-obj-ptrn-prop-obj-value-null.js [strict mode] (previously Failed)
test/language/expressions/function/dstr/dflt-obj-ptrn-prop-obj-value-null.js (previously Failed)
test/language/expressions/function/dstr/dflt-obj-ptrn-id-init-throws.js [strict mode] (previously Failed)
test/language/expressions/function/dstr/dflt-obj-ptrn-id-init-throws.js (previously Failed)
test/language/expressions/instanceof/S15.3.5.3_A1_T8.js [strict mode] (previously Failed)
test/language/expressions/instanceof/S15.3.5.3_A1_T8.js (previously Failed)
test/language/function-code/10.4.3-1-87gs.js (previously Failed)
test/language/function-code/10.4.3-1-91-s.js (previously Failed)
test/language/function-code/10.4.3-1-101-s.js (previously Failed)
test/language/function-code/10.4.3-1-95gs.js (previously Failed)
test/language/function-code/10.4.3-1-86gs.js (previously Failed)
test/language/function-code/10.4.3-1-3-s.js (previously Failed)
test/language/function-code/10.4.3-1-92gs.js (previously Failed)
test/language/function-code/10.4.3-1-90gs.js (previously Failed)
test/language/function-code/10.4.3-1-95-s.js (previously Failed)
test/language/function-code/10.4.3-1-86-s.js (previously Failed)
test/language/function-code/10.4.3-1-97gs.js (previously Failed)
test/language/function-code/10.4.3-1-96-s.js (previously Failed)
test/language/function-code/10.4.3-1-97-s.js (previously Failed)
test/language/function-code/10.4.3-1-87-s.js (previously Failed)
test/language/function-code/10.4.3-1-101gs.js (previously Failed)
test/language/function-code/10.4.3-1-91gs.js (previously Failed)
test/language/function-code/10.4.3-1-85gs.js (previously Failed)
test/language/function-code/10.4.3-1-96gs.js (previously Failed)
test/language/function-code/10.4.3-1-85-s.js (previously Failed)
test/language/function-code/10.4.3-1-90-s.js (previously Failed)
test/language/function-code/10.4.3-1-92-s.js (previously Failed)
test/language/directive-prologue/14.1-6-s.js (previously Failed)
test/language/directive-prologue/14.1-16-s.js (previously Failed)
test/language/directive-prologue/14.1-3-s.js (previously Failed)
test/language/directive-prologue/14.1-7-s.js (previously Failed)
test/language/directive-prologue/14.1-17-s.js (previously Failed)
test/language/types/object/S8.6.2_A5_T3.js [strict mode] (previously Failed)
test/language/types/object/S8.6.2_A5_T3.js (previously Failed)
test/language/types/boolean/S8.3_A1_T1.js [strict mode] (previously Failed)
test/language/types/boolean/S8.3_A1_T1.js (previously Failed)
test/language/global-code/decl-lex-restricted-global.js [strict mode] (previously Failed)
test/language/global-code/decl-lex-restricted-global.js (previously Failed)
test/language/statements/variable/S14_A1.js [strict mode] (previously Failed)
test/language/statements/variable/S14_A1.js (previously Failed)
test/language/statements/variable/S12.2_A10.js [strict mode] (previously Failed)
test/language/statements/variable/S12.2_A10.js (previously Failed)
test/language/statements/variable/S12.2_A4.js [strict mode] (previously Failed)
test/language/statements/variable/S12.2_A4.js (previously Failed)
test/language/statements/variable/S12.2_A6_T1.js [strict mode] (previously Failed)
test/language/statements/variable/S12.2_A6_T1.js (previously Failed)
test/language/statements/variable/S12.2_A6_T2.js [strict mode] (previously Failed)
test/language/statements/variable/S12.2_A6_T2.js (previously Failed)
test/language/statements/variable/S12.2_A3.js [strict mode] (previously Failed)
test/language/statements/variable/S12.2_A3.js (previously Failed)
test/language/statements/variable/S12.2_A7.js [strict mode] (previously Failed)
test/language/statements/variable/S12.2_A7.js (previously Failed)
test/language/statements/variable/S12.2_A12.js [strict mode] (previously Failed)
test/language/statements/variable/S12.2_A12.js (previously Failed)
test/language/statements/variable/S12.2_A1.js [strict mode] (previously Failed)
test/language/statements/variable/S12.2_A1.js (previously Failed)
test/language/statements/generators/invoke-as-constructor.js [strict mode] (previously Failed)
test/language/statements/generators/invoke-as-constructor.js (previously Failed)
test/language/statements/generators/dstr/dflt-obj-ptrn-prop-ary-value-null.js [strict mode] (previously Failed)
test/language/statements/generators/dstr/dflt-obj-ptrn-prop-ary-value-null.js (previously Failed)
test/language/statements/generators/dstr/obj-ptrn-prop-ary-value-null.js [strict mode] (previously Failed)
test/language/statements/generators/dstr/obj-ptrn-prop-ary-value-null.js (previously Failed)
test/language/statements/generators/dstr/ary-ptrn-elem-obj-val-null.js [strict mode] (previously Failed)
test/language/statements/generators/dstr/ary-ptrn-elem-obj-val-null.js (previously Failed)
test/language/statements/generators/dstr/dflt-obj-init-undefined.js [strict mode] (previously Failed)
test/language/statements/generators/dstr/dflt-obj-init-undefined.js (previously Failed)
test/language/statements/generators/dstr/obj-ptrn-prop-obj-value-undef.js [strict mode] (previously Failed)
test/language/statements/generators/dstr/obj-ptrn-prop-obj-value-undef.js (previously Failed)
test/language/statements/generators/dstr/ary-ptrn-elem-obj-val-undef.js [strict mode] (previously Failed)
test/language/statements/generators/dstr/ary-ptrn-elem-obj-val-undef.js (previously Failed)
test/language/statements/generators/dstr/dflt-obj-init-null.js [strict mode] (previously Failed)
test/language/statements/generators/dstr/dflt-obj-init-null.js (previously Failed)
test/language/statements/generators/dstr/ary-init-iter-get-err-array-prototype.js [strict mode] (previously Failed)
test/language/statements/generators/dstr/ary-init-iter-get-err-array-prototype.js (previously Failed)
test/language/statements/generators/dstr/dflt-obj-ptrn-prop-obj-value-undef.js [strict mode] (previously Failed)
test/language/statements/generators/dstr/dflt-obj-ptrn-prop-obj-value-undef.js (previously Failed)
test/language/statements/generators/dstr/obj-init-undefined.js [strict mode] (previously Failed)
test/language/statements/generators/dstr/obj-init-undefined.js (previously Failed)
test/language/statements/generators/dstr/obj-init-null.js [strict mode] (previously Failed)
test/language/statements/generators/dstr/obj-init-null.js (previously Failed)
test/language/statements/generators/dstr/dflt-obj-ptrn-prop-obj-value-null.js [strict mode] (previously Failed)
test/language/statements/generators/dstr/dflt-obj-ptrn-prop-obj-value-null.js (previously Failed)
test/language/statements/generators/dstr/obj-ptrn-prop-obj-value-null.js [strict mode] (previously Failed)
test/language/statements/generators/dstr/obj-ptrn-prop-obj-value-null.js (previously Failed)
test/language/statements/generators/dstr/ary-ptrn-elem-ary-val-null.js [strict mode] (previously Failed)
test/language/statements/generators/dstr/ary-ptrn-elem-ary-val-null.js (previously Failed)
test/language/statements/async-generator/dstr/dflt-obj-ptrn-prop-ary-value-null.js [strict mode] (previously Failed)
test/language/statements/async-generator/dstr/dflt-obj-ptrn-prop-ary-value-null.js (previously Failed)
test/language/statements/async-generator/dstr/obj-ptrn-prop-ary-value-null.js [strict mode] (previously Failed)
test/language/statements/async-generator/dstr/obj-ptrn-prop-ary-value-null.js (previously Failed)
test/language/statements/async-generator/dstr/ary-ptrn-elem-obj-val-null.js [strict mode] (previously Failed)
test/language/statements/async-generator/dstr/ary-ptrn-elem-obj-val-null.js (previously Failed)
test/language/statements/async-generator/dstr/dflt-obj-init-undefined.js [strict mode] (previously Failed)
test/language/statements/async-generator/dstr/dflt-obj-init-undefined.js (previously Failed)
test/language/statements/async-generator/dstr/obj-ptrn-prop-obj-value-undef.js [strict mode] (previously Failed)
test/language/statements/async-generator/dstr/obj-ptrn-prop-obj-value-undef.js (previously Failed)
test/language/statements/async-generator/dstr/ary-ptrn-elem-obj-val-undef.js [strict mode] (previously Failed)
test/language/statements/async-generator/dstr/ary-ptrn-elem-obj-val-undef.js (previously Failed)
test/language/statements/async-generator/dstr/dflt-obj-init-null.js [strict mode] (previously Failed)
test/language/statements/async-generator/dstr/dflt-obj-init-null.js (previously Failed)
test/language/statements/async-generator/dstr/ary-init-iter-get-err-array-prototype.js [strict mode] (previously Failed)
test/language/statements/async-generator/dstr/ary-init-iter-get-err-array-prototype.js (previously Failed)
test/language/statements/async-generator/dstr/dflt-obj-ptrn-prop-obj-value-undef.js [strict mode] (previously Failed)
test/language/statements/async-generator/dstr/dflt-obj-ptrn-prop-obj-value-undef.js (previously Failed)
test/language/statements/async-generator/dstr/obj-init-undefined.js [strict mode] (previously Failed)
test/language/statements/async-generator/dstr/obj-init-undefined.js (previously Failed)
test/language/statements/async-generator/dstr/obj-init-null.js [strict mode] (previously Failed)
test/language/statements/async-generator/dstr/obj-init-null.js (previously Failed)
test/language/statements/async-generator/dstr/dflt-obj-ptrn-prop-obj-value-null.js [strict mode] (previously Failed)
test/language/statements/async-generator/dstr/dflt-obj-ptrn-prop-obj-value-null.js (previously Failed)
test/language/statements/async-generator/dstr/obj-ptrn-prop-obj-value-null.js [strict mode] (previously Failed)
test/language/statements/async-generator/dstr/obj-ptrn-prop-obj-value-null.js (previously Failed)
test/language/statements/async-generator/dstr/ary-ptrn-elem-ary-val-null.js [strict mode] (previously Failed)
test/language/statements/async-generator/dstr/ary-ptrn-elem-ary-val-null.js (previously Failed)
test/language/statements/continue/S12.7_A9_T2.js [strict mode] (previously Failed)
test/language/statements/continue/S12.7_A9_T2.js (previously Failed)
test/language/statements/continue/shadowing-loop-variable-in-same-scope-as-continue.js [strict mode] (previously Failed)
test/language/statements/continue/shadowing-loop-variable-in-same-scope-as-continue.js (previously Failed)
test/language/statements/continue/S12.7_A9_T1.js [strict mode] (previously Failed)
test/language/statements/continue/S12.7_A9_T1.js (previously Failed)
test/language/statements/switch/scope-lex-const.js [strict mode] (previously Failed)
test/language/statements/switch/scope-lex-const.js (previously Failed)
test/language/statements/switch/scope-lex-close-case.js [strict mode] (previously Failed)
test/language/statements/switch/scope-lex-close-case.js (previously Failed)
test/language/statements/switch/scope-lex-open-dflt.js [strict mode] (previously Failed)
test/language/statements/switch/scope-lex-open-dflt.js (previously Failed)
test/language/statements/for/S12.6.3_A13.js [strict mode] (previously Failed)
test/language/statements/for/S12.6.3_A13.js (previously Failed)
test/language/statements/for/head-let-destructuring.js [strict mode] (previously Failed)
test/language/statements/for/head-let-destructuring.js (previously Failed)
test/language/statements/for/S12.6.3_A10.1_T2.js [strict mode] (previously Failed)
test/language/statements/for/S12.6.3_A10.1_T2.js (previously Failed)
test/language/statements/for/S12.6.3_A10.1_T1.js (previously Failed)
test/language/statements/for/S12.6.3_A2.js [strict mode] (previously Failed)
test/language/statements/for/S12.6.3_A2.js (previously Failed)
test/language/statements/for/S12.6.3_A10_T1.js (previously Failed)
test/language/statements/for/S12.6.3_A10_T2.js [strict mode] (previously Failed)
test/language/statements/for/S12.6.3_A10_T2.js (previously Failed)
test/language/statements/let/global-closure-set-before-initialization.js (previously Failed)
test/language/statements/let/block-local-closure-set-before-initialization.js (previously Failed)
test/language/statements/let/function-local-closure-set-before-initialization.js (previously Failed)
test/language/statements/function/S13_A17_T2.js [strict mode] (previously Failed)
test/language/statements/function/S13_A17_T2.js (previously Failed)
test/language/statements/function/S13_A15_T4.js (previously Failed)
test/language/statements/function/dflt-params-abrupt.js [strict mode] (previously Failed)
test/language/statements/function/dflt-params-abrupt.js (previously Failed)
test/language/statements/function/S13_A17_T1.js [strict mode] (previously Failed)
test/language/statements/function/S13_A17_T1.js (previously Failed)
test/language/statements/function/scope-paramsbody-var-open.js [strict mode] (previously Failed)
test/language/statements/function/scope-paramsbody-var-open.js (previously Failed)
test/language/statements/function/dflt-params-ref-later.js [strict mode] (previously Failed)
test/language/statements/function/dflt-params-ref-later.js (previously Failed)
test/language/statements/function/dflt-params-ref-self.js [strict mode] (previously Failed)
test/language/statements/function/dflt-params-ref-self.js (previously Failed)
test/language/statements/function/dstr/dflt-obj-ptrn-prop-ary-value-null.js [strict mode] (previously Failed)
test/language/statements/function/dstr/dflt-obj-ptrn-prop-ary-value-null.js (previously Failed)
test/language/statements/function/dstr/dflt-obj-ptrn-id-init-unresolvable.js [strict mode] (previously Failed)
test/language/statements/function/dstr/dflt-obj-ptrn-id-init-unresolvable.js (previously Failed)
test/language/statements/function/dstr/dflt-obj-init-undefined.js [strict mode] (previously Failed)
test/language/statements/function/dstr/dflt-obj-init-undefined.js (previously Failed)
test/language/statements/function/dstr/dflt-obj-init-null.js [strict mode] (previously Failed)
test/language/statements/function/dstr/dflt-obj-init-null.js (previously Failed)
test/language/statements/function/dstr/dflt-obj-ptrn-prop-id-get-value-err.js [strict mode] (previously Failed)
test/language/statements/function/dstr/dflt-obj-ptrn-prop-id-get-value-err.js (previously Failed)
test/language/statements/function/dstr/dflt-obj-ptrn-id-get-value-err.js [strict mode] (previously Failed)
test/language/statements/function/dstr/dflt-obj-ptrn-id-get-value-err.js (previously Failed)
test/language/statements/function/dstr/dflt-obj-ptrn-prop-id-init-throws.js [strict mode] (previously Failed)
test/language/statements/function/dstr/dflt-obj-ptrn-prop-id-init-throws.js (previously Failed)
test/language/statements/function/dstr/dflt-obj-ptrn-prop-obj-value-undef.js [strict mode] (previously Failed)
test/language/statements/function/dstr/dflt-obj-ptrn-prop-obj-value-undef.js (previously Failed)
test/language/statements/function/dstr/dflt-obj-ptrn-prop-id-init-unresolvable.js [strict mode] (previously Failed)
test/language/statements/function/dstr/dflt-obj-ptrn-prop-id-init-unresolvable.js (previously Failed)
test/language/statements/function/dstr/dflt-obj-ptrn-list-err.js [strict mode] (previously Failed)
test/language/statements/function/dstr/dflt-obj-ptrn-list-err.js (previously Failed)
test/language/statements/function/dstr/dflt-obj-ptrn-prop-obj-value-null.js [strict mode] (previously Failed)
test/language/statements/function/dstr/dflt-obj-ptrn-prop-obj-value-null.js (previously Failed)
test/language/statements/function/dstr/dflt-obj-ptrn-id-init-throws.js [strict mode] (previously Failed)
test/language/statements/function/dstr/dflt-obj-ptrn-id-init-throws.js (previously Failed)
test/language/statements/do-while/S12.6.1_A4_T2.js [strict mode] (previously Failed)
test/language/statements/do-while/S12.6.1_A4_T2.js (previously Failed)
test/language/statements/do-while/S12.6.1_A4_T4.js [strict mode] (previously Failed)
test/language/statements/do-while/S12.6.1_A4_T4.js (previously Failed)
test/language/statements/do-while/S12.6.1_A4_T3.js [strict mode] (previously Failed)
test/language/statements/do-while/S12.6.1_A4_T3.js (previously Failed)
test/language/statements/const/dstr/obj-ptrn-rest-getter.js [strict mode] (previously Failed)
test/language/statements/const/dstr/obj-ptrn-rest-getter.js (previously Failed)
test/language/statements/while/S12.6.2_A9.js [strict mode] (previously Failed)
test/language/statements/while/S12.6.2_A9.js (previously Failed)
test/language/statements/while/S12.6.2_A4_T2.js [strict mode] (previously Failed)
test/language/statements/while/S12.6.2_A4_T2.js (previously Failed)
test/language/statements/while/S12.6.2_A4_T4.js [strict mode] (previously Failed)
test/language/statements/while/S12.6.2_A4_T4.js (previously Failed)
test/language/statements/while/S12.6.2_A4_T3.js [strict mode] (previously Failed)
test/language/statements/while/S12.6.2_A4_T3.js (previously Failed)
test/language/statements/try/scope-catch-block-lex-open.js [strict mode] (previously Failed)
test/language/statements/try/scope-catch-block-lex-open.js (previously Failed)
test/language/block-scope/leave/finally-block-let-declaration-only-shadows-outer-parameter-value-2.js [strict mode] (previously Failed)
test/language/block-scope/leave/finally-block-let-declaration-only-shadows-outer-parameter-value-2.js (previously Failed)
test/language/block-scope/leave/for-loop-block-let-declaration-only-shadows-outer-parameter-value-2.js [strict mode] (previously Failed)
test/language/block-scope/leave/for-loop-block-let-declaration-only-shadows-outer-parameter-value-2.js (previously Failed)
test/language/block-scope/leave/verify-context-in-for-loop-block.js [strict mode] (previously Failed)
test/language/block-scope/leave/verify-context-in-for-loop-block.js (previously Failed)
test/language/block-scope/leave/try-block-let-declaration-only-shadows-outer-parameter-value-2.js [strict mode] (previously Failed)
test/language/block-scope/leave/try-block-let-declaration-only-shadows-outer-parameter-value-2.js (previously Failed)
test/language/block-scope/leave/for-loop-block-let-declaration-only-shadows-outer-parameter-value-1.js [strict mode] (previously Failed)
test/language/block-scope/leave/for-loop-block-let-declaration-only-shadows-outer-parameter-value-1.js (previously Failed)
test/built-ins/global/global-object.js [strict mode] (previously Failed)
test/built-ins/global/global-object.js (previously Failed)
test/built-ins/Map/proto-from-ctor-realm.js [strict mode] (previously Failed)
test/built-ins/Map/proto-from-ctor-realm.js (previously Failed)
test/built-ins/Map/prototype/forEach/callback-this-non-strict.js (previously Failed)
test/built-ins/Array/proto-from-ctor-realm-two.js [strict mode] (previously Failed)
test/built-ins/Array/proto-from-ctor-realm-two.js (previously Failed)
test/built-ins/Array/proto-from-ctor-realm-zero.js [strict mode] (previously Failed)
test/built-ins/Array/proto-from-ctor-realm-zero.js (previously Failed)
test/built-ins/Array/proto-from-ctor-realm-one.js [strict mode] (previously Failed)
test/built-ins/Array/proto-from-ctor-realm-one.js (previously Failed)
test/built-ins/Array/prototype/flatMap/depth-always-one.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/flatMap/depth-always-one.js (previously Failed)
test/built-ins/Array/prototype/forEach/15.4.4.18-5-25.js (previously Failed)
test/built-ins/Array/prototype/forEach/15.4.4.18-5-1.js (previously Failed)
test/built-ins/Array/prototype/findLastIndex/predicate-call-this-non-strict.js (previously Failed)
test/built-ins/Array/prototype/every/15.4.4.16-5-1.js (previously Failed)
test/built-ins/Array/prototype/filter/15.4.4.20-5-1.js (previously Failed)
test/built-ins/Array/prototype/filter/15.4.4.20-5-30.js (previously Failed)
test/built-ins/Array/prototype/findLast/predicate-call-this-non-strict.js (previously Failed)
test/built-ins/Array/prototype/map/15.4.4.19-5-1.js (previously Failed)
test/built-ins/Array/prototype/some/15.4.4.17-5-1.js (previously Failed)
test/built-ins/Array/prototype/some/15.4.4.17-5-25.js (previously Failed)
test/built-ins/Array/prototype/find/predicate-call-this-non-strict.js (previously Failed)
test/built-ins/Array/prototype/findIndex/predicate-call-this-non-strict.js (previously Failed)
test/built-ins/Reflect/getOwnPropertyDescriptor/return-from-data-descriptor.js [strict mode] (previously Failed)
test/built-ins/Reflect/getOwnPropertyDescriptor/return-from-data-descriptor.js (previously Failed)
test/built-ins/Reflect/getOwnPropertyDescriptor/return-from-accessor-descriptor.js [strict mode] (previously Failed)
test/built-ins/Reflect/getOwnPropertyDescriptor/return-from-accessor-descriptor.js (previously Failed)
test/built-ins/Reflect/getOwnPropertyDescriptor/symbol-property.js [strict mode] (previously Failed)
test/built-ins/Reflect/getOwnPropertyDescriptor/symbol-property.js (previously Failed)
test/built-ins/Number/proto-from-ctor-realm.js [strict mode] (previously Failed)
test/built-ins/Number/proto-from-ctor-realm.js (previously Failed)
test/built-ins/Object/S15.2.2.1_A1_T5.js [strict mode] (previously Failed)
test/built-ins/Object/S15.2.2.1_A1_T5.js (previously Failed)
test/built-ins/Object/proto-from-ctor-realm.js [strict mode] (previously Failed)
test/built-ins/Object/proto-from-ctor-realm.js (previously Failed)
test/built-ins/Object/fromEntries/evaluation-order.js [strict mode] (previously Failed)
test/built-ins/Object/fromEntries/evaluation-order.js (previously Failed)
test/built-ins/Proxy/get-fn-realm-recursive.js [strict mode] (previously Failed)
test/built-ins/Proxy/get-fn-realm-recursive.js (previously Failed)
test/built-ins/Proxy/get-fn-realm.js [strict mode] (previously Failed)
test/built-ins/Proxy/get-fn-realm.js (previously Failed)
test/built-ins/Proxy/construct/trap-is-undefined-proto-from-newtarget-realm.js [strict mode] (previously Failed)
test/built-ins/Proxy/construct/trap-is-undefined-proto-from-newtarget-realm.js (previously Failed)
test/built-ins/DataView/proto-from-ctor-realm.js [strict mode] (previously Failed)
test/built-ins/DataView/proto-from-ctor-realm.js (previously Failed)
test/built-ins/Error/proto-from-ctor-realm.js [strict mode] (previously Failed)
test/built-ins/Error/proto-from-ctor-realm.js (previously Failed)
test/built-ins/TypedArray/prototype/reduce/callbackfn-this.js (previously Failed)
test/built-ins/TypedArray/prototype/reduce/BigInt/callbackfn-this.js (previously Failed)
test/built-ins/TypedArray/prototype/forEach/callbackfn-this.js (previously Failed)
test/built-ins/TypedArray/prototype/forEach/BigInt/callbackfn-this.js (previously Failed)
test/built-ins/TypedArray/prototype/reduceRight/callbackfn-this.js (previously Failed)
test/built-ins/TypedArray/prototype/reduceRight/BigInt/callbackfn-this.js (previously Failed)
test/built-ins/TypedArray/prototype/every/callbackfn-this.js (previously Failed)
test/built-ins/TypedArray/prototype/every/BigInt/callbackfn-this.js (previously Failed)
test/built-ins/TypedArray/prototype/filter/callbackfn-this.js (previously Failed)
test/built-ins/TypedArray/prototype/filter/BigInt/callbackfn-this.js (previously Failed)
test/built-ins/TypedArray/prototype/sort/comparefn-calls.js (previously Failed)
test/built-ins/TypedArray/prototype/sort/BigInt/comparefn-calls.js (previously Failed)
test/built-ins/TypedArray/prototype/map/callbackfn-this.js (previously Failed)
test/built-ins/TypedArray/prototype/map/BigInt/callbackfn-this.js (previously Failed)
test/built-ins/TypedArray/prototype/some/callbackfn-this.js (previously Failed)
test/built-ins/TypedArray/prototype/some/BigInt/callbackfn-this.js (previously Failed)
test/built-ins/TypedArray/prototype/find/predicate-call-this-non-strict.js (previously Failed)
test/built-ins/TypedArray/prototype/find/BigInt/predicate-call-this-non-strict.js (previously Failed)
test/built-ins/TypedArray/prototype/findIndex/predicate-call-this-non-strict.js (previously Failed)
test/built-ins/TypedArray/prototype/findIndex/BigInt/predicate-call-this-non-strict.js (previously Failed)
test/built-ins/TypedArrayConstructors/from/custom-ctor.js [strict mode] (previously Failed)
test/built-ins/TypedArrayConstructors/from/custom-ctor.js (previously Failed)
test/built-ins/TypedArrayConstructors/from/mapfn-this-without-thisarg-non-strict.js (previously Failed)
test/built-ins/TypedArrayConstructors/from/BigInt/custom-ctor.js [strict mode] (previously Failed)
test/built-ins/TypedArrayConstructors/from/BigInt/custom-ctor.js (previously Failed)
test/built-ins/TypedArrayConstructors/from/BigInt/mapfn-this-without-thisarg-non-strict.js (previously Failed)
test/built-ins/TypedArrayConstructors/ctors-bigint/no-args/proto-from-ctor-realm.js [strict mode] (previously Failed)
test/built-ins/TypedArrayConstructors/ctors-bigint/no-args/proto-from-ctor-realm.js (previously Failed)
test/built-ins/TypedArrayConstructors/ctors-bigint/object-arg/proto-from-ctor-realm.js [strict mode] (previously Failed)
test/built-ins/TypedArrayConstructors/ctors-bigint/object-arg/proto-from-ctor-realm.js (previously Failed)
test/built-ins/TypedArrayConstructors/ctors-bigint/length-arg/proto-from-ctor-realm.js [strict mode] (previously Failed)
test/built-ins/TypedArrayConstructors/ctors-bigint/length-arg/proto-from-ctor-realm.js (previously Failed)
test/built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/proto-from-ctor-realm.js [strict mode] (previously Failed)
test/built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/proto-from-ctor-realm.js (previously Failed)
test/built-ins/TypedArrayConstructors/ctors-bigint/typedarray-arg/other-ctor-buffer-ctor-custom-species-proto-from-ctor-realm.js [strict mode] (previously Failed)
test/built-ins/TypedArrayConstructors/ctors-bigint/typedarray-arg/other-ctor-buffer-ctor-custom-species-proto-from-ctor-realm.js (previously Failed)
test/built-ins/TypedArrayConstructors/ctors-bigint/typedarray-arg/same-ctor-buffer-ctor-species-custom-proto-from-ctor-realm.js [strict mode] (previously Failed)
test/built-ins/TypedArrayConstructors/ctors-bigint/typedarray-arg/same-ctor-buffer-ctor-species-custom-proto-from-ctor-realm.js (previously Failed)
test/built-ins/TypedArrayConstructors/ctors-bigint/typedarray-arg/proto-from-ctor-realm.js [strict mode] (previously Failed)
test/built-ins/TypedArrayConstructors/ctors-bigint/typedarray-arg/proto-from-ctor-realm.js (previously Failed)
test/built-ins/TypedArrayConstructors/ctors/no-args/proto-from-ctor-realm.js [strict mode] (previously Failed)
test/built-ins/TypedArrayConstructors/ctors/no-args/proto-from-ctor-realm.js (previously Failed)
test/built-ins/TypedArrayConstructors/ctors/object-arg/proto-from-ctor-realm.js [strict mode] (previously Failed)
test/built-ins/TypedArrayConstructors/ctors/object-arg/proto-from-ctor-realm.js (previously Failed)
test/built-ins/TypedArrayConstructors/ctors/length-arg/proto-from-ctor-realm.js [strict mode] (previously Failed)
test/built-ins/TypedArrayConstructors/ctors/length-arg/proto-from-ctor-realm.js (previously Failed)
test/built-ins/TypedArrayConstructors/ctors/buffer-arg/proto-from-ctor-realm.js [strict mode] (previously Failed)
test/built-ins/TypedArrayConstructors/ctors/buffer-arg/proto-from-ctor-realm.js (previously Failed)
test/built-ins/TypedArrayConstructors/ctors/typedarray-arg/other-ctor-buffer-ctor-custom-species-proto-from-ctor-realm.js [strict mode] (previously Failed)
test/built-ins/TypedArrayConstructors/ctors/typedarray-arg/other-ctor-buffer-ctor-custom-species-proto-from-ctor-realm.js (previously Failed)
test/built-ins/TypedArrayConstructors/ctors/typedarray-arg/same-ctor-buffer-ctor-species-custom-proto-from-ctor-realm.js [strict mode] (previously Failed)
test/built-ins/TypedArrayConstructors/ctors/typedarray-arg/same-ctor-buffer-ctor-species-custom-proto-from-ctor-realm.js (previously Failed)
test/built-ins/TypedArrayConstructors/ctors/typedarray-arg/proto-from-ctor-realm.js [strict mode] (previously Failed)
test/built-ins/TypedArrayConstructors/ctors/typedarray-arg/proto-from-ctor-realm.js (previously Failed)
test/built-ins/TypedArrayConstructors/of/custom-ctor.js [strict mode] (previously Failed)
test/built-ins/TypedArrayConstructors/of/custom-ctor.js (previously Failed)
test/built-ins/TypedArrayConstructors/of/BigInt/custom-ctor.js [strict mode] (previously Failed)
test/built-ins/TypedArrayConstructors/of/BigInt/custom-ctor.js (previously Failed)
test/built-ins/Set/proto-from-ctor-realm.js [strict mode] (previously Failed)
test/built-ins/Set/proto-from-ctor-realm.js (previously Failed)
test/built-ins/ArrayBuffer/proto-from-ctor-realm.js [strict mode] (previously Failed)
test/built-ins/ArrayBuffer/proto-from-ctor-realm.js (previously Failed)
test/built-ins/Function/S15.3.2.1_A3_T14.js [strict mode] (previously Failed)
test/built-ins/Function/S15.3.2.1_A3_T14.js (previously Failed)
test/built-ins/Function/S15.3.2.1_A1_T4.js [strict mode] (previously Failed)
test/built-ins/Function/S15.3.2.1_A1_T4.js (previously Failed)
test/built-ins/Function/proto-from-ctor-realm.js [strict mode] (previously Failed)
test/built-ins/Function/proto-from-ctor-realm.js (previously Failed)
test/built-ins/Function/prototype/apply/S15.3.4.3_A3_T8.js (previously Failed)
test/built-ins/Function/prototype/apply/argarray-not-object-realm.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/apply/argarray-not-object-realm.js (previously Failed)
test/built-ins/Function/prototype/apply/S15.3.4.3_A3_T6.js (previously Failed)
test/built-ins/Function/prototype/apply/this-not-callable-realm.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/apply/this-not-callable-realm.js (previously Failed)
test/built-ins/Function/prototype/apply/S15.3.4.3_A5_T4.js (previously Failed)
test/built-ins/Function/prototype/bind/get-fn-realm-recursive.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/get-fn-realm-recursive.js (previously Failed)
test/built-ins/Function/prototype/bind/proto-from-ctor-realm.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/proto-from-ctor-realm.js (previously Failed)
test/built-ins/Function/prototype/call/S15.3.4.4_A3_T8.js (previously Failed)
test/built-ins/Function/prototype/call/S15.3.4.4_A5_T4.js (previously Failed)
test/built-ins/Function/prototype/call/S15.3.4.4_A3_T6.js (previously Failed)
test/built-ins/Boolean/S15.6.1.1_A1_T4.js [strict mode] (previously Failed)
test/built-ins/Boolean/S15.6.1.1_A1_T4.js (previously Failed)
test/built-ins/Boolean/proto-from-ctor-realm.js [strict mode] (previously Failed)
test/built-ins/Boolean/proto-from-ctor-realm.js (previously Failed)
test/built-ins/RegExp/S15.10.4.1_A1_T2.js [strict mode] (previously Failed)
test/built-ins/RegExp/S15.10.4.1_A1_T2.js (previously Failed)
test/built-ins/RegExp/proto-from-ctor-realm.js [strict mode] (previously Failed)
test/built-ins/RegExp/proto-from-ctor-realm.js (previously Failed)
test/built-ins/RegExp/S15.10.4.1_A3_T3.js [strict mode] (previously Failed)
test/built-ins/RegExp/S15.10.4.1_A3_T3.js (previously Failed)
test/built-ins/RegExp/prototype/test/S15.10.6.3_A1_T20.js [strict mode] (previously Failed)
test/built-ins/RegExp/prototype/test/S15.10.6.3_A1_T20.js (previously Failed)
test/built-ins/RegExp/prototype/exec/S15.10.6.2_A1_T20.js [strict mode] (previously Failed)
test/built-ins/RegExp/prototype/exec/S15.10.6.2_A1_T20.js (previously Failed)
test/built-ins/RegExp/prototype/exec/S15.10.6.2_A4_T5.js [strict mode] (previously Failed)
test/built-ins/RegExp/prototype/exec/S15.10.6.2_A4_T5.js (previously Failed)
test/built-ins/RegExp/prototype/Symbol.replace/fn-invoke-this-no-strict.js (previously Failed)
test/built-ins/String/S15.5.1.1_A1_T5.js [strict mode] (previously Failed)
test/built-ins/String/S15.5.1.1_A1_T5.js (previously Failed)
test/built-ins/String/proto-from-ctor-realm.js [strict mode] (previously Failed)
test/built-ins/String/proto-from-ctor-realm.js (previously Failed)
test/built-ins/String/S15.5.1.1_A1_T9.js [strict mode] (previously Failed)
test/built-ins/String/S15.5.1.1_A1_T9.js (previously Failed)
test/built-ins/String/prototype/slice/S15.5.4.13_A1_T6.js [strict mode] (previously Failed)
test/built-ins/String/prototype/slice/S15.5.4.13_A1_T6.js (previously Failed)
test/built-ins/String/prototype/slice/S15.5.4.13_A1_T2.js [strict mode] (previously Failed)
test/built-ins/String/prototype/slice/S15.5.4.13_A1_T2.js (previously Failed)
test/built-ins/String/prototype/indexOf/S15.5.4.7_A1_T6.js [strict mode] (previously Failed)
test/built-ins/String/prototype/indexOf/S15.5.4.7_A1_T6.js (previously Failed)
test/built-ins/String/prototype/charCodeAt/S15.5.4.5_A1_T6.js [strict mode] (previously Failed)
test/built-ins/String/prototype/charCodeAt/S15.5.4.5_A1_T6.js (previously Failed)
test/built-ins/String/prototype/toString/non-generic-realm.js [strict mode] (previously Failed)
test/built-ins/String/prototype/toString/non-generic-realm.js (previously Failed)
test/built-ins/String/prototype/replace/S15.5.4.11_A1_T10.js [strict mode] (previously Failed)
test/built-ins/String/prototype/replace/S15.5.4.11_A1_T10.js (previously Failed)
test/built-ins/String/prototype/replace/15.5.4.11-1.js (previously Failed)
test/built-ins/String/prototype/replace/S15.5.4.11_A1_T2.js [strict mode] (previously Failed)
test/built-ins/String/prototype/replace/S15.5.4.11_A1_T2.js (previously Failed)
test/built-ins/String/prototype/replace/S15.5.4.11_A1_T17.js [strict mode] (previously Failed)
test/built-ins/String/prototype/replace/S15.5.4.11_A1_T17.js (previously Failed)
test/built-ins/String/prototype/concat/S15.5.4.6_A4_T1.js [strict mode] (previously Failed)
test/built-ins/String/prototype/concat/S15.5.4.6_A4_T1.js (previously Failed)
test/built-ins/String/prototype/concat/S15.5.4.6_A4_T2.js [strict mode] (previously Failed)
test/built-ins/String/prototype/concat/S15.5.4.6_A4_T2.js (previously Failed)
test/built-ins/String/prototype/concat/S15.5.4.6_A1_T10.js [strict mode] (previously Failed)
test/built-ins/String/prototype/concat/S15.5.4.6_A1_T10.js (previously Failed)
test/built-ins/String/prototype/concat/S15.5.4.6_A1_T6.js [strict mode] (previously Failed)
test/built-ins/String/prototype/concat/S15.5.4.6_A1_T6.js (previously Failed)
test/built-ins/String/prototype/lastIndexOf/S15.5.4.8_A1_T6.js [strict mode] (previously Failed)
test/built-ins/String/prototype/lastIndexOf/S15.5.4.8_A1_T6.js (previously Failed)
test/built-ins/String/prototype/substring/S15.5.4.15_A1_T2.js [strict mode] (previously Failed)
test/built-ins/String/prototype/substring/S15.5.4.15_A1_T2.js (previously Failed)
test/built-ins/String/prototype/substring/S15.5.4.15_A1_T6.js [strict mode] (previously Failed)
test/built-ins/String/prototype/substring/S15.5.4.15_A1_T6.js (previously Failed)
test/built-ins/String/prototype/match/S15.5.4.10_A1_T6.js [strict mode] (previously Failed)
test/built-ins/String/prototype/match/S15.5.4.10_A1_T6.js (previously Failed)
test/built-ins/String/prototype/search/S15.5.4.12_A1_T6.js [strict mode] (previously Failed)
test/built-ins/String/prototype/search/S15.5.4.12_A1_T6.js (previously Failed)
test/built-ins/String/prototype/charAt/S15.5.4.4_A1_T6.js [strict mode] (previously Failed)
test/built-ins/String/prototype/charAt/S15.5.4.4_A1_T6.js (previously Failed)
test/built-ins/JSON/stringify/value-bigint-cross-realm.js [strict mode] (previously Failed)
test/built-ins/JSON/stringify/value-bigint-cross-realm.js (previously Failed)
test/annexB/language/function-code/if-decl-else-decl-a-func-skip-early-err-switch.js (previously Failed)
test/annexB/language/function-code/block-decl-func-skip-early-err-for.js (previously Failed)
test/annexB/language/function-code/if-decl-else-decl-a-func-skip-early-err-for.js (previously Failed)
test/annexB/language/function-code/if-decl-no-else-func-skip-early-err-for.js (previously Failed)
test/annexB/language/function-code/switch-case-func-skip-early-err-switch.js (previously Failed)
test/annexB/language/function-code/if-decl-else-decl-b-func-skip-early-err-switch.js (previously Failed)
test/annexB/language/function-code/if-decl-else-decl-b-func-skip-early-err-for.js (previously Failed)
test/annexB/language/function-code/switch-dflt-func-skip-early-err-for.js (previously Failed)
test/annexB/language/function-code/switch-dflt-func-skip-early-err-switch.js (previously Failed)
test/annexB/language/function-code/if-decl-no-else-func-skip-early-err-switch.js (previously Failed)
test/annexB/language/function-code/if-decl-else-stmt-func-skip-early-err-for.js (previously Failed)
test/annexB/language/function-code/switch-case-func-skip-early-err-for.js (previously Failed)
test/annexB/language/function-code/if-decl-else-stmt-func-skip-early-err-switch.js (previously Failed)
test/annexB/language/function-code/if-stmt-else-decl-func-skip-early-err-switch.js (previously Failed)
test/annexB/language/function-code/block-decl-func-skip-early-err-switch.js (previously Failed)
test/annexB/language/function-code/if-stmt-else-decl-func-skip-early-err-for.js (previously Failed)
test/annexB/language/global-code/if-decl-else-decl-a-global-existing-block-fn-no-init.js (previously Failed)
test/annexB/language/global-code/switch-dflt-global-existing-block-fn-no-init.js (previously Failed)
test/annexB/language/global-code/block-decl-global-existing-block-fn-no-init.js (previously Failed)
test/annexB/language/global-code/if-stmt-else-decl-global-existing-block-fn-no-init.js (previously Failed)
test/annexB/language/global-code/if-decl-no-else-global-existing-block-fn-no-init.js (previously Failed)
test/annexB/language/global-code/switch-case-global-existing-block-fn-no-init.js (previously Failed)
test/annexB/language/global-code/if-decl-else-stmt-global-existing-block-fn-no-init.js (previously Failed)
test/annexB/language/global-code/if-decl-else-decl-b-global-existing-block-fn-no-init.js (previously Failed)
test/intl402/Intl/getCanonicalLocales/transformed-ext-valid.js [strict mode] (previously Failed)
test/intl402/Intl/getCanonicalLocales/transformed-ext-valid.js (previously Failed)
Broken tests (80):
test/language/directive-prologue/14.1-14-s.js (previously Passed)
test/language/directive-prologue/14.1-8-s.js (previously Passed)
test/language/statements/generators/dflt-params-ref-later.js [strict mode] (previously Passed)
test/language/statements/generators/dflt-params-ref-later.js (previously Passed)
test/language/statements/generators/dflt-params-ref-self.js [strict mode] (previously Passed)
test/language/statements/generators/dflt-params-ref-self.js (previously Passed)
test/language/statements/generators/dstr/ary-ptrn-elem-id-init-unresolvable.js [strict mode] (previously Passed)
test/language/statements/generators/dstr/ary-ptrn-elem-id-init-unresolvable.js (previously Passed)
test/language/statements/generators/dstr/dflt-obj-ptrn-id-init-unresolvable.js [strict mode] (previously Passed)
test/language/statements/generators/dstr/dflt-obj-ptrn-id-init-unresolvable.js (previously Passed)
test/language/statements/generators/dstr/obj-ptrn-id-init-unresolvable.js [strict mode] (previously Passed)
test/language/statements/generators/dstr/obj-ptrn-id-init-unresolvable.js (previously Passed)
test/language/statements/generators/dstr/dflt-obj-ptrn-prop-id-init-unresolvable.js [strict mode] (previously Passed)
test/language/statements/generators/dstr/dflt-obj-ptrn-prop-id-init-unresolvable.js (previously Passed)
test/language/statements/generators/dstr/obj-ptrn-prop-id-init-unresolvable.js [strict mode] (previously Passed)
test/language/statements/generators/dstr/obj-ptrn-prop-id-init-unresolvable.js (previously Passed)
test/language/statements/async-generator/dflt-params-ref-later.js [strict mode] (previously Passed)
test/language/statements/async-generator/dflt-params-ref-later.js (previously Passed)
test/language/statements/async-generator/dflt-params-ref-self.js [strict mode] (previously Passed)
test/language/statements/async-generator/dflt-params-ref-self.js (previously Passed)
test/language/statements/async-generator/dstr/ary-ptrn-elem-id-init-unresolvable.js [strict mode] (previously Passed)
test/language/statements/async-generator/dstr/ary-ptrn-elem-id-init-unresolvable.js (previously Passed)
test/language/statements/async-generator/dstr/dflt-obj-ptrn-id-init-unresolvable.js [strict mode] (previously Passed)
test/language/statements/async-generator/dstr/dflt-obj-ptrn-id-init-unresolvable.js (previously Passed)
test/language/statements/async-generator/dstr/obj-ptrn-id-init-unresolvable.js [strict mode] (previously Passed)
test/language/statements/async-generator/dstr/obj-ptrn-id-init-unresolvable.js (previously Passed)
test/language/statements/async-generator/dstr/dflt-obj-ptrn-prop-id-init-unresolvable.js [strict mode] (previously Passed)
test/language/statements/async-generator/dstr/dflt-obj-ptrn-prop-id-init-unresolvable.js (previously Passed)
test/language/statements/async-generator/dstr/obj-ptrn-prop-id-init-unresolvable.js [strict mode] (previously Passed)
test/language/statements/async-generator/dstr/obj-ptrn-prop-id-init-unresolvable.js (previously Passed)
test/language/statements/switch/scope-lex-async-function.js [strict mode] (previously Passed)
test/language/statements/switch/scope-lex-async-function.js (previously Passed)
test/language/statements/switch/scope-lex-generator.js [strict mode] (previously Passed)
test/language/statements/switch/scope-lex-generator.js (previously Passed)
test/language/statements/switch/scope-lex-async-generator.js [strict mode] (previously Passed)
test/language/statements/switch/scope-lex-async-generator.js (previously Passed)
test/language/statements/try/S12.14_A12_T2.js [strict mode] (previously Passed)
test/language/statements/try/S12.14_A12_T2.js (previously Passed)
test/built-ins/Object/defineProperties/15.2.3.7-6-a-24.js [strict mode] (previously Passed)
test/built-ins/Object/defineProperties/15.2.3.7-6-a-24.js (previously Passed)
test/built-ins/Object/defineProperties/15.2.3.7-2-18.js [strict mode] (previously Passed)
test/built-ins/Object/defineProperties/15.2.3.7-2-18.js (previously Passed)
test/built-ins/Symbol/for/cross-realm.js [strict mode] (previously Passed)
test/built-ins/Symbol/for/cross-realm.js (previously Passed)
test/built-ins/Symbol/keyFor/cross-realm.js [strict mode] (previously Passed)
test/built-ins/Symbol/keyFor/cross-realm.js (previously Passed)
test/annexB/language/global-code/block-decl-global-skip-early-err-for-in.js (previously Passed)
test/annexB/language/global-code/if-decl-else-decl-a-global-skip-early-err-block.js (previously Passed)
test/annexB/language/global-code/if-stmt-else-decl-global-skip-early-err-for-in.js (previously Passed)
test/annexB/language/global-code/if-decl-else-decl-b-global-skip-early-err-for-of.js (previously Passed)
test/annexB/language/global-code/if-decl-else-stmt-global-skip-early-err-for-in.js (previously Passed)
test/annexB/language/global-code/if-decl-no-else-global-skip-early-err-try.js (previously Passed)
test/annexB/language/global-code/if-decl-else-decl-b-global-skip-early-err-try.js (previously Passed)
test/annexB/language/global-code/block-decl-global-skip-early-err-block.js (previously Passed)
test/annexB/language/global-code/if-stmt-else-decl-global-skip-early-err-for-of.js (previously Passed)
test/annexB/language/global-code/if-decl-else-stmt-global-skip-early-err-block.js (previously Passed)
test/annexB/language/global-code/if-decl-no-else-global-skip-early-err-block.js (previously Passed)
test/annexB/language/global-code/if-decl-else-decl-b-global-skip-early-err-for-in.js (previously Passed)
test/annexB/language/global-code/block-decl-global-skip-early-err-try.js (previously Passed)
test/annexB/language/global-code/block-decl-global-skip-early-err-for-of.js (previously Passed)
test/annexB/language/global-code/if-decl-else-stmt-global-skip-early-err-for-of.js (previously Passed)
test/annexB/language/global-code/switch-dflt-global-skip-early-err-try.js (previously Passed)
test/annexB/language/global-code/if-decl-else-decl-a-global-skip-early-err-for-of.js (previously Passed)
test/annexB/language/global-code/switch-case-global-skip-early-err-block.js (previously Passed)
test/annexB/language/global-code/if-decl-no-else-global-skip-early-err-for-in.js (previously Passed)
test/annexB/language/global-code/switch-dflt-global-skip-early-err-for-in.js (previously Passed)
test/annexB/language/global-code/if-decl-else-stmt-global-skip-early-err-try.js (previously Passed)
test/annexB/language/global-code/switch-dflt-global-skip-early-err-for-of.js (previously Passed)
test/annexB/language/global-code/switch-case-global-skip-early-err-for-in.js (previously Passed)
test/annexB/language/global-code/switch-case-global-skip-early-err-try.js (previously Passed)
test/annexB/language/global-code/if-decl-no-else-global-skip-early-err-for-of.js (previously Passed)
test/annexB/language/global-code/if-decl-else-decl-a-global-skip-early-err-for-in.js (previously Passed)
test/annexB/language/global-code/if-stmt-else-decl-global-skip-early-err-try.js (previously Passed)
test/annexB/language/global-code/if-decl-else-decl-b-global-skip-early-err-block.js (previously Passed)
test/annexB/language/global-code/if-decl-else-decl-a-global-skip-early-err-try.js (previously Passed)
test/annexB/language/global-code/switch-dflt-global-skip-early-err-block.js (previously Passed)
test/annexB/language/global-code/switch-case-global-skip-early-err-for-of.js (previously Passed)
test/annexB/language/global-code/if-stmt-else-decl-global-skip-early-err-block.js (previously Passed)
test/harness/assert-throws-same-realm.js [strict mode] (previously Passed)
test/harness/assert-throws-same-realm.js (previously Passed)

@codecov
Copy link

codecov bot commented Feb 8, 2022

Codecov Report

Merging #1829 (ae4242e) into main (4a33d20) will decrease coverage by 0.03%.
The diff coverage is 59.09%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1829      +/-   ##
==========================================
- Coverage   55.60%   55.57%   -0.04%     
==========================================
  Files         201      199       -2     
  Lines       17397    17756     +359     
==========================================
+ Hits         9674     9868     +194     
- Misses       7723     7888     +165     
Impacted Files Coverage Δ
boa/src/builtins/function/mod.rs 33.33% <ø> (ø)
boa/src/class.rs 0.00% <0.00%> (ø)
boa/src/lib.rs 87.09% <ø> (ø)
boa/src/object/internal_methods/mod.rs 62.50% <ø> (ø)
boa/src/object/mod.rs 29.09% <ø> (ø)
boa/src/object/property_map.rs 40.90% <0.00%> (-1.28%) ⬇️
boa/src/profiler.rs 0.00% <ø> (ø)
boa/src/vm/opcode.rs 28.57% <ø> (ø)
boa_tester/src/exec/js262.rs 0.00% <ø> (ø)
boa/src/object/internal_methods/global.rs 32.14% <32.14%> (ø)
... and 21 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4a33d20...ae4242e. Read the comment docs.

@github-actions
Copy link

github-actions bot commented Feb 8, 2022

Benchmark for c004eaa

Click to view benchmark
Test Base PR %
Arithmetic operations (Compiler) 344.4±0.63ns 460.0±1.38ns +33.57%
Arithmetic operations (Execution) 2.0±0.00µs 1795.5±8.59ns -10.22%
Arithmetic operations (Parser) 5.5±0.01µs 5.6±0.01µs +1.82%
Array access (Compiler) 828.1±2.76ns 1278.3±4.60ns +54.37%
Array access (Execution) 9.2±0.05µs 10.4±0.07µs +13.04%
Array access (Parser) 10.6±0.02µs 12.1±0.01µs +14.15%
Array creation (Compiler) 1162.3±3.84ns 2.1±0.01µs +80.68%
Array creation (Execution) 2.8±0.01ms 3.2±0.00ms +14.29%
Array creation (Parser) 11.8±0.03µs 13.8±0.02µs +16.95%
Array pop (Compiler) 3.0±0.01µs 3.7±0.01µs +23.33%
Array pop (Execution) 1207.8±13.70µs 1375.5±9.36µs +13.88%
Array pop (Parser) 136.0±0.12µs 136.7±0.08µs +0.51%
Boolean Object Access (Compiler) 601.2±1.84ns 1143.1±3.66ns +90.14%
Boolean Object Access (Execution) 6.9±0.10µs 5.6±0.01µs -18.84%
Boolean Object Access (Parser) 12.4±0.01µs 14.4±0.02µs +16.13%
Clean js (Compiler) 1929.1±5.37ns 4.1±0.02µs +112.53%
Clean js (Execution) 1487.4±7.50µs 987.3±3.78µs -33.62%
Clean js (Parser) 25.2±0.03µs 30.0±0.03µs +19.05%
Create Realm 329.4±3.08ns 514.5±0.56ns +56.19%
Dynamic Object Property Access (Compiler) 1014.8±3.69ns 1625.9±3.37ns +60.22%
Dynamic Object Property Access (Execution) 6.8±0.03µs 7.0±0.04µs +2.94%
Dynamic Object Property Access (Parser) 9.5±0.02µs 10.7±0.01µs +12.63%
Fibonacci (Compiler) 1277.8±4.81ns 2.5±0.00µs +95.65%
Fibonacci (Execution) 2.5±0.00ms 2.7±0.00ms +8.00%
Fibonacci (Parser) 14.0±0.03µs 16.5±0.02µs +17.86%
For loop (Compiler) 1122.2±1.92ns 2.3±0.00µs +104.95%
For loop (Execution) 38.8±0.11µs 44.0±0.24µs +13.40%
For loop (Parser) 13.7±0.03µs 14.4±0.03µs +5.11%
Mini js (Compiler) 1903.0±8.70ns 3.7±0.01µs +94.43%
Mini js (Execution) 1217.9±21.70µs 902.3±5.38µs -25.91%
Mini js (Parser) 21.9±0.02µs 26.0±0.04µs +18.72%
Number Object Access (Compiler) 646.6±1.04ns 1058.2±3.12ns +63.66%
Number Object Access (Execution) 5.3±0.01µs 3.9±0.01µs -26.42%
Number Object Access (Parser) 9.7±0.02µs 11.4±0.02µs +17.53%
Object Creation (Compiler) 839.6±3.28ns 1420.4±3.04ns +69.18%
Object Creation (Execution) 5.5±0.01µs 6.4±0.03µs +16.36%
Object Creation (Parser) 8.2±0.02µs 9.3±0.02µs +13.41%
RegExp (Compiler) 1127.6±3.37ns 1636.5±4.51ns +45.13%
RegExp (Execution) 11.6±0.03µs 13.0±0.03µs +12.07%
RegExp (Parser) 9.0±0.01µs 10.3±0.02µs +14.44%
RegExp Creation (Compiler) 905.5±2.45ns 1428.7±3.40ns +57.78%
RegExp Creation (Execution) 8.7±0.03µs 9.7±0.02µs +11.49%
RegExp Creation (Parser) 7.5±0.01µs 8.6±0.01µs +14.67%
RegExp Literal (Compiler) 996.3±5.54ns 1640.3±3.63ns +64.64%
RegExp Literal (Execution) 11.7±0.07µs 12.9±0.04µs +10.26%
RegExp Literal (Parser) 7.2±0.02µs 8.3±0.02µs +15.28%
RegExp Literal Creation (Compiler) 911.1±2.40ns 1446.7±6.19ns +58.79%
RegExp Literal Creation (Execution) 8.7±0.04µs 9.7±0.02µs +11.49%
RegExp Literal Creation (Parser) 5.7±0.01µs 6.5±0.02µs +14.04%
Static Object Property Access (Compiler) 858.3±2.29ns 1439.3±4.32ns +67.69%
Static Object Property Access (Execution) 5.7±0.01µs 6.6±0.05µs +15.79%
Static Object Property Access (Parser) 8.8±0.02µs 9.9±0.02µs +12.50%
String Object Access (Compiler) 896.1±2.34ns 1486.9±5.06ns +65.93%
String Object Access (Execution) 8.6±0.07µs 6.5±0.03µs -24.42%
String Object Access (Parser) 13.9±0.04µs 14.2±0.03µs +2.16%
String comparison (Compiler) 1138.0±2.42ns 2.1±0.01µs +84.53%
String comparison (Execution) 6.4±0.03µs 5.5±0.02µs -14.06%
String comparison (Parser) 9.6±0.03µs 11.1±0.01µs +15.63%
String concatenation (Compiler) 923.9±2.28ns 1640.5±4.97ns +77.56%
String concatenation (Execution) 6.2±0.03µs 4.9±0.01µs -20.97%
String concatenation (Parser) 7.5±0.02µs 7.8±0.02µs +4.00%
String copy (Compiler) 867.2±3.34ns 1311.5±2.41ns +51.23%
String copy (Execution) 5.3±0.02µs 5.0±0.02µs -5.66%
String copy (Parser) 5.0±0.01µs 5.8±0.01µs +16.00%
Symbols (Compiler) 567.5±0.99ns 980.4±2.57ns +72.76%
Symbols (Execution) 4.3±0.01µs 4.9±0.02µs +13.95%
Symbols (Parser) 4.4±0.01µs 4.5±0.02µs +2.27%

@raskad raskad added execution Issues or PRs related to code execution performance Performance related changes and issues labels Feb 8, 2022
Copy link
Member

@Razican Razican left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I started my review, will continue at a later time. Things are looking very, very, very good in this change! I added some comments on things where I need some background or where things could be improved, but overall, congratulations on the progress!!

Comment on lines 163 to 168
// 17. Let mappedNames be a new empty List.
// using a set to optimize `contains`
let mut mapped_names = FxHashSet::default();

// 12. Let parameterNames be the BoundNames of formals.
// 13. Let numberOfParameters be the number of elements in parameterNames.
// 18. Set index to numberOfParameters - 1.
// 19. Repeat, while index ≥ 0,
// a. Let name be parameterNames[index].
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this somehow be mapped to the code? I guess we are changing a bit the algorithm here for performance, right?

Copy link
Member Author

@raskad raskad Feb 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really performance. The spec works with identifiers (name) but we do not have identifiers at runtime anymore. We have to work with the binding indices on the environments. The argument bindings are always the first few binding in the environment and we use that to decide what indices the getters and setters should have here.

For example:

function f(a, b, c) {}
f(1,2,3)

Looks like this in the function environment:

binding index arguments property identifier value
0 arguments[0] a 1
1 arguments[1] b 2
2 arguments[2] c 3

This is pretty straightforward, but we can also have this:

function f(a, a, c, c) {}
f(1,2,3)

Which translates to:

binding index arguments property identifier value
- arguments[0] - -
0 arguments[1] a 2
- arguments[2] - -
1 arguments[3] c undefined

As you can see, we have to work out the binding index based on the number of arguments and based on the parameter names. The spec assumes, that we can just go forward trough the list of parameter names, but in addition we have to go backwards to find out the binding index (because the last one in the parameter list gets bound).

I think I will add this comment or something similar as documentation to the code to explain how this is different from the spec.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would be great, yes!!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added!

boa/src/builtins/function/arguments.rs Show resolved Hide resolved
boa/src/builtins/function/arguments.rs Outdated Show resolved Hide resolved
boa/src/builtins/function/arguments.rs Outdated Show resolved Hide resolved
boa/src/builtins/number/mod.rs Outdated Show resolved Hide resolved
boa/src/context.rs Outdated Show resolved Hide resolved
boa/src/environment/lexical_environment.rs Outdated Show resolved Hide resolved
boa/src/environment/mod.rs Outdated Show resolved Hide resolved
@github-actions
Copy link

Benchmark for 9b90817

Click to view benchmark
Test Base PR %
Arithmetic operations (Compiler) 479.4±2.79ns 558.7±3.46ns +16.54%
Arithmetic operations (Execution) 2.3±0.02µs 2.4±0.02µs +4.35%
Arithmetic operations (Parser) 6.1±0.06µs 6.1±0.04µs 0.00%
Array access (Compiler) 963.6±4.92ns 1399.3±8.13ns +45.22%
Array access (Execution) 12.3±0.10µs 12.5±0.06µs +1.63%
Array access (Parser) 13.2±0.10µs 13.1±0.07µs -0.76%
Array creation (Compiler) 1375.8±10.39ns 1985.9±14.90ns +44.35%
Array creation (Execution) 3.8±0.02ms 3.7±0.03ms -2.63%
Array creation (Parser) 14.8±0.09µs 14.7±0.13µs -0.68%
Array pop (Compiler) 3.6±0.04µs 3.9±0.04µs +8.33%
Array pop (Execution) 1638.4±8.50µs 1608.1±18.11µs -1.85%
Array pop (Parser) 156.5±1.06µs 160.1±0.77µs +2.30%
Boolean Object Access (Compiler) 784.5±4.59ns 1113.0±9.92ns +41.87%
Boolean Object Access (Execution) 8.2±0.07µs 6.7±0.05µs -18.29%
Boolean Object Access (Parser) 15.9±0.14µs 15.8±0.16µs -0.63%
Clean js (Compiler) 2.6±0.01µs 3.7±0.03µs +42.31%
Clean js (Execution) 1752.1±14.40µs 1280.2±16.67µs -26.93%
Clean js (Parser) 32.0±0.25µs 31.6±0.28µs -1.25%
Create Realm 390.6±4.00ns 318.6±1.90ns -18.43%
Dynamic Object Property Access (Compiler) 1358.0±9.25ns 1750.7±14.73ns +28.92%
Dynamic Object Property Access (Execution) 8.1±0.07µs 8.3±0.06µs +2.47%
Dynamic Object Property Access (Parser) 11.9±0.10µs 11.4±0.13µs -4.20%
Fibonacci (Compiler) 1789.6±15.34ns 2.6±0.01µs +45.28%
Fibonacci (Execution) 3.3±0.01ms 3.3±0.03ms 0.00%
Fibonacci (Parser) 17.9±0.03µs 17.6±0.13µs -1.68%
For loop (Compiler) 1501.6±9.16ns 2.1±0.02µs +39.85%
For loop (Execution) 51.9±0.19µs 50.7±0.28µs -2.31%
For loop (Parser) 15.6±0.09µs 15.1±0.11µs -3.21%
Mini js (Compiler) 2.6±0.01µs 3.7±0.03µs +42.31%
Mini js (Execution) 1608.0±14.98µs 1187.2±10.75µs -26.17%
Mini js (Parser) 27.7±0.21µs 27.4±0.19µs -1.08%
Number Object Access (Compiler) 751.2±4.32ns 1040.2±5.61ns +38.47%
Number Object Access (Execution) 6.4±0.03µs 5.3±0.03µs -17.19%
Number Object Access (Parser) 12.2±0.12µs 12.2±0.09µs 0.00%
Object Creation (Compiler) 1133.3±4.75ns 1536.6±11.80ns +35.59%
Object Creation (Execution) 7.4±0.07µs 7.5±0.03µs +1.35%
Object Creation (Parser) 10.4±0.06µs 10.0±0.09µs -3.85%
RegExp (Compiler) 1339.8±12.06ns 1777.3±15.85ns +32.65%
RegExp (Execution) 15.4±0.23µs 14.9±0.17µs -3.25%
RegExp (Parser) 11.2±0.09µs 10.8±0.12µs -3.57%
RegExp Creation (Compiler) 1224.4±7.73ns 1581.9±7.16ns +29.20%
RegExp Creation (Execution) 11.8±0.09µs 11.5±0.09µs -2.54%
RegExp Creation (Parser) 9.4±0.07µs 9.1±0.09µs -3.19%
RegExp Literal (Compiler) 1347.2±10.07ns 1824.8±13.34ns +35.45%
RegExp Literal (Execution) 15.4±0.14µs 14.8±0.13µs -3.90%
RegExp Literal (Parser) 9.1±0.08µs 8.7±0.07µs -4.40%
RegExp Literal Creation (Compiler) 1224.3±11.75ns 1567.5±10.65ns +28.03%
RegExp Literal Creation (Execution) 11.7±0.09µs 11.6±0.07µs -0.85%
RegExp Literal Creation (Parser) 7.2±0.05µs 6.8±0.08µs -5.56%
Static Object Property Access (Compiler) 1174.8±5.58ns 1545.6±9.90ns +31.56%
Static Object Property Access (Execution) 7.6±0.03µs 7.8±0.04µs +2.63%
Static Object Property Access (Parser) 11.1±0.06µs 10.7±0.08µs -3.60%
String Object Access (Compiler) 1226.1±6.59ns 1485.7±16.19ns +21.17%
String Object Access (Execution) 10.1±0.11µs 8.7±0.17µs -13.86%
String Object Access (Parser) 15.5±0.11µs 15.5±0.17µs 0.00%
String comparison (Compiler) 1537.1±11.57ns 2.3±0.02µs +49.63%
String comparison (Execution) 8.5±0.11µs 7.2±0.04µs -15.29%
String comparison (Parser) 12.2±0.11µs 11.9±0.09µs -2.46%
String concatenation (Compiler) 1259.7±6.54ns 1821.7±10.40ns +44.61%
String concatenation (Execution) 7.3±0.08µs 6.6±0.04µs -9.59%
String concatenation (Parser) 8.4±0.08µs 8.1±0.08µs -3.57%
String copy (Compiler) 1024.0±9.93ns 1396.9±13.15ns +36.42%
String copy (Execution) 6.3±0.05µs 5.9±0.07µs -6.35%
String copy (Parser) 6.2±0.04µs 6.0±0.06µs -3.23%
Symbols (Compiler) 777.6±8.14ns 991.1±6.75ns +27.46%
Symbols (Execution) 5.9±0.04µs 5.7±0.03µs -3.39%
Symbols (Parser) 4.7±0.03µs 4.5±0.02µs -4.26%

@github-actions
Copy link

Benchmark for e60e532

Click to view benchmark
Test Base PR %
Arithmetic operations (Compiler) 405.0±0.48ns 461.4±1.60ns +13.93%
Arithmetic operations (Execution) 1965.2±2.06ns 1772.8±2.39ns -9.79%
Arithmetic operations (Parser) 4.9±0.01µs 5.5±0.01µs +12.24%
Array access (Compiler) 818.2±1.97ns 1160.2±4.40ns +41.80%
Array access (Execution) 10.5±0.04µs 9.2±0.04µs -12.38%
Array access (Parser) 11.9±0.05µs 12.0±0.02µs +0.84%
Array creation (Compiler) 1164.8±3.50ns 1705.4±4.21ns +46.41%
Array creation (Execution) 3.2±0.01ms 2.8±0.00ms -12.50%
Array creation (Parser) 11.7±0.02µs 13.4±0.02µs +14.53%
Array pop (Compiler) 3.0±0.01µs 3.3±0.01µs +10.00%
Array pop (Execution) 1366.7±5.08µs 1208.6±3.14µs -11.57%
Array pop (Parser) 119.7±0.14µs 136.5±0.24µs +14.04%
Boolean Object Access (Compiler) 689.2±1.35ns 919.6±5.67ns +33.43%
Boolean Object Access (Execution) 6.9±0.02µs 5.0±0.01µs -27.54%
Boolean Object Access (Parser) 12.3±0.01µs 14.2±0.02µs +15.45%
Clean js (Compiler) 2.2±0.00µs 2.8±0.01µs +27.27%
Clean js (Execution) 1472.7±13.19µs 1078.9±5.65µs -26.74%
Clean js (Parser) 25.0±0.04µs 28.8±0.04µs +15.20%
Create Realm 331.6±3.33ns 266.3±0.32ns -19.69%
Dynamic Object Property Access (Compiler) 1163.2±3.46ns 1499.3±3.40ns +28.89%
Dynamic Object Property Access (Execution) 6.8±0.04µs 6.9±0.04µs +1.47%
Dynamic Object Property Access (Parser) 10.6±0.02µs 10.6±0.01µs 0.00%
Fibonacci (Compiler) 1457.2±4.01ns 2.2±0.01µs +50.97%
Fibonacci (Execution) 2.8±0.00ms 2.7±0.00ms -3.57%
Fibonacci (Parser) 15.9±0.03µs 16.0±0.02µs +0.63%
For loop (Compiler) 1113.3±1.99ns 1787.1±6.58ns +60.52%
For loop (Execution) 43.7±0.16µs 37.5±0.07µs -14.19%
For loop (Parser) 12.0±0.02µs 13.7±0.03µs +14.17%
Mini js (Compiler) 2.2±0.00µs 3.1±0.04µs +40.91%
Mini js (Execution) 1363.2±11.31µs 878.7±4.98µs -35.54%
Mini js (Parser) 21.8±0.05µs 25.2±0.18µs +15.60%
Number Object Access (Compiler) 641.7±1.13ns 965.8±1.52ns +50.51%
Number Object Access (Execution) 5.3±0.01µs 4.4±0.02µs -16.98%
Number Object Access (Parser) 9.7±0.01µs 11.1±0.01µs +14.43%
Object Creation (Compiler) 945.7±1.29ns 1269.6±4.24ns +34.25%
Object Creation (Execution) 6.1±0.08µs 6.3±0.04µs +3.28%
Object Creation (Parser) 9.2±0.01µs 9.2±0.01µs 0.00%
RegExp (Compiler) 1127.2±4.62ns 1499.7±2.84ns +33.05%
RegExp (Execution) 13.1±0.06µs 12.7±0.05µs -3.05%
RegExp (Parser) 10.1±0.01µs 10.1±0.02µs 0.00%
RegExp Creation (Compiler) 1018.3±3.65ns 1294.1±2.76ns +27.08%
RegExp Creation (Execution) 10.0±0.09µs 8.6±0.04µs -14.00%
RegExp Creation (Parser) 8.4±0.01µs 8.5±0.02µs +1.19%
RegExp Literal (Compiler) 1123.9±5.05ns 1508.7±4.05ns +34.24%
RegExp Literal (Execution) 13.1±0.16µs 12.7±0.04µs -3.05%
RegExp Literal (Parser) 7.1±0.01µs 8.1±0.04µs +14.08%
RegExp Literal Creation (Compiler) 1018.6±4.08ns 1284.5±3.66ns +26.10%
RegExp Literal Creation (Execution) 9.9±0.09µs 9.7±0.06µs -2.02%
RegExp Literal Creation (Parser) 5.6±0.01µs 6.4±0.01µs +14.29%
Static Object Property Access (Compiler) 972.2±2.92ns 1306.1±2.61ns +34.34%
Static Object Property Access (Execution) 6.4±0.03µs 5.7±0.01µs -10.94%
Static Object Property Access (Parser) 9.8±0.01µs 9.8±0.06µs 0.00%
String Object Access (Compiler) 1014.4±6.61ns 1194.4±5.67ns +17.74%
String Object Access (Execution) 8.6±0.04µs 6.6±0.02µs -23.26%
String Object Access (Parser) 12.1±0.02µs 13.9±0.02µs +14.88%
String comparison (Compiler) 1288.0±3.41ns 1962.7±3.48ns +52.38%
String comparison (Execution) 7.2±0.02µs 5.3±0.01µs -26.39%
String comparison (Parser) 9.4±0.02µs 10.7±0.02µs +13.83%
String concatenation (Compiler) 1037.5±3.24ns 1499.7±3.25ns +44.55%
String concatenation (Execution) 6.1±0.01µs 4.9±0.01µs -19.67%
String concatenation (Parser) 6.5±0.02µs 7.5±0.02µs +15.38%
String copy (Compiler) 861.3±3.72ns 1060.0±2.34ns +23.07%
String copy (Execution) 5.3±0.02µs 4.4±0.01µs -16.98%
String copy (Parser) 4.9±0.01µs 5.6±0.02µs +14.29%
Symbols (Compiler) 657.6±1.56ns 822.5±1.74ns +25.08%
Symbols (Execution) 4.9±0.02µs 4.2±0.01µs -14.29%
Symbols (Parser) 4.3±0.02µs 4.3±0.01µs 0.00%

@raskad raskad added this to the v0.14.0 milestone Feb 11, 2022
@raskad raskad marked this pull request as ready for review February 11, 2022 19:56
Copy link
Member

@Razican Razican left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good already :) I added some comments and suggestions to improve the result. I don't think I can help a lot with the VM, since I'm still learning through it, and I'm missing some documentation, but the rest looks pretty good!

boa/src/context.rs Show resolved Hide resolved

/// A binding locator contains all information about a binding that is needed to resolve it at runtime.
///
/// Binding locators get created at compile time and are accessible at runtime via the [`CodeBlock`].
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that this link to CodeBlock is not working properly.

boa/src/environments.rs Outdated Show resolved Hide resolved
boa/src/vm/call_frame.rs Show resolved Hide resolved
boa/src/vm/call_frame.rs Show resolved Hide resolved
boa/src/vm/mod.rs Outdated Show resolved Hide resolved
boa/src/vm/mod.rs Outdated Show resolved Hide resolved
boa/src/vm/mod.rs Outdated Show resolved Hide resolved
boa/src/vm/mod.rs Outdated Show resolved Hide resolved
boa/src/vm/mod.rs Outdated Show resolved Hide resolved
@github-actions
Copy link

Benchmark for 05e43dc

Click to view benchmark
Test Base PR %
Arithmetic operations (Compiler) 474.4±1.13ns 571.1±2.07ns +20.38%
Arithmetic operations (Execution) 2.4±0.01µs 2.4±0.01µs 0.00%
Arithmetic operations (Parser) 6.1±0.01µs 6.1±0.13µs 0.00%
Array access (Compiler) 971.1±3.79ns 1400.8±6.36ns +44.25%
Array access (Execution) 12.4±0.05µs 12.2±0.09µs -1.61%
Array access (Parser) 13.1±0.04µs 13.1±0.03µs 0.00%
Array creation (Compiler) 1377.3±14.32ns 2.0±0.01µs +45.21%
Array creation (Execution) 3.8±0.01ms 3.8±0.01ms 0.00%
Array creation (Parser) 14.7±0.01µs 14.6±0.05µs -0.68%
Array pop (Compiler) 3.6±0.01µs 4.2±0.03µs +16.67%
Array pop (Execution) 1633.4±6.62µs 1615.2±7.65µs -1.11%
Array pop (Parser) 159.2±0.38µs 158.5±0.97µs -0.44%
Boolean Object Access (Compiler) 792.4±2.72ns 1112.5±4.82ns +40.40%
Boolean Object Access (Execution) 8.2±0.02µs 6.8±0.03µs -17.07%
Boolean Object Access (Parser) 15.7±0.03µs 15.8±0.06µs +0.64%
Clean js (Compiler) 2.6±0.01µs 3.8±0.01µs +46.15%
Clean js (Execution) 1753.9±19.61µs 1295.4±9.81µs -26.14%
Clean js (Parser) 31.7±0.05µs 31.6±0.07µs -0.32%
Create Realm 395.7±1.70ns 352.7±0.72ns -10.87%
Dynamic Object Property Access (Compiler) 1371.9±3.49ns 1804.7±7.84ns +31.55%
Dynamic Object Property Access (Execution) 8.1±0.04µs 8.2±0.05µs +1.23%
Dynamic Object Property Access (Parser) 11.6±0.04µs 11.6±0.02µs 0.00%
Fibonacci (Compiler) 1750.4±6.07ns 2.5±0.02µs +42.82%
Fibonacci (Execution) 3.2±0.03ms 3.2±0.01ms 0.00%
Fibonacci (Parser) 17.8±0.06µs 17.7±0.10µs -0.56%
For loop (Compiler) 1511.0±4.75ns 2.2±0.01µs +45.60%
For loop (Execution) 51.9±0.12µs 51.4±0.24µs -0.96%
For loop (Parser) 15.3±0.10µs 15.3±0.04µs 0.00%
Mini js (Compiler) 2.6±0.02µs 3.7±0.01µs +42.31%
Mini js (Execution) 1621.7±7.94µs 1197.6±7.79µs -26.15%
Mini js (Parser) 27.6±0.06µs 27.4±0.14µs -0.72%
Number Object Access (Compiler) 746.5±3.56ns 1053.7±3.13ns +41.15%
Number Object Access (Execution) 6.5±0.03µs 5.3±0.02µs -18.46%
Number Object Access (Parser) 12.1±0.03µs 12.2±0.05µs +0.83%
Object Creation (Compiler) 1148.7±3.02ns 1577.7±16.28ns +37.35%
Object Creation (Execution) 7.3±0.02µs 7.4±0.02µs +1.37%
Object Creation (Parser) 10.2±0.06µs 10.3±0.04µs +0.98%
RegExp (Compiler) 1362.7±9.11ns 1854.9±18.82ns +36.12%
RegExp (Execution) 15.4±0.05µs 14.5±0.07µs -5.84%
RegExp (Parser) 11.1±0.07µs 11.0±0.03µs -0.90%
RegExp Creation (Compiler) 1217.7±5.89ns 1613.3±17.95ns +32.49%
RegExp Creation (Execution) 11.8±0.04µs 11.0±0.06µs -6.78%
RegExp Creation (Parser) 9.2±0.05µs 9.2±0.02µs 0.00%
RegExp Literal (Compiler) 1358.5±15.83ns 1834.9±16.33ns +35.07%
RegExp Literal (Execution) 15.5±0.06µs 14.5±0.18µs -6.45%
RegExp Literal (Parser) 8.9±0.02µs 8.8±0.04µs -1.12%
RegExp Literal Creation (Compiler) 1219.2±5.13ns 1611.1±12.20ns +32.14%
RegExp Literal Creation (Execution) 11.8±0.08µs 10.9±0.04µs -7.63%
RegExp Literal Creation (Parser) 7.0±0.02µs 7.0±0.02µs 0.00%
Static Object Property Access (Compiler) 1146.2±2.66ns 1580.9±4.52ns +37.93%
Static Object Property Access (Execution) 7.7±0.03µs 7.6±0.04µs -1.30%
Static Object Property Access (Parser) 11.0±0.07µs 10.9±0.05µs -0.91%
String Object Access (Compiler) 1198.7±4.74ns 1495.6±8.77ns +24.77%
String Object Access (Execution) 10.5±0.06µs 8.7±0.04µs -17.14%
String Object Access (Parser) 15.4±0.05µs 15.5±0.05µs +0.65%
String comparison (Compiler) 1519.2±5.03ns 2.3±0.02µs +51.40%
String comparison (Execution) 8.6±0.04µs 7.2±0.03µs -16.28%
String comparison (Parser) 12.1±0.03µs 12.1±0.04µs 0.00%
String concatenation (Compiler) 1242.4±7.48ns 1840.1±7.62ns +48.11%
String concatenation (Execution) 7.3±0.03µs 6.5±0.02µs -10.96%
String concatenation (Parser) 8.3±0.04µs 8.4±0.07µs +1.20%
String copy (Compiler) 1044.5±3.63ns 1445.0±6.42ns +38.34%
String copy (Execution) 6.3±0.04µs 5.9±0.02µs -6.35%
String copy (Parser) 6.1±0.04µs 6.1±0.03µs 0.00%
Symbols (Compiler) 764.5±2.85ns 996.4±2.72ns +30.33%
Symbols (Execution) 6.0±0.03µs 5.7±0.02µs -5.00%
Symbols (Parser) 4.6±0.03µs 4.7±0.04µs +2.17%

Copy link
Member

@Razican Razican left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! LGTM!

@@ -38,6 +39,9 @@ struct JumpControlInfo {
kind: JumpControlInfoKind,
breaks: Vec<Label>,
try_continues: Vec<Label>,
in_catch: bool,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At some point we could add all these booleans as bitflags, should be more efficient.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not really satisfied with the current exception handling tbh. I will open an issue to think about different ways of how to handle all of that in the vm. I'm hoping that we can find a way to do it without all these fields at runtime.

@github-actions
Copy link

Benchmark for 9a1c7c3

Click to view benchmark
Test Base PR %
Arithmetic operations (Compiler) 392.4±0.89ns 456.5±1.39ns +16.34%
Arithmetic operations (Execution) 1806.2±12.31ns 1810.9±2.84ns +0.26%
Arithmetic operations (Parser) 5.8±0.06µs 5.8±0.03µs 0.00%
Array access (Compiler) 819.8±2.11ns 1232.7±10.44ns +50.37%
Array access (Execution) 11.0±0.12µs 10.8±0.03µs -1.82%
Array access (Parser) 13.0±0.10µs 12.9±0.02µs -0.77%
Array creation (Compiler) 1220.4±5.14ns 1865.2±4.34ns +52.84%
Array creation (Execution) 3.2±0.01ms 3.1±0.01ms -3.13%
Array creation (Parser) 14.5±0.10µs 14.4±0.03µs -0.69%
Array pop (Compiler) 2.8±0.01µs 3.4±0.01µs +21.43%
Array pop (Execution) 1402.9±10.99µs 1370.5±12.07µs -2.31%
Array pop (Parser) 142.3±0.18µs 144.5±0.17µs +1.55%
Boolean Object Access (Compiler) 691.2±1.58ns 1070.2±10.24ns +54.83%
Boolean Object Access (Execution) 7.0±0.05µs 5.5±0.01µs -21.43%
Boolean Object Access (Parser) 15.1±0.01µs 15.1±0.07µs 0.00%
Clean js (Compiler) 2.3±0.01µs 3.5±0.01µs +52.17%
Clean js (Execution) 1507.9±17.13µs 1075.3±10.75µs -28.69%
Clean js (Parser) 30.4±0.19µs 30.6±0.09µs +0.66%
Create Realm 351.1±0.37ns 281.0±1.27ns -19.97%
Dynamic Object Property Access (Compiler) 1190.0±3.44ns 1630.8±4.25ns +37.04%
Dynamic Object Property Access (Execution) 6.9±0.04µs 6.9±0.06µs 0.00%
Dynamic Object Property Access (Parser) 11.7±0.03µs 11.5±0.03µs -1.71%
Fibonacci (Compiler) 1485.0±4.42ns 2.3±0.03µs +54.88%
Fibonacci (Execution) 2.8±0.00ms 2.7±0.00ms -3.57%
Fibonacci (Parser) 17.4±0.16µs 17.1±0.04µs -1.72%
For loop (Compiler) 1319.5±3.10ns 1944.9±6.08ns +47.40%
For loop (Execution) 42.1±0.16µs 39.9±0.16µs -5.23%
For loop (Parser) 15.0±0.07µs 14.9±0.04µs -0.67%
Mini js (Compiler) 2.2±0.01µs 3.4±0.03µs +54.55%
Mini js (Execution) 1412.5±11.46µs 1000.1±7.43µs -29.20%
Mini js (Parser) 26.5±0.09µs 26.9±0.17µs +1.51%
Number Object Access (Compiler) 640.2±1.66ns 1009.8±3.63ns +57.73%
Number Object Access (Execution) 5.5±0.04µs 4.4±0.05µs -20.00%
Number Object Access (Parser) 11.7±0.04µs 11.7±0.07µs 0.00%
Object Creation (Compiler) 998.4±4.34ns 1354.4±5.94ns +35.66%
Object Creation (Execution) 6.1±0.03µs 6.1±0.04µs 0.00%
Object Creation (Parser) 10.1±0.07µs 10.1±0.03µs 0.00%
RegExp (Compiler) 1194.2±6.30ns 1602.3±3.36ns +34.17%
RegExp (Execution) 12.9±0.04µs 12.8±0.03µs -0.78%
RegExp (Parser) 11.1±0.06µs 10.9±0.02µs -1.80%
RegExp Creation (Compiler) 1075.9±3.53ns 1427.6±69.13ns +32.69%
RegExp Creation (Execution) 9.6±0.03µs 9.4±0.05µs -2.08%
RegExp Creation (Parser) 9.2±0.08µs 9.1±0.02µs -1.09%
RegExp Literal (Compiler) 1189.1±5.83ns 1606.2±5.57ns +35.08%
RegExp Literal (Execution) 12.9±0.03µs 12.7±0.03µs -1.55%
RegExp Literal (Parser) 8.9±0.05µs 8.9±0.04µs 0.00%
RegExp Literal Creation (Compiler) 1047.5±3.69ns 1405.2±33.35ns +34.15%
RegExp Literal Creation (Execution) 9.6±0.03µs 9.5±0.05µs -1.04%
RegExp Literal Creation (Parser) 7.1±0.03µs 7.1±0.02µs 0.00%
Static Object Property Access (Compiler) 1004.8±4.61ns 1415.8±3.19ns +40.90%
Static Object Property Access (Execution) 6.3±0.04µs 6.3±0.02µs 0.00%
Static Object Property Access (Parser) 10.9±0.06µs 10.7±0.03µs -1.83%
String Object Access (Compiler) 1056.8±6.09ns 1454.4±9.61ns +37.62%
String Object Access (Execution) 8.9±0.05µs 7.4±0.02µs -16.85%
String Object Access (Parser) 14.7±0.01µs 14.8±0.08µs +0.68%
String comparison (Compiler) 1356.8±4.36ns 2.1±0.00µs +54.78%
String comparison (Execution) 7.5±0.04µs 6.2±0.02µs -17.33%
String comparison (Parser) 12.0±0.22µs 11.8±0.05µs -1.67%
String concatenation (Compiler) 1090.2±2.10ns 1635.3±5.14ns +50.00%
String concatenation (Execution) 6.3±0.02µs 5.5±0.01µs -12.70%
String concatenation (Parser) 8.3±0.12µs 8.3±0.04µs 0.00%
String copy (Compiler) 908.5±3.48ns 1250.7±4.76ns +37.67%
String copy (Execution) 5.3±0.04µs 5.0±0.01µs -5.66%
String copy (Parser) 6.1±0.11µs 6.2±0.06µs +1.64%
Symbols (Compiler) 634.3±1.30ns 871.2±5.57ns +37.35%
Symbols (Execution) 4.9±0.05µs 4.8±0.02µs -2.04%
Symbols (Parser) 4.7±0.09µs 4.7±0.02µs 0.00%

@RageKnify RageKnify added the Internal Category for changelog label Feb 15, 2022
@github-actions
Copy link

Benchmark for 54b6f3b

Click to view benchmark
Test Base PR %
Arithmetic operations (Compiler) 475.7±25.10ns 569.8±53.34ns +19.78%
Arithmetic operations (Execution) 2.2±0.08µs 2.1±0.08µs -4.55%
Arithmetic operations (Parser) 6.2±0.28µs 6.0±0.27µs -3.23%
Array access (Compiler) 976.9±40.55ns 1594.0±82.45ns +63.17%
Array access (Execution) 12.2±0.57µs 12.1±0.63µs -0.82%
Array access (Parser) 13.5±0.76µs 13.8±0.87µs +2.22%
Array creation (Compiler) 1407.1±94.58ns 2.2±0.08µs +56.35%
Array creation (Execution) 3.7±0.16ms 3.4±0.12ms -8.11%
Array creation (Parser) 14.6±0.80µs 15.6±1.62µs +6.85%
Array pop (Compiler) 3.3±0.15µs 4.0±0.16µs +21.21%
Array pop (Execution) 1521.7±65.96µs 1539.5±91.55µs +1.17%
Array pop (Parser) 160.7±5.50µs 159.6±7.32µs -0.68%
Boolean Object Access (Compiler) 819.7±31.60ns 1204.8±46.60ns +46.98%
Boolean Object Access (Execution) 8.1±0.42µs 6.3±0.33µs -22.22%
Boolean Object Access (Parser) 15.4±0.85µs 15.5±0.88µs +0.65%
Clean js (Compiler) 2.6±0.16µs 4.2±0.24µs +61.54%
Clean js (Execution) 1637.8±69.35µs 1203.9±53.23µs -26.49%
Clean js (Parser) 32.3±1.50µs 32.3±1.82µs 0.00%
Create Realm 361.5±16.48ns 295.8±13.44ns -18.17%
Dynamic Object Property Access (Compiler) 1424.2±119.55ns 1936.7±127.45ns +35.99%
Dynamic Object Property Access (Execution) 8.0±0.27µs 8.0±0.32µs 0.00%
Dynamic Object Property Access (Parser) 11.6±0.53µs 11.7±0.62µs +0.86%
Fibonacci (Compiler) 1823.0±175.74ns 2.9±0.15µs +59.08%
Fibonacci (Execution) 3.5±0.20ms 3.3±0.11ms -5.71%
Fibonacci (Parser) 17.6±0.85µs 18.2±1.83µs +3.41%
For loop (Compiler) 1652.2±79.04ns 2.3±0.10µs +39.21%
For loop (Execution) 51.5±2.88µs 46.7±1.78µs -9.32%
For loop (Parser) 15.3±0.98µs 15.6±1.24µs +1.96%
Mini js (Compiler) 2.6±0.18µs 4.1±0.19µs +57.69%
Mini js (Execution) 1503.9±60.18µs 1152.8±88.23µs -23.35%
Mini js (Parser) 28.0±1.34µs 28.4±1.46µs +1.43%
Number Object Access (Compiler) 784.8±71.01ns 1165.0±68.49ns +48.45%
Number Object Access (Execution) 6.2±0.30µs 4.9±0.23µs -20.97%
Number Object Access (Parser) 12.0±0.47µs 12.1±0.59µs +0.83%
Object Creation (Compiler) 1204.4±62.17ns 1683.0±86.28ns +39.74%
Object Creation (Execution) 7.4±0.31µs 7.3±0.32µs -1.35%
Object Creation (Parser) 10.3±0.61µs 10.2±0.40µs -0.97%
RegExp (Compiler) 1362.7±60.79ns 1943.6±83.89ns +42.63%
RegExp (Execution) 15.0±0.73µs 14.6±0.93µs -2.67%
RegExp (Parser) 10.9±0.47µs 11.2±0.55µs +2.75%
RegExp Creation (Compiler) 1265.3±61.10ns 1690.5±63.03ns +33.60%
RegExp Creation (Execution) 11.3±0.52µs 10.9±0.71µs -3.54%
RegExp Creation (Parser) 9.3±0.50µs 9.6±0.55µs +3.23%
RegExp Literal (Compiler) 1455.3±98.75ns 1927.7±74.89ns +32.46%
RegExp Literal (Execution) 14.8±0.84µs 14.3±0.62µs -3.38%
RegExp Literal (Parser) 8.8±0.35µs 9.0±0.35µs +2.27%
RegExp Literal Creation (Compiler) 1268.6±69.53ns 1710.3±73.70ns +34.82%
RegExp Literal Creation (Execution) 11.1±0.48µs 10.6±0.65µs -4.50%
RegExp Literal Creation (Parser) 6.9±0.25µs 7.0±0.26µs +1.45%
Static Object Property Access (Compiler) 1213.6±153.27ns 1687.5±71.74ns +39.05%
Static Object Property Access (Execution) 7.5±0.29µs 7.9±1.00µs +5.33%
Static Object Property Access (Parser) 10.7±0.41µs 10.9±0.47µs +1.87%
String Object Access (Compiler) 1193.9±77.41ns 1598.8±79.14ns +33.91%
String Object Access (Execution) 9.8±0.39µs 8.5±0.82µs -13.27%
String Object Access (Parser) 15.2±1.54µs 15.2±0.82µs 0.00%
String comparison (Compiler) 1561.1±60.25ns 2.5±0.11µs +60.14%
String comparison (Execution) 8.4±0.46µs 7.0±0.55µs -16.67%
String comparison (Parser) 12.2±0.68µs 12.0±0.75µs -1.64%
String concatenation (Compiler) 1323.9±77.89ns 1970.1±87.11ns +48.81%
String concatenation (Execution) 7.2±0.27µs 6.4±0.46µs -11.11%
String concatenation (Parser) 8.3±0.35µs 8.4±0.57µs +1.20%
String copy (Compiler) 1095.7±61.23ns 1558.6±81.27ns +42.25%
String copy (Execution) 6.3±0.31µs 5.9±0.30µs -6.35%
String copy (Parser) 6.2±0.37µs 6.3±0.53µs +1.61%
Symbols (Compiler) 811.9±89.48ns 1067.6±46.95ns +31.49%
Symbols (Execution) 6.0±0.25µs 5.9±0.41µs -1.67%
Symbols (Parser) 4.6±0.18µs 4.9±0.25µs +6.52%

boa/src/profiler.rs Outdated Show resolved Hide resolved
@github-actions
Copy link

Benchmark for 8538ec7

Click to view benchmark
Test Base PR %
Arithmetic operations (Compiler) 400.3±13.92ns 556.3±16.81ns +38.97%
Arithmetic operations (Execution) 1885.5±183.93ns 1781.0±65.28ns -5.54%
Arithmetic operations (Parser) 5.1±0.25µs 5.0±0.21µs -1.96%
Array access (Compiler) 846.4±38.12ns 1244.3±55.94ns +47.01%
Array access (Execution) 10.1±0.37µs 10.2±0.25µs +0.99%
Array access (Parser) 10.9±0.39µs 11.0±0.59µs +0.92%
Array creation (Compiler) 1211.3±47.37ns 1770.0±88.84ns +46.12%
Array creation (Execution) 3.0±0.10ms 3.0±0.12ms 0.00%
Array creation (Parser) 12.0±0.35µs 11.8±0.32µs -1.67%
Array pop (Compiler) 2.7±0.09µs 3.4±0.12µs +25.93%
Array pop (Execution) 1252.7±38.42µs 1248.9±46.72µs -0.30%
Array pop (Parser) 129.8±5.59µs 129.9±4.95µs +0.08%
Boolean Object Access (Compiler) 709.3±26.14ns 1112.6±35.64ns +56.86%
Boolean Object Access (Execution) 6.6±0.28µs 5.3±0.21µs -19.70%
Boolean Object Access (Parser) 13.0±0.36µs 12.5±0.45µs -3.85%
Clean js (Compiler) 2.3±0.13µs 3.2±0.06µs +39.13%
Clean js (Execution) 1388.7±59.34µs 996.6±34.25µs -28.24%
Clean js (Parser) 26.4±1.11µs 26.3±1.39µs -0.38%
Create Realm 306.6±14.58ns 297.3±13.20ns -3.03%
Dynamic Object Property Access (Compiler) 1150.8±37.92ns 1556.1±67.78ns +35.22%
Dynamic Object Property Access (Execution) 6.9±0.25µs 6.9±0.20µs 0.00%
Dynamic Object Property Access (Parser) 9.7±0.54µs 9.8±0.74µs +1.03%
Fibonacci (Compiler) 1485.4±51.77ns 2.2±0.07µs +48.11%
Fibonacci (Execution) 2.9±0.07ms 2.9±0.14ms 0.00%
Fibonacci (Parser) 14.6±0.48µs 14.8±1.05µs +1.37%
For loop (Compiler) 1309.2±64.23ns 1845.7±178.20ns +40.98%
For loop (Execution) 41.6±1.83µs 40.5±2.41µs -2.64%
For loop (Parser) 12.5±0.36µs 12.6±0.84µs +0.80%
Mini js (Compiler) 2.2±0.06µs 3.3±0.22µs +50.00%
Mini js (Execution) 1246.5±32.09µs 920.4±43.50µs -26.16%
Mini js (Parser) 23.3±1.28µs 24.0±1.96µs +3.00%
Number Object Access (Compiler) 673.2±27.19ns 1078.4±36.58ns +60.19%
Number Object Access (Execution) 5.1±0.17µs 4.2±0.17µs -17.65%
Number Object Access (Parser) 10.4±0.54µs 10.0±0.50µs -3.85%
Object Creation (Compiler) 978.0±32.83ns 1348.9±37.35ns +37.92%
Object Creation (Execution) 6.5±0.22µs 6.4±0.30µs -1.54%
Object Creation (Parser) 8.4±0.24µs 8.3±0.29µs -1.19%
RegExp (Compiler) 1162.1±44.27ns 1606.4±39.33ns +38.23%
RegExp (Execution) 12.4±0.60µs 12.9±0.85µs +4.03%
RegExp (Parser) 9.4±0.39µs 9.3±0.44µs -1.06%
RegExp Creation (Compiler) 1033.1±41.48ns 1371.5±45.58ns +32.76%
RegExp Creation (Execution) 9.3±0.33µs 9.1±0.25µs -2.15%
RegExp Creation (Parser) 7.8±0.38µs 7.8±0.45µs 0.00%
RegExp Literal (Compiler) 1196.5±64.59ns 1578.3±27.11ns +31.91%
RegExp Literal (Execution) 13.0±0.62µs 12.3±0.40µs -5.38%
RegExp Literal (Parser) 7.3±0.25µs 7.3±0.20µs 0.00%
RegExp Literal Creation (Compiler) 1086.0±60.74ns 1374.5±48.98ns +26.57%
RegExp Literal Creation (Execution) 9.3±0.44µs 9.4±0.52µs +1.08%
RegExp Literal Creation (Parser) 5.7±0.17µs 5.7±0.14µs 0.00%
Static Object Property Access (Compiler) 1012.3±45.47ns 1367.1±51.57ns +35.05%
Static Object Property Access (Execution) 6.5±0.28µs 6.6±0.26µs +1.54%
Static Object Property Access (Parser) 9.2±0.49µs 9.0±0.42µs -2.17%
String Object Access (Compiler) 1022.1±32.34ns 1448.7±58.10ns +41.74%
String Object Access (Execution) 8.2±0.27µs 7.4±0.26µs -9.76%
String Object Access (Parser) 12.5±0.38µs 12.6±0.55µs +0.80%
String comparison (Compiler) 1289.7±36.14ns 2.0±0.10µs +55.07%
String comparison (Execution) 7.2±0.32µs 6.0±0.26µs -16.67%
String comparison (Parser) 10.2±0.38µs 10.0±0.48µs -1.96%
String concatenation (Compiler) 1113.6±53.05ns 1578.0±49.76ns +41.70%
String concatenation (Execution) 6.1±0.20µs 5.7±0.34µs -6.56%
String concatenation (Parser) 7.1±0.35µs 6.7±0.19µs -5.63%
String copy (Compiler) 907.7±40.40ns 1253.5±33.96ns +38.10%
String copy (Execution) 5.4±0.25µs 5.0±0.13µs -7.41%
String copy (Parser) 5.3±0.35µs 5.1±0.17µs -3.77%
Symbols (Compiler) 674.9±26.71ns 885.1±27.83ns +31.15%
Symbols (Execution) 5.1±0.16µs 5.0±0.22µs -1.96%
Symbols (Parser) 3.8±0.11µs 3.9±0.12µs +2.63%

@github-actions
Copy link

Benchmark for cf6d14f

Click to view benchmark
Test Base PR %
Arithmetic operations (Compiler) 351.6±0.47ns 461.9±1.35ns +31.37%
Arithmetic operations (Execution) 1852.0±12.55ns 1954.1±2.99ns +5.51%
Arithmetic operations (Parser) 5.0±0.07µs 5.5±0.02µs +10.00%
Array access (Compiler) 799.7±1.56ns 1189.4±3.51ns +48.73%
Array access (Execution) 10.3±0.03µs 10.5±0.04µs +1.94%
Array access (Parser) 10.7±0.02µs 11.9±0.01µs +11.21%
Array creation (Compiler) 1020.3±2.83ns 1717.4±15.42ns +68.32%
Array creation (Execution) 3.2±0.01ms 3.2±0.01ms 0.00%
Array creation (Parser) 12.0±0.03µs 13.4±0.02µs +11.67%
Array pop (Compiler) 2.4±0.01µs 3.4±0.01µs +41.67%
Array pop (Execution) 1374.7±5.96µs 1368.4±3.26µs -0.46%
Array pop (Parser) 124.8±0.28µs 137.0±0.16µs +9.78%
Boolean Object Access (Compiler) 612.7±2.29ns 1023.1±1.51ns +66.98%
Boolean Object Access (Execution) 6.1±0.01µs 5.5±0.02µs -9.84%
Boolean Object Access (Parser) 14.3±0.03µs 14.0±0.01µs -2.10%
Clean js (Compiler) 1880.6±7.38ns 3.2±0.01µs +70.16%
Clean js (Execution) 1287.5±5.66µs 1085.6±20.60µs -15.68%
Clean js (Parser) 29.2±0.04µs 28.7±0.04µs -1.71%
Create Realm 307.0±3.69ns 263.2±0.32ns -14.27%
Dynamic Object Property Access (Compiler) 1147.9±2.77ns 1541.2±5.76ns +34.26%
Dynamic Object Property Access (Execution) 6.8±0.04µs 7.0±0.04µs +2.94%
Dynamic Object Property Access (Parser) 11.1±0.04µs 10.5±0.02µs -5.41%
Fibonacci (Compiler) 1433.5±3.09ns 2.2±0.01µs +53.47%
Fibonacci (Execution) 2.4±0.00ms 2.7±0.00ms +12.50%
Fibonacci (Parser) 14.7±0.04µs 16.0±0.02µs +8.84%
For loop (Compiler) 1269.0±4.69ns 1835.4±4.34ns +44.63%
For loop (Execution) 39.7±0.10µs 41.6±0.14µs +4.79%
For loop (Parser) 14.2±0.02µs 13.7±0.02µs -3.52%
Mini js (Compiler) 1879.2±5.81ns 3.1±0.02µs +64.96%
Mini js (Execution) 1185.6±6.89µs 1009.4±6.81µs -14.86%
Mini js (Parser) 25.6±0.03µs 25.1±0.02µs -1.95%
Number Object Access (Compiler) 563.4±0.58ns 987.0±1.34ns +75.19%
Number Object Access (Execution) 4.8±0.01µs 4.3±0.03µs -10.42%
Number Object Access (Parser) 11.3±0.04µs 11.0±0.01µs -2.65%
Object Creation (Compiler) 952.5±2.02ns 1302.6±4.24ns +36.76%
Object Creation (Execution) 5.5±0.01µs 6.2±0.03µs +12.73%
Object Creation (Parser) 8.5±0.03µs 9.2±0.02µs +8.24%
RegExp (Compiler) 1164.1±4.01ns 1539.5±13.49ns +32.25%
RegExp (Execution) 11.5±0.06µs 12.9±0.02µs +12.17%
RegExp (Parser) 9.1±0.03µs 10.1±0.02µs +10.99%
RegExp Creation (Compiler) 1028.6±3.11ns 1306.1±10.20ns +26.98%
RegExp Creation (Execution) 9.7±0.04µs 9.7±0.05µs 0.00%
RegExp Creation (Parser) 7.6±0.02µs 8.4±0.01µs +10.53%
RegExp Literal (Compiler) 1167.8±3.74ns 1527.8±10.51ns +30.83%
RegExp Literal (Execution) 11.5±0.03µs 12.9±0.02µs +12.17%
RegExp Literal (Parser) 8.3±0.03µs 8.1±0.01µs -2.41%
RegExp Literal Creation (Compiler) 923.4±2.02ns 1318.0±10.83ns +42.73%
RegExp Literal Creation (Execution) 9.7±0.05µs 9.7±0.05µs 0.00%
RegExp Literal Creation (Parser) 6.6±0.02µs 6.4±0.05µs -3.03%
Static Object Property Access (Compiler) 967.6±3.06ns 1293.5±5.76ns +33.68%
Static Object Property Access (Execution) 6.4±0.04µs 6.5±0.03µs +1.56%
Static Object Property Access (Parser) 9.0±0.03µs 9.8±0.03µs +8.89%
String Object Access (Compiler) 918.2±2.08ns 1381.6±8.86ns +50.47%
String Object Access (Execution) 7.6±0.03µs 7.4±0.02µs -2.63%
String Object Access (Parser) 14.1±0.04µs 13.8±0.03µs -2.13%
String comparison (Compiler) 1130.2±1.45ns 2.0±0.02µs +76.96%
String comparison (Execution) 7.2±0.02µs 6.1±0.01µs -15.28%
String comparison (Parser) 10.2±0.04µs 10.9±0.03µs +6.86%
String concatenation (Compiler) 941.7±1.91ns 1572.3±13.62ns +66.96%
String concatenation (Execution) 6.2±0.02µs 5.5±0.02µs -11.29%
String concatenation (Parser) 7.9±0.02µs 7.5±0.02µs -5.06%
String copy (Compiler) 778.8±1.73ns 1229.1±13.24ns +57.82%
String copy (Execution) 5.3±0.02µs 5.0±0.02µs -5.66%
String copy (Parser) 5.1±0.01µs 5.7±0.01µs +11.76%
Symbols (Compiler) 656.9±1.70ns 817.0±1.29ns +24.37%
Symbols (Execution) 4.3±0.01µs 4.8±0.01µs +11.63%
Symbols (Parser) 3.9±0.02µs 4.3±0.01µs +10.26%

Copy link
Member

@RageKnify RageKnify left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, big change but the code looks good and I think the docs are at a point where other people can contribute.

@github-actions
Copy link

Benchmark for 44a4ad1

Click to view benchmark
Test Base PR %
Arithmetic operations (Compiler) 391.0±0.68ns 458.0±2.31ns +17.14%
Arithmetic operations (Execution) 2.0±0.00µs 2.1±0.06µs +5.00%
Arithmetic operations (Parser) 5.6±0.03µs 5.5±0.01µs -1.79%
Array access (Compiler) 799.5±1.76ns 1165.6±2.12ns +45.79%
Array access (Execution) 10.3±0.08µs 10.6±0.03µs +2.91%
Array access (Parser) 11.9±0.11µs 11.9±0.04µs 0.00%
Array creation (Compiler) 1154.5±2.68ns 1687.2±18.70ns +46.14%
Array creation (Execution) 3.2±0.00ms 3.2±0.00ms 0.00%
Array creation (Parser) 13.2±0.02µs 13.4±0.02µs +1.52%
Array pop (Compiler) 2.7±0.01µs 3.4±0.01µs +25.93%
Array pop (Execution) 1366.0±4.04µs 1370.7±2.61µs +0.34%
Array pop (Parser) 136.7±0.05µs 136.9±0.11µs +0.15%
Boolean Object Access (Compiler) 684.0±1.34ns 1022.6±2.43ns +49.50%
Boolean Object Access (Execution) 7.0±0.02µs 5.6±0.01µs -20.00%
Boolean Object Access (Parser) 14.1±0.02µs 14.1±0.02µs 0.00%
Clean js (Compiler) 2.2±0.01µs 3.2±0.01µs +45.45%
Clean js (Execution) 1457.7±9.16µs 1106.1±8.51µs -24.12%
Clean js (Parser) 28.5±0.21µs 28.8±0.03µs +1.05%
Create Realm 329.3±14.35ns 263.3±2.98ns -20.04%
Dynamic Object Property Access (Compiler) 1171.3±3.82ns 1501.2±5.78ns +28.17%
Dynamic Object Property Access (Execution) 6.9±0.04µs 6.9±0.03µs 0.00%
Dynamic Object Property Access (Parser) 10.7±0.02µs 10.5±0.02µs -1.87%
Fibonacci (Compiler) 1468.3±3.39ns 2.1±0.01µs +43.02%
Fibonacci (Execution) 2.8±0.00ms 2.7±0.00ms -3.57%
Fibonacci (Parser) 16.0±0.04µs 15.9±0.06µs -0.62%
For loop (Compiler) 1275.4±4.13ns 1829.1±18.90ns +43.41%
For loop (Execution) 44.1±0.19µs 42.4±0.19µs -3.85%
For loop (Parser) 13.8±0.02µs 13.8±0.02µs 0.00%
Mini js (Compiler) 2.1±0.01µs 3.2±0.01µs +52.38%
Mini js (Execution) 1359.1±9.35µs 1010.6±7.35µs -25.64%
Mini js (Parser) 24.8±0.03µs 25.1±0.03µs +1.21%
Number Object Access (Compiler) 645.8±0.93ns 980.5±1.46ns +51.83%
Number Object Access (Execution) 5.4±0.01µs 4.4±0.01µs -18.52%
Number Object Access (Parser) 11.1±0.03µs 11.0±0.03µs -0.90%
Object Creation (Compiler) 954.3±1.76ns 1287.9±4.36ns +34.96%
Object Creation (Execution) 6.3±0.02µs 6.3±0.03µs 0.00%
Object Creation (Parser) 9.3±0.06µs 9.2±0.01µs -1.08%
RegExp (Compiler) 1140.9±1.65ns 1548.5±10.74ns +35.73%
RegExp (Execution) 13.0±0.03µs 12.9±0.03µs -0.77%
RegExp (Parser) 10.1±0.02µs 10.0±0.02µs -0.99%
RegExp Creation (Compiler) 1036.3±3.53ns 1333.4±14.71ns +28.67%
RegExp Creation (Execution) 9.8±0.05µs 9.7±0.05µs -1.02%
RegExp Creation (Parser) 8.4±0.01µs 8.4±0.01µs 0.00%
RegExp Literal (Compiler) 1148.4±11.71ns 1522.5±10.75ns +32.58%
RegExp Literal (Execution) 13.1±0.05µs 12.9±0.04µs -1.53%
RegExp Literal (Parser) 8.1±0.01µs 8.1±0.01µs 0.00%
RegExp Literal Creation (Compiler) 1030.2±2.46ns 1313.4±15.71ns +27.49%
RegExp Literal Creation (Execution) 9.9±0.16µs 9.7±0.07µs -2.02%
RegExp Literal Creation (Parser) 6.3±0.01µs 6.4±0.01µs +1.59%
Static Object Property Access (Compiler) 974.6±5.20ns 1309.0±3.19ns +34.31%
Static Object Property Access (Execution) 6.6±0.03µs 6.6±0.03µs 0.00%
Static Object Property Access (Parser) 10.0±0.02µs 9.8±0.01µs -2.00%
String Object Access (Compiler) 1022.6±5.62ns 1374.8±3.51ns +34.44%
String Object Access (Execution) 8.7±0.03µs 7.5±0.02µs -13.79%
String Object Access (Parser) 13.9±0.02µs 13.8±0.02µs -0.72%
String comparison (Compiler) 1283.9±12.93ns 1979.0±10.45ns +54.14%
String comparison (Execution) 7.2±0.03µs 6.1±0.01µs -15.28%
String comparison (Parser) 10.8±0.03µs 10.9±0.03µs +0.93%
String concatenation (Compiler) 1066.0±2.38ns 1547.3±10.09ns +45.15%
String concatenation (Execution) 6.2±0.02µs 5.6±0.02µs -9.68%
String concatenation (Parser) 7.6±0.02µs 7.6±0.01µs 0.00%
String copy (Compiler) 878.9±4.88ns 1231.2±7.70ns +40.08%
String copy (Execution) 5.3±0.02µs 5.0±0.01µs -5.66%
String copy (Parser) 5.6±0.01µs 5.7±0.01µs +1.79%
Symbols (Compiler) 637.0±1.49ns 823.9±1.77ns +29.34%
Symbols (Execution) 4.9±0.02µs 4.8±0.02µs -2.04%
Symbols (Parser) 4.3±0.02µs 4.3±0.00µs 0.00%

@raskad
Copy link
Member Author

raskad commented Feb 19, 2022

bors r+

bors bot pushed a commit that referenced this pull request Feb 19, 2022
This is an attempt to refactor the environments to be more performant at runtime. The idea is, to shift the dynamic hashmap environment lookups from runtime to compile time.

Currently the environments hold hashmaps that contain binding identifiers, values and additional information that is needed to identify some errors. Because bindings in outer environments are accessible from inner environments, this can lead to a traversal through all environments (in the worst case to the global environment).

This change to the environment structure pushes most of the work that is needed to access bindings to the compile time. At compile time, environments and bindings in the environments are being assigned indices. These indices are then stored instead of the `Sym` that is currently used to access bindings. At runtime, the indices are used to access bindings in a fixed size `Vec` per environment. This brings multiple benefits:
 - No hashmap access needed at runtime
 - The number of bindings per environment is known at compile time. Environments only need a single allocation, as their size is constant.
 - Potential for optimizations with `unsafe` https://doc.rust-lang.org/std/vec/struct.Vec.html#method.get_unchecked

Additionally, this changes the global object to have it's bindings directly stored on the `Realm`. This should reduce some overhead from access trough gc objects and makes some optimizations for the global object possible.

The benchmarks look not that great on the first sight. But if you look closer, I think it is apparent, that this is a positive change. The difference is most apparent on Mini and Clean as they are longer (still not near any real life js but less specific that most other benchmarks):

| Test | Base         | PR               | % |
|------|--------------|------------------|---|
| Clean js (Compiler) | **1929.1±5.37ns** | 4.1±0.02µs | **+112.53%** |
| Clean js (Execution) | 1487.4±7.50µs | **987.3±3.78µs** | **-33.62%** |

The compile time is up in all benchmarks, as expected. The percentage is huge, but if we look at the real numbers, we can see that this is an issue of orders of magnitude. While compile is up `112.53%`, the real change is `~+2µs`. Execution is only down `33.62%`, but the real time changed by `~-500µs`.

Co-authored-by: Iban Eguia <[email protected]>
@bors
Copy link

bors bot commented Feb 19, 2022

Pull request successfully merged into main.

Build succeeded:

@bors bors bot changed the title Refactor the environment for runtime performance [Merged by Bors] - Refactor the environment for runtime performance Feb 19, 2022
@bors bors bot closed this Feb 19, 2022
@bors bors bot deleted the refactor-environment branch February 19, 2022 18:57
Razican added a commit that referenced this pull request Feb 21, 2022
This is an attempt to refactor the environments to be more performant at runtime. The idea is, to shift the dynamic hashmap environment lookups from runtime to compile time.

Currently the environments hold hashmaps that contain binding identifiers, values and additional information that is needed to identify some errors. Because bindings in outer environments are accessible from inner environments, this can lead to a traversal through all environments (in the worst case to the global environment).

This change to the environment structure pushes most of the work that is needed to access bindings to the compile time. At compile time, environments and bindings in the environments are being assigned indices. These indices are then stored instead of the `Sym` that is currently used to access bindings. At runtime, the indices are used to access bindings in a fixed size `Vec` per environment. This brings multiple benefits:
 - No hashmap access needed at runtime
 - The number of bindings per environment is known at compile time. Environments only need a single allocation, as their size is constant.
 - Potential for optimizations with `unsafe` https://doc.rust-lang.org/std/vec/struct.Vec.html#method.get_unchecked

Additionally, this changes the global object to have it's bindings directly stored on the `Realm`. This should reduce some overhead from access trough gc objects and makes some optimizations for the global object possible.

The benchmarks look not that great on the first sight. But if you look closer, I think it is apparent, that this is a positive change. The difference is most apparent on Mini and Clean as they are longer (still not near any real life js but less specific that most other benchmarks):

| Test | Base         | PR               | % |
|------|--------------|------------------|---|
| Clean js (Compiler) | **1929.1±5.37ns** | 4.1±0.02µs | **+112.53%** |
| Clean js (Execution) | 1487.4±7.50µs | **987.3±3.78µs** | **-33.62%** |

The compile time is up in all benchmarks, as expected. The percentage is huge, but if we look at the real numbers, we can see that this is an issue of orders of magnitude. While compile is up `112.53%`, the real change is `~+2µs`. Execution is only down `33.62%`, but the real time changed by `~-500µs`.

Co-authored-by: Iban Eguia <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
execution Issues or PRs related to code execution Internal Category for changelog performance Performance related changes and issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants