Changeset 39070 in webkit for trunk/JavaScriptCore/interpreter/Interpreter.cpp
- Timestamp:
- Dec 6, 2008, 2:01:05 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/interpreter/Interpreter.cpp
r39039 r39070 93 93 static ALWAYS_INLINE Instruction* vPCForPC(CodeBlock* codeBlock, void* pc) 94 94 { 95 if (pc >= codeBlock->instructions .begin() && pc < codeBlock->instructions.end())95 if (pc >= codeBlock->instructions().begin() && pc < codeBlock->instructions().end()) 96 96 return static_cast<Instruction*>(pc); 97 97 98 ASSERT(codeBlock-> ctiReturnAddressVPCMap.contains(pc));99 unsigned vPCIndex = codeBlock-> ctiReturnAddressVPCMap.get(pc);100 return codeBlock->instructions .begin() + vPCIndex;98 ASSERT(codeBlock->jitReturnAddressVPCMap().contains(pc)); 99 unsigned vPCIndex = codeBlock->jitReturnAddressVPCMap().get(pc); 100 return codeBlock->instructions().begin() + vPCIndex; 101 101 } 102 102 … … 113 113 static int depth(CodeBlock* codeBlock, ScopeChain& sc) 114 114 { 115 if (!codeBlock->needsFullScopeChain )115 if (!codeBlock->needsFullScopeChain()) 116 116 return 0; 117 117 int scopeDepth = 0; … … 334 334 335 335 CodeBlock* codeBlock = callFrame->codeBlock(); 336 Identifier& ident = codeBlock->identifier s[property];336 Identifier& ident = codeBlock->identifier(property); 337 337 do { 338 338 JSObject* o = *iter; … … 357 357 int dst = (vPC + 1)->u.operand; 358 358 int property = (vPC + 2)->u.operand; 359 int skip = (vPC + 3)->u.operand + codeBlock->needsFullScopeChain ;359 int skip = (vPC + 3)->u.operand + codeBlock->needsFullScopeChain(); 360 360 361 361 ScopeChainNode* scopeChain = callFrame->scopeChain(); … … 367 367 ASSERT(iter != end); 368 368 } 369 Identifier& ident = codeBlock->identifier s[property];369 Identifier& ident = codeBlock->identifier(property); 370 370 do { 371 371 JSObject* o = *iter; … … 399 399 400 400 CodeBlock* codeBlock = callFrame->codeBlock(); 401 Identifier& ident = codeBlock->identifier s[property];401 Identifier& ident = codeBlock->identifier(property); 402 402 PropertySlot slot(globalObject); 403 403 if (globalObject->getPropertySlot(callFrame, ident, slot)) { … … 451 451 int dst = (vPC + 1)->u.operand; 452 452 int property = (vPC + 2)->u.operand; 453 callFrame[dst] = inlineResolveBase(callFrame, callFrame->codeBlock()->identifier s[property], callFrame->scopeChain());453 callFrame[dst] = inlineResolveBase(callFrame, callFrame->codeBlock()->identifier(property), callFrame->scopeChain()); 454 454 } 455 455 … … 469 469 470 470 CodeBlock* codeBlock = callFrame->codeBlock(); 471 Identifier& ident = codeBlock->identifier s[property];471 Identifier& ident = codeBlock->identifier(property); 472 472 JSObject* base; 473 473 do { … … 505 505 506 506 CodeBlock* codeBlock = callFrame->codeBlock(); 507 Identifier& ident = codeBlock->identifier s[property];507 Identifier& ident = codeBlock->identifier(property); 508 508 JSObject* base; 509 509 do { … … 538 538 { 539 539 Register* r = callFrame->registers(); 540 Register* newEnd = r + registerOffset + newCodeBlock-> numCalleeRegisters;541 542 if (LIKELY(argc == newCodeBlock-> numParameters)) { // correct number of arguments540 Register* newEnd = r + registerOffset + newCodeBlock->m_numCalleeRegisters; 541 542 if (LIKELY(argc == newCodeBlock->m_numParameters)) { // correct number of arguments 543 543 if (UNLIKELY(!registerFile->grow(newEnd))) 544 544 return 0; 545 545 r += registerOffset; 546 } else if (argc < newCodeBlock-> numParameters) { // too few arguments -- fill in the blanks547 size_t omittedArgCount = newCodeBlock-> numParameters - argc;546 } else if (argc < newCodeBlock->m_numParameters) { // too few arguments -- fill in the blanks 547 size_t omittedArgCount = newCodeBlock->m_numParameters - argc; 548 548 registerOffset += omittedArgCount; 549 549 newEnd += omittedArgCount; … … 556 556 argv[i] = jsUndefined(); 557 557 } else { // too many arguments -- copy expected arguments, leaving the extra arguments behind 558 size_t numParameters = newCodeBlock-> numParameters;558 size_t numParameters = newCodeBlock->m_numParameters; 559 559 registerOffset += numParameters; 560 560 newEnd += numParameters; … … 594 594 ScopeChainNode* scopeChain = callFrame->scopeChain(); 595 595 CodeBlock* codeBlock = callFrame->codeBlock(); 596 RefPtr<EvalNode> evalNode = codeBlock->evalCodeCache .get(callFrame, programSource, scopeChain, exceptionValue);596 RefPtr<EvalNode> evalNode = codeBlock->evalCodeCache().get(callFrame, programSource, scopeChain, exceptionValue); 597 597 598 598 JSValue* result = jsUndefined(); … … 676 676 const Register* end; 677 677 678 if (codeBlock->codeType == GlobalCode) {678 if (codeBlock->codeType() == GlobalCode) { 679 679 it = registerFile->lastGlobal(); 680 680 end = it + registerFile->numGlobals(); … … 686 686 } 687 687 688 it = callFrame->registers() - RegisterFile::CallFrameHeaderSize - codeBlock-> numParameters;688 it = callFrame->registers() - RegisterFile::CallFrameHeaderSize - codeBlock->m_numParameters; 689 689 printf("[this] | %10p | %10p \n", it, (*it).v()); ++it; 690 end = it + max(codeBlock-> numParameters - 1, 0); // - 1 to skip "this"690 end = it + max(codeBlock->m_numParameters - 1, 0); // - 1 to skip "this" 691 691 if (it != end) { 692 692 do { … … 709 709 int registerCount = 0; 710 710 711 end = it + codeBlock-> numVars;711 end = it + codeBlock->m_numVars; 712 712 if (it != end) { 713 713 do { … … 719 719 printf("----------------------------------------------------\n"); 720 720 721 end = it + codeBlock-> numConstants;721 end = it + codeBlock->m_numConstants; 722 722 if (it != end) { 723 723 do { … … 729 729 printf("----------------------------------------------------\n"); 730 730 731 end = it + codeBlock-> numCalleeRegisters - codeBlock->numConstants - codeBlock->numVars;731 end = it + codeBlock->m_numCalleeRegisters - codeBlock->m_numConstants - codeBlock->m_numVars; 732 732 if (it != end) { 733 733 do { … … 761 761 DebuggerCallFrame debuggerCallFrame(callFrame, exceptionValue); 762 762 if (callFrame->callee()) 763 debugger->returnEvent(debuggerCallFrame, codeBlock->ownerNode ->sourceID(), codeBlock->ownerNode->lastLine());763 debugger->returnEvent(debuggerCallFrame, codeBlock->ownerNode()->sourceID(), codeBlock->ownerNode()->lastLine()); 764 764 else 765 debugger->didExecuteProgram(debuggerCallFrame, codeBlock->ownerNode ->sourceID(), codeBlock->ownerNode->lastLine());765 debugger->didExecuteProgram(debuggerCallFrame, codeBlock->ownerNode()->sourceID(), codeBlock->ownerNode()->lastLine()); 766 766 } 767 767 … … 770 770 profiler->didExecute(callFrame, callFrame->callee()); 771 771 else 772 profiler->didExecute(callFrame, codeBlock->ownerNode ->sourceURL(), codeBlock->ownerNode->lineNo());772 profiler->didExecute(callFrame, codeBlock->ownerNode()->sourceURL(), codeBlock->ownerNode()->lineNo()); 773 773 } 774 774 775 775 // If this call frame created an activation or an 'arguments' object, tear it off. 776 if (oldCodeBlock->codeType == FunctionCode && oldCodeBlock->needsFullScopeChain) {776 if (oldCodeBlock->codeType() == FunctionCode && oldCodeBlock->needsFullScopeChain()) { 777 777 while (!scopeChain->object->isObject(&JSActivation::info)) 778 778 scopeChain = scopeChain->pop(); … … 783 783 } 784 784 785 if (oldCodeBlock->needsFullScopeChain )785 if (oldCodeBlock->needsFullScopeChain()) 786 786 scopeChain->deref(); 787 787 … … 826 826 } else 827 827 exception->putWithAttributes(callFrame, Identifier(callFrame, "line"), jsNumber(callFrame, codeBlock->lineNumberForVPC(vPC)), ReadOnly | DontDelete); 828 exception->putWithAttributes(callFrame, Identifier(callFrame, "sourceId"), jsNumber(callFrame, codeBlock->ownerNode ->sourceID()), ReadOnly | DontDelete);829 exception->putWithAttributes(callFrame, Identifier(callFrame, "sourceURL"), jsOwnedString(callFrame, codeBlock->ownerNode ->sourceURL()), ReadOnly | DontDelete);828 exception->putWithAttributes(callFrame, Identifier(callFrame, "sourceId"), jsNumber(callFrame, codeBlock->ownerNode()->sourceID()), ReadOnly | DontDelete); 829 exception->putWithAttributes(callFrame, Identifier(callFrame, "sourceURL"), jsOwnedString(callFrame, codeBlock->ownerNode()->sourceURL()), ReadOnly | DontDelete); 830 830 } 831 831 … … 841 841 if (Debugger* debugger = callFrame->dynamicGlobalObject()->debugger()) { 842 842 DebuggerCallFrame debuggerCallFrame(callFrame, exceptionValue); 843 debugger->exception(debuggerCallFrame, codeBlock->ownerNode ->sourceID(), codeBlock->lineNumberForVPC(vPC));843 debugger->exception(debuggerCallFrame, codeBlock->ownerNode()->sourceID(), codeBlock->lineNumberForVPC(vPC)); 844 844 } 845 845 … … 907 907 908 908 Register* oldEnd = m_registerFile.end(); 909 Register* newEnd = oldEnd + codeBlock-> numParameters + RegisterFile::CallFrameHeaderSize + codeBlock->numCalleeRegisters;909 Register* newEnd = oldEnd + codeBlock->m_numParameters + RegisterFile::CallFrameHeaderSize + codeBlock->m_numCalleeRegisters; 910 910 if (!m_registerFile.grow(newEnd)) { 911 911 *exception = createStackOverflowError(callFrame); … … 919 919 globalObject->copyGlobalsTo(m_registerFile); 920 920 921 CallFrame* newCallFrame = CallFrame::create(oldEnd + codeBlock-> numParameters + RegisterFile::CallFrameHeaderSize);922 newCallFrame[codeBlock->thisRegister ] = thisObj;921 CallFrame* newCallFrame = CallFrame::create(oldEnd + codeBlock->m_numParameters + RegisterFile::CallFrameHeaderSize); 922 newCallFrame[codeBlock->thisRegister()] = thisObj; 923 923 newCallFrame->init(codeBlock, 0, scopeChain, CallFrame::noCaller(), 0, 0, 0); 924 924 925 if (codeBlock->needsFullScopeChain )925 if (codeBlock->needsFullScopeChain()) 926 926 scopeChain->ref(); 927 927 … … 936 936 m_reentryDepth++; 937 937 #if ENABLE(JIT) 938 if (!codeBlock-> ctiCode)938 if (!codeBlock->jitCode()) 939 939 JIT::compile(scopeChain->globalData, codeBlock); 940 result = JIT::execute(codeBlock-> ctiCode, &m_registerFile, newCallFrame, scopeChain->globalData, exception);940 result = JIT::execute(codeBlock->jitCode(), &m_registerFile, newCallFrame, scopeChain->globalData, exception); 941 941 #else 942 942 result = privateExecute(Normal, &m_registerFile, newCallFrame, exception); … … 1002 1002 m_reentryDepth++; 1003 1003 #if ENABLE(JIT) 1004 if (!codeBlock-> ctiCode)1004 if (!codeBlock->jitCode()) 1005 1005 JIT::compile(scopeChain->globalData, codeBlock); 1006 result = JIT::execute(codeBlock-> ctiCode, &m_registerFile, newCallFrame, scopeChain->globalData, exception);1006 result = JIT::execute(codeBlock->jitCode(), &m_registerFile, newCallFrame, scopeChain->globalData, exception); 1007 1007 #else 1008 1008 result = privateExecute(Normal, &m_registerFile, newCallFrame, exception); … … 1020 1020 JSValue* Interpreter::execute(EvalNode* evalNode, CallFrame* callFrame, JSObject* thisObj, ScopeChainNode* scopeChain, JSValue** exception) 1021 1021 { 1022 return execute(evalNode, callFrame, thisObj, m_registerFile.size() + evalNode->bytecode(scopeChain). numParameters + RegisterFile::CallFrameHeaderSize, scopeChain, exception);1022 return execute(evalNode, callFrame, thisObj, m_registerFile.size() + evalNode->bytecode(scopeChain).m_numParameters + RegisterFile::CallFrameHeaderSize, scopeChain, exception); 1023 1023 } 1024 1024 … … 1049 1049 BatchedTransitionOptimizer optimizer(variableObject); 1050 1050 1051 const DeclarationStacks::VarStack& varStack = codeBlock->ownerNode ->varStack();1051 const DeclarationStacks::VarStack& varStack = codeBlock->ownerNode()->varStack(); 1052 1052 DeclarationStacks::VarStack::const_iterator varStackEnd = varStack.end(); 1053 1053 for (DeclarationStacks::VarStack::const_iterator it = varStack.begin(); it != varStackEnd; ++it) { … … 1059 1059 } 1060 1060 1061 const DeclarationStacks::FunctionStack& functionStack = codeBlock->ownerNode ->functionStack();1061 const DeclarationStacks::FunctionStack& functionStack = codeBlock->ownerNode()->functionStack(); 1062 1062 DeclarationStacks::FunctionStack::const_iterator functionStackEnd = functionStack.end(); 1063 1063 for (DeclarationStacks::FunctionStack::const_iterator it = functionStack.begin(); it != functionStackEnd; ++it) { … … 1069 1069 1070 1070 Register* oldEnd = m_registerFile.end(); 1071 Register* newEnd = m_registerFile.start() + globalRegisterOffset + codeBlock-> numCalleeRegisters;1071 Register* newEnd = m_registerFile.start() + globalRegisterOffset + codeBlock->m_numCalleeRegisters; 1072 1072 if (!m_registerFile.grow(newEnd)) { 1073 1073 *exception = createStackOverflowError(callFrame); … … 1078 1078 1079 1079 // a 0 codeBlock indicates a built-in caller 1080 newCallFrame[codeBlock->thisRegister ] = thisObj;1080 newCallFrame[codeBlock->thisRegister()] = thisObj; 1081 1081 newCallFrame->init(codeBlock, 0, scopeChain, callFrame->addHostCallFrameFlag(), 0, 0, 0); 1082 1082 1083 if (codeBlock->needsFullScopeChain )1083 if (codeBlock->needsFullScopeChain()) 1084 1084 scopeChain->ref(); 1085 1085 … … 1094 1094 m_reentryDepth++; 1095 1095 #if ENABLE(JIT) 1096 if (!codeBlock-> ctiCode)1096 if (!codeBlock->jitCode()) 1097 1097 JIT::compile(scopeChain->globalData, codeBlock); 1098 result = JIT::execute(codeBlock-> ctiCode, &m_registerFile, newCallFrame, scopeChain->globalData, exception);1098 result = JIT::execute(codeBlock->jitCode(), &m_registerFile, newCallFrame, scopeChain->globalData, exception); 1099 1099 #else 1100 1100 result = privateExecute(Normal, &m_registerFile, newCallFrame, exception); … … 1118 1118 switch (debugHookID) { 1119 1119 case DidEnterCallFrame: 1120 debugger->callEvent(callFrame, callFrame->codeBlock()->ownerNode ->sourceID(), firstLine);1120 debugger->callEvent(callFrame, callFrame->codeBlock()->ownerNode()->sourceID(), firstLine); 1121 1121 return; 1122 1122 case WillLeaveCallFrame: 1123 debugger->returnEvent(callFrame, callFrame->codeBlock()->ownerNode ->sourceID(), lastLine);1123 debugger->returnEvent(callFrame, callFrame->codeBlock()->ownerNode()->sourceID(), lastLine); 1124 1124 return; 1125 1125 case WillExecuteStatement: 1126 debugger->atStatement(callFrame, callFrame->codeBlock()->ownerNode ->sourceID(), firstLine);1126 debugger->atStatement(callFrame, callFrame->codeBlock()->ownerNode()->sourceID(), firstLine); 1127 1127 return; 1128 1128 case WillExecuteProgram: 1129 debugger->willExecuteProgram(callFrame, callFrame->codeBlock()->ownerNode ->sourceID(), firstLine);1129 debugger->willExecuteProgram(callFrame, callFrame->codeBlock()->ownerNode()->sourceID(), firstLine); 1130 1130 return; 1131 1131 case DidExecuteProgram: 1132 debugger->didExecuteProgram(callFrame, callFrame->codeBlock()->ownerNode ->sourceID(), lastLine);1132 debugger->didExecuteProgram(callFrame, callFrame->codeBlock()->ownerNode()->sourceID(), lastLine); 1133 1133 return; 1134 1134 case DidReachBreakpoint: 1135 debugger->didReachBreakpoint(callFrame, callFrame->codeBlock()->ownerNode ->sourceID(), lastLine);1135 debugger->didReachBreakpoint(callFrame, callFrame->codeBlock()->ownerNode()->sourceID(), lastLine); 1136 1136 return; 1137 1137 } … … 1227 1227 int dst = (++vPC)->u.operand; 1228 1228 CodeBlock* codeBlock = callFrame->codeBlock(); 1229 Identifier& property = codeBlock->identifier s[(++vPC)->u.operand];1229 Identifier& property = codeBlock->identifier((++vPC)->u.operand); 1230 1230 JSValue* value = callFrame[(++vPC)->u.operand].jsValue(callFrame); 1231 1231 JSObject* scope = new (callFrame) JSStaticScopeObject(callFrame, property, value, DontDelete); … … 1486 1486 Instruction* handlerVPC = 0; 1487 1487 1488 Instruction* vPC = callFrame->codeBlock()->instructions .begin();1488 Instruction* vPC = callFrame->codeBlock()->instructions().begin(); 1489 1489 Profiler** enabledProfilerReference = Profiler::enabledProfilerReference(); 1490 1490 unsigned tickCount = m_ticksUntilNextTimeoutCheck + 1; … … 1575 1575 int dst = (++vPC)->u.operand; 1576 1576 int regExp = (++vPC)->u.operand; 1577 callFrame[dst] = new (globalData) RegExpObject(callFrame->scopeChain()->globalObject()->regExpStructure(), callFrame->codeBlock()->regexp s[regExp]);1577 callFrame[dst] = new (globalData) RegExpObject(callFrame->scopeChain()->globalObject()->regExpStructure(), callFrame->codeBlock()->regexp(regExp)); 1578 1578 1579 1579 ++vPC; … … 2413 2413 int dst = (++vPC)->u.operand; 2414 2414 int index = (++vPC)->u.operand; 2415 int skip = (++vPC)->u.operand + callFrame->codeBlock()->needsFullScopeChain ;2415 int skip = (++vPC)->u.operand + callFrame->codeBlock()->needsFullScopeChain(); 2416 2416 2417 2417 ScopeChainNode* scopeChain = callFrame->scopeChain(); … … 2435 2435 */ 2436 2436 int index = (++vPC)->u.operand; 2437 int skip = (++vPC)->u.operand + callFrame->codeBlock()->needsFullScopeChain ;2437 int skip = (++vPC)->u.operand + callFrame->codeBlock()->needsFullScopeChain(); 2438 2438 int value = (++vPC)->u.operand; 2439 2439 … … 2516 2516 2517 2517 CodeBlock* codeBlock = callFrame->codeBlock(); 2518 Identifier& ident = codeBlock->identifier s[property];2518 Identifier& ident = codeBlock->identifier(property); 2519 2519 JSValue* baseValue = callFrame[base].jsValue(callFrame); 2520 2520 PropertySlot slot(baseValue); … … 2548 2548 int offset = vPC[5].u.operand; 2549 2549 2550 ASSERT(baseObject->get(callFrame, callFrame->codeBlock()->identifier s[vPC[3].u.operand]) == baseObject->getDirectOffset(offset));2550 ASSERT(baseObject->get(callFrame, callFrame->codeBlock()->identifier(vPC[3].u.operand)) == baseObject->getDirectOffset(offset)); 2551 2551 callFrame[dst] = baseObject->getDirectOffset(offset); 2552 2552 … … 2582 2582 int offset = vPC[6].u.operand; 2583 2583 2584 ASSERT(protoObject->get(callFrame, callFrame->codeBlock()->identifier s[vPC[3].u.operand]) == protoObject->getDirectOffset(offset));2584 ASSERT(protoObject->get(callFrame, callFrame->codeBlock()->identifier(vPC[3].u.operand)) == protoObject->getDirectOffset(offset)); 2585 2585 callFrame[dst] = protoObject->getDirectOffset(offset); 2586 2586 … … 2637 2637 int offset = vPC[7].u.operand; 2638 2638 2639 ASSERT(baseObject->get(callFrame, callFrame->codeBlock()->identifier s[vPC[3].u.operand]) == baseObject->getDirectOffset(offset));2639 ASSERT(baseObject->get(callFrame, callFrame->codeBlock()->identifier(vPC[3].u.operand)) == baseObject->getDirectOffset(offset)); 2640 2640 callFrame[dst] = baseObject->getDirectOffset(offset); 2641 2641 … … 2660 2660 int property = vPC[3].u.operand; 2661 2661 2662 Identifier& ident = callFrame->codeBlock()->identifier s[property];2662 Identifier& ident = callFrame->codeBlock()->identifier(property); 2663 2663 JSValue* baseValue = callFrame[base].jsValue(callFrame); 2664 2664 PropertySlot slot(baseValue); … … 2726 2726 CodeBlock* codeBlock = callFrame->codeBlock(); 2727 2727 JSValue* baseValue = callFrame[base].jsValue(callFrame); 2728 Identifier& ident = codeBlock->identifier s[property];2728 Identifier& ident = codeBlock->identifier(property); 2729 2729 PutPropertySlot slot; 2730 2730 baseValue->put(callFrame, ident, callFrame[value].jsValue(callFrame), slot); … … 2775 2775 int value = vPC[3].u.operand; 2776 2776 unsigned offset = vPC[7].u.operand; 2777 ASSERT(baseObject->offsetForLocation(baseObject->getDirectLocation(callFrame->codeBlock()->identifier s[vPC[2].u.operand])) == offset);2777 ASSERT(baseObject->offsetForLocation(baseObject->getDirectLocation(callFrame->codeBlock()->identifier(vPC[2].u.operand))) == offset); 2778 2778 baseObject->putDirectOffset(offset, callFrame[value].jsValue(callFrame)); 2779 2779 … … 2810 2810 unsigned offset = vPC[5].u.operand; 2811 2811 2812 ASSERT(baseObject->offsetForLocation(baseObject->getDirectLocation(callFrame->codeBlock()->identifier s[vPC[2].u.operand])) == offset);2812 ASSERT(baseObject->offsetForLocation(baseObject->getDirectLocation(callFrame->codeBlock()->identifier(vPC[2].u.operand))) == offset); 2813 2813 baseObject->putDirectOffset(offset, callFrame[value].jsValue(callFrame)); 2814 2814 … … 2835 2835 2836 2836 JSValue* baseValue = callFrame[base].jsValue(callFrame); 2837 Identifier& ident = callFrame->codeBlock()->identifier s[property];2837 Identifier& ident = callFrame->codeBlock()->identifier(property); 2838 2838 PutPropertySlot slot; 2839 2839 baseValue->put(callFrame, ident, callFrame[value].jsValue(callFrame), slot); … … 2856 2856 2857 2857 JSObject* baseObj = callFrame[base].jsValue(callFrame)->toObject(callFrame); 2858 Identifier& ident = callFrame->codeBlock()->identifier s[property];2858 Identifier& ident = callFrame->codeBlock()->identifier(property); 2859 2859 JSValue* result = jsBoolean(baseObj->deleteProperty(callFrame, ident)); 2860 2860 CHECK_FOR_EXCEPTION(); … … 3265 3265 int func = (++vPC)->u.operand; 3266 3266 3267 callFrame[dst] = callFrame->codeBlock()->function s[func]->makeFunction(callFrame, callFrame->scopeChain());3267 callFrame[dst] = callFrame->codeBlock()->function(func)->makeFunction(callFrame, callFrame->scopeChain()); 3268 3268 3269 3269 ++vPC; … … 3281 3281 int func = (++vPC)->u.operand; 3282 3282 3283 callFrame[dst] = callFrame->codeBlock()->functionExpression s[func]->makeFunction(callFrame, callFrame->scopeChain());3283 callFrame[dst] = callFrame->codeBlock()->functionExpression(func)->makeFunction(callFrame, callFrame->scopeChain()); 3284 3284 3285 3285 ++vPC; … … 3360 3360 3361 3361 callFrame->init(newCodeBlock, vPC + 5, callDataScopeChain, previousCallFrame, dst, argCount, asFunction(v)); 3362 vPC = newCodeBlock->instructions .begin();3362 vPC = newCodeBlock->instructions().begin(); 3363 3363 3364 3364 #if ENABLE(OPCODE_STATS) … … 3414 3414 3415 3415 int src = (++vPC)->u.operand; 3416 ASSERT(callFrame->codeBlock()->needsFullScopeChain );3416 ASSERT(callFrame->codeBlock()->needsFullScopeChain()); 3417 3417 3418 3418 asActivation(callFrame[src].getJSValue())->copyRegisters(callFrame->optionalCalleeArguments()); … … 3434 3434 */ 3435 3435 3436 ASSERT(callFrame->codeBlock()->usesArguments && !callFrame->codeBlock()->needsFullScopeChain);3436 ASSERT(callFrame->codeBlock()->usesArguments() && !callFrame->codeBlock()->needsFullScopeChain()); 3437 3437 3438 3438 callFrame->optionalCalleeArguments()->copyRegisters(); … … 3453 3453 int result = (++vPC)->u.operand; 3454 3454 3455 if (callFrame->codeBlock()->needsFullScopeChain )3455 if (callFrame->codeBlock()->needsFullScopeChain()) 3456 3456 callFrame->scopeChain()->deref(); 3457 3457 … … 3483 3483 CodeBlock* codeBlock = callFrame->codeBlock(); 3484 3484 3485 for (size_t count = codeBlock-> numVars; i < count; ++i)3485 for (size_t count = codeBlock->m_numVars; i < count; ++i) 3486 3486 callFrame[i] = jsUndefined(); 3487 3487 3488 for (size_t count = codeBlock-> constantRegisters.size(), j = 0; j < count; ++i, ++j)3489 callFrame[i] = codeBlock->constantRegister s[j];3488 for (size_t count = codeBlock->numberOfConstantRegisters(), j = 0; j < count; ++i, ++j) 3489 callFrame[i] = codeBlock->constantRegister(j); 3490 3490 3491 3491 ++vPC; … … 3508 3508 CodeBlock* codeBlock = callFrame->codeBlock(); 3509 3509 3510 for (size_t count = codeBlock-> numVars; i < count; ++i)3510 for (size_t count = codeBlock->m_numVars; i < count; ++i) 3511 3511 callFrame[i] = jsUndefined(); 3512 3512 3513 for (size_t count = codeBlock-> constantRegisters.size(), j = 0; j < count; ++i, ++j)3514 callFrame[i] = codeBlock->constantRegister s[j];3513 for (size_t count = codeBlock->numberOfConstantRegisters(), j = 0; j < count; ++i, ++j) 3514 callFrame[i] = codeBlock->constantRegister(j); 3515 3515 3516 3516 int dst = (++vPC)->u.operand; 3517 JSActivation* activation = new (globalData) JSActivation(callFrame, static_cast<FunctionBodyNode*>(codeBlock->ownerNode ));3517 JSActivation* activation = new (globalData) JSActivation(callFrame, static_cast<FunctionBodyNode*>(codeBlock->ownerNode())); 3518 3518 callFrame[dst] = activation; 3519 3519 callFrame->setScopeChain(callFrame->scopeChain()->copy()->push(activation)); … … 3612 3612 3613 3613 callFrame->init(newCodeBlock, vPC + 7, callDataScopeChain, previousCallFrame, dst, argCount, asFunction(v)); 3614 vPC = newCodeBlock->instructions .begin();3614 vPC = newCodeBlock->instructions().begin(); 3615 3615 3616 3616 #if ENABLE(OPCODE_STATS) … … 3813 3813 int dst = (++vPC)->u.operand; 3814 3814 int src = (++vPC)->u.operand; 3815 callFrame[dst] = callFrame->codeBlock()->unexpectedConstant s[src];3815 callFrame[dst] = callFrame->codeBlock()->unexpectedConstant(src); 3816 3816 3817 3817 ++vPC; … … 3831 3831 3832 3832 CodeBlock* codeBlock = callFrame->codeBlock(); 3833 callFrame[dst] = Error::create(callFrame, (ErrorType)type, codeBlock->unexpectedConstant s[message]->toString(callFrame), codeBlock->lineNumberForVPC(vPC), codeBlock->ownerNode->sourceID(), codeBlock->ownerNode->sourceURL());3833 callFrame[dst] = Error::create(callFrame, (ErrorType)type, codeBlock->unexpectedConstant(message)->toString(callFrame), codeBlock->lineNumberForVPC(vPC), codeBlock->ownerNode()->sourceID(), codeBlock->ownerNode()->sourceURL()); 3834 3834 3835 3835 ++vPC; … … 3843 3843 */ 3844 3844 3845 if (callFrame->codeBlock()->needsFullScopeChain ) {3845 if (callFrame->codeBlock()->needsFullScopeChain()) { 3846 3846 ScopeChainNode* scopeChain = callFrame->scopeChain(); 3847 3847 ASSERT(scopeChain->refCount > 1); … … 3868 3868 ASSERT(callFrame[base].jsValue(callFrame)->isObject()); 3869 3869 JSObject* baseObj = asObject(callFrame[base].jsValue(callFrame)); 3870 Identifier& ident = callFrame->codeBlock()->identifier s[property];3870 Identifier& ident = callFrame->codeBlock()->identifier(property); 3871 3871 ASSERT(callFrame[function].jsValue(callFrame)->isObject()); 3872 3872 baseObj->defineGetter(callFrame, ident, asObject(callFrame[function].jsValue(callFrame))); … … 3892 3892 ASSERT(callFrame[base].jsValue(callFrame)->isObject()); 3893 3893 JSObject* baseObj = asObject(callFrame[base].jsValue(callFrame)); 3894 Identifier& ident = callFrame->codeBlock()->identifier s[property];3894 Identifier& ident = callFrame->codeBlock()->identifier(property); 3895 3895 ASSERT(callFrame[function].jsValue(callFrame)->isObject()); 3896 3896 baseObj->defineSetter(callFrame, ident, asObject(callFrame[function].jsValue(callFrame))); … … 3998 3998 3999 3999 CodeBlock* codeBlock = functionCallFrame->codeBlock(); 4000 if (codeBlock->usesArguments ) {4001 ASSERT(codeBlock->codeType == FunctionCode);4002 SymbolTable& symbolTable = codeBlock->symbolTable ;4000 if (codeBlock->usesArguments()) { 4001 ASSERT(codeBlock->codeType() == FunctionCode); 4002 SymbolTable& symbolTable = codeBlock->symbolTable(); 4003 4003 int argumentsIndex = symbolTable.get(functionCallFrame->propertyNames().arguments.ustring().rep()).getIndex(); 4004 4004 return functionCallFrame[argumentsIndex].jsValue(callFrame); … … 4048 4048 Instruction* vPC = vPCForPC(callerCodeBlock, callFrame->returnPC()); 4049 4049 lineNumber = callerCodeBlock->lineNumberForVPC(vPC - 1); 4050 sourceID = callerCodeBlock->ownerNode ->sourceID();4051 sourceURL = callerCodeBlock->ownerNode ->sourceURL();4050 sourceID = callerCodeBlock->ownerNode()->sourceID(); 4051 sourceURL = callerCodeBlock->ownerNode()->sourceURL(); 4052 4052 function = callerFrame->callee(); 4053 4053 } … … 4088 4088 // *_second method to achieve a similar (but not quite the same) effect. 4089 4089 4090 unsigned vPCIndex = codeBlock-> ctiReturnAddressVPCMap.get(returnAddress);4091 Instruction* vPC = codeBlock->instructions .begin() + vPCIndex;4090 unsigned vPCIndex = codeBlock->jitReturnAddressVPCMap().get(returnAddress); 4091 Instruction* vPC = codeBlock->instructions().begin() + vPCIndex; 4092 4092 4093 4093 // Cache hit: Specialize instruction and ref Structures. … … 4176 4176 // *_second method to achieve a similar (but not quite the same) effect. 4177 4177 4178 unsigned vPCIndex = codeBlock-> ctiReturnAddressVPCMap.get(returnAddress);4179 Instruction* vPC = codeBlock->instructions .begin() + vPCIndex;4178 unsigned vPCIndex = codeBlock->jitReturnAddressVPCMap().get(returnAddress); 4179 Instruction* vPC = codeBlock->instructions().begin() + vPCIndex; 4180 4180 4181 4181 // Cache hit: Specialize instruction and ref Structures. … … 4425 4425 CTI_STACK_HACK(); 4426 4426 4427 if (LIKELY(ARG_registerFile->grow(ARG_callFrame + ARG_callFrame->codeBlock()-> numCalleeRegisters)))4427 if (LIKELY(ARG_registerFile->grow(ARG_callFrame + ARG_callFrame->codeBlock()->m_numCalleeRegisters))) 4428 4428 return; 4429 4429 … … 4583 4583 4584 4584 CodeBlock* codeBlock = callFrame->codeBlock(); 4585 unsigned vPCIndex = codeBlock-> ctiReturnAddressVPCMap.get(CTI_RETURN_ADDRESS);4586 Instruction* vPC = codeBlock->instructions .begin() + vPCIndex;4585 unsigned vPCIndex = codeBlock->jitReturnAddressVPCMap().get(CTI_RETURN_ADDRESS); 4586 Instruction* vPC = codeBlock->instructions().begin() + vPCIndex; 4587 4587 4588 4588 ASSERT(slot.slotBase()->isObject()); … … 4667 4667 Structure* structure = asCell(baseValue)->structure(); 4668 4668 CodeBlock* codeBlock = callFrame->codeBlock(); 4669 Instruction* vPC = codeBlock->instructions .begin() + codeBlock->ctiReturnAddressVPCMap.get(CTI_RETURN_ADDRESS);4669 Instruction* vPC = codeBlock->instructions().begin() + codeBlock->jitReturnAddressVPCMap().get(CTI_RETURN_ADDRESS); 4670 4670 4671 4671 ASSERT(slot.slotBase()->isObject()); … … 4776 4776 CallFrame* callFrame = ARG_callFrame; 4777 4777 CodeBlock* codeBlock = callFrame->codeBlock(); 4778 ASSERT(codeBlock-> ctiReturnAddressVPCMap.contains(CTI_RETURN_ADDRESS));4779 unsigned vPCIndex = codeBlock-> ctiReturnAddressVPCMap.get(CTI_RETURN_ADDRESS);4780 ARG_globalData->exception = createInvalidParamError(callFrame, "instanceof", baseVal, codeBlock->instructions .begin() + vPCIndex, codeBlock);4778 ASSERT(codeBlock->jitReturnAddressVPCMap().contains(CTI_RETURN_ADDRESS)); 4779 unsigned vPCIndex = codeBlock->jitReturnAddressVPCMap().get(CTI_RETURN_ADDRESS); 4780 ARG_globalData->exception = createInvalidParamError(callFrame, "instanceof", baseVal, codeBlock->instructions().begin() + vPCIndex, codeBlock); 4781 4781 VM_THROW_EXCEPTION(); 4782 4782 } … … 4849 4849 CodeBlock* newCodeBlock = &asFunction(ARG_src1)->body()->bytecode(callDataScopeChain); 4850 4850 4851 if (!newCodeBlock-> ctiCode)4851 if (!newCodeBlock->jitCode()) 4852 4852 JIT::compile(ARG_globalData, newCodeBlock); 4853 4853 … … 4863 4863 int argCount = ARG_int3; 4864 4864 4865 ASSERT(argCount != newCodeBlock-> numParameters);4865 ASSERT(argCount != newCodeBlock->m_numParameters); 4866 4866 4867 4867 CallFrame* oldCallFrame = callFrame->callerFrame(); 4868 4868 4869 if (argCount > newCodeBlock-> numParameters) {4870 size_t numParameters = newCodeBlock-> numParameters;4869 if (argCount > newCodeBlock->m_numParameters) { 4870 size_t numParameters = newCodeBlock->m_numParameters; 4871 4871 Register* r = callFrame->registers() + numParameters; 4872 4872 … … 4878 4878 callFrame->setCallerFrame(oldCallFrame); 4879 4879 } else { 4880 size_t omittedArgCount = newCodeBlock-> numParameters - argCount;4880 size_t omittedArgCount = newCodeBlock->m_numParameters - argCount; 4881 4881 Register* r = callFrame->registers() + omittedArgCount; 4882 Register* newEnd = r + newCodeBlock-> numCalleeRegisters;4882 Register* newEnd = r + newCodeBlock->m_numCalleeRegisters; 4883 4883 if (!ARG_registerFile->grow(newEnd)) { 4884 4884 // Rewind to the previous call frame because op_call already optimistically … … 4908 4908 JSFunction* callee = asFunction(ARG_src1); 4909 4909 CodeBlock* codeBlock = &callee->body()->bytecode(callee->m_scopeChain.node()); 4910 if (!codeBlock-> ctiCode)4910 if (!codeBlock->jitCode()) 4911 4911 JIT::compile(ARG_globalData, codeBlock); 4912 4912 4913 4913 ctiRepatchCallByReturnAddress(ARG_returnAddress2, ARG_globalData->interpreter->m_ctiVirtualCallLink); 4914 4914 4915 return codeBlock-> ctiCode;4915 return codeBlock->jitCode(); 4916 4916 } 4917 4917 … … 4922 4922 JSFunction* callee = asFunction(ARG_src1); 4923 4923 CodeBlock* codeBlock = &callee->body()->bytecode(callee->m_scopeChain.node()); 4924 if (!codeBlock-> ctiCode)4924 if (!codeBlock->jitCode()) 4925 4925 JIT::compile(ARG_globalData, codeBlock); 4926 4926 4927 4927 CallLinkInfo* callLinkInfo = &ARG_callFrame->callerFrame()->codeBlock()->getCallLinkInfo(ARG_returnAddress2); 4928 JIT::linkCall(callee, codeBlock, codeBlock-> ctiCode, callLinkInfo, ARG_int3);4929 4930 return codeBlock-> ctiCode;4928 JIT::linkCall(callee, codeBlock, codeBlock->jitCode(), callLinkInfo, ARG_int3); 4929 4930 return codeBlock->jitCode(); 4931 4931 } 4932 4932 … … 4935 4935 CTI_STACK_HACK(); 4936 4936 4937 JSActivation* activation = new (ARG_globalData) JSActivation(ARG_callFrame, static_cast<FunctionBodyNode*>(ARG_callFrame->codeBlock()->ownerNode ));4937 JSActivation* activation = new (ARG_globalData) JSActivation(ARG_callFrame, static_cast<FunctionBodyNode*>(ARG_callFrame->codeBlock()->ownerNode())); 4938 4938 ARG_callFrame->setScopeChain(ARG_callFrame->scopeChain()->copy()->push(activation)); 4939 4939 return activation; … … 5008 5008 CTI_STACK_HACK(); 5009 5009 5010 ASSERT(ARG_callFrame->codeBlock()->needsFullScopeChain );5010 ASSERT(ARG_callFrame->codeBlock()->needsFullScopeChain()); 5011 5011 asActivation(ARG_src1)->copyRegisters(ARG_callFrame->optionalCalleeArguments()); 5012 5012 } … … 5016 5016 CTI_STACK_HACK(); 5017 5017 5018 ASSERT(ARG_callFrame->codeBlock()->usesArguments && !ARG_callFrame->codeBlock()->needsFullScopeChain);5018 ASSERT(ARG_callFrame->codeBlock()->usesArguments() && !ARG_callFrame->codeBlock()->needsFullScopeChain()); 5019 5019 ARG_callFrame->optionalCalleeArguments()->copyRegisters(); 5020 5020 } … … 5040 5040 CTI_STACK_HACK(); 5041 5041 5042 ASSERT(ARG_callFrame->codeBlock()->needsFullScopeChain );5042 ASSERT(ARG_callFrame->codeBlock()->needsFullScopeChain()); 5043 5043 ARG_callFrame->scopeChain()->deref(); 5044 5044 } … … 5075 5075 5076 5076 CodeBlock* codeBlock = callFrame->codeBlock(); 5077 ASSERT(codeBlock-> ctiReturnAddressVPCMap.contains(CTI_RETURN_ADDRESS));5078 unsigned vPCIndex = codeBlock-> ctiReturnAddressVPCMap.get(CTI_RETURN_ADDRESS);5079 ARG_globalData->exception = createUndefinedVariableError(callFrame, ident, codeBlock->instructions .begin() + vPCIndex, codeBlock);5077 ASSERT(codeBlock->jitReturnAddressVPCMap().contains(CTI_RETURN_ADDRESS)); 5078 unsigned vPCIndex = codeBlock->jitReturnAddressVPCMap().get(CTI_RETURN_ADDRESS); 5079 ARG_globalData->exception = createUndefinedVariableError(callFrame, ident, codeBlock->instructions().begin() + vPCIndex, codeBlock); 5080 5080 VM_THROW_EXCEPTION(); 5081 5081 } … … 5202 5202 5203 5203 CodeBlock* codeBlock = callFrame->codeBlock(); 5204 ASSERT(codeBlock-> ctiReturnAddressVPCMap.contains(CTI_RETURN_ADDRESS));5205 unsigned vPCIndex = codeBlock-> ctiReturnAddressVPCMap.get(CTI_RETURN_ADDRESS);5206 ARG_globalData->exception = createUndefinedVariableError(callFrame, ident, codeBlock->instructions .begin() + vPCIndex, codeBlock);5204 ASSERT(codeBlock->jitReturnAddressVPCMap().contains(CTI_RETURN_ADDRESS)); 5205 unsigned vPCIndex = codeBlock->jitReturnAddressVPCMap().get(CTI_RETURN_ADDRESS); 5206 ARG_globalData->exception = createUndefinedVariableError(callFrame, ident, codeBlock->instructions().begin() + vPCIndex, codeBlock); 5207 5207 VM_THROW_EXCEPTION_2(); 5208 5208 } … … 5360 5360 5361 5361 CodeBlock* codeBlock = callFrame->codeBlock(); 5362 ASSERT(codeBlock-> ctiReturnAddressVPCMap.contains(CTI_RETURN_ADDRESS));5363 unsigned vPCIndex = codeBlock-> ctiReturnAddressVPCMap.get(CTI_RETURN_ADDRESS);5364 ARG_globalData->exception = createUndefinedVariableError(callFrame, ident, codeBlock->instructions .begin() + vPCIndex, codeBlock);5362 ASSERT(codeBlock->jitReturnAddressVPCMap().contains(CTI_RETURN_ADDRESS)); 5363 unsigned vPCIndex = codeBlock->jitReturnAddressVPCMap().get(CTI_RETURN_ADDRESS); 5364 ARG_globalData->exception = createUndefinedVariableError(callFrame, ident, codeBlock->instructions().begin() + vPCIndex, codeBlock); 5365 5365 VM_THROW_EXCEPTION(); 5366 5366 } … … 5599 5599 5600 5600 CodeBlock* codeBlock = callFrame->codeBlock(); 5601 ASSERT(codeBlock-> ctiReturnAddressVPCMap.contains(CTI_RETURN_ADDRESS));5602 unsigned vPCIndex = codeBlock-> ctiReturnAddressVPCMap.get(CTI_RETURN_ADDRESS);5603 ARG_globalData->exception = createUndefinedVariableError(callFrame, ident, codeBlock->instructions .begin() + vPCIndex, codeBlock);5601 ASSERT(codeBlock->jitReturnAddressVPCMap().contains(CTI_RETURN_ADDRESS)); 5602 unsigned vPCIndex = codeBlock->jitReturnAddressVPCMap().get(CTI_RETURN_ADDRESS); 5603 ARG_globalData->exception = createUndefinedVariableError(callFrame, ident, codeBlock->instructions().begin() + vPCIndex, codeBlock); 5604 5604 VM_THROW_EXCEPTION_2(); 5605 5605 } … … 5757 5757 CodeBlock* codeBlock = callFrame->codeBlock(); 5758 5758 5759 ASSERT(codeBlock-> ctiReturnAddressVPCMap.contains(CTI_RETURN_ADDRESS));5760 unsigned vPCIndex = codeBlock-> ctiReturnAddressVPCMap.get(CTI_RETURN_ADDRESS);5759 ASSERT(codeBlock->jitReturnAddressVPCMap().contains(CTI_RETURN_ADDRESS)); 5760 unsigned vPCIndex = codeBlock->jitReturnAddressVPCMap().get(CTI_RETURN_ADDRESS); 5761 5761 5762 5762 JSValue* exceptionValue = ARG_src1; 5763 5763 ASSERT(exceptionValue); 5764 5764 5765 Instruction* handlerVPC = ARG_globalData->interpreter->throwException(callFrame, exceptionValue, codeBlock->instructions .begin() + vPCIndex, true);5765 Instruction* handlerVPC = ARG_globalData->interpreter->throwException(callFrame, exceptionValue, codeBlock->instructions().begin() + vPCIndex, true); 5766 5766 5767 5767 if (!handlerVPC) { … … 5911 5911 CallFrame* callFrame = ARG_callFrame; 5912 5912 CodeBlock* codeBlock = callFrame->codeBlock(); 5913 ASSERT(codeBlock-> ctiReturnAddressVPCMap.contains(CTI_RETURN_ADDRESS));5914 unsigned vPCIndex = codeBlock-> ctiReturnAddressVPCMap.get(CTI_RETURN_ADDRESS);5915 ARG_globalData->exception = createInvalidParamError(callFrame, "in", baseVal, codeBlock->instructions .begin() + vPCIndex, codeBlock);5913 ASSERT(codeBlock->jitReturnAddressVPCMap().contains(CTI_RETURN_ADDRESS)); 5914 unsigned vPCIndex = codeBlock->jitReturnAddressVPCMap().get(CTI_RETURN_ADDRESS); 5915 ARG_globalData->exception = createInvalidParamError(callFrame, "in", baseVal, codeBlock->instructions().begin() + vPCIndex, codeBlock); 5916 5916 VM_THROW_EXCEPTION(); 5917 5917 } … … 6078 6078 unsigned lineNumber = ARG_int3; 6079 6079 6080 return Error::create(callFrame, static_cast<ErrorType>(type), message->toString(callFrame), lineNumber, codeBlock->ownerNode ->sourceID(), codeBlock->ownerNode->sourceURL());6080 return Error::create(callFrame, static_cast<ErrorType>(type), message->toString(callFrame), lineNumber, codeBlock->ownerNode()->sourceID(), codeBlock->ownerNode()->sourceURL()); 6081 6081 } 6082 6082 … … 6102 6102 JSGlobalData* globalData = ARG_globalData; 6103 6103 6104 ASSERT(codeBlock-> ctiReturnAddressVPCMap.contains(globalData->exceptionLocation));6105 unsigned vPCIndex = codeBlock-> ctiReturnAddressVPCMap.get(globalData->exceptionLocation);6104 ASSERT(codeBlock->jitReturnAddressVPCMap().contains(globalData->exceptionLocation)); 6105 unsigned vPCIndex = codeBlock->jitReturnAddressVPCMap().get(globalData->exceptionLocation); 6106 6106 6107 6107 JSValue* exceptionValue = globalData->exception; … … 6109 6109 globalData->exception = noValue(); 6110 6110 6111 Instruction* handlerVPC = globalData->interpreter->throwException(callFrame, exceptionValue, codeBlock->instructions .begin() + vPCIndex, false);6111 Instruction* handlerVPC = globalData->interpreter->throwException(callFrame, exceptionValue, codeBlock->instructions().begin() + vPCIndex, false); 6112 6112 6113 6113 if (!handlerVPC) {
Note:
See TracChangeset
for help on using the changeset viewer.