Add helper function to emit JSOP_POP or JSOP_POPN for given amount

RESOLVED FIXED in Firefox 55

Status

()

Core
JavaScript Engine
--
enhancement
RESOLVED FIXED
8 months ago
8 months ago

People

(Reporter: arai, Assigned: arai)

Tracking

Trunk
mozilla55
Points:
---

Firefox Tracking Flags

(firefox55 fixed)

Details

Attachments

(1 attachment)

(Assignee)

Description

8 months ago
JSOP_POP is single byte, and JSOP_POPN is 3 bytes, so using JSOP_POP is shorter for popping 1 or 2 values.
it would be better adding dedicated function that receives the amount of values to pop and emit better opcode sequence to it.
(Assignee)

Updated

8 months ago
status-firefox54: affected → ---
(Assignee)

Comment 1

8 months ago
Created attachment 8844763 [details] [diff] [review]
Add BytecodeEmitter::emitPopN to emit shorter bytecode for given pop count.

regarding bug 1147371 comment #36
> I chose |pop; pop| because it's 2 bytes, and |popn 2| is 3 bytes.

added BytecodeEmitter::emitPopN that emits JSOP_POP when popping 1 or 2 values, and JSOP_POPN for other cases,
and used emitPopN where popping possibly multiple values.
Assignee: nobody → arai.unmht
Status: NEW → ASSIGNED
Attachment #8844763 - Flags: review?(shu)

Comment 2

8 months ago
Comment on attachment 8844763 [details] [diff] [review]
Add BytecodeEmitter::emitPopN to emit shorter bytecode for given pop count.

Review of attachment 8844763 [details] [diff] [review]:
-----------------------------------------------------------------

Nice, thanks.
Attachment #8844763 - Flags: review?(shu) → review+
(Assignee)

Comment 3

8 months ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/5dff3bf590ba88c906073e0a22a9f9b33a77b927
Bug 1344476 - Add BytecodeEmitter::emitPopN to emit shorter bytecode for given pop count. r=shu

Comment 4

8 months ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/5dff3bf590ba
Status: ASSIGNED → RESOLVED
Last Resolved: 8 months ago
status-firefox55: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.