Add easier to use reset method to CallReceiver

RESOLVED FIXED in mozilla11

Status

()

Core
JavaScript Engine
--
trivial
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: terrence, Assigned: terrence)

Tracking

Trunk
mozilla11
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

6 years ago
Created attachment 569562 [details] [diff] [review]
v1: Implements setupNewCall and removes calleeHasBeenReset

All users of InvokeArgsGuard that use calleeHasBeenReset use it before setting a new callee/this, frequently in a loop.  We should make it easier to use by combining the reset with the setup of the required parameters for the new call.
Attachment #569562 - Flags: review?(luke)

Comment 1

6 years ago
Comment on attachment 569562 [details] [diff] [review]
v1: Implements setupNewCall and removes calleeHasBeenReset

>-    ag.calleeHasBeenReset();
>-    ag.calleev() = ca->fval;
>-    ag.thisv() = UndefinedValue();
>+    ag.setupNewCall(ca->fval, UndefinedValue());

It makes sense to merge setting callee and clearing the debug flag, but I'd rather not set both this and callee since you now need to know the order of callee/this to read the call.  How about:

>-    ag.calleeHasBeenReset();
>-    ag.calleev() = ca->fval;
>+    ag.setCallee(ca->fval)
>     ag.thisv() = UndefinedValue();

?
(Assignee)

Comment 2

6 years ago
Created attachment 569814 [details] [diff] [review]
v2: With review feedback.

You are right.  I got a bit over zealous in merging both of those.
Attachment #569562 - Attachment is obsolete: true
Attachment #569562 - Flags: review?(luke)
Attachment #569814 - Flags: review?(luke)

Comment 3

6 years ago
Comment on attachment 569814 [details] [diff] [review]
v2: With review feedback.

Great
Attachment #569814 - Flags: review?(luke) → review+
(Assignee)

Comment 4

6 years ago
https://tbpl.mozilla.org/?tree=Mozilla-Inbound&rev=131f751eedb1
https://hg.mozilla.org/mozilla-central/rev/131f751eedb1
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla11
You need to log in before you can comment on or make changes to this bug.