Skip to content

Small Atomics changes to reduce duplications#835

Closed
anba wants to merge 4 commits into
tc39:masterfrom
anba:atomics-cleanup
Closed

Small Atomics changes to reduce duplications#835
anba wants to merge 4 commits into
tc39:masterfrom
anba:atomics-cleanup

Conversation

@anba
Copy link
Copy Markdown
Contributor

@anba anba commented Mar 3, 2017

Here are possible changes to avoid some duplications in the Atomics section.

Changes:

  • Partially reverts f1239ca, because Atomics.wait actually only needs the GetValueFromBuffer bits from Atomics.load.
  • I've replaced the boolean parameter in ValidateSharedIntegerTypedArray with a List, because some prefer to avoid boolean parameters, and because the List approach allows to write a more concise algorithm.
  • The buffer address computation was duplicate in multiple operations, we can avoid this by moving it into the ValidateAtomicAccess operation.

Applies on top of #834, but I wanted to keep possible refactorings separate from bug fixes. And I've directly included the changes from #820 in 62ac9b4.

@littledan
Copy link
Copy Markdown
Member

@syg @lars-t-hansen What do you think of these editorial changes?

@lars-t-hansen
Copy link
Copy Markdown
Contributor

I think this PR should wait until #1127 is resolved since that will likely rearrange some of the relevant bits. I'm not against it, but I'd probably prefer to re-evaluate changes after that PR lands.

(Personally I doubt that changing from a bool to a list of allowed types clarifies anything, but that's mostly a matter of preference and more for TC39 to decide.)

@syg syg self-requested a review March 9, 2018 18:43
@ljharb
Copy link
Copy Markdown
Member

ljharb commented Aug 23, 2018

@lars-t-hansen @anba now that #1127 is merged, can this be updated?

@lars-t-hansen
Copy link
Copy Markdown
Contributor

@anba, I'll wait until you notify me about any changes.

@bakkot bakkot added the editor call to be discussed in the next editor call label Sep 9, 2020
@ljharb
Copy link
Copy Markdown
Member

ljharb commented Sep 9, 2020

@anba this can be rebased on top of master now that #2015 has landed, if you're still interested in pursuing the third commit.

@bakkot
Copy link
Copy Markdown
Member

bakkot commented Sep 9, 2020

The change to ValidateSharedIntegerTypedArray is pretty stale after the addition of BigInts and #1908, and I think the waitable boolean which is now on ValidateIntegerTypedArray is better than a list of allowed types, so I'm going to close this. If there's still a change someone wants to make here, feel free to reopen (or, ideally, open a new PR).

@bakkot bakkot closed this Sep 9, 2020
@ljharb ljharb removed the editor call to be discussed in the next editor call label Sep 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants