Closed
Bug 1491959
Opened 7 years ago
Closed 7 years ago
We allocate a whole array every time a generator yields (?!)
Categories
(Core :: JavaScript Engine, enhancement)
Core
JavaScript Engine
Tracking
()
RESOLVED
INVALID
People
(Reporter: jorendorff, Unassigned)
Details
Not totally sure, but it seems silly if so.
https://searchfox.org/mozilla-central/rev/6c82481caa506a240a626bb44a2b8cbe0eedb3a0/js/src/vm/GeneratorObject.cpp#84
Comment 1•7 years ago
|
||
The expression stack is saved here [1], so that the next yield operation can reuse it [2]. Courtesy of Arai-san -> bug 1396499. :-)
[1] https://searchfox.org/mozilla-central/rev/6c82481caa506a240a626bb44a2b8cbe0eedb3a0/js/src/vm/GeneratorObject.cpp#95
[2] https://searchfox.org/mozilla-central/rev/6c82481caa506a240a626bb44a2b8cbe0eedb3a0/js/src/vm/GeneratorObject.cpp#71,75-78
| Reporter | ||
Comment 2•7 years ago
|
||
This is the line I was missing:
https://searchfox.org/mozilla-central/rev/6c82481caa506a240a626bb44a2b8cbe0eedb3a0/js/src/vm/GeneratorObject.cpp#77
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → INVALID
| Reporter | ||
Comment 3•7 years ago
|
||
It looks like the storage of these values could be optimized a bunch more, but that's another bug.
You need to log in
before you can comment on or make changes to this bug.
Description
•