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] - Implement ProxyBuilder #2076

Closed
wants to merge 3 commits into from
Closed

Conversation

jedel1043
Copy link
Member

This Pull Request fixes/closes #2075.

It changes the following:

  • Implements a ProxyBuilder struct to be able to create Proxy objects from native function traps.
  • Documents ProxyBuilder and adjusts some documentation.
  • Fixes a clippy lint.

@jedel1043 jedel1043 added enhancement New feature or request builtins PRs and Issues related to builtins/intrinsics API labels May 18, 2022
@jedel1043 jedel1043 added this to the v0.15.0 milestone May 18, 2022
@github-actions
Copy link

Test262 conformance changes

VM implementation

Test result main count PR count difference
Total 90,192 90,192 0
Passed 54,651 54,651 0
Ignored 23,279 23,279 0
Failed 12,262 12,262 0
Panics 0 0 0
Conformance 60.59% 60.59% 0.00%

@codecov
Copy link

codecov bot commented May 18, 2022

Codecov Report

Merging #2076 (12fe403) into main (456da49) will decrease coverage by 0.00%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main    #2076      +/-   ##
==========================================
- Coverage   44.17%   44.17%   -0.01%     
==========================================
  Files         215      216       +1     
  Lines       19371    19379       +8     
==========================================
+ Hits         8558     8561       +3     
- Misses      10813    10818       +5     
Impacted Files Coverage Δ
boa_engine/src/builtins/function/mod.rs 30.08% <ø> (ø)
boa_engine/src/builtins/proxy/mod.rs 8.82% <0.00%> (ø)
...gine/src/object/internal_methods/bound_function.rs 0.00% <ø> (ø)
boa_engine/src/object/internal_methods/proxy.rs 0.00% <ø> (ø)
boa_engine/src/object/jsproxy.rs 0.00% <0.00%> (ø)
boa_engine/src/object/mod.rs 20.10% <ø> (ø)
boa_engine/src/string.rs 54.21% <ø> (ø)
...a_engine/src/syntax/ast/node/statement_list/mod.rs 73.52% <0.00%> (+2.94%) ⬆️
...parser/expression/primary/array_initializer/mod.rs 53.57% <0.00%> (+3.57%) ⬆️
... and 1 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 456da49...12fe403. Read the comment docs.

@github-actions
Copy link

Benchmark for ccd1624

Click to view benchmark
Test Base PR %
Arithmetic operations (Compiler) 537.0±0.97ns 526.3±1.22ns -1.99%
Arithmetic operations (Execution) 454.0±2.07ns 474.8±3.94ns +4.58%
Arithmetic operations (Parser) 6.3±0.06µs 6.3±0.06µs 0.00%
Array access (Compiler) 1543.1±7.09ns 1532.3±6.55ns -0.70%
Array access (Execution) 8.5±0.03µs 8.5±0.03µs 0.00%
Array access (Parser) 13.8±0.06µs 13.8±0.04µs 0.00%
Array creation (Compiler) 2.5±0.01µs 2.4±0.01µs -4.00%
Array creation (Execution) 2.5±0.00ms 2.4±0.01ms -4.00%
Array creation (Parser) 16.0±0.08µs 15.9±0.07µs -0.62%
Array pop (Compiler) 4.2±0.03µs 4.3±0.01µs +2.38%
Array pop (Execution) 1092.7±5.23µs 1080.2±15.34µs -1.14%
Array pop (Parser) 156.5±0.21µs 158.1±0.31µs +1.02%
Boolean Object Access (Compiler) 1169.1±4.45ns 1172.1±5.04ns +0.26%
Boolean Object Access (Execution) 4.5±0.01µs 4.5±0.01µs 0.00%
Boolean Object Access (Parser) 16.0±0.06µs 16.1±0.09µs +0.63%
Clean js (Compiler) 5.1±0.02µs 5.1±0.02µs 0.00%
Clean js (Execution) 703.6±3.25µs 701.0±3.25µs -0.37%
Clean js (Parser) 34.3±0.08µs 34.2±0.10µs -0.29%
Create Realm 282.0±0.57ns 269.2±4.03ns -4.54%
Dynamic Object Property Access (Compiler) 2.0±0.02µs 1993.7±5.12ns -0.31%
Dynamic Object Property Access (Execution) 5.6±0.04µs 5.5±0.02µs -1.79%
Dynamic Object Property Access (Parser) 12.1±0.04µs 12.0±0.05µs -0.83%
Fibonacci (Compiler) 3.0±0.02µs 2.9±0.01µs -3.33%
Fibonacci (Execution) 1422.2±3.77µs 1414.9±3.56µs -0.51%
Fibonacci (Parser) 18.7±0.06µs 18.5±0.06µs -1.07%
For loop (Compiler) 2.8±0.01µs 2.8±0.01µs 0.00%
For loop (Execution) 16.3±0.03µs 16.1±0.06µs -1.23%
For loop (Parser) 16.3±0.06µs 16.3±0.06µs 0.00%
Mini js (Compiler) 4.5±0.01µs 4.5±0.01µs 0.00%
Mini js (Execution) 658.1±6.70µs 654.8±2.88µs -0.50%
Mini js (Parser) 30.0±0.14µs 29.9±0.17µs -0.33%
Number Object Access (Compiler) 1113.1±1.80ns 1121.0±1.79ns +0.71%
Number Object Access (Execution) 3.5±0.01µs 3.5±0.01µs 0.00%
Number Object Access (Parser) 12.7±0.10µs 12.6±0.07µs -0.79%
Object Creation (Compiler) 1721.5±33.89ns 1725.8±3.35ns +0.25%
Object Creation (Execution) 5.4±0.05µs 5.2±0.02µs -3.70%
Object Creation (Parser) 10.6±0.03µs 10.5±0.04µs -0.94%
RegExp (Compiler) 1944.6±24.15ns 1920.0±12.55ns -1.27%
RegExp (Execution) 12.3±0.07µs 12.4±0.21µs +0.81%
RegExp (Parser) 11.7±0.07µs 11.6±0.04µs -0.85%
RegExp Creation (Compiler) 1683.5±13.49ns 1711.7±3.90ns +1.68%
RegExp Creation (Execution) 9.4±0.05µs 9.5±0.05µs +1.06%
RegExp Creation (Parser) 9.8±0.04µs 9.7±0.05µs -1.02%
RegExp Literal (Compiler) 1969.1±52.71ns 1933.5±5.70ns -1.81%
RegExp Literal (Execution) 12.4±0.07µs 12.3±0.29µs -0.81%
RegExp Literal (Parser) 9.5±0.04µs 9.5±0.07µs 0.00%
RegExp Literal Creation (Compiler) 1712.3±8.60ns 1678.3±4.52ns -1.99%
RegExp Literal Creation (Execution) 9.4±0.02µs 9.5±0.05µs +1.06%
RegExp Literal Creation (Parser) 7.6±0.03µs 7.5±0.04µs -1.32%
Static Object Property Access (Compiler) 1786.9±62.53ns 1748.4±8.12ns -2.15%
Static Object Property Access (Execution) 5.3±0.02µs 5.4±0.01µs +1.89%
Static Object Property Access (Parser) 11.4±0.04µs 11.2±0.04µs -1.75%
String Object Access (Compiler) 1559.4±5.42ns 1581.1±8.40ns +1.39%
String Object Access (Execution) 6.4±0.06µs 6.3±0.09µs -1.56%
String Object Access (Parser) 16.1±0.08µs 16.0±0.06µs -0.62%
String comparison (Compiler) 2.5±0.01µs 2.5±0.01µs 0.00%
String comparison (Execution) 4.8±0.03µs 4.8±0.03µs 0.00%
String comparison (Parser) 12.5±0.04µs 12.6±0.06µs +0.80%
String concatenation (Compiler) 1962.9±4.77ns 1953.7±5.05ns -0.47%
String concatenation (Execution) 4.7±0.03µs 4.6±0.01µs -2.13%
String concatenation (Parser) 8.7±0.02µs 8.7±0.03µs 0.00%
String copy (Compiler) 1595.8±5.41ns 1582.7±6.46ns -0.82%
String copy (Execution) 4.3±0.01µs 4.3±0.02µs 0.00%
String copy (Parser) 6.5±0.03µs 6.6±0.19µs +1.54%
Symbols (Compiler) 1167.5±2.47ns 1184.5±2.26ns +1.46%
Symbols (Execution) 4.3±0.01µs 4.4±0.01µs +2.33%
Symbols (Parser) 5.2±0.06µs 5.1±0.04µs -1.92%

@github-actions
Copy link

Benchmark for 1686740

Click to view benchmark
Test Base PR %
Arithmetic operations (Compiler) 547.9±0.84ns 533.4±0.93ns -2.65%
Arithmetic operations (Execution) 632.4±0.56ns 649.9±0.62ns +2.77%
Arithmetic operations (Parser) 6.0±0.02µs 6.1±0.02µs +1.67%
Array access (Compiler) 1474.3±2.63ns 1273.4±15.76ns -13.63%
Array access (Execution) 7.8±0.02µs 7.8±0.02µs 0.00%
Array access (Parser) 12.7±0.02µs 12.7±0.02µs 0.00%
Array creation (Compiler) 2.3±0.01µs 2.0±0.03µs -13.04%
Array creation (Execution) 2.6±0.00ms 2.6±0.00ms 0.00%
Array creation (Parser) 14.6±0.03µs 14.5±0.02µs -0.68%
Array pop (Compiler) 4.0±0.00µs 3.6±0.04µs -10.00%
Array pop (Execution) 1116.3±33.02µs 1121.5±3.10µs +0.47%
Array pop (Parser) 147.8±0.10µs 150.5±0.17µs +1.83%
Boolean Object Access (Compiler) 1158.4±5.46ns 1160.0±28.92ns +0.14%
Boolean Object Access (Execution) 4.2±0.01µs 4.2±0.01µs 0.00%
Boolean Object Access (Parser) 15.2±0.04µs 15.1±0.04µs -0.66%
Clean js (Compiler) 4.8±0.01µs 4.7±0.01µs -2.08%
Clean js (Execution) 680.1±3.97µs 683.9±3.62µs +0.56%
Clean js (Parser) 31.5±0.04µs 31.6±0.06µs +0.32%
Create Realm 280.6±2.34ns 283.8±0.94ns +1.14%
Dynamic Object Property Access (Compiler) 1871.4±8.50ns 1639.6±13.28ns -12.39%
Dynamic Object Property Access (Execution) 5.4±0.02µs 5.4±0.02µs 0.00%
Dynamic Object Property Access (Parser) 11.2±0.02µs 11.2±0.02µs 0.00%
Fibonacci (Compiler) 2.4±0.01µs 2.4±0.03µs 0.00%
Fibonacci (Execution) 1347.2±4.82µs 1335.0±3.49µs -0.91%
Fibonacci (Parser) 17.1±0.03µs 17.2±0.03µs +0.58%
For loop (Compiler) 2.6±0.01µs 2.3±0.04µs -11.54%
For loop (Execution) 16.1±0.03µs 15.9±0.03µs -1.24%
For loop (Parser) 15.1±0.07µs 15.0±0.02µs -0.66%
Mini js (Compiler) 4.2±0.02µs 4.2±0.02µs 0.00%
Mini js (Execution) 645.0±3.84µs 644.8±5.57µs -0.03%
Mini js (Parser) 27.6±0.08µs 27.7±0.04µs +0.36%
Number Object Access (Compiler) 1094.7±2.03ns 942.5±10.26ns -13.90%
Number Object Access (Execution) 3.3±0.00µs 3.2±0.01µs -3.03%
Number Object Access (Parser) 11.9±0.02µs 11.9±0.02µs 0.00%
Object Creation (Compiler) 1633.9±10.82ns 1445.8±15.14ns -11.51%
Object Creation (Execution) 5.1±0.02µs 5.1±0.01µs 0.00%
Object Creation (Parser) 9.8±0.02µs 9.7±0.20µs -1.02%
RegExp (Compiler) 1865.8±14.40ns 1590.4±13.58ns -14.76%
RegExp (Execution) 12.3±0.08µs 11.7±0.07µs -4.88%
RegExp (Parser) 10.8±0.01µs 10.8±0.02µs 0.00%
RegExp Creation (Compiler) 1627.1±5.69ns 1430.9±13.56ns -12.06%
RegExp Creation (Execution) 9.3±0.05µs 9.0±0.06µs -3.23%
RegExp Creation (Parser) 9.0±0.03µs 9.0±0.01µs 0.00%
RegExp Literal (Compiler) 1863.6±16.42ns 1612.7±18.33ns -13.46%
RegExp Literal (Execution) 12.3±0.08µs 11.7±0.07µs -4.88%
RegExp Literal (Parser) 8.8±0.02µs 8.6±0.02µs -2.27%
RegExp Literal Creation (Compiler) 1592.9±3.57ns 1387.5±16.00ns -12.89%
RegExp Literal Creation (Execution) 9.3±0.06µs 9.0±0.04µs -3.23%
RegExp Literal Creation (Parser) 6.9±0.02µs 6.8±0.01µs -1.45%
Static Object Property Access (Compiler) 1665.2±9.72ns 1447.8±16.74ns -13.06%
Static Object Property Access (Execution) 5.3±0.02µs 5.3±0.01µs 0.00%
Static Object Property Access (Parser) 10.6±0.02µs 10.4±0.02µs -1.89%
String Object Access (Compiler) 1523.6±4.45ns 1515.8±8.02ns -0.51%
String Object Access (Execution) 5.9±0.02µs 6.1±0.07µs +3.39%
String Object Access (Parser) 15.0±0.02µs 15.0±0.07µs 0.00%
String comparison (Compiler) 2.3±0.01µs 2.0±0.02µs -13.04%
String comparison (Execution) 4.6±0.01µs 4.6±0.02µs 0.00%
String comparison (Parser) 11.6±0.02µs 11.6±0.02µs 0.00%
String concatenation (Compiler) 1838.4±8.07ns 1604.3±16.35ns -12.73%
String concatenation (Execution) 4.4±0.01µs 4.4±0.02µs 0.00%
String concatenation (Parser) 8.0±0.02µs 8.1±0.04µs +1.25%
String copy (Compiler) 1523.8±7.68ns 1339.6±12.68ns -12.09%
String copy (Execution) 4.1±0.02µs 4.2±0.01µs +2.44%
String copy (Parser) 6.0±0.03µs 6.0±0.02µs 0.00%
Symbols (Compiler) 1001.7±2.09ns 1130.6±2.75ns +12.87%
Symbols (Execution) 4.2±0.02µs 4.3±0.02µs +2.38%
Symbols (Parser) 4.7±0.02µs 4.7±0.01µs 0.00%

Copy link
Member

@raskad raskad left a comment

Choose a reason for hiding this comment

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

The changes look good to me. I like the builder approach.

Should we align this new public api with the existing ones in boa_engine/src/object/ like JsArray, JsFunction, etc.? If not, we basically have an additional kind of public api right?

@jedel1043
Copy link
Member Author

The changes look good to me. I like the builder approach.

Should we align this new public api with the existing ones in boa_engine/src/object/ like JsArray, JsFunction, etc.? If not, we basically have an additional kind of public api right?

Yeah, I can do that. It won't have any methods since Proxy objects don't have methods, but it would be good to have symmetry with the other APIs

@jedel1043
Copy link
Member Author

Done! Will wait for #2079 to be merged, since that PR fixed the lints.

@github-actions
Copy link

Benchmark for 1dcbf80

Click to view benchmark
Test Base PR %
Arithmetic operations (Compiler) 503.3±1.71ns 524.4±1.51ns +4.19%
Arithmetic operations (Execution) 534.8±1.34ns 532.3±1.41ns -0.47%
Arithmetic operations (Parser) 6.5±0.03µs 6.8±0.02µs +4.62%
Array access (Compiler) 1560.6±7.29ns 1546.1±6.82ns -0.93%
Array access (Execution) 9.3±0.05µs 9.1±0.05µs -2.15%
Array access (Parser) 14.2±0.05µs 14.5±0.09µs +2.11%
Array creation (Compiler) 2.5±0.01µs 2.5±0.01µs 0.00%
Array creation (Execution) 2.5±0.01ms 2.5±0.01ms 0.00%
Array creation (Parser) 16.5±0.03µs 16.7±0.03µs +1.21%
Array pop (Compiler) 4.2±0.06µs 4.0±0.01µs -4.76%
Array pop (Execution) 1174.5±8.18µs 1168.8±7.11µs -0.49%
Array pop (Parser) 165.1±0.48µs 165.5±0.39µs +0.24%
Boolean Object Access (Compiler) 1180.0±3.82ns 1173.0±7.10ns -0.59%
Boolean Object Access (Execution) 4.8±0.03µs 4.6±0.01µs -4.17%
Boolean Object Access (Parser) 16.9±0.08µs 17.1±0.05µs +1.18%
Clean js (Compiler) 5.3±0.01µs 5.1±0.02µs -3.77%
Clean js (Execution) 768.6±3.12µs 766.8±3.42µs -0.23%
Clean js (Parser) 36.0±0.11µs 36.3±0.22µs +0.83%
Create Realm 290.6±0.56ns 291.5±0.51ns +0.31%
Dynamic Object Property Access (Compiler) 1999.8±7.63ns 1990.7±7.93ns -0.46%
Dynamic Object Property Access (Execution) 5.8±0.04µs 5.9±0.03µs +1.72%
Dynamic Object Property Access (Parser) 12.8±0.04µs 12.8±0.08µs 0.00%
Fibonacci (Compiler) 2.9±0.01µs 2.9±0.01µs 0.00%
Fibonacci (Execution) 1505.5±6.85µs 1519.8±8.40µs +0.95%
Fibonacci (Parser) 19.4±0.07µs 19.7±0.04µs +1.55%
For loop (Compiler) 2.9±0.01µs 2.9±0.01µs 0.00%
For loop (Execution) 16.9±0.08µs 16.9±0.11µs 0.00%
For loop (Parser) 16.9±0.08µs 17.2±0.05µs +1.78%
Mini js (Compiler) 4.5±0.01µs 4.5±0.04µs 0.00%
Mini js (Execution) 720.8±5.85µs 721.5±5.76µs +0.10%
Mini js (Parser) 31.5±0.11µs 31.9±0.07µs +1.27%
Number Object Access (Compiler) 1119.9±3.30ns 1115.2±2.81ns -0.42%
Number Object Access (Execution) 3.7±0.02µs 3.6±0.09µs -2.70%
Number Object Access (Parser) 13.1±0.03µs 13.5±0.09µs +3.05%
Object Creation (Compiler) 1684.2±4.96ns 1665.9±4.49ns -1.09%
Object Creation (Execution) 5.4±0.03µs 5.6±0.02µs +3.70%
Object Creation (Parser) 11.1±0.04µs 11.1±0.05µs 0.00%
RegExp (Compiler) 1906.1±7.30ns 1977.3±16.29ns +3.74%
RegExp (Execution) 12.9±0.16µs 13.0±0.23µs +0.78%
RegExp (Parser) 12.1±0.07µs 12.3±0.06µs +1.65%
RegExp Creation (Compiler) 1753.3±4.51ns 1700.5±4.35ns -3.01%
RegExp Creation (Execution) 9.9±0.03µs 9.9±0.03µs 0.00%
RegExp Creation (Parser) 10.0±0.07µs 10.1±0.04µs +1.00%
RegExp Literal (Compiler) 1960.5±5.99ns 1912.5±4.42ns -2.45%
RegExp Literal (Execution) 12.9±0.10µs 12.9±0.08µs 0.00%
RegExp Literal (Parser) 9.7±0.06µs 9.9±0.04µs +2.06%
RegExp Literal Creation (Compiler) 1731.9±3.70ns 1712.1±7.76ns -1.14%
RegExp Literal Creation (Execution) 9.9±0.03µs 9.9±0.04µs 0.00%
RegExp Literal Creation (Parser) 7.7±0.06µs 7.6±0.05µs -1.30%
Static Object Property Access (Compiler) 1734.3±3.34ns 1723.9±3.52ns -0.60%
Static Object Property Access (Execution) 5.7±0.04µs 5.8±0.03µs +1.75%
Static Object Property Access (Parser) 12.0±0.09µs 11.9±0.04µs -0.83%
String Object Access (Compiler) 1575.5±6.20ns 1563.8±5.68ns -0.74%
String Object Access (Execution) 7.1±0.06µs 6.7±0.06µs -5.63%
String Object Access (Parser) 16.8±0.08µs 16.9±0.07µs +0.60%
String comparison (Compiler) 2.4±0.01µs 2.4±0.01µs 0.00%
String comparison (Execution) 5.1±0.04µs 5.1±0.02µs 0.00%
String comparison (Parser) 13.3±0.09µs 13.7±0.11µs +3.01%
String concatenation (Compiler) 1924.5±6.18ns 1914.9±9.85ns -0.50%
String concatenation (Execution) 4.9±0.05µs 4.9±0.04µs 0.00%
String concatenation (Parser) 9.3±0.10µs 9.5±0.09µs +2.15%
String copy (Compiler) 1598.9±16.61ns 1616.3±5.34ns +1.09%
String copy (Execution) 4.5±0.03µs 4.6±0.01µs +2.22%
String copy (Parser) 6.9±0.04µs 7.1±0.05µs +2.90%
Symbols (Compiler) 1163.2±3.48ns 1178.9±6.84ns +1.35%
Symbols (Execution) 4.7±0.02µs 4.8±0.02µs +2.13%
Symbols (Parser) 5.2±0.05µs 5.3±0.07µs +1.92%

@github-actions
Copy link

Benchmark for f0f7f87

Click to view benchmark
Test Base PR %
Arithmetic operations (Compiler) 767.0±37.76ns 720.8±34.53ns -6.02%
Arithmetic operations (Execution) 822.9±50.45ns 755.6±38.09ns -8.18%
Arithmetic operations (Parser) 7.6±0.42µs 7.5±0.41µs -1.32%
Array access (Compiler) 2.1±0.09µs 2.1±0.06µs 0.00%
Array access (Execution) 11.6±0.32µs 10.7±0.40µs -7.76%
Array access (Parser) 17.4±1.28µs 16.8±0.80µs -3.45%
Array creation (Compiler) 3.2±0.12µs 3.1±0.17µs -3.13%
Array creation (Execution) 3.2±0.15ms 3.1±0.12ms -3.13%
Array creation (Parser) 19.4±1.11µs 18.9±0.96µs -2.58%
Array pop (Compiler) 5.3±0.19µs 5.3±0.43µs 0.00%
Array pop (Execution) 1366.8±58.59µs 1358.1±52.62µs -0.64%
Array pop (Parser) 208.8±9.69µs 196.4±10.19µs -5.94%
Boolean Object Access (Compiler) 1493.3±81.92ns 1485.7±55.35ns -0.51%
Boolean Object Access (Execution) 6.0±0.36µs 5.8±0.26µs -3.33%
Boolean Object Access (Parser) 19.1±0.85µs 20.0±0.90µs +4.71%
Clean js (Compiler) 6.5±0.34µs 6.4±0.35µs -1.54%
Clean js (Execution) 915.9±43.41µs 877.0±48.42µs -4.25%
Clean js (Parser) 40.2±2.26µs 40.3±2.00µs +0.25%
Create Realm 335.6±15.35ns 348.2±47.81ns +3.75%
Dynamic Object Property Access (Compiler) 2.5±0.14µs 2.5±0.09µs 0.00%
Dynamic Object Property Access (Execution) 8.0±0.83µs 7.6±0.35µs -5.00%
Dynamic Object Property Access (Parser) 14.9±0.66µs 14.4±0.65µs -3.36%
Fibonacci (Compiler) 3.7±0.27µs 3.7±0.16µs 0.00%
Fibonacci (Execution) 1966.5±158.26µs 1897.4±72.90µs -3.51%
Fibonacci (Parser) 22.1±1.40µs 22.1±1.17µs 0.00%
For loop (Compiler) 3.6±0.17µs 3.7±0.61µs +2.78%
For loop (Execution) 20.9±1.23µs 21.1±1.03µs +0.96%
For loop (Parser) 19.6±0.76µs 19.7±0.95µs +0.51%
Mini js (Compiler) 5.7±0.41µs 5.7±0.32µs 0.00%
Mini js (Execution) 831.8±34.18µs 809.9±64.79µs -2.63%
Mini js (Parser) 36.3±2.58µs 35.4±2.33µs -2.48%
Number Object Access (Compiler) 1430.0±62.88ns 1424.2±71.16ns -0.41%
Number Object Access (Execution) 4.5±0.17µs 4.3±0.18µs -4.44%
Number Object Access (Parser) 14.8±0.85µs 15.3±0.60µs +3.38%
Object Creation (Compiler) 2.2±0.11µs 2.2±0.13µs 0.00%
Object Creation (Execution) 7.0±0.38µs 7.2±0.36µs +2.86%
Object Creation (Parser) 12.4±0.58µs 12.5±0.65µs +0.81%
RegExp (Compiler) 2.5±0.15µs 2.5±0.10µs 0.00%
RegExp (Execution) 16.9±0.79µs 16.4±1.03µs -2.96%
RegExp (Parser) 13.8±0.76µs 14.4±0.67µs +4.35%
RegExp Creation (Compiler) 2.3±0.11µs 2.2±0.11µs -4.35%
RegExp Creation (Execution) 12.6±0.49µs 12.2±0.47µs -3.17%
RegExp Creation (Parser) 11.3±0.73µs 11.6±0.69µs +2.65%
RegExp Literal (Compiler) 2.5±0.10µs 2.5±0.09µs 0.00%
RegExp Literal (Execution) 16.9±0.85µs 16.0±0.69µs -5.33%
RegExp Literal (Parser) 11.2±1.30µs 11.4±0.48µs +1.79%
RegExp Literal Creation (Compiler) 2.3±0.10µs 2.2±0.12µs -4.35%
RegExp Literal Creation (Execution) 12.7±0.49µs 12.2±0.58µs -3.94%
RegExp Literal Creation (Parser) 8.9±0.46µs 8.8±0.40µs -1.12%
Static Object Property Access (Compiler) 2.3±0.10µs 2.3±0.09µs 0.00%
Static Object Property Access (Execution) 7.7±0.29µs 7.3±0.43µs -5.19%
Static Object Property Access (Parser) 13.3±0.76µs 13.2±0.60µs -0.75%
String Object Access (Compiler) 1979.3±143.11ns 1957.2±117.91ns -1.12%
String Object Access (Execution) 8.9±0.56µs 8.7±0.32µs -2.25%
String Object Access (Parser) 18.6±0.92µs 18.9±0.99µs +1.61%
String comparison (Compiler) 3.1±0.15µs 3.0±0.16µs -3.23%
String comparison (Execution) 6.4±0.27µs 6.3±0.26µs -1.56%
String comparison (Parser) 14.8±0.92µs 14.7±0.74µs -0.68%
String concatenation (Compiler) 2.5±0.15µs 2.5±0.17µs 0.00%
String concatenation (Execution) 6.3±0.27µs 6.1±0.39µs -3.17%
String concatenation (Parser) 10.5±0.59µs 10.4±0.55µs -0.95%
String copy (Compiler) 2.1±0.09µs 2.1±0.27µs 0.00%
String copy (Execution) 6.0±0.43µs 5.7±0.33µs -5.00%
String copy (Parser) 7.6±0.37µs 7.8±0.38µs +2.63%
Symbols (Compiler) 1605.8±85.95ns 1599.5±68.17ns -0.39%
Symbols (Execution) 5.8±0.26µs 5.8±0.22µs 0.00%
Symbols (Parser) 6.0±0.35µs 6.1±0.28µs +1.67%

@raskad
Copy link
Member

raskad commented May 21, 2022

bors r+

bors bot pushed a commit that referenced this pull request May 21, 2022
This Pull Request fixes/closes #2075.

It changes the following:

- Implements a `ProxyBuilder` struct to be able to create `Proxy` objects from native function traps.
- Documents `ProxyBuilder` and adjusts some documentation.
- Fixes a clippy lint.
@bors
Copy link

bors bot commented May 21, 2022

Pull request successfully merged into main.

Build succeeded:

@bors bors bot changed the title Implement ProxyBuilder [Merged by Bors] - Implement ProxyBuilder May 21, 2022
@bors bors bot closed this May 21, 2022
@bors bors bot deleted the proxy-builder branch May 21, 2022 01:13
Razican pushed a commit that referenced this pull request Jun 8, 2022
This Pull Request fixes/closes #2075.

It changes the following:

- Implements a `ProxyBuilder` struct to be able to create `Proxy` objects from native function traps.
- Documents `ProxyBuilder` and adjusts some documentation.
- Fixes a clippy lint.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API builtins PRs and Issues related to builtins/intrinsics enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expose Proxy builtin as a public API
3 participants