Bug 927782 - Part 12: Remove blockChain from StackFrame. r=luke
☠☠ backed out by 94cdaced90bf ☠ ☠
authorAndy Wingo <wingo@igalia.com>
Tue, 26 Nov 2013 12:17:08 +0100
changeset 174949 f86d2d4cfadf457bef12afbedb8a8f82a5e69fca
parent 174948 51d6617835d140affaf45ed9787d317388beb1ff
child 174950 4dcb040e3c84e69e9c3be4cee4d5e4b9ee995285
push id445
push userffxbld
push dateMon, 10 Mar 2014 22:05:19 +0000
treeherdermozilla-release@dc38b741b04e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersluke
bugs927782
milestone28.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 927782 - Part 12: Remove blockChain from StackFrame. r=luke
js/src/jit/BaselineBailouts.cpp
js/src/jit/BaselineCompiler.cpp
js/src/jit/BaselineFrame.cpp
js/src/jit/BaselineFrame.h
js/src/jit/BaselineFrameInfo.h
js/src/vm/Stack-inl.h
js/src/vm/Stack.cpp
js/src/vm/Stack.h
--- a/js/src/jit/BaselineBailouts.cpp
+++ b/js/src/jit/BaselineBailouts.cpp
@@ -606,20 +606,16 @@ InitFromBailout(JSContext *cx, HandleScr
     // Do not need to initialize scratchValue or returnValue fields in BaselineFrame.
 
     blFrame->setFlags(flags);
 
     // initArgsObjUnchecked modifies the frame's flags, so call it after setFlags.
     if (argsObj)
         blFrame->initArgsObjUnchecked(*argsObj);
 
-    // Ion doesn't compile code with try/catch, so the block object will always be
-    // null.
-    blFrame->setBlockChainNull();
-
     if (fun) {
         // The unpacked thisv and arguments should overwrite the pushed args present
         // in the calling frame.
         Value thisv = iter.read();
         IonSpew(IonSpew_BaselineBailouts, "      Is function!");
         IonSpew(IonSpew_BaselineBailouts, "      thisv=%016llx", *((uint64_t *) &thisv));
 
         size_t thisvOffset = builder.framePushed() + IonJSFrameLayout::offsetOfThis();
--- a/js/src/jit/BaselineCompiler.cpp
+++ b/js/src/jit/BaselineCompiler.cpp
@@ -284,18 +284,16 @@ BaselineCompiler::emitPrologue()
     // chain is in R1.  For function scripts, the scope chain is in
     // the callee, nullptr is stored for now so that GC doesn't choke
     // on a bogus ScopeChain value in the frame.
     if (function())
         masm.storePtr(ImmPtr(nullptr), frame.addressOfScopeChain());
     else
         masm.storePtr(R1.scratchReg(), frame.addressOfScopeChain());
 
-    masm.storePtr(ImmPtr(nullptr), frame.addressOfBlockChain());
-
     // Functions with a large number of locals require two stack checks.
     // The VMCall for a fallible stack check can only occur after the
     // scope chain has been initialized, as that is required for proper
     // exception handling if the VMCall returns false.  The scope chain
     // initialization can only happen after the UndefinedValues for the
     // local slots have been pushed.
     // However by that time, the stack might have grown too much.
     // In these cases, we emit an extra, early, infallible check
--- a/js/src/jit/BaselineFrame.cpp
+++ b/js/src/jit/BaselineFrame.cpp
@@ -108,18 +108,16 @@ BaselineFrame::initForOsr(StackFrame *fp
 {
     mozilla::PodZero(this);
 
     scopeChain_ = fp->scopeChain();
 
     if (fp->hasCallObjUnchecked())
         flags_ |= BaselineFrame::HAS_CALL_OBJ;
 
-    blockChain_ = fp->maybeBlockChain();
-
     if (fp->isEvalFrame()) {
         flags_ |= BaselineFrame::EVAL;
         evalScript_ = fp->script();
     }
 
     if (fp->script()->needsArgsObj() && fp->hasArgsObj()) {
         flags_ |= BaselineFrame::HAS_ARGS_OBJ;
         argsObj_ = &fp->argsObj();
--- a/js/src/jit/BaselineFrame.h
+++ b/js/src/jit/BaselineFrame.h
@@ -64,21 +64,23 @@ class BaselineFrame
     // We need to split the Value into 2 fields of 32 bits, otherwise the C++
     // compiler may add some padding between the fields.
     uint32_t loScratchValue_;
     uint32_t hiScratchValue_;
     uint32_t loReturnValue_;        // If HAS_RVAL, the frame's return value.
     uint32_t hiReturnValue_;
     uint32_t frameSize_;
     JSObject *scopeChain_;          // Scope chain (always initialized).
-    StaticBlockObject *blockChain_; // The static block chain.
     JSScript *evalScript_;          // If isEvalFrame(), the current eval script.
     ArgumentsObject *argsObj_;      // If HAS_ARGS_OBJ, the arguments object.
     void *hookData_;                // If HAS_HOOK_DATA, debugger call hook data.
     uint32_t flags_;
+#if JS_BITS_PER_WORD == 32
+    uint32_t padding_;              // Pad to 8-byte alignment.
+#endif
 
   public:
     // Distance between the frame pointer and the frame header (return address).
     // This is the old frame pointer saved in the prologue.
     static const uint32_t FramePointerOffset = sizeof(void *);
 
     bool initForOsr(StackFrame *fp, uint32_t numStackValues);
 
@@ -204,36 +206,16 @@ class BaselineFrame
     void setReturnValue(const Value &v) {
         flags_ |= HAS_RVAL;
         *returnValue() = v;
     }
     inline Value *addressOfReturnValue() {
         return reinterpret_cast<Value *>(&loReturnValue_);
     }
 
-    bool hasBlockChain() const {
-        return blockChain_;
-    }
-    StaticBlockObject &blockChain() const {
-        JS_ASSERT(hasBlockChain());
-        return *blockChain_;
-    }
-    StaticBlockObject *maybeBlockChain() const {
-        return hasBlockChain() ? blockChain_ : nullptr;
-    }
-    void setBlockChain(StaticBlockObject &block) {
-        blockChain_ = &block;
-    }
-    void setBlockChainNull() {
-        blockChain_ = nullptr;
-    }
-    StaticBlockObject **addressOfBlockChain() {
-        return &blockChain_;
-    }
-
     bool hasCallObj() const {
         return flags_ & HAS_CALL_OBJ;
     }
 
     inline CallObject &callObj() const;
 
     void setFlags(uint32_t flags) {
         flags_ = flags;
@@ -373,19 +355,16 @@ class BaselineFrame
         return -int(Size()) + offsetof(BaselineFrame, frameSize_);
     }
     static int reverseOffsetOfScratchValue() {
         return -int(Size()) + offsetof(BaselineFrame, loScratchValue_);
     }
     static int reverseOffsetOfScopeChain() {
         return -int(Size()) + offsetof(BaselineFrame, scopeChain_);
     }
-    static int reverseOffsetOfBlockChain() {
-        return -int(Size()) + offsetof(BaselineFrame, blockChain_);
-    }
     static int reverseOffsetOfArgsObj() {
         return -int(Size()) + offsetof(BaselineFrame, argsObj_);
     }
     static int reverseOffsetOfFlags() {
         return -int(Size()) + offsetof(BaselineFrame, flags_);
     }
     static int reverseOffsetOfEvalScript() {
         return -int(Size()) + offsetof(BaselineFrame, evalScript_);
--- a/js/src/jit/BaselineFrameInfo.h
+++ b/js/src/jit/BaselineFrameInfo.h
@@ -279,19 +279,16 @@ class FrameInfo
         return Address(BaselineFrameReg, BaselineFrame::offsetOfThis());
     }
     Address addressOfCallee() const {
         return Address(BaselineFrameReg, BaselineFrame::offsetOfCalleeToken());
     }
     Address addressOfScopeChain() const {
         return Address(BaselineFrameReg, BaselineFrame::reverseOffsetOfScopeChain());
     }
-    Address addressOfBlockChain() const {
-        return Address(BaselineFrameReg, BaselineFrame::reverseOffsetOfBlockChain());
-    }
     Address addressOfFlags() const {
         return Address(BaselineFrameReg, BaselineFrame::reverseOffsetOfFlags());
     }
     Address addressOfEvalScript() const {
         return Address(BaselineFrameReg, BaselineFrame::reverseOffsetOfEvalScript());
     }
     Address addressOfReturnValue() const {
         return Address(BaselineFrameReg, BaselineFrame::reverseOffsetOfReturnValue());
--- a/js/src/vm/Stack-inl.h
+++ b/js/src/vm/Stack-inl.h
@@ -80,18 +80,16 @@ StackFrame::initCallFrame(JSContext *cx,
     flags_ = FUNCTION | HAS_SCOPECHAIN | flagsArg;
     argv_ = argv;
     exec.fun = &callee;
     u.nactual = nactual;
     scopeChain_ = callee.environment();
     prev_ = prev;
     prevpc_ = prevpc;
     prevsp_ = prevsp;
-    blockChain_= nullptr;
-    JS_ASSERT(!hasBlockChain());
     JS_ASSERT(!hasHookData());
 
     initVarsToUndefined();
 }
 
 inline void
 StackFrame::initVarsToUndefined()
 {
@@ -511,27 +509,16 @@ AbstractFramePtr::unaliasedActual(unsign
         return asStackFrame()->unaliasedActual(i, checkAliasing);
 #ifdef JS_ION
     return asBaselineFrame()->unaliasedActual(i, checkAliasing);
 #else
     MOZ_ASSUME_UNREACHABLE("Invalid frame");
 #endif
 }
 
-inline StaticBlockObject *
-AbstractFramePtr::maybeBlockChain() const
-{
-    if (isStackFrame())
-        return asStackFrame()->maybeBlockChain();
-#ifdef JS_ION
-    return asBaselineFrame()->maybeBlockChain();
-#else
-    MOZ_ASSUME_UNREACHABLE("Invalid frame");
-#endif
-}
 inline bool
 AbstractFramePtr::hasCallObj() const
 {
     if (isStackFrame())
         return asStackFrame()->hasCallObj();
 #ifdef JS_ION
     return asBaselineFrame()->hasCallObj();
 #else
--- a/js/src/vm/Stack.cpp
+++ b/js/src/vm/Stack.cpp
@@ -76,17 +76,16 @@ StackFrame::initExecuteFrame(JSContext *
         u.evalScript = (JSScript *)0xbad;
 #endif
     }
 
     scopeChain_ = &scopeChain;
     prev_ = nullptr;
     prevpc_ = nullptr;
     prevsp_ = nullptr;
-    blockChain_ = nullptr;
 
     JS_ASSERT_IF(evalInFramePrev, isDebuggerFrame());
     evalInFramePrev_ = evalInFramePrev;
 
 #ifdef DEBUG
     Debug_SetValueRangeToCrashOnTouch(&rval_, 1);
     hookData_ = (void *)0xbad;
 #endif
@@ -268,17 +267,16 @@ StackFrame::prologue(JSContext *cx)
     probes::EnterScript(cx, script, script->function(), this);
     return true;
 }
 
 void
 StackFrame::epilogue(JSContext *cx)
 {
     JS_ASSERT(!isYielding());
-    JS_ASSERT(!hasBlockChain());
 
     RootedScript script(cx, this->script());
     probes::ExitScript(cx, script, script->function(), hasPushedSPSFrame());
 
     if (isEvalFrame()) {
         if (isStrictEvalFrame()) {
             JS_ASSERT_IF(hasCallObj(), scopeChain()->as<CallObject>().isForEval());
             if (JS_UNLIKELY(cx->compartment()->debugMode()))
--- a/js/src/vm/Stack.h
+++ b/js/src/vm/Stack.h
@@ -173,17 +173,16 @@ class AbstractFramePtr
 
     inline JSObject *scopeChain() const;
     inline CallObject &callObj() const;
     inline bool initFunctionScopeObjects(JSContext *cx);
     inline void pushOnScopeChain(ScopeObject &scope);
 
     inline JSCompartment *compartment() const;
 
-    inline StaticBlockObject *maybeBlockChain() const;
     inline bool hasCallObj() const;
     inline bool isGeneratorFrame() const;
     inline bool isYielding() const;
     inline bool isFunctionFrame() const;
     inline bool isGlobalFrame() const;
     inline bool isEvalFrame() const;
     inline bool isFramePushedByExecute() const;
     inline bool isDebuggerFrame() const;
@@ -332,17 +331,16 @@ class StackFrame
         JSFunction      *fun;           /*   function frame, pre GetScopeChain */
     } exec;
     union {                             /* describes the arguments of a function */
         unsigned        nactual;        /*   for non-eval frames */
         JSScript        *evalScript;    /*   the script of an eval-in-function */
     } u;
     mutable JSObject    *scopeChain_;   /* if HAS_SCOPECHAIN, current scope chain */
     Value               rval_;          /* if HAS_RVAL, return value of the frame */
-    StaticBlockObject   *blockChain_;   /* innermost let block */
     ArgumentsObject     *argsObj_;      /* if HAS_ARGS_OBJ, the call's arguments object */
 
     /*
      * Previous frame and its pc and sp. Always nullptr for
      * InterpreterActivation's entry frame, always non-nullptr for inline
      * frames.
      */
     StackFrame          *prev_;
@@ -589,29 +587,16 @@ class StackFrame
     inline void pushOnScopeChain(ScopeObject &scope);
     inline void popOffScopeChain();
 
     /*
      * For blocks with aliased locals, these interfaces push and pop entries on
      * the scope chain.
      */
 
-    bool hasBlockChain() const {
-        return blockChain_;
-    }
-
-    StaticBlockObject *maybeBlockChain() {
-        return blockChain_;
-    }
-
-    StaticBlockObject &blockChain() const {
-        JS_ASSERT(hasBlockChain());
-        return *blockChain_;
-    }
-
     bool pushBlock(JSContext *cx, StaticBlockObject &block);
     void popBlock(JSContext *cx);
 
     /*
      * With
      *
      * Entering/leaving a |with| block pushes/pops an object on the scope chain.
      * Pushing uses pushOnScopeChain, popping should use popWith.