Changeset 47412 in webkit for trunk/JavaScriptCore/interpreter/Interpreter.cpp
- Timestamp:
- Aug 17, 2009, 10:34:52 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/interpreter/Interpreter.cpp
r47405 r47412 490 490 DebuggerCallFrame debuggerCallFrame(callFrame, exceptionValue); 491 491 if (callFrame->callee()) 492 debugger->returnEvent(debuggerCallFrame, codeBlock->owner Node()->sourceID(), codeBlock->ownerNode()->lastLine());492 debugger->returnEvent(debuggerCallFrame, codeBlock->ownerExecutable()->sourceID(), codeBlock->ownerExecutable()->lastLine()); 493 493 else 494 debugger->didExecuteProgram(debuggerCallFrame, codeBlock->owner Node()->sourceID(), codeBlock->ownerNode()->lastLine());494 debugger->didExecuteProgram(debuggerCallFrame, codeBlock->ownerExecutable()->sourceID(), codeBlock->ownerExecutable()->lastLine()); 495 495 } 496 496 … … 499 499 profiler->didExecute(callFrame, callFrame->callee()); 500 500 else 501 profiler->didExecute(callFrame, codeBlock->owner Node()->sourceURL(), codeBlock->ownerNode()->lineNo());501 profiler->didExecute(callFrame, codeBlock->ownerExecutable()->sourceURL(), codeBlock->ownerExecutable()->lineNo()); 502 502 } 503 503 … … 555 555 } else 556 556 exception->putWithAttributes(callFrame, Identifier(callFrame, "line"), jsNumber(callFrame, codeBlock->lineNumberForBytecodeOffset(callFrame, bytecodeOffset)), ReadOnly | DontDelete); 557 exception->putWithAttributes(callFrame, Identifier(callFrame, "sourceId"), jsNumber(callFrame, codeBlock->owner Node()->sourceID()), ReadOnly | DontDelete);558 exception->putWithAttributes(callFrame, Identifier(callFrame, "sourceURL"), jsOwnedString(callFrame, codeBlock->owner Node()->sourceURL()), ReadOnly | DontDelete);557 exception->putWithAttributes(callFrame, Identifier(callFrame, "sourceId"), jsNumber(callFrame, codeBlock->ownerExecutable()->sourceID()), ReadOnly | DontDelete); 558 exception->putWithAttributes(callFrame, Identifier(callFrame, "sourceURL"), jsOwnedString(callFrame, codeBlock->ownerExecutable()->sourceURL()), ReadOnly | DontDelete); 559 559 } 560 560 … … 570 570 if (Debugger* debugger = callFrame->dynamicGlobalObject()->debugger()) { 571 571 DebuggerCallFrame debuggerCallFrame(callFrame, exceptionValue); 572 debugger->exception(debuggerCallFrame, codeBlock->owner Node()->sourceID(), codeBlock->lineNumberForBytecodeOffset(callFrame, bytecodeOffset));572 debugger->exception(debuggerCallFrame, codeBlock->ownerExecutable()->sourceID(), codeBlock->lineNumberForBytecodeOffset(callFrame, bytecodeOffset)); 573 573 } 574 574 … … 671 671 } 672 672 673 JSValue Interpreter::execute(Function BodyNode* functionBodyNode, CallFrame* callFrame, JSFunction* function, JSObject* thisObj, const ArgList& args, ScopeChainNode* scopeChain, JSValue* exception)673 JSValue Interpreter::execute(FunctionExecutable* functionExecutable, CallFrame* callFrame, JSFunction* function, JSObject* thisObj, const ArgList& args, ScopeChainNode* scopeChain, JSValue* exception) 674 674 { 675 675 ASSERT(!scopeChain->globalData->exception); … … 699 699 newCallFrame->r(++dst) = *it; 700 700 701 CodeBlock* codeBlock = &function BodyNode->bytecode(scopeChain);701 CodeBlock* codeBlock = &functionExecutable->bytecode(scopeChain); 702 702 newCallFrame = slideRegisterWindowForCall(codeBlock, &m_registerFile, newCallFrame, argc + RegisterFile::CallFrameHeaderSize, argc); 703 703 if (UNLIKELY(!newCallFrame)) { … … 719 719 m_reentryDepth++; 720 720 #if ENABLE(JIT) 721 result = function BodyNode->jitCode(scopeChain).execute(&m_registerFile, newCallFrame, scopeChain->globalData, exception);721 result = functionExecutable->jitCode(scopeChain).execute(&m_registerFile, newCallFrame, scopeChain->globalData, exception); 722 722 #else 723 723 result = privateExecute(Normal, &m_registerFile, newCallFrame, exception); … … 733 733 } 734 734 735 CallFrameClosure Interpreter::prepareForRepeatCall(Function BodyNode* functionBodyNode, CallFrame* callFrame, JSFunction* function, int argCount, ScopeChainNode* scopeChain, JSValue* exception)735 CallFrameClosure Interpreter::prepareForRepeatCall(FunctionExecutable* FunctionExecutable, CallFrame* callFrame, JSFunction* function, int argCount, ScopeChainNode* scopeChain, JSValue* exception) 736 736 { 737 737 ASSERT(!scopeChain->globalData->exception); … … 757 757 newCallFrame->r(++dst) = jsUndefined(); 758 758 759 CodeBlock* codeBlock = & functionBodyNode->bytecode(scopeChain);759 CodeBlock* codeBlock = &FunctionExecutable->bytecode(scopeChain); 760 760 newCallFrame = slideRegisterWindowForCall(codeBlock, &m_registerFile, newCallFrame, argc + RegisterFile::CallFrameHeaderSize, argc); 761 761 if (UNLIKELY(!newCallFrame)) { … … 767 767 newCallFrame->init(codeBlock, 0, scopeChain, callFrame->addHostCallFrameFlag(), 0, argc, function); 768 768 #if ENABLE(JIT) 769 functionBodyNode->jitCode(scopeChain);769 FunctionExecutable->jitCode(scopeChain); 770 770 #endif 771 771 772 CallFrameClosure result = { callFrame, newCallFrame, function, functionBodyNode, scopeChain->globalData, oldEnd, scopeChain, codeBlock->m_numParameters, argc };772 CallFrameClosure result = { callFrame, newCallFrame, function, FunctionExecutable, scopeChain->globalData, oldEnd, scopeChain, codeBlock->m_numParameters, argc }; 773 773 return result; 774 774 } … … 787 787 m_reentryDepth++; 788 788 #if ENABLE(JIT) 789 result = closure.function Body->generatedJITCode().execute(&m_registerFile, closure.newCallFrame, closure.globalData, exception);789 result = closure.functionExecutable->generatedJITCode().execute(&m_registerFile, closure.newCallFrame, closure.globalData, exception); 790 790 #else 791 791 result = privateExecute(Normal, &m_registerFile, closure.newCallFrame, exception); … … 837 837 BatchedTransitionOptimizer optimizer(variableObject); 838 838 839 const DeclarationStacks::VarStack& varStack = codeBlock->ownerNode()->varStack();839 const DeclarationStacks::VarStack& varStack = static_cast<EvalExecutable*>(codeBlock->ownerExecutable())->varStack(); 840 840 DeclarationStacks::VarStack::const_iterator varStackEnd = varStack.end(); 841 841 for (DeclarationStacks::VarStack::const_iterator it = varStack.begin(); it != varStackEnd; ++it) { … … 847 847 } 848 848 849 const DeclarationStacks::FunctionStack& functionStack = codeBlock->ownerNode()->functionStack();850 DeclarationStacks::FunctionStack::const_iterator functionStackEnd = functionStack.end();851 for (DeclarationStacks::FunctionStack::const_iterator it = functionStack.begin(); it != functionStackEnd; ++it) {849 int numFunctions = codeBlock->numberOfFunctionDecls(); 850 for (int i = 0; i < numFunctions; ++i) { 851 FunctionExecutable* function = codeBlock->functionDecl(i); 852 852 PutPropertySlot slot; 853 variableObject->put(callFrame, (*it)->ident(), (*it)->make(callFrame, scopeChain), slot);853 variableObject->put(callFrame, function->name(), function->make(callFrame, scopeChain), slot); 854 854 } 855 855 … … 904 904 switch (debugHookID) { 905 905 case DidEnterCallFrame: 906 debugger->callEvent(callFrame, callFrame->codeBlock()->owner Node()->sourceID(), firstLine);906 debugger->callEvent(callFrame, callFrame->codeBlock()->ownerExecutable()->sourceID(), firstLine); 907 907 return; 908 908 case WillLeaveCallFrame: 909 debugger->returnEvent(callFrame, callFrame->codeBlock()->owner Node()->sourceID(), lastLine);909 debugger->returnEvent(callFrame, callFrame->codeBlock()->ownerExecutable()->sourceID(), lastLine); 910 910 return; 911 911 case WillExecuteStatement: 912 debugger->atStatement(callFrame, callFrame->codeBlock()->owner Node()->sourceID(), firstLine);912 debugger->atStatement(callFrame, callFrame->codeBlock()->ownerExecutable()->sourceID(), firstLine); 913 913 return; 914 914 case WillExecuteProgram: 915 debugger->willExecuteProgram(callFrame, callFrame->codeBlock()->owner Node()->sourceID(), firstLine);915 debugger->willExecuteProgram(callFrame, callFrame->codeBlock()->ownerExecutable()->sourceID(), firstLine); 916 916 return; 917 917 case DidExecuteProgram: 918 debugger->didExecuteProgram(callFrame, callFrame->codeBlock()->owner Node()->sourceID(), lastLine);918 debugger->didExecuteProgram(callFrame, callFrame->codeBlock()->ownerExecutable()->sourceID(), lastLine); 919 919 return; 920 920 case DidReachBreakpoint: 921 debugger->didReachBreakpoint(callFrame, callFrame->codeBlock()->owner Node()->sourceID(), lastLine);921 debugger->didReachBreakpoint(callFrame, callFrame->codeBlock()->ownerExecutable()->sourceID(), lastLine); 922 922 return; 923 923 } … … 2921 2921 int func = (++vPC)->u.operand; 2922 2922 2923 callFrame->r(dst) = JSValue(callFrame->codeBlock()->function (func)->make(callFrame, callFrame->scopeChain()));2923 callFrame->r(dst) = JSValue(callFrame->codeBlock()->functionDecl(func)->make(callFrame, callFrame->scopeChain())); 2924 2924 2925 2925 ++vPC; … … 2937 2937 int funcIndex = (++vPC)->u.operand; 2938 2938 2939 Function BodyNode* body = callFrame->codeBlock()->function(funcIndex);2940 JSFunction* func = body->make(callFrame, callFrame->scopeChain());2939 FunctionExecutable* function = callFrame->codeBlock()->functionExpr(funcIndex); 2940 JSFunction* func = function->make(callFrame, callFrame->scopeChain()); 2941 2941 2942 2942 /* … … 2947 2947 does not affect the scope enclosing the FunctionExpression. 2948 2948 */ 2949 if (! body->ident().isNull()) {2950 JSStaticScopeObject* functionScopeObject = new (callFrame) JSStaticScopeObject(callFrame, body->ident(), func, ReadOnly | DontDelete);2949 if (!function->name().isNull()) { 2950 JSStaticScopeObject* functionScopeObject = new (callFrame) JSStaticScopeObject(callFrame, function->name(), func, ReadOnly | DontDelete); 2951 2951 func->scope().push(functionScopeObject); 2952 2952 } … … 3018 3018 if (callType == CallTypeJS) { 3019 3019 ScopeChainNode* callDataScopeChain = callData.js.scopeChain; 3020 FunctionBodyNode* functionBodyNode = callData.js.functionBody; 3021 CodeBlock* newCodeBlock = &functionBodyNode->bytecode(callDataScopeChain); 3020 CodeBlock* newCodeBlock = &callData.js.functionExecutable->bytecode(callDataScopeChain); 3022 3021 3023 3022 CallFrame* previousCallFrame = callFrame; … … 3085 3084 goto vm_throw; 3086 3085 } 3087 int32_t expectedParams = callFrame->callee()-> body()->parameterCount();3086 int32_t expectedParams = callFrame->callee()->executable()->parameterCount(); 3088 3087 int32_t inplaceArgs = min(argCount, expectedParams); 3089 3088 int32_t i = 0; … … 3172 3171 if (callType == CallTypeJS) { 3173 3172 ScopeChainNode* callDataScopeChain = callData.js.scopeChain; 3174 FunctionBodyNode* functionBodyNode = callData.js.functionBody; 3175 CodeBlock* newCodeBlock = &functionBodyNode->bytecode(callDataScopeChain); 3173 CodeBlock* newCodeBlock = &callData.js.functionExecutable->bytecode(callDataScopeChain); 3176 3174 3177 3175 CallFrame* previousCallFrame = callFrame; … … 3335 3333 3336 3334 int dst = (++vPC)->u.operand; 3337 JSActivation* activation = new (globalData) JSActivation(callFrame, static_cast<Function BodyNode*>(codeBlock->ownerNode()));3335 JSActivation* activation = new (globalData) JSActivation(callFrame, static_cast<FunctionExecutable*>(codeBlock->ownerExecutable())); 3338 3336 callFrame->r(dst) = JSValue(activation); 3339 3337 callFrame->setScopeChain(callFrame->scopeChain()->copy()->push(activation)); … … 3421 3419 if (constructType == ConstructTypeJS) { 3422 3420 ScopeChainNode* callDataScopeChain = constructData.js.scopeChain; 3423 FunctionBodyNode* functionBodyNode = constructData.js.functionBody; 3424 CodeBlock* newCodeBlock = &functionBodyNode->bytecode(callDataScopeChain); 3421 CodeBlock* newCodeBlock = &constructData.js.functionExecutable->bytecode(callDataScopeChain); 3425 3422 3426 3423 Structure* structure; … … 3672 3669 3673 3670 CodeBlock* codeBlock = callFrame->codeBlock(); 3674 callFrame->r(dst) = JSValue(Error::create(callFrame, (ErrorType)type, callFrame->r(message).jsValue().toString(callFrame), codeBlock->lineNumberForBytecodeOffset(callFrame, vPC - codeBlock->instructions().begin()), codeBlock->owner Node()->sourceID(), codeBlock->ownerNode()->sourceURL()));3671 callFrame->r(dst) = JSValue(Error::create(callFrame, (ErrorType)type, callFrame->r(message).jsValue().toString(callFrame), codeBlock->lineNumberForBytecodeOffset(callFrame, vPC - codeBlock->instructions().begin()), codeBlock->ownerExecutable()->sourceID(), codeBlock->ownerExecutable()->sourceURL())); 3675 3672 3676 3673 ++vPC; … … 3900 3897 unsigned bytecodeOffset = bytecodeOffsetForPC(callerFrame, callerCodeBlock, callFrame->returnPC()); 3901 3898 lineNumber = callerCodeBlock->lineNumberForBytecodeOffset(callerFrame, bytecodeOffset - 1); 3902 sourceID = callerCodeBlock->owner Node()->sourceID();3903 sourceURL = callerCodeBlock->owner Node()->sourceURL();3899 sourceID = callerCodeBlock->ownerExecutable()->sourceID(); 3900 sourceURL = callerCodeBlock->ownerExecutable()->sourceURL(); 3904 3901 function = callerFrame->callee(); 3905 3902 }
Note:
See TracChangeset
for help on using the changeset viewer.