Closed
Bug 1015742
Opened 11 years ago
Closed 10 years ago
refactor JSOP_SPREAD to work on iterator
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
mozilla32
People
(Reporter: Swatinem, Assigned: Swatinem)
References
(Blocks 1 open bug)
Details
Attachments
(1 file, 1 obsolete file)
13.43 KB,
patch
|
jorendorff
:
review+
|
Details | Diff | Splinter Review |
Discussion on irc:
jorendorff: Swatinem: change the existing JSOP_SPREAD bytecode to take an iterator, not an iterable
jorendorff: Swatinem: change all our existing code that uses JSOP_SPREAD to first emit a JSOP_CALLPROP "@@iterator"
jorendorff: Swatinem: then the new JSOP_SPREAD behavior will be exactly what rest-destructuring needs. What do you think?
jorendorff: We may eventually want to remove JSOP_SPREAD, but that can happen later.
Swatinem: hm ok, so in the spread case, jsop_spread would get a fresh iterator to fill into an already filled array
Swatinem: and in the rest-destructuring, it will get a half-spent iterator to fill into an empty array?
jorendorff: yep
Swatinem: sounds good.
Swatinem: i was looking at jsop_spread before, but it didnt quite do what was needed for my case
jorendorff: right
jorendorff: but it shouldn't be hard to fix that
Swatinem: and incidentally, that would also take care of the bug that one cant use generic iterators with destructuring right now
jorendorff: Well ... I kind of assumed you'd be doing that already.
jorendorff: heh
jorendorff: it needs to be done. a lot of tests will have to be fixed :-\
Assignee | ||
Updated•11 years ago
|
No longer blocks: spread-assignment
Assignee | ||
Updated•11 years ago
|
Blocks: spread-assignment
Assignee | ||
Comment 1•11 years ago
|
||
Wow, this was easier than expected.
luckily GetIterator(iterator) === iterator; so I didn’t have to change ForOfIterator.
Note: I haven’t run the testsuite yet, just tested it locally.
Assignee: nobody → arpad.borsos
Status: NEW → ASSIGNED
Attachment #8428827 -
Flags: review?(jorendorff)
Assignee | ||
Comment 2•11 years ago
|
||
FAILURES:
js/src/jit-test/tests/basic/spread-array.js
js/src/jit-test/tests/basic/spread-call-eval.js
js/src/jit-test/tests/basic/spread-call-funapply.js
js/src/jit-test/tests/basic/spread-call-length.js
js/src/jit-test/tests/basic/spread-call.js
I will take a look at those tomorrow.
Assignee | ||
Comment 3•11 years ago
|
||
jit-test passes now locally, haven’t run it through try yet though.
Attachment #8428827 -
Attachment is obsolete: true
Attachment #8428827 -
Flags: review?(jorendorff)
Attachment #8429427 -
Flags: review?(jorendorff)
Assignee | ||
Comment 4•11 years ago
|
||
https://tbpl.mozilla.org/?tree=Try&rev=0fe98a371e67 looks pretty green so far :-)
Comment 5•10 years ago
|
||
Comment on attachment 8429427 [details] [diff] [review]
jsopspread.patch
Review of attachment 8429427 [details] [diff] [review]:
-----------------------------------------------------------------
Looks great.
Attachment #8429427 -
Flags: review?(jorendorff) → review+
Assignee | ||
Comment 6•10 years ago
|
||
Comment 7•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/310d82551d3b
https://hg.mozilla.org/mozilla-central/rev/7371145721bf
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla32
You need to log in
before you can comment on or make changes to this bug.
Description
•