-
-
Notifications
You must be signed in to change notification settings - Fork 411
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 resizable buffers #3634
Conversation
Test262 conformance changes
Fixed tests (533):
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work!
Did you get the chance to run the 262 test suite in debug mode to test all of the debug assertions? Or switch them to asserts for one 262 run maybe.
Yep, I ran the |
Did another run on debug mode and everything looks good! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! :)
We might want to run the test262 tests in release with debug assertions in the CI, might help catch some bugs. |
A bit of a complex implementation, but happy with the new design overall. Open for suggestions though!
This implements:
ArrayBuffer
to resize, but it's limited to amaxByteLength
parameter passed at construction time.SharedArrayBuffer
to grow (shrinking is disallowed by the spec), also limited to amaxByteLength
parameter.It uses an
AtomicUsize
to track the current length, which should be enough to ensure thread-safety.Atomics
,TypedArray
andDataView
to use the new buffers.memmove
,memcpy
andcopy_shared_to_shared
more low level, computing using pointers.The previous design used slices to do debug assertions before copying memory, but this made the API a bit clunkier to use, and some of the assertions weren't even needed by some callers.
EDIT: Forgot to mention that this doesn't add methods to resize
JsArrayBuffer
andJsSharedArrayBuffer
, but this can be added later after some design work.