Remove our notion of having a single activation register
authorsbarati@apple.com <sbarati@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 30 Jan 2016 00:01:48 +0000 (00:01 +0000)
committersbarati@apple.com <sbarati@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 30 Jan 2016 00:01:48 +0000 (00:01 +0000)
https://bugs.webkit.org/show_bug.cgi?id=153673

Reviewed by Filip Pizlo.

We have many functions lurking around where we think a function
might only have one activation register. This is clearly wrong
now that ES6 has block scoping. This patch removes this false notion.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::dumpBytecode):
(JSC::CodeBlock::CodeBlock):
* bytecode/CodeBlock.h:
(JSC::CodeBlock::scopeRegister):
(JSC::CodeBlock::codeType):
(JSC::CodeBlock::setActivationRegister): Deleted.
(JSC::CodeBlock::activationRegister): Deleted.
(JSC::CodeBlock::uncheckedActivationRegister): Deleted.
(JSC::CodeBlock::needsActivation): Deleted.
* bytecode/ExecutableInfo.h:
(JSC::ExecutableInfo::ExecutableInfo):
(JSC::ExecutableInfo::usesEval):
(JSC::ExecutableInfo::isStrictMode):
(JSC::ExecutableInfo::isConstructor):
(JSC::ExecutableInfo::isClassContext):
(JSC::ExecutableInfo::needsActivation): Deleted.
* bytecode/UnlinkedCodeBlock.cpp:
(JSC::UnlinkedCodeBlock::UnlinkedCodeBlock):
* bytecode/UnlinkedCodeBlock.h:
(JSC::UnlinkedCodeBlock::isArrowFunctionContext):
(JSC::UnlinkedCodeBlock::isClassContext):
(JSC::UnlinkedCodeBlock::setThisRegister):
(JSC::UnlinkedCodeBlock::setScopeRegister):
(JSC::UnlinkedCodeBlock::usesGlobalObject):
(JSC::UnlinkedCodeBlock::setGlobalObjectRegister):
(JSC::UnlinkedCodeBlock::thisRegister):
(JSC::UnlinkedCodeBlock::scopeRegister):
(JSC::UnlinkedCodeBlock::addPropertyAccessInstruction):
(JSC::UnlinkedCodeBlock::needsFullScopeChain): Deleted.
(JSC::UnlinkedCodeBlock::setActivationRegister): Deleted.
(JSC::UnlinkedCodeBlock::activationRegister): Deleted.
(JSC::UnlinkedCodeBlock::hasActivationRegister): Deleted.
* bytecode/UnlinkedFunctionExecutable.cpp:
(JSC::generateUnlinkedFunctionCodeBlock):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::BytecodeGenerator):
(JSC::BytecodeGenerator::initializeVarLexicalEnvironment):
* bytecompiler/BytecodeGenerator.h:
(JSC::BytecodeGenerator::destinationForAssignResult):
(JSC::BytecodeGenerator::leftHandSideNeedsCopy):
(JSC::BytecodeGenerator::emitNodeForLeftHandSide):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::inliningCost):
(JSC::DFG::ByteCodeParser::parseCodeBlock):
* dfg/DFGGraph.h:
(JSC::DFG::Graph::hasExitSite):
(JSC::DFG::Graph::activationRegister): Deleted.
(JSC::DFG::Graph::uncheckedActivationRegister): Deleted.
(JSC::DFG::Graph::machineActivationRegister): Deleted.
(JSC::DFG::Graph::uncheckedMachineActivationRegister): Deleted.
* dfg/DFGStackLayoutPhase.cpp:
(JSC::DFG::StackLayoutPhase::run):
* interpreter/CallFrame.cpp:
(JSC::CallFrame::callSiteIndex):
(JSC::CallFrame::stack):
(JSC::CallFrame::callerFrame):
(JSC::CallFrame::friendlyFunctionName):
(JSC::CallFrame::hasActivation): Deleted.
(JSC::CallFrame::uncheckedActivation): Deleted.
(JSC::CallFrame::lexicalEnvironment): Deleted.
(JSC::CallFrame::lexicalEnvironmentOrNullptr): Deleted.
(JSC::CallFrame::setActivation): Deleted.
* interpreter/CallFrame.h:
(JSC::ExecState::scope):
(JSC::ExecState::setCallerFrame):
(JSC::ExecState::setScope):
(JSC::ExecState::init):
* interpreter/Register.h:
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* runtime/Executable.h:
(JSC::ScriptExecutable::usesEval):
(JSC::ScriptExecutable::usesArguments):
(JSC::ScriptExecutable::isArrowFunctionContext):
(JSC::ScriptExecutable::isStrictMode):
(JSC::ScriptExecutable::derivedContextType):
(JSC::ScriptExecutable::needsActivation): Deleted.
* runtime/JSLexicalEnvironment.h:
(JSC::asActivation):
(JSC::Register::lexicalEnvironment): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@195862 268f45cc-cd09-0410-ab3c-d52691b4dbfc

18 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/bytecode/CodeBlock.cpp
Source/JavaScriptCore/bytecode/CodeBlock.h
Source/JavaScriptCore/bytecode/ExecutableInfo.h
Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.cpp
Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h
Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.cpp
Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h
Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
Source/JavaScriptCore/dfg/DFGGraph.h
Source/JavaScriptCore/dfg/DFGStackLayoutPhase.cpp
Source/JavaScriptCore/interpreter/CallFrame.cpp
Source/JavaScriptCore/interpreter/CallFrame.h
Source/JavaScriptCore/interpreter/Register.h
Source/JavaScriptCore/llint/LLIntSlowPaths.cpp
Source/JavaScriptCore/runtime/Executable.h
Source/JavaScriptCore/runtime/JSLexicalEnvironment.h

index e69eb0c..572e3a8 100644 (file)
@@ -1,3 +1,96 @@
+2016-01-29  Saam barati  <sbarati@apple.com>
+
+        Remove our notion of having a single activation register
+        https://bugs.webkit.org/show_bug.cgi?id=153673
+
+        Reviewed by Filip Pizlo.
+
+        We have many functions lurking around where we think a function 
+        might only have one activation register. This is clearly wrong
+        now that ES6 has block scoping. This patch removes this false notion.
+
+        * bytecode/CodeBlock.cpp:
+        (JSC::CodeBlock::dumpBytecode):
+        (JSC::CodeBlock::CodeBlock):
+        * bytecode/CodeBlock.h:
+        (JSC::CodeBlock::scopeRegister):
+        (JSC::CodeBlock::codeType):
+        (JSC::CodeBlock::setActivationRegister): Deleted.
+        (JSC::CodeBlock::activationRegister): Deleted.
+        (JSC::CodeBlock::uncheckedActivationRegister): Deleted.
+        (JSC::CodeBlock::needsActivation): Deleted.
+        * bytecode/ExecutableInfo.h:
+        (JSC::ExecutableInfo::ExecutableInfo):
+        (JSC::ExecutableInfo::usesEval):
+        (JSC::ExecutableInfo::isStrictMode):
+        (JSC::ExecutableInfo::isConstructor):
+        (JSC::ExecutableInfo::isClassContext):
+        (JSC::ExecutableInfo::needsActivation): Deleted.
+        * bytecode/UnlinkedCodeBlock.cpp:
+        (JSC::UnlinkedCodeBlock::UnlinkedCodeBlock):
+        * bytecode/UnlinkedCodeBlock.h:
+        (JSC::UnlinkedCodeBlock::isArrowFunctionContext):
+        (JSC::UnlinkedCodeBlock::isClassContext):
+        (JSC::UnlinkedCodeBlock::setThisRegister):
+        (JSC::UnlinkedCodeBlock::setScopeRegister):
+        (JSC::UnlinkedCodeBlock::usesGlobalObject):
+        (JSC::UnlinkedCodeBlock::setGlobalObjectRegister):
+        (JSC::UnlinkedCodeBlock::thisRegister):
+        (JSC::UnlinkedCodeBlock::scopeRegister):
+        (JSC::UnlinkedCodeBlock::addPropertyAccessInstruction):
+        (JSC::UnlinkedCodeBlock::needsFullScopeChain): Deleted.
+        (JSC::UnlinkedCodeBlock::setActivationRegister): Deleted.
+        (JSC::UnlinkedCodeBlock::activationRegister): Deleted.
+        (JSC::UnlinkedCodeBlock::hasActivationRegister): Deleted.
+        * bytecode/UnlinkedFunctionExecutable.cpp:
+        (JSC::generateUnlinkedFunctionCodeBlock):
+        * bytecompiler/BytecodeGenerator.cpp:
+        (JSC::BytecodeGenerator::BytecodeGenerator):
+        (JSC::BytecodeGenerator::initializeVarLexicalEnvironment):
+        * bytecompiler/BytecodeGenerator.h:
+        (JSC::BytecodeGenerator::destinationForAssignResult):
+        (JSC::BytecodeGenerator::leftHandSideNeedsCopy):
+        (JSC::BytecodeGenerator::emitNodeForLeftHandSide):
+        * dfg/DFGByteCodeParser.cpp:
+        (JSC::DFG::ByteCodeParser::inliningCost):
+        (JSC::DFG::ByteCodeParser::parseCodeBlock):
+        * dfg/DFGGraph.h:
+        (JSC::DFG::Graph::hasExitSite):
+        (JSC::DFG::Graph::activationRegister): Deleted.
+        (JSC::DFG::Graph::uncheckedActivationRegister): Deleted.
+        (JSC::DFG::Graph::machineActivationRegister): Deleted.
+        (JSC::DFG::Graph::uncheckedMachineActivationRegister): Deleted.
+        * dfg/DFGStackLayoutPhase.cpp:
+        (JSC::DFG::StackLayoutPhase::run):
+        * interpreter/CallFrame.cpp:
+        (JSC::CallFrame::callSiteIndex):
+        (JSC::CallFrame::stack):
+        (JSC::CallFrame::callerFrame):
+        (JSC::CallFrame::friendlyFunctionName):
+        (JSC::CallFrame::hasActivation): Deleted.
+        (JSC::CallFrame::uncheckedActivation): Deleted.
+        (JSC::CallFrame::lexicalEnvironment): Deleted.
+        (JSC::CallFrame::lexicalEnvironmentOrNullptr): Deleted.
+        (JSC::CallFrame::setActivation): Deleted.
+        * interpreter/CallFrame.h:
+        (JSC::ExecState::scope):
+        (JSC::ExecState::setCallerFrame):
+        (JSC::ExecState::setScope):
+        (JSC::ExecState::init):
+        * interpreter/Register.h:
+        * llint/LLIntSlowPaths.cpp:
+        (JSC::LLInt::LLINT_SLOW_PATH_DECL):
+        * runtime/Executable.h:
+        (JSC::ScriptExecutable::usesEval):
+        (JSC::ScriptExecutable::usesArguments):
+        (JSC::ScriptExecutable::isArrowFunctionContext):
+        (JSC::ScriptExecutable::isStrictMode):
+        (JSC::ScriptExecutable::derivedContextType):
+        (JSC::ScriptExecutable::needsActivation): Deleted.
+        * runtime/JSLexicalEnvironment.h:
+        (JSC::asActivation):
+        (JSC::Register::lexicalEnvironment): Deleted.
+
 2016-01-29  Filip Pizlo  <fpizlo@apple.com>
 
         Air:fixObviousSpills should handle floats and doubles
index 12d4ca9..d06c5c4 100644 (file)
@@ -586,8 +586,6 @@ void CodeBlock::dumpBytecode(PrintStream& out)
         static_cast<unsigned long>(instructions().size()),
         static_cast<unsigned long>(instructions().size() * sizeof(Instruction)),
         m_numParameters, m_numCalleeLocals, m_numVars);
-    if (needsActivation() && codeType() == FunctionCode)
-        out.printf("; lexical environment in r%d", activationRegister().offset());
     out.printf("\n");
     
     StubInfoMap stubInfos;
@@ -1750,7 +1748,6 @@ CodeBlock::CodeBlock(VM* vm, Structure* structure, CopyParsedBlockTag, CodeBlock
     , m_hasBeenCompiledWithFTL(false)
     , m_isConstructor(other.m_isConstructor)
     , m_isStrictMode(other.m_isStrictMode)
-    , m_needsActivation(other.m_needsActivation)
     , m_codeType(other.m_codeType)
     , m_unlinkedCode(*other.m_vm, this, other.m_unlinkedCode.get())
     , m_hasDebuggerStatement(false)
@@ -1761,7 +1758,6 @@ CodeBlock::CodeBlock(VM* vm, Structure* structure, CopyParsedBlockTag, CodeBlock
     , m_instructions(other.m_instructions)
     , m_thisRegister(other.m_thisRegister)
     , m_scopeRegister(other.m_scopeRegister)
-    , m_lexicalEnvironmentRegister(other.m_lexicalEnvironmentRegister)
     , m_hash(other.m_hash)
     , m_source(other.m_source)
     , m_sourceOffset(other.m_sourceOffset)
@@ -1817,7 +1813,6 @@ CodeBlock::CodeBlock(VM* vm, Structure* structure, ScriptExecutable* ownerExecut
     , m_hasBeenCompiledWithFTL(false)
     , m_isConstructor(unlinkedCodeBlock->isConstructor())
     , m_isStrictMode(unlinkedCodeBlock->isStrictMode())
-    , m_needsActivation(unlinkedCodeBlock->hasActivationRegister() && unlinkedCodeBlock->codeType() == FunctionCode)
     , m_codeType(unlinkedCodeBlock->codeType())
     , m_unlinkedCode(m_globalObject->vm(), this, unlinkedCodeBlock)
     , m_hasDebuggerStatement(false)
@@ -1827,7 +1822,6 @@ CodeBlock::CodeBlock(VM* vm, Structure* structure, ScriptExecutable* ownerExecut
     , m_vm(unlinkedCodeBlock->vm())
     , m_thisRegister(unlinkedCodeBlock->thisRegister())
     , m_scopeRegister(unlinkedCodeBlock->scopeRegister())
-    , m_lexicalEnvironmentRegister(unlinkedCodeBlock->activationRegister())
     , m_source(sourceProvider)
     , m_sourceOffset(sourceOffset)
     , m_firstLineColumnOffset(firstLineColumnOffset)
@@ -2334,7 +2328,6 @@ CodeBlock::CodeBlock(VM* vm, Structure* structure, WebAssemblyExecutable* ownerE
     , m_hasBeenCompiledWithFTL(false)
     , m_isConstructor(false)
     , m_isStrictMode(false)
-    , m_needsActivation(false)
     , m_codeType(FunctionCode)
     , m_hasDebuggerStatement(false)
     , m_steppingMode(SteppingModeDisabled)
index 627a7d4..56015fc 100644 (file)
@@ -351,28 +351,6 @@ public:
     {
         return m_scopeRegister;
     }
-
-    void setActivationRegister(VirtualRegister activationRegister)
-    {
-        m_lexicalEnvironmentRegister = activationRegister;
-    }
-
-    VirtualRegister activationRegister() const
-    {
-        ASSERT(m_lexicalEnvironmentRegister.isValid());
-        return m_lexicalEnvironmentRegister;
-    }
-
-    VirtualRegister uncheckedActivationRegister()
-    {
-        return m_lexicalEnvironmentRegister;
-    }
-
-    bool needsActivation() const
-    {
-        ASSERT(m_lexicalEnvironmentRegister.isValid() == m_needsActivation);
-        return m_needsActivation;
-    }
     
     CodeType codeType() const
     {
@@ -898,7 +876,6 @@ public:
     bool m_hasBeenCompiledWithFTL : 1;
     bool m_isConstructor : 1;
     bool m_isStrictMode : 1;
-    bool m_needsActivation : 1;
     unsigned m_codeType : 2; // CodeType
 
     // Internal methods for use by validation code. It would be private if it wasn't
@@ -1039,7 +1016,6 @@ private:
     RefCountedArray<Instruction> m_instructions;
     VirtualRegister m_thisRegister;
     VirtualRegister m_scopeRegister;
-    VirtualRegister m_lexicalEnvironmentRegister;
     mutable CodeBlockHash m_hash;
 
     RefPtr<SourceProvider> m_source;
index 07f4684..02bc0f4 100644 (file)
@@ -35,9 +35,8 @@ enum class DerivedContextType { None, DerivedConstructorContext, DerivedMethodCo
 // FIXME: These flags, ParserModes and propagation to XXXCodeBlocks should be reorganized.
 // https://bugs.webkit.org/show_bug.cgi?id=151547
 struct ExecutableInfo {
-    ExecutableInfo(bool needsActivation, bool usesEval, bool isStrictMode, bool isConstructor, bool isBuiltinFunction, ConstructorKind constructorKind, SuperBinding superBinding, SourceParseMode parseMode, DerivedContextType derivedContextType, bool isArrowFunctionContext, bool isClassContext)
-        : m_needsActivation(needsActivation)
-        , m_usesEval(usesEval)
+    ExecutableInfo(bool usesEval, bool isStrictMode, bool isConstructor, bool isBuiltinFunction, ConstructorKind constructorKind, SuperBinding superBinding, SourceParseMode parseMode, DerivedContextType derivedContextType, bool isArrowFunctionContext, bool isClassContext)
+        : m_usesEval(usesEval)
         , m_isStrictMode(isStrictMode)
         , m_isConstructor(isConstructor)
         , m_isBuiltinFunction(isBuiltinFunction)
@@ -52,7 +51,6 @@ struct ExecutableInfo {
         ASSERT(m_superBinding == static_cast<unsigned>(superBinding));
     }
 
-    bool needsActivation() const { return m_needsActivation; }
     bool usesEval() const { return m_usesEval; }
     bool isStrictMode() const { return m_isStrictMode; }
     bool isConstructor() const { return m_isConstructor; }
@@ -65,7 +63,6 @@ struct ExecutableInfo {
     bool isClassContext() const { return m_isClassContext; }
 
 private:
-    unsigned m_needsActivation : 1;
     unsigned m_usesEval : 1;
     unsigned m_isStrictMode : 1;
     unsigned m_isConstructor : 1;
index d560425..cc10f84 100644 (file)
@@ -58,7 +58,6 @@ UnlinkedCodeBlock::UnlinkedCodeBlock(VM* vm, Structure* structure, CodeType code
     , m_numParameters(0)
     , m_vm(vm)
     , m_globalObjectRegister(VirtualRegister())
-    , m_needsFullScopeChain(info.needsActivation())
     , m_usesEval(info.usesEval())
     , m_isStrictMode(info.isStrictMode())
     , m_isConstructor(info.isConstructor())
index 2b4eb64..f2404e3 100644 (file)
@@ -123,8 +123,6 @@ public:
     bool isArrowFunctionContext() const { return m_isArrowFunctionContext; }
     bool isClassContext() const { return m_isClassContext; }
 
-    bool needsFullScopeChain() const { return m_needsFullScopeChain; }
-
     void addExpressionInfo(unsigned instructionOffset, int divot,
         int startOffset, int endOffset, unsigned line, unsigned column);
 
@@ -135,7 +133,6 @@ public:
     // Special registers
     void setThisRegister(VirtualRegister thisRegister) { m_thisRegister = thisRegister; }
     void setScopeRegister(VirtualRegister scopeRegister) { m_scopeRegister = scopeRegister; }
-    void setActivationRegister(VirtualRegister activationRegister) { m_lexicalEnvironmentRegister = activationRegister; }
 
     bool usesGlobalObject() const { return m_globalObjectRegister.isValid(); }
     void setGlobalObjectRegister(VirtualRegister globalObjectRegister) { m_globalObjectRegister = globalObjectRegister; }
@@ -292,8 +289,6 @@ public:
 
     VirtualRegister thisRegister() const { return m_thisRegister; }
     VirtualRegister scopeRegister() const { return m_scopeRegister; }
-    VirtualRegister activationRegister() const { return m_lexicalEnvironmentRegister; }
-    bool hasActivationRegister() const { return m_lexicalEnvironmentRegister.isValid(); }
 
     void addPropertyAccessInstruction(unsigned propertyAccessInstruction)
     {
@@ -383,10 +378,8 @@ private:
 
     VirtualRegister m_thisRegister;
     VirtualRegister m_scopeRegister;
-    VirtualRegister m_lexicalEnvironmentRegister;
     VirtualRegister m_globalObjectRegister;
 
-    unsigned m_needsFullScopeChain : 1;
     unsigned m_usesEval : 1;
     unsigned m_isStrictMode : 1;
     unsigned m_isConstructor : 1;
index df304fa..c42b336 100644 (file)
@@ -69,7 +69,7 @@ static UnlinkedFunctionCodeBlock* generateUnlinkedFunctionCodeBlock(
     bool isClassContext = executable->superBinding() == SuperBinding::Needed;
 
     UnlinkedFunctionCodeBlock* result = UnlinkedFunctionCodeBlock::create(&vm, FunctionCode,
-        ExecutableInfo(function->needsActivation(), function->usesEval(), function->isStrictMode(), kind == CodeForConstruct, functionKind == UnlinkedBuiltinFunction, executable->constructorKind(), executable->superBinding(), parseMode, executable->derivedContextType(), false, isClassContext));
+        ExecutableInfo(function->usesEval(), function->isStrictMode(), kind == CodeForConstruct, functionKind == UnlinkedBuiltinFunction, executable->constructorKind(), executable->superBinding(), parseMode, executable->derivedContextType(), false, isClassContext));
 
     auto generator(std::make_unique<BytecodeGenerator>(vm, function.get(), result, debuggerMode, profilerMode, executable->parentScopeTDZVariables()));
     error = generator->generate();
index c91eafa..ae8b476 100644 (file)
@@ -240,7 +240,7 @@ BytecodeGenerator::BytecodeGenerator(VM& vm, FunctionNode* functionNode, Unlinke
     SourceParseMode parseMode = codeBlock->parseMode();
 
     bool containsArrowOrEvalButNotInArrowBlock = needsToUpdateArrowFunctionContext() && !m_codeBlock->isArrowFunction();
-    bool shouldCaptureSomeOfTheThings = m_shouldEmitDebugHooks || m_codeBlock->needsFullScopeChain() || containsArrowOrEvalButNotInArrowBlock;
+    bool shouldCaptureSomeOfTheThings = m_shouldEmitDebugHooks || functionNode->needsActivation() || containsArrowOrEvalButNotInArrowBlock;
 
     bool shouldCaptureAllOfTheThings = m_shouldEmitDebugHooks || codeBlock->usesEval();
     bool needsArguments = (functionNode->usesArguments() || codeBlock->usesEval() || (functionNode->usesArrowFunction() && !codeBlock->isArrowFunction()));
@@ -661,14 +661,11 @@ BytecodeGenerator::BytecodeGenerator(VM& vm, ModuleProgramNode* moduleProgramNod
     moduleEnvironmentSymbolTable->setUsesNonStrictEval(m_usesNonStrictEval);
     moduleEnvironmentSymbolTable->setScopeType(SymbolTable::ScopeType::LexicalScope);
 
-    bool shouldCaptureSomeOfTheThings = m_shouldEmitDebugHooks || m_codeBlock->needsFullScopeChain();
     bool shouldCaptureAllOfTheThings = m_shouldEmitDebugHooks || codeBlock->usesEval();
     if (shouldCaptureAllOfTheThings)
         moduleProgramNode->varDeclarations().markAllVariablesAsCaptured();
 
     auto captures = [&] (UniquedStringImpl* uid) -> bool {
-        if (!shouldCaptureSomeOfTheThings)
-            return false;
         return moduleProgramNode->captures(uid);
     };
     auto lookUpVarKind = [&] (UniquedStringImpl* uid, const VariableEnvironmentEntry& entry) -> VarKind {
@@ -962,7 +959,6 @@ void BytecodeGenerator::initializeParameters(FunctionParameters& parameters)
 void BytecodeGenerator::initializeVarLexicalEnvironment(int symbolTableConstantIndex)
 {
     RELEASE_ASSERT(m_lexicalEnvironmentRegister);
-    m_codeBlock->setActivationRegister(m_lexicalEnvironmentRegister->virtualRegister());
     emitOpcode(op_create_lexical_environment);
     instructions().append(m_lexicalEnvironmentRegister->index());
     instructions().append(scopeRegister()->index());
index 5e3845b..f2c7ac5 100644 (file)
@@ -354,7 +354,7 @@ namespace JSC {
 
         RegisterID* destinationForAssignResult(RegisterID* dst)
         {
-            if (dst && dst != ignoredResult() && m_codeBlock->needsFullScopeChain())
+            if (dst && dst != ignoredResult())
                 return dst->isTemporary() ? dst : newTemporary();
             return 0;
         }
@@ -465,7 +465,7 @@ namespace JSC {
 
         ALWAYS_INLINE bool leftHandSideNeedsCopy(bool rightHasAssignments, bool rightIsPure)
         {
-            return (m_codeType != FunctionCode || m_codeBlock->needsFullScopeChain() || rightHasAssignments) && !rightIsPure;
+            return (m_codeType != FunctionCode || rightHasAssignments) && !rightIsPure;
         }
 
         ALWAYS_INLINE PassRefPtr<RegisterID> emitNodeForLeftHandSide(ExpressionNode* n, bool rightHasAssignments, bool rightIsPure)
index 3644a2f..cdcd093 100644 (file)
@@ -1338,7 +1338,6 @@ unsigned ByteCodeParser::inliningCost(CallVariant callee, int argumentCountInclu
         dataLog("    Might inline function: ", mightInlineFunctionFor(codeBlock, kind), "\n");
         dataLog("    Might compile function: ", mightCompileFunctionFor(codeBlock, kind), "\n");
         dataLog("    Is supported for inlining: ", isSupportedForInlining(codeBlock), "\n");
-        dataLog("    Needs activation: ", codeBlock->ownerScriptExecutable()->needsActivation(), "\n");
         dataLog("    Is inlining candidate: ", codeBlock->ownerScriptExecutable()->isInliningCandidate(), "\n");
     }
     if (!canInline(capabilityLevel)) {
@@ -4909,7 +4908,6 @@ void ByteCodeParser::parseCodeBlock()
                 " ", inlineCallFrame()->directCaller);
         }
         dataLog(
-            ": needsActivation = ", codeBlock->needsActivation(),
             ", isStrictMode = ", codeBlock->ownerScriptExecutable()->isStrictMode(), "\n");
         codeBlock->baselineVersion()->dumpBytecode();
     }
index 09aae95..60d146b 100644 (file)
@@ -398,26 +398,6 @@ public:
         return hasExitSite(node->origin.semantic, exitKind);
     }
     
-    VirtualRegister activationRegister()
-    {
-        return m_profiledBlock->activationRegister();
-    }
-    
-    VirtualRegister uncheckedActivationRegister()
-    {
-        return m_profiledBlock->uncheckedActivationRegister();
-    }
-    
-    VirtualRegister machineActivationRegister()
-    {
-        return m_profiledBlock->activationRegister();
-    }
-    
-    VirtualRegister uncheckedMachineActivationRegister()
-    {
-        return m_profiledBlock->uncheckedActivationRegister();
-    }
-    
     ValueProfile* valueProfileFor(Node*);
     MethodOfGettingAValueProfile methodOfGettingAValueProfileFor(Node*);
     
index 526a0f5..09fe995 100644 (file)
@@ -173,8 +173,6 @@ public:
             data->machineLocal = assign(allocation, data->local);
         }
         
-        // This register is never valid for DFG code blocks.
-        codeBlock()->setActivationRegister(VirtualRegister());
         if (LIKELY(!m_graph.hasDebuggerEnabled()))
             codeBlock()->setScopeRegister(VirtualRegister());
         else
index 5be3604..e961796 100644 (file)
@@ -84,20 +84,6 @@ CallSiteIndex CallFrame::callSiteIndex() const
     return CallSiteIndex(callSiteAsRawBits());
 }
 
-bool CallFrame::hasActivation() const
-{
-    JSValue activation = uncheckedActivation();
-    return !!activation && activation.isCell();
-}
-
-JSValue CallFrame::uncheckedActivation() const
-{
-    CodeBlock* codeBlock = this->codeBlock();
-    RELEASE_ASSERT(codeBlock->needsActivation());
-    VirtualRegister activationRegister = codeBlock->activationRegister();
-    return registers()[activationRegister.offset()].jsValue();
-}
-
 #ifndef NDEBUG
 JSStack* CallFrame::stack()
 {
@@ -208,28 +194,6 @@ CallFrame* CallFrame::callerFrame(VMEntryFrame*& currVMEntryFrame)
     return static_cast<CallFrame*>(callerFrameOrVMEntryFrame());
 }
 
-JSLexicalEnvironment* CallFrame::lexicalEnvironment() const
-{
-    CodeBlock* codeBlock = this->codeBlock();
-    RELEASE_ASSERT(codeBlock->needsActivation());
-    VirtualRegister activationRegister = codeBlock->activationRegister();
-    return registers()[activationRegister.offset()].Register::lexicalEnvironment();
-}
-
-JSLexicalEnvironment* CallFrame::lexicalEnvironmentOrNullptr() const
-{
-    CodeBlock* codeBlock = this->codeBlock();
-    return codeBlock->needsActivation() ? lexicalEnvironment() : nullptr;
-}
-    
-void CallFrame::setActivation(JSLexicalEnvironment* lexicalEnvironment)
-{
-    CodeBlock* codeBlock = this->codeBlock();
-    RELEASE_ASSERT(codeBlock->needsActivation());
-    VirtualRegister activationRegister = codeBlock->activationRegister();
-    registers()[activationRegister.offset()] = lexicalEnvironment;
-}
-
 String CallFrame::friendlyFunctionName()
 {
     CodeBlock* codeBlock = this->codeBlock();
index 1920c44..520e86d 100644 (file)
@@ -34,7 +34,6 @@
 namespace JSC  {
 
     class Arguments;
-    class JSLexicalEnvironment;
     class Interpreter;
     class JSScope;
 
@@ -75,11 +74,6 @@ namespace JSC  {
             return this[scopeRegisterOffset].Register::scope();
         }
 
-        bool hasActivation() const;
-        JSLexicalEnvironment* lexicalEnvironment() const;
-        JSLexicalEnvironment* lexicalEnvironmentOrNullptr() const;
-        JSValue uncheckedActivation() const;
-
         // Global object in which execution began.
         JS_EXPORT_PRIVATE JSGlobalObject* vmEntryGlobalObject();
 
@@ -164,7 +158,6 @@ namespace JSC  {
 
         void setCallerFrame(CallFrame* frame) { callerFrameAndPC().callerFrame = frame; }
         void setScope(int scopeRegisterOffset, JSScope* scope) { static_cast<Register*>(this)[scopeRegisterOffset] = scope; }
-        void setActivation(JSLexicalEnvironment*);
 
         ALWAYS_INLINE void init(CodeBlock* codeBlock, Instruction* vPC,
             CallFrame* callerFrame, int argc, JSObject* callee) 
index 71ead7d..a7ec563 100644 (file)
@@ -60,7 +60,6 @@ namespace JSC {
         Register& operator=(JSObject*);
 
         int32_t i() const;
-        JSLexicalEnvironment* lexicalEnvironment() const;
         CallFrame* callFrame() const;
         CodeBlock* codeBlock() const;
         JSObject* object() const;
index 0b5623d..7886dd2 100644 (file)
@@ -1031,7 +1031,6 @@ LLINT_SLOW_PATH_DECL(slow_path_new_func)
 {
     LLINT_BEGIN();
     CodeBlock* codeBlock = exec->codeBlock();
-    ASSERT(codeBlock->codeType() != FunctionCode || !codeBlock->needsActivation() || exec->hasActivation());
     JSScope* scope = exec->uncheckedR(pc[2].u.operand).Register::scope();
 #if LLINT_SLOW_PATH_TRACING
     dataLogF("Creating function!\n");
@@ -1043,7 +1042,6 @@ LLINT_SLOW_PATH_DECL(slow_path_new_generator_func)
 {
     LLINT_BEGIN();
     CodeBlock* codeBlock = exec->codeBlock();
-    ASSERT(codeBlock->codeType() != FunctionCode || !codeBlock->needsActivation() || exec->hasActivation());
     JSScope* scope = exec->uncheckedR(pc[2].u.operand).Register::scope();
 #if LLINT_SLOW_PATH_TRACING
     dataLogF("Creating function!\n");
index 7f908d5..3021a7b 100644 (file)
@@ -348,7 +348,6 @@ public:
 
     bool usesEval() const { return m_features & EvalFeature; }
     bool usesArguments() const { return m_features & ArgumentsFeature; }
-    bool needsActivation() const { return m_hasCapturedVariables || m_features & (EvalFeature | WithFeature); }
     bool isArrowFunctionContext() const { return m_isArrowFunctionContext; }
     bool isStrictMode() const { return m_features & StrictModeFeature; }
     DerivedContextType derivedContextType() const { return m_derivedContextType; }
@@ -458,7 +457,7 @@ public:
         
     DECLARE_INFO;
 
-    ExecutableInfo executableInfo() const { return ExecutableInfo(needsActivation(), usesEval(), isStrictMode(), false, false, ConstructorKind::None, SuperBinding::NotNeeded, SourceParseMode::ProgramMode, derivedContextType(), isArrowFunctionContext() , false); }
+    ExecutableInfo executableInfo() const { return ExecutableInfo(usesEval(), isStrictMode(), false, false, ConstructorKind::None, SuperBinding::NotNeeded, SourceParseMode::ProgramMode, derivedContextType(), isArrowFunctionContext() , false); }
 
     unsigned numVariables() { return m_unlinkedEvalCodeBlock->numVariables(); }
     unsigned numberOfFunctionDecls() { return m_unlinkedEvalCodeBlock->numberOfFunctionDecls(); }
@@ -512,7 +511,7 @@ public:
         
     DECLARE_INFO;
 
-    ExecutableInfo executableInfo() const { return ExecutableInfo(needsActivation(), usesEval(), isStrictMode(), false, false, ConstructorKind::None, SuperBinding::NotNeeded, SourceParseMode::ProgramMode, derivedContextType(), isArrowFunctionContext(), false); }
+    ExecutableInfo executableInfo() const { return ExecutableInfo(usesEval(), isStrictMode(), false, false, ConstructorKind::None, SuperBinding::NotNeeded, SourceParseMode::ProgramMode, derivedContextType(), isArrowFunctionContext(), false); }
 
 private:
     friend class ExecutableBase;
@@ -553,7 +552,7 @@ public:
 
     DECLARE_INFO;
 
-    ExecutableInfo executableInfo() const { return ExecutableInfo(needsActivation(), usesEval(), isStrictMode(), false, false, ConstructorKind::None, SuperBinding::NotNeeded, SourceParseMode::ModuleEvaluateMode, derivedContextType(), isArrowFunctionContext(), false); }
+    ExecutableInfo executableInfo() const { return ExecutableInfo(usesEval(), isStrictMode(), false, false, ConstructorKind::None, SuperBinding::NotNeeded, SourceParseMode::ModuleEvaluateMode, derivedContextType(), isArrowFunctionContext(), false); }
 
     UnlinkedModuleProgramCodeBlock* unlinkedModuleProgramCodeBlock() { return m_unlinkedModuleProgramCodeBlock.get(); }
 
index 99c3533..c40ae87 100644 (file)
@@ -89,11 +89,6 @@ inline JSLexicalEnvironment* asActivation(JSValue value)
     return jsCast<JSLexicalEnvironment*>(asObject(value));
 }
     
-ALWAYS_INLINE JSLexicalEnvironment* Register::lexicalEnvironment() const
-{
-    return asActivation(jsValue());
-}
-
 } // namespace JSC
 
 #endif // JSLexicalEnvironment_h