Bug 835277 part 1 - Convert CallObject::createForStrictEval to use AbstractFramePtr. r=djvj
authorJan de Mooij <jdemooij@mozilla.com>
Thu, 31 Jan 2013 11:49:55 +0100
changeset 130332 e2d33e01fac4afb284298da37868a339d9f2d22d
parent 130331 987ebceef054a1d1395d099c1ad36d20c7eaf1b9
child 130333 ccd9b78a80de58b3d3528e606848b18af7a80f22
push id2323
push userbbajaj@mozilla.com
push dateMon, 01 Apr 2013 19:47:02 +0000
treeherdermozilla-beta@7712be144d91 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdjvj
bugs835277
milestone21.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 835277 part 1 - Convert CallObject::createForStrictEval to use AbstractFramePtr. r=djvj
js/src/vm/ScopeObject.cpp
js/src/vm/ScopeObject.h
--- a/js/src/vm/ScopeObject.cpp
+++ b/js/src/vm/ScopeObject.cpp
@@ -237,26 +237,27 @@ CallObject::createForFunction(JSContext 
     /* Copy in the closed-over formal arguments. */
     for (AliasedFormalIter i(frame.script()); i; i++)
         callobj->setAliasedVar(i, frame.unaliasedFormal(i.frameIndex(), DONT_CHECK_ALIASING));
 
     return callobj;
 }
 
 CallObject *
-CallObject::createForStrictEval(JSContext *cx, StackFrame *fp)
+CallObject::createForStrictEval(JSContext *cx, AbstractFramePtr frame)
 {
     AssertCanGC();
-    JS_ASSERT(fp->isStrictEvalFrame());
-    JS_ASSERT(cx->fp() == fp);
-    JS_ASSERT(cx->regs().pc == fp->script()->code);
+    JS_ASSERT(frame.isStrictEvalFrame());
+    JS_ASSERT_IF(frame.isStackFrame(), cx->fp() == frame.asStackFrame());
+    JS_ASSERT_IF(frame.isStackFrame(), cx->regs().pc == frame.script()->code);
 
     RootedFunction callee(cx);
-    RootedScript script(cx, fp->script());
-    return create(cx, script, fp->scopeChain(), callee);
+    RootedScript script(cx, frame.script());
+    RootedObject scopeChain(cx, frame.scopeChain());
+    return create(cx, script, scopeChain, callee);
 }
 
 JS_PUBLIC_DATA(Class) js::CallClass = {
     "Call",
     JSCLASS_IS_ANONYMOUS | JSCLASS_HAS_RESERVED_SLOTS(CallObject::RESERVED_SLOTS),
     JS_PropertyStub,         /* addProperty */
     JS_PropertyStub,         /* delProperty */
     JS_PropertyStub,         /* getProperty */
--- a/js/src/vm/ScopeObject.h
+++ b/js/src/vm/ScopeObject.h
@@ -193,17 +193,17 @@ class CallObject : public ScopeObject
     static CallObject *
     createTemplateObject(JSContext *cx, HandleScript script);
 
     static const uint32_t RESERVED_SLOTS = 2;
 
     static CallObject *createForFunction(JSContext *cx, HandleObject enclosing, HandleFunction callee);
 
     static CallObject *createForFunction(JSContext *cx, AbstractFramePtr frame);
-    static CallObject *createForStrictEval(JSContext *cx, StackFrame *fp);
+    static CallObject *createForStrictEval(JSContext *cx, AbstractFramePtr frame);
 
     /* True if this is for a strict mode eval frame. */
     inline bool isForEval() const;
 
     /*
      * Returns the function for which this CallObject was created. (This may
      * only be called if !isForEval.)
      */