Closed
Bug 1232966
Opened 9 years ago
Closed 8 years ago
Implement %SharedArrayBuffer%.prototype.slice
Categories
(Core :: JavaScript Engine, defect, P2)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla52
Tracking | Status | |
---|---|---|
firefox52 | --- | fixed |
People
(Reporter: lth, Assigned: lth)
References
(Blocks 1 open bug)
Details
(Keywords: dev-doc-complete)
Attachments
(3 files, 1 obsolete file)
(deleted),
patch
|
arai
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
arai
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
evilpie
:
review+
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
The slice method is required for standards conformance.
Assignee | ||
Comment 1•9 years ago
|
||
Attachment #8698958 -
Flags: review?(arai.unmht)
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → lhansen
Status: NEW → ASSIGNED
Assignee | ||
Comment 2•9 years ago
|
||
Comment on attachment 8698958 [details] [diff] [review]
SharedArrayBuffer.prototype.slice
I'm going to do things in the opposite order (subclassing first, then slice). Cancelling review for now. Sorry for the trouble.
Attachment #8698958 -
Flags: review?(arai.unmht)
Assignee | ||
Updated•9 years ago
|
Comment 3•9 years ago
|
||
The dev doc update once this lands is at least the following:
A new page about the slice method, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer#SharedArrayBuffer_prototype_object
Keywords: dev-doc-needed
Assignee | ||
Updated•8 years ago
|
Priority: -- → P2
Assignee | ||
Comment 4•8 years ago
|
||
Implements %SharedArrayBuffer%.prototype.slice, and also the species accessor which is needed for proper subclassing behavior.
Attachment #8698958 -
Attachment is obsolete: true
Attachment #8805902 -
Flags: review?(arai.unmht)
Assignee | ||
Comment 5•8 years ago
|
||
Test cases for %SharedArrayBuffer%.prototype.slice, and also one for byteLength.
Attachment #8805903 -
Flags: review?(arai.unmht)
Comment 6•8 years ago
|
||
Comment on attachment 8805902 [details] [diff] [review]
bug1232966-sab-slice.patch
Review of attachment 8805902 [details] [diff] [review]:
-----------------------------------------------------------------
::: js/src/vm/CommonPropertyNames.h
@@ +273,5 @@
> macro(SetIterator, SetIterator, "Set Iterator") \
> macro(setPrefix, setPrefix, "set ") \
> macro(setPrototypeOf, setPrototypeOf, "setPrototypeOf") \
> macro(shape, shape, "shape") \
> + macro(SharedArrayBufferSpecies, SharedArrayBufferSpecies, "SharedArrayBufferSpecies") \
This isn't used anywhere in this patch.
would be better removing for now.
Attachment #8805902 -
Flags: review?(arai.unmht) → review+
Comment 7•8 years ago
|
||
Comment on attachment 8805903 [details] [diff] [review]
bug1232966-sab-slice-tests.patch
Review of attachment 8805903 [details] [diff] [review]:
-----------------------------------------------------------------
::: js/src/jit-test/tests/sharedbuf/methods.js
@@ +4,5 @@
> + quit(0);
> +
> +load(libdir + "asserts.js");
> +
> +// Test the byteLength method
It should be better separating files per each method.
byteLength.js and slice.js, or something like that with prefix.
so that you don't need the block statement, and it would become clear what goes wrong if some of them hit regression.
@@ +7,5 @@
> +
> +// Test the byteLength method
> +
> +{
> + let v = new SharedArrayBuffer(137);
can this variable be named `buffer` or something?
same for other 1-2 length variables (except `i`), they need more descriptive name.
Attachment #8805903 -
Flags: review?(arai.unmht) → review+
Comment 8•8 years ago
|
||
You will have to update the test for slice in test_xrayToJS.xul, that I just landed in bug 1130988.
Assignee | ||
Comment 9•8 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/f16586fdc3fd11dbf541f1f8b12296165b3b0d86
Bug 1232966 - SharedArrayBuffer.prototype.slice. r=arai
https://hg.mozilla.org/integration/mozilla-inbound/rev/6892ec7e77f3e244473498e3c0c3731939227170
Bug 1232966 - test cases for SharedArrayBuffer.prototype.slice. r=arai
Comment 10•8 years ago
|
||
sorry had to backout for test failures like https://treeherder.mozilla.org/logviewer.html#?job_id=38469517&repo=mozilla-inbound
Flags: needinfo?(lhansen)
Assignee | ||
Comment 11•8 years ago
|
||
In a debug build, fails with --ion-eager --ion-offthread-compile=off:
Assertion failure: fromBuffer->byteLength() >= fromIndex + count, at /Users/lhansen/moz/mozilla-inbound/js/src/vm/SharedArrayObject.cpp:337
(Will also add a patch for Tom's case.)
Flags: needinfo?(lhansen)
Comment 12•8 years ago
|
||
Backout by cbook@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/f3334bb262d3
Backed out changeset 6892ec7e77f3
https://hg.mozilla.org/integration/mozilla-inbound/rev/017b9ab11023
Backed out changeset f16586fdc3fd for arm bustage
Assignee | ||
Comment 13•8 years ago
|
||
A failure on my part to set up inlinable intrinsics correctly. There's really no particular reason for these to be inlinable; they are not going to be hot. So it's an easy fix.
Assignee | ||
Comment 14•8 years ago
|
||
Assignee | ||
Comment 15•8 years ago
|
||
With this patch (suitably corrected) there's a fascinating new failure in an existing test: in ecma_6/TypedArray/Tconstructor-fromTypedArray-byteLength.js.
The direct cause of the failure is that an object that is an ArrayBuffer (it prints as "[ArrayBuffer]" and believes itself to be that) has a prototype that is SharedArrayBuffer.prototype. Hence when we call the byteLength getter on that object there's a failure, since the byteLength getter is nongeneric and SharedArrayBuffer's byteLength fails the type check when presented with an arrayBuffer.
How we end up with the wrong prototype is unknown. What is known is that the patch on the present bug fixes subclassing of SharedArrayBuffer, which was not previously working. There could be a bug in that fix, or the fix could be uncovering a previous bug, either in the VM or in the test case. The test case relies on some particularly gnarly reflection to construct a set of constructors for TypedArrays that carry SharedArrayBuffers... See ecma_{6,7}/TypedArray/shell.js.
Assignee | ||
Comment 16•8 years ago
|
||
The fascinating failure is being addressed in bug 1314564.
Depends on: 1314564
Assignee | ||
Comment 17•8 years ago
|
||
Assignee | ||
Comment 18•8 years ago
|
||
Adaptation of Xrays test case.
Attachment #8807147 -
Flags: review?(evilpies)
Comment 19•8 years ago
|
||
Comment on attachment 8807147 [details] [diff] [review]
bug1232966-sab-slice-xray.patch
Review of attachment 8807147 [details] [diff] [review]:
-----------------------------------------------------------------
I am glad to see this being fixed now!
Attachment #8807147 -
Flags: review?(evilpies) → review+
Assignee | ||
Comment 20•8 years ago
|
||
Comment on attachment 8807147 [details] [diff] [review]
bug1232966-sab-slice-xray.patch
Boris, evilpie approved this but it probably needs your stamp - one more property going onto SharedArrayBuffer.
Flags: needinfo?(bzbarsky)
Comment 21•8 years ago
|
||
Flags: needinfo?(bzbarsky)
Attachment #8807147 -
Flags: review+
Assignee | ||
Comment 22•8 years ago
|
||
Try build is green:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=95505b97467d
Assignee | ||
Comment 23•8 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/334620bedacab85bcfed7934a714d95d9945455d
Bug 1232966 - SharedArrayBuffer.prototype.slice. r=arai
https://hg.mozilla.org/integration/mozilla-inbound/rev/55398c6f895777f83bdec5cc4bbef3af9f958930
Bug 1232966 - test cases for SharedArrayBuffer.prototype.slice. r=arai
https://hg.mozilla.org/integration/mozilla-inbound/rev/00c0fdd359040cf9c5515522a620f06ea26cc6ba
Bug 1232966 - Adapt Xrays tests for SharedArrayBuffer.prototype.slice. r=bz
Comment 24•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/334620bedaca
https://hg.mozilla.org/mozilla-central/rev/55398c6f8957
https://hg.mozilla.org/mozilla-central/rev/00c0fdd35904
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
status-firefox52:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
Comment 25•8 years ago
|
||
New page: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer/slice
Updated: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer#Methods
As this isn't in a Firefox release yet, it won't appear on the "Firefox for developers" release notes. Shared memory is listed as an experimental feature, though: https://developer.mozilla.org/en-US/Firefox/Experimental_features#JavaScript
Keywords: dev-doc-needed → dev-doc-complete
You need to log in
before you can comment on or make changes to this bug.
Description
•