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

Implement RegExp flag accessors #1221

Merged
merged 3 commits into from
May 8, 2021
Merged

Implement RegExp flag accessors #1221

merged 3 commits into from
May 8, 2021

Conversation

HalidOdat
Copy link
Member

It changes the following:

  • Implement RegExp.prototype.global accessor
  • Implement RegExp.prototype.multiline accessor
  • Implement RegExp.prototype.dotAll accessor
  • Implement RegExp.prototype.ignoreCase accessor
  • Implement RegExp.prototype.unicode accessor
  • Implement RegExp.prototype.sticky accessor
  • Implement RegExp.prototype.flags accessor

@HalidOdat HalidOdat added enhancement New feature or request builtins PRs and Issues related to builtins/intrinsics labels May 4, 2021
@HalidOdat HalidOdat added this to the v0.12.0 milestone May 4, 2021
@github-actions
Copy link

github-actions bot commented May 4, 2021

Test262 conformance changes:

Test result master count PR count difference
Total 78,497 78,497 0
Passed 25,537 25,679 +142
Ignored 15,587 15,587 0
Failed 37,373 37,231 -142
Panics 13 12 -1
Conformance 32.53 32.71 +0.18%

@github-actions
Copy link

github-actions bot commented May 4, 2021

Benchmark for 9b6ea3d

Click to view benchmark
Test PR Benchmark Master Benchmark %
Arithmetic operations (Execution) 357.1±11.18ns 358.1±9.33ns -0.28%
Arithmetic operations (Full) 254.2±5.67µs 250.0±4.75µs +1.68%
Array access (Execution) 6.0±0.13µs 5.9±0.19µs +1.69%
Array access (Full) 269.1±7.46µs 267.7±3.33µs +0.52%
Array creation (Execution) 2.8±0.09ms 2.9±0.09ms -3.45%
Array creation (Full) 3.0±0.08ms 3.2±0.06ms -6.25%
Array pop (Execution) 900.4±19.22µs 894.0±24.06µs +0.72%
Array pop (Full) 1335.6±37.15µs 1386.6±24.84µs -3.68%
Boolean Object Access (Execution) 5.2±0.14µs 5.4±0.14µs -3.70%
Boolean Object Access (Full) 272.0±4.68µs 268.4±1.23µs +1.34%
Clean js (Execution) 644.2±16.88µs 664.6±9.10µs -3.07%
Clean js (Full) 947.3±18.38µs 960.3±10.76µs -1.35%
Clean js (Parser) 42.8±0.71µs 43.4±0.49µs -1.38%
Create Realm 444.9±12.93ns 431.5±10.84ns +3.11%
Dynamic Object Property Access (Execution) 4.7±0.14µs 4.9±0.12µs -4.08%
Dynamic Object Property Access (Full) 274.9±4.32µs 270.6±2.94µs +1.59%
Expression (Parser) 6.9±0.11µs 7.0±0.07µs -1.43%
Fibonacci (Execution) 760.0±12.21µs 746.7±17.67µs +1.78%
Fibonacci (Full) 1028.8±28.65µs 1047.6±7.62µs -1.79%
For loop (Execution) 21.2±0.43µs 20.4±0.53µs +3.92%
For loop (Full) 278.8±7.32µs 286.2±2.74µs -2.59%
For loop (Parser) 20.4±0.33µs 20.6±0.54µs -0.97%
Goal Symbols (Parser) 14.1±0.33µs 14.5±0.27µs -2.76%
Hello World (Parser) 3.9±0.06µs 4.0±0.02µs -2.50%
Long file (Parser) 781.9±12.36ns 776.3±11.13ns +0.72%
Mini js (Execution) 580.7±15.65µs 599.5±8.78µs -3.14%
Mini js (Full) 873.5±16.62µs 885.0±8.07µs -1.30%
Mini js (Parser) 37.7±0.70µs 38.3±0.18µs -1.57%
Number Object Access (Execution) 4.0±0.10µs 4.1±0.10µs -2.44%
Number Object Access (Full) 270.6±5.66µs 264.9±1.81µs +2.15%
Object Creation (Execution) 4.0±0.13µs 4.0±0.11µs 0.00%
Object Creation (Full) 259.8±5.30µs 263.5±4.17µs -1.40%
RegExp (Execution) 9.1±0.35µs 9.4±0.29µs -3.19%
RegExp (Full) 277.4±7.41µs 271.7±2.43µs +2.10%
RegExp Literal (Execution) 10.5±0.30µs 10.9±0.25µs -3.67%
RegExp Literal (Full) 283.0±4.11µs 270.8±4.59µs +4.51%
RegExp Literal Creation (Execution) 9.1±0.70µs 9.6±0.36µs -5.21%
RegExp Literal Creation (Full) 270.8±6.17µs 265.5±2.46µs +2.00%
Static Object Property Access (Execution) 4.4±0.16µs 4.3±0.13µs +2.33%
Static Object Property Access (Full) 263.5±7.44µs 276.1±14.74µs -4.56%
String Object Access (Execution) 7.2±0.20µs 7.4±0.11µs -2.70%
String Object Access (Full) 280.1±3.57µs 271.3±3.97µs +3.24%
String comparison (Execution) 6.2±0.18µs 6.3±0.18µs -1.59%
String comparison (Full) 274.6±7.04µs 271.7±2.36µs +1.07%
String concatenation (Execution) 5.0±0.17µs 5.0±0.12µs 0.00%
String concatenation (Full) 268.4±4.61µs 259.0±5.32µs +3.63%
String copy (Execution) 3.7±0.10µs 3.9±0.08µs -5.13%
String copy (Full) 257.8±8.09µs 255.7±2.11µs +0.82%
Symbols (Execution) 3.3±0.07µs 3.2±0.08µs +3.12%
Symbols (Full) 248.8±7.35µs 247.7±8.37µs +0.44%

Copy link
Contributor

@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.

Assume the panics are the 2 ghosts that keep showing up in CI.
edit: panics disappeared...

@github-actions
Copy link

github-actions bot commented May 7, 2021

Benchmark for 05b5601

Click to view benchmark
Test PR Benchmark Master Benchmark %
Arithmetic operations (Execution) 338.5±14.31ns 320.0±7.08ns +5.78%
Arithmetic operations (Full) 242.1±8.00µs 254.9±9.36µs -5.02%
Array access (Execution) 5.9±0.14µs 6.1±0.34µs -3.28%
Array access (Full) 277.2±20.86µs 254.4±16.79µs +8.96%
Array creation (Execution) 2.5±0.05ms 2.6±0.09ms -3.85%
Array creation (Full) 2.8±0.11ms 2.8±0.06ms 0.00%
Array pop (Execution) 803.7±20.70µs 842.4±34.75µs -4.59%
Array pop (Full) 1308.4±68.51µs 1257.7±53.67µs +4.03%
Boolean Object Access (Execution) 5.2±0.27µs 4.8±0.21µs +8.33%
Boolean Object Access (Full) 277.1±17.22µs 261.6±12.59µs +5.93%
Clean js (Execution) 629.4±21.73µs 619.0±29.40µs +1.68%
Clean js (Full) 876.3±31.60µs 929.4±36.69µs -5.71%
Clean js (Parser) 38.7±1.16µs 40.6±2.23µs -4.68%
Create Realm 404.5±23.24ns 423.3±16.75ns -4.44%
Dynamic Object Property Access (Execution) 5.1±0.24µs 5.4±0.37µs -5.56%
Dynamic Object Property Access (Full) 274.1±13.47µs 250.7±3.90µs +9.33%
Expression (Parser) 5.9±0.19µs 6.3±0.26µs -6.35%
Fibonacci (Execution) 787.6±18.69µs 808.2±23.37µs -2.55%
Fibonacci (Full) 1099.1±41.22µs 996.1±20.98µs +10.34%
For loop (Execution) 21.1±1.24µs 21.1±0.71µs 0.00%
For loop (Full) 290.1±9.80µs 267.8±4.20µs +8.33%
For loop (Parser) 18.0±0.78µs 19.4±0.97µs -7.22%
Goal Symbols (Parser) 12.8±0.55µs 13.5±0.46µs -5.19%
Hello World (Parser) 3.4±0.10µs 3.6±0.10µs -5.56%
Long file (Parser) 719.5±33.45ns 840.3±110.15ns -14.38%
Mini js (Execution) 555.0±21.25µs 540.8±9.38µs +2.63%
Mini js (Full) 811.3±13.09µs 862.6±34.03µs -5.95%
Mini js (Parser) 34.0±5.06µs 37.1±1.36µs -8.36%
Number Object Access (Execution) 4.2±0.23µs 3.8±0.18µs +10.53%
Number Object Access (Full) 260.4±11.35µs 264.3±14.25µs -1.48%
Object Creation (Execution) 4.2±0.10µs 4.3±0.24µs -2.33%
Object Creation (Full) 265.2±8.71µs 248.6±6.80µs +6.68%
RegExp (Execution) 10.4±0.31µs 10.2±0.31µs +1.96%
RegExp (Full) 270.1±9.02µs 258.8±9.44µs +4.37%
RegExp Literal (Execution) 10.9±0.46µs 10.3±0.48µs +5.83%
RegExp Literal (Full) 287.3±25.81µs 261.7±5.40µs +9.78%
RegExp Literal Creation (Execution) 9.3±0.58µs 9.4±0.56µs -1.06%
RegExp Literal Creation (Full) 268.4±12.64µs 249.3±3.44µs +7.66%
Static Object Property Access (Execution) 4.6±0.20µs 4.6±0.25µs 0.00%
Static Object Property Access (Full) 275.6±18.18µs 248.4±8.59µs +10.95%
String Object Access (Execution) 7.2±0.23µs 6.7±0.15µs +7.46%
String Object Access (Full) 287.7±14.46µs 266.9±20.89µs +7.79%
String comparison (Execution) 6.4±0.22µs 6.2±0.14µs +3.23%
String comparison (Full) 274.2±14.68µs 268.5±17.85µs +2.12%
String concatenation (Execution) 5.3±0.19µs 5.0±0.15µs +6.00%
String concatenation (Full) 264.1±10.20µs 256.4±11.24µs +3.00%
String copy (Execution) 4.3±0.43µs 3.8±0.11µs +13.16%
String copy (Full) 256.5±9.49µs 254.0±8.43µs +0.98%
Symbols (Execution) 3.3±0.10µs 3.4±0.16µs -2.94%
Symbols (Full) 247.9±9.17µs 229.0±5.60µs +8.25%

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, just noticed a couple of things that might require a small fix.

boa/src/builtins/regexp/mod.rs Outdated Show resolved Hide resolved
boa/src/builtins/regexp/mod.rs Show resolved Hide resolved
@HalidOdat HalidOdat requested a review from Razican May 8, 2021 22:17
@github-actions
Copy link

github-actions bot commented May 8, 2021

Benchmark for cb36796

Click to view benchmark
Test PR Benchmark Master Benchmark %
Arithmetic operations (Execution) 382.8±21.34ns 369.1±0.19ns +3.71%
Arithmetic operations (Full) 256.0±0.38µs 247.5±0.61µs +3.43%
Array access (Execution) 6.1±0.01µs 6.2±0.02µs -1.61%
Array access (Full) 279.5±0.45µs 268.4±0.66µs +4.14%
Array creation (Execution) 2.8±0.00ms 2.9±0.12ms -3.45%
Array creation (Full) 3.2±0.00ms 3.2±0.00ms 0.00%
Array pop (Execution) 909.9±18.93µs 915.5±3.17µs -0.61%
Array pop (Full) 1409.6±2.64µs 1459.6±74.56µs -3.43%
Boolean Object Access (Execution) 5.3±0.04µs 5.4±0.24µs -1.85%
Boolean Object Access (Full) 274.8±0.38µs 265.2±0.52µs +3.62%
Clean js (Execution) 663.9±3.58µs 661.0±3.42µs +0.44%
Clean js (Full) 965.6±3.94µs 960.9±6.36µs +0.49%
Clean js (Parser) 40.6±0.04µs 40.7±0.05µs -0.25%
Create Realm 450.6±0.30ns 434.1±0.42ns +3.80%
Dynamic Object Property Access (Execution) 5.2±0.03µs 5.1±0.01µs +1.96%
Dynamic Object Property Access (Full) 276.4±0.69µs 265.8±0.80µs +3.99%
Expression (Parser) 7.0±0.18µs 7.0±0.49µs 0.00%
Fibonacci (Execution) 783.0±1.17µs 775.6±2.28µs +0.95%
Fibonacci (Full) 1078.1±1.24µs 1113.8±62.24µs -3.21%
For loop (Execution) 22.0±0.11µs 22.4±0.11µs -1.79%
For loop (Full) 294.0±0.32µs 289.2±0.94µs +1.66%
For loop (Parser) 19.9±0.23µs 19.7±0.03µs +1.02%
Goal Symbols (Parser) 13.9±0.02µs 14.0±0.02µs -0.71%
Hello World (Parser) 3.8±0.02µs 3.8±0.01µs 0.00%
Long file (Parser) 796.7±0.67ns 789.2±0.61ns +0.95%
Mini js (Execution) 596.9±3.44µs 595.2±3.15µs +0.29%
Mini js (Full) 931.7±33.78µs 891.2±3.67µs +4.54%
Mini js (Parser) 35.5±0.04µs 35.6±0.04µs -0.28%
Number Object Access (Execution) 4.3±0.17µs 4.2±0.02µs +2.38%
Number Object Access (Full) 270.9±0.62µs 259.2±0.32µs +4.51%
Object Creation (Execution) 4.3±0.02µs 4.3±0.02µs 0.00%
Object Creation (Full) 285.4±12.97µs 263.9±0.55µs +8.15%
RegExp (Execution) 10.8±0.05µs 11.7±0.03µs -7.69%
RegExp (Full) 280.2±1.26µs 270.0±1.35µs +3.78%
RegExp Literal (Execution) 10.8±0.05µs 11.7±0.03µs -7.69%
RegExp Literal (Full) 284.4±0.54µs 275.6±0.52µs +3.19%
RegExp Literal Creation (Execution) 9.5±0.02µs 10.4±0.02µs -8.65%
RegExp Literal Creation (Full) 276.9±0.62µs 264.6±1.35µs +4.65%
Static Object Property Access (Execution) 4.6±0.02µs 4.5±0.01µs +2.22%
Static Object Property Access (Full) 275.0±2.94µs 264.3±0.40µs +4.05%
String Object Access (Execution) 7.2±0.02µs 7.8±0.63µs -7.69%
String Object Access (Full) 279.1±0.50µs 270.5±0.27µs +3.18%
String comparison (Execution) 6.6±0.03µs 6.4±0.03µs +3.12%
String comparison (Full) 275.7±0.73µs 268.0±0.57µs +2.87%
String concatenation (Execution) 5.3±0.09µs 5.4±0.02µs -1.85%
String concatenation (Full) 269.1±0.89µs 258.2±0.55µs +4.22%
String copy (Execution) 3.9±0.01µs 4.1±0.14µs -4.88%
String copy (Full) 264.9±0.90µs 251.2±0.51µs +5.45%
Symbols (Execution) 3.6±0.32µs 3.4±0.01µs +5.88%
Symbols (Full) 262.4±6.13µs 256.4±14.65µs +2.34%

@HalidOdat HalidOdat merged commit f47ed7b into master May 8, 2021
@HalidOdat HalidOdat deleted the feature/regexp-flags branch May 8, 2021 23:23
Razican pushed a commit that referenced this pull request May 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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