Changeset 37433 in webkit for trunk/JavaScriptCore/VM/Machine.cpp
- Timestamp:
- Oct 8, 2008, 5:40:43 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/VM/Machine.cpp
r37430 r37433 163 163 } 164 164 165 static inline bool jsLess( ExecState* exec, JSValue* v1, JSValue* v2)165 static inline bool jsLess(CallFrame* callFrame, JSValue* v1, JSValue* v2) 166 166 { 167 167 if (JSImmediate::areBothImmediateNumbers(v1, v2)) … … 173 173 return n1 < n2; 174 174 175 Machine* machine = exec->machine();175 Machine* machine = callFrame->machine(); 176 176 if (machine->isJSString(v1) && machine->isJSString(v2)) 177 177 return static_cast<const JSString*>(v1)->value() < static_cast<const JSString*>(v2)->value(); … … 179 179 JSValue* p1; 180 180 JSValue* p2; 181 bool wasNotString1 = v1->getPrimitiveNumber( exec, n1, p1);182 bool wasNotString2 = v2->getPrimitiveNumber( exec, n2, p2);181 bool wasNotString1 = v1->getPrimitiveNumber(callFrame, n1, p1); 182 bool wasNotString2 = v2->getPrimitiveNumber(callFrame, n2, p2); 183 183 184 184 if (wasNotString1 | wasNotString2) … … 188 188 } 189 189 190 static inline bool jsLessEq( ExecState* exec, JSValue* v1, JSValue* v2)190 static inline bool jsLessEq(CallFrame* callFrame, JSValue* v1, JSValue* v2) 191 191 { 192 192 if (JSImmediate::areBothImmediateNumbers(v1, v2)) … … 198 198 return n1 <= n2; 199 199 200 Machine* machine = exec->machine();200 Machine* machine = callFrame->machine(); 201 201 if (machine->isJSString(v1) && machine->isJSString(v2)) 202 202 return !(static_cast<const JSString*>(v2)->value() < static_cast<const JSString*>(v1)->value()); … … 204 204 JSValue* p1; 205 205 JSValue* p2; 206 bool wasNotString1 = v1->getPrimitiveNumber( exec, n1, p1);207 bool wasNotString2 = v2->getPrimitiveNumber( exec, n2, p2);206 bool wasNotString1 = v1->getPrimitiveNumber(callFrame, n1, p1); 207 bool wasNotString2 = v2->getPrimitiveNumber(callFrame, n2, p2); 208 208 209 209 if (wasNotString1 | wasNotString2) … … 213 213 } 214 214 215 static NEVER_INLINE JSValue* jsAddSlowCase( ExecState* exec, JSValue* v1, JSValue* v2)215 static NEVER_INLINE JSValue* jsAddSlowCase(CallFrame* callFrame, JSValue* v1, JSValue* v2) 216 216 { 217 217 // exception for the Date exception in defaultValue() 218 JSValue* p1 = v1->toPrimitive( exec);219 JSValue* p2 = v2->toPrimitive( exec);218 JSValue* p1 = v1->toPrimitive(callFrame); 219 JSValue* p2 = v2->toPrimitive(callFrame); 220 220 221 221 if (p1->isString() || p2->isString()) { 222 RefPtr<UString::Rep> value = concatenate(p1->toString( exec).rep(), p2->toString(exec).rep());222 RefPtr<UString::Rep> value = concatenate(p1->toString(callFrame).rep(), p2->toString(callFrame).rep()); 223 223 if (!value) 224 return throwOutOfMemoryError( exec);225 return jsString( exec, value.release());226 } 227 228 return jsNumber( exec, p1->toNumber(exec) + p2->toNumber(exec));224 return throwOutOfMemoryError(callFrame); 225 return jsString(callFrame, value.release()); 226 } 227 228 return jsNumber(callFrame, p1->toNumber(callFrame) + p2->toNumber(callFrame)); 229 229 } 230 230 … … 238 238 // 4000 Add case: 3 5 239 239 240 static ALWAYS_INLINE JSValue* jsAdd( ExecState* exec, JSValue* v1, JSValue* v2)240 static ALWAYS_INLINE JSValue* jsAdd(CallFrame* callFrame, JSValue* v1, JSValue* v2) 241 241 { 242 242 double left; … … 245 245 bool rightIsNumber = fastIsNumber(v2, right); 246 246 if (rightIsNumber && fastIsNumber(v1, left)) 247 return jsNumber( exec, left + right);247 return jsNumber(callFrame, left + right); 248 248 249 249 bool leftIsString = v1->isString(); … … 251 251 RefPtr<UString::Rep> value = concatenate(static_cast<JSString*>(v1)->value().rep(), static_cast<JSString*>(v2)->value().rep()); 252 252 if (!value) 253 return throwOutOfMemoryError( exec);254 return jsString( exec, value.release());253 return throwOutOfMemoryError(callFrame); 254 return jsString(callFrame, value.release()); 255 255 } 256 256 … … 261 261 262 262 if (!value) 263 return throwOutOfMemoryError( exec);264 return jsString( exec, value.release());263 return throwOutOfMemoryError(callFrame); 264 return jsString(callFrame, value.release()); 265 265 } 266 266 267 267 // All other cases are pretty uncommon 268 return jsAddSlowCase( exec, v1, v2);269 } 270 271 static JSValue* jsTypeStringForValue( ExecState* exec, JSValue* v)268 return jsAddSlowCase(callFrame, v1, v2); 269 } 270 271 static JSValue* jsTypeStringForValue(CallFrame* callFrame, JSValue* v) 272 272 { 273 273 if (v->isUndefined()) 274 return jsNontrivialString( exec, "undefined");274 return jsNontrivialString(callFrame, "undefined"); 275 275 if (v->isBoolean()) 276 return jsNontrivialString( exec, "boolean");276 return jsNontrivialString(callFrame, "boolean"); 277 277 if (v->isNumber()) 278 return jsNontrivialString( exec, "number");278 return jsNontrivialString(callFrame, "number"); 279 279 if (v->isString()) 280 return jsNontrivialString( exec, "string");280 return jsNontrivialString(callFrame, "string"); 281 281 if (v->isObject()) { 282 282 // Return "undefined" for objects that should be treated 283 283 // as null when doing comparisons. 284 284 if (static_cast<JSObject*>(v)->structureID()->typeInfo().masqueradesAsUndefined()) 285 return jsNontrivialString( exec, "undefined");285 return jsNontrivialString(callFrame, "undefined"); 286 286 CallData callData; 287 287 if (static_cast<JSObject*>(v)->getCallData(callData) != CallTypeNone) 288 return jsNontrivialString( exec, "function");289 } 290 return jsNontrivialString( exec, "object");288 return jsNontrivialString(callFrame, "function"); 289 } 290 return jsNontrivialString(callFrame, "object"); 291 291 } 292 292 … … 319 319 } 320 320 321 NEVER_INLINE bool Machine::resolve( ExecState* exec, Instruction* vPC, Register* r, JSValue*& exceptionValue)321 NEVER_INLINE bool Machine::resolve(CallFrame* callFrame, Instruction* vPC, JSValue*& exceptionValue) 322 322 { 323 323 int dst = (vPC + 1)->u.operand; 324 324 int property = (vPC + 2)->u.operand; 325 325 326 ScopeChainNode* scopeChain = this->scopeChain(r);326 ScopeChainNode* scopeChain = callFrame->scopeChain(); 327 327 ScopeChainIterator iter = scopeChain->begin(); 328 328 ScopeChainIterator end = scopeChain->end(); 329 329 ASSERT(iter != end); 330 330 331 CodeBlock* codeBlock = this->codeBlock(r);331 CodeBlock* codeBlock = callFrame->codeBlock(); 332 332 Identifier& ident = codeBlock->identifiers[property]; 333 333 do { 334 334 JSObject* o = *iter; 335 335 PropertySlot slot(o); 336 if (o->getPropertySlot( exec, ident, slot)) {337 JSValue* result = slot.getValue( exec, ident);338 exceptionValue = exec->exception();336 if (o->getPropertySlot(callFrame, ident, slot)) { 337 JSValue* result = slot.getValue(callFrame, ident); 338 exceptionValue = callFrame->globalData().exception; 339 339 if (exceptionValue) 340 340 return false; 341 r[dst] = result;341 callFrame[dst] = result; 342 342 return true; 343 343 } 344 344 } while (++iter != end); 345 exceptionValue = createUndefinedVariableError( exec, ident, vPC, codeBlock);345 exceptionValue = createUndefinedVariableError(callFrame, ident, vPC, codeBlock); 346 346 return false; 347 347 } 348 348 349 NEVER_INLINE bool Machine::resolveSkip( ExecState* exec, Instruction* vPC, Register* r, JSValue*& exceptionValue)350 { 351 CodeBlock* codeBlock = this->codeBlock(r);349 NEVER_INLINE bool Machine::resolveSkip(CallFrame* callFrame, Instruction* vPC, JSValue*& exceptionValue) 350 { 351 CodeBlock* codeBlock = callFrame->codeBlock(); 352 352 353 353 int dst = (vPC + 1)->u.operand; … … 355 355 int skip = (vPC + 3)->u.operand + codeBlock->needsFullScopeChain; 356 356 357 ScopeChainNode* scopeChain = this->scopeChain(r);357 ScopeChainNode* scopeChain = callFrame->scopeChain(); 358 358 ScopeChainIterator iter = scopeChain->begin(); 359 359 ScopeChainIterator end = scopeChain->end(); … … 367 367 JSObject* o = *iter; 368 368 PropertySlot slot(o); 369 if (o->getPropertySlot( exec, ident, slot)) {370 JSValue* result = slot.getValue( exec, ident);371 exceptionValue = exec->exception();369 if (o->getPropertySlot(callFrame, ident, slot)) { 370 JSValue* result = slot.getValue(callFrame, ident); 371 exceptionValue = callFrame->globalData().exception; 372 372 if (exceptionValue) 373 373 return false; 374 r[dst] = result;374 callFrame[dst] = result; 375 375 return true; 376 376 } 377 377 } while (++iter != end); 378 exceptionValue = createUndefinedVariableError( exec, ident, vPC, codeBlock);378 exceptionValue = createUndefinedVariableError(callFrame, ident, vPC, codeBlock); 379 379 return false; 380 380 } 381 381 382 NEVER_INLINE bool Machine::resolveGlobal( ExecState* exec, Instruction* vPC, Register* r, JSValue*& exceptionValue)382 NEVER_INLINE bool Machine::resolveGlobal(CallFrame* callFrame, Instruction* vPC, JSValue*& exceptionValue) 383 383 { 384 384 int dst = (vPC + 1)->u.operand; … … 390 390 391 391 if (structureID == globalObject->structureID()) { 392 r[dst] = globalObject->getDirectOffset(offset);392 callFrame[dst] = globalObject->getDirectOffset(offset); 393 393 return true; 394 394 } 395 395 396 CodeBlock* codeBlock = this->codeBlock(r);396 CodeBlock* codeBlock = callFrame->codeBlock(); 397 397 Identifier& ident = codeBlock->identifiers[property]; 398 398 PropertySlot slot(globalObject); 399 if (globalObject->getPropertySlot( exec, ident, slot)) {400 JSValue* result = slot.getValue( exec, ident);399 if (globalObject->getPropertySlot(callFrame, ident, slot)) { 400 JSValue* result = slot.getValue(callFrame, ident); 401 401 if (slot.isCacheable()) { 402 402 if (vPC[4].u.structureID) … … 405 405 vPC[4] = globalObject->structureID(); 406 406 vPC[5] = slot.cachedOffset(); 407 r[dst] = result;407 callFrame[dst] = result; 408 408 return true; 409 409 } 410 410 411 exceptionValue = exec->exception();411 exceptionValue = callFrame->globalData().exception; 412 412 if (exceptionValue) 413 413 return false; 414 r[dst] = result;414 callFrame[dst] = result; 415 415 return true; 416 416 } 417 417 418 exceptionValue = createUndefinedVariableError( exec, ident, vPC, codeBlock);418 exceptionValue = createUndefinedVariableError(callFrame, ident, vPC, codeBlock); 419 419 return false; 420 420 } 421 421 422 ALWAYS_INLINE static JSValue* inlineResolveBase( ExecState* exec, Identifier& property, ScopeChainNode* scopeChain)422 ALWAYS_INLINE static JSValue* inlineResolveBase(CallFrame* callFrame, Identifier& property, ScopeChainNode* scopeChain) 423 423 { 424 424 ScopeChainIterator iter = scopeChain->begin(); … … 432 432 while (true) { 433 433 base = *iter; 434 if (next == end || base->getPropertySlot( exec, property, slot))434 if (next == end || base->getPropertySlot(callFrame, property, slot)) 435 435 return base; 436 436 … … 443 443 } 444 444 445 NEVER_INLINE void Machine::resolveBase( ExecState* exec, Instruction* vPC, Register* r)445 NEVER_INLINE void Machine::resolveBase(CallFrame* callFrame, Instruction* vPC) 446 446 { 447 447 int dst = (vPC + 1)->u.operand; 448 448 int property = (vPC + 2)->u.operand; 449 CodeBlock* codeBlock = this->codeBlock(r); 450 ScopeChainNode* scopeChain = this->scopeChain(r); 451 r[dst] = inlineResolveBase(exec, codeBlock->identifiers[property], scopeChain); 452 } 453 454 NEVER_INLINE bool Machine::resolveBaseAndProperty(ExecState* exec, Instruction* vPC, Register* r, JSValue*& exceptionValue) 449 callFrame[dst] = inlineResolveBase(callFrame, callFrame->codeBlock()->identifiers[property], callFrame->scopeChain()); 450 } 451 452 NEVER_INLINE bool Machine::resolveBaseAndProperty(CallFrame* callFrame, Instruction* vPC, JSValue*& exceptionValue) 455 453 { 456 454 int baseDst = (vPC + 1)->u.operand; … … 458 456 int property = (vPC + 3)->u.operand; 459 457 460 ScopeChainNode* scopeChain = this->scopeChain(r);458 ScopeChainNode* scopeChain = callFrame->scopeChain(); 461 459 ScopeChainIterator iter = scopeChain->begin(); 462 460 ScopeChainIterator end = scopeChain->end(); … … 466 464 ASSERT(iter != end); 467 465 468 CodeBlock* codeBlock = this->codeBlock(r);466 CodeBlock* codeBlock = callFrame->codeBlock(); 469 467 Identifier& ident = codeBlock->identifiers[property]; 470 468 JSObject* base; … … 472 470 base = *iter; 473 471 PropertySlot slot(base); 474 if (base->getPropertySlot( exec, ident, slot)) {475 JSValue* result = slot.getValue( exec, ident);476 exceptionValue = exec->exception();472 if (base->getPropertySlot(callFrame, ident, slot)) { 473 JSValue* result = slot.getValue(callFrame, ident); 474 exceptionValue = callFrame->globalData().exception; 477 475 if (exceptionValue) 478 476 return false; 479 r[propDst] = result;480 r[baseDst] = base;477 callFrame[propDst] = result; 478 callFrame[baseDst] = base; 481 479 return true; 482 480 } … … 484 482 } while (iter != end); 485 483 486 exceptionValue = createUndefinedVariableError( exec, ident, vPC, codeBlock);484 exceptionValue = createUndefinedVariableError(callFrame, ident, vPC, codeBlock); 487 485 return false; 488 486 } 489 487 490 NEVER_INLINE bool Machine::resolveBaseAndFunc( ExecState* exec, Instruction* vPC, Register* r, JSValue*& exceptionValue)488 NEVER_INLINE bool Machine::resolveBaseAndFunc(CallFrame* callFrame, Instruction* vPC, JSValue*& exceptionValue) 491 489 { 492 490 int baseDst = (vPC + 1)->u.operand; … … 494 492 int property = (vPC + 3)->u.operand; 495 493 496 ScopeChainNode* scopeChain = this->scopeChain(r);494 ScopeChainNode* scopeChain = callFrame->scopeChain(); 497 495 ScopeChainIterator iter = scopeChain->begin(); 498 496 ScopeChainIterator end = scopeChain->end(); … … 502 500 ASSERT(iter != end); 503 501 504 CodeBlock* codeBlock = this->codeBlock(r);502 CodeBlock* codeBlock = callFrame->codeBlock(); 505 503 Identifier& ident = codeBlock->identifiers[property]; 506 504 JSObject* base; … … 508 506 base = *iter; 509 507 PropertySlot slot(base); 510 if (base->getPropertySlot( exec, ident, slot)) {508 if (base->getPropertySlot(callFrame, ident, slot)) { 511 509 // ECMA 11.2.3 says that if we hit an activation the this value should be null. 512 510 // However, section 10.2.3 says that in the case where the value provided … … 516 514 // that in host objects you always get a valid object for this. 517 515 // We also handle wrapper substitution for the global object at the same time. 518 JSObject* thisObj = base->toThisObject( exec);519 JSValue* result = slot.getValue( exec, ident);520 exceptionValue = exec->exception();516 JSObject* thisObj = base->toThisObject(callFrame); 517 JSValue* result = slot.getValue(callFrame, ident); 518 exceptionValue = callFrame->globalData().exception; 521 519 if (exceptionValue) 522 520 return false; 523 521 524 r[baseDst] = thisObj;525 r[funcDst] = result;522 callFrame[baseDst] = thisObj; 523 callFrame[funcDst] = result; 526 524 return true; 527 525 } … … 529 527 } while (iter != end); 530 528 531 exceptionValue = createUndefinedVariableError( exec, ident, vPC, codeBlock);529 exceptionValue = createUndefinedVariableError(callFrame, ident, vPC, codeBlock); 532 530 return false; 533 531 } 534 532 535 ALWAYS_INLINE Register* slideRegisterWindowForCall(CodeBlock* newCodeBlock, RegisterFile* registerFile, Register* r, size_t registerOffset, int argc) 536 { 533 ALWAYS_INLINE CallFrame* Machine::slideRegisterWindowForCall(CodeBlock* newCodeBlock, RegisterFile* registerFile, CallFrame* callFrame, size_t registerOffset, int argc) 534 { 535 Register* r = callFrame->registers(); 537 536 Register* newEnd = r + registerOffset + newCodeBlock->numCalleeRegisters; 538 537 … … 566 565 } 567 566 568 return r;569 } 570 571 static NEVER_INLINE bool isNotObject( ExecState* exec, bool forInstanceOf, CodeBlock* codeBlock, const Instruction* vPC, JSValue* value, JSValue*& exceptionData)567 return CallFrame::create(r); 568 } 569 570 static NEVER_INLINE bool isNotObject(CallFrame* callFrame, bool forInstanceOf, CodeBlock* codeBlock, const Instruction* vPC, JSValue* value, JSValue*& exceptionData) 572 571 { 573 572 if (value->isObject()) 574 573 return false; 575 exceptionData = createInvalidParamError( exec, forInstanceOf ? "instanceof" : "in" , value, vPC, codeBlock);574 exceptionData = createInvalidParamError(callFrame, forInstanceOf ? "instanceof" : "in" , value, vPC, codeBlock); 576 575 return true; 577 576 } 578 577 579 NEVER_INLINE JSValue* Machine::callEval( ExecState* exec, JSObject* thisObj, ScopeChainNode* scopeChain, RegisterFile* registerFile, Register* r, int argv, int argc, JSValue*& exceptionValue)578 NEVER_INLINE JSValue* Machine::callEval(CallFrame* callFrame, JSObject* thisObj, ScopeChainNode* scopeChain, RegisterFile* registerFile, int argv, int argc, JSValue*& exceptionValue) 580 579 { 581 580 if (argc < 2) 582 581 return jsUndefined(); 583 582 584 JSValue* program = r[argv + 1].jsValue(exec);583 JSValue* program = callFrame[argv + 1].jsValue(callFrame); 585 584 586 585 if (!program->isString()) … … 589 588 Profiler** profiler = Profiler::enabledProfilerReference(); 590 589 if (*profiler) 591 (*profiler)->willExecute( exec, scopeChain->globalObject()->evalFunction());590 (*profiler)->willExecute(callFrame, scopeChain->globalObject()->evalFunction()); 592 591 593 592 UString programSource = static_cast<JSString*>(program)->value(); 594 593 595 CodeBlock* codeBlock = this->codeBlock(r);596 RefPtr<EvalNode> evalNode = codeBlock->evalCodeCache.get( exec, programSource, scopeChain, exceptionValue);594 CodeBlock* codeBlock = callFrame->codeBlock(); 595 RefPtr<EvalNode> evalNode = codeBlock->evalCodeCache.get(callFrame, programSource, scopeChain, exceptionValue); 597 596 598 597 JSValue* result = 0; 599 598 if (evalNode) 600 result = exec->globalData().machine->execute(evalNode.get(), exec, thisObj, r- registerFile->start() + argv + 1 + RegisterFile::CallFrameHeaderSize, scopeChain, &exceptionValue);599 result = callFrame->globalData().machine->execute(evalNode.get(), callFrame, thisObj, callFrame->registers() - registerFile->start() + argv + 1 + RegisterFile::CallFrameHeaderSize, scopeChain, &exceptionValue); 601 600 602 601 if (*profiler) 603 (*profiler)->didExecute( exec, scopeChain->globalObject()->evalFunction());602 (*profiler)->didExecute(callFrame, scopeChain->globalObject()->evalFunction()); 604 603 605 604 return result; … … 653 652 #ifndef NDEBUG 654 653 655 void Machine::dumpCallFrame(const RegisterFile* registerFile, const Register* r)656 { 657 JSGlobalObject* globalObject = scopeChain(r)->globalObject();658 659 CodeBlock* codeBlock = this->codeBlock(r);654 void Machine::dumpCallFrame(const RegisterFile* registerFile, CallFrame* callFrame) 655 { 656 JSGlobalObject* globalObject = callFrame->scopeChain()->globalObject(); 657 658 CodeBlock* codeBlock = callFrame->codeBlock(); 660 659 codeBlock->dump(globalObject->globalExec()); 661 660 662 dumpRegisters(registerFile, r);663 } 664 665 void Machine::dumpRegisters(const RegisterFile* registerFile, const Register* r)661 dumpRegisters(registerFile, callFrame); 662 } 663 664 void Machine::dumpRegisters(const RegisterFile* registerFile, CallFrame* callFrame) 666 665 { 667 666 printf("Register frame: \n\n"); … … 670 669 printf("----------------------------------------------------\n"); 671 670 672 CodeBlock* codeBlock = this->codeBlock(r);671 CodeBlock* codeBlock = callFrame->codeBlock(); 673 672 const Register* it; 674 673 const Register* end; … … 684 683 } 685 684 686 it = r- RegisterFile::CallFrameHeaderSize - codeBlock->numParameters;685 it = callFrame->registers() - RegisterFile::CallFrameHeaderSize - codeBlock->numParameters; 687 686 printf("[this] | %10p | %10p \n", it, (*it).v()); ++it; 688 687 end = it + max(codeBlock->numParameters - 1, 0); // - 1 to skip "this" … … 740 739 #endif 741 740 742 //#if !defined(NDEBUG) || ENABLE(SAMPLING_TOOL)743 744 741 bool Machine::isOpcode(Opcode opcode) 745 742 { … … 753 750 } 754 751 755 //#endif 756 757 NEVER_INLINE bool Machine::unwindCallFrame(ExecState*& exec, JSValue* exceptionValue, const Instruction*& vPC, CodeBlock*& codeBlock, Register*& r) 752 NEVER_INLINE bool Machine::unwindCallFrame(CallFrame*& callFrame, JSValue* exceptionValue, const Instruction*& vPC, CodeBlock*& codeBlock) 758 753 { 759 754 CodeBlock* oldCodeBlock = codeBlock; 760 ScopeChainNode* scopeChain = this->scopeChain(r);761 762 if (Debugger* debugger = exec->dynamicGlobalObject()->debugger()) {763 DebuggerCallFrame debuggerCallFrame( exec->dynamicGlobalObject(), codeBlock, scopeChain, r, exceptionValue);764 if ( r[RegisterFile::Callee].jsValue(exec))755 ScopeChainNode* scopeChain = callFrame->scopeChain(); 756 757 if (Debugger* debugger = callFrame->dynamicGlobalObject()->debugger()) { 758 DebuggerCallFrame debuggerCallFrame(callFrame, exceptionValue); 759 if (callFrame->callee()) 765 760 debugger->returnEvent(debuggerCallFrame, codeBlock->ownerNode->sourceID(), codeBlock->ownerNode->lastLine()); 766 761 else … … 769 764 770 765 if (Profiler* profiler = *Profiler::enabledProfilerReference()) { 771 if ( r[RegisterFile::Callee].jsValue(exec))772 profiler->didExecute( exec, static_cast<JSObject*>(r[RegisterFile::Callee].jsValue(exec)));766 if (callFrame->callee()) 767 profiler->didExecute(callFrame, callFrame->callee()); 773 768 else 774 profiler->didExecute( exec, codeBlock->ownerNode->sourceURL(), codeBlock->ownerNode->lineNo());769 profiler->didExecute(callFrame, codeBlock->ownerNode->sourceURL(), codeBlock->ownerNode->lineNo()); 775 770 } 776 771 … … 779 774 while (!scopeChain->object->isObject(&JSActivation::info)) 780 775 scopeChain = scopeChain->pop(); 781 JSActivation* activation = static_cast<JSActivation*>(scopeChain->object); 782 ASSERT(activation->isObject(&JSActivation::info)); 783 784 Arguments* arguments = static_cast<Arguments*>(r[RegisterFile::OptionalCalleeArguments].getJSValue()); 785 ASSERT(!arguments || arguments->isObject(&Arguments::info)); 786 787 activation->copyRegisters(arguments); 788 } else if (Arguments* arguments = static_cast<Arguments*>(r[RegisterFile::OptionalCalleeArguments].getJSValue())) { 789 ASSERT(arguments->isObject(&Arguments::info)); 776 static_cast<JSActivation*>(scopeChain->object)->copyRegisters(callFrame->optionalCalleeArguments()); 777 } else if (Arguments* arguments = callFrame->optionalCalleeArguments()) { 790 778 if (!arguments->isTornOff()) 791 779 arguments->copyRegisters(); … … 795 783 scopeChain->deref(); 796 784 797 void* returnPC = r[RegisterFile::ReturnPC].v(); 798 r = r[RegisterFile::CallerRegisters].r(); 799 exec = CallFrame::create(r); 800 if (isHostCallFrame(r)) 785 void* returnPC = callFrame->returnPC(); 786 callFrame = callFrame->callerFrame(); 787 if (callFrame->hasHostCallFrameFlag()) 801 788 return false; 802 789 803 codeBlock = this->codeBlock(r);790 codeBlock = callFrame->codeBlock(); 804 791 vPC = vPCForPC(codeBlock, returnPC); 805 792 return true; 806 793 } 807 794 808 NEVER_INLINE Instruction* Machine::throwException( ExecState* exec, JSValue*& exceptionValue, const Instruction* vPC, Register*& r, bool explicitThrow)795 NEVER_INLINE Instruction* Machine::throwException(CallFrame*& callFrame, JSValue*& exceptionValue, const Instruction* vPC, bool explicitThrow) 809 796 { 810 797 // Set up the exception object 811 798 812 CodeBlock* codeBlock = this->codeBlock(r);799 CodeBlock* codeBlock = callFrame->codeBlock(); 813 800 if (exceptionValue->isObject()) { 814 801 JSObject* exception = static_cast<JSObject*>(exceptionValue); 815 802 if (exception->isNotAnObjectErrorStub()) { 816 exception = createNotAnObjectError( exec, static_cast<JSNotAnObjectErrorStub*>(exception), vPC, codeBlock);803 exception = createNotAnObjectError(callFrame, static_cast<JSNotAnObjectErrorStub*>(exception), vPC, codeBlock); 817 804 exceptionValue = exception; 818 805 } else { 819 if (!exception->hasProperty( exec, Identifier(exec, "line")) &&820 !exception->hasProperty( exec, Identifier(exec, "sourceId")) &&821 !exception->hasProperty( exec, Identifier(exec, "sourceURL")) &&822 !exception->hasProperty( exec, Identifier(exec, expressionBeginOffsetPropertyName)) &&823 !exception->hasProperty( exec, Identifier(exec, expressionCaretOffsetPropertyName)) &&824 !exception->hasProperty( exec, Identifier(exec, expressionEndOffsetPropertyName))) {806 if (!exception->hasProperty(callFrame, Identifier(callFrame, "line")) && 807 !exception->hasProperty(callFrame, Identifier(callFrame, "sourceId")) && 808 !exception->hasProperty(callFrame, Identifier(callFrame, "sourceURL")) && 809 !exception->hasProperty(callFrame, Identifier(callFrame, expressionBeginOffsetPropertyName)) && 810 !exception->hasProperty(callFrame, Identifier(callFrame, expressionCaretOffsetPropertyName)) && 811 !exception->hasProperty(callFrame, Identifier(callFrame, expressionEndOffsetPropertyName))) { 825 812 if (explicitThrow) { 826 813 int startOffset = 0; … … 828 815 int divotPoint = 0; 829 816 int line = codeBlock->expressionRangeForVPC(vPC, divotPoint, startOffset, endOffset); 830 exception->putWithAttributes( exec, Identifier(exec, "line"), jsNumber(exec, line), ReadOnly | DontDelete);817 exception->putWithAttributes(callFrame, Identifier(callFrame, "line"), jsNumber(callFrame, line), ReadOnly | DontDelete); 831 818 832 819 // We only hit this path for error messages and throw statements, which don't have a specific failure position 833 820 // So we just give the full range of the error/throw statement. 834 exception->putWithAttributes( exec, Identifier(exec, expressionBeginOffsetPropertyName), jsNumber(exec, divotPoint - startOffset), ReadOnly | DontDelete);835 exception->putWithAttributes( exec, Identifier(exec, expressionEndOffsetPropertyName), jsNumber(exec, divotPoint + endOffset), ReadOnly | DontDelete);821 exception->putWithAttributes(callFrame, Identifier(callFrame, expressionBeginOffsetPropertyName), jsNumber(callFrame, divotPoint - startOffset), ReadOnly | DontDelete); 822 exception->putWithAttributes(callFrame, Identifier(callFrame, expressionEndOffsetPropertyName), jsNumber(callFrame, divotPoint + endOffset), ReadOnly | DontDelete); 836 823 } else 837 exception->putWithAttributes( exec, Identifier(exec, "line"), jsNumber(exec, codeBlock->lineNumberForVPC(vPC)), ReadOnly | DontDelete);838 exception->putWithAttributes( exec, Identifier(exec, "sourceId"), jsNumber(exec, codeBlock->ownerNode->sourceID()), ReadOnly | DontDelete);839 exception->putWithAttributes( exec, Identifier(exec, "sourceURL"), jsOwnedString(exec, codeBlock->ownerNode->sourceURL()), ReadOnly | DontDelete);824 exception->putWithAttributes(callFrame, Identifier(callFrame, "line"), jsNumber(callFrame, codeBlock->lineNumberForVPC(vPC)), ReadOnly | DontDelete); 825 exception->putWithAttributes(callFrame, Identifier(callFrame, "sourceId"), jsNumber(callFrame, codeBlock->ownerNode->sourceID()), ReadOnly | DontDelete); 826 exception->putWithAttributes(callFrame, Identifier(callFrame, "sourceURL"), jsOwnedString(callFrame, codeBlock->ownerNode->sourceURL()), ReadOnly | DontDelete); 840 827 } 841 828 842 829 if (exception->isWatchdogException()) { 843 while (unwindCallFrame( exec, exceptionValue, vPC, codeBlock, r)) {830 while (unwindCallFrame(callFrame, exceptionValue, vPC, codeBlock)) { 844 831 // Don't need handler checks or anything, we just want to unroll all the JS callframes possible. 845 832 } … … 849 836 } 850 837 851 if (Debugger* debugger = exec->dynamicGlobalObject()->debugger()) { 852 ScopeChainNode* scopeChain = this->scopeChain(r); 853 DebuggerCallFrame debuggerCallFrame(exec->dynamicGlobalObject(), codeBlock, scopeChain, r, exceptionValue); 838 if (Debugger* debugger = callFrame->dynamicGlobalObject()->debugger()) { 839 DebuggerCallFrame debuggerCallFrame(callFrame, exceptionValue); 854 840 debugger->exception(debuggerCallFrame, codeBlock->ownerNode->sourceID(), codeBlock->lineNumberForVPC(vPC)); 855 841 } … … 861 847 862 848 while (!codeBlock->getHandlerForVPC(vPC, handlerVPC, scopeDepth)) { 863 if (!unwindCallFrame( exec, exceptionValue, vPC, codeBlock, r))849 if (!unwindCallFrame(callFrame, exceptionValue, vPC, codeBlock)) 864 850 return 0; 865 851 } … … 867 853 // Now unwind the scope chain within the exception handler's call frame. 868 854 869 ScopeChain sc( this->scopeChain(r));855 ScopeChain sc(callFrame->scopeChain()); 870 856 int scopeDelta = depth(codeBlock, sc) - scopeDepth; 871 857 ASSERT(scopeDelta >= 0); 872 858 while (scopeDelta--) 873 859 sc.pop(); 874 r[RegisterFile::ScopeChain] = sc.node();860 callFrame->setScopeChain(sc.node()); 875 861 876 862 return handlerVPC; 877 863 } 878 864 879 class DynamicGlobalObjectScope {865 class DynamicGlobalObjectScope : Noncopyable { 880 866 public: 881 DynamicGlobalObjectScope( ExecState* exec, JSGlobalObject* dynamicGlobalObject)882 : m_ exec(exec)883 , m_saved GlobalObject(exec->globalData().dynamicGlobalObject)867 DynamicGlobalObjectScope(CallFrame* callFrame, JSGlobalObject* dynamicGlobalObject) 868 : m_dynamicGlobalObjectSlot(callFrame->globalData().dynamicGlobalObject) 869 , m_savedDynamicGlobalObject(m_dynamicGlobalObjectSlot) 884 870 { 885 exec->globalData().dynamicGlobalObject = dynamicGlobalObject;871 m_dynamicGlobalObjectSlot = dynamicGlobalObject; 886 872 } 887 873 888 874 ~DynamicGlobalObjectScope() 889 875 { 890 m_ exec->globalData().dynamicGlobalObject = m_savedGlobalObject;876 m_dynamicGlobalObjectSlot = m_savedDynamicGlobalObject; 891 877 } 892 878 893 879 private: 894 ExecState* m_exec;895 JSGlobalObject* m_saved GlobalObject;880 JSGlobalObject*& m_dynamicGlobalObjectSlot; 881 JSGlobalObject* m_savedDynamicGlobalObject; 896 882 }; 897 883 898 JSValue* Machine::execute(ProgramNode* programNode, ExecState* exec, ScopeChainNode* scopeChain, JSObject* thisObj, JSValue** exception)899 { 900 ASSERT(! exec->hadException());884 JSValue* Machine::execute(ProgramNode* programNode, CallFrame* callFrame, ScopeChainNode* scopeChain, JSObject* thisObj, JSValue** exception) 885 { 886 ASSERT(!scopeChain->globalData->exception); 901 887 902 888 if (m_reentryDepth >= MaxReentryDepth) { 903 *exception = createStackOverflowError( exec);889 *exception = createStackOverflowError(callFrame); 904 890 return jsNull(); 905 891 } … … 910 896 Register* newEnd = oldEnd + codeBlock->numParameters + RegisterFile::CallFrameHeaderSize + codeBlock->numCalleeRegisters; 911 897 if (!m_registerFile.grow(newEnd)) { 912 *exception = createStackOverflowError( exec);898 *exception = createStackOverflowError(callFrame); 913 899 return jsNull(); 914 900 } 915 901 916 DynamicGlobalObjectScope globalObjectScope( exec, scopeChain->globalObject());902 DynamicGlobalObjectScope globalObjectScope(callFrame, scopeChain->globalObject()); 917 903 918 904 JSGlobalObject* lastGlobalObject = m_registerFile.globalObject(); 919 JSGlobalObject* globalObject = exec->dynamicGlobalObject();905 JSGlobalObject* globalObject = callFrame->dynamicGlobalObject(); 920 906 globalObject->copyGlobalsTo(m_registerFile); 921 907 922 Register* r = oldEnd + codeBlock->numParameters + RegisterFile::CallFrameHeaderSize;923 r[codeBlock->thisRegister] = thisObj;924 initializeCallFrame(r, codeBlock, 0, scopeChain, makeHostCallFramePointer(0), 0, 0, 0);908 CallFrame* newCallFrame = CallFrame::create(oldEnd + codeBlock->numParameters + RegisterFile::CallFrameHeaderSize); 909 newCallFrame[codeBlock->thisRegister] = thisObj; 910 newCallFrame->init(codeBlock, 0, scopeChain, CallFrame::noCaller(), 0, 0, 0); 925 911 926 912 if (codeBlock->needsFullScopeChain) 927 scopeChain = scopeChain->copy();913 scopeChain->ref(); 928 914 929 915 Profiler** profiler = Profiler::enabledProfilerReference(); 930 916 if (*profiler) 931 (*profiler)->willExecute( exec, programNode->sourceURL(), programNode->lineNo());917 (*profiler)->willExecute(newCallFrame, programNode->sourceURL(), programNode->lineNo()); 932 918 933 919 m_reentryDepth++; 934 920 #if ENABLE(CTI) 935 921 if (!codeBlock->ctiCode) 936 CTI::compile(this, exec, codeBlock);937 JSValue* result = CTI::execute(codeBlock->ctiCode, &m_registerFile, r, scopeChain->globalData, exception);922 CTI::compile(this, newCallFrame, codeBlock); 923 JSValue* result = CTI::execute(codeBlock->ctiCode, &m_registerFile, newCallFrame, scopeChain->globalData, exception); 938 924 #else 939 JSValue* result = privateExecute(Normal, &m_registerFile, r, exception);925 JSValue* result = privateExecute(Normal, &m_registerFile, newCallFrame, exception); 940 926 #endif 941 927 m_reentryDepth--; … … 944 930 945 931 if (*profiler) 946 (*profiler)->didExecute( exec, programNode->sourceURL(), programNode->lineNo());932 (*profiler)->didExecute(callFrame, programNode->sourceURL(), programNode->lineNo()); 947 933 948 934 if (m_reentryDepth && lastGlobalObject && globalObject != lastGlobalObject) … … 954 940 } 955 941 956 JSValue* Machine::execute(FunctionBodyNode* functionBodyNode, ExecState* exec, JSFunction* function, JSObject* thisObj, const ArgList& args, ScopeChainNode* scopeChain, JSValue** exception)957 { 958 ASSERT(! exec->hadException());942 JSValue* Machine::execute(FunctionBodyNode* functionBodyNode, CallFrame* callFrame, JSFunction* function, JSObject* thisObj, const ArgList& args, ScopeChainNode* scopeChain, JSValue** exception) 943 { 944 ASSERT(!scopeChain->globalData->exception); 959 945 960 946 if (m_reentryDepth >= MaxReentryDepth) { 961 *exception = createStackOverflowError( exec);947 *exception = createStackOverflowError(callFrame); 962 948 return jsNull(); 963 949 } … … 967 953 968 954 if (!m_registerFile.grow(oldEnd + argc)) { 969 *exception = createStackOverflowError( exec);955 *exception = createStackOverflowError(callFrame); 970 956 return jsNull(); 971 957 } 972 958 973 DynamicGlobalObjectScope globalObjectScope( exec, exec->globalData().dynamicGlobalObject ? exec->globalData().dynamicGlobalObject : scopeChain->globalObject());974 975 Register* argv = oldEnd;959 DynamicGlobalObjectScope globalObjectScope(callFrame, callFrame->globalData().dynamicGlobalObject ? callFrame->globalData().dynamicGlobalObject : scopeChain->globalObject()); 960 961 CallFrame* newCallFrame = CallFrame::create(oldEnd); 976 962 size_t dst = 0; 977 argv[dst] = thisObj; 978 963 newCallFrame[0] = thisObj; 979 964 ArgList::const_iterator end = args.end(); 980 965 for (ArgList::const_iterator it = args.begin(); it != end; ++it) 981 argv[++dst] = *it;966 newCallFrame[++dst] = *it; 982 967 983 968 CodeBlock* codeBlock = &functionBodyNode->byteCode(scopeChain); 984 Register* r = slideRegisterWindowForCall(codeBlock, &m_registerFile, argv, argc + RegisterFile::CallFrameHeaderSize, argc);985 if (UNLIKELY(! r)) {986 *exception = createStackOverflowError( exec);969 newCallFrame = slideRegisterWindowForCall(codeBlock, &m_registerFile, newCallFrame, argc + RegisterFile::CallFrameHeaderSize, argc); 970 if (UNLIKELY(!newCallFrame)) { 971 *exception = createStackOverflowError(callFrame); 987 972 m_registerFile.shrink(oldEnd); 988 973 return jsNull(); 989 974 } 990 975 // a 0 codeBlock indicates a built-in caller 991 initializeCallFrame(r, codeBlock, 0, scopeChain, makeHostCallFramePointer(exec->registers()), 0, argc, function);976 newCallFrame->init(codeBlock, 0, scopeChain, callFrame->addHostCallFrameFlag(), 0, argc, function); 992 977 993 978 Profiler** profiler = Profiler::enabledProfilerReference(); 994 979 if (*profiler) 995 (*profiler)->willExecute( exec, function);980 (*profiler)->willExecute(newCallFrame, function); 996 981 997 982 m_reentryDepth++; 998 983 #if ENABLE(CTI) 999 984 if (!codeBlock->ctiCode) 1000 CTI::compile(this, exec, codeBlock);1001 JSValue* result = CTI::execute(codeBlock->ctiCode, &m_registerFile, r, scopeChain->globalData, exception);985 CTI::compile(this, newCallFrame, codeBlock); 986 JSValue* result = CTI::execute(codeBlock->ctiCode, &m_registerFile, newCallFrame, scopeChain->globalData, exception); 1002 987 #else 1003 JSValue* result = privateExecute(Normal, &m_registerFile, r, exception);988 JSValue* result = privateExecute(Normal, &m_registerFile, newCallFrame, exception); 1004 989 #endif 1005 990 m_reentryDepth--; … … 1011 996 } 1012 997 1013 JSValue* Machine::execute(EvalNode* evalNode, ExecState* exec, JSObject* thisObj, ScopeChainNode* scopeChain, JSValue** exception)1014 { 1015 return execute(evalNode, exec, thisObj, m_registerFile.size() + evalNode->byteCode(scopeChain).numParameters + RegisterFile::CallFrameHeaderSize, scopeChain, exception);1016 } 1017 1018 JSValue* Machine::execute(EvalNode* evalNode, ExecState* exec, JSObject* thisObj, int registerOffset, ScopeChainNode* scopeChain, JSValue** exception)1019 { 1020 ASSERT(! exec->hadException());998 JSValue* Machine::execute(EvalNode* evalNode, CallFrame* callFrame, JSObject* thisObj, ScopeChainNode* scopeChain, JSValue** exception) 999 { 1000 return execute(evalNode, callFrame, thisObj, m_registerFile.size() + evalNode->byteCode(scopeChain).numParameters + RegisterFile::CallFrameHeaderSize, scopeChain, exception); 1001 } 1002 1003 JSValue* Machine::execute(EvalNode* evalNode, CallFrame* callFrame, JSObject* thisObj, int registerOffset, ScopeChainNode* scopeChain, JSValue** exception) 1004 { 1005 ASSERT(!scopeChain->globalData->exception); 1021 1006 1022 1007 if (m_reentryDepth >= MaxReentryDepth) { 1023 *exception = createStackOverflowError( exec);1008 *exception = createStackOverflowError(callFrame); 1024 1009 return jsNull(); 1025 1010 } 1026 1011 1027 DynamicGlobalObjectScope globalObjectScope( exec, exec->globalData().dynamicGlobalObject ? exec->globalData().dynamicGlobalObject : scopeChain->globalObject());1012 DynamicGlobalObjectScope globalObjectScope(callFrame, callFrame->globalData().dynamicGlobalObject ? callFrame->globalData().dynamicGlobalObject : scopeChain->globalObject()); 1028 1013 1029 1014 EvalCodeBlock* codeBlock = &evalNode->byteCode(scopeChain); … … 1046 1031 for (Node::VarStack::const_iterator it = varStack.begin(); it != varStackEnd; ++it) { 1047 1032 const Identifier& ident = (*it).first; 1048 if (!variableObject->hasProperty( exec, ident)) {1033 if (!variableObject->hasProperty(callFrame, ident)) { 1049 1034 PutPropertySlot slot; 1050 variableObject->put( exec, ident, jsUndefined(), slot);1035 variableObject->put(callFrame, ident, jsUndefined(), slot); 1051 1036 } 1052 1037 } … … 1056 1041 for (Node::FunctionStack::const_iterator it = functionStack.begin(); it != functionStackEnd; ++it) { 1057 1042 PutPropertySlot slot; 1058 variableObject->put( exec, (*it)->m_ident, (*it)->makeFunction(exec, scopeChain), slot);1043 variableObject->put(callFrame, (*it)->m_ident, (*it)->makeFunction(callFrame, scopeChain), slot); 1059 1044 } 1060 1045 … … 1064 1049 Register* newEnd = m_registerFile.start() + registerOffset + codeBlock->numCalleeRegisters; 1065 1050 if (!m_registerFile.grow(newEnd)) { 1066 *exception = createStackOverflowError( exec);1051 *exception = createStackOverflowError(callFrame); 1067 1052 return jsNull(); 1068 1053 } 1069 1054 1070 Register* r = m_registerFile.start() + registerOffset;1055 CallFrame* newCallFrame = CallFrame::create(m_registerFile.start() + registerOffset); 1071 1056 1072 1057 // a 0 codeBlock indicates a built-in caller 1073 r[codeBlock->thisRegister] = thisObj;1074 initializeCallFrame(r, codeBlock, 0, scopeChain, makeHostCallFramePointer(exec->registers()), 0, 0, 0);1058 newCallFrame[codeBlock->thisRegister] = thisObj; 1059 newCallFrame->init(codeBlock, 0, scopeChain, callFrame->addHostCallFrameFlag(), 0, 0, 0); 1075 1060 1076 1061 if (codeBlock->needsFullScopeChain) 1077 scopeChain = scopeChain->copy();1062 scopeChain->ref(); 1078 1063 1079 1064 Profiler** profiler = Profiler::enabledProfilerReference(); 1080 1065 if (*profiler) 1081 (*profiler)->willExecute( exec, evalNode->sourceURL(), evalNode->lineNo());1066 (*profiler)->willExecute(newCallFrame, evalNode->sourceURL(), evalNode->lineNo()); 1082 1067 1083 1068 m_reentryDepth++; 1084 1069 #if ENABLE(CTI) 1085 1070 if (!codeBlock->ctiCode) 1086 CTI::compile(this, exec, codeBlock);1087 JSValue* result = CTI::execute(codeBlock->ctiCode, &m_registerFile, r, scopeChain->globalData, exception);1071 CTI::compile(this, newCallFrame, codeBlock); 1072 JSValue* result = CTI::execute(codeBlock->ctiCode, &m_registerFile, newCallFrame, scopeChain->globalData, exception); 1088 1073 #else 1089 JSValue* result = privateExecute(Normal, &m_registerFile, r, exception);1074 JSValue* result = privateExecute(Normal, &m_registerFile, newCallFrame, exception); 1090 1075 #endif 1091 1076 m_reentryDepth--; … … 1094 1079 1095 1080 if (*profiler) 1096 (*profiler)->didExecute( exec, evalNode->sourceURL(), evalNode->lineNo());1081 (*profiler)->didExecute(callFrame, evalNode->sourceURL(), evalNode->lineNo()); 1097 1082 1098 1083 m_registerFile.shrink(oldEnd); … … 1100 1085 } 1101 1086 1102 NEVER_INLINE void Machine::debug( ExecState* exec, Register* r, DebugHookID debugHookID, int firstLine, int lastLine)1103 { 1104 Debugger* debugger = exec->dynamicGlobalObject()->debugger();1087 NEVER_INLINE void Machine::debug(CallFrame* callFrame, DebugHookID debugHookID, int firstLine, int lastLine) 1088 { 1089 Debugger* debugger = callFrame->dynamicGlobalObject()->debugger(); 1105 1090 if (!debugger) 1106 1091 return; 1107 1092 1108 CodeBlock* codeBlock = this->codeBlock(r);1109 ScopeChainNode* scopeChain = this->scopeChain(r);1110 DebuggerCallFrame debuggerCallFrame(exec->dynamicGlobalObject(), codeBlock, scopeChain, r, 0);1111 1112 1093 switch (debugHookID) { 1113 1094 case DidEnterCallFrame: 1114 debugger->callEvent( debuggerCallFrame, codeBlock->ownerNode->sourceID(), firstLine);1095 debugger->callEvent(DebuggerCallFrame(callFrame, 0), callFrame->codeBlock()->ownerNode->sourceID(), firstLine); 1115 1096 return; 1116 1097 case WillLeaveCallFrame: 1117 debugger->returnEvent( debuggerCallFrame, codeBlock->ownerNode->sourceID(), lastLine);1098 debugger->returnEvent(DebuggerCallFrame(callFrame, 0), callFrame->codeBlock()->ownerNode->sourceID(), lastLine); 1118 1099 return; 1119 1100 case WillExecuteStatement: 1120 debugger->atStatement( debuggerCallFrame, codeBlock->ownerNode->sourceID(), firstLine);1101 debugger->atStatement(DebuggerCallFrame(callFrame, 0), callFrame->codeBlock()->ownerNode->sourceID(), firstLine); 1121 1102 return; 1122 1103 case WillExecuteProgram: 1123 debugger->willExecuteProgram( debuggerCallFrame, codeBlock->ownerNode->sourceID(), firstLine);1104 debugger->willExecuteProgram(DebuggerCallFrame(callFrame, 0), callFrame->codeBlock()->ownerNode->sourceID(), firstLine); 1124 1105 return; 1125 1106 case DidExecuteProgram: 1126 debugger->didExecuteProgram( debuggerCallFrame, codeBlock->ownerNode->sourceID(), lastLine);1107 debugger->didExecuteProgram(DebuggerCallFrame(callFrame, 0), callFrame->codeBlock()->ownerNode->sourceID(), lastLine); 1127 1108 return; 1128 1109 case DidReachBreakpoint: 1129 debugger->didReachBreakpoint( debuggerCallFrame, codeBlock->ownerNode->sourceID(), lastLine);1110 debugger->didReachBreakpoint(DebuggerCallFrame(callFrame, 0), callFrame->codeBlock()->ownerNode->sourceID(), lastLine); 1130 1111 return; 1131 1112 } … … 1217 1198 } 1218 1199 1219 NEVER_INLINE ScopeChainNode* Machine::createExceptionScope( ExecState* exec, const Instruction* vPC, Register* r)1200 NEVER_INLINE ScopeChainNode* Machine::createExceptionScope(CallFrame* callFrame, const Instruction* vPC) 1220 1201 { 1221 1202 int dst = (++vPC)->u.operand; 1222 CodeBlock* codeBlock = this->codeBlock(r);1203 CodeBlock* codeBlock = callFrame->codeBlock(); 1223 1204 Identifier& property = codeBlock->identifiers[(++vPC)->u.operand]; 1224 JSValue* value = r[(++vPC)->u.operand].jsValue(exec);1225 JSObject* scope = new ( exec) JSStaticScopeObject(exec, property, value, DontDelete);1226 r[dst] = scope;1227 1228 return scopeChain(r)->push(scope);1229 } 1230 1231 static StructureIDChain* cachePrototypeChain( ExecState* exec, StructureID* structureID)1232 { 1233 JSValue* prototype = structureID->prototypeForLookup( exec);1205 JSValue* value = callFrame[(++vPC)->u.operand].jsValue(callFrame); 1206 JSObject* scope = new (callFrame) JSStaticScopeObject(callFrame, property, value, DontDelete); 1207 callFrame[dst] = scope; 1208 1209 return callFrame->scopeChain()->push(scope); 1210 } 1211 1212 static StructureIDChain* cachePrototypeChain(CallFrame* callFrame, StructureID* structureID) 1213 { 1214 JSValue* prototype = structureID->prototypeForLookup(callFrame); 1234 1215 if (JSImmediate::isImmediate(prototype)) 1235 1216 return 0; … … 1239 1220 } 1240 1221 1241 NEVER_INLINE void Machine::tryCachePutByID( ExecState* exec, CodeBlock* codeBlock, Instruction* vPC, JSValue* baseValue, const PutPropertySlot& slot)1222 NEVER_INLINE void Machine::tryCachePutByID(CallFrame* callFrame, CodeBlock* codeBlock, Instruction* vPC, JSValue* baseValue, const PutPropertySlot& slot) 1242 1223 { 1243 1224 // Recursive invocation may already have specialized this instruction. … … 1291 1272 StructureIDChain* chain = structureID->cachedPrototypeChain(); 1292 1273 if (!chain) { 1293 chain = cachePrototypeChain( exec, structureID);1274 chain = cachePrototypeChain(callFrame, structureID); 1294 1275 if (!chain) { 1295 1276 // This happens if someone has manually inserted null into the prototype chain … … 1316 1297 } 1317 1298 1318 NEVER_INLINE void Machine::tryCacheGetByID( ExecState* exec, CodeBlock* codeBlock, Instruction* vPC, JSValue* baseValue, const Identifier& propertyName, const PropertySlot& slot)1299 NEVER_INLINE void Machine::tryCacheGetByID(CallFrame* callFrame, CodeBlock* codeBlock, Instruction* vPC, JSValue* baseValue, const Identifier& propertyName, const PropertySlot& slot) 1319 1300 { 1320 1301 // Recursive invocation may already have specialized this instruction. … … 1328 1309 } 1329 1310 1330 if (isJSArray(baseValue) && propertyName == exec->propertyNames().length) {1311 if (isJSArray(baseValue) && propertyName == callFrame->propertyNames().length) { 1331 1312 vPC[0] = getOpcode(op_get_array_length); 1332 1313 return; 1333 1314 } 1334 1315 1335 if (isJSString(baseValue) && propertyName == exec->propertyNames().length) {1316 if (isJSString(baseValue) && propertyName == callFrame->propertyNames().length) { 1336 1317 vPC[0] = getOpcode(op_get_string_length); 1337 1318 return; … … 1375 1356 } 1376 1357 1377 if (slot.slotBase() == structureID->prototypeForLookup( exec)) {1358 if (slot.slotBase() == structureID->prototypeForLookup(callFrame)) { 1378 1359 ASSERT(slot.slotBase()->isObject()); 1379 1360 … … 1399 1380 JSObject* o = static_cast<JSObject*>(baseValue); 1400 1381 while (slot.slotBase() != o) { 1401 JSValue* v = o->structureID()->prototypeForLookup( exec);1382 JSValue* v = o->structureID()->prototypeForLookup(callFrame); 1402 1383 1403 1384 // If we didn't find base in baseValue's prototype chain, then baseValue … … 1423 1404 StructureIDChain* chain = structureID->cachedPrototypeChain(); 1424 1405 if (!chain) 1425 chain = cachePrototypeChain( exec, structureID);1406 chain = cachePrototypeChain(callFrame, structureID); 1426 1407 ASSERT(chain); 1427 1408 … … 1441 1422 } 1442 1423 1443 JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile, Register* r, JSValue** exception)1424 JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile, CallFrame* callFrame, JSValue** exception) 1444 1425 { 1445 1426 // One-time initialization of our address tables. We have to put this code … … 1466 1447 #endif 1467 1448 1468 #define exec CallFrame::create(r) 1469 1470 JSGlobalData* globalData = &exec->globalData(); 1449 JSGlobalData* globalData = &callFrame->globalData(); 1471 1450 JSValue* exceptionValue = 0; 1472 1451 Instruction* handlerVPC = 0; 1473 1452 1474 Instruction* vPC = this->codeBlock(r)->instructions.begin();1453 Instruction* vPC = callFrame->codeBlock()->instructions.begin(); 1475 1454 Profiler** enabledProfilerReference = Profiler::enabledProfilerReference(); 1476 1455 unsigned tickCount = m_ticksUntilNextTimeoutCheck + 1; … … 1490 1469 #define CHECK_FOR_TIMEOUT() \ 1491 1470 if (!--tickCount) { \ 1492 if ((exceptionValue = checkTimeout( exec->dynamicGlobalObject()))) \1471 if ((exceptionValue = checkTimeout(callFrame->dynamicGlobalObject()))) \ 1493 1472 goto vm_throw; \ 1494 1473 tickCount = m_ticksUntilNextTimeoutCheck; \ … … 1496 1475 1497 1476 #if HAVE(COMPUTED_GOTO) 1498 #define NEXT_OPCODE MACHINE_SAMPLING_sample( this->codeBlock(r), vPC); goto *vPC->u.opcode1477 #define NEXT_OPCODE MACHINE_SAMPLING_sample(callFrame->codeBlock(), vPC); goto *vPC->u.opcode 1499 1478 #if DUMP_OPCODE_STATS 1500 1479 #define BEGIN_OPCODE(opcode) opcode: OpcodeStats::recordInstruction(opcode); … … 1504 1483 NEXT_OPCODE; 1505 1484 #else 1506 #define NEXT_OPCODE MACHINE_SAMPLING_sample( this->codeBlock(r), vPC); goto interpreterLoopStart1485 #define NEXT_OPCODE MACHINE_SAMPLING_sample(callFrame->codeBlock(), vPC); goto interpreterLoopStart 1507 1486 #if DUMP_OPCODE_STATS 1508 1487 #define BEGIN_OPCODE(opcode) case opcode: OpcodeStats::recordInstruction(opcode); … … 1522 1501 */ 1523 1502 int dst = (++vPC)->u.operand; 1524 r[dst] = constructEmptyObject(exec);1503 callFrame[dst] = constructEmptyObject(callFrame); 1525 1504 1526 1505 ++vPC; … … 1538 1517 int firstArg = (++vPC)->u.operand; 1539 1518 int argCount = (++vPC)->u.operand; 1540 ArgList args( r+ firstArg, argCount);1541 r[dst] = constructArray(exec, args);1519 ArgList args(callFrame->registers() + firstArg, argCount); 1520 callFrame[dst] = constructArray(callFrame, args); 1542 1521 1543 1522 ++vPC; … … 1553 1532 int dst = (++vPC)->u.operand; 1554 1533 int regExp = (++vPC)->u.operand; 1555 r[dst] = new (globalData) RegExpObject(scopeChain(r)->globalObject()->regExpStructure(), codeBlock(r)->regexps[regExp]);1534 callFrame[dst] = new (globalData) RegExpObject(callFrame->scopeChain()->globalObject()->regExpStructure(), callFrame->codeBlock()->regexps[regExp]); 1556 1535 1557 1536 ++vPC; … … 1565 1544 int dst = (++vPC)->u.operand; 1566 1545 int src = (++vPC)->u.operand; 1567 r[dst] = r[src];1546 callFrame[dst] = callFrame[src]; 1568 1547 1569 1548 ++vPC; … … 1578 1557 */ 1579 1558 int dst = (++vPC)->u.operand; 1580 JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec);1581 JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec);1559 JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame); 1560 JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame); 1582 1561 if (JSImmediate::areBothImmediateNumbers(src1, src2)) 1583 r[dst] = jsBoolean(reinterpret_cast<intptr_t>(src1) == reinterpret_cast<intptr_t>(src2));1562 callFrame[dst] = jsBoolean(reinterpret_cast<intptr_t>(src1) == reinterpret_cast<intptr_t>(src2)); 1584 1563 else { 1585 JSValue* result = jsBoolean(equalSlowCase( exec, src1, src2));1564 JSValue* result = jsBoolean(equalSlowCase(callFrame, src1, src2)); 1586 1565 VM_CHECK_EXCEPTION(); 1587 r[dst] = result;1566 callFrame[dst] = result; 1588 1567 } 1589 1568 … … 1598 1577 */ 1599 1578 int dst = (++vPC)->u.operand; 1600 JSValue* src = r[(++vPC)->u.operand].jsValue(exec);1579 JSValue* src = callFrame[(++vPC)->u.operand].jsValue(callFrame); 1601 1580 1602 1581 if (src->isUndefinedOrNull()) { 1603 r[dst] = jsBoolean(true);1582 callFrame[dst] = jsBoolean(true); 1604 1583 ++vPC; 1605 1584 NEXT_OPCODE; 1606 1585 } 1607 1586 1608 r[dst] = jsBoolean(!JSImmediate::isImmediate(src) && src->asCell()->structureID()->typeInfo().masqueradesAsUndefined());1587 callFrame[dst] = jsBoolean(!JSImmediate::isImmediate(src) && src->asCell()->structureID()->typeInfo().masqueradesAsUndefined()); 1609 1588 ++vPC; 1610 1589 NEXT_OPCODE; … … 1618 1597 */ 1619 1598 int dst = (++vPC)->u.operand; 1620 JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec);1621 JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec);1599 JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame); 1600 JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame); 1622 1601 if (JSImmediate::areBothImmediateNumbers(src1, src2)) 1623 r[dst] = jsBoolean(src1 != src2);1602 callFrame[dst] = jsBoolean(src1 != src2); 1624 1603 else { 1625 JSValue* result = jsBoolean(!equalSlowCase( exec, src1, src2));1604 JSValue* result = jsBoolean(!equalSlowCase(callFrame, src1, src2)); 1626 1605 VM_CHECK_EXCEPTION(); 1627 r[dst] = result;1606 callFrame[dst] = result; 1628 1607 } 1629 1608 … … 1638 1617 */ 1639 1618 int dst = (++vPC)->u.operand; 1640 JSValue* src = r[(++vPC)->u.operand].jsValue(exec);1619 JSValue* src = callFrame[(++vPC)->u.operand].jsValue(callFrame); 1641 1620 1642 1621 if (src->isUndefinedOrNull()) { 1643 r[dst] = jsBoolean(false);1622 callFrame[dst] = jsBoolean(false); 1644 1623 ++vPC; 1645 1624 NEXT_OPCODE; 1646 1625 } 1647 1626 1648 r[dst] = jsBoolean(JSImmediate::isImmediate(src) || !static_cast<JSCell*>(src)->asCell()->structureID()->typeInfo().masqueradesAsUndefined());1627 callFrame[dst] = jsBoolean(JSImmediate::isImmediate(src) || !static_cast<JSCell*>(src)->asCell()->structureID()->typeInfo().masqueradesAsUndefined()); 1649 1628 ++vPC; 1650 1629 NEXT_OPCODE; … … 1658 1637 */ 1659 1638 int dst = (++vPC)->u.operand; 1660 JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec);1661 JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec);1639 JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame); 1640 JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame); 1662 1641 if (JSImmediate::areBothImmediate(src1, src2)) 1663 r[dst] = jsBoolean(reinterpret_cast<intptr_t>(src1) == reinterpret_cast<intptr_t>(src2));1642 callFrame[dst] = jsBoolean(reinterpret_cast<intptr_t>(src1) == reinterpret_cast<intptr_t>(src2)); 1664 1643 else if (JSImmediate::isEitherImmediate(src1, src2) & (src1 != JSImmediate::zeroImmediate()) & (src2 != JSImmediate::zeroImmediate())) 1665 r[dst] = jsBoolean(false);1644 callFrame[dst] = jsBoolean(false); 1666 1645 else 1667 r[dst] = jsBoolean(strictEqualSlowCase(src1, src2));1646 callFrame[dst] = jsBoolean(strictEqualSlowCase(src1, src2)); 1668 1647 1669 1648 ++vPC; … … 1678 1657 */ 1679 1658 int dst = (++vPC)->u.operand; 1680 JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec);1681 JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec);1659 JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame); 1660 JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame); 1682 1661 1683 1662 if (JSImmediate::areBothImmediate(src1, src2)) 1684 r[dst] = jsBoolean(reinterpret_cast<intptr_t>(src1) != reinterpret_cast<intptr_t>(src2));1663 callFrame[dst] = jsBoolean(reinterpret_cast<intptr_t>(src1) != reinterpret_cast<intptr_t>(src2)); 1685 1664 else if (JSImmediate::isEitherImmediate(src1, src2) & (src1 != JSImmediate::zeroImmediate()) & (src2 != JSImmediate::zeroImmediate())) 1686 r[dst] = jsBoolean(true);1665 callFrame[dst] = jsBoolean(true); 1687 1666 else 1688 r[dst] = jsBoolean(!strictEqualSlowCase(src1, src2));1667 callFrame[dst] = jsBoolean(!strictEqualSlowCase(src1, src2)); 1689 1668 1690 1669 ++vPC; … … 1699 1678 */ 1700 1679 int dst = (++vPC)->u.operand; 1701 JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec);1702 JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec);1703 JSValue* result = jsBoolean(jsLess( exec, src1, src2));1680 JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame); 1681 JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame); 1682 JSValue* result = jsBoolean(jsLess(callFrame, src1, src2)); 1704 1683 VM_CHECK_EXCEPTION(); 1705 r[dst] = result;1684 callFrame[dst] = result; 1706 1685 1707 1686 ++vPC; … … 1716 1695 */ 1717 1696 int dst = (++vPC)->u.operand; 1718 JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec);1719 JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec);1720 JSValue* result = jsBoolean(jsLessEq( exec, src1, src2));1697 JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame); 1698 JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame); 1699 JSValue* result = jsBoolean(jsLessEq(callFrame, src1, src2)); 1721 1700 VM_CHECK_EXCEPTION(); 1722 r[dst] = result;1701 callFrame[dst] = result; 1723 1702 1724 1703 ++vPC; … … 1732 1711 */ 1733 1712 int srcDst = (++vPC)->u.operand; 1734 JSValue* v = r[srcDst].jsValue(exec);1713 JSValue* v = callFrame[srcDst].jsValue(callFrame); 1735 1714 if (JSImmediate::canDoFastAdditiveOperations(v)) 1736 r[srcDst] = JSImmediate::incImmediateNumber(v);1715 callFrame[srcDst] = JSImmediate::incImmediateNumber(v); 1737 1716 else { 1738 JSValue* result = jsNumber( exec, v->toNumber(exec) + 1);1717 JSValue* result = jsNumber(callFrame, v->toNumber(callFrame) + 1); 1739 1718 VM_CHECK_EXCEPTION(); 1740 r[srcDst] = result;1719 callFrame[srcDst] = result; 1741 1720 } 1742 1721 … … 1751 1730 */ 1752 1731 int srcDst = (++vPC)->u.operand; 1753 JSValue* v = r[srcDst].jsValue(exec);1732 JSValue* v = callFrame[srcDst].jsValue(callFrame); 1754 1733 if (JSImmediate::canDoFastAdditiveOperations(v)) 1755 r[srcDst] = JSImmediate::decImmediateNumber(v);1734 callFrame[srcDst] = JSImmediate::decImmediateNumber(v); 1756 1735 else { 1757 JSValue* result = jsNumber( exec, v->toNumber(exec) - 1);1736 JSValue* result = jsNumber(callFrame, v->toNumber(callFrame) - 1); 1758 1737 VM_CHECK_EXCEPTION(); 1759 r[srcDst] = result;1738 callFrame[srcDst] = result; 1760 1739 } 1761 1740 … … 1772 1751 int dst = (++vPC)->u.operand; 1773 1752 int srcDst = (++vPC)->u.operand; 1774 JSValue* v = r[srcDst].jsValue(exec);1753 JSValue* v = callFrame[srcDst].jsValue(callFrame); 1775 1754 if (JSImmediate::canDoFastAdditiveOperations(v)) { 1776 r[dst] = v;1777 r[srcDst] = JSImmediate::incImmediateNumber(v);1755 callFrame[dst] = v; 1756 callFrame[srcDst] = JSImmediate::incImmediateNumber(v); 1778 1757 } else { 1779 JSValue* number = r[srcDst].jsValue(exec)->toJSNumber(exec);1758 JSValue* number = callFrame[srcDst].jsValue(callFrame)->toJSNumber(callFrame); 1780 1759 VM_CHECK_EXCEPTION(); 1781 r[dst] = number;1782 r[srcDst] = jsNumber(exec, number->uncheckedGetNumber() + 1);1760 callFrame[dst] = number; 1761 callFrame[srcDst] = jsNumber(callFrame, number->uncheckedGetNumber() + 1); 1783 1762 } 1784 1763 … … 1795 1774 int dst = (++vPC)->u.operand; 1796 1775 int srcDst = (++vPC)->u.operand; 1797 JSValue* v = r[srcDst].jsValue(exec);1776 JSValue* v = callFrame[srcDst].jsValue(callFrame); 1798 1777 if (JSImmediate::canDoFastAdditiveOperations(v)) { 1799 r[dst] = v;1800 r[srcDst] = JSImmediate::decImmediateNumber(v);1778 callFrame[dst] = v; 1779 callFrame[srcDst] = JSImmediate::decImmediateNumber(v); 1801 1780 } else { 1802 JSValue* number = r[srcDst].jsValue(exec)->toJSNumber(exec);1781 JSValue* number = callFrame[srcDst].jsValue(callFrame)->toJSNumber(callFrame); 1803 1782 VM_CHECK_EXCEPTION(); 1804 r[dst] = number;1805 r[srcDst] = jsNumber(exec, number->uncheckedGetNumber() - 1);1783 callFrame[dst] = number; 1784 callFrame[srcDst] = jsNumber(callFrame, number->uncheckedGetNumber() - 1); 1806 1785 } 1807 1786 … … 1818 1797 int src = (++vPC)->u.operand; 1819 1798 1820 JSValue* srcVal = r[src].jsValue(exec);1799 JSValue* srcVal = callFrame[src].jsValue(callFrame); 1821 1800 1822 1801 if (LIKELY(srcVal->isNumber())) 1823 r[dst] = r[src];1802 callFrame[dst] = callFrame[src]; 1824 1803 else { 1825 JSValue* result = srcVal->toJSNumber( exec);1804 JSValue* result = srcVal->toJSNumber(callFrame); 1826 1805 VM_CHECK_EXCEPTION(); 1827 r[dst] = result;1806 callFrame[dst] = result; 1828 1807 } 1829 1808 … … 1838 1817 */ 1839 1818 int dst = (++vPC)->u.operand; 1840 JSValue* src = r[(++vPC)->u.operand].jsValue(exec);1819 JSValue* src = callFrame[(++vPC)->u.operand].jsValue(callFrame); 1841 1820 double v; 1842 1821 if (fastIsNumber(src, v)) 1843 r[dst] = jsNumber(exec, -v);1822 callFrame[dst] = jsNumber(callFrame, -v); 1844 1823 else { 1845 JSValue* result = jsNumber( exec, -src->toNumber(exec));1824 JSValue* result = jsNumber(callFrame, -src->toNumber(callFrame)); 1846 1825 VM_CHECK_EXCEPTION(); 1847 r[dst] = result;1826 callFrame[dst] = result; 1848 1827 } 1849 1828 … … 1859 1838 */ 1860 1839 int dst = (++vPC)->u.operand; 1861 JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec);1862 JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec);1840 JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame); 1841 JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame); 1863 1842 if (JSImmediate::canDoFastAdditiveOperations(src1) && JSImmediate::canDoFastAdditiveOperations(src2)) 1864 r[dst] = JSImmediate::addImmediateNumbers(src1, src2);1843 callFrame[dst] = JSImmediate::addImmediateNumbers(src1, src2); 1865 1844 else { 1866 JSValue* result = jsAdd( exec, src1, src2);1845 JSValue* result = jsAdd(callFrame, src1, src2); 1867 1846 VM_CHECK_EXCEPTION(); 1868 r[dst] = result;1847 callFrame[dst] = result; 1869 1848 } 1870 1849 vPC += 2; … … 1878 1857 */ 1879 1858 int dst = (++vPC)->u.operand; 1880 JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec);1881 JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec);1859 JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame); 1860 JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame); 1882 1861 double left; 1883 1862 double right; 1884 1863 if (fastIsNumber(src1, left) && fastIsNumber(src2, right)) 1885 r[dst] = jsNumber(exec, left * right);1864 callFrame[dst] = jsNumber(callFrame, left * right); 1886 1865 else { 1887 JSValue* result = jsNumber( exec, src1->toNumber(exec) * src2->toNumber(exec));1866 JSValue* result = jsNumber(callFrame, src1->toNumber(callFrame) * src2->toNumber(callFrame)); 1888 1867 VM_CHECK_EXCEPTION(); 1889 r[dst] = result;1868 callFrame[dst] = result; 1890 1869 } 1891 1870 … … 1901 1880 */ 1902 1881 int dst = (++vPC)->u.operand; 1903 JSValue* dividend = r[(++vPC)->u.operand].jsValue(exec);1904 JSValue* divisor = r[(++vPC)->u.operand].jsValue(exec);1882 JSValue* dividend = callFrame[(++vPC)->u.operand].jsValue(callFrame); 1883 JSValue* divisor = callFrame[(++vPC)->u.operand].jsValue(callFrame); 1905 1884 double left; 1906 1885 double right; 1907 1886 if (fastIsNumber(dividend, left) && fastIsNumber(divisor, right)) 1908 r[dst] = jsNumber(exec, left / right);1887 callFrame[dst] = jsNumber(callFrame, left / right); 1909 1888 else { 1910 JSValue* result = jsNumber( exec, dividend->toNumber(exec) / divisor->toNumber(exec));1889 JSValue* result = jsNumber(callFrame, dividend->toNumber(callFrame) / divisor->toNumber(callFrame)); 1911 1890 VM_CHECK_EXCEPTION(); 1912 r[dst] = result;1891 callFrame[dst] = result; 1913 1892 } 1914 1893 ++vPC; … … 1926 1905 int divisor = (++vPC)->u.operand; 1927 1906 1928 JSValue* dividendValue = r[dividend].jsValue(exec);1929 JSValue* divisorValue = r[divisor].jsValue(exec);1907 JSValue* dividendValue = callFrame[dividend].jsValue(callFrame); 1908 JSValue* divisorValue = callFrame[divisor].jsValue(callFrame); 1930 1909 1931 1910 if (JSImmediate::areBothImmediateNumbers(dividendValue, divisorValue) && divisorValue != JSImmediate::from(0)) { 1932 r[dst] = JSImmediate::from(JSImmediate::getTruncatedInt32(dividendValue) % JSImmediate::getTruncatedInt32(divisorValue));1911 callFrame[dst] = JSImmediate::from(JSImmediate::getTruncatedInt32(dividendValue) % JSImmediate::getTruncatedInt32(divisorValue)); 1933 1912 ++vPC; 1934 1913 NEXT_OPCODE; 1935 1914 } 1936 1915 1937 double d = dividendValue->toNumber( exec);1938 JSValue* result = jsNumber( exec, fmod(d, divisorValue->toNumber(exec)));1916 double d = dividendValue->toNumber(callFrame); 1917 JSValue* result = jsNumber(callFrame, fmod(d, divisorValue->toNumber(callFrame))); 1939 1918 VM_CHECK_EXCEPTION(); 1940 r[dst] = result;1919 callFrame[dst] = result; 1941 1920 ++vPC; 1942 1921 NEXT_OPCODE; … … 1950 1929 */ 1951 1930 int dst = (++vPC)->u.operand; 1952 JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec);1953 JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec);1931 JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame); 1932 JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame); 1954 1933 double left; 1955 1934 double right; 1956 1935 if (JSImmediate::canDoFastAdditiveOperations(src1) && JSImmediate::canDoFastAdditiveOperations(src2)) 1957 r[dst] = JSImmediate::subImmediateNumbers(src1, src2);1936 callFrame[dst] = JSImmediate::subImmediateNumbers(src1, src2); 1958 1937 else if (fastIsNumber(src1, left) && fastIsNumber(src2, right)) 1959 r[dst] = jsNumber(exec, left - right);1938 callFrame[dst] = jsNumber(callFrame, left - right); 1960 1939 else { 1961 JSValue* result = jsNumber( exec, src1->toNumber(exec) - src2->toNumber(exec));1940 JSValue* result = jsNumber(callFrame, src1->toNumber(callFrame) - src2->toNumber(callFrame)); 1962 1941 VM_CHECK_EXCEPTION(); 1963 r[dst] = result;1942 callFrame[dst] = result; 1964 1943 } 1965 1944 vPC += 2; … … 1974 1953 */ 1975 1954 int dst = (++vPC)->u.operand; 1976 JSValue* val = r[(++vPC)->u.operand].jsValue(exec);1977 JSValue* shift = r[(++vPC)->u.operand].jsValue(exec);1955 JSValue* val = callFrame[(++vPC)->u.operand].jsValue(callFrame); 1956 JSValue* shift = callFrame[(++vPC)->u.operand].jsValue(callFrame); 1978 1957 int32_t left; 1979 1958 uint32_t right; 1980 1959 if (JSImmediate::areBothImmediateNumbers(val, shift)) 1981 r[dst] = jsNumber(exec, JSImmediate::getTruncatedInt32(val) << (JSImmediate::getTruncatedUInt32(shift) & 0x1f));1960 callFrame[dst] = jsNumber(callFrame, JSImmediate::getTruncatedInt32(val) << (JSImmediate::getTruncatedUInt32(shift) & 0x1f)); 1982 1961 else if (fastToInt32(val, left) && fastToUInt32(shift, right)) 1983 r[dst] = jsNumber(exec, left << (right & 0x1f));1962 callFrame[dst] = jsNumber(callFrame, left << (right & 0x1f)); 1984 1963 else { 1985 JSValue* result = jsNumber( exec, (val->toInt32(exec)) << (shift->toUInt32(exec) & 0x1f));1964 JSValue* result = jsNumber(callFrame, (val->toInt32(callFrame)) << (shift->toUInt32(callFrame) & 0x1f)); 1986 1965 VM_CHECK_EXCEPTION(); 1987 r[dst] = result;1966 callFrame[dst] = result; 1988 1967 } 1989 1968 … … 1999 1978 */ 2000 1979 int dst = (++vPC)->u.operand; 2001 JSValue* val = r[(++vPC)->u.operand].jsValue(exec);2002 JSValue* shift = r[(++vPC)->u.operand].jsValue(exec);1980 JSValue* val = callFrame[(++vPC)->u.operand].jsValue(callFrame); 1981 JSValue* shift = callFrame[(++vPC)->u.operand].jsValue(callFrame); 2003 1982 int32_t left; 2004 1983 uint32_t right; 2005 1984 if (JSImmediate::areBothImmediateNumbers(val, shift)) 2006 r[dst] = JSImmediate::rightShiftImmediateNumbers(val, shift);1985 callFrame[dst] = JSImmediate::rightShiftImmediateNumbers(val, shift); 2007 1986 else if (fastToInt32(val, left) && fastToUInt32(shift, right)) 2008 r[dst] = jsNumber(exec, left >> (right & 0x1f));1987 callFrame[dst] = jsNumber(callFrame, left >> (right & 0x1f)); 2009 1988 else { 2010 JSValue* result = jsNumber( exec, (val->toInt32(exec)) >> (shift->toUInt32(exec) & 0x1f));1989 JSValue* result = jsNumber(callFrame, (val->toInt32(callFrame)) >> (shift->toUInt32(callFrame) & 0x1f)); 2011 1990 VM_CHECK_EXCEPTION(); 2012 r[dst] = result;1991 callFrame[dst] = result; 2013 1992 } 2014 1993 … … 2024 2003 */ 2025 2004 int dst = (++vPC)->u.operand; 2026 JSValue* val = r[(++vPC)->u.operand].jsValue(exec);2027 JSValue* shift = r[(++vPC)->u.operand].jsValue(exec);2005 JSValue* val = callFrame[(++vPC)->u.operand].jsValue(callFrame); 2006 JSValue* shift = callFrame[(++vPC)->u.operand].jsValue(callFrame); 2028 2007 if (JSImmediate::areBothImmediateNumbers(val, shift) && !JSImmediate::isNegative(val)) 2029 r[dst] = JSImmediate::rightShiftImmediateNumbers(val, shift);2008 callFrame[dst] = JSImmediate::rightShiftImmediateNumbers(val, shift); 2030 2009 else { 2031 JSValue* result = jsNumber( exec, (val->toUInt32(exec)) >> (shift->toUInt32(exec) & 0x1f));2010 JSValue* result = jsNumber(callFrame, (val->toUInt32(callFrame)) >> (shift->toUInt32(callFrame) & 0x1f)); 2032 2011 VM_CHECK_EXCEPTION(); 2033 r[dst] = result;2012 callFrame[dst] = result; 2034 2013 } 2035 2014 … … 2045 2024 */ 2046 2025 int dst = (++vPC)->u.operand; 2047 JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec);2048 JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec);2026 JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame); 2027 JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame); 2049 2028 int32_t left; 2050 2029 int32_t right; 2051 2030 if (JSImmediate::areBothImmediateNumbers(src1, src2)) 2052 r[dst] = JSImmediate::andImmediateNumbers(src1, src2);2031 callFrame[dst] = JSImmediate::andImmediateNumbers(src1, src2); 2053 2032 else if (fastToInt32(src1, left) && fastToInt32(src2, right)) 2054 r[dst] = jsNumber(exec, left & right);2033 callFrame[dst] = jsNumber(callFrame, left & right); 2055 2034 else { 2056 JSValue* result = jsNumber( exec, src1->toInt32(exec) & src2->toInt32(exec));2035 JSValue* result = jsNumber(callFrame, src1->toInt32(callFrame) & src2->toInt32(callFrame)); 2057 2036 VM_CHECK_EXCEPTION(); 2058 r[dst] = result;2037 callFrame[dst] = result; 2059 2038 } 2060 2039 … … 2070 2049 */ 2071 2050 int dst = (++vPC)->u.operand; 2072 JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec);2073 JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec);2051 JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame); 2052 JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame); 2074 2053 int32_t left; 2075 2054 int32_t right; 2076 2055 if (JSImmediate::areBothImmediateNumbers(src1, src2)) 2077 r[dst] = JSImmediate::xorImmediateNumbers(src1, src2);2056 callFrame[dst] = JSImmediate::xorImmediateNumbers(src1, src2); 2078 2057 else if (fastToInt32(src1, left) && fastToInt32(src2, right)) 2079 r[dst] = jsNumber(exec, left ^ right);2058 callFrame[dst] = jsNumber(callFrame, left ^ right); 2080 2059 else { 2081 JSValue* result = jsNumber( exec, src1->toInt32(exec) ^ src2->toInt32(exec));2060 JSValue* result = jsNumber(callFrame, src1->toInt32(callFrame) ^ src2->toInt32(callFrame)); 2082 2061 VM_CHECK_EXCEPTION(); 2083 r[dst] = result;2062 callFrame[dst] = result; 2084 2063 } 2085 2064 … … 2095 2074 */ 2096 2075 int dst = (++vPC)->u.operand; 2097 JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec);2098 JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec);2076 JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame); 2077 JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame); 2099 2078 int32_t left; 2100 2079 int32_t right; 2101 2080 if (JSImmediate::areBothImmediateNumbers(src1, src2)) 2102 r[dst] = JSImmediate::orImmediateNumbers(src1, src2);2081 callFrame[dst] = JSImmediate::orImmediateNumbers(src1, src2); 2103 2082 else if (fastToInt32(src1, left) && fastToInt32(src2, right)) 2104 r[dst] = jsNumber(exec, left | right);2083 callFrame[dst] = jsNumber(callFrame, left | right); 2105 2084 else { 2106 JSValue* result = jsNumber( exec, src1->toInt32(exec) | src2->toInt32(exec));2085 JSValue* result = jsNumber(callFrame, src1->toInt32(callFrame) | src2->toInt32(callFrame)); 2107 2086 VM_CHECK_EXCEPTION(); 2108 r[dst] = result;2087 callFrame[dst] = result; 2109 2088 } 2110 2089 … … 2119 2098 */ 2120 2099 int dst = (++vPC)->u.operand; 2121 JSValue* src = r[(++vPC)->u.operand].jsValue(exec);2100 JSValue* src = callFrame[(++vPC)->u.operand].jsValue(callFrame); 2122 2101 int32_t value; 2123 2102 if (fastToInt32(src, value)) 2124 r[dst] = jsNumber(exec, ~value);2103 callFrame[dst] = jsNumber(callFrame, ~value); 2125 2104 else { 2126 JSValue* result = jsNumber( exec, ~src->toInt32(exec));2105 JSValue* result = jsNumber(callFrame, ~src->toInt32(callFrame)); 2127 2106 VM_CHECK_EXCEPTION(); 2128 r[dst] = result;2107 callFrame[dst] = result; 2129 2108 } 2130 2109 ++vPC; … … 2139 2118 int dst = (++vPC)->u.operand; 2140 2119 int src = (++vPC)->u.operand; 2141 JSValue* result = jsBoolean(! r[src].jsValue(exec)->toBoolean(exec));2120 JSValue* result = jsBoolean(!callFrame[src].jsValue(callFrame)->toBoolean(callFrame)); 2142 2121 VM_CHECK_EXCEPTION(); 2143 r[dst] = result;2122 callFrame[dst] = result; 2144 2123 2145 2124 ++vPC; … … 2164 2143 int baseProto = (++vPC)->u.operand; 2165 2144 2166 JSValue* baseVal = r[base].jsValue(exec);2167 2168 if (isNotObject( exec, true, codeBlock(r), vPC, baseVal, exceptionValue))2145 JSValue* baseVal = callFrame[base].jsValue(callFrame); 2146 2147 if (isNotObject(callFrame, true, callFrame->codeBlock(), vPC, baseVal, exceptionValue)) 2169 2148 goto vm_throw; 2170 2149 2171 2150 JSObject* baseObj = static_cast<JSObject*>(baseVal); 2172 r[dst] = jsBoolean(baseObj->structureID()->typeInfo().implementsHasInstance() ? baseObj->hasInstance(exec, r[value].jsValue(exec), r[baseProto].jsValue(exec)) : false);2151 callFrame[dst] = jsBoolean(baseObj->structureID()->typeInfo().implementsHasInstance() ? baseObj->hasInstance(callFrame, callFrame[value].jsValue(callFrame), callFrame[baseProto].jsValue(callFrame)) : false); 2173 2152 2174 2153 ++vPC; … … 2183 2162 int dst = (++vPC)->u.operand; 2184 2163 int src = (++vPC)->u.operand; 2185 r[dst] = jsTypeStringForValue(exec, r[src].jsValue(exec));2164 callFrame[dst] = jsTypeStringForValue(callFrame, callFrame[src].jsValue(callFrame)); 2186 2165 2187 2166 ++vPC; … … 2197 2176 int dst = (++vPC)->u.operand; 2198 2177 int src = (++vPC)->u.operand; 2199 JSValue* v = r[src].jsValue(exec);2200 r[dst] = jsBoolean(JSImmediate::isImmediate(v) ? v->isUndefined() : v->asCell()->structureID()->typeInfo().masqueradesAsUndefined());2178 JSValue* v = callFrame[src].jsValue(callFrame); 2179 callFrame[dst] = jsBoolean(JSImmediate::isImmediate(v) ? v->isUndefined() : v->asCell()->structureID()->typeInfo().masqueradesAsUndefined()); 2201 2180 2202 2181 ++vPC; … … 2212 2191 int dst = (++vPC)->u.operand; 2213 2192 int src = (++vPC)->u.operand; 2214 r[dst] = jsBoolean(r[src].jsValue(exec)->isBoolean());2193 callFrame[dst] = jsBoolean(callFrame[src].jsValue(callFrame)->isBoolean()); 2215 2194 2216 2195 ++vPC; … … 2226 2205 int dst = (++vPC)->u.operand; 2227 2206 int src = (++vPC)->u.operand; 2228 r[dst] = jsBoolean(r[src].jsValue(exec)->isNumber());2207 callFrame[dst] = jsBoolean(callFrame[src].jsValue(callFrame)->isNumber()); 2229 2208 2230 2209 ++vPC; … … 2240 2219 int dst = (++vPC)->u.operand; 2241 2220 int src = (++vPC)->u.operand; 2242 r[dst] = jsBoolean(r[src].jsValue(exec)->isString());2221 callFrame[dst] = jsBoolean(callFrame[src].jsValue(callFrame)->isString()); 2243 2222 2244 2223 ++vPC; … … 2254 2233 int dst = (++vPC)->u.operand; 2255 2234 int src = (++vPC)->u.operand; 2256 r[dst] = jsBoolean(jsIsObjectType(r[src].jsValue(exec)));2235 callFrame[dst] = jsBoolean(jsIsObjectType(callFrame[src].jsValue(callFrame))); 2257 2236 2258 2237 ++vPC; … … 2268 2247 int dst = (++vPC)->u.operand; 2269 2248 int src = (++vPC)->u.operand; 2270 r[dst] = jsBoolean(jsIsFunctionType(r[src].jsValue(exec)));2249 callFrame[dst] = jsBoolean(jsIsFunctionType(callFrame[src].jsValue(callFrame))); 2271 2250 2272 2251 ++vPC; … … 2286 2265 int base = (++vPC)->u.operand; 2287 2266 2288 JSValue* baseVal = r[base].jsValue(exec);2289 if (isNotObject( exec, false, codeBlock(r), vPC, baseVal, exceptionValue))2267 JSValue* baseVal = callFrame[base].jsValue(callFrame); 2268 if (isNotObject(callFrame, false, callFrame->codeBlock(), vPC, baseVal, exceptionValue)) 2290 2269 goto vm_throw; 2291 2270 2292 2271 JSObject* baseObj = static_cast<JSObject*>(baseVal); 2293 2272 2294 JSValue* propName = r[property].jsValue(exec);2273 JSValue* propName = callFrame[property].jsValue(callFrame); 2295 2274 2296 2275 uint32_t i; 2297 2276 if (propName->getUInt32(i)) 2298 r[dst] = jsBoolean(baseObj->hasProperty(exec, i));2277 callFrame[dst] = jsBoolean(baseObj->hasProperty(callFrame, i)); 2299 2278 else { 2300 Identifier property( exec, propName->toString(exec));2279 Identifier property(callFrame, propName->toString(callFrame)); 2301 2280 VM_CHECK_EXCEPTION(); 2302 r[dst] = jsBoolean(baseObj->hasProperty(exec, property));2281 callFrame[dst] = jsBoolean(baseObj->hasProperty(callFrame, property)); 2303 2282 } 2304 2283 … … 2313 2292 dst. If the property is not found, raises an exception. 2314 2293 */ 2315 if (UNLIKELY(!resolve( exec, vPC, r, exceptionValue)))2294 if (UNLIKELY(!resolve(callFrame, vPC, exceptionValue))) 2316 2295 goto vm_throw; 2317 2296 … … 2326 2305 value to register dst. If the property is not found, raises an exception. 2327 2306 */ 2328 if (UNLIKELY(!resolveSkip( exec, vPC, r, exceptionValue)))2307 if (UNLIKELY(!resolveSkip(callFrame, vPC, exceptionValue))) 2329 2308 goto vm_throw; 2330 2309 … … 2341 2320 cache the new structureID and offset 2342 2321 */ 2343 if (UNLIKELY(!resolveGlobal( exec, vPC, r,exceptionValue)))2322 if (UNLIKELY(!resolveGlobal(callFrame, vPC, exceptionValue))) 2344 2323 goto vm_throw; 2345 2324 … … 2358 2337 int index = (++vPC)->u.operand; 2359 2338 2360 r[dst] = scope->registerAt(index);2339 callFrame[dst] = scope->registerAt(index); 2361 2340 ++vPC; 2362 2341 NEXT_OPCODE; … … 2372 2351 int value = (++vPC)->u.operand; 2373 2352 2374 scope->registerAt(index) = r[value].jsValue(exec);2353 scope->registerAt(index) = callFrame[value].jsValue(callFrame); 2375 2354 ++vPC; 2376 2355 NEXT_OPCODE; … … 2384 2363 int dst = (++vPC)->u.operand; 2385 2364 int index = (++vPC)->u.operand; 2386 int skip = (++vPC)->u.operand + c odeBlock(r)->needsFullScopeChain;2387 2388 ScopeChainNode* scopeChain = this->scopeChain(r);2365 int skip = (++vPC)->u.operand + callFrame->codeBlock()->needsFullScopeChain; 2366 2367 ScopeChainNode* scopeChain = callFrame->scopeChain(); 2389 2368 ScopeChainIterator iter = scopeChain->begin(); 2390 2369 ScopeChainIterator end = scopeChain->end(); … … 2397 2376 ASSERT((*iter)->isVariableObject()); 2398 2377 JSVariableObject* scope = static_cast<JSVariableObject*>(*iter); 2399 r[dst] = scope->registerAt(index);2378 callFrame[dst] = scope->registerAt(index); 2400 2379 ++vPC; 2401 2380 NEXT_OPCODE; … … 2406 2385 */ 2407 2386 int index = (++vPC)->u.operand; 2408 int skip = (++vPC)->u.operand + c odeBlock(r)->needsFullScopeChain;2387 int skip = (++vPC)->u.operand + callFrame->codeBlock()->needsFullScopeChain; 2409 2388 int value = (++vPC)->u.operand; 2410 2389 2411 ScopeChainNode* scopeChain = this->scopeChain(r);2390 ScopeChainNode* scopeChain = callFrame->scopeChain(); 2412 2391 ScopeChainIterator iter = scopeChain->begin(); 2413 2392 ScopeChainIterator end = scopeChain->end(); … … 2420 2399 ASSERT((*iter)->isVariableObject()); 2421 2400 JSVariableObject* scope = static_cast<JSVariableObject*>(*iter); 2422 scope->registerAt(index) = r[value].jsValue(exec);2401 scope->registerAt(index) = callFrame[value].jsValue(callFrame); 2423 2402 ++vPC; 2424 2403 NEXT_OPCODE; … … 2432 2411 will be the global object) is stored in register dst. 2433 2412 */ 2434 resolveBase( exec, vPC, r);2413 resolveBase(callFrame, vPC); 2435 2414 2436 2415 vPC += 3; … … 2449 2428 avoids duplicate hash lookups. 2450 2429 */ 2451 if (UNLIKELY(!resolveBaseAndProperty( exec, vPC, r, exceptionValue)))2430 if (UNLIKELY(!resolveBaseAndProperty(callFrame, vPC, exceptionValue))) 2452 2431 goto vm_throw; 2453 2432 … … 2470 2449 calls but not for other property lookup. 2471 2450 */ 2472 if (UNLIKELY(!resolveBaseAndFunc( exec, vPC, r, exceptionValue)))2451 if (UNLIKELY(!resolveBaseAndFunc(callFrame, vPC, exceptionValue))) 2473 2452 goto vm_throw; 2474 2453 … … 2486 2465 int property = vPC[3].u.operand; 2487 2466 2488 CodeBlock* codeBlock = this->codeBlock(r);2467 CodeBlock* codeBlock = callFrame->codeBlock(); 2489 2468 Identifier& ident = codeBlock->identifiers[property]; 2490 JSValue* baseValue = r[base].jsValue(exec);2469 JSValue* baseValue = callFrame[base].jsValue(callFrame); 2491 2470 PropertySlot slot(baseValue); 2492 JSValue* result = baseValue->get( exec, ident, slot);2471 JSValue* result = baseValue->get(callFrame, ident, slot); 2493 2472 VM_CHECK_EXCEPTION(); 2494 2473 2495 tryCacheGetByID( exec, codeBlock, vPC, baseValue, ident, slot);2496 2497 r[dst] = result;2474 tryCacheGetByID(callFrame, codeBlock, vPC, baseValue, ident, slot); 2475 2476 callFrame[dst] = result; 2498 2477 vPC += 8; 2499 2478 NEXT_OPCODE; … … 2507 2486 */ 2508 2487 int base = vPC[2].u.operand; 2509 JSValue* baseValue = r[base].jsValue(exec);2488 JSValue* baseValue = callFrame[base].jsValue(callFrame); 2510 2489 2511 2490 if (LIKELY(!JSImmediate::isImmediate(baseValue))) { … … 2519 2498 int offset = vPC[5].u.operand; 2520 2499 2521 ASSERT(baseObject->get( exec, codeBlock(r)->identifiers[vPC[3].u.operand]) == baseObject->getDirectOffset(offset));2522 r[dst] = baseObject->getDirectOffset(offset);2500 ASSERT(baseObject->get(callFrame, callFrame->codeBlock()->identifiers[vPC[3].u.operand]) == baseObject->getDirectOffset(offset)); 2501 callFrame[dst] = baseObject->getDirectOffset(offset); 2523 2502 2524 2503 vPC += 8; … … 2527 2506 } 2528 2507 2529 uncacheGetByID(c odeBlock(r), vPC);2508 uncacheGetByID(callFrame->codeBlock(), vPC); 2530 2509 NEXT_OPCODE; 2531 2510 } … … 2538 2517 */ 2539 2518 int base = vPC[2].u.operand; 2540 JSValue* baseValue = r[base].jsValue(exec);2519 JSValue* baseValue = callFrame[base].jsValue(callFrame); 2541 2520 2542 2521 if (LIKELY(!JSImmediate::isImmediate(baseValue))) { … … 2545 2524 2546 2525 if (LIKELY(baseCell->structureID() == structureID)) { 2547 ASSERT(structureID->prototypeForLookup( exec)->isObject());2548 JSObject* protoObject = static_cast<JSObject*>(structureID->prototypeForLookup( exec));2526 ASSERT(structureID->prototypeForLookup(callFrame)->isObject()); 2527 JSObject* protoObject = static_cast<JSObject*>(structureID->prototypeForLookup(callFrame)); 2549 2528 StructureID* protoStructureID = vPC[5].u.structureID; 2550 2529 … … 2553 2532 int offset = vPC[6].u.operand; 2554 2533 2555 ASSERT(protoObject->get( exec, codeBlock(r)->identifiers[vPC[3].u.operand]) == protoObject->getDirectOffset(offset));2556 r[dst] = protoObject->getDirectOffset(offset);2534 ASSERT(protoObject->get(callFrame, callFrame->codeBlock()->identifiers[vPC[3].u.operand]) == protoObject->getDirectOffset(offset)); 2535 callFrame[dst] = protoObject->getDirectOffset(offset); 2557 2536 2558 2537 vPC += 8; … … 2562 2541 } 2563 2542 2564 uncacheGetByID(c odeBlock(r), vPC);2543 uncacheGetByID(callFrame->codeBlock(), vPC); 2565 2544 NEXT_OPCODE; 2566 2545 } … … 2573 2552 */ 2574 2553 int base = vPC[2].u.operand; 2575 JSValue* baseValue = r[base].jsValue(exec);2554 JSValue* baseValue = callFrame[base].jsValue(callFrame); 2576 2555 2577 2556 if (LIKELY(!JSImmediate::isImmediate(baseValue))) { … … 2586 2565 JSObject* baseObject = static_cast<JSObject*>(baseCell); 2587 2566 while (1) { 2588 baseObject = static_cast<JSObject*>(baseObject->structureID()->prototypeForLookup( exec));2567 baseObject = static_cast<JSObject*>(baseObject->structureID()->prototypeForLookup(callFrame)); 2589 2568 if (UNLIKELY(baseObject->structureID() != (*it).get())) 2590 2569 break; … … 2594 2573 int offset = vPC[7].u.operand; 2595 2574 2596 ASSERT(baseObject->get( exec, codeBlock(r)->identifiers[vPC[3].u.operand]) == baseObject->getDirectOffset(offset));2597 r[dst] = baseObject->getDirectOffset(offset);2575 ASSERT(baseObject->get(callFrame, callFrame->codeBlock()->identifiers[vPC[3].u.operand]) == baseObject->getDirectOffset(offset)); 2576 callFrame[dst] = baseObject->getDirectOffset(offset); 2598 2577 2599 2578 vPC += 8; … … 2604 2583 } 2605 2584 2606 uncacheGetByID(c odeBlock(r), vPC);2585 uncacheGetByID(callFrame->codeBlock(), vPC); 2607 2586 NEXT_OPCODE; 2608 2587 } … … 2617 2596 int property = vPC[3].u.operand; 2618 2597 2619 Identifier& ident = c odeBlock(r)->identifiers[property];2620 JSValue* baseValue = r[base].jsValue(exec);2598 Identifier& ident = callFrame->codeBlock()->identifiers[property]; 2599 JSValue* baseValue = callFrame[base].jsValue(callFrame); 2621 2600 PropertySlot slot(baseValue); 2622 JSValue* result = baseValue->get( exec, ident, slot);2601 JSValue* result = baseValue->get(callFrame, ident, slot); 2623 2602 VM_CHECK_EXCEPTION(); 2624 2603 2625 r[dst] = result;2604 callFrame[dst] = result; 2626 2605 vPC += 8; 2627 2606 NEXT_OPCODE; … … 2636 2615 2637 2616 int base = vPC[2].u.operand; 2638 JSValue* baseValue = r[base].jsValue(exec);2617 JSValue* baseValue = callFrame[base].jsValue(callFrame); 2639 2618 if (LIKELY(isJSArray(baseValue))) { 2640 2619 int dst = vPC[1].u.operand; 2641 r[dst] = jsNumber(exec, static_cast<JSArray*>(baseValue)->length());2620 callFrame[dst] = jsNumber(callFrame, static_cast<JSArray*>(baseValue)->length()); 2642 2621 vPC += 8; 2643 2622 NEXT_OPCODE; 2644 2623 } 2645 2624 2646 uncacheGetByID(c odeBlock(r), vPC);2625 uncacheGetByID(callFrame->codeBlock(), vPC); 2647 2626 NEXT_OPCODE; 2648 2627 } … … 2656 2635 2657 2636 int base = vPC[2].u.operand; 2658 JSValue* baseValue = r[base].jsValue(exec);2637 JSValue* baseValue = callFrame[base].jsValue(callFrame); 2659 2638 if (LIKELY(isJSString(baseValue))) { 2660 2639 int dst = vPC[1].u.operand; 2661 r[dst] = jsNumber(exec, static_cast<JSString*>(baseValue)->value().size());2640 callFrame[dst] = jsNumber(callFrame, static_cast<JSString*>(baseValue)->value().size()); 2662 2641 vPC += 8; 2663 2642 NEXT_OPCODE; 2664 2643 } 2665 2644 2666 uncacheGetByID(c odeBlock(r), vPC);2645 uncacheGetByID(callFrame->codeBlock(), vPC); 2667 2646 NEXT_OPCODE; 2668 2647 } … … 2681 2660 int value = vPC[3].u.operand; 2682 2661 2683 CodeBlock* codeBlock = this->codeBlock(r);2684 JSValue* baseValue = r[base].jsValue(exec);2662 CodeBlock* codeBlock = callFrame->codeBlock(); 2663 JSValue* baseValue = callFrame[base].jsValue(callFrame); 2685 2664 Identifier& ident = codeBlock->identifiers[property]; 2686 2665 PutPropertySlot slot; 2687 baseValue->put( exec, ident, r[value].jsValue(exec), slot);2666 baseValue->put(callFrame, ident, callFrame[value].jsValue(callFrame), slot); 2688 2667 VM_CHECK_EXCEPTION(); 2689 2668 2690 tryCachePutByID( exec, codeBlock, vPC, baseValue, slot);2669 tryCachePutByID(callFrame, codeBlock, vPC, baseValue, slot); 2691 2670 2692 2671 vPC += 8; … … 2705 2684 */ 2706 2685 int base = vPC[1].u.operand; 2707 JSValue* baseValue = r[base].jsValue(exec);2686 JSValue* baseValue = callFrame[base].jsValue(callFrame); 2708 2687 2709 2688 if (LIKELY(!JSImmediate::isImmediate(baseValue))) { … … 2718 2697 RefPtr<StructureID>* it = vPC[6].u.structureIDChain->head(); 2719 2698 2720 JSObject* proto = static_cast<JSObject*>(baseObject->structureID()->prototypeForLookup( exec));2699 JSObject* proto = static_cast<JSObject*>(baseObject->structureID()->prototypeForLookup(callFrame)); 2721 2700 while (!proto->isNull()) { 2722 2701 if (UNLIKELY(proto->structureID() != (*it).get())) { 2723 uncachePutByID(c odeBlock(r), vPC);2702 uncachePutByID(callFrame->codeBlock(), vPC); 2724 2703 NEXT_OPCODE; 2725 2704 } 2726 2705 ++it; 2727 proto = static_cast<JSObject*>(proto->structureID()->prototypeForLookup( exec));2706 proto = static_cast<JSObject*>(proto->structureID()->prototypeForLookup(callFrame)); 2728 2707 } 2729 2708 … … 2732 2711 int value = vPC[3].u.operand; 2733 2712 unsigned offset = vPC[7].u.operand; 2734 ASSERT(baseObject->offsetForLocation(baseObject->getDirectLocation(c odeBlock(r)->identifiers[vPC[2].u.operand])) == offset);2735 baseObject->putDirectOffset(offset, r[value].jsValue(exec));2713 ASSERT(baseObject->offsetForLocation(baseObject->getDirectLocation(callFrame->codeBlock()->identifiers[vPC[2].u.operand])) == offset); 2714 baseObject->putDirectOffset(offset, callFrame[value].jsValue(callFrame)); 2736 2715 2737 2716 vPC += 8; … … 2740 2719 } 2741 2720 2742 uncachePutByID(c odeBlock(r), vPC);2721 uncachePutByID(callFrame->codeBlock(), vPC); 2743 2722 NEXT_OPCODE; 2744 2723 } … … 2755 2734 */ 2756 2735 int base = vPC[1].u.operand; 2757 JSValue* baseValue = r[base].jsValue(exec);2736 JSValue* baseValue = callFrame[base].jsValue(callFrame); 2758 2737 2759 2738 if (LIKELY(!JSImmediate::isImmediate(baseValue))) { … … 2767 2746 unsigned offset = vPC[5].u.operand; 2768 2747 2769 ASSERT(baseObject->offsetForLocation(baseObject->getDirectLocation(c odeBlock(r)->identifiers[vPC[2].u.operand])) == offset);2770 baseObject->putDirectOffset(offset, r[value].jsValue(exec));2748 ASSERT(baseObject->offsetForLocation(baseObject->getDirectLocation(callFrame->codeBlock()->identifiers[vPC[2].u.operand])) == offset); 2749 baseObject->putDirectOffset(offset, callFrame[value].jsValue(callFrame)); 2771 2750 2772 2751 vPC += 8; … … 2775 2754 } 2776 2755 2777 uncachePutByID(c odeBlock(r), vPC);2756 uncachePutByID(callFrame->codeBlock(), vPC); 2778 2757 NEXT_OPCODE; 2779 2758 } … … 2791 2770 int value = vPC[3].u.operand; 2792 2771 2793 JSValue* baseValue = r[base].jsValue(exec);2794 Identifier& ident = c odeBlock(r)->identifiers[property];2772 JSValue* baseValue = callFrame[base].jsValue(callFrame); 2773 Identifier& ident = callFrame->codeBlock()->identifiers[property]; 2795 2774 PutPropertySlot slot; 2796 baseValue->put( exec, ident, r[value].jsValue(exec), slot);2775 baseValue->put(callFrame, ident, callFrame[value].jsValue(callFrame), slot); 2797 2776 VM_CHECK_EXCEPTION(); 2798 2777 … … 2812 2791 int property = (++vPC)->u.operand; 2813 2792 2814 JSObject* baseObj = r[base].jsValue(exec)->toObject(exec);2815 Identifier& ident = c odeBlock(r)->identifiers[property];2816 JSValue* result = jsBoolean(baseObj->deleteProperty( exec, ident));2793 JSObject* baseObj = callFrame[base].jsValue(callFrame)->toObject(callFrame); 2794 Identifier& ident = callFrame->codeBlock()->identifiers[property]; 2795 JSValue* result = jsBoolean(baseObj->deleteProperty(callFrame, ident)); 2817 2796 VM_CHECK_EXCEPTION(); 2818 r[dst] = result;2797 callFrame[dst] = result; 2819 2798 ++vPC; 2820 2799 NEXT_OPCODE; … … 2832 2811 int property = (++vPC)->u.operand; 2833 2812 2834 JSValue* baseValue = r[base].jsValue(exec);2835 JSValue* subscript = r[property].jsValue(exec);2813 JSValue* baseValue = callFrame[base].jsValue(callFrame); 2814 JSValue* subscript = callFrame[property].jsValue(callFrame); 2836 2815 2837 2816 JSValue* result; … … 2845 2824 result = jsArray->getIndex(i); 2846 2825 else 2847 result = jsArray->JSArray::get( exec, i);2826 result = jsArray->JSArray::get(callFrame, i); 2848 2827 } else if (isJSString(baseValue) && static_cast<JSString*>(baseValue)->canGetIndex(i)) 2849 result = static_cast<JSString*>(baseValue)->getIndex(& exec->globalData(), i);2828 result = static_cast<JSString*>(baseValue)->getIndex(&callFrame->globalData(), i); 2850 2829 else 2851 result = baseValue->get( exec, i);2830 result = baseValue->get(callFrame, i); 2852 2831 } else { 2853 Identifier property( exec, subscript->toString(exec));2854 result = baseValue->get( exec, property);2832 Identifier property(callFrame, subscript->toString(callFrame)); 2833 result = baseValue->get(callFrame, property); 2855 2834 } 2856 2835 2857 2836 VM_CHECK_EXCEPTION(); 2858 r[dst] = result;2837 callFrame[dst] = result; 2859 2838 ++vPC; 2860 2839 NEXT_OPCODE; … … 2875 2854 int value = (++vPC)->u.operand; 2876 2855 2877 JSValue* baseValue = r[base].jsValue(exec);2878 JSValue* subscript = r[property].jsValue(exec);2856 JSValue* baseValue = callFrame[base].jsValue(callFrame); 2857 JSValue* subscript = callFrame[property].jsValue(callFrame); 2879 2858 2880 2859 unsigned i; … … 2885 2864 JSArray* jsArray = static_cast<JSArray*>(baseValue); 2886 2865 if (jsArray->canSetIndex(i)) 2887 jsArray->setIndex(i, r[value].jsValue(exec));2866 jsArray->setIndex(i, callFrame[value].jsValue(callFrame)); 2888 2867 else 2889 jsArray->JSArray::put( exec, i, r[value].jsValue(exec));2868 jsArray->JSArray::put(callFrame, i, callFrame[value].jsValue(callFrame)); 2890 2869 } else 2891 baseValue->put( exec, i, r[value].jsValue(exec));2870 baseValue->put(callFrame, i, callFrame[value].jsValue(callFrame)); 2892 2871 } else { 2893 Identifier property( exec, subscript->toString(exec));2894 if (! exec->hadException()) { // Don't put to an object if toString threw an exception.2872 Identifier property(callFrame, subscript->toString(callFrame)); 2873 if (!globalData->exception) { // Don't put to an object if toString threw an exception. 2895 2874 PutPropertySlot slot; 2896 baseValue->put( exec, property, r[value].jsValue(exec), slot);2875 baseValue->put(callFrame, property, callFrame[value].jsValue(callFrame), slot); 2897 2876 } 2898 2877 } … … 2914 2893 int property = (++vPC)->u.operand; 2915 2894 2916 JSObject* baseObj = r[base].jsValue(exec)->toObject(exec); // may throw2917 2918 JSValue* subscript = r[property].jsValue(exec);2895 JSObject* baseObj = callFrame[base].jsValue(callFrame)->toObject(callFrame); // may throw 2896 2897 JSValue* subscript = callFrame[property].jsValue(callFrame); 2919 2898 JSValue* result; 2920 2899 uint32_t i; 2921 2900 if (subscript->getUInt32(i)) 2922 result = jsBoolean(baseObj->deleteProperty( exec, i));2901 result = jsBoolean(baseObj->deleteProperty(callFrame, i)); 2923 2902 else { 2924 2903 VM_CHECK_EXCEPTION(); 2925 Identifier property( exec, subscript->toString(exec));2904 Identifier property(callFrame, subscript->toString(callFrame)); 2926 2905 VM_CHECK_EXCEPTION(); 2927 result = jsBoolean(baseObj->deleteProperty( exec, property));2906 result = jsBoolean(baseObj->deleteProperty(callFrame, property)); 2928 2907 } 2929 2908 2930 2909 VM_CHECK_EXCEPTION(); 2931 r[dst] = result;2910 callFrame[dst] = result; 2932 2911 ++vPC; 2933 2912 NEXT_OPCODE; … … 2949 2928 int value = (++vPC)->u.operand; 2950 2929 2951 r[base].jsValue(exec)->put(exec, property, r[value].jsValue(exec));2930 callFrame[base].jsValue(callFrame)->put(callFrame, property, callFrame[value].jsValue(callFrame)); 2952 2931 2953 2932 ++vPC; … … 2996 2975 int cond = (++vPC)->u.operand; 2997 2976 int target = (++vPC)->u.operand; 2998 if ( r[cond].jsValue(exec)->toBoolean(exec)) {2977 if (callFrame[cond].jsValue(callFrame)->toBoolean(callFrame)) { 2999 2978 vPC += target; 3000 2979 CHECK_FOR_TIMEOUT(); … … 3013 2992 int cond = (++vPC)->u.operand; 3014 2993 int target = (++vPC)->u.operand; 3015 if ( r[cond].jsValue(exec)->toBoolean(exec)) {2994 if (callFrame[cond].jsValue(callFrame)->toBoolean(callFrame)) { 3016 2995 vPC += target; 3017 2996 NEXT_OPCODE; … … 3029 3008 int cond = (++vPC)->u.operand; 3030 3009 int target = (++vPC)->u.operand; 3031 if (! r[cond].jsValue(exec)->toBoolean(exec)) {3010 if (!callFrame[cond].jsValue(callFrame)->toBoolean(callFrame)) { 3032 3011 vPC += target; 3033 3012 NEXT_OPCODE; … … 3048 3027 the JS timeout is reached. 3049 3028 */ 3050 JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec);3051 JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec);3029 JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame); 3030 JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame); 3052 3031 int target = (++vPC)->u.operand; 3053 3032 3054 bool result = jsLess( exec, src1, src2);3033 bool result = jsLess(callFrame, src1, src2); 3055 3034 VM_CHECK_EXCEPTION(); 3056 3035 … … 3075 3054 the JS timeout is reached. 3076 3055 */ 3077 JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec);3078 JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec);3056 JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame); 3057 JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame); 3079 3058 int target = (++vPC)->u.operand; 3080 3059 3081 bool result = jsLessEq( exec, src1, src2);3060 bool result = jsLessEq(callFrame, src1, src2); 3082 3061 VM_CHECK_EXCEPTION(); 3083 3062 … … 3099 3078 result of the comparison is false. 3100 3079 */ 3101 JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec);3102 JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec);3080 JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame); 3081 JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame); 3103 3082 int target = (++vPC)->u.operand; 3104 3083 3105 bool result = jsLess( exec, src1, src2);3084 bool result = jsLess(callFrame, src1, src2); 3106 3085 VM_CHECK_EXCEPTION(); 3107 3086 … … 3125 3104 int tableIndex = (++vPC)->u.operand; 3126 3105 int defaultOffset = (++vPC)->u.operand; 3127 JSValue* scrutinee = r[(++vPC)->u.operand].jsValue(exec);3106 JSValue* scrutinee = callFrame[(++vPC)->u.operand].jsValue(callFrame); 3128 3107 if (!JSImmediate::isNumber(scrutinee)) 3129 3108 vPC += defaultOffset; 3130 3109 else { 3131 3110 int32_t value = JSImmediate::getTruncatedInt32(scrutinee); 3132 vPC += c odeBlock(r)->immediateSwitchJumpTables[tableIndex].offsetForValue(value, defaultOffset);3111 vPC += callFrame->codeBlock()->immediateSwitchJumpTables[tableIndex].offsetForValue(value, defaultOffset); 3133 3112 } 3134 3113 NEXT_OPCODE; … … 3145 3124 int tableIndex = (++vPC)->u.operand; 3146 3125 int defaultOffset = (++vPC)->u.operand; 3147 JSValue* scrutinee = r[(++vPC)->u.operand].jsValue(exec);3126 JSValue* scrutinee = callFrame[(++vPC)->u.operand].jsValue(callFrame); 3148 3127 if (!scrutinee->isString()) 3149 3128 vPC += defaultOffset; … … 3153 3132 vPC += defaultOffset; 3154 3133 else 3155 vPC += c odeBlock(r)->characterSwitchJumpTables[tableIndex].offsetForValue(value->data()[0], defaultOffset);3134 vPC += callFrame->codeBlock()->characterSwitchJumpTables[tableIndex].offsetForValue(value->data()[0], defaultOffset); 3156 3135 } 3157 3136 NEXT_OPCODE; … … 3168 3147 int tableIndex = (++vPC)->u.operand; 3169 3148 int defaultOffset = (++vPC)->u.operand; 3170 JSValue* scrutinee = r[(++vPC)->u.operand].jsValue(exec);3149 JSValue* scrutinee = callFrame[(++vPC)->u.operand].jsValue(callFrame); 3171 3150 if (!scrutinee->isString()) 3172 3151 vPC += defaultOffset; 3173 3152 else 3174 vPC += c odeBlock(r)->stringSwitchJumpTables[tableIndex].offsetForValue(static_cast<JSString*>(scrutinee)->value().rep(), defaultOffset);3153 vPC += callFrame->codeBlock()->stringSwitchJumpTables[tableIndex].offsetForValue(static_cast<JSString*>(scrutinee)->value().rep(), defaultOffset); 3175 3154 NEXT_OPCODE; 3176 3155 } … … 3186 3165 int func = (++vPC)->u.operand; 3187 3166 3188 r[dst] = codeBlock(r)->functions[func]->makeFunction(exec, scopeChain(r));3167 callFrame[dst] = callFrame->codeBlock()->functions[func]->makeFunction(callFrame, callFrame->scopeChain()); 3189 3168 3190 3169 ++vPC; … … 3202 3181 int func = (++vPC)->u.operand; 3203 3182 3204 r[dst] = codeBlock(r)->functionExpressions[func]->makeFunction(exec, scopeChain(r));3183 callFrame[dst] = callFrame->codeBlock()->functionExpressions[func]->makeFunction(callFrame, callFrame->scopeChain()); 3205 3184 3206 3185 ++vPC; … … 3226 3205 ++vPC; // registerOffset 3227 3206 3228 JSValue* funcVal = r[func].jsValue(exec);3229 JSValue* baseVal = r[thisVal].jsValue(exec);3230 3231 ScopeChainNode* scopeChain = this->scopeChain(r);3207 JSValue* funcVal = callFrame[func].jsValue(callFrame); 3208 JSValue* baseVal = callFrame[thisVal].jsValue(callFrame); 3209 3210 ScopeChainNode* scopeChain = callFrame->scopeChain(); 3232 3211 if (baseVal == scopeChain->globalObject() && funcVal == scopeChain->globalObject()->evalFunction()) { 3233 JSObject* thisObject = static_cast<JSObject*>( r[codeBlock(r)->thisRegister].jsValue(exec));3234 JSValue* result = callEval( exec, thisObject, scopeChain, registerFile, r, firstArg, argCount, exceptionValue);3212 JSObject* thisObject = static_cast<JSObject*>(callFrame[callFrame->codeBlock()->thisRegister].jsValue(callFrame)); 3213 JSValue* result = callEval(callFrame, thisObject, scopeChain, registerFile, firstArg, argCount, exceptionValue); 3235 3214 if (exceptionValue) 3236 3215 goto vm_throw; 3237 3216 3238 r[dst] = result;3217 callFrame[dst] = result; 3239 3218 3240 3219 ++vPC; … … 3246 3225 // value. 3247 3226 vPC -= 6; 3248 r[thisVal] = baseVal->toThisObject(exec);3227 callFrame[thisVal] = baseVal->toThisObject(callFrame); 3249 3228 3250 3229 #if HAVE(COMPUTED_GOTO) … … 3300 3279 int registerOffset = (++vPC)->u.operand; 3301 3280 3302 JSValue* v = r[func].jsValue(exec);3281 JSValue* v = callFrame[func].jsValue(callFrame); 3303 3282 3304 3283 CallData callData; … … 3310 3289 CodeBlock* newCodeBlock = &functionBodyNode->byteCode(callDataScopeChain); 3311 3290 3312 r[firstArg] = thisVal == missingThisObjectMarker() ? exec->globalThisValue() : r[thisVal].jsValue(exec);3291 callFrame[firstArg] = thisVal == missingThisObjectMarker() ? callFrame->globalThisValue() : callFrame[thisVal].jsValue(callFrame); 3313 3292 3314 Register* savedR = r;3315 3316 r = slideRegisterWindowForCall(newCodeBlock, registerFile, r, registerOffset, argCount);3317 if (UNLIKELY(! r)) {3318 r = savedR;3319 exceptionValue = createStackOverflowError( CallFrame::create(r));3293 CallFrame* previousCallFrame = callFrame; 3294 3295 callFrame = slideRegisterWindowForCall(newCodeBlock, registerFile, callFrame, registerOffset, argCount); 3296 if (UNLIKELY(!callFrame)) { 3297 callFrame = previousCallFrame; 3298 exceptionValue = createStackOverflowError(callFrame); 3320 3299 goto vm_throw; 3321 3300 } 3322 3301 3323 initializeCallFrame(r, newCodeBlock, vPC + 1, callDataScopeChain, savedR, dst, argCount, v);3302 callFrame->init(newCodeBlock, vPC + 1, callDataScopeChain, previousCallFrame, dst, argCount, static_cast<JSFunction*>(v)); 3324 3303 3325 3304 if (*enabledProfilerReference) 3326 (*enabledProfilerReference)->willExecute( exec, static_cast<JSObject*>(v));3305 (*enabledProfilerReference)->willExecute(callFrame, static_cast<JSObject*>(v)); 3327 3306 3328 3307 vPC = newCodeBlock->instructions.begin(); … … 3336 3315 3337 3316 if (callType == CallTypeHost) { 3338 JSValue* thisValue = thisVal == missingThisObjectMarker() ? exec->globalThisValue() : r[thisVal].jsValue(exec);3339 ArgList args( r+ firstArg + 1, argCount - 1);3340 3341 ScopeChainNode* scopeChain = this->scopeChain(r);3342 initializeCallFrame(r + registerOffset, 0, vPC + 1, scopeChain, r, dst, argCount, v);3343 ExecState* callFrame = CallFrame::create(r + registerOffset);3317 JSValue* thisValue = thisVal == missingThisObjectMarker() ? callFrame->globalThisValue() : callFrame[thisVal].jsValue(callFrame); 3318 ArgList args(callFrame->registers() + firstArg + 1, argCount - 1); 3319 3320 ScopeChainNode* scopeChain = callFrame->scopeChain(); 3321 CallFrame* newCallFrame = CallFrame::create(callFrame->registers() + registerOffset); 3322 newCallFrame->init(0, vPC + 1, scopeChain, callFrame, dst, argCount, static_cast<JSFunction*>(v)); 3344 3323 3345 3324 if (*enabledProfilerReference) 3346 (*enabledProfilerReference)->willExecute( callFrame, static_cast<JSObject*>(v));3325 (*enabledProfilerReference)->willExecute(newCallFrame, static_cast<JSFunction*>(v)); 3347 3326 3348 3327 MACHINE_SAMPLING_callingHostFunction(); 3349 3328 3350 JSValue* returnValue = callData.native.function( callFrame, static_cast<JSObject*>(v), thisValue, args);3329 JSValue* returnValue = callData.native.function(newCallFrame, static_cast<JSFunction*>(v), thisValue, args); 3351 3330 VM_CHECK_EXCEPTION(); 3352 3331 3353 r[dst] = returnValue;3332 newCallFrame[dst] = returnValue; 3354 3333 3355 3334 if (*enabledProfilerReference) 3356 (*enabledProfilerReference)->didExecute( CallFrame::create(r), static_cast<JSObject*>(v));3335 (*enabledProfilerReference)->didExecute(callFrame, static_cast<JSFunction*>(v)); 3357 3336 3358 3337 ++vPC; … … 3362 3341 ASSERT(callType == CallTypeNone); 3363 3342 3364 exceptionValue = createNotAFunctionError( exec, v, vPC, codeBlock(r));3343 exceptionValue = createNotAFunctionError(callFrame, v, vPC, callFrame->codeBlock()); 3365 3344 goto vm_throw; 3366 3345 } 3367 3346 BEGIN_OPCODE(op_tear_off_activation) { 3368 3347 int src = (++vPC)->u.operand; 3369 JSActivation* activation = static_cast<JSActivation*>(r[src].getJSValue());3370 ASSERT(codeBlock(r)->needsFullScopeChain);3348 ASSERT(callFrame->codeBlock()->needsFullScopeChain); 3349 JSActivation* activation = static_cast<JSActivation*>(callFrame[src].getJSValue()); 3371 3350 ASSERT(activation->isObject(&JSActivation::info)); 3372 3351 3373 Arguments* arguments = static_cast<Arguments*>(r[RegisterFile::OptionalCalleeArguments].getJSValue()); 3374 ASSERT(!arguments || arguments->isObject(&Arguments::info)); 3375 activation->copyRegisters(arguments); 3352 activation->copyRegisters(callFrame->optionalCalleeArguments()); 3376 3353 3377 3354 ++vPC; … … 3379 3356 } 3380 3357 BEGIN_OPCODE(op_tear_off_arguments) { 3381 Arguments* arguments = static_cast<Arguments*>(r[RegisterFile::OptionalCalleeArguments].getJSValue()); 3382 ASSERT(codeBlock(r)->usesArguments && !codeBlock(r)->needsFullScopeChain); 3383 ASSERT(arguments->isObject(&Arguments::info)); 3384 3385 arguments->copyRegisters(); 3358 ASSERT(callFrame->codeBlock()->usesArguments && !callFrame->codeBlock()->needsFullScopeChain); 3359 3360 callFrame->optionalCalleeArguments()->copyRegisters(); 3386 3361 3387 3362 ++vPC; … … 3401 3376 3402 3377 if (*enabledProfilerReference) 3403 (*enabledProfilerReference)->didExecute( exec, static_cast<JSObject*>(r[RegisterFile::Callee].jsValue(exec)));3404 3405 if (c odeBlock(r)->needsFullScopeChain)3406 scopeChain(r)->deref();3407 3408 JSValue* returnValue = r[result].jsValue(exec);3409 3410 vPC = r[RegisterFile::ReturnPC].vPC();3411 int dst = r[RegisterFile::ReturnValueRegister].i();3412 r = r[RegisterFile::CallerRegisters].r();3378 (*enabledProfilerReference)->didExecute(callFrame, callFrame->callee()); 3379 3380 if (callFrame->codeBlock()->needsFullScopeChain) 3381 callFrame->scopeChain()->deref(); 3382 3383 JSValue* returnValue = callFrame[result].jsValue(callFrame); 3384 3385 vPC = callFrame->returnPC(); 3386 int dst = callFrame->returnValueRegister(); 3387 callFrame = callFrame->callerFrame(); 3413 3388 3414 if ( isHostCallFrame(r))3389 if (callFrame->hasHostCallFrameFlag()) 3415 3390 return returnValue; 3416 3391 3417 r[dst] = returnValue;3392 callFrame[dst] = returnValue; 3418 3393 3419 3394 NEXT_OPCODE; … … 3431 3406 3432 3407 size_t i = 0; 3433 CodeBlock* codeBlock = this->codeBlock(r);3408 CodeBlock* codeBlock = callFrame->codeBlock(); 3434 3409 3435 3410 for (size_t count = codeBlock->numVars; i < count; ++i) 3436 r[i] = jsUndefined();3411 callFrame[i] = jsUndefined(); 3437 3412 3438 3413 for (size_t count = codeBlock->constantRegisters.size(), j = 0; j < count; ++i, ++j) 3439 r[i] = codeBlock->constantRegisters[j];3414 callFrame[i] = codeBlock->constantRegisters[j]; 3440 3415 3441 3416 ++vPC; … … 3456 3431 3457 3432 size_t i = 0; 3458 CodeBlock* codeBlock = this->codeBlock(r);3433 CodeBlock* codeBlock = callFrame->codeBlock(); 3459 3434 3460 3435 for (size_t count = codeBlock->numVars; i < count; ++i) 3461 r[i] = jsUndefined();3436 callFrame[i] = jsUndefined(); 3462 3437 3463 3438 for (size_t count = codeBlock->constantRegisters.size(), j = 0; j < count; ++i, ++j) 3464 r[i] = codeBlock->constantRegisters[j];3439 callFrame[i] = codeBlock->constantRegisters[j]; 3465 3440 3466 3441 int dst = (++vPC)->u.operand; 3467 JSActivation* activation = new (globalData) JSActivation( exec, static_cast<FunctionBodyNode*>(codeBlock->ownerNode), r);3468 r[dst] = activation;3469 r[RegisterFile::ScopeChain] = scopeChain(r)->copy()->push(activation);3442 JSActivation* activation = new (globalData) JSActivation(callFrame, static_cast<FunctionBodyNode*>(codeBlock->ownerNode)); 3443 callFrame[dst] = activation; 3444 callFrame->setScopeChain(callFrame->scopeChain()->copy()->push(activation)); 3470 3445 3471 3446 ++vPC; … … 3474 3449 BEGIN_OPCODE(op_convert_this) { 3475 3450 int thisRegister = (++vPC)->u.operand; 3476 JSValue* thisVal = r[thisRegister].getJSValue();3451 JSValue* thisVal = callFrame[thisRegister].getJSValue(); 3477 3452 if (thisVal->needsThisConversion()) 3478 r[thisRegister] = thisVal->toThisObject(exec);3453 callFrame[thisRegister] = thisVal->toThisObject(callFrame); 3479 3454 3480 3455 ++vPC; … … 3492 3467 */ 3493 3468 3494 Arguments* arguments = new (globalData) Arguments( exec, r);3495 r[RegisterFile::OptionalCalleeArguments] = arguments;3496 r[RegisterFile::ArgumentsRegister] = arguments;3469 Arguments* arguments = new (globalData) Arguments(callFrame); 3470 callFrame->setCalleeArguments(arguments); 3471 callFrame[RegisterFile::ArgumentsRegister] = arguments; 3497 3472 3498 3473 ++vPC; … … 3521 3496 int registerOffset = (++vPC)->u.operand; 3522 3497 3523 JSValue* v = r[constr].jsValue(exec);3498 JSValue* v = callFrame[constr].jsValue(callFrame); 3524 3499 3525 3500 ConstructData constructData; … … 3528 3503 if (constructType == ConstructTypeJS) { 3529 3504 if (*enabledProfilerReference) 3530 (*enabledProfilerReference)->willExecute( exec, static_cast<JSObject*>(v));3505 (*enabledProfilerReference)->willExecute(callFrame, static_cast<JSObject*>(v)); 3531 3506 3532 3507 ScopeChainNode* callDataScopeChain = constructData.js.scopeChain; … … 3535 3510 3536 3511 StructureID* structure; 3537 JSValue* prototype = r[constrProto].jsValue(exec);3512 JSValue* prototype = callFrame[constrProto].jsValue(callFrame); 3538 3513 if (prototype->isObject()) 3539 3514 structure = static_cast<JSObject*>(prototype)->inheritorID(); … … 3542 3517 JSObject* newObject = new (globalData) JSObject(structure); 3543 3518 3544 r[firstArg] = newObject; // "this" value3545 3546 Register* savedR = r;3547 3548 r = slideRegisterWindowForCall(newCodeBlock, registerFile, r, registerOffset, argCount);3549 if (UNLIKELY(! r)) {3550 r = savedR;3551 exceptionValue = createStackOverflowError( CallFrame::create(r));3519 callFrame[firstArg] = newObject; // "this" value 3520 3521 CallFrame* previousCallFrame = callFrame; 3522 3523 callFrame = slideRegisterWindowForCall(newCodeBlock, registerFile, callFrame, registerOffset, argCount); 3524 if (UNLIKELY(!callFrame)) { 3525 callFrame = previousCallFrame; 3526 exceptionValue = createStackOverflowError(callFrame); 3552 3527 goto vm_throw; 3553 3528 } 3554 3529 3555 initializeCallFrame(r, newCodeBlock, vPC + 1, callDataScopeChain, savedR, dst, argCount, v);3530 callFrame->init(newCodeBlock, vPC + 1, callDataScopeChain, previousCallFrame, dst, argCount, static_cast<JSFunction*>(v)); 3556 3531 3557 3532 if (*enabledProfilerReference) 3558 (*enabledProfilerReference)->didExecute( exec, static_cast<JSObject*>(v));3533 (*enabledProfilerReference)->didExecute(callFrame, static_cast<JSObject*>(v)); 3559 3534 3560 3535 vPC = newCodeBlock->instructions.begin(); … … 3568 3543 3569 3544 if (constructType == ConstructTypeHost) { 3570 ArgList args( r+ firstArg + 1, argCount - 1);3571 3572 ScopeChainNode* scopeChain = this->scopeChain(r);3573 initializeCallFrame(r + registerOffset, 0, vPC + 1, scopeChain, r, dst, argCount, v);3574 r += registerOffset;3545 ArgList args(callFrame->registers() + firstArg + 1, argCount - 1); 3546 3547 ScopeChainNode* scopeChain = callFrame->scopeChain(); 3548 CallFrame::create(callFrame->registers() + registerOffset)->init(0, vPC + 1, scopeChain, callFrame, dst, argCount, static_cast<JSFunction*>(v)); 3549 callFrame = CallFrame::create(callFrame->registers() + registerOffset); 3575 3550 3576 3551 if (*enabledProfilerReference) 3577 (*enabledProfilerReference)->willExecute( exec, static_cast<JSObject*>(v));3552 (*enabledProfilerReference)->willExecute(callFrame, static_cast<JSObject*>(v)); 3578 3553 3579 3554 MACHINE_SAMPLING_callingHostFunction(); 3580 3555 3581 JSValue* returnValue = constructData.native.function( exec, static_cast<JSObject*>(v), args);3582 r -= registerOffset;3556 JSValue* returnValue = constructData.native.function(callFrame, static_cast<JSObject*>(v), args); 3557 callFrame = CallFrame::create(callFrame->registers() - registerOffset); 3583 3558 3584 3559 VM_CHECK_EXCEPTION(); 3585 r[dst] = returnValue;3560 callFrame[dst] = returnValue; 3586 3561 3587 3562 if (*enabledProfilerReference) 3588 (*enabledProfilerReference)->didExecute( exec, static_cast<JSObject*>(v));3563 (*enabledProfilerReference)->didExecute(callFrame, static_cast<JSObject*>(v)); 3589 3564 3590 3565 ++vPC; … … 3594 3569 ASSERT(constructType == ConstructTypeNone); 3595 3570 3596 exceptionValue = createNotAConstructorError( exec, v, vPC, codeBlock(r));3571 exceptionValue = createNotAConstructorError(callFrame, v, vPC, callFrame->codeBlock()); 3597 3572 goto vm_throw; 3598 3573 } … … 3605 3580 3606 3581 int dst = vPC[1].u.operand;; 3607 if (LIKELY( r[dst].jsValue(exec)->isObject())) {3582 if (LIKELY(callFrame[dst].jsValue(callFrame)->isObject())) { 3608 3583 vPC += 3; 3609 3584 NEXT_OPCODE; … … 3611 3586 3612 3587 int override = vPC[2].u.operand; 3613 r[dst] = r[override];3588 callFrame[dst] = callFrame[override]; 3614 3589 3615 3590 vPC += 3; … … 3623 3598 */ 3624 3599 int scope = (++vPC)->u.operand; 3625 JSValue* v = r[scope].jsValue(exec);3626 JSObject* o = v->toObject( exec);3600 JSValue* v = callFrame[scope].jsValue(callFrame); 3601 JSObject* o = v->toObject(callFrame); 3627 3602 VM_CHECK_EXCEPTION(); 3628 3603 3629 r[RegisterFile::ScopeChain] = scopeChain(r)->push(o);3604 callFrame->setScopeChain(callFrame->scopeChain()->push(o)); 3630 3605 3631 3606 ++vPC; … … 3637 3612 Removes the top item from the current scope chain. 3638 3613 */ 3639 r[RegisterFile::ScopeChain] = scopeChain(r)->pop();3614 callFrame->setScopeChain(callFrame->scopeChain()->pop()); 3640 3615 3641 3616 ++vPC; … … 3653 3628 int base = (++vPC)->u.operand; 3654 3629 3655 r[dst] = JSPropertyNameIterator::create(exec, r[base].jsValue(exec));3630 callFrame[dst] = JSPropertyNameIterator::create(callFrame, callFrame[base].jsValue(callFrame)); 3656 3631 ++vPC; 3657 3632 NEXT_OPCODE; … … 3670 3645 int target = (++vPC)->u.operand; 3671 3646 3672 JSPropertyNameIterator* it = r[iter].jsPropertyNameIterator();3673 if (JSValue* temp = it->next( exec)) {3647 JSPropertyNameIterator* it = callFrame[iter].propertyNameIterator(); 3648 if (JSValue* temp = it->next(callFrame)) { 3674 3649 CHECK_FOR_TIMEOUT(); 3675 r[dst] = temp;3650 callFrame[dst] = temp; 3676 3651 vPC += target; 3677 3652 NEXT_OPCODE; … … 3692 3667 int target = (++vPC)->u.operand; 3693 3668 3694 ScopeChainNode* tmp = scopeChain(r);3669 ScopeChainNode* tmp = callFrame->scopeChain(); 3695 3670 while (count--) 3696 3671 tmp = tmp->pop(); 3697 r[RegisterFile::ScopeChain] = tmp;3672 callFrame->setScopeChain(tmp); 3698 3673 3699 3674 vPC += target; … … 3711 3686 in dst for GC. 3712 3687 */ 3713 r[RegisterFile::ScopeChain] = createExceptionScope(exec, vPC, r);3688 callFrame->setScopeChain(createExceptionScope(callFrame, vPC)); 3714 3689 3715 3690 vPC += 4; … … 3727 3702 */ 3728 3703 ASSERT(exceptionValue); 3729 ASSERT(! exec->hadException());3704 ASSERT(!globalData->exception); 3730 3705 int ex = (++vPC)->u.operand; 3731 r[ex] = exceptionValue;3706 callFrame[ex] = exceptionValue; 3732 3707 exceptionValue = 0; 3733 3708 … … 3747 3722 3748 3723 int ex = (++vPC)->u.operand; 3749 exceptionValue = r[ex].jsValue(exec);3750 3751 handlerVPC = throwException( exec, exceptionValue, vPC, r, true);3724 exceptionValue = callFrame[ex].jsValue(callFrame); 3725 3726 handlerVPC = throwException(callFrame, exceptionValue, vPC, true); 3752 3727 if (!handlerVPC) { 3753 3728 *exception = exceptionValue; … … 3774 3749 int dst = (++vPC)->u.operand; 3775 3750 int src = (++vPC)->u.operand; 3776 r[dst] = codeBlock(r)->unexpectedConstants[src];3751 callFrame[dst] = callFrame->codeBlock()->unexpectedConstants[src]; 3777 3752 3778 3753 ++vPC; … … 3791 3766 int message = (++vPC)->u.operand; 3792 3767 3793 CodeBlock* codeBlock = this->codeBlock(r);3794 r[dst] = Error::create(exec, (ErrorType)type, codeBlock->unexpectedConstants[message]->toString(exec), codeBlock->lineNumberForVPC(vPC), codeBlock->ownerNode->sourceID(), codeBlock->ownerNode->sourceURL());3768 CodeBlock* codeBlock = callFrame->codeBlock(); 3769 callFrame[dst] = Error::create(callFrame, (ErrorType)type, codeBlock->unexpectedConstants[message]->toString(callFrame), codeBlock->lineNumberForVPC(vPC), codeBlock->ownerNode->sourceID(), codeBlock->ownerNode->sourceURL()); 3795 3770 3796 3771 ++vPC; … … 3804 3779 */ 3805 3780 3806 if (c odeBlock(r)->needsFullScopeChain) {3807 ScopeChainNode* scopeChain = this->scopeChain(r);3781 if (callFrame->codeBlock()->needsFullScopeChain) { 3782 ScopeChainNode* scopeChain = callFrame->scopeChain(); 3808 3783 ASSERT(scopeChain->refCount > 1); 3809 3784 scopeChain->deref(); 3810 3785 } 3811 3786 int result = (++vPC)->u.operand; 3812 return r[result].jsValue(exec);3787 return callFrame[result].jsValue(callFrame); 3813 3788 } 3814 3789 BEGIN_OPCODE(op_put_getter) { … … 3827 3802 int function = (++vPC)->u.operand; 3828 3803 3829 ASSERT( r[base].jsValue(exec)->isObject());3830 JSObject* baseObj = static_cast<JSObject*>( r[base].jsValue(exec));3831 Identifier& ident = c odeBlock(r)->identifiers[property];3832 ASSERT( r[function].jsValue(exec)->isObject());3833 baseObj->defineGetter( exec, ident, static_cast<JSObject*>(r[function].jsValue(exec)));3804 ASSERT(callFrame[base].jsValue(callFrame)->isObject()); 3805 JSObject* baseObj = static_cast<JSObject*>(callFrame[base].jsValue(callFrame)); 3806 Identifier& ident = callFrame->codeBlock()->identifiers[property]; 3807 ASSERT(callFrame[function].jsValue(callFrame)->isObject()); 3808 baseObj->defineGetter(callFrame, ident, static_cast<JSObject*>(callFrame[function].jsValue(callFrame))); 3834 3809 3835 3810 ++vPC; … … 3851 3826 int function = (++vPC)->u.operand; 3852 3827 3853 ASSERT( r[base].jsValue(exec)->isObject());3854 JSObject* baseObj = static_cast<JSObject*>( r[base].jsValue(exec));3855 Identifier& ident = c odeBlock(r)->identifiers[property];3856 ASSERT( r[function].jsValue(exec)->isObject());3857 baseObj->defineSetter( exec, ident, static_cast<JSObject*>(r[function].jsValue(exec)));3828 ASSERT(callFrame[base].jsValue(callFrame)->isObject()); 3829 JSObject* baseObj = static_cast<JSObject*>(callFrame[base].jsValue(callFrame)); 3830 Identifier& ident = callFrame->codeBlock()->identifiers[property]; 3831 ASSERT(callFrame[function].jsValue(callFrame)->isObject()); 3832 baseObj->defineSetter(callFrame, ident, static_cast<JSObject*>(callFrame[function].jsValue(callFrame))); 3858 3833 3859 3834 ++vPC; … … 3868 3843 int retAddrDst = (++vPC)->u.operand; 3869 3844 int target = (++vPC)->u.operand; 3870 r[retAddrDst] = vPC + 1;3845 callFrame[retAddrDst] = vPC + 1; 3871 3846 3872 3847 vPC += target; … … 3881 3856 */ 3882 3857 int retAddrSrc = (++vPC)->u.operand; 3883 vPC = r[retAddrSrc].vPC();3858 vPC = callFrame[retAddrSrc].vPC(); 3884 3859 NEXT_OPCODE; 3885 3860 } … … 3894 3869 int lastLine = (++vPC)->u.operand; 3895 3870 3896 debug( exec, r, static_cast<DebugHookID>(debugHookID), firstLine, lastLine);3871 debug(callFrame, static_cast<DebugHookID>(debugHookID), firstLine, lastLine); 3897 3872 3898 3873 ++vPC; … … 3906 3881 exceptionValue = createInterruptedExecutionException(globalData); 3907 3882 } 3908 handlerVPC = throwException( exec, exceptionValue, vPC, r, false);3883 handlerVPC = throwException(callFrame, exceptionValue, vPC, false); 3909 3884 if (!handlerVPC) { 3910 3885 *exception = exceptionValue; … … 3922 3897 #undef VM_CHECK_EXCEPTION 3923 3898 #undef CHECK_FOR_TIMEOUT 3924 #undef exec 3925 } 3926 3927 JSValue* Machine::retrieveArguments(ExecState* exec, JSFunction* function) const 3928 { 3929 Register* r = this->callFrame(exec, function); 3930 if (!r) 3899 } 3900 3901 JSValue* Machine::retrieveArguments(CallFrame* callFrame, JSFunction* function) const 3902 { 3903 CallFrame* functionCallFrame = findFunctionCallFrame(callFrame, function); 3904 if (!functionCallFrame) 3931 3905 return jsNull(); 3932 3906 3933 CodeBlock* codeBlock = Machine::codeBlock(r);3907 CodeBlock* codeBlock = functionCallFrame->codeBlock(); 3934 3908 if (codeBlock->usesArguments) { 3935 3909 ASSERT(codeBlock->codeType == FunctionCode); 3936 3910 SymbolTable& symbolTable = static_cast<FunctionBodyNode*>(codeBlock->ownerNode)->symbolTable(); 3937 int argumentsIndex = symbolTable.get( exec->propertyNames().arguments.ustring().rep()).getIndex();3938 return r[argumentsIndex].jsValue(exec);3939 } 3940 3941 Arguments* arguments = static_cast<Arguments*>(r[RegisterFile::OptionalCalleeArguments].getJSValue());3911 int argumentsIndex = symbolTable.get(functionCallFrame->propertyNames().arguments.ustring().rep()).getIndex(); 3912 return functionCallFrame[argumentsIndex].jsValue(callFrame); 3913 } 3914 3915 Arguments* arguments = functionCallFrame->optionalCalleeArguments(); 3942 3916 if (!arguments) { 3943 arguments = new ( exec) Arguments(exec, r);3917 arguments = new (functionCallFrame) Arguments(functionCallFrame); 3944 3918 arguments->copyRegisters(); 3945 r[RegisterFile::OptionalCalleeArguments] = arguments; 3946 } 3947 ASSERT(arguments->isObject(&Arguments::info)); 3919 callFrame->setCalleeArguments(arguments); 3920 } 3948 3921 3949 3922 return arguments; 3950 3923 } 3951 3924 3952 JSValue* Machine::retrieveCaller( ExecState* exec, InternalFunction* function) const3953 { 3954 Register* r = this->callFrame(exec, function);3955 if (! r)3925 JSValue* Machine::retrieveCaller(CallFrame* callFrame, InternalFunction* function) const 3926 { 3927 CallFrame* functionCallFrame = findFunctionCallFrame(callFrame, function); 3928 if (!functionCallFrame) 3956 3929 return jsNull(); 3957 3930 3958 Register* callerR = r[RegisterFile::CallerRegisters].r();3959 if ( isHostCallFrame(callerR))3931 CallFrame* callerFrame = functionCallFrame->callerFrame(); 3932 if (callerFrame->hasHostCallFrameFlag()) 3960 3933 return jsNull(); 3961 3934 3962 JSValue* caller = caller R[RegisterFile::Callee].jsValue(exec);3935 JSValue* caller = callerFrame->callee(); 3963 3936 if (!caller) 3964 3937 return jsNull(); … … 3967 3940 } 3968 3941 3969 void Machine::retrieveLastCaller( ExecState* exec, int& lineNumber, intptr_t& sourceID, UString& sourceURL, JSValue*& function) const3942 void Machine::retrieveLastCaller(CallFrame* callFrame, int& lineNumber, intptr_t& sourceID, UString& sourceURL, JSValue*& function) const 3970 3943 { 3971 3944 function = 0; … … 3973 3946 sourceURL = UString(); 3974 3947 3975 Register* r = exec->registers(); 3976 Register* callerR = r[RegisterFile::CallerRegisters].r(); 3977 if (isHostCallFrame(callerR)) 3948 CallFrame* callerFrame = callFrame->callerFrame(); 3949 if (callerFrame->hasHostCallFrameFlag()) 3978 3950 return; 3979 3951 3980 CodeBlock* callerCodeBlock = c odeBlock(callerR);3952 CodeBlock* callerCodeBlock = callerFrame->codeBlock(); 3981 3953 if (!callerCodeBlock) 3982 3954 return; 3983 3955 3984 Instruction* vPC = vPCForPC(callerCodeBlock, r[RegisterFile::ReturnPC].v());3956 Instruction* vPC = vPCForPC(callerCodeBlock, callFrame->returnPC()); 3985 3957 lineNumber = callerCodeBlock->lineNumberForVPC(vPC - 1); 3986 3958 sourceID = callerCodeBlock->ownerNode->sourceID(); 3987 3959 sourceURL = callerCodeBlock->ownerNode->sourceURL(); 3988 3989 JSValue* caller = callerR[RegisterFile::Callee].getJSValue(); 3990 if (!caller) 3991 return; 3992 3993 function = caller; 3994 } 3995 3996 Register* Machine::callFrame(ExecState* exec, InternalFunction* function) const 3997 { 3998 for (Register* r = exec->registers(); r; r = stripHostCallFrameBit(r[RegisterFile::CallerRegisters].r())) 3999 if (r[RegisterFile::Callee].getJSValue() == function) 4000 return r; 3960 function = callerFrame->callee(); 3961 } 3962 3963 CallFrame* Machine::findFunctionCallFrame(CallFrame* callFrame, InternalFunction* function) 3964 { 3965 for (CallFrame* candidate = callFrame; candidate; candidate = candidate->callerFrame()->removeHostCallFrameFlag()) { 3966 if (candidate->callee() == function) 3967 return candidate; 3968 } 4001 3969 return 0; 4002 3970 } 4003 3971 4004 void Machine::getArgumentsData(Register* callFrame, JSFunction*& function, ptrdiff_t& firstParameterIndex, Register*& argv, int& argc) 4005 { 4006 function = static_cast<JSFunction*>(callFrame[RegisterFile::Callee].getJSValue()); 4007 ASSERT(function->inherits(&JSFunction::info)); 3972 void Machine::getArgumentsData(CallFrame* callFrame, JSFunction*& function, ptrdiff_t& firstParameterIndex, Register*& argv, int& argc) 3973 { 3974 function = callFrame->callee(); 4008 3975 4009 3976 CodeBlock* codeBlock = &function->m_body->generatedByteCode(); 4010 3977 int numParameters = codeBlock->numParameters; 4011 argc = callFrame [RegisterFile::ArgumentCount].i();3978 argc = callFrame->argumentCount(); 4012 3979 4013 3980 if (argc <= numParameters) 4014 argv = callFrame - RegisterFile::CallFrameHeaderSize - numParameters + 1; // + 1 to skip "this"3981 argv = callFrame->registers() - RegisterFile::CallFrameHeaderSize - numParameters + 1; // + 1 to skip "this" 4015 3982 else 4016 argv = callFrame - RegisterFile::CallFrameHeaderSize - numParameters - argc + 1; // + 1 to skip "this"3983 argv = callFrame->registers() - RegisterFile::CallFrameHeaderSize - numParameters - argc + 1; // + 1 to skip "this" 4017 3984 4018 3985 argc -= 1; // - 1 to skip "this" … … 4027 3994 } 4028 3995 4029 NEVER_INLINE void Machine::tryCTICachePutByID( ExecState* exec, CodeBlock* codeBlock, void* returnAddress, JSValue* baseValue, const PutPropertySlot& slot)3996 NEVER_INLINE void Machine::tryCTICachePutByID(CallFrame* callFrame, CodeBlock* codeBlock, void* returnAddress, JSValue* baseValue, const PutPropertySlot& slot) 4030 3997 { 4031 3998 // The interpreter checks for recursion here; I do not believe this can occur in CTI. … … 4069 4036 StructureIDChain* chain = structureID->cachedPrototypeChain(); 4070 4037 if (!chain) { 4071 chain = cachePrototypeChain( exec, structureID);4038 chain = cachePrototypeChain(callFrame, structureID); 4072 4039 if (!chain) { 4073 4040 // This happens if someone has manually inserted null into the prototype chain … … 4079 4046 vPC[7] = slot.cachedOffset(); 4080 4047 codeBlock->refStructureIDs(vPC); 4081 CTI::compilePutByIdTransition(this, exec, codeBlock, structureID->previousID(), structureID, slot.cachedOffset(), chain, returnAddress);4048 CTI::compilePutByIdTransition(this, callFrame, codeBlock, structureID->previousID(), structureID, slot.cachedOffset(), chain, returnAddress); 4082 4049 return; 4083 4050 } … … 4089 4056 4090 4057 #if USE(CTI_REPATCH_PIC) 4091 UNUSED_PARAM( exec);4058 UNUSED_PARAM(callFrame); 4092 4059 CTI::patchPutByIdReplace(codeBlock, structureID, slot.cachedOffset(), returnAddress); 4093 4060 #else 4094 CTI::compilePutByIdReplace(this, exec, codeBlock, structureID, slot.cachedOffset(), returnAddress);4061 CTI::compilePutByIdReplace(this, callFrame, codeBlock, structureID, slot.cachedOffset(), returnAddress); 4095 4062 #endif 4096 4063 } 4097 4064 4098 void* Machine::getCTIArrayLengthTrampoline( ExecState* exec, CodeBlock* codeBlock)4065 void* Machine::getCTIArrayLengthTrampoline(CallFrame* callFrame, CodeBlock* codeBlock) 4099 4066 { 4100 4067 if (!m_ctiArrayLengthTrampoline) 4101 m_ctiArrayLengthTrampoline = CTI::compileArrayLengthTrampoline(this, exec, codeBlock);4068 m_ctiArrayLengthTrampoline = CTI::compileArrayLengthTrampoline(this, callFrame, codeBlock); 4102 4069 4103 4070 return m_ctiArrayLengthTrampoline; 4104 4071 } 4105 4072 4106 void* Machine::getCTIStringLengthTrampoline( ExecState* exec, CodeBlock* codeBlock)4073 void* Machine::getCTIStringLengthTrampoline(CallFrame* callFrame, CodeBlock* codeBlock) 4107 4074 { 4108 4075 if (!m_ctiStringLengthTrampoline) 4109 m_ctiStringLengthTrampoline = CTI::compileStringLengthTrampoline(this, exec, codeBlock);4076 m_ctiStringLengthTrampoline = CTI::compileStringLengthTrampoline(this, callFrame, codeBlock); 4110 4077 4111 4078 return m_ctiStringLengthTrampoline; 4112 4079 } 4113 4080 4114 NEVER_INLINE void Machine::tryCTICacheGetByID( ExecState* exec, CodeBlock* codeBlock, void* returnAddress, JSValue* baseValue, const Identifier& propertyName, const PropertySlot& slot)4081 NEVER_INLINE void Machine::tryCTICacheGetByID(CallFrame* callFrame, CodeBlock* codeBlock, void* returnAddress, JSValue* baseValue, const Identifier& propertyName, const PropertySlot& slot) 4115 4082 { 4116 4083 // FIXME: Write a test that proves we need to check for recursion here just … … 4123 4090 } 4124 4091 4125 if (isJSArray(baseValue) && propertyName == exec->propertyNames().length) {4092 if (isJSArray(baseValue) && propertyName == callFrame->propertyNames().length) { 4126 4093 #if USE(CTI_REPATCH_PIC) 4127 CTI::compilePatchGetArrayLength(this, exec, codeBlock, returnAddress);4094 CTI::compilePatchGetArrayLength(this, callFrame, codeBlock, returnAddress); 4128 4095 #else 4129 ctiRepatchCallByReturnAddress(returnAddress, getCTIArrayLengthTrampoline( exec, codeBlock));4096 ctiRepatchCallByReturnAddress(returnAddress, getCTIArrayLengthTrampoline(callFrame, codeBlock)); 4130 4097 #endif 4131 4098 return; 4132 4099 } 4133 if (isJSString(baseValue) && propertyName == exec->propertyNames().length) {4100 if (isJSString(baseValue) && propertyName == callFrame->propertyNames().length) { 4134 4101 // The tradeoff of compiling an repatched inline string length access routine does not seem 4135 4102 // to pay off, so we currently only do this for arrays. 4136 ctiRepatchCallByReturnAddress(returnAddress, getCTIStringLengthTrampoline( exec, codeBlock));4103 ctiRepatchCallByReturnAddress(returnAddress, getCTIStringLengthTrampoline(callFrame, codeBlock)); 4137 4104 return; 4138 4105 } … … 4170 4137 CTI::patchGetByIdSelf(codeBlock, structureID, slot.cachedOffset(), returnAddress); 4171 4138 #else 4172 CTI::compileGetByIdSelf(this, exec, codeBlock, structureID, slot.cachedOffset(), returnAddress);4139 CTI::compileGetByIdSelf(this, callFrame, codeBlock, structureID, slot.cachedOffset(), returnAddress); 4173 4140 #endif 4174 4141 return; 4175 4142 } 4176 4143 4177 if (slot.slotBase() == structureID->prototypeForLookup( exec)) {4144 if (slot.slotBase() == structureID->prototypeForLookup(callFrame)) { 4178 4145 ASSERT(slot.slotBase()->isObject()); 4179 4146 … … 4194 4161 codeBlock->refStructureIDs(vPC); 4195 4162 4196 CTI::compileGetByIdProto(this, exec, codeBlock, structureID, slotBaseObject->structureID(), slot.cachedOffset(), returnAddress);4163 CTI::compileGetByIdProto(this, callFrame, codeBlock, structureID, slotBaseObject->structureID(), slot.cachedOffset(), returnAddress); 4197 4164 return; 4198 4165 } … … 4201 4168 JSObject* o = static_cast<JSObject*>(baseValue); 4202 4169 while (slot.slotBase() != o) { 4203 JSValue* v = o->structureID()->prototypeForLookup( exec);4170 JSValue* v = o->structureID()->prototypeForLookup(callFrame); 4204 4171 4205 4172 // If we didn't find slotBase in baseValue's prototype chain, then baseValue … … 4226 4193 StructureIDChain* chain = structureID->cachedPrototypeChain(); 4227 4194 if (!chain) 4228 chain = cachePrototypeChain( exec, structureID);4195 chain = cachePrototypeChain(callFrame, structureID); 4229 4196 4230 4197 ASSERT(chain); … … 4236 4203 codeBlock->refStructureIDs(vPC); 4237 4204 4238 CTI::compileGetByIdChain(this, exec, codeBlock, structureID, chain, count, slot.cachedOffset(), returnAddress);4205 CTI::compileGetByIdChain(this, callFrame, codeBlock, structureID, chain, count, slot.cachedOffset(), returnAddress); 4239 4206 } 4240 4207 … … 4291 4258 { 4292 4259 JSValue* v1 = ARG_src1; 4293 ExecState* exec = ARG_exec;4294 4295 JSObject* result = v1->toThisObject( exec);4260 CallFrame* callFrame = ARG_callFrame; 4261 4262 JSObject* result = v1->toThisObject(callFrame); 4296 4263 VM_CHECK_EXCEPTION_AT_END(); 4297 4264 return result; … … 4300 4267 void Machine::cti_op_end(CTI_ARGS) 4301 4268 { 4302 Register* r = ARG_r; 4303 ScopeChainNode* scopeChain = Machine::scopeChain(r); 4269 ScopeChainNode* scopeChain = ARG_callFrame->scopeChain(); 4304 4270 ASSERT(scopeChain->refCount > 1); 4305 4271 scopeChain->deref(); … … 4318 4284 return jsNumber(ARG_globalData, left + right); 4319 4285 4320 ExecState* exec = ARG_exec;4286 CallFrame* callFrame = ARG_callFrame; 4321 4287 4322 4288 bool leftIsString = v1->isString(); … … 4324 4290 RefPtr<UString::Rep> value = concatenate(static_cast<JSString*>(v1)->value().rep(), static_cast<JSString*>(v2)->value().rep()); 4325 4291 if (UNLIKELY(!value)) { 4326 throwOutOfMemoryError( exec);4292 throwOutOfMemoryError(callFrame); 4327 4293 VM_THROW_EXCEPTION(); 4328 4294 } … … 4337 4303 4338 4304 if (UNLIKELY(!value)) { 4339 throwOutOfMemoryError( exec);4305 throwOutOfMemoryError(callFrame); 4340 4306 VM_THROW_EXCEPTION(); 4341 4307 } … … 4344 4310 4345 4311 // All other cases are pretty uncommon 4346 JSValue* result = jsAddSlowCase( exec, v1, v2);4312 JSValue* result = jsAddSlowCase(callFrame, v1, v2); 4347 4313 VM_CHECK_EXCEPTION_AT_END(); 4348 4314 return result; … … 4353 4319 JSValue* v = ARG_src1; 4354 4320 4355 ExecState* exec = ARG_exec;4356 JSValue* result = jsNumber(ARG_globalData, v->toNumber( exec) + 1);4321 CallFrame* callFrame = ARG_callFrame; 4322 JSValue* result = jsNumber(ARG_globalData, v->toNumber(callFrame) + 1); 4357 4323 VM_CHECK_EXCEPTION_AT_END(); 4358 4324 return result; … … 4361 4327 void Machine::cti_timeout_check(CTI_ARGS) 4362 4328 { 4363 if (ARG_globalData->machine->checkTimeout(ARG_ exec->dynamicGlobalObject())) {4329 if (ARG_globalData->machine->checkTimeout(ARG_callFrame->dynamicGlobalObject())) { 4364 4330 ARG_globalData->exception = createInterruptedExecutionException(ARG_globalData); 4365 4331 VM_THROW_EXCEPTION_AT_END(); … … 4371 4337 JSValue* src1 = ARG_src1; 4372 4338 JSValue* src2 = ARG_src2; 4373 ExecState* exec = ARG_exec;4374 4375 bool result = jsLess( exec, src1, src2);4339 CallFrame* callFrame = ARG_callFrame; 4340 4341 bool result = jsLess(callFrame, src1, src2); 4376 4342 VM_CHECK_EXCEPTION_AT_END(); 4377 4343 return result; … … 4382 4348 JSValue* src1 = ARG_src1; 4383 4349 JSValue* src2 = ARG_src2; 4384 ExecState* exec = ARG_exec;4385 4386 bool result = jsLessEq( exec, src1, src2);4350 CallFrame* callFrame = ARG_callFrame; 4351 4352 bool result = jsLessEq(callFrame, src1, src2); 4387 4353 VM_CHECK_EXCEPTION_AT_END(); 4388 4354 return result; … … 4391 4357 JSValue* Machine::cti_op_new_object(CTI_ARGS) 4392 4358 { 4393 return constructEmptyObject(ARG_ exec);;4359 return constructEmptyObject(ARG_callFrame);; 4394 4360 } 4395 4361 4396 4362 void Machine::cti_op_put_by_id(CTI_ARGS) 4397 4363 { 4398 ExecState* exec = ARG_exec;4364 CallFrame* callFrame = ARG_callFrame; 4399 4365 Identifier& ident = *ARG_id2; 4400 4366 4401 4367 PutPropertySlot slot; 4402 ARG_src1->put( exec, ident, ARG_src3, slot);4368 ARG_src1->put(callFrame, ident, ARG_src3, slot); 4403 4369 4404 4370 ctiRepatchCallByReturnAddress(CTI_RETURN_ADDRESS, (void*)cti_op_put_by_id_second); … … 4409 4375 void Machine::cti_op_put_by_id_second(CTI_ARGS) 4410 4376 { 4411 ExecState* exec = ARG_exec; 4377 PutPropertySlot slot; 4378 ARG_src1->put(ARG_callFrame, *ARG_id2, ARG_src3, slot); 4379 ARG_globalData->machine->tryCTICachePutByID(ARG_callFrame, ARG_callFrame->codeBlock(), CTI_RETURN_ADDRESS, ARG_src1, slot); 4380 VM_CHECK_EXCEPTION_AT_END(); 4381 } 4382 4383 void Machine::cti_op_put_by_id_generic(CTI_ARGS) 4384 { 4385 PutPropertySlot slot; 4386 ARG_src1->put(ARG_callFrame, *ARG_id2, ARG_src3, slot); 4387 VM_CHECK_EXCEPTION_AT_END(); 4388 } 4389 4390 void Machine::cti_op_put_by_id_fail(CTI_ARGS) 4391 { 4392 CallFrame* callFrame = ARG_callFrame; 4412 4393 Identifier& ident = *ARG_id2; 4413 4394 4414 JSValue* baseValue = ARG_src1;4415 4395 PutPropertySlot slot; 4416 baseValue->put(exec, ident, ARG_src3, slot); 4417 4418 Register* r = ARG_r; 4419 ARG_globalData->machine->tryCTICachePutByID(exec, codeBlock(r), CTI_RETURN_ADDRESS, baseValue, slot); 4420 4421 VM_CHECK_EXCEPTION_AT_END(); 4422 } 4423 4424 void Machine::cti_op_put_by_id_generic(CTI_ARGS) 4425 { 4426 ExecState* exec = ARG_exec; 4427 Identifier& ident = *ARG_id2; 4428 4429 PutPropertySlot slot; 4430 ARG_src1->put(exec, ident, ARG_src3, slot); 4431 4432 VM_CHECK_EXCEPTION_AT_END(); 4433 } 4434 4435 void Machine::cti_op_put_by_id_fail(CTI_ARGS) 4436 { 4437 ExecState* exec = ARG_exec; 4438 Identifier& ident = *ARG_id2; 4439 4440 PutPropertySlot slot; 4441 ARG_src1->put(exec, ident, ARG_src3, slot); 4396 ARG_src1->put(callFrame, ident, ARG_src3, slot); 4442 4397 4443 4398 // should probably uncachePutByID() ... this would mean doing a vPC lookup - might be worth just bleeding this until the end. … … 4449 4404 JSValue* Machine::cti_op_get_by_id(CTI_ARGS) 4450 4405 { 4451 ExecState* exec = ARG_exec;4406 CallFrame* callFrame = ARG_callFrame; 4452 4407 Identifier& ident = *ARG_id2; 4453 4408 4454 4409 JSValue* baseValue = ARG_src1; 4455 4410 PropertySlot slot(baseValue); 4456 JSValue* result = baseValue->get( exec, ident, slot);4411 JSValue* result = baseValue->get(callFrame, ident, slot); 4457 4412 4458 4413 ctiRepatchCallByReturnAddress(CTI_RETURN_ADDRESS, (void*)cti_op_get_by_id_second); … … 4464 4419 JSValue* Machine::cti_op_get_by_id_second(CTI_ARGS) 4465 4420 { 4466 ExecState* exec = ARG_exec;4421 CallFrame* callFrame = ARG_callFrame; 4467 4422 Identifier& ident = *ARG_id2; 4468 4423 4469 4424 JSValue* baseValue = ARG_src1; 4470 4425 PropertySlot slot(baseValue); 4471 JSValue* result = baseValue->get(exec, ident, slot); 4472 4473 Register* r = ARG_r; 4474 ARG_globalData->machine->tryCTICacheGetByID(exec, codeBlock(r), CTI_RETURN_ADDRESS, baseValue, ident, slot); 4426 JSValue* result = baseValue->get(callFrame, ident, slot); 4427 4428 ARG_globalData->machine->tryCTICacheGetByID(callFrame, callFrame->codeBlock(), CTI_RETURN_ADDRESS, baseValue, ident, slot); 4475 4429 4476 4430 VM_CHECK_EXCEPTION_AT_END(); … … 4480 4434 JSValue* Machine::cti_op_get_by_id_generic(CTI_ARGS) 4481 4435 { 4482 ExecState* exec = ARG_exec;4436 CallFrame* callFrame = ARG_callFrame; 4483 4437 Identifier& ident = *ARG_id2; 4484 4438 4485 4439 JSValue* baseValue = ARG_src1; 4486 4440 PropertySlot slot(baseValue); 4487 JSValue* result = baseValue->get( exec, ident, slot);4441 JSValue* result = baseValue->get(callFrame, ident, slot); 4488 4442 4489 4443 VM_CHECK_EXCEPTION_AT_END(); … … 4493 4447 JSValue* Machine::cti_op_get_by_id_fail(CTI_ARGS) 4494 4448 { 4495 ExecState* exec = ARG_exec;4449 CallFrame* callFrame = ARG_callFrame; 4496 4450 Identifier& ident = *ARG_id2; 4497 4451 4498 4452 JSValue* baseValue = ARG_src1; 4499 4453 PropertySlot slot(baseValue); 4500 JSValue* result = baseValue->get( exec, ident, slot);4454 JSValue* result = baseValue->get(callFrame, ident, slot); 4501 4455 4502 4456 // should probably uncacheGetByID() ... this would mean doing a vPC lookup - might be worth just bleeding this until the end. … … 4509 4463 JSValue* Machine::cti_op_instanceof(CTI_ARGS) 4510 4464 { 4511 ExecState* exec = ARG_exec;4465 CallFrame* callFrame = ARG_callFrame; 4512 4466 JSValue* value = ARG_src1; 4513 4467 JSValue* baseVal = ARG_src2; … … 4523 4477 4524 4478 if (!baseVal->isObject()) { 4525 Register* r = ARG_r;4526 CodeBlock* codeBlock = Machine::codeBlock(r);4479 CallFrame* callFrame = ARG_callFrame; 4480 CodeBlock* codeBlock = callFrame->codeBlock(); 4527 4481 ASSERT(codeBlock->ctiReturnAddressVPCMap.contains(CTI_RETURN_ADDRESS)); 4528 4482 unsigned vPCIndex = codeBlock->ctiReturnAddressVPCMap.get(CTI_RETURN_ADDRESS); 4529 ARG_globalData->exception = createInvalidParamError( exec, "instanceof", baseVal, codeBlock->instructions.begin() + vPCIndex, codeBlock);4483 ARG_globalData->exception = createInvalidParamError(callFrame, "instanceof", baseVal, codeBlock->instructions.begin() + vPCIndex, codeBlock); 4530 4484 VM_THROW_EXCEPTION(); 4531 4485 } … … 4535 4489 4536 4490 if (!proto->isObject()) { 4537 throwError( exec, TypeError, "instanceof called on an object with an invalid prototype property.");4491 throwError(callFrame, TypeError, "instanceof called on an object with an invalid prototype property."); 4538 4492 VM_THROW_EXCEPTION(); 4539 4493 } … … 4542 4496 return jsBoolean(false); 4543 4497 4544 JSValue* result = jsBoolean(static_cast<JSObject*>(baseCell)->hasInstance( exec, valueCell, protoCell));4498 JSValue* result = jsBoolean(static_cast<JSObject*>(baseCell)->hasInstance(callFrame, valueCell, protoCell)); 4545 4499 VM_CHECK_EXCEPTION_AT_END(); 4546 4500 … … 4550 4504 JSValue* Machine::cti_op_del_by_id(CTI_ARGS) 4551 4505 { 4552 ExecState* exec = ARG_exec;4506 CallFrame* callFrame = ARG_callFrame; 4553 4507 Identifier& ident = *ARG_id2; 4554 4508 4555 JSObject* baseObj = ARG_src1->toObject( exec);4556 4557 JSValue* result = jsBoolean(baseObj->deleteProperty( exec, ident));4509 JSObject* baseObj = ARG_src1->toObject(callFrame); 4510 4511 JSValue* result = jsBoolean(baseObj->deleteProperty(callFrame, ident)); 4558 4512 VM_CHECK_EXCEPTION_AT_END(); 4559 4513 return result; … … 4570 4524 return jsNumber(ARG_globalData, left * right); 4571 4525 4572 ExecState* exec = ARG_exec;4573 JSValue* result = jsNumber(ARG_globalData, src1->toNumber( exec) * src2->toNumber(exec));4526 CallFrame* callFrame = ARG_callFrame; 4527 JSValue* result = jsNumber(ARG_globalData, src1->toNumber(callFrame) * src2->toNumber(callFrame)); 4574 4528 VM_CHECK_EXCEPTION_AT_END(); 4575 4529 return result; … … 4578 4532 JSValue* Machine::cti_op_new_func(CTI_ARGS) 4579 4533 { 4580 return ARG_func1->makeFunction(ARG_ exec, Machine::scopeChain(ARG_r));4534 return ARG_func1->makeFunction(ARG_callFrame, ARG_callFrame->scopeChain()); 4581 4535 } 4582 4536 … … 4589 4543 4590 4544 if (UNLIKELY(*ARG_profilerReference != 0)) 4591 (*ARG_profilerReference)->willExecute( CallFrame::create(ARG_r), static_cast<JSObject*>(ARG_src1));4545 (*ARG_profilerReference)->willExecute(ARG_callFrame, static_cast<JSFunction*>(ARG_src1)); 4592 4546 4593 4547 ScopeChainNode* callDataScopeChain = static_cast<JSFunction*>(ARG_src1)->m_scopeChain.node(); 4594 4548 CodeBlock* newCodeBlock = &static_cast<JSFunction*>(ARG_src1)->m_body->byteCode(callDataScopeChain); 4595 4549 4596 Register* r = slideRegisterWindowForCall(newCodeBlock, ARG_registerFile, ARG_r, ARG_int2, ARG_int3);4597 if (UNLIKELY(! r)) {4598 ARG_globalData->exception = createStackOverflowError( CallFrame::create(ARG_r));4550 CallFrame* callFrame = slideRegisterWindowForCall(newCodeBlock, ARG_registerFile, ARG_callFrame, ARG_int2, ARG_int3); 4551 if (UNLIKELY(!callFrame)) { 4552 ARG_globalData->exception = createStackOverflowError(ARG_callFrame); 4599 4553 VM_THROW_EXCEPTION_2(); 4600 4554 } 4601 4555 4602 VoidPtrPair pair = { newCodeBlock, r};4556 VoidPtrPair pair = { newCodeBlock, callFrame }; 4603 4557 return pair; 4604 4558 } … … 4606 4560 void* Machine::cti_vm_compile(CTI_ARGS) 4607 4561 { 4608 Register* r = ARG_r; 4609 CodeBlock* codeBlock = Machine::codeBlock(r); 4610 4562 CodeBlock* codeBlock = ARG_callFrame->codeBlock(); 4611 4563 if (!codeBlock->ctiCode) 4612 CTI::compile(ARG_globalData->machine, CallFrame::create(r), codeBlock); 4613 4564 CTI::compile(ARG_globalData->machine, ARG_callFrame, codeBlock); 4614 4565 return codeBlock->ctiCode; 4615 4566 } … … 4617 4568 JSValue* Machine::cti_op_push_activation(CTI_ARGS) 4618 4569 { 4619 ExecState* exec = ARG_exec; 4620 Register* r = ARG_r; 4621 CodeBlock* codeBlock = Machine::codeBlock(r); 4622 ScopeChainNode* scopeChain = Machine::scopeChain(r); 4623 4624 JSActivation* activation = new (ARG_globalData) JSActivation(exec, static_cast<FunctionBodyNode*>(codeBlock->ownerNode), r); 4625 r[RegisterFile::ScopeChain] = scopeChain->copy()->push(activation); 4570 JSActivation* activation = new (ARG_globalData) JSActivation(ARG_callFrame, static_cast<FunctionBodyNode*>(ARG_callFrame->codeBlock()->ownerNode)); 4571 ARG_callFrame->setScopeChain(ARG_callFrame->scopeChain()->copy()->push(activation)); 4626 4572 return activation; 4627 4573 } … … 4639 4585 int registerOffset = ARG_int2; 4640 4586 int argCount = ARG_int3; 4641 Register* savedR = ARG_r;4642 Register* r = savedR + registerOffset;4643 4644 initializeCallFrame(r, 0, ARG_instr4 + 1, scopeChain(savedR), savedR, 0, argCount, funcVal);4645 ARG_set R(r);4587 CallFrame* previousCallFrame = ARG_callFrame; 4588 CallFrame* callFrame = CallFrame::create(previousCallFrame->registers() + registerOffset); 4589 4590 callFrame->init(0, ARG_instr4 + 1, previousCallFrame->scopeChain(), previousCallFrame, 0, argCount, static_cast<JSFunction*>(funcVal)); 4591 ARG_setCallFrame(callFrame); 4646 4592 4647 4593 if (*ARG_profilerReference) 4648 (*ARG_profilerReference)->willExecute( CallFrame::create(r), static_cast<JSObject*>(funcVal));4649 4650 Register* argv = r- RegisterFile::CallFrameHeaderSize - argCount;4594 (*ARG_profilerReference)->willExecute(callFrame, static_cast<JSFunction*>(funcVal)); 4595 4596 Register* argv = ARG_callFrame->registers() - RegisterFile::CallFrameHeaderSize - argCount; 4651 4597 ArgList argList(argv + 1, argCount - 1); 4652 4598 4653 4599 CTI_MACHINE_SAMPLING_callingHostFunction(); 4654 4600 4655 JSValue* returnValue = callData.native.function( CallFrame::create(r), static_cast<JSObject*>(funcVal), argv[0].jsValue(CallFrame::create(r)), argList);4656 ARG_set R(savedR);4601 JSValue* returnValue = callData.native.function(callFrame, static_cast<JSFunction*>(funcVal), argv[0].jsValue(callFrame), argList); 4602 ARG_setCallFrame(previousCallFrame); 4657 4603 VM_CHECK_EXCEPTION(); 4658 4604 4659 4605 if (*ARG_profilerReference) 4660 (*ARG_profilerReference)->didExecute( CallFrame::create(savedR), static_cast<JSObject*>(funcVal));4606 (*ARG_profilerReference)->didExecute(previousCallFrame, static_cast<JSFunction*>(funcVal)); 4661 4607 4662 4608 return returnValue; … … 4665 4611 ASSERT(callType == CallTypeNone); 4666 4612 4667 ARG_globalData->exception = createNotAFunctionError( CallFrame::create(ARG_r), funcVal, ARG_instr4, codeBlock(ARG_r));4613 ARG_globalData->exception = createNotAFunctionError(ARG_callFrame, funcVal, ARG_instr4, ARG_callFrame->codeBlock()); 4668 4614 VM_THROW_EXCEPTION(); 4669 4615 } … … 4671 4617 void Machine::cti_op_create_arguments(CTI_ARGS) 4672 4618 { 4673 ExecState* exec = ARG_exec; 4674 Register* r = ARG_r; 4675 4676 Arguments* arguments = new (ARG_globalData) Arguments(exec, r); 4677 r[RegisterFile::OptionalCalleeArguments] = arguments; 4678 r[RegisterFile::ArgumentsRegister] = arguments; 4619 Arguments* arguments = new (ARG_globalData) Arguments(ARG_callFrame); 4620 ARG_callFrame->setCalleeArguments(arguments); 4621 ARG_callFrame[RegisterFile::ArgumentsRegister] = arguments; 4679 4622 } 4680 4623 4681 4624 void Machine::cti_op_tear_off_activation(CTI_ARGS) 4682 4625 { 4683 Register* r = ARG_r; 4684 4685 JSActivation* activation = static_cast<JSActivation*>(ARG_src1); 4686 ASSERT(codeBlock(r)->needsFullScopeChain); 4687 ASSERT(activation->isObject(&JSActivation::info)); 4688 4689 Arguments* arguments = static_cast<Arguments*>(r[RegisterFile::OptionalCalleeArguments].getJSValue()); 4690 ASSERT(!arguments || arguments->isObject(&Arguments::info)); 4691 activation->copyRegisters(arguments); 4626 ASSERT(ARG_callFrame->codeBlock()->needsFullScopeChain); 4627 ASSERT(ARG_src1->isObject(&JSActivation::info)); 4628 static_cast<JSActivation*>(ARG_src1)->copyRegisters(ARG_callFrame->optionalCalleeArguments()); 4692 4629 } 4693 4630 4694 4631 void Machine::cti_op_tear_off_arguments(CTI_ARGS) 4695 4632 { 4696 Register* r = ARG_r; 4697 4698 Arguments* arguments = static_cast<Arguments*>(r[RegisterFile::OptionalCalleeArguments].getJSValue()); 4699 ASSERT(codeBlock(r)->usesArguments && !codeBlock(r)->needsFullScopeChain); 4700 ASSERT(arguments->isObject(&Arguments::info)); 4701 4702 arguments->copyRegisters(); 4633 ASSERT(ARG_callFrame->codeBlock()->usesArguments && !ARG_callFrame->codeBlock()->needsFullScopeChain); 4634 ARG_callFrame->optionalCalleeArguments()->copyRegisters(); 4703 4635 } 4704 4636 4705 4637 void Machine::cti_op_ret_profiler(CTI_ARGS) 4706 4638 { 4707 ExecState* exec = ARG_exec;4708 4709 Register* r = ARG_r;4710 4639 ASSERT(*ARG_profilerReference); 4711 (*ARG_profilerReference)->didExecute( exec, static_cast<JSObject*>(r[RegisterFile::Callee].jsValue(exec)));4640 (*ARG_profilerReference)->didExecute(ARG_callFrame, ARG_callFrame->callee()); 4712 4641 } 4713 4642 4714 4643 void Machine::cti_op_ret_scopeChain(CTI_ARGS) 4715 4644 { 4716 Register* r = ARG_r; 4717 ASSERT(codeBlock(r)->needsFullScopeChain); 4718 scopeChain(r)->deref(); 4645 ASSERT(ARG_callFrame->codeBlock()->needsFullScopeChain); 4646 ARG_callFrame->scopeChain()->deref(); 4719 4647 } 4720 4648 4721 4649 JSValue* Machine::cti_op_new_array(CTI_ARGS) 4722 4650 { 4723 ArgList arg sList(ARG_registers1, ARG_int2);4724 return constructArray(ARG_ exec, argsList);4651 ArgList argList(ARG_registers1, ARG_int2); 4652 return constructArray(ARG_callFrame, argList); 4725 4653 } 4726 4654 4727 4655 JSValue* Machine::cti_op_resolve(CTI_ARGS) 4728 4656 { 4729 ExecState* exec = ARG_exec; 4730 Register* r = ARG_r; 4731 ScopeChainNode* scopeChain = Machine::scopeChain(r); 4657 CallFrame* callFrame = ARG_callFrame; 4658 ScopeChainNode* scopeChain = callFrame->scopeChain(); 4732 4659 4733 4660 ScopeChainIterator iter = scopeChain->begin(); … … 4739 4666 JSObject* o = *iter; 4740 4667 PropertySlot slot(o); 4741 if (o->getPropertySlot( exec, ident, slot)) {4742 JSValue* result = slot.getValue( exec, ident);4668 if (o->getPropertySlot(callFrame, ident, slot)) { 4669 JSValue* result = slot.getValue(callFrame, ident); 4743 4670 VM_CHECK_EXCEPTION_AT_END(); 4744 4671 return result; … … 4746 4673 } while (++iter != end); 4747 4674 4748 CodeBlock* codeBlock = Machine::codeBlock(r);4675 CodeBlock* codeBlock = callFrame->codeBlock(); 4749 4676 ASSERT(codeBlock->ctiReturnAddressVPCMap.contains(CTI_RETURN_ADDRESS)); 4750 4677 unsigned vPCIndex = codeBlock->ctiReturnAddressVPCMap.get(CTI_RETURN_ADDRESS); 4751 exec->setException(createUndefinedVariableError(exec, ident, codeBlock->instructions.begin() + vPCIndex, codeBlock));4678 ARG_globalData->exception = createUndefinedVariableError(callFrame, ident, codeBlock->instructions.begin() + vPCIndex, codeBlock); 4752 4679 VM_THROW_EXCEPTION(); 4753 4680 } … … 4756 4683 { 4757 4684 RegisterFile* registerFile = ARG_registerFile; 4758 Register* r = ARG_r;4685 CallFrame* callFrame = ARG_callFrame; 4759 4686 4760 4687 JSFunction* constructor = static_cast<JSFunction*>(ARG_src1); … … 4770 4697 4771 4698 if (*ARG_profilerReference) 4772 (*ARG_profilerReference)->willExecute( CallFrame::create(r), constructor);4699 (*ARG_profilerReference)->willExecute(callFrame, constructor); 4773 4700 4774 4701 ScopeChainNode* callDataScopeChain = constructor->m_scopeChain.node(); … … 4783 4710 JSObject* newObject = new (ARG_globalData) JSObject(structure); 4784 4711 4785 r[firstArg] = newObject; // "this" value4786 4787 r = slideRegisterWindowForCall(newCodeBlock, registerFile, r, registerOffset, argCount);4788 if (UNLIKELY(! r)) {4789 ARG_globalData->exception = createStackOverflowError( CallFrame::create(ARG_r));4712 callFrame[firstArg] = newObject; // "this" value 4713 4714 callFrame = slideRegisterWindowForCall(newCodeBlock, registerFile, callFrame, registerOffset, argCount); 4715 if (UNLIKELY(!callFrame)) { 4716 ARG_globalData->exception = createStackOverflowError(ARG_callFrame); 4790 4717 VM_THROW_EXCEPTION_2(); 4791 4718 } 4792 4719 4793 VoidPtrPair pair = { newCodeBlock, r};4720 VoidPtrPair pair = { newCodeBlock, callFrame }; 4794 4721 return pair; 4795 4722 } … … 4797 4724 JSValue* Machine::cti_op_construct_NotJSConstruct(CTI_ARGS) 4798 4725 { 4799 ExecState* exec = ARG_exec; 4800 Register* r = ARG_r; 4726 CallFrame* callFrame = ARG_callFrame; 4801 4727 4802 4728 JSValue* constrVal = ARG_src1; … … 4811 4737 if (constructType == ConstructTypeHost) { 4812 4738 if (*ARG_profilerReference) 4813 (*ARG_profilerReference)->willExecute( exec, constructor);4814 4815 ArgList argList( r+ firstArg + 1, argCount - 1);4739 (*ARG_profilerReference)->willExecute(callFrame, constructor); 4740 4741 ArgList argList(callFrame->registers() + firstArg + 1, argCount - 1); 4816 4742 4817 4743 CTI_MACHINE_SAMPLING_callingHostFunction(); 4818 4744 4819 JSValue* returnValue = constructData.native.function( exec, constructor, argList);4745 JSValue* returnValue = constructData.native.function(callFrame, constructor, argList); 4820 4746 VM_CHECK_EXCEPTION(); 4821 4747 4822 4748 if (*ARG_profilerReference) 4823 (*ARG_profilerReference)->didExecute( exec, constructor);4749 (*ARG_profilerReference)->didExecute(callFrame, constructor); 4824 4750 4825 4751 return returnValue; … … 4828 4754 ASSERT(constructType == ConstructTypeNone); 4829 4755 4830 exec->setException(createNotAConstructorError(exec, constrVal, ARG_instr6, codeBlock(r)));4756 ARG_globalData->exception = createNotAConstructorError(callFrame, constrVal, ARG_instr6, callFrame->codeBlock()); 4831 4757 VM_THROW_EXCEPTION(); 4832 4758 } … … 4834 4760 JSValue* Machine::cti_op_get_by_val(CTI_ARGS) 4835 4761 { 4836 ExecState* exec = ARG_exec;4762 CallFrame* callFrame = ARG_callFrame; 4837 4763 Machine* machine = ARG_globalData->machine; 4838 4764 … … 4850 4776 result = jsArray->getIndex(i); 4851 4777 else 4852 result = jsArray->JSArray::get( exec, i);4778 result = jsArray->JSArray::get(callFrame, i); 4853 4779 } else if (machine->isJSString(baseValue) && static_cast<JSString*>(baseValue)->canGetIndex(i)) 4854 4780 result = static_cast<JSString*>(baseValue)->getIndex(ARG_globalData, i); 4855 4781 else 4856 result = baseValue->get( exec, i);4782 result = baseValue->get(callFrame, i); 4857 4783 } else { 4858 Identifier property( exec, subscript->toString(exec));4859 result = baseValue->get( exec, property);4784 Identifier property(callFrame, subscript->toString(callFrame)); 4785 result = baseValue->get(callFrame, property); 4860 4786 } 4861 4787 … … 4866 4792 VoidPtrPair Machine::cti_op_resolve_func(CTI_ARGS) 4867 4793 { 4868 ExecState* exec = ARG_exec; 4869 Register* r = ARG_r; 4870 ScopeChainNode* scopeChain = Machine::scopeChain(r); 4794 CallFrame* callFrame = ARG_callFrame; 4795 ScopeChainNode* scopeChain = callFrame->scopeChain(); 4871 4796 4872 4797 ScopeChainIterator iter = scopeChain->begin(); … … 4882 4807 base = *iter; 4883 4808 PropertySlot slot(base); 4884 if (base->getPropertySlot( exec, ident, slot)) {4809 if (base->getPropertySlot(callFrame, ident, slot)) { 4885 4810 // ECMA 11.2.3 says that if we hit an activation the this value should be null. 4886 4811 // However, section 10.2.3 says that in the case where the value provided … … 4890 4815 // that in host objects you always get a valid object for this. 4891 4816 // We also handle wrapper substitution for the global object at the same time. 4892 JSObject* thisObj = base->toThisObject( exec);4893 JSValue* result = slot.getValue( exec, ident);4817 JSObject* thisObj = base->toThisObject(callFrame); 4818 JSValue* result = slot.getValue(callFrame, ident); 4894 4819 VM_CHECK_EXCEPTION_AT_END(); 4895 4820 … … 4900 4825 } while (iter != end); 4901 4826 4902 CodeBlock* codeBlock = Machine::codeBlock(r);4827 CodeBlock* codeBlock = callFrame->codeBlock(); 4903 4828 ASSERT(codeBlock->ctiReturnAddressVPCMap.contains(CTI_RETURN_ADDRESS)); 4904 4829 unsigned vPCIndex = codeBlock->ctiReturnAddressVPCMap.get(CTI_RETURN_ADDRESS); 4905 exec->setException(createUndefinedVariableError(exec, ident, codeBlock->instructions.begin() + vPCIndex, codeBlock));4830 ARG_globalData->exception = createUndefinedVariableError(callFrame, ident, codeBlock->instructions.begin() + vPCIndex, codeBlock); 4906 4831 VM_THROW_EXCEPTION_2(); 4907 4832 } … … 4917 4842 return jsNumber(ARG_globalData, left - right); 4918 4843 4919 ExecState* exec = ARG_exec;4920 JSValue* result = jsNumber(ARG_globalData, src1->toNumber( exec) - src2->toNumber(exec));4844 CallFrame* callFrame = ARG_callFrame; 4845 JSValue* result = jsNumber(ARG_globalData, src1->toNumber(callFrame) - src2->toNumber(callFrame)); 4921 4846 VM_CHECK_EXCEPTION_AT_END(); 4922 4847 return result; … … 4925 4850 void Machine::cti_op_put_by_val(CTI_ARGS) 4926 4851 { 4927 ExecState* exec = ARG_exec;4852 CallFrame* callFrame = ARG_callFrame; 4928 4853 Machine* machine = ARG_globalData->machine; 4929 4854 … … 4941 4866 jsArray->setIndex(i, value); 4942 4867 else 4943 jsArray->JSArray::put( exec, i, value);4868 jsArray->JSArray::put(callFrame, i, value); 4944 4869 } else 4945 baseValue->put( exec, i, value);4870 baseValue->put(callFrame, i, value); 4946 4871 } else { 4947 Identifier property( exec, subscript->toString(exec));4872 Identifier property(callFrame, subscript->toString(callFrame)); 4948 4873 if (!ARG_globalData->exception) { // Don't put to an object if toString threw an exception. 4949 4874 PutPropertySlot slot; 4950 baseValue->put( exec, property, value, slot);4875 baseValue->put(callFrame, property, value, slot); 4951 4876 } 4952 4877 } … … 4957 4882 void Machine::cti_op_put_by_val_array(CTI_ARGS) 4958 4883 { 4959 ExecState* exec = ARG_exec;4884 CallFrame* callFrame = ARG_callFrame; 4960 4885 4961 4886 JSValue* baseValue = ARG_src1; … … 4966 4891 4967 4892 if (LIKELY(i >= 0)) 4968 static_cast<JSArray*>(baseValue)->JSArray::put( exec, i, value);4893 static_cast<JSArray*>(baseValue)->JSArray::put(callFrame, i, value); 4969 4894 else { 4970 Identifier property( exec, JSImmediate::from(i)->toString(exec));4895 Identifier property(callFrame, JSImmediate::from(i)->toString(callFrame)); 4971 4896 // FIXME: can toString throw an exception here? 4972 4897 if (!ARG_globalData->exception) { // Don't put to an object if toString threw an exception. 4973 4898 PutPropertySlot slot; 4974 baseValue->put( exec, property, value, slot);4899 baseValue->put(callFrame, property, value, slot); 4975 4900 } 4976 4901 } … … 4981 4906 JSValue* Machine::cti_op_lesseq(CTI_ARGS) 4982 4907 { 4983 ExecState* exec = ARG_exec;4984 JSValue* result = jsBoolean(jsLessEq( exec, ARG_src1, ARG_src2));4908 CallFrame* callFrame = ARG_callFrame; 4909 JSValue* result = jsBoolean(jsLessEq(callFrame, ARG_src1, ARG_src2)); 4985 4910 VM_CHECK_EXCEPTION_AT_END(); 4986 4911 return result; … … 4991 4916 JSValue* src1 = ARG_src1; 4992 4917 4993 ExecState* exec = ARG_exec;4994 4995 bool result = src1->toBoolean( exec);4918 CallFrame* callFrame = ARG_callFrame; 4919 4920 bool result = src1->toBoolean(callFrame); 4996 4921 VM_CHECK_EXCEPTION_AT_END(); 4997 4922 return result; … … 5006 4931 return jsNumber(ARG_globalData, -v); 5007 4932 5008 ExecState* exec = ARG_exec;5009 JSValue* result = jsNumber(ARG_globalData, -src->toNumber( exec));4933 CallFrame* callFrame = ARG_callFrame; 4934 JSValue* result = jsNumber(ARG_globalData, -src->toNumber(callFrame)); 5010 4935 VM_CHECK_EXCEPTION_AT_END(); 5011 4936 return result; … … 5014 4939 JSValue* Machine::cti_op_resolve_base(CTI_ARGS) 5015 4940 { 5016 return inlineResolveBase(ARG_ exec, *ARG_id1, scopeChain(ARG_r));4941 return inlineResolveBase(ARG_callFrame, *ARG_id1, ARG_callFrame->scopeChain()); 5017 4942 } 5018 4943 5019 4944 JSValue* Machine::cti_op_resolve_skip(CTI_ARGS) 5020 4945 { 5021 ExecState* exec = ARG_exec; 5022 Register* r = ARG_r; 5023 ScopeChainNode* scopeChain = Machine::scopeChain(r); 4946 CallFrame* callFrame = ARG_callFrame; 4947 ScopeChainNode* scopeChain = callFrame->scopeChain(); 5024 4948 5025 4949 int skip = ARG_int2; … … 5036 4960 JSObject* o = *iter; 5037 4961 PropertySlot slot(o); 5038 if (o->getPropertySlot( exec, ident, slot)) {5039 JSValue* result = slot.getValue( exec, ident);4962 if (o->getPropertySlot(callFrame, ident, slot)) { 4963 JSValue* result = slot.getValue(callFrame, ident); 5040 4964 VM_CHECK_EXCEPTION_AT_END(); 5041 4965 return result; … … 5043 4967 } while (++iter != end); 5044 4968 5045 CodeBlock* codeBlock = Machine::codeBlock(r);4969 CodeBlock* codeBlock = callFrame->codeBlock(); 5046 4970 ASSERT(codeBlock->ctiReturnAddressVPCMap.contains(CTI_RETURN_ADDRESS)); 5047 4971 unsigned vPCIndex = codeBlock->ctiReturnAddressVPCMap.get(CTI_RETURN_ADDRESS); 5048 exec->setException(createUndefinedVariableError(exec, ident, codeBlock->instructions.begin() + vPCIndex, codeBlock));4972 ARG_globalData->exception = createUndefinedVariableError(callFrame, ident, codeBlock->instructions.begin() + vPCIndex, codeBlock); 5049 4973 VM_THROW_EXCEPTION(); 5050 4974 } … … 5052 4976 JSValue* Machine::cti_op_resolve_global(CTI_ARGS) 5053 4977 { 5054 ExecState* exec = ARG_exec;4978 CallFrame* callFrame = ARG_callFrame; 5055 4979 JSGlobalObject* globalObject = static_cast<JSGlobalObject*>(ARG_src1); 5056 4980 Identifier& ident = *ARG_id2; … … 5059 4983 5060 4984 PropertySlot slot(globalObject); 5061 if (globalObject->getPropertySlot( exec, ident, slot)) {5062 JSValue* result = slot.getValue( exec, ident);4985 if (globalObject->getPropertySlot(callFrame, ident, slot)) { 4986 JSValue* result = slot.getValue(callFrame, ident); 5063 4987 if (slot.isCacheable()) { 5064 4988 if (vPC[4].u.structureID) … … 5074 4998 } 5075 4999 5076 Register* r = ARG_r; 5077 exec->setException(createUndefinedVariableError(exec, ident, vPC, codeBlock(r))); 5000 ARG_globalData->exception = createUndefinedVariableError(callFrame, ident, vPC, callFrame->codeBlock()); 5078 5001 VM_THROW_EXCEPTION(); 5079 5002 } … … 5089 5012 return jsNumber(ARG_globalData, left / right); 5090 5013 5091 ExecState* exec = ARG_exec;5092 JSValue* result = jsNumber(ARG_globalData, src1->toNumber( exec) / src2->toNumber(exec));5014 CallFrame* callFrame = ARG_callFrame; 5015 JSValue* result = jsNumber(ARG_globalData, src1->toNumber(callFrame) / src2->toNumber(callFrame)); 5093 5016 VM_CHECK_EXCEPTION_AT_END(); 5094 5017 return result; … … 5099 5022 JSValue* v = ARG_src1; 5100 5023 5101 ExecState* exec = ARG_exec;5102 JSValue* result = jsNumber(ARG_globalData, v->toNumber( exec) - 1);5024 CallFrame* callFrame = ARG_callFrame; 5025 JSValue* result = jsNumber(ARG_globalData, v->toNumber(callFrame) - 1); 5103 5026 VM_CHECK_EXCEPTION_AT_END(); 5104 5027 return result; … … 5109 5032 JSValue* src1 = ARG_src1; 5110 5033 JSValue* src2 = ARG_src2; 5111 ExecState* exec = ARG_exec;5112 5113 bool result = jsLess( exec, src1, src2);5034 CallFrame* callFrame = ARG_callFrame; 5035 5036 bool result = jsLess(callFrame, src1, src2); 5114 5037 VM_CHECK_EXCEPTION_AT_END(); 5115 5038 return result; … … 5120 5043 JSValue* src = ARG_src1; 5121 5044 5122 ExecState* exec = ARG_exec;5123 5124 JSValue* result = jsBoolean(!src->toBoolean( exec));5045 CallFrame* callFrame = ARG_callFrame; 5046 5047 JSValue* result = jsBoolean(!src->toBoolean(callFrame)); 5125 5048 VM_CHECK_EXCEPTION_AT_END(); 5126 5049 return result; … … 5131 5054 JSValue* src1 = ARG_src1; 5132 5055 5133 ExecState* exec = ARG_exec;5134 5135 bool result = src1->toBoolean( exec);5056 CallFrame* callFrame = ARG_callFrame; 5057 5058 bool result = src1->toBoolean(callFrame); 5136 5059 VM_CHECK_EXCEPTION_AT_END(); 5137 5060 return result; … … 5142 5065 JSValue* v = ARG_src1; 5143 5066 5144 ExecState* exec = ARG_exec;5145 5146 JSValue* number = v->toJSNumber( exec);5067 CallFrame* callFrame = ARG_callFrame; 5068 5069 JSValue* number = v->toJSNumber(callFrame); 5147 5070 VM_CHECK_EXCEPTION_2(); 5148 5071 … … 5156 5079 JSValue* src2 = ARG_src2; 5157 5080 5158 ExecState* exec = ARG_exec;5081 CallFrame* callFrame = ARG_callFrame; 5159 5082 5160 5083 ASSERT(!JSImmediate::areBothImmediateNumbers(src1, src2)); 5161 JSValue* result = jsBoolean(equalSlowCaseInline( exec, src1, src2));5084 JSValue* result = jsBoolean(equalSlowCaseInline(callFrame, src1, src2)); 5162 5085 VM_CHECK_EXCEPTION_AT_END(); 5163 5086 return result; … … 5176 5099 return jsNumber(ARG_globalData, left << (right & 0x1f)); 5177 5100 5178 ExecState* exec = ARG_exec;5179 JSValue* result = jsNumber(ARG_globalData, (val->toInt32( exec)) << (shift->toUInt32(exec) & 0x1f));5101 CallFrame* callFrame = ARG_callFrame; 5102 JSValue* result = jsNumber(ARG_globalData, (val->toInt32(callFrame)) << (shift->toUInt32(callFrame) & 0x1f)); 5180 5103 VM_CHECK_EXCEPTION_AT_END(); 5181 5104 return result; … … 5192 5115 return jsNumber(ARG_globalData, left & right); 5193 5116 5194 ExecState* exec = ARG_exec;5195 JSValue* result = jsNumber(ARG_globalData, src1->toInt32( exec) & src2->toInt32(exec));5117 CallFrame* callFrame = ARG_callFrame; 5118 JSValue* result = jsNumber(ARG_globalData, src1->toInt32(callFrame) & src2->toInt32(callFrame)); 5196 5119 VM_CHECK_EXCEPTION_AT_END(); 5197 5120 return result; … … 5210 5133 return jsNumber(ARG_globalData, left >> (right & 0x1f)); 5211 5134 5212 ExecState* exec = ARG_exec;5213 JSValue* result = jsNumber(ARG_globalData, (val->toInt32( exec)) >> (shift->toUInt32(exec) & 0x1f));5135 CallFrame* callFrame = ARG_callFrame; 5136 JSValue* result = jsNumber(ARG_globalData, (val->toInt32(callFrame)) >> (shift->toUInt32(callFrame) & 0x1f)); 5214 5137 VM_CHECK_EXCEPTION_AT_END(); 5215 5138 return result; … … 5224 5147 return jsNumber(ARG_globalData, ~value); 5225 5148 5226 ExecState* exec = ARG_exec;5227 JSValue* result = jsNumber(ARG_globalData, ~src->toInt32( exec));5149 CallFrame* callFrame = ARG_callFrame; 5150 JSValue* result = jsNumber(ARG_globalData, ~src->toInt32(callFrame)); 5228 5151 VM_CHECK_EXCEPTION_AT_END(); 5229 5152 return result; … … 5232 5155 VoidPtrPair Machine::cti_op_resolve_with_base(CTI_ARGS) 5233 5156 { 5234 ExecState* exec = ARG_exec; 5235 Register* r = ARG_r; 5236 ScopeChainNode* scopeChain = Machine::scopeChain(r); 5157 CallFrame* callFrame = ARG_callFrame; 5158 ScopeChainNode* scopeChain = callFrame->scopeChain(); 5237 5159 5238 5160 ScopeChainIterator iter = scopeChain->begin(); … … 5248 5170 base = *iter; 5249 5171 PropertySlot slot(base); 5250 if (base->getPropertySlot( exec, ident, slot)) {5251 JSValue* result = slot.getValue( exec, ident);5172 if (base->getPropertySlot(callFrame, ident, slot)) { 5173 JSValue* result = slot.getValue(callFrame, ident); 5252 5174 VM_CHECK_EXCEPTION_AT_END(); 5253 5175 … … 5258 5180 } while (iter != end); 5259 5181 5260 CodeBlock* codeBlock = Machine::codeBlock(r);5182 CodeBlock* codeBlock = callFrame->codeBlock(); 5261 5183 ASSERT(codeBlock->ctiReturnAddressVPCMap.contains(CTI_RETURN_ADDRESS)); 5262 5184 unsigned vPCIndex = codeBlock->ctiReturnAddressVPCMap.get(CTI_RETURN_ADDRESS); 5263 exec->setException(createUndefinedVariableError(exec, ident, codeBlock->instructions.begin() + vPCIndex, codeBlock));5185 ARG_globalData->exception = createUndefinedVariableError(callFrame, ident, codeBlock->instructions.begin() + vPCIndex, codeBlock); 5264 5186 VM_THROW_EXCEPTION_2(); 5265 5187 } … … 5267 5189 JSValue* Machine::cti_op_new_func_exp(CTI_ARGS) 5268 5190 { 5269 return ARG_funcexp1->makeFunction(ARG_ exec, scopeChain(ARG_r));5191 return ARG_funcexp1->makeFunction(ARG_callFrame, ARG_callFrame->scopeChain()); 5270 5192 } 5271 5193 … … 5275 5197 JSValue* divisorValue = ARG_src2; 5276 5198 5277 ExecState* exec = ARG_exec;5278 double d = dividendValue->toNumber( exec);5279 JSValue* result = jsNumber(ARG_globalData, fmod(d, divisorValue->toNumber( exec)));5199 CallFrame* callFrame = ARG_callFrame; 5200 double d = dividendValue->toNumber(callFrame); 5201 JSValue* result = jsNumber(ARG_globalData, fmod(d, divisorValue->toNumber(callFrame))); 5280 5202 VM_CHECK_EXCEPTION_AT_END(); 5281 5203 return result; … … 5284 5206 JSValue* Machine::cti_op_less(CTI_ARGS) 5285 5207 { 5286 ExecState* exec = ARG_exec;5287 JSValue* result = jsBoolean(jsLess( exec, ARG_src1, ARG_src2));5208 CallFrame* callFrame = ARG_callFrame; 5209 JSValue* result = jsBoolean(jsLess(callFrame, ARG_src1, ARG_src2)); 5288 5210 VM_CHECK_EXCEPTION_AT_END(); 5289 5211 return result; … … 5297 5219 ASSERT(!JSImmediate::areBothImmediateNumbers(src1, src2)); 5298 5220 5299 ExecState* exec = ARG_exec;5300 JSValue* result = jsBoolean(!equalSlowCaseInline( exec, src1, src2));5221 CallFrame* callFrame = ARG_callFrame; 5222 JSValue* result = jsBoolean(!equalSlowCaseInline(callFrame, src1, src2)); 5301 5223 VM_CHECK_EXCEPTION_AT_END(); 5302 5224 return result; … … 5307 5229 JSValue* v = ARG_src1; 5308 5230 5309 ExecState* exec = ARG_exec;5310 5311 JSValue* number = v->toJSNumber( exec);5231 CallFrame* callFrame = ARG_callFrame; 5232 5233 JSValue* number = v->toJSNumber(callFrame); 5312 5234 VM_CHECK_EXCEPTION_2(); 5313 5235 … … 5321 5243 JSValue* shift = ARG_src2; 5322 5244 5323 ExecState* exec = ARG_exec;5245 CallFrame* callFrame = ARG_callFrame; 5324 5246 5325 5247 if (JSImmediate::areBothImmediateNumbers(val, shift) && !JSImmediate::isNegative(val)) 5326 5248 return JSImmediate::rightShiftImmediateNumbers(val, shift); 5327 5249 else { 5328 JSValue* result = jsNumber(ARG_globalData, (val->toUInt32( exec)) >> (shift->toUInt32(exec) & 0x1f));5250 JSValue* result = jsNumber(ARG_globalData, (val->toUInt32(callFrame)) >> (shift->toUInt32(callFrame) & 0x1f)); 5329 5251 VM_CHECK_EXCEPTION_AT_END(); 5330 5252 return result; … … 5337 5259 JSValue* src2 = ARG_src2; 5338 5260 5339 ExecState* exec = ARG_exec;5340 5341 JSValue* result = jsNumber(ARG_globalData, src1->toInt32( exec) ^ src2->toInt32(exec));5261 CallFrame* callFrame = ARG_callFrame; 5262 5263 JSValue* result = jsNumber(ARG_globalData, src1->toInt32(callFrame) ^ src2->toInt32(callFrame)); 5342 5264 VM_CHECK_EXCEPTION_AT_END(); 5343 5265 return result; … … 5346 5268 JSValue* Machine::cti_op_new_regexp(CTI_ARGS) 5347 5269 { 5348 return new (ARG_globalData) RegExpObject( scopeChain(ARG_r)->globalObject()->regExpStructure(), ARG_regexp1);5270 return new (ARG_globalData) RegExpObject(ARG_callFrame->lexicalGlobalObject()->regExpStructure(), ARG_regexp1); 5349 5271 } 5350 5272 … … 5354 5276 JSValue* src2 = ARG_src2; 5355 5277 5356 ExecState* exec = ARG_exec;5357 5358 JSValue* result = jsNumber(ARG_globalData, src1->toInt32( exec) | src2->toInt32(exec));5278 CallFrame* callFrame = ARG_callFrame; 5279 5280 JSValue* result = jsNumber(ARG_globalData, src1->toInt32(callFrame) | src2->toInt32(callFrame)); 5359 5281 VM_CHECK_EXCEPTION_AT_END(); 5360 5282 return result; … … 5363 5285 JSValue* Machine::cti_op_call_eval(CTI_ARGS) 5364 5286 { 5365 ExecState* exec = ARG_exec;5287 CallFrame* callFrame = ARG_callFrame; 5366 5288 RegisterFile* registerFile = ARG_registerFile; 5367 Register* r = ARG_r; 5368 CodeBlock* codeBlock = Machine::codeBlock(r); 5369 ScopeChainNode* scopeChain = Machine::scopeChain(r); 5289 CodeBlock* codeBlock = callFrame->codeBlock(); 5290 ScopeChainNode* scopeChain = callFrame->scopeChain(); 5370 5291 5371 5292 Machine* machine = ARG_globalData->machine; … … 5377 5298 5378 5299 if (baseVal == scopeChain->globalObject() && funcVal == scopeChain->globalObject()->evalFunction()) { 5379 JSObject* thisObject = static_cast<JSObject*>( r[codeBlock->thisRegister].jsValue(exec));5300 JSObject* thisObject = static_cast<JSObject*>(callFrame[codeBlock->thisRegister].jsValue(callFrame)); 5380 5301 JSValue* exceptionValue = 0; 5381 JSValue* result = machine->callEval( exec, thisObject, scopeChain, registerFile, r, registerOffset - RegisterFile::CallFrameHeaderSize - argCount, argCount, exceptionValue);5302 JSValue* result = machine->callEval(callFrame, thisObject, scopeChain, registerFile, registerOffset - RegisterFile::CallFrameHeaderSize - argCount, argCount, exceptionValue); 5382 5303 VM_CHECK_EXCEPTION_ARG(exceptionValue); 5383 5304 return result; … … 5389 5310 void* Machine::cti_op_throw(CTI_ARGS) 5390 5311 { 5391 ExecState* exec = ARG_exec; 5392 Register* r = ARG_r; 5393 CodeBlock* codeBlock = Machine::codeBlock(r); 5312 CallFrame* callFrame = ARG_callFrame; 5313 CodeBlock* codeBlock = callFrame->codeBlock(); 5394 5314 5395 5315 ASSERT(codeBlock->ctiReturnAddressVPCMap.contains(CTI_RETURN_ADDRESS)); … … 5399 5319 ASSERT(exceptionValue); 5400 5320 5401 Instruction* handlerVPC = ARG_globalData->machine->throwException( exec, exceptionValue, codeBlock->instructions.begin() + vPCIndex, r, true);5321 Instruction* handlerVPC = ARG_globalData->machine->throwException(callFrame, exceptionValue, codeBlock->instructions.begin() + vPCIndex, true); 5402 5322 5403 5323 if (!handlerVPC) { … … 5406 5326 } 5407 5327 5408 ARG_set R(r);5409 void* catchRoutine = Machine::codeBlock(r)->nativeExceptionCodeForHandlerVPC(handlerVPC);5328 ARG_setCallFrame(callFrame); 5329 void* catchRoutine = callFrame->codeBlock()->nativeExceptionCodeForHandlerVPC(handlerVPC); 5410 5330 ASSERT(catchRoutine); 5411 5331 ctiSetReturnAddress(&CTI_RETURN_ADDRESS, catchRoutine); … … 5415 5335 JSPropertyNameIterator* Machine::cti_op_get_pnames(CTI_ARGS) 5416 5336 { 5417 return JSPropertyNameIterator::create(ARG_ exec, ARG_src1);5337 return JSPropertyNameIterator::create(ARG_callFrame, ARG_src1); 5418 5338 } 5419 5339 … … 5421 5341 { 5422 5342 JSPropertyNameIterator* it = ARG_pni1; 5423 JSValue* temp = it->next(ARG_ exec);5343 JSValue* temp = it->next(ARG_callFrame); 5424 5344 if (!temp) 5425 5345 it->invalidate(); … … 5429 5349 void Machine::cti_op_push_scope(CTI_ARGS) 5430 5350 { 5431 ExecState* exec = ARG_exec; 5432 JSValue* v = ARG_src1; 5433 5434 JSObject* o = v->toObject(exec); 5351 JSObject* o = ARG_src1->toObject(ARG_callFrame); 5435 5352 VM_CHECK_EXCEPTION_VOID(); 5436 5437 Register* r = ARG_r; 5438 r[RegisterFile::ScopeChain] = scopeChain(r)->push(o); 5353 ARG_callFrame->setScopeChain(ARG_callFrame->scopeChain()->push(o)); 5439 5354 } 5440 5355 5441 5356 void Machine::cti_op_pop_scope(CTI_ARGS) 5442 5357 { 5443 Register* r = ARG_r; 5444 r[RegisterFile::ScopeChain] = scopeChain(r)->pop(); 5358 ARG_callFrame->setScopeChain(ARG_callFrame->scopeChain()->pop()); 5445 5359 } 5446 5360 5447 5361 JSValue* Machine::cti_op_typeof(CTI_ARGS) 5448 5362 { 5449 return jsTypeStringForValue(ARG_ exec, ARG_src1);5363 return jsTypeStringForValue(ARG_callFrame, ARG_src1); 5450 5364 } 5451 5365 … … 5508 5422 { 5509 5423 JSValue* src = ARG_src1; 5510 ExecState* exec = ARG_exec;5511 5512 JSValue* result = src->toJSNumber( exec);5424 CallFrame* callFrame = ARG_callFrame; 5425 5426 JSValue* result = src->toJSNumber(callFrame); 5513 5427 VM_CHECK_EXCEPTION_AT_END(); 5514 5428 return result; … … 5517 5431 JSValue* Machine::cti_op_in(CTI_ARGS) 5518 5432 { 5519 ExecState* exec = ARG_exec;5433 CallFrame* callFrame = ARG_callFrame; 5520 5434 JSValue* baseVal = ARG_src2; 5521 5435 5522 5436 if (!baseVal->isObject()) { 5523 Register* r = ARG_r;5524 CodeBlock* codeBlock = Machine::codeBlock(r);5437 CallFrame* callFrame = ARG_callFrame; 5438 CodeBlock* codeBlock = callFrame->codeBlock(); 5525 5439 ASSERT(codeBlock->ctiReturnAddressVPCMap.contains(CTI_RETURN_ADDRESS)); 5526 5440 unsigned vPCIndex = codeBlock->ctiReturnAddressVPCMap.get(CTI_RETURN_ADDRESS); 5527 exec->setException(createInvalidParamError(exec, "in", baseVal, codeBlock->instructions.begin() + vPCIndex, codeBlock));5441 ARG_globalData->exception = createInvalidParamError(callFrame, "in", baseVal, codeBlock->instructions.begin() + vPCIndex, codeBlock); 5528 5442 VM_THROW_EXCEPTION(); 5529 5443 } … … 5534 5448 uint32_t i; 5535 5449 if (propName->getUInt32(i)) 5536 return jsBoolean(baseObj->hasProperty( exec, i));5537 5538 Identifier property( exec, propName->toString(exec));5450 return jsBoolean(baseObj->hasProperty(callFrame, i)); 5451 5452 Identifier property(callFrame, propName->toString(callFrame)); 5539 5453 VM_CHECK_EXCEPTION(); 5540 return jsBoolean(baseObj->hasProperty( exec, property));5454 return jsBoolean(baseObj->hasProperty(callFrame, property)); 5541 5455 } 5542 5456 5543 5457 JSValue* Machine::cti_op_push_new_scope(CTI_ARGS) 5544 5458 { 5545 JSObject* scope = new (ARG_globalData) JSStaticScopeObject(ARG_ exec, *ARG_id1, ARG_src2, DontDelete);5546 5547 Register* r = ARG_r;5548 r[RegisterFile::ScopeChain] = scopeChain(r)->push(scope);5459 JSObject* scope = new (ARG_globalData) JSStaticScopeObject(ARG_callFrame, *ARG_id1, ARG_src2, DontDelete); 5460 5461 CallFrame* callFrame = ARG_callFrame; 5462 callFrame->setScopeChain(callFrame->scopeChain()->push(scope)); 5549 5463 return scope; 5550 5464 } … … 5553 5467 { 5554 5468 unsigned count = ARG_int1; 5555 Register* r = ARG_r;5556 5557 ScopeChainNode* tmp = scopeChain(r);5469 CallFrame* callFrame = ARG_callFrame; 5470 5471 ScopeChainNode* tmp = callFrame->scopeChain(); 5558 5472 while (count--) 5559 5473 tmp = tmp->pop(); 5560 r[RegisterFile::ScopeChain] = tmp;5474 callFrame->setScopeChain(tmp); 5561 5475 } 5562 5476 5563 5477 void Machine::cti_op_put_by_index(CTI_ARGS) 5564 5478 { 5565 ExecState* exec = ARG_exec;5479 CallFrame* callFrame = ARG_callFrame; 5566 5480 unsigned property = ARG_int2; 5567 5481 5568 ARG_src1->put( exec, property, ARG_src3);5482 ARG_src1->put(callFrame, property, ARG_src3); 5569 5483 } 5570 5484 … … 5573 5487 JSValue* scrutinee = ARG_src1; 5574 5488 unsigned tableIndex = ARG_int2; 5575 Register* r = ARG_r;5576 CodeBlock* codeBlock = Machine::codeBlock(r);5489 CallFrame* callFrame = ARG_callFrame; 5490 CodeBlock* codeBlock = callFrame->codeBlock(); 5577 5491 5578 5492 if (JSImmediate::isNumber(scrutinee)) { … … 5588 5502 JSValue* scrutinee = ARG_src1; 5589 5503 unsigned tableIndex = ARG_int2; 5590 Register* r = ARG_r;5591 CodeBlock* codeBlock = Machine::codeBlock(r);5504 CallFrame* callFrame = ARG_callFrame; 5505 CodeBlock* codeBlock = callFrame->codeBlock(); 5592 5506 5593 5507 void* result = codeBlock->characterSwitchJumpTables[tableIndex].ctiDefault; … … 5606 5520 JSValue* scrutinee = ARG_src1; 5607 5521 unsigned tableIndex = ARG_int2; 5608 Register* r = ARG_r;5609 CodeBlock* codeBlock = Machine::codeBlock(r);5522 CallFrame* callFrame = ARG_callFrame; 5523 CodeBlock* codeBlock = callFrame->codeBlock(); 5610 5524 5611 5525 void* result = codeBlock->stringSwitchJumpTables[tableIndex].ctiDefault; … … 5621 5535 JSValue* Machine::cti_op_del_by_val(CTI_ARGS) 5622 5536 { 5623 ExecState* exec = ARG_exec;5537 CallFrame* callFrame = ARG_callFrame; 5624 5538 5625 5539 JSValue* baseValue = ARG_src1; 5626 JSObject* baseObj = baseValue->toObject( exec); // may throw5540 JSObject* baseObj = baseValue->toObject(callFrame); // may throw 5627 5541 5628 5542 JSValue* subscript = ARG_src2; … … 5630 5544 uint32_t i; 5631 5545 if (subscript->getUInt32(i)) 5632 result = jsBoolean(baseObj->deleteProperty( exec, i));5546 result = jsBoolean(baseObj->deleteProperty(callFrame, i)); 5633 5547 else { 5634 5548 VM_CHECK_EXCEPTION(); 5635 Identifier property( exec, subscript->toString(exec));5549 Identifier property(callFrame, subscript->toString(callFrame)); 5636 5550 VM_CHECK_EXCEPTION(); 5637 result = jsBoolean(baseObj->deleteProperty( exec, property));5551 result = jsBoolean(baseObj->deleteProperty(callFrame, property)); 5638 5552 } 5639 5553 … … 5644 5558 void Machine::cti_op_put_getter(CTI_ARGS) 5645 5559 { 5646 ExecState* exec = ARG_exec;5560 CallFrame* callFrame = ARG_callFrame; 5647 5561 5648 5562 ASSERT(ARG_src1->isObject()); … … 5650 5564 Identifier& ident = *ARG_id2; 5651 5565 ASSERT(ARG_src3->isObject()); 5652 baseObj->defineGetter( exec, ident, static_cast<JSObject*>(ARG_src3));5566 baseObj->defineGetter(callFrame, ident, static_cast<JSObject*>(ARG_src3)); 5653 5567 } 5654 5568 5655 5569 void Machine::cti_op_put_setter(CTI_ARGS) 5656 5570 { 5657 ExecState* exec = ARG_exec;5571 CallFrame* callFrame = ARG_callFrame; 5658 5572 5659 5573 ASSERT(ARG_src1->isObject()); … … 5661 5575 Identifier& ident = *ARG_id2; 5662 5576 ASSERT(ARG_src3->isObject()); 5663 baseObj->defineSetter( exec, ident, static_cast<JSObject*>(ARG_src3));5577 baseObj->defineSetter(callFrame, ident, static_cast<JSObject*>(ARG_src3)); 5664 5578 } 5665 5579 5666 5580 JSValue* Machine::cti_op_new_error(CTI_ARGS) 5667 5581 { 5668 ExecState* exec = ARG_exec; 5669 Register* r = ARG_r; 5670 CodeBlock* codeBlock = Machine::codeBlock(r); 5582 CallFrame* callFrame = ARG_callFrame; 5583 CodeBlock* codeBlock = callFrame->codeBlock(); 5671 5584 unsigned type = ARG_int1; 5672 5585 JSValue* message = ARG_src2; 5673 5586 unsigned lineNumber = ARG_int3; 5674 5587 5675 return Error::create( exec, static_cast<ErrorType>(type), message->toString(exec), lineNumber, codeBlock->ownerNode->sourceID(), codeBlock->ownerNode->sourceURL());5588 return Error::create(callFrame, static_cast<ErrorType>(type), message->toString(callFrame), lineNumber, codeBlock->ownerNode->sourceID(), codeBlock->ownerNode->sourceURL()); 5676 5589 } 5677 5590 5678 5591 void Machine::cti_op_debug(CTI_ARGS) 5679 5592 { 5680 ExecState* exec = ARG_exec; 5681 Register* r = ARG_r; 5593 CallFrame* callFrame = ARG_callFrame; 5682 5594 5683 5595 int debugHookID = ARG_int1; … … 5685 5597 int lastLine = ARG_int3; 5686 5598 5687 ARG_globalData->machine->debug( exec, r, static_cast<DebugHookID>(debugHookID), firstLine, lastLine);5599 ARG_globalData->machine->debug(callFrame, static_cast<DebugHookID>(debugHookID), firstLine, lastLine); 5688 5600 } 5689 5601 5690 5602 void* Machine::cti_vm_throw(CTI_ARGS) 5691 5603 { 5692 ExecState* exec = ARG_exec; 5693 Register* r = ARG_r; 5694 CodeBlock* codeBlock = Machine::codeBlock(r); 5604 CallFrame* callFrame = ARG_callFrame; 5605 CodeBlock* codeBlock = callFrame->codeBlock(); 5695 5606 5696 5607 ASSERT(codeBlock->ctiReturnAddressVPCMap.contains(ARG_globalData->throwReturnAddress)); … … 5701 5612 ARG_globalData->exception = 0; 5702 5613 5703 Instruction* handlerVPC = ARG_globalData->machine->throwException( exec, exceptionValue, codeBlock->instructions.begin() + vPCIndex, r, false);5614 Instruction* handlerVPC = ARG_globalData->machine->throwException(callFrame, exceptionValue, codeBlock->instructions.begin() + vPCIndex, false); 5704 5615 5705 5616 if (!handlerVPC) { … … 5708 5619 } 5709 5620 5710 ARG_set R(r);5711 void* catchRoutine = Machine::codeBlock(r)->nativeExceptionCodeForHandlerVPC(handlerVPC);5621 ARG_setCallFrame(callFrame); 5622 void* catchRoutine = callFrame->codeBlock()->nativeExceptionCodeForHandlerVPC(handlerVPC); 5712 5623 ASSERT(catchRoutine); 5713 5624 ctiSetReturnAddress(&CTI_RETURN_ADDRESS, catchRoutine);
Note:
See TracChangeset
for help on using the changeset viewer.