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

Expose raw builtin functions #1997

Closed
wants to merge 1 commit into from
Closed

Expose raw builtin functions #1997

wants to merge 1 commit into from

Conversation

HalidOdat
Copy link
Member

This PR exposes the raw buitin functions.

It changes the following:

  • Expose Builtin functions
  • Add pub reexport in bultin functions
  • Add disclaimer in builtin modules that the raw builtin function could change.

@HalidOdat HalidOdat added enhancement New feature or request builtins PRs and Issues related to builtins/intrinsics API labels Apr 1, 2022
@github-actions
Copy link

github-actions bot commented Apr 1, 2022

Test262 conformance changes

VM implementation

Test result main count PR count difference
Total 88,428 88,428 0
Passed 44,003 44,003 0
Ignored 21,495 21,495 0
Failed 22,930 22,930 0
Panics 0 0 0
Conformance 49.76% 49.76% 0.00%

@codecov
Copy link

codecov bot commented Apr 1, 2022

Codecov Report

Merging #1997 (da8cbf7) into main (48f23b3) will increase coverage by 0.03%.
The diff coverage is 59.33%.

@@            Coverage Diff             @@
##             main    #1997      +/-   ##
==========================================
+ Coverage   45.86%   45.90%   +0.03%     
==========================================
  Files         206      206              
  Lines       17097    17150      +53     
==========================================
+ Hits         7842     7872      +30     
- Misses       9255     9278      +23     
Impacted Files Coverage Δ
boa_engine/src/builtins/array/mod.rs 75.78% <ø> (+1.02%) ⬆️
boa_engine/src/builtins/array_buffer/mod.rs 8.00% <0.00%> (ø)
boa_engine/src/builtins/dataview/mod.rs 8.24% <0.00%> (ø)
boa_engine/src/builtins/error/aggregate.rs 38.88% <0.00%> (ø)
boa_engine/src/builtins/generator/mod.rs 7.77% <0.00%> (ø)
boa_engine/src/builtins/generator_function/mod.rs 76.19% <0.00%> (ø)
boa_engine/src/builtins/mod.rs 8.06% <ø> (ø)
boa_engine/src/builtins/proxy/mod.rs 8.82% <0.00%> (ø)
boa_engine/src/builtins/typed_array/mod.rs 3.67% <0.00%> (ø)
boa_engine/src/builtins/symbol/mod.rs 58.57% <28.57%> (+0.82%) ⬆️
... and 49 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 48f23b3...da8cbf7. Read the comment docs.

@github-actions
Copy link

github-actions bot commented Apr 1, 2022

Benchmark for 15bf3b1

Click to view benchmark
Test Base PR %
Arithmetic operations (Compiler) 487.2±1.26ns 488.5±0.88ns +0.27%
Arithmetic operations (Execution) 467.5±0.76ns 460.0±1.34ns -1.60%
Arithmetic operations (Parser) 5.5±0.01µs 5.4±0.01µs -1.82%
Array access (Compiler) 1344.6±4.53ns 1324.8±2.00ns -1.47%
Array access (Execution) 7.7±0.01µs 8.0±0.05µs +3.90%
Array access (Parser) 12.5±0.08µs 12.5±0.06µs 0.00%
Array creation (Compiler) 1987.9±6.14ns 1943.1±4.11ns -2.25%
Array creation (Execution) 2.4±0.00ms 2.4±0.02ms 0.00%
Array creation (Parser) 13.9±0.04µs 14.0±0.12µs +0.72%
Array pop (Compiler) 3.8±0.01µs 3.8±0.02µs 0.00%
Array pop (Execution) 1084.3±3.73µs 1062.6±3.66µs -2.00%
Array pop (Parser) 138.5±0.18µs 139.2±0.17µs +0.51%
Boolean Object Access (Compiler) 1131.9±3.59ns 1123.4±3.78ns -0.75%
Boolean Object Access (Execution) 4.0±0.01µs 4.0±0.01µs 0.00%
Boolean Object Access (Parser) 14.5±0.02µs 14.6±0.09µs +0.69%
Clean js (Compiler) 3.7±0.01µs 3.6±0.01µs -2.70%
Clean js (Execution) 706.9±4.47µs 700.9±4.56µs -0.85%
Clean js (Parser) 30.0±0.09µs 30.1±0.06µs +0.33%
Create Realm 252.6±0.79ns 263.3±0.33ns +4.24%
Dynamic Object Property Access (Compiler) 1775.4±6.70ns 1732.3±6.26ns -2.43%
Dynamic Object Property Access (Execution) 5.1±0.02µs 5.2±0.07µs +1.96%
Dynamic Object Property Access (Parser) 10.9±0.04µs 11.0±0.07µs +0.92%
Fibonacci (Compiler) 2.4±0.00µs 2.4±0.00µs 0.00%
Fibonacci (Execution) 1343.2±3.50µs 1353.6±3.98µs +0.77%
Fibonacci (Parser) 16.5±0.06µs 16.9±0.08µs +2.42%
For loop (Compiler) 2.1±0.01µs 2.1±0.01µs 0.00%
For loop (Execution) 14.8±0.03µs 14.9±0.07µs +0.68%
For loop (Parser) 14.3±0.04µs 14.3±0.06µs 0.00%
Mini js (Compiler) 3.6±0.01µs 3.5±0.01µs -2.78%
Mini js (Execution) 668.8±4.12µs 654.9±3.35µs -2.08%
Mini js (Parser) 26.2±0.11µs 26.3±0.04µs +0.38%
Number Object Access (Compiler) 1056.2±2.63ns 1063.5±4.68ns +0.69%
Number Object Access (Execution) 3.1±0.01µs 3.2±0.06µs +3.23%
Number Object Access (Parser) 11.2±0.01µs 11.3±0.02µs +0.89%
Object Creation (Compiler) 1514.9±3.59ns 1477.4±3.99ns -2.48%
Object Creation (Execution) 4.8±0.02µs 4.9±0.02µs +2.08%
Object Creation (Parser) 9.5±0.02µs 9.6±0.05µs +1.05%
RegExp (Compiler) 1732.6±5.31ns 1707.2±6.82ns -1.47%
RegExp (Execution) 11.3±0.04µs 11.3±0.03µs 0.00%
RegExp (Parser) 10.6±0.11µs 10.6±0.03µs 0.00%
RegExp Creation (Compiler) 1499.7±3.04ns 1509.1±4.19ns +0.63%
RegExp Creation (Execution) 8.4±0.04µs 8.5±0.03µs +1.19%
RegExp Creation (Parser) 8.8±0.06µs 8.9±0.03µs +1.14%
RegExp Literal (Compiler) 1736.0±5.07ns 1752.1±7.25ns +0.93%
RegExp Literal (Execution) 11.2±0.04µs 11.2±0.03µs 0.00%
RegExp Literal (Parser) 8.5±0.03µs 8.6±0.02µs +1.18%
RegExp Literal Creation (Compiler) 1483.8±3.37ns 1476.1±16.37ns -0.52%
RegExp Literal Creation (Execution) 8.3±0.03µs 8.5±0.03µs +2.41%
RegExp Literal Creation (Parser) 6.8±0.05µs 6.8±0.02µs 0.00%
Static Object Property Access (Compiler) 1528.4±4.33ns 1488.2±3.81ns -2.63%
Static Object Property Access (Execution) 5.0±0.02µs 5.1±0.03µs +2.00%
Static Object Property Access (Parser) 10.2±0.09µs 10.3±0.05µs +0.98%
String Object Access (Compiler) 1537.1±7.61ns 1533.0±8.75ns -0.27%
String Object Access (Execution) 5.9±0.02µs 5.9±0.03µs 0.00%
String Object Access (Parser) 14.1±0.02µs 14.3±0.14µs +1.42%
String comparison (Compiler) 2.3±0.01µs 2.2±0.01µs -4.35%
String comparison (Execution) 4.4±0.01µs 4.5±0.01µs +2.27%
String comparison (Parser) 11.5±0.01µs 11.5±0.07µs 0.00%
String concatenation (Compiler) 1747.3±6.93ns 1743.7±5.90ns -0.21%
String concatenation (Execution) 4.2±0.01µs 4.3±0.01µs +2.38%
String concatenation (Parser) 7.9±0.01µs 7.9±0.05µs 0.00%
String copy (Compiler) 1382.3±6.02ns 1356.4±5.73ns -1.87%
String copy (Execution) 4.0±0.02µs 4.1±0.01µs +2.50%
String copy (Parser) 5.9±0.01µs 6.0±0.07µs +1.69%
Symbols (Compiler) 952.9±1.89ns 966.5±3.19ns +1.43%
Symbols (Execution) 3.9±0.01µs 4.1±0.02µs +5.13%
Symbols (Parser) 4.6±0.01µs 4.6±0.03µs 0.00%

@raskad
Copy link
Member

raskad commented Apr 9, 2022

I think we should make a strategic decision if we want to make the builtins public or if we want to follow the Js*-type approach like in #2003 or #1746. Doing both seems like giving users different apis for the same task.
If we make the builtins public, I do not see any direct benefit of additional Js* types.

@HalidOdat
Copy link
Member Author

Yeah, the Js-types are an easier and more user friendly API. So I'm closing this :)

@HalidOdat HalidOdat closed this Apr 9, 2022
@HalidOdat HalidOdat deleted the expose-builtins branch April 9, 2022 12:34
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.

3 participants