Replace all u64/i64 for length, index or offsets into usize/isize
On platforms that are 32-bits (or 128?) this should make array and iterations faster in general. On platforms that are 64-bits, this will have no effect.
Codecov Report
Attention: Patch coverage is 43.57143% with 79 lines in your changes missing coverage. Please review.
Project coverage is 53.34%. Comparing base (
6ddc2b4) to head (442bc60). Report is 319 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #4083 +/- ##
==========================================
+ Coverage 47.24% 53.34% +6.09%
==========================================
Files 476 484 +8
Lines 46892 48196 +1304
==========================================
+ Hits 22154 25709 +3555
+ Misses 24738 22487 -2251
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Test262 conformance changes
| Test result | main count | PR count | difference |
|---|---|---|---|
| Total | 48,625 | 48,625 | 0 |
| Passed | 43,616 | 43,607 | -9 |
| Ignored | 1,471 | 1,471 | 0 |
| Failed | 3,538 | 3,547 | +9 |
| Panics | 0 | 0 | 0 |
| Conformance | 89.70% | 89.68% | -0.02% |
Broken tests (9):
test/built-ins/TypedArray/prototype/lastIndexOf/search-not-found-returns-minus-one.js (previously Passed)
test/built-ins/TypedArray/prototype/lastIndexOf/tointeger-fromindex.js (previously Passed)
test/built-ins/TypedArray/prototype/lastIndexOf/search-found-returns-index.js (previously Passed)
test/built-ins/TypedArray/prototype/lastIndexOf/fromIndex-minus-zero.js (previously Passed)
test/built-ins/TypedArray/prototype/lastIndexOf/resizable-buffer.js (previously Passed)
test/built-ins/TypedArray/prototype/lastIndexOf/BigInt/search-not-found-returns-minus-one.js (previously Passed)
test/built-ins/TypedArray/prototype/lastIndexOf/BigInt/tointeger-fromindex.js (previously Passed)
test/built-ins/TypedArray/prototype/lastIndexOf/BigInt/search-found-returns-index.js (previously Passed)
test/built-ins/TypedArray/prototype/lastIndexOf/BigInt/fromIndex-minus-zero.js (previously Passed)
Hmm, there were some test regressions. Can you investigate them? Maybe it was just a typo somewhere.
@jedel1043 I don't know how to manually re-run the test262 on this project, so I'll leave that to you as a reviewer. Thanks!
@hansl tests already ran, it's just on the output of the "Update comment / Write a new comment" steps for the Test262 action. We really need to setup something so that this thing works on external repos 😅
Test262 conformance changes
| Test result | main count | PR count | difference |
|---|---|---|---|
| Total | 48,625 | 48,625 | 0 |
| Passed | 43,616 | 43,616 | 0 |
| Ignored | 1,471 | 1,471 | 0 |
| Failed | 3,538 | 3,538 | 0 |
| Panics | 0 | 0 | 0 |
| Conformance | 89.70% | 89.70% | 0.00% |
~~Sounds good. Let me test the test262 on my embedded platform before merging. Will have to wait to Monday.~~
Scratch that. I won't be able to easily run test262, but I'll run the integration tests and the unit tests tonight and report back. Will also create an issue.
At least 3 tests are failing in boa_engine, will investigate Monday.
To be fair, they're likely wrong test expectations based on overflow/underflow, but I still want to make sure.
Okay so after running test262 a bunch, and testing in browsers and Deno, I would still like to build this PR the right way but will need to move to a different approach:
- isize/usize will be used internally for sizes, indices and offsets of strings.
- i64/u64 will be used for array.
This should still result in performance improvements on 32-bits platforms (e.g. in wasm32).
I may type the new sizes StringUSize / StringISize and ArrayUSize / ArrayISize so it becomes more clear in the code which we're dealing with.
For now this PR will be back to draft.