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

Refactor internal methods and make some builtins spec compliant #1422

Merged
merged 1 commit into from
Jul 22, 2021

Conversation

HalidOdat
Copy link
Member

@HalidOdat HalidOdat commented Jul 22, 2021

We currently have the internal object method such as set (which in reality is [[set]]) the problem is that we do not differentiate between Set and [[set]] (same goes for many others [[get]], etc). That's is why in this PR internal method with [[something]] are renamed to __something__. This makes it very clear that we are calling an internal method using the [[]] syntax.

Rename internal object methods:

  • set => __set__
  • get => __get__
  • etc

Implement some spec functions:

  • CreateDataProperty()
  • CreateDataPropertyOrThrow()
  • Set
  • Get
  • HasProperty
  • IsExtensible
  • DeletePropertyOrThrow
  • DefineOwnProperty

The above methods help with implementing other builtin function and are used everywhere in the spec.

Documented/make spec compliant:

  • Object.prototype.toString
  • Object.prototype.assign
  • get RegExp.prototype.flags
  • Reflect.get
  • RegExp abstract_builtin_exec helper function
  • GcObject::to_property_descriptor
  • GcObject::get_method
  • Array.prototype.of
  • Array.prototype.push
  • Array.prototype.pop
  • Array.prototype.forEach
  • Array.prototype.join
  • Array.prototype.toString
  • Array.prototype.reverse
  • Array.prototype.shift
  • Array.prototype.unshift
  • Array.prototype.every
  • Array.prototype.some

Misc changes:

  • Made all internal methods take &self instead of &mut self (this avoids some clones).
  • removed unnecessary get_arg_at_index() function in console builtin
  • Implement From<u64> to PropertyKey

@HalidOdat HalidOdat added bug Something isn't working technical debt builtins PRs and Issues related to builtins/intrinsics execution Issues or PRs related to code execution labels Jul 22, 2021
@HalidOdat HalidOdat added this to the v0.13.0 milestone Jul 22, 2021
@github-actions
Copy link

github-actions bot commented Jul 22, 2021

Test262 conformance changes:

Test result master count PR count difference
Total 78,897 78,897 0
Passed 27,984 28,148 +164
Ignored 15,616 15,616 0
Failed 35,297 35,133 -164
Panics 0 2 +2
Conformance 35.47% 35.68% +0.21%
Fixed tests:
test/built-ins/Array/prototype/pop/S15.4.4.6_A2_T1.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/pop/S15.4.4.6_A2_T1.js (previously Failed)
test/built-ins/Array/prototype/pop/S15.4.4.6_A3_T1.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/pop/S15.4.4.6_A3_T1.js (previously Failed)
test/built-ins/Array/prototype/pop/S15.4.4.6_A2_T2.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/pop/S15.4.4.6_A2_T2.js (previously Failed)
test/built-ins/Array/prototype/pop/S15.4.4.6_A3_T2.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/pop/S15.4.4.6_A3_T2.js (previously Failed)
test/built-ins/Array/prototype/pop/throws-with-string-receiver.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/pop/throws-with-string-receiver.js (previously Failed)
test/built-ins/Array/prototype/pop/clamps-to-integer-limit.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/pop/clamps-to-integer-limit.js (previously Failed)
test/built-ins/Array/prototype/pop/S15.4.4.6_A3_T3.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/pop/S15.4.4.6_A3_T3.js (previously Failed)
test/built-ins/Array/prototype/pop/length-near-integer-limit.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/pop/length-near-integer-limit.js (previously Failed)
test/built-ins/Array/prototype/join/S15.4.4.5_A2_T3.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/join/S15.4.4.5_A2_T3.js (previously Failed)
test/built-ins/Array/prototype/join/S15.4.4.5_A1.3_T1.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/join/S15.4.4.5_A1.3_T1.js (previously Failed)
test/built-ins/Array/prototype/join/S15.4.4.5_A3.2_T1.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/join/S15.4.4.5_A3.2_T1.js (previously Failed)
test/built-ins/Array/prototype/join/S15.4.4.5_A2_T4.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/join/S15.4.4.5_A2_T4.js (previously Failed)
test/built-ins/Array/prototype/join/S15.4.4.5_A1.2_T1.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/join/S15.4.4.5_A1.2_T1.js (previously Failed)
test/built-ins/Array/prototype/unshift/throws-with-string-receiver.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/unshift/throws-with-string-receiver.js (previously Failed)
test/built-ins/Array/prototype/unshift/clamps-to-integer-limit.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/unshift/clamps-to-integer-limit.js (previously Failed)
test/built-ins/Array/prototype/push/S15.4.4.7_A4_T2.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/push/S15.4.4.7_A4_T2.js (previously Failed)
test/built-ins/Array/prototype/push/S15.4.4.7_A4_T1.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/push/S15.4.4.7_A4_T1.js (previously Failed)
test/built-ins/Array/prototype/push/throws-with-string-receiver.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/push/throws-with-string-receiver.js (previously Failed)
test/built-ins/Array/prototype/push/call-with-boolean.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/push/call-with-boolean.js (previously Failed)
test/built-ins/Array/prototype/push/clamps-to-integer-limit.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/push/clamps-to-integer-limit.js (previously Failed)
test/built-ins/Array/prototype/push/length-near-integer-limit-set-failure.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/push/length-near-integer-limit-set-failure.js (previously Failed)
test/built-ins/Array/prototype/push/S15.4.4.7_A3.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/push/S15.4.4.7_A3.js (previously Failed)
test/built-ins/Array/prototype/push/length-near-integer-limit.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/push/length-near-integer-limit.js (previously Failed)
test/built-ins/Array/prototype/indexOf/15.4.4.14-9-9.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/indexOf/15.4.4.14-9-9.js (previously Failed)
test/built-ins/Array/prototype/indexOf/length-near-integer-limit.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/indexOf/length-near-integer-limit.js (previously Failed)
test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-19.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-19.js (previously Failed)
test/built-ins/Array/prototype/every/15.4.4.16-1-3.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/every/15.4.4.16-1-3.js (previously Failed)
test/built-ins/Array/prototype/every/15.4.4.16-7-b-9.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/every/15.4.4.16-7-b-9.js (previously Failed)
test/built-ins/Array/prototype/every/15.4.4.16-7-b-8.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/every/15.4.4.16-7-b-8.js (previously Failed)
test/built-ins/Array/prototype/every/15.4.4.16-1-2.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/every/15.4.4.16-1-2.js (previously Failed)
test/built-ins/Array/prototype/every/15.4.4.16-1-7.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/every/15.4.4.16-1-7.js (previously Failed)
test/built-ins/Array/prototype/every/15.4.4.16-7-b-15.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/every/15.4.4.16-7-b-15.js (previously Failed)
test/built-ins/Array/prototype/every/15.4.4.16-1-5.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/every/15.4.4.16-1-5.js (previously Failed)
test/built-ins/Array/prototype/every/15.4.4.16-7-b-3.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/every/15.4.4.16-7-b-3.js (previously Failed)
test/built-ins/Array/prototype/every/15.4.4.16-7-5.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/every/15.4.4.16-7-5.js (previously Failed)
test/built-ins/Array/prototype/every/15.4.4.16-4-1.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/every/15.4.4.16-4-1.js (previously Failed)
test/built-ins/Array/prototype/every/15.4.4.16-7-b-10.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/every/15.4.4.16-7-b-10.js (previously Failed)
test/built-ins/Array/prototype/every/15.4.4.16-7-b-1.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/every/15.4.4.16-7-b-1.js (previously Failed)
test/built-ins/Array/prototype/every/15.4.4.16-4-15.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/every/15.4.4.16-4-15.js (previously Failed)
test/built-ins/Array/prototype/every/15.4.4.16-1-1.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/every/15.4.4.16-1-1.js (previously Failed)
test/built-ins/Array/prototype/some/15.4.4.17-1-1.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/some/15.4.4.17-1-1.js (previously Failed)
test/built-ins/Array/prototype/some/15.4.4.17-1-3.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/some/15.4.4.17-1-3.js (previously Failed)
test/built-ins/Array/prototype/some/15.4.4.17-1-2.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/some/15.4.4.17-1-2.js (previously Failed)
test/built-ins/Array/prototype/some/15.4.4.17-7-b-10.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/some/15.4.4.17-7-b-10.js (previously Failed)
test/built-ins/Array/prototype/some/15.4.4.17-7-b-9.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/some/15.4.4.17-7-b-9.js (previously Failed)
test/built-ins/Array/prototype/some/15.4.4.17-7-b-8.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/some/15.4.4.17-7-b-8.js (previously Failed)
test/built-ins/Array/prototype/some/15.4.4.17-7-5.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/some/15.4.4.17-7-5.js (previously Failed)
test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-19.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/some/15.4.4.17-7-c-ii-19.js (previously Failed)
test/built-ins/Array/prototype/some/15.4.4.17-4-15.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/some/15.4.4.17-4-15.js (previously Failed)
test/built-ins/Array/prototype/some/15.4.4.17-7-b-15.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/some/15.4.4.17-7-b-15.js (previously Failed)
test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-30.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-30.js (previously Failed)
test/built-ins/Array/prototype/some/15.4.4.17-7-b-1.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/some/15.4.4.17-7-b-1.js (previously Failed)
test/built-ins/Array/prototype/some/15.4.4.17-1-7.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/some/15.4.4.17-1-7.js (previously Failed)
test/built-ins/Array/prototype/some/15.4.4.17-7-9.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/some/15.4.4.17-7-9.js (previously Failed)
test/built-ins/Array/prototype/some/15.4.4.17-7-b-3.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/some/15.4.4.17-7-b-3.js (previously Failed)
test/built-ins/Array/prototype/some/15.4.4.17-1-5.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/some/15.4.4.17-1-5.js (previously Failed)
test/built-ins/Array/prototype/some/15.4.4.17-4-1.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/some/15.4.4.17-4-1.js (previously Failed)
test/built-ins/Array/prototype/toString/S15.4.4.2_A1_T3.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/toString/S15.4.4.2_A1_T3.js (previously Failed)
test/built-ins/Array/prototype/toString/S15.4.4.2_A1_T2.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/toString/S15.4.4.2_A1_T2.js (previously Failed)
test/built-ins/Array/prototype/forEach/15.4.4.18-4-1.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/forEach/15.4.4.18-4-1.js (previously Failed)
test/built-ins/Array/prototype/forEach/15.4.4.18-7-2.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/forEach/15.4.4.18-7-2.js (previously Failed)
test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-14.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-14.js (previously Failed)
test/built-ins/Array/prototype/forEach/15.4.4.18-7-4.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/forEach/15.4.4.18-7-4.js (previously Failed)
test/built-ins/Array/prototype/forEach/15.4.4.18-7-3.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/forEach/15.4.4.18-7-3.js (previously Failed)
test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-8.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-8.js (previously Failed)
test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-9.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-9.js (previously Failed)
test/built-ins/Array/prototype/forEach/15.4.4.18-1-2.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/forEach/15.4.4.18-1-2.js (previously Failed)
test/built-ins/Array/prototype/forEach/15.4.4.18-1-7.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/forEach/15.4.4.18-1-7.js (previously Failed)
test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-3.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-3.js (previously Failed)
test/built-ins/Array/prototype/forEach/15.4.4.18-1-5.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/forEach/15.4.4.18-1-5.js (previously Failed)
test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-1.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-1.js (previously Failed)
test/built-ins/Array/prototype/forEach/15.4.4.18-1-1.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/forEach/15.4.4.18-1-1.js (previously Failed)
test/built-ins/Array/prototype/forEach/15.4.4.18-1-3.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/forEach/15.4.4.18-1-3.js (previously Failed)
test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-10.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-10.js (previously Failed)
test/built-ins/Array/prototype/forEach/15.4.4.18-4-15.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/forEach/15.4.4.18-4-15.js (previously Failed)
test/built-ins/Array/prototype/reduceRight/length-near-integer-limit.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/reduceRight/length-near-integer-limit.js (previously Failed)
test/built-ins/Array/prototype/reverse/get_if_present_with_delete.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/reverse/get_if_present_with_delete.js (previously Failed)
test/built-ins/Array/prototype/reverse/call-with-boolean.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/reverse/call-with-boolean.js (previously Failed)
test/built-ins/Array/length/S15.4.2.2_A2.1_T1.js [strict mode] (previously Failed)
test/built-ins/Array/length/S15.4.2.2_A2.1_T1.js (previously Failed)
test/built-ins/Object/assign/assignment-to-readonly-property-of-target-must-throw-a-typeerror-exception.js [strict mode] (previously Failed)
test/built-ins/Object/assign/assignment-to-readonly-property-of-target-must-throw-a-typeerror-exception.js (previously Failed)
test/built-ins/Object/assign/target-set-not-writable.js [strict mode] (previously Failed)
test/built-ins/Object/assign/target-set-not-writable.js (previously Failed)
test/built-ins/RegExp/prototype/Symbol.replace/coerce-lastindex.js [strict mode] (previously Failed)
test/built-ins/RegExp/prototype/Symbol.replace/coerce-lastindex.js (previously Failed)
New panics:
test/built-ins/Array/of/proto-from-ctor-realm.js [strict mode] (previously Failed)
test/built-ins/Array/of/proto-from-ctor-realm.js (previously Failed)

@github-actions
Copy link

Benchmark for 660b265

Click to view benchmark
Test PR Benchmark Master Benchmark %
Arithmetic operations (Execution) 268.4±3.47ns 269.3±10.89ns -0.33%
Arithmetic operations (Full) 301.7±41.50µs 273.6±5.93µs +10.27%
Array access (Execution) 6.5±0.05µs 6.3±0.10µs +3.17%
Array access (Full) 308.3±3.81µs 290.0±10.16µs +6.31%
Array creation (Execution) 2.6±0.01ms 2.7±0.03ms -3.70%
Array creation (Full) 2.9±0.02ms 3.0±0.07ms -3.33%
Array pop (Execution) 839.9±9.86µs 912.6±4.53µs -7.97%
Array pop (Full) 1360.1±12.47µs 1422.2±12.75µs -4.37%
Boolean Object Access (Execution) 5.3±0.15µs 5.2±0.17µs +1.92%
Boolean Object Access (Full) 302.3±0.97µs 295.7±4.27µs +2.23%
Clean js (Execution) 707.2±4.94µs 621.0±25.18µs +13.88%
Clean js (Full) 1039.5±10.37µs 936.9±21.79µs +10.95%
Clean js (Parser) 40.1±0.88µs 40.7±0.56µs -1.47%
Create Realm 404.1±12.61ns 422.5±15.02ns -4.36%
Dynamic Object Property Access (Execution) 5.1±0.11µs 5.3±0.10µs -3.77%
Dynamic Object Property Access (Full) 300.9±6.92µs 280.6±10.44µs +7.23%
Expression (Parser) 7.2±0.07µs 6.9±0.20µs +4.35%
Fibonacci (Execution) 716.7±45.11µs 754.6±11.92µs -5.02%
Fibonacci (Full) 1080.1±25.76µs 1079.8±58.38µs +0.03%
For loop (Execution) 18.9±0.84µs 19.4±0.79µs -2.58%
For loop (Full) 310.2±6.70µs 298.8±7.52µs +3.82%
For loop (Parser) 19.8±0.12µs 18.9±0.47µs +4.76%
Goal Symbols (Parser) 14.1±0.31µs 14.1±0.29µs 0.00%
Hello World (Parser) 3.9±0.06µs 3.7±0.08µs +5.41%
Long file (Parser) 803.5±19.20ns 801.9±9.59ns +0.20%
Mini js (Execution) 632.3±9.62µs 556.3±13.64µs +13.66%
Mini js (Full) 972.4±5.97µs 847.5±24.57µs +14.74%
Mini js (Parser) 35.4±0.67µs 35.7±0.11µs -0.84%
Number Object Access (Execution) 4.1±0.14µs 3.9±0.17µs +5.13%
Number Object Access (Full) 298.5±1.24µs 289.0±5.80µs +3.29%
Object Creation (Execution) 4.6±0.10µs 4.6±0.07µs 0.00%
Object Creation (Full) 297.7±5.97µs 284.3±7.70µs +4.71%
RegExp (Execution) 13.0±0.28µs 11.8±0.51µs +10.17%
RegExp (Full) 303.4±10.23µs 294.8±7.21µs +2.92%
RegExp Literal (Execution) 13.0±0.19µs 12.2±0.51µs +6.56%
RegExp Literal (Full) 300.2±17.82µs 291.6±9.33µs +2.95%
RegExp Literal Creation (Execution) 9.8±0.27µs 9.3±0.37µs +5.38%
RegExp Literal Creation (Full) 301.3±5.84µs 289.9±8.97µs +3.93%
Static Object Property Access (Execution) 4.8±0.09µs 4.7±0.05µs +2.13%
Static Object Property Access (Full) 298.3±5.37µs 283.9±8.29µs +5.07%
String Object Access (Execution) 6.6±0.26µs 6.8±0.23µs -2.94%
String Object Access (Full) 300.0±5.78µs 303.3±3.70µs -1.09%
String comparison (Execution) 6.4±0.18µs 6.1±0.24µs +4.92%
String comparison (Full) 304.9±2.17µs 281.3±14.91µs +8.39%
String concatenation (Execution) 4.8±0.16µs 4.9±0.13µs -2.04%
String concatenation (Full) 296.3±3.48µs 280.1±10.68µs +5.78%
String copy (Execution) 4.1±0.03µs 3.7±0.16µs +10.81%
String copy (Full) 293.4±0.76µs 281.1±7.34µs +4.38%
Symbols (Execution) 3.1±0.15µs 3.5±0.05µs -11.43%
Symbols (Full) 276.2±3.04µs 273.3±11.43µs +1.06%

@github-actions
Copy link

Benchmark for d2f544e

Click to view benchmark
Test PR Benchmark Master Benchmark %
Arithmetic operations (Execution) 263.9±9.09ns 254.8±7.93ns +3.57%
Arithmetic operations (Full) 290.4±10.18µs 291.9±12.66µs -0.51%
Array access (Execution) 7.1±0.32µs 6.7±0.22µs +5.97%
Array access (Full) 332.9±10.95µs 323.5±9.46µs +2.91%
Array creation (Execution) 2.7±0.07ms 2.5±0.07ms +8.00%
Array creation (Full) 3.0±0.11ms 2.9±0.12ms +3.45%
Array pop (Execution) 857.3±29.56µs 855.5±31.84µs +0.21%
Array pop (Full) 1347.3±40.92µs 1365.1±52.52µs -1.30%
Boolean Object Access (Execution) 5.8±0.22µs 5.4±0.19µs +7.41%
Boolean Object Access (Full) 313.3±11.98µs 318.6±15.60µs -1.66%
Clean js (Execution) 730.2±28.27µs 631.9±39.63µs +15.56%
Clean js (Full) 1028.7±43.24µs 967.1±27.04µs +6.37%
Clean js (Parser) 40.0±1.92µs 40.3±1.93µs -0.74%
Create Realm 432.0±17.76ns 411.7±13.68ns +4.93%
Dynamic Object Property Access (Execution) 5.6±0.16µs 5.4±0.15µs +3.70%
Dynamic Object Property Access (Full) 331.5±13.06µs 312.5±14.26µs +6.08%
Expression (Parser) 6.7±0.23µs 6.9±0.34µs -2.90%
Fibonacci (Execution) 833.3±20.17µs 823.1±27.41µs +1.24%
Fibonacci (Full) 1179.8±34.13µs 1158.8±43.59µs +1.81%
For loop (Execution) 21.1±0.68µs 20.8±0.85µs +1.44%
For loop (Full) 338.2±10.63µs 326.1±12.78µs +3.71%
For loop (Parser) 19.2±0.84µs 18.9±0.70µs +1.59%
Goal Symbols (Parser) 13.6±0.51µs 13.5±1.02µs +0.74%
Hello World (Parser) 3.7±0.19µs 3.8±0.19µs -2.63%
Long file (Parser) 797.9±24.58ns 782.0±29.52ns +2.03%
Mini js (Execution) 657.8±24.17µs 555.3±25.84µs +18.46%
Mini js (Full) 967.5±32.49µs 927.3±29.90µs +4.34%
Mini js (Parser) 34.8±1.54µs 34.8±1.28µs 0.00%
Number Object Access (Execution) 4.4±0.24µs 4.3±0.29µs +2.33%
Number Object Access (Full) 308.4±9.46µs 303.1±17.53µs +1.75%
Object Creation (Execution) 4.9±0.15µs 4.7±0.16µs +4.26%
Object Creation (Full) 319.0±11.27µs 307.8±13.00µs +3.64%
RegExp (Execution) 13.6±0.65µs 13.2±0.50µs +3.03%
RegExp (Full) 334.4±12.77µs 320.4±9.71µs +4.37%
RegExp Literal (Execution) 13.6±0.76µs 13.0±0.51µs +4.62%
RegExp Literal (Full) 335.8±12.77µs 335.8±11.68µs 0.00%
RegExp Literal Creation (Execution) 10.4±0.35µs 10.2±0.46µs +1.96%
RegExp Literal Creation (Full) 326.5±13.89µs 316.0±11.18µs +3.32%
Static Object Property Access (Execution) 5.1±0.18µs 5.1±0.26µs 0.00%
Static Object Property Access (Full) 323.9±13.61µs 312.3±10.84µs +3.71%
String Object Access (Execution) 7.5±0.41µs 7.1±0.31µs +5.63%
String Object Access (Full) 316.4±12.58µs 325.4±15.97µs -2.77%
String comparison (Execution) 6.8±0.33µs 6.7±0.26µs +1.49%
String comparison (Full) 313.2±10.37µs 318.3±17.32µs -1.60%
String concatenation (Execution) 5.4±0.18µs 5.2±0.18µs +3.85%
String concatenation (Full) 303.8±12.07µs 295.8±12.50µs +2.70%
String copy (Execution) 4.3±0.11µs 4.4±1.25µs -2.27%
String copy (Full) 308.3±21.08µs 295.8±17.53µs +4.23%
Symbols (Execution) 3.7±0.14µs 3.6±0.13µs +2.78%
Symbols (Full) 298.0±11.61µs 289.2±12.87µs +3.04%

@HalidOdat HalidOdat force-pushed the refactor/builtins branch from 82cd2c9 to a639899 Compare July 22, 2021 18:42
@HalidOdat HalidOdat merged commit f6d5733 into master Jul 22, 2021
@HalidOdat HalidOdat deleted the refactor/builtins branch July 22, 2021 19:08
@github-actions
Copy link

Benchmark for cf55bcf

Click to view benchmark
Test PR Benchmark Master Benchmark %
Arithmetic operations (Execution) 269.1±12.63ns 291.6±11.91ns -7.72%
Arithmetic operations (Full) 312.6±19.15µs 334.1±19.04µs -6.44%
Array access (Execution) 7.0±0.36µs 7.0±0.90µs 0.00%
Array access (Full) 332.7±22.14µs 359.4±18.51µs -7.43%
Array creation (Execution) 2.8±0.15ms 2.9±0.12ms -3.45%
Array creation (Full) 3.1±0.12ms 3.4±0.13ms -8.82%
Array pop (Execution) 898.1±46.72µs 915.9±74.95µs -1.94%
Array pop (Full) 1450.0±82.19µs 1576.2±81.03µs -8.01%
Boolean Object Access (Execution) 5.7±0.33µs 5.9±0.32µs -3.39%
Boolean Object Access (Full) 334.9±19.15µs 355.4±13.96µs -5.77%
Clean js (Execution) 738.8±34.54µs 670.2±47.19µs +10.24%
Clean js (Full) 1161.2±67.46µs 1083.7±62.34µs +7.15%
Clean js (Parser) 45.0±2.28µs 43.0±2.26µs +4.65%
Create Realm 457.0±33.56ns 458.7±23.38ns -0.37%
Dynamic Object Property Access (Execution) 5.8±0.27µs 5.7±0.32µs +1.75%
Dynamic Object Property Access (Full) 332.3±16.25µs 360.8±19.89µs -7.90%
Expression (Parser) 7.4±0.51µs 7.7±0.29µs -3.90%
Fibonacci (Execution) 852.4±36.10µs 925.0±34.23µs -7.85%
Fibonacci (Full) 1193.2±61.38µs 1263.2±137.84µs -5.54%
For loop (Execution) 21.4±1.16µs 23.6±0.97µs -9.32%
For loop (Full) 337.6±26.68µs 356.6±16.09µs -5.33%
For loop (Parser) 21.7±1.13µs 21.3±0.78µs +1.88%
Goal Symbols (Parser) 15.2±0.60µs 14.8±0.71µs +2.70%
Hello World (Parser) 4.1±0.18µs 4.2±0.23µs -2.38%
Long file (Parser) 883.5±40.84ns 876.4±44.45ns +0.81%
Mini js (Execution) 650.1±34.19µs 642.1±73.58µs +1.25%
Mini js (Full) 1072.6±85.93µs 1014.6±73.89µs +5.72%
Mini js (Parser) 40.5±2.41µs 37.8±2.41µs +7.14%
Number Object Access (Execution) 4.7±0.30µs 4.7±0.28µs 0.00%
Number Object Access (Full) 330.7±17.58µs 350.9±20.23µs -5.76%
Object Creation (Execution) 5.1±0.30µs 5.0±0.28µs +2.00%
Object Creation (Full) 319.3±14.81µs 348.6±14.10µs -8.41%
RegExp (Execution) 14.2±0.74µs 14.6±0.97µs -2.74%
RegExp (Full) 336.7±25.43µs 363.3±15.48µs -7.32%
RegExp Literal (Execution) 14.4±0.77µs 14.3±0.85µs +0.70%
RegExp Literal (Full) 343.3±21.40µs 377.3±19.42µs -9.01%
RegExp Literal Creation (Execution) 10.4±0.64µs 10.5±0.70µs -0.95%
RegExp Literal Creation (Full) 327.8±21.89µs 362.4±49.71µs -9.55%
Static Object Property Access (Execution) 5.3±0.55µs 5.3±0.66µs 0.00%
Static Object Property Access (Full) 324.4±19.28µs 363.4±31.44µs -10.73%
String Object Access (Execution) 7.5±0.46µs 7.9±0.37µs -5.06%
String Object Access (Full) 333.1±22.44µs 356.8±18.69µs -6.64%
String comparison (Execution) 7.1±0.37µs 7.3±0.47µs -2.74%
String comparison (Full) 326.9±18.85µs 357.9±16.83µs -8.66%
String concatenation (Execution) 5.6±0.70µs 5.8±0.31µs -3.45%
String concatenation (Full) 317.5±17.96µs 355.7±19.95µs -10.74%
String copy (Execution) 4.5±0.21µs 4.5±0.20µs 0.00%
String copy (Full) 323.0±17.99µs 347.2±18.37µs -6.97%
Symbols (Execution) 3.9±0.26µs 3.9±0.24µs 0.00%
Symbols (Full) 295.5±17.48µs 313.9±14.47µs -5.86%

@jasonwilliams jasonwilliams mentioned this pull request Sep 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working builtins PRs and Issues related to builtins/intrinsics execution Issues or PRs related to code execution technical debt
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant