Closed
Bug 1457365
Opened 7 years ago
Closed 7 years ago
Do not add source note for useless expressions
Categories
(Core :: JavaScript Engine, enhancement, P2)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla61
Tracking | Status | |
---|---|---|
firefox61 | --- | fixed |
People
(Reporter: arai, Assigned: arai)
References
Details
Attachments
(1 file)
1.84 KB,
patch
|
jorendorff
:
review+
|
Details | Diff | Splinter Review |
https://searchfox.org/mozilla-central/rev/78dbe34925f04975f16cb9a5d4938be714d41897/js/src/frontend/BytecodeEmitter.cpp#8703-8704
> bool
> BytecodeEmitter::emitExpressionStatement(ParseNode* pn)
> {
> ...
>
> if (!updateSourceCoordNotes(pn->pn_pos.begin))
> return false;
> ...
> if (useful) {
> JSOp op = wantval ? JSOP_SETRVAL : JSOP_POP;
> ValueUsage valueUsage = wantval ? ValueUsage::WantValue : ValueUsage::IgnoreValue;
> MOZ_ASSERT_IF(expr->isKind(ParseNodeKind::Assign), expr->isOp(JSOP_NOP));
> if (!emitTree(expr, valueUsage))
> return false;
> if (!emit1(op))
> return false;
Currently updateSourceCoordNotes is called regardless of useful-ness.
But we don't have to call it for useless expressions, since we don't emit bytecode for them.
Assignee | ||
Comment 1•7 years ago
|
||
here's try with the change.
https://treeherder.mozilla.org/#/jobs?repo=try&revision=bf823a24557d083ed20fb57a223cc2fb496da996&group_state=expanded
I'll post the patch once try finishes without unexpected failure.
Assignee: nobody → arai.unmht
Status: NEW → ASSIGNED
Assignee | ||
Comment 2•7 years ago
|
||
Assignee | ||
Comment 3•7 years ago
|
||
This will reduce the source note size, and also help bug 1455548,
since now we have to handle source note only if we're emitting the code there.
Attachment #8971495 -
Flags: review?(jorendorff)
Updated•7 years ago
|
Attachment #8971495 -
Flags: review?(jorendorff) → review+
Updated•7 years ago
|
Priority: -- → P2
Assignee | ||
Comment 4•7 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/2c8741c94a0dd857b86f48aad3e8f82cb8c5e6d7
Bug 1457365 - Do not add source note for useless expression. r=jorendorff
Comment 5•7 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
You need to log in
before you can comment on or make changes to this bug.
Description
•