Bug 800179 - Initialize CallArgsList::active_ in the constructor. r=luke a=bajaj
authorJan de Mooij <jdemooij@mozilla.com>
Fri, 09 Nov 2012 10:23:56 +0100
changeset 116769 8914200121e93849f54ed81e5d85cc302f437b28
parent 116768 895e866ddec3eea1220c0bd58b55e784a89a2b5a
child 116770 cb6d20b909c02d7a8a24562571f5dfde7a5450c7
push id1708
push userakeybl@mozilla.com
push dateMon, 19 Nov 2012 21:10:21 +0000
treeherdermozilla-beta@27b14fe50103 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersluke, bajaj
bugs800179
milestone18.0a2
Bug 800179 - Initialize CallArgsList::active_ in the constructor. r=luke a=bajaj
js/src/ion/Ion.cpp
js/src/ion/Ion.h
js/src/vm/Stack.h
--- a/js/src/ion/Ion.cpp
+++ b/js/src/ion/Ion.cpp
@@ -1447,17 +1447,17 @@ ion::SideCannon(JSContext *cx, StackFram
                  script);
     }
 #endif
 
     return status;
 }
 
 IonExecStatus
-ion::FastInvoke(JSContext *cx, HandleFunction fun, CallArgs &args)
+ion::FastInvoke(JSContext *cx, HandleFunction fun, CallArgsList &args)
 {
     JS_CHECK_RECURSION(cx, return IonExec_Error);
 
     HandleScript script = fun->script();
     IonScript *ion = script->ionScript();
     IonCode *code = ion->method();
     void *jitcode = code->raw();
 
@@ -1489,17 +1489,19 @@ ion::FastInvoke(JSContext *cx, HandleFun
     activation.setPrevPc(cx->regs().pc);
 
     EnterIonCode enter = cx->compartment->ionCompartment()->enterJITInfallible();
     void *calleeToken = CalleeToToken(fun);
 
     Value result = Int32Value(fun->nargs);
 
     JSAutoResolveFlags rf(cx, RESOLVE_INFER);
+    args.setActive();
     enter(jitcode, args.length() + 1, &args[0] - 1, fp, calleeToken, &result);
+    args.setInactive();
 
     if (clearCallingIntoIon)
         fp->clearCallingIntoIon();
 
     JS_ASSERT(fp == cx->fp());
     JS_ASSERT(!cx->runtime->hasIonReturnOverride());
 
     args.rval().set(result);
--- a/js/src/ion/Ion.h
+++ b/js/src/ion/Ion.h
@@ -234,17 +234,17 @@ enum IonExecStatus
     IonExec_Ok,
     IonExec_Bailout
 };
 
 IonExecStatus Cannon(JSContext *cx, StackFrame *fp);
 IonExecStatus SideCannon(JSContext *cx, StackFrame *fp, jsbytecode *pc);
 
 // Used to enter Ion from C++ natives like Array.map. Called from FastInvokeGuard.
-IonExecStatus FastInvoke(JSContext *cx, HandleFunction fun, CallArgs &args);
+IonExecStatus FastInvoke(JSContext *cx, HandleFunction fun, CallArgsList &args);
 
 // Walk the stack and invalidate active Ion frames for the invalid scripts.
 void Invalidate(types::TypeCompartment &types, FreeOp *fop,
                 const Vector<types::RecompileInfo> &invalid, bool resetUses = true);
 void Invalidate(JSContext *cx, const Vector<types::RecompileInfo> &invalid, bool resetUses = true);
 bool Invalidate(JSContext *cx, JSScript *script, bool resetUses = true);
 
 void MarkFromIon(JSCompartment *comp, Value *vp);
--- a/js/src/vm/Stack.h
+++ b/js/src/vm/Stack.h
@@ -168,16 +168,18 @@ namespace ion {
  * InvokeArgsGuard can be pushed long before and popped long after the actual
  * call, during which time many stack-observing things can happen).
  */
 class CallArgsList : public JS::CallArgs
 {
     friend class StackSegment;
     CallArgsList *prev_;
     bool active_;
+  protected:
+    CallArgsList() : prev_(NULL), active_(false) {}
   public:
     friend CallArgsList CallArgsListFromVp(unsigned, Value *, CallArgsList *);
     friend CallArgsList CallArgsListFromArgv(unsigned, Value *, CallArgsList *);
     CallArgsList *prev() const { return prev_; }
     bool active() const { return active_; }
     void setActive() { active_ = true; }
     void setInactive() { active_ = false; }
 };