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

Atomics: Should ValidateSharedIntegerTypedArray allow a Proxy of a valid TypedArray? #1184

Closed
rwaldron opened this Issue Apr 24, 2018 · 6 comments

Comments

Projects
None yet
5 participants
@rwaldron
Contributor

rwaldron commented Apr 24, 2018

Pros? Cons?

@syg

This comment has been minimized.

Show comment
Hide comment
@syg

syg Apr 24, 2018

Member

I recommend against. Given that Atomics is a low-level API for performance, the design spirit here should be easily compilable down to ISA-level atomic ops. Allowing Proxies wrapping SABs will mean JITs won't compile the Proxy case, which defeats the purpose of using Atomics in the first place.

Member

syg commented Apr 24, 2018

I recommend against. Given that Atomics is a low-level API for performance, the design spirit here should be easily compilable down to ISA-level atomic ops. Allowing Proxies wrapping SABs will mean JITs won't compile the Proxy case, which defeats the purpose of using Atomics in the first place.

@littledan

This comment has been minimized.

Show comment
Hide comment
@littledan

littledan Apr 24, 2018

Member

If you wanted to permit Proxies of TypedArrays to be used in similar contexts, presumably you'd make several other changes to various places to access the internal slots of the underlying TypedArray. This would be a big change, and not quite in line with the general design of Proxies, which don't tend to get this sort of forwarding (Array.isArray being the one-off exception).

Member

littledan commented Apr 24, 2018

If you wanted to permit Proxies of TypedArrays to be used in similar contexts, presumably you'd make several other changes to various places to access the internal slots of the underlying TypedArray. This would be a big change, and not quite in line with the general design of Proxies, which don't tend to get this sort of forwarding (Array.isArray being the one-off exception).

@domenic

This comment has been minimized.

Show comment
Hide comment
@domenic

domenic Apr 24, 2018

Member

Right, as mentioned previously, proxies are not generally transparent, and should not be.

Member

domenic commented Apr 24, 2018

Right, as mentioned previously, proxies are not generally transparent, and should not be.

@erights

This comment has been minimized.

Show comment
Hide comment
@erights

erights Apr 24, 2018

erights commented Apr 24, 2018

@littledan

This comment has been minimized.

Show comment
Hide comment
@littledan

littledan Apr 25, 2018

Member

Offtopic, but where can I read an explanation of how Proxies are generally transparent?

Member

littledan commented Apr 25, 2018

Offtopic, but where can I read an explanation of how Proxies are generally transparent?

@rwaldron

This comment has been minimized.

Show comment
Hide comment
@rwaldron

rwaldron Apr 25, 2018

Contributor

Thanks for the feedback. I came across this while writing Atomics tests for Test262, but I intentionally held back any context, to avoid tainting any responses. I suspect my use case isn't compelling enough to warrant further consideration.

Contributor

rwaldron commented Apr 25, 2018

Thanks for the feedback. I came across this while writing Atomics tests for Test262, but I intentionally held back any context, to avoid tainting any responses. I suspect my use case isn't compelling enough to warrant further consideration.

@rwaldron rwaldron closed this Apr 25, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment