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

Made all Math methods spec compliant #541

Merged
merged 1 commit into from
Jul 4, 2020
Merged

Made all Math methods spec compliant #541

merged 1 commit into from
Jul 4, 2020

Conversation

HalidOdat
Copy link
Member

@HalidOdat HalidOdat commented Jul 3, 2020

It changes the following:

  • Did some cleaning of the Math methods
  • Made Math methods call Interpreter::to_number() and Interpreter::to_uint32()
  • Fix bugs where some methods were panicking when no argument was supplied.
  • Added From<u32> for Value

Slowly deprecating the Values to_ methods, Removed Maths methods dependency on Value::to_* methods

@HalidOdat HalidOdat added bug Something isn't working technical debt builtins PRs and Issues related to builtins/intrinsics labels Jul 3, 2020
@HalidOdat HalidOdat added this to the v0.10.0 milestone Jul 3, 2020
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.

Perfect! :)

@codecov
Copy link

codecov bot commented Jul 3, 2020

Codecov Report

Merging #541 into master will decrease coverage by 0.19%.
The diff coverage is 65.50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #541      +/-   ##
==========================================
- Coverage   68.33%   68.14%   -0.20%     
==========================================
  Files         172      172              
  Lines       10495    10598     +103     
==========================================
+ Hits         7172     7222      +50     
- Misses       3323     3376      +53     
Impacted Files Coverage Δ
boa/src/builtins/math/mod.rs 64.62% <64.58%> (-11.28%) ⬇️
boa/src/builtins/value/conversions.rs 55.71% <75.00%> (+1.16%) ⬆️
boa/src/builtins/math/tests.rs 100.00% <100.00%> (ø)
boa/src/exec/mod.rs 69.93% <0.00%> (+1.39%) ⬆️
boa/src/builtins/number/conversions.rs 65.78% <0.00%> (+2.63%) ⬆️

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 641dce1...634c7c8. Read the comment docs.

@github-actions
Copy link

github-actions bot commented Jul 3, 2020

Benchmark for 607cbe3

Click to view benchmark
Test PR Benchmark Master Benchmark %
Arithmetic operations (Execution) 347.7±25.24ns 329.6±19.72ns +5.49%
Array access (Execution) 11.9±0.88µs 11.7±0.75µs +1.71%
Array creation (Execution) 3.1±0.16ms 3.2±0.18ms -3.13%
Array pop (Execution) 1161.2±81.28µs 1134.9±56.42µs +2.32%
Boolean Object Access (Execution) 4.7±0.28µs 4.6±0.34µs +2.17%
Create Realm 133.1±10.77µs 129.6±9.97µs +2.70%
Dynamic Object Property Access (Execution) 6.3±0.40µs 6.1±0.37µs +3.28%
Expression (Lexer) 1761.1±124.59ns 1788.3±123.97ns -1.52%
Expression (Parser) 4.5±0.38µs 4.4±0.35µs +2.27%
Fibonacci (Execution) 977.5±76.28µs 906.9±61.16µs +7.78%
For loop (Execution) 20.8±1.83µs 19.1±1.19µs +8.90%
For loop (Lexer) 4.4±0.31µs 4.5±0.39µs -2.22%
For loop (Parser) 12.1±1.22µs 11.6±0.89µs +4.31%
Hello World (Lexer) 792.1±62.99ns 808.7±63.23ns -2.05%
Hello World (Parser) 1872.1±154.36ns 1949.4±163.39ns -3.97%
Long file (Parser) 6.0±0.29ms 5.4±0.29ms +11.11%
Number Object Access (Execution) 3.8±0.33µs 3.9±0.37µs -2.56%
Object Creation (Execution) 5.5±0.39µs 5.6±0.45µs -1.79%
RegExp (Execution) 68.4±4.58µs 65.3±4.92µs +4.75%
RegExp Literal (Execution) 75.1±5.31µs 71.2±6.00µs +5.48%
RegExp Literal Creation (Execution) 65.4±4.09µs 64.8±5.35µs +0.93%
Static Object Property Access (Execution) 6.1±0.57µs 6.2±0.50µs -1.61%
String Object Access (Execution) 7.5±0.48µs 7.6±0.66µs -1.32%
String comparison (Execution) 6.2±0.51µs 6.0±0.69µs +3.33%
String concatenation (Execution) 5.2±0.37µs 5.2±0.44µs 0.00%
String copy (Execution) 4.3±0.33µs 4.2±0.34µs +2.38%
Symbols (Execution) 3.6±0.20µs 3.7±0.24µs -2.70%

@HalidOdat HalidOdat merged commit 5f7ec62 into master Jul 4, 2020
@HalidOdat HalidOdat deleted the fix/math-methods branch July 4, 2020 15:17
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 technical debt
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants