Closed Bug 1225040 Opened 9 years ago Closed 9 years ago

Add jsapi-tests for TypedArray on SharedArrayBuffer

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla45
Tracking Status
firefox45 --- fixed

People

(Reporter: lth, Assigned: lth)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

All TypedArray jsapi-test tests currently work with ArrayBuffer. Clearly we need to do better once TypedArray can map SharedArrayBuffer.
The "p" failure in that run is bug 1230162, technically a problem with running tests in parallel but fundamentally we should also clean up SpiderMonkey.
Attached patch generalize jsapi-tests for SAB (deleted) — Splinter Review
Attachment #8695789 - Flags: review?(arai.unmht)
Assignee: nobody → lhansen
Status: NEW → ASSIGNED
Comment on attachment 8695789 [details] [diff] [review] generalize jsapi-tests for SAB Review of attachment 8695789 [details] [diff] [review]: ----------------------------------------------------------------- ::: js/src/jsapi-tests/testTypedArrays.cpp @@ +66,5 @@ > > return ok; > } > > +// Shared memory can only be mapped by a TypedArray by creating the TypedArray with "with" should be moved to the next line, to make this line fit into 79 chars. @@ +115,5 @@ > TestArrayFromBuffer(JSContext* cx) > { > size_t elts = 8; > size_t nbytes = elts * sizeof(Element); > + RootedObject buffer(cx, Shared ? JS_NewSharedArrayBuffer(cx, nbytes) : JS_NewArrayBuffer(cx, nbytes)); please wrap this line into 99 chars ;) (or maybe there's different style rule for test files?) @@ +120,5 @@ > { > JS::AutoCheckCannotGC nogc; > bool isShared; > + void* data = Shared ? JS_GetSharedArrayBufferData(buffer, &isShared, nogc) > + : JS_GetArrayBufferData(buffer, &isShared, nogc); ":" should be aligned to the same column as "S" of "Shared ?" in previous line. @@ +121,5 @@ > JS::AutoCheckCannotGC nogc; > bool isShared; > + void* data = Shared ? JS_GetSharedArrayBufferData(buffer, &isShared, nogc) > + : JS_GetArrayBufferData(buffer, &isShared, nogc); > + MOZ_ASSERT(Shared == isShared); as "Shared" is now variable, using CHECK might be better for testing purpose here, and following several places.
Attachment #8695789 - Flags: review?(arai.unmht) → review+
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: