I'll work on some additional tests next.

I think it's worth adding tests for constructing
SharedArrayBuffers/SharedTypedArrays, ensuring that they ArrayBufferViews cannot be used on SharedArrayBuffers and vice-versa. Testing the "shared" part is not
possible as it is more of a DOM feature requiring Workers and postMessage.

Is it worth copying the typedarray cctests/mjsunit tests and substituting
s/ArrayBuffer/SharedArrayBuffer/? I'm leaning toward yes; it's not nice to have
duplicated code, but it seems wrong for the tests to assume a shared
implementation. What do you think?




https://codereview.chromium.org/1069883002/diff/1/src/objects.h
File src/objects.h (right):

https://codereview.chromium.org/1069883002/diff/1/src/objects.h#newcode10265
src/objects.h:10265: static const int kIsSharedBit = 3;
On 2015/04/17 07:49:27, jarin wrote:
On 2015/04/16 21:00:34, binji wrote:
> On 2015/04/16 14:55:28, jarin wrote:
> > Why do you need the bit? Cannot you get the sharedness from the
map?
>
> Do you mean from the ExternalArrayType? I currently share that
enumeration
value
> between TypedArrays and SharedTypedArrays. I could add new shared
types, but
I'm
> not sure how much code would need to be duplicated then. Also, I
think that
will
> only work for TypedArrays, not for the SharedArrayBuffer.
>
> Or am I missing something? (quite likely :)

I was just wondering why you could not define is_shared()
{ return map()->instance_type() == JS_SHARED_ARRAY_BUFFER_TYPE; }

Thanks, that works. I knew I was missing something. :)

https://codereview.chromium.org/1069883002/

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to