Closed
Bug 1237449
Opened 10 years ago
Closed 10 years ago
Split emitSpread out of emitForOf for clarity
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla46
| Tracking | Status | |
|---|---|---|
| firefox46 | --- | fixed |
People
(Reporter: Waldo, Assigned: Waldo)
References
Details
Attachments
(4 files)
|
6.24 KB,
patch
|
efaust
:
review+
|
Details | Diff | Splinter Review |
|
3.14 KB,
patch
|
efaust
:
review+
|
Details | Diff | Splinter Review |
|
6.78 KB,
patch
|
efaust
:
review+
|
Details | Diff | Splinter Review |
|
10.34 KB,
patch
|
efaust
:
review+
|
Details | Diff | Splinter Review |
The intermixing hurts clarity more than it helps non-duplication, IMO.
| Assignee | ||
Comment 1•10 years ago
|
||
Attachment #8704856 -
Flags: review?(efaustbmo)
| Assignee | ||
Comment 2•10 years ago
|
||
Attachment #8704859 -
Flags: review?(efaustbmo)
| Assignee | ||
Comment 3•10 years ago
|
||
Attachment #8704860 -
Flags: review?(efaustbmo)
| Assignee | ||
Comment 4•10 years ago
|
||
Attachment #8704861 -
Flags: review?(efaustbmo)
Comment 5•10 years ago
|
||
Comment on attachment 8704856 [details] [diff] [review]
Copy emitForOf into a new emitSpread method, basically no other changes
Review of attachment 8704856 [details] [diff] [review]:
-----------------------------------------------------------------
OK...
Attachment #8704856 -
Flags: review?(efaustbmo) → review+
Comment 6•10 years ago
|
||
Comment on attachment 8704859 [details] [diff] [review]
Initial emitSpread cleanups. NOT REVIEWED YET
Review of attachment 8704859 [details] [diff] [review]:
-----------------------------------------------------------------
::: js/src/frontend/BytecodeEmitter.cpp
@@ +5549,3 @@
>
> #ifdef DEBUG
> + auto loopDepth = this->stackDepth;
why is auto here better? In case we change the type of this->stackDepth?
Attachment #8704859 -
Flags: review?(efaustbmo) → review+
Comment 7•10 years ago
|
||
Comment on attachment 8704860 [details] [diff] [review]
More emitSpread cleanups
Review of attachment 8704860 [details] [diff] [review]:
-----------------------------------------------------------------
::: js/src/frontend/BytecodeEmitter.cpp
@@ +5544,5 @@
> // Increment manually to reflect this.
> this->stackDepth++;
>
> + ptrdiff_t beq;
> + {
This syntactic block is just for logical readability, "this is the loop body". Up to you whether to keep it, not sure it gains that much.
Attachment #8704860 -
Flags: review?(efaustbmo) → review+
Comment 8•10 years ago
|
||
Comment on attachment 8704861 [details] [diff] [review]
Finish cleaning up emitForOf's code now that it's not also implementing the spread operation
Review of attachment 8704861 [details] [diff] [review]:
-----------------------------------------------------------------
These do indeed make it cleaner.
::: js/src/frontend/BytecodeEmitter.cpp
@@ +5608,5 @@
> + if (!emitForInOrOfVariables(loopDecl))
> + return false;
> + }
> +
> + // Compile the expression to the right of 'of'.
"Compile" is a terrible word here, while we're changing this.
Attachment #8704861 -
Flags: review?(efaustbmo) → review+
| Assignee | ||
Comment 9•10 years ago
|
||
(In reply to Eric Faust [:efaust] from comment #6)
> > + auto loopDepth = this->stackDepth;
>
> why is auto here better? In case we change the type of this->stackDepth?
Not so much in case of a change, but because then neither reader/writer has to know the type of stackDepth -- they can just take as obvious that the variable has the right type, so long as it's only used in comparisons with values of like meaning. That makes it easier to write such assertions, easier to read them, etc.
(Also, I did this partly for the reason you indirectly suggest. We are inconsistent in several places wrt what type we use for stack depth: uint32_t in CGTryNoteList, int32_t *and* uint32_t in BytecodeEmitter, and for all I know other types elsewhere. This probably should all be made consistent, but for comparison purposes it's all so much mental noise.)
Comment 10•10 years ago
|
||
Comment 11•10 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/af947b44dc7d
https://hg.mozilla.org/mozilla-central/rev/0b4bc484328e
https://hg.mozilla.org/mozilla-central/rev/368b826c8290
https://hg.mozilla.org/mozilla-central/rev/6cc42896216e
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
status-firefox46:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla46
You need to log in
before you can comment on or make changes to this bug.
Description
•