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] - Added fallible allocation to data blocks #1728

Closed
wants to merge 4 commits into from

Conversation

Razican
Copy link
Member

@Razican Razican commented Dec 4, 2021

This Pull Request uses the new fallible allocation API in Rust 1.57 to follow the JavaScript specification for data blocks: https://tc39.es/ecma262/#sec-createbytedatablock

It changes the following:

  • Creating a new DataBlock for an ArrayBuffer will no longer fail with an arbitrary byte length, it will now actually call the allocator and try to reserve the needed space, and fail if it can't.
  • Added sunny and rainy day unit tests that check if the API works as expected.
  • Bumped the minimum Rust version to Rust 1.57 for the Boa crate.
  • Removed the unused DataBlock implementation in IntegerIndexedObjects.

@Razican Razican added enhancement New feature or request builtins PRs and Issues related to builtins/intrinsics labels Dec 4, 2021
@Razican Razican added this to the v0.14.0 milestone Dec 4, 2021
@codecov
Copy link

codecov bot commented Dec 4, 2021

Codecov Report

Merging #1728 (d057f43) into main (65e4ab6) will increase coverage by 0.04%.
The diff coverage is 85.71%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1728      +/-   ##
==========================================
+ Coverage   53.28%   53.33%   +0.04%     
==========================================
  Files         200      200              
  Lines       16982    16983       +1     
==========================================
+ Hits         9049     9058       +9     
+ Misses       7933     7925       -8     
Impacted Files Coverage Δ
...src/builtins/typed_array/integer_indexed_object.rs 0.00% <ø> (ø)
boa/src/builtins/array_buffer/mod.rs 6.77% <85.71%> (+3.04%) ⬆️
...tement/declaration/hoistable/generator_decl/mod.rs 70.00% <0.00%> (+15.00%) ⬆️

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 65e4ab6...d057f43. Read the comment docs.

@github-actions
Copy link

github-actions bot commented Dec 4, 2021

Test262 conformance changes

Non-VM implementation

Test result main count PR count difference
Total 86,464 86,464 0
Passed 40,113 40,113 0
Ignored 18,869 18,869 0
Failed 27,482 27,482 0
Panics 0 0 0
Conformance 46.39% 46.39% 0.00%

VM implementation

Test result main count PR count difference
Total 86,464 86,464 0
Passed 39,656 39,656 0
Ignored 18,869 18,869 0
Failed 27,939 27,939 0
Panics 189 189 0
Conformance 45.86% 45.86% 0.00%

@Razican
Copy link
Member Author

Razican commented Dec 5, 2021

bors r+

@bors
Copy link

bors bot commented Dec 5, 2021

👎 Rejected by too few approved reviews

@Razican
Copy link
Member Author

Razican commented Dec 5, 2021

bors r+

bors bot pushed a commit that referenced this pull request Dec 5, 2021
This Pull Request uses the new fallible allocation API in Rust 1.57 to follow the JavaScript specification for data blocks: https://tc39.es/ecma262/#sec-createbytedatablock

It changes the following:

- Creating a new DataBlock for an ArrayBuffer will no longer fail with an arbitrary byte length, it will now actually call the allocator and try to reserve the needed space, and fail if it can't.
- Added sunny and rainy day unit tests that check if the API works as expected.
- Bumped the minimum Rust version to Rust 1.57 for the Boa crate.
- Removed the unused `DataBlock` implementation in IntegerIndexedObjects.
@bors
Copy link

bors bot commented Dec 5, 2021

Pull request successfully merged into main.

Build succeeded:

@bors bors bot changed the title Added fallible allocation to data blocks [Merged by Bors] - Added fallible allocation to data blocks Dec 5, 2021
@bors bors bot closed this Dec 5, 2021
@bors bors bot deleted the fallible_alloc branch December 5, 2021 00:52
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