Closed Bug 989011 Opened 10 years ago Closed 10 years ago

Factor this-computation for arrow functions out of JSOP_LAMBDA

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla31

People

(Reporter: jandem, Assigned: jandem)

References

Details

Attachments

(1 file)

For arrow functions, js::Lambda currently uses ComputeThis to compute |this| for the current Baseline/interpreter frame.

Computing |this| for Ion frames is a bit more complicated, see IonBuilder::jsop_this.

It'd be nice if we could just emit JSOP_THIS followed by JSOP_LAMBDA_ARROW, this should also be more efficient for Baseline.
Attached patch PatchSplinter Review
This patch adds JSOP_LAMBDA_ARROW and emits it for arrow functions. This op is always preceded by JSOP_THIS, this is nice because it means we get the (optimized) compute-this logic for free. Ion-compiling this op will be straight-forward.

It should also be slightly faster, because we no longer need the GetTopBaselineFrame stuff etc.
Attachment #8398118 - Flags: review?(jorendorff)
Blocks: 989204
Comment on attachment 8398118 [details] [diff] [review]
Patch

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

Looks good.
Attachment #8398118 - Flags: review?(jorendorff) → review+
https://hg.mozilla.org/mozilla-central/rev/5caacc7b8fa5
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla31
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: