Last Comment Bug 697322 - Add easier to use reset method to CallReceiver
: Add easier to use reset method to CallReceiver
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: Trunk
: All All
: -- trivial (vote)
: mozilla11
Assigned To: Terrence Cole [:terrence]
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-10-25 17:30 PDT by Terrence Cole [:terrence]
Modified: 2011-11-09 05:25 PST (History)
4 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
v1: Implements setupNewCall and removes calleeHasBeenReset (5.58 KB, patch)
2011-10-25 17:30 PDT, Terrence Cole [:terrence]
no flags Details | Diff | Splinter Review
v2: With review feedback. (5.18 KB, patch)
2011-10-26 15:09 PDT, Terrence Cole [:terrence]
luke: review+
Details | Diff | Splinter Review

Description Terrence Cole [:terrence] 2011-10-25 17:30:24 PDT
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.
Comment 1 Luke Wagner [:luke] 2011-10-25 17:52:36 PDT
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();

?
Comment 2 Terrence Cole [:terrence] 2011-10-26 15:09:17 PDT
Created attachment 569814 [details] [diff] [review]
v2: With review feedback.

You are right.  I got a bit over zealous in merging both of those.
Comment 3 Luke Wagner [:luke] 2011-10-26 15:15:24 PDT
Comment on attachment 569814 [details] [diff] [review]
v2: With review feedback.

Great
Comment 4 Terrence Cole [:terrence] 2011-11-08 10:28:21 PST
https://tbpl.mozilla.org/?tree=Mozilla-Inbound&rev=131f751eedb1
Comment 5 Marco Bonardo [::mak] 2011-11-09 05:25:21 PST
https://hg.mozilla.org/mozilla-central/rev/131f751eedb1

Note You need to log in before you can comment on or make changes to this bug.