Ignore:
Timestamp:
Aug 24, 2009, 7:53:51 PM (16 years ago)
Author:
[email protected]
Message:

https://bugs.webkit.org/show_bug.cgi?id=28691
Do not retain ScopeNodes outside of parsing

Reviewed by Oliver Adler & Darin Hunt.

There is now no need for these to exist outside of parsing - their use in the runtime is replaced by Executable types.

  • bytecode/EvalCodeCache.h:

(JSC::EvalCodeCache::get):

  • bytecompiler/BytecodeGenerator.cpp:

(JSC::BytecodeGenerator::BytecodeGenerator):
(JSC::BytecodeGenerator::emitNewFunction):
(JSC::BytecodeGenerator::emitNewFunctionExpression):

  • bytecompiler/BytecodeGenerator.h:

(JSC::BytecodeGenerator::makeFunction):

  • debugger/Debugger.cpp:

(JSC::Debugger::recompileAllJSFunctions):
(JSC::evaluateInGlobalCallFrame):

  • debugger/DebuggerCallFrame.cpp:

(JSC::DebuggerCallFrame::evaluate):

  • interpreter/Interpreter.cpp:

(JSC::Interpreter::execute):
(JSC::Interpreter::prepareForRepeatCall):
(JSC::Interpreter::privateExecute):

  • jit/JITStubs.cpp:

(JSC::DEFINE_STUB_FUNCTION):

  • parser/Nodes.cpp:

(JSC::ScopeNodeData::ScopeNodeData):
(JSC::ProgramNode::create):
(JSC::EvalNode::create):
(JSC::FunctionBodyNode::create):

  • parser/Nodes.h:

(JSC::ScopeNode::adoptData):
(JSC::FunctionBodyNode::parameterCount):

  • parser/Parser.cpp:
  • parser/Parser.h:

(JSC::Parser::arena):
(JSC::Parser::Parser):
(JSC::Parser::parse):

  • runtime/ArrayPrototype.cpp:

(JSC::isNumericCompareFunction):
(JSC::arrayProtoFuncSort):

  • runtime/Completion.cpp:

(JSC::checkSyntax):
(JSC::evaluate):

  • runtime/Executable.cpp:

(JSC::FunctionExecutable::~FunctionExecutable):
(JSC::EvalExecutable::compile):
(JSC::ProgramExecutable::checkSyntax):
(JSC::ProgramExecutable::compile):
(JSC::FunctionExecutable::compile):
(JSC::EvalExecutable::generateJITCode):
(JSC::ProgramExecutable::generateJITCode):
(JSC::FunctionExecutable::generateJITCode):
(JSC::FunctionExecutable::reparseExceptionInfo):
(JSC::EvalExecutable::reparseExceptionInfo):
(JSC::FunctionExecutable::recompile):
(JSC::FunctionExecutable::fromGlobalCode):
(JSC::FunctionExecutable::copyParameters):
(JSC::FunctionExecutable::paramString):

  • runtime/Executable.h:

(JSC::ScriptExecutable::ScriptExecutable):
(JSC::ScriptExecutable::sourceID):
(JSC::ScriptExecutable::sourceURL):
(JSC::ScriptExecutable::lineNo):
(JSC::ScriptExecutable::lastLine):
(JSC::ScriptExecutable::usesEval):
(JSC::ScriptExecutable::usesArguments):
(JSC::ScriptExecutable::needsActivation):
(JSC::ScriptExecutable::recordParse):
(JSC::EvalExecutable::bytecode):
(JSC::EvalExecutable::jitCode):
(JSC::ProgramExecutable::bytecode):
(JSC::ProgramExecutable::reparseExceptionInfo):
(JSC::ProgramExecutable::jitCode):
(JSC::FunctionExecutable::FunctionExecutable):
(JSC::FunctionExecutable::make):
(JSC::FunctionExecutable::bytecode):
(JSC::FunctionExecutable::isGenerated):
(JSC::FunctionExecutable::name):
(JSC::FunctionExecutable::parameterCount):
(JSC::FunctionExecutable::jitCode):

  • runtime/FunctionConstructor.cpp:

(JSC::constructFunction):

  • runtime/JSGlobalData.cpp:

(JSC::JSGlobalData::numericCompareFunction):

  • runtime/JSGlobalObjectFunctions.cpp:

(JSC::globalFuncEval):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/interpreter/Interpreter.cpp

    r47641 r47738  
    621621    }
    622622
    623     CodeBlock* codeBlock = &program->bytecode(scopeChain);
     623    CodeBlock* codeBlock = &program->bytecode(callFrame, scopeChain);
    624624
    625625    Register* oldEnd = m_registerFile.end();
     
    653653        m_reentryDepth++;
    654654#if ENABLE(JIT)
    655         result = program->jitCode(scopeChain).execute(&m_registerFile, newCallFrame, scopeChain->globalData, exception);
     655        result = program->jitCode(newCallFrame, scopeChain).execute(&m_registerFile, newCallFrame, scopeChain->globalData, exception);
    656656#else
    657657        result = privateExecute(Normal, &m_registerFile, newCallFrame, exception);
     
    699699        newCallFrame->r(++dst) = *it;
    700700
    701     CodeBlock* codeBlock = &functionExecutable->bytecode(scopeChain);
     701    CodeBlock* codeBlock = &functionExecutable->bytecode(callFrame, scopeChain);
    702702    newCallFrame = slideRegisterWindowForCall(codeBlock, &m_registerFile, newCallFrame, argc + RegisterFile::CallFrameHeaderSize, argc);
    703703    if (UNLIKELY(!newCallFrame)) {
     
    719719        m_reentryDepth++;
    720720#if ENABLE(JIT)
    721         result = functionExecutable->jitCode(scopeChain).execute(&m_registerFile, newCallFrame, scopeChain->globalData, exception);
     721        result = functionExecutable->jitCode(newCallFrame, scopeChain).execute(&m_registerFile, newCallFrame, scopeChain->globalData, exception);
    722722#else
    723723        result = privateExecute(Normal, &m_registerFile, newCallFrame, exception);
     
    757757        newCallFrame->r(++dst) = jsUndefined();
    758758   
    759     CodeBlock* codeBlock = &FunctionExecutable->bytecode(scopeChain);
     759    CodeBlock* codeBlock = &FunctionExecutable->bytecode(callFrame, scopeChain);
    760760    newCallFrame = slideRegisterWindowForCall(codeBlock, &m_registerFile, newCallFrame, argc + RegisterFile::CallFrameHeaderSize, argc);
    761761    if (UNLIKELY(!newCallFrame)) {
     
    767767    newCallFrame->init(codeBlock, 0, scopeChain, callFrame->addHostCallFrameFlag(), 0, argc, function);
    768768#if ENABLE(JIT)
    769     FunctionExecutable->jitCode(scopeChain);
     769    FunctionExecutable->jitCode(newCallFrame, scopeChain);
    770770#endif
    771771
     
    806806JSValue Interpreter::execute(EvalExecutable* eval, CallFrame* callFrame, JSObject* thisObj, ScopeChainNode* scopeChain, JSValue* exception)
    807807{
    808     return execute(eval, callFrame, thisObj, m_registerFile.size() + eval->bytecode(scopeChain).m_numParameters + RegisterFile::CallFrameHeaderSize, scopeChain, exception);
     808    return execute(eval, callFrame, thisObj, m_registerFile.size() + eval->bytecode(callFrame, scopeChain).m_numParameters + RegisterFile::CallFrameHeaderSize, scopeChain, exception);
    809809}
    810810
     
    822822    DynamicGlobalObjectScope globalObjectScope(callFrame, callFrame->globalData().dynamicGlobalObject ? callFrame->globalData().dynamicGlobalObject : scopeChain->globalObject());
    823823
    824     EvalCodeBlock* codeBlock = &eval->bytecode(scopeChain);
     824    EvalCodeBlock* codeBlock = &eval->bytecode(callFrame, scopeChain);
    825825
    826826    JSVariableObject* variableObject;
     
    881881        m_reentryDepth++;
    882882#if ENABLE(JIT)
    883         result = eval->jitCode(scopeChain).execute(&m_registerFile, newCallFrame, scopeChain->globalData, exception);
     883        result = eval->jitCode(newCallFrame, scopeChain).execute(&m_registerFile, newCallFrame, scopeChain->globalData, exception);
    884884#else
    885885        result = privateExecute(Normal, &m_registerFile, newCallFrame, exception);
     
    30173017        if (callType == CallTypeJS) {
    30183018            ScopeChainNode* callDataScopeChain = callData.js.scopeChain;
    3019             CodeBlock* newCodeBlock = &callData.js.functionExecutable->bytecode(callDataScopeChain);
     3019            CodeBlock* newCodeBlock = &callData.js.functionExecutable->bytecode(callFrame, callDataScopeChain);
    30203020
    30213021            CallFrame* previousCallFrame = callFrame;
     
    31713171        if (callType == CallTypeJS) {
    31723172            ScopeChainNode* callDataScopeChain = callData.js.scopeChain;
    3173             CodeBlock* newCodeBlock = &callData.js.functionExecutable->bytecode(callDataScopeChain);
     3173            CodeBlock* newCodeBlock = &callData.js.functionExecutable->bytecode(callFrame, callDataScopeChain);
    31743174           
    31753175            CallFrame* previousCallFrame = callFrame;
     
    34193419        if (constructType == ConstructTypeJS) {
    34203420            ScopeChainNode* callDataScopeChain = constructData.js.scopeChain;
    3421             CodeBlock* newCodeBlock = &constructData.js.functionExecutable->bytecode(callDataScopeChain);
     3421            CodeBlock* newCodeBlock = &constructData.js.functionExecutable->bytecode(callFrame, callDataScopeChain);
    34223422
    34233423            Structure* structure;
Note: See TracChangeset for help on using the changeset viewer.