Ignore:
Timestamp:
Jan 29, 2016, 4:01:48 PM (9 years ago)
Author:
[email protected]
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/Executable.h

    r195000 r195862  
    349349    bool usesEval() const { return m_features & EvalFeature; }
    350350    bool usesArguments() const { return m_features & ArgumentsFeature; }
    351     bool needsActivation() const { return m_hasCapturedVariables || m_features & (EvalFeature | WithFeature); }
    352351    bool isArrowFunctionContext() const { return m_isArrowFunctionContext; }
    353352    bool isStrictMode() const { return m_features & StrictModeFeature; }
     
    459458    DECLARE_INFO;
    460459
    461     ExecutableInfo executableInfo() const { return ExecutableInfo(needsActivation(), usesEval(), isStrictMode(), false, false, ConstructorKind::None, SuperBinding::NotNeeded, SourceParseMode::ProgramMode, derivedContextType(), isArrowFunctionContext() , false); }
     460    ExecutableInfo executableInfo() const { return ExecutableInfo(usesEval(), isStrictMode(), false, false, ConstructorKind::None, SuperBinding::NotNeeded, SourceParseMode::ProgramMode, derivedContextType(), isArrowFunctionContext() , false); }
    462461
    463462    unsigned numVariables() { return m_unlinkedEvalCodeBlock->numVariables(); }
     
    513512    DECLARE_INFO;
    514513
    515     ExecutableInfo executableInfo() const { return ExecutableInfo(needsActivation(), usesEval(), isStrictMode(), false, false, ConstructorKind::None, SuperBinding::NotNeeded, SourceParseMode::ProgramMode, derivedContextType(), isArrowFunctionContext(), false); }
     514    ExecutableInfo executableInfo() const { return ExecutableInfo(usesEval(), isStrictMode(), false, false, ConstructorKind::None, SuperBinding::NotNeeded, SourceParseMode::ProgramMode, derivedContextType(), isArrowFunctionContext(), false); }
    516515
    517516private:
     
    554553    DECLARE_INFO;
    555554
    556     ExecutableInfo executableInfo() const { return ExecutableInfo(needsActivation(), usesEval(), isStrictMode(), false, false, ConstructorKind::None, SuperBinding::NotNeeded, SourceParseMode::ModuleEvaluateMode, derivedContextType(), isArrowFunctionContext(), false); }
     555    ExecutableInfo executableInfo() const { return ExecutableInfo(usesEval(), isStrictMode(), false, false, ConstructorKind::None, SuperBinding::NotNeeded, SourceParseMode::ModuleEvaluateMode, derivedContextType(), isArrowFunctionContext(), false); }
    557556
    558557    UnlinkedModuleProgramCodeBlock* unlinkedModuleProgramCodeBlock() { return m_unlinkedModuleProgramCodeBlock.get(); }
Note: See TracChangeset for help on using the changeset viewer.