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 get RegExp.prototype.hasIndices #2031

Closed
wants to merge 1 commit into from

Conversation

HalidOdat
Copy link
Member

It changes the following:

  • Implement get RegExp.prototype.hasIndices
  • Update Implement get RegExp.prototype.flags to currect spec
  • Update RegExpFlags

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

github-actions bot commented Apr 16, 2022

Test262 conformance changes

VM implementation

Test result main count PR count difference
Total 88,720 88,720 0
Passed 53,170 53,196 +26
Ignored 21,853 21,853 0
Failed 13,697 13,671 -26
Panics 0 0 0
Conformance 59.93% 59.96% +0.03%
Fixed tests (26):
test/built-ins/RegExp/duplicate-flags.js [strict mode] (previously Failed)
test/built-ins/RegExp/duplicate-flags.js (previously Failed)
test/built-ins/RegExp/prototype/flags/this-val-regexp.js [strict mode] (previously Failed)
test/built-ins/RegExp/prototype/flags/this-val-regexp.js (previously Failed)
test/built-ins/RegExp/prototype/flags/return-order.js [strict mode] (previously Failed)
test/built-ins/RegExp/prototype/flags/return-order.js (previously Failed)
test/built-ins/RegExp/prototype/flags/get-order.js [strict mode] (previously Failed)
test/built-ins/RegExp/prototype/flags/get-order.js (previously Failed)
test/built-ins/RegExp/prototype/flags/coercion-hasIndices.js [strict mode] (previously Failed)
test/built-ins/RegExp/prototype/flags/coercion-hasIndices.js (previously Failed)
test/built-ins/RegExp/prototype/flags/rethrow.js [strict mode] (previously Failed)
test/built-ins/RegExp/prototype/flags/rethrow.js (previously Failed)
test/built-ins/RegExp/prototype/hasIndices/this-val-non-obj.js [strict mode] (previously Failed)
test/built-ins/RegExp/prototype/hasIndices/this-val-non-obj.js (previously Failed)
test/built-ins/RegExp/prototype/hasIndices/length.js [strict mode] (previously Failed)
test/built-ins/RegExp/prototype/hasIndices/length.js (previously Failed)
test/built-ins/RegExp/prototype/hasIndices/this-val-regexp.js [strict mode] (previously Failed)
test/built-ins/RegExp/prototype/hasIndices/this-val-regexp.js (previously Failed)
test/built-ins/RegExp/prototype/hasIndices/this-val-regexp-prototype.js [strict mode] (previously Failed)
test/built-ins/RegExp/prototype/hasIndices/this-val-regexp-prototype.js (previously Failed)
test/built-ins/RegExp/prototype/hasIndices/name.js [strict mode] (previously Failed)
test/built-ins/RegExp/prototype/hasIndices/name.js (previously Failed)
test/built-ins/RegExp/prototype/hasIndices/this-val-invalid-obj.js [strict mode] (previously Failed)
test/built-ins/RegExp/prototype/hasIndices/this-val-invalid-obj.js (previously Failed)
test/built-ins/RegExp/prototype/hasIndices/prop-desc.js [strict mode] (previously Failed)
test/built-ins/RegExp/prototype/hasIndices/prop-desc.js (previously Failed)

@codecov
Copy link

codecov bot commented Apr 16, 2022

Codecov Report

Merging #2031 (a1f328c) into main (a357a18) will increase coverage by 0.01%.
The diff coverage is 75.00%.

@@            Coverage Diff             @@
##             main    #2031      +/-   ##
==========================================
+ Coverage   43.92%   43.93%   +0.01%     
==========================================
  Files         211      211              
  Lines       18693    18701       +8     
==========================================
+ Hits         8211     8217       +6     
- Misses      10482    10484       +2     
Impacted Files Coverage Δ
boa_engine/src/builtins/regexp/mod.rs 67.70% <71.42%> (+0.06%) ⬆️
boa_engine/src/syntax/lexer/regex.rs 53.52% <100.00%> (+0.66%) ⬆️

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 a357a18...a1f328c. Read the comment docs.

Copy link
Member

@jedel1043 jedel1043 left a comment

Choose a reason for hiding this comment

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

Nice!

@github-actions
Copy link

Benchmark for aeb88e3

Click to view benchmark
Test Base PR %
Arithmetic operations (Compiler) 521.1±0.78ns 519.2±2.92ns -0.36%
Arithmetic operations (Execution) 633.4±1.06ns 577.9±0.72ns -8.76%
Arithmetic operations (Parser) 5.9±0.01µs 6.0±0.00µs +1.69%
Array access (Compiler) 1296.5±4.89ns 1283.1±2.74ns -1.03%
Array access (Execution) 7.6±0.05µs 6.9±0.03µs -9.21%
Array access (Parser) 12.9±0.03µs 12.8±0.02µs -0.78%
Array creation (Compiler) 1839.0±11.80ns 1600.3±6.38ns -12.98%
Array creation (Execution) 2.5±0.00ms 2.2±0.00ms -12.00%
Array creation (Parser) 12.9±0.02µs 14.6±0.02µs +13.18%
Array pop (Compiler) 3.8±0.01µs 3.2±0.01µs -15.79%
Array pop (Execution) 1120.4±4.04µs 1125.9±7.87µs +0.49%
Array pop (Parser) 129.4±0.23µs 146.9±0.76µs +13.52%
Boolean Object Access (Compiler) 1066.1±2.75ns 1055.7±6.74ns -0.98%
Boolean Object Access (Execution) 4.1±0.01µs 4.2±0.01µs +2.44%
Boolean Object Access (Parser) 15.4±0.02µs 15.1±0.06µs -1.95%
Clean js (Compiler) 3.3±0.01µs 3.4±0.01µs +3.03%
Clean js (Execution) 663.9±35.92µs 691.0±3.94µs +4.08%
Clean js (Parser) 31.4±0.05µs 31.3±0.03µs -0.32%
Create Realm 291.3±0.37ns 280.1±0.85ns -3.84%
Dynamic Object Property Access (Compiler) 1435.1±46.04ns 1420.6±2.16ns -1.01%
Dynamic Object Property Access (Execution) 5.4±0.02µs 5.5±0.01µs +1.85%
Dynamic Object Property Access (Parser) 11.5±0.02µs 11.3±0.01µs -1.74%
Fibonacci (Compiler) 2.3±0.01µs 2.3±0.01µs 0.00%
Fibonacci (Execution) 1340.0±4.15µs 1358.0±5.05µs +1.34%
Fibonacci (Parser) 17.3±0.02µs 17.3±0.03µs 0.00%
For loop (Compiler) 1985.9±12.00ns 1950.6±4.49ns -1.78%
For loop (Execution) 15.2±0.12µs 15.3±0.06µs +0.66%
For loop (Parser) 14.8±0.02µs 14.8±0.08µs 0.00%
Mini js (Compiler) 3.2±0.01µs 3.2±0.01µs 0.00%
Mini js (Execution) 575.0±3.98µs 656.1±4.75µs +14.10%
Mini js (Parser) 27.8±0.10µs 27.6±0.03µs -0.72%
Number Object Access (Compiler) 1015.8±1.41ns 1024.0±8.25ns +0.81%
Number Object Access (Execution) 3.2±0.00µs 3.3±0.00µs +3.12%
Number Object Access (Parser) 12.0±0.02µs 11.8±0.02µs -1.67%
Object Creation (Compiler) 1391.5±10.38ns 1373.3±6.48ns -1.31%
Object Creation (Execution) 5.1±0.02µs 4.6±0.01µs -9.80%
Object Creation (Parser) 10.0±0.03µs 9.9±0.03µs -1.00%
RegExp (Compiler) 1627.8±3.72ns 1641.0±3.27ns +0.81%
RegExp (Execution) 11.1±0.05µs 10.0±0.03µs -9.91%
RegExp (Parser) 10.9±0.01µs 10.9±0.02µs 0.00%
RegExp Creation (Compiler) 1410.4±12.24ns 1410.2±5.54ns -0.01%
RegExp Creation (Execution) 8.4±0.02µs 8.4±0.03µs 0.00%
RegExp Creation (Parser) 9.1±0.01µs 8.0±0.02µs -12.09%
RegExp Literal (Compiler) 1633.0±3.83ns 1617.5±4.40ns -0.95%
RegExp Literal (Execution) 11.1±0.05µs 10.0±0.04µs -9.91%
RegExp Literal (Parser) 8.8±0.02µs 8.9±0.03µs +1.14%
RegExp Literal Creation (Compiler) 1285.6±3.51ns 1260.6±8.27ns -1.94%
RegExp Literal Creation (Execution) 8.3±0.03µs 7.4±0.02µs -10.84%
RegExp Literal Creation (Parser) 6.1±0.03µs 7.0±0.02µs +14.75%
Static Object Property Access (Compiler) 1245.3±3.91ns 1389.2±3.20ns +11.56%
Static Object Property Access (Execution) 5.2±0.02µs 4.7±0.02µs -9.62%
Static Object Property Access (Parser) 10.6±0.02µs 10.6±0.02µs 0.00%
String Object Access (Compiler) 1428.1±5.92ns 1427.9±9.02ns -0.01%
String Object Access (Execution) 5.9±0.06µs 6.0±0.02µs +1.69%
String Object Access (Parser) 15.0±0.03µs 14.9±0.02µs -0.67%
String comparison (Compiler) 2.1±0.00µs 2.1±0.00µs 0.00%
String comparison (Execution) 4.5±0.01µs 4.6±0.03µs +2.22%
String comparison (Parser) 11.9±0.05µs 11.7±0.03µs -1.68%
String concatenation (Compiler) 1642.9±3.13ns 1650.7±3.39ns +0.47%
String concatenation (Execution) 4.3±0.01µs 4.4±0.03µs +2.33%
String concatenation (Parser) 7.3±0.01µs 8.1±0.02µs +10.96%
String copy (Compiler) 1315.2±5.59ns 1295.9±3.64ns -1.47%
String copy (Execution) 4.0±0.01µs 4.1±0.02µs +2.50%
String copy (Parser) 6.1±0.01µs 6.0±0.01µs -1.64%
Symbols (Compiler) 910.5±3.31ns 930.0±1.81ns +2.14%
Symbols (Execution) 4.1±0.02µs 4.2±0.01µs +2.44%
Symbols (Parser) 4.7±0.01µs 4.6±0.01µs -2.13%

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 new flag is missing from ToString for RegExpFlags at in boa_engine/src/syntax/lexer/regex.rs.

That should make the missing tests pass.
For example /./d.hasIndices currently returns false.

@raskad raskad linked an issue Apr 16, 2022 that may be closed by this pull request
@HalidOdat HalidOdat force-pushed the feature/regexp.prototype.hasIndices branch from 7c52f37 to a1f328c Compare April 16, 2022 23:47
@HalidOdat HalidOdat requested a review from raskad April 17, 2022 00:06
@github-actions
Copy link

Benchmark for cbebbc7

Click to view benchmark
Test Base PR %
Arithmetic operations (Compiler) 524.8±2.21ns 527.9±2.69ns +0.59%
Arithmetic operations (Execution) 633.1±0.83ns 637.6±0.56ns +0.71%
Arithmetic operations (Parser) 6.0±0.00µs 5.9±0.01µs -1.67%
Array access (Compiler) 1261.0±3.06ns 1340.9±5.85ns +6.34%
Array access (Execution) 7.8±0.02µs 8.0±0.03µs +2.56%
Array access (Parser) 12.9±0.04µs 12.8±0.02µs -0.78%
Array creation (Compiler) 1827.2±6.55ns 1935.9±7.10ns +5.95%
Array creation (Execution) 2.5±0.00ms 2.6±0.00ms +4.00%
Array creation (Parser) 14.7±0.02µs 14.6±0.02µs -0.68%
Array pop (Compiler) 3.7±0.01µs 3.7±0.01µs 0.00%
Array pop (Execution) 1123.8±3.26µs 1133.0±6.07µs +0.82%
Array pop (Parser) 146.1±0.19µs 146.3±0.14µs +0.14%
Boolean Object Access (Compiler) 1045.9±1.25ns 1046.4±5.32ns +0.05%
Boolean Object Access (Execution) 4.1±0.01µs 4.4±0.02µs +7.32%
Boolean Object Access (Parser) 15.4±0.01µs 15.1±0.08µs -1.95%
Clean js (Compiler) 3.4±0.01µs 3.5±0.01µs +2.94%
Clean js (Execution) 686.1±3.18µs 714.4±5.71µs +4.12%
Clean js (Parser) 31.7±0.04µs 31.4±0.04µs -0.95%
Create Realm 282.3±0.21ns 294.2±0.29ns +4.22%
Dynamic Object Property Access (Compiler) 1648.9±8.14ns 1715.5±4.32ns +4.04%
Dynamic Object Property Access (Execution) 5.4±0.02µs 5.7±0.03µs +5.56%
Dynamic Object Property Access (Parser) 11.5±0.01µs 11.3±0.01µs -1.74%
Fibonacci (Compiler) 2.3±0.01µs 2.4±0.01µs +4.35%
Fibonacci (Execution) 1334.3±3.34µs 1378.2±2.90µs +3.29%
Fibonacci (Parser) 17.5±0.09µs 17.3±0.03µs -1.14%
For loop (Compiler) 1937.4±7.68ns 2.0±0.00µs +3.23%
For loop (Execution) 15.2±0.06µs 15.4±0.05µs +1.32%
For loop (Parser) 14.8±0.03µs 14.8±0.07µs 0.00%
Mini js (Compiler) 3.3±0.01µs 3.4±0.01µs +3.03%
Mini js (Execution) 651.5±5.87µs 679.5±3.38µs +4.30%
Mini js (Parser) 27.8±0.03µs 27.6±0.03µs -0.72%
Number Object Access (Compiler) 1023.3±1.90ns 1020.7±7.39ns -0.25%
Number Object Access (Execution) 3.2±0.01µs 3.4±0.03µs +6.25%
Number Object Access (Parser) 11.9±0.02µs 11.8±0.02µs -0.84%
Object Creation (Compiler) 1412.8±3.02ns 1476.3±3.28ns +4.49%
Object Creation (Execution) 5.1±0.01µs 5.3±0.01µs +3.92%
Object Creation (Parser) 9.9±0.01µs 9.8±0.03µs -1.01%
RegExp (Compiler) 1645.5±3.72ns 1731.7±5.20ns +5.24%
RegExp (Execution) 11.0±0.05µs 11.6±0.06µs +5.45%
RegExp (Parser) 11.0±0.01µs 10.8±0.02µs -1.82%
RegExp Creation (Compiler) 1415.7±7.66ns 1490.3±3.74ns +5.27%
RegExp Creation (Execution) 8.3±0.03µs 8.6±0.03µs +3.61%
RegExp Creation (Parser) 9.1±0.02µs 9.0±0.03µs -1.10%
RegExp Literal (Compiler) 1628.7±3.18ns 1709.6±3.02ns +4.97%
RegExp Literal (Execution) 11.1±0.06µs 11.6±0.06µs +4.50%
RegExp Literal (Parser) 8.9±0.01µs 8.7±0.02µs -2.25%
RegExp Literal Creation (Compiler) 1418.1±3.64ns 1489.4±25.80ns +5.03%
RegExp Literal Creation (Execution) 8.3±0.02µs 8.6±0.03µs +3.61%
RegExp Literal Creation (Parser) 7.0±0.03µs 6.9±0.02µs -1.43%
Static Object Property Access (Compiler) 1390.6±3.02ns 1480.3±3.94ns +6.45%
Static Object Property Access (Execution) 5.3±0.01µs 5.6±0.01µs +5.66%
Static Object Property Access (Parser) 10.6±0.01µs 10.5±0.02µs -0.94%
String Object Access (Compiler) 1435.0±8.35ns 1466.1±10.35ns +2.17%
String Object Access (Execution) 5.8±0.02µs 6.4±0.04µs +10.34%
String Object Access (Parser) 15.0±0.01µs 14.9±0.03µs -0.67%
String comparison (Compiler) 2.1±0.00µs 2.2±0.01µs +4.76%
String comparison (Execution) 4.6±0.01µs 4.7±0.01µs +2.17%
String comparison (Parser) 11.8±0.04µs 11.8±0.05µs 0.00%
String concatenation (Compiler) 1632.3±3.10ns 1732.7±6.37ns +6.15%
String concatenation (Execution) 4.3±0.01µs 4.6±0.01µs +6.98%
String concatenation (Parser) 8.2±0.02µs 8.2±0.03µs 0.00%
String copy (Compiler) 1277.8±3.22ns 1391.3±4.14ns +8.88%
String copy (Execution) 4.1±0.02µs 4.4±0.01µs +7.32%
String copy (Parser) 6.1±0.05µs 6.1±0.02µs 0.00%
Symbols (Compiler) 910.9±3.30ns 947.8±1.29ns +4.05%
Symbols (Execution) 4.2±0.02µs 4.4±0.04µs +4.76%
Symbols (Parser) 4.8±0.01µs 4.6±0.01µs -4.17%

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 to me :)

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.

bors r+

bors bot pushed a commit that referenced this pull request Apr 17, 2022
It changes the following:
- Implement `get RegExp.prototype.hasIndices`
- Update Implement `get RegExp.prototype.flags` to currect spec
- Update `RegExpFlags`
@bors
Copy link

bors bot commented Apr 17, 2022

Pull request successfully merged into main.

Build succeeded:

@bors bors bot changed the title Implement get RegExp.prototype.hasIndices [Merged by Bors] - Implement get RegExp.prototype.hasIndices Apr 17, 2022
@bors bors bot closed this Apr 17, 2022
@bors bors bot deleted the feature/regexp.prototype.hasIndices branch April 17, 2022 19:58
Razican pushed a commit that referenced this pull request Jun 8, 2022
It changes the following:
- Implement `get RegExp.prototype.hasIndices`
- Update Implement `get RegExp.prototype.flags` to currect spec
- Update `RegExpFlags`
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.

RegExp Match Indices
4 participants