Closed
Bug 1452818
Opened 7 years ago
Closed 7 years ago
Eliminate the need for BytecodeCompiler::startPosition to be default-constructable
Categories
(Core :: JavaScript Engine, enhancement)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla61
Tracking | Status | |
---|---|---|
firefox61 | --- | fixed |
People
(Reporter: Waldo, Assigned: Waldo)
Details
Attachments
(2 files)
6.46 KB,
patch
|
arai
:
review+
|
Details | Diff | Splinter Review |
20.41 KB,
patch
|
arai
:
review+
|
Details | Diff | Splinter Review |
Some of the Unicode character-type work wants to be able to create character iterators that have Rust-like borrow-checking semantics. Part of this requires that iterators always be initialized, which means they should never be default-constructed.
Unfortunately, TokenStreamCharsBase::Position *is* default-constructed now. This can be fixed: move the single Position where this is necessary to a location where it can be constructed fully initialized, and then initialize those positions by directly constructing them from a |tokenStream|.
Assignee | ||
Comment 1•7 years ago
|
||
This doesn't really change anything, but it does get rid of a very small amount of useless code-execution when not compiling things that don't have handleParseFailure failure modes.
Attachment #8966427 -
Flags: review?(arai.unmht)
Assignee | ||
Comment 2•7 years ago
|
||
Attachment #8966428 -
Flags: review?(arai.unmht)
Updated•7 years ago
|
Attachment #8966427 -
Flags: review?(arai.unmht) → review+
Updated•7 years ago
|
Attachment #8966428 -
Flags: review?(arai.unmht) → review+
Pushed by jwalden@mit.edu:
https://hg.mozilla.org/integration/mozilla-inbound/rev/d21bb4d700d8
Move BytecodeCompiler::startPosition into more locally-scoped stack-frame variables. r=arai
https://hg.mozilla.org/integration/mozilla-inbound/rev/4f2a7bac2733
Make tokenstream positions be created by constructor-call so that their members don't have to be default-constructible. r=arai
Comment 4•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/d21bb4d700d8
https://hg.mozilla.org/mozilla-central/rev/4f2a7bac2733
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
status-firefox61:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
Assignee | ||
Comment 5•7 years ago
|
||
Oh, for anyone wondering -- we have to have a |Position foo(...)| local declared that way, not a function that returns a Position, because returning a Position that way pre-C++17 is not guaranteed to not need to invoke a copy constructor or similar, and I may need to have that requirement for the work that motivated this.
You need to log in
before you can comment on or make changes to this bug.
Description
•