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 ephemeron-based weak map #3052

Merged
merged 4 commits into from Aug 5, 2023
Merged

Implement ephemeron-based weak map #3052

merged 4 commits into from Aug 5, 2023

Conversation

jedel1043
Copy link
Member

@jedel1043 jedel1043 commented Jun 20, 2023

This Pull Request fixes #2596 and fixes #2732.

It changes the following:

  • Implements an ephemeron-based weak map using the hashbrown raw API.

I only exposed WeakMap as public, but it would be good to decide in the future if we want to expose the full RawWeakMap to our users.

Marking as draft since this just needs documentation and a clippy run, but it's feature complete.

@jedel1043 jedel1043 added enhancement New feature or request builtins PRs and Issues related to builtins/intrinsics gc Issue related to garbage collection labels Jun 20, 2023
@jedel1043 jedel1043 added this to the v0.17.0 milestone Jun 20, 2023
@jedel1043 jedel1043 requested a review from a team June 20, 2023 00:59
@github-actions
Copy link

github-actions bot commented Jun 20, 2023

Test262 conformance changes

Test result main count PR count difference
Total 95,282 95,282 0
Passed 74,984 74,984 0
Ignored 19,220 19,220 0
Failed 1,078 1,078 0
Panics 0 0 0
Conformance 78.70% 78.70% 0.00%

@codecov
Copy link

codecov bot commented Jun 20, 2023

Codecov Report

Merging #3052 (02246b9) into main (5f70585) will increase coverage by 0.24%.
The diff coverage is 60.36%.

❗ Current head 02246b9 differs from pull request most recent head 0c43545. Consider uploading reports for the commit 0c43545 to get more accurate results

@@            Coverage Diff             @@
##             main    #3052      +/-   ##
==========================================
+ Coverage   50.40%   50.64%   +0.24%     
==========================================
  Files         436      444       +8     
  Lines       42375    42746     +371     
==========================================
+ Hits        21358    21649     +291     
- Misses      21017    21097      +80     
Files Changed Coverage Δ
boa_engine/src/builtins/weak_set/mod.rs 14.47% <0.00%> (ø)
boa_gc/src/pointers/weak.rs 47.05% <ø> (-23.53%) ⬇️
boa_gc/src/pointers/weak_map.rs 55.10% <53.26%> (-24.90%) ⬇️
boa_gc/src/internals/ephemeron_box.rs 87.71% <100.00%> (+1.80%) ⬆️
boa_gc/src/internals/weak_map_box.rs 90.90% <100.00%> (ø)
boa_gc/src/lib.rs 99.41% <100.00%> (-0.05%) ⬇️
boa_gc/src/pointers/ephemeron.rs 95.12% <100.00%> (+2.01%) ⬆️

... and 85 files with indirect coverage changes

@jedel1043 jedel1043 marked this pull request as ready for review June 21, 2023 01:12
@Razican Razican modified the milestones: v0.17.0, v0.18.0 Jul 8, 2023
Copy link
Member

@HalidOdat HalidOdat 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! :)

@HalidOdat HalidOdat requested a review from a team July 16, 2023 20:00
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.

Nice work

@raskad raskad added this pull request to the merge queue Aug 4, 2023
Merged via the queue into main with commit a06a6f5 Aug 5, 2023
8 checks passed
@jedel1043 jedel1043 deleted the ephemeron-hashmap branch August 5, 2023 00:14
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 gc Issue related to garbage collection
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sporadic panics on WeakMap tests Implement a weak HashMap based on Ephemerons
4 participants