Changeset 37427 in webkit for trunk/JavaScriptCore/VM/Machine.cpp
- Timestamp:
- Oct 8, 2008, 10:03:10 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/VM/Machine.cpp
r37422 r37427 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; 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) … … 929 915 Profiler** profiler = Profiler::enabledProfilerReference(); 930 916 if (*profiler) 931 (*profiler)->willExecute( exec, programNode->sourceURL(), programNode->lineNo());917 (*profiler)->willExecute(callFrame, 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, callFrame, codeBlock); 923 JSValue* result = CTI::execute(codeBlock->ctiCode, &m_registerFile, callFrame, scopeChain->globalData, exception); 938 924 #else 939 JSValue* result = privateExecute(Normal, &m_registerFile, r, exception);925 JSValue* result = privateExecute(Normal, &m_registerFile, callFrame, 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 callFrame = slideRegisterWindowForCall(codeBlock, &m_registerFile, newCallFrame, argc + RegisterFile::CallFrameHeaderSize, argc); 970 if (UNLIKELY(!callFrame)) { 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 callFrame->init(codeBlock, 0, scopeChain, newCallFrame->addHostCallFrameFlag(), 0, argc, function); 992 977 993 978 Profiler** profiler = Profiler::enabledProfilerReference(); 994 979 if (*profiler) 995 (*profiler)->willExecute( exec, function);980 (*profiler)->willExecute(callFrame, 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, callFrame, codeBlock); 986 JSValue* result = CTI::execute(codeBlock->ctiCode, &m_registerFile, callFrame, scopeChain->globalData, exception); 1002 987 #else 1003 JSValue* result = privateExecute(Normal, &m_registerFile, r, exception);988 JSValue* result = privateExecute(Normal, &m_registerFile, callFrame, 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) … … 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(JSImmediate::isNumber(srcVal) || static_cast<JSCell*>(srcVal)->structureID()->typeInfo().type() == NumberType)) { 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);3376 3377 3352 ++vPC; 3378 3353 NEXT_OPCODE; 3379 3354 } 3380 3355 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(); 3356 ASSERT(callFrame->codeBlock()->usesArguments && !callFrame->codeBlock()->needsFullScopeChain); 3357 3358 callFrame->optionalCalleeArguments()->copyRegisters(); 3386 3359 3387 3360 ++vPC; … … 3401 3374 3402 3375 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();3376 (*enabledProfilerReference)->didExecute(callFrame, callFrame->callee()); 3377 3378 if (callFrame->codeBlock()->needsFullScopeChain) 3379 callFrame->scopeChain()->deref(); 3380 3381 JSValue* returnValue = callFrame[result].jsValue(callFrame); 3382 3383 vPC = callFrame->returnPC(); 3384 int dst = callFrame->returnValueRegister(); 3385 callFrame = callFrame->callerFrame(); 3413 3386 3414 if ( isHostCallFrame(r))3387 if (callFrame->hasHostCallFrameFlag()) 3415 3388 return returnValue; 3416 3389 3417 r[dst] = returnValue;3390 callFrame[dst] = returnValue; 3418 3391 3419 3392 NEXT_OPCODE; … … 3431 3404 3432 3405 size_t i = 0; 3433 CodeBlock* codeBlock = this->codeBlock(r);3406 CodeBlock* codeBlock = callFrame->codeBlock(); 3434 3407 3435 3408 for (size_t count = codeBlock->numVars; i < count; ++i) 3436 r[i] = jsUndefined();3409 callFrame[i] = jsUndefined(); 3437 3410 3438 3411 for (size_t count = codeBlock->constantRegisters.size(), j = 0; j < count; ++i, ++j) 3439 r[i] = codeBlock->constantRegisters[j];3412 callFrame[i] = codeBlock->constantRegisters[j]; 3440 3413 3441 3414 ++vPC; … … 3456 3429 3457 3430 size_t i = 0; 3458 CodeBlock* codeBlock = this->codeBlock(r);3431 CodeBlock* codeBlock = callFrame->codeBlock(); 3459 3432 3460 3433 for (size_t count = codeBlock->numVars; i < count; ++i) 3461 r[i] = jsUndefined();3434 callFrame[i] = jsUndefined(); 3462 3435 3463 3436 for (size_t count = codeBlock->constantRegisters.size(), j = 0; j < count; ++i, ++j) 3464 r[i] = codeBlock->constantRegisters[j];3437 callFrame[i] = codeBlock->constantRegisters[j]; 3465 3438 3466 3439 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);3440 JSActivation* activation = new (globalData) JSActivation(callFrame, static_cast<FunctionBodyNode*>(codeBlock->ownerNode)); 3441 callFrame[dst] = activation; 3442 callFrame->setScopeChain(callFrame->scopeChain()->copy()->push(activation)); 3470 3443 3471 3444 ++vPC; … … 3474 3447 BEGIN_OPCODE(op_convert_this) { 3475 3448 int thisRegister = (++vPC)->u.operand; 3476 JSValue* thisVal = r[thisRegister].getJSValue();3449 JSValue* thisVal = callFrame[thisRegister].getJSValue(); 3477 3450 if (thisVal->needsThisConversion()) 3478 r[thisRegister] = thisVal->toThisObject(exec);3451 callFrame[thisRegister] = thisVal->toThisObject(callFrame); 3479 3452 3480 3453 ++vPC; … … 3492 3465 */ 3493 3466 3494 Arguments* arguments = new (globalData) Arguments( exec, r);3495 r[RegisterFile::OptionalCalleeArguments] = arguments;3496 r[RegisterFile::ArgumentsRegister] = arguments;3467 Arguments* arguments = new (globalData) Arguments(callFrame); 3468 callFrame->setCalleeArguments(arguments); 3469 callFrame[RegisterFile::ArgumentsRegister] = arguments; 3497 3470 3498 3471 ++vPC; … … 3521 3494 int registerOffset = (++vPC)->u.operand; 3522 3495 3523 JSValue* v = r[constr].jsValue(exec);3496 JSValue* v = callFrame[constr].jsValue(callFrame); 3524 3497 3525 3498 ConstructData constructData; … … 3528 3501 if (constructType == ConstructTypeJS) { 3529 3502 if (*enabledProfilerReference) 3530 (*enabledProfilerReference)->willExecute( exec, static_cast<JSObject*>(v));3503 (*enabledProfilerReference)->willExecute(callFrame, static_cast<JSObject*>(v)); 3531 3504 3532 3505 ScopeChainNode* callDataScopeChain = constructData.js.scopeChain; … … 3535 3508 3536 3509 StructureID* structure; 3537 JSValue* prototype = r[constrProto].jsValue(exec);3510 JSValue* prototype = callFrame[constrProto].jsValue(callFrame); 3538 3511 if (prototype->isObject()) 3539 3512 structure = static_cast<JSObject*>(prototype)->inheritorID(); … … 3542 3515 JSObject* newObject = new (globalData) JSObject(structure); 3543 3516 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));3517 callFrame[firstArg] = newObject; // "this" value 3518 3519 CallFrame* previousCallFrame = callFrame; 3520 3521 callFrame = slideRegisterWindowForCall(newCodeBlock, registerFile, callFrame, registerOffset, argCount); 3522 if (UNLIKELY(!callFrame)) { 3523 callFrame = previousCallFrame; 3524 exceptionValue = createStackOverflowError(callFrame); 3552 3525 goto vm_throw; 3553 3526 } 3554 3527 3555 initializeCallFrame(r, newCodeBlock, vPC + 1, callDataScopeChain, savedR, dst, argCount, v);3528 callFrame->init(newCodeBlock, vPC + 1, callDataScopeChain, previousCallFrame, dst, argCount, static_cast<JSFunction*>(v)); 3556 3529 3557 3530 if (*enabledProfilerReference) 3558 (*enabledProfilerReference)->didExecute( exec, static_cast<JSObject*>(v));3531 (*enabledProfilerReference)->didExecute(callFrame, static_cast<JSObject*>(v)); 3559 3532 3560 3533 vPC = newCodeBlock->instructions.begin(); … … 3568 3541 3569 3542 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;3543 ArgList args(callFrame->registers() + firstArg + 1, argCount - 1); 3544 3545 ScopeChainNode* scopeChain = callFrame->scopeChain(); 3546 CallFrame::create(callFrame->registers() + registerOffset)->init(0, vPC + 1, scopeChain, callFrame, dst, argCount, static_cast<JSFunction*>(v)); 3547 callFrame = CallFrame::create(callFrame->registers() + registerOffset); 3575 3548 3576 3549 if (*enabledProfilerReference) 3577 (*enabledProfilerReference)->willExecute( exec, static_cast<JSObject*>(v));3550 (*enabledProfilerReference)->willExecute(callFrame, static_cast<JSObject*>(v)); 3578 3551 3579 3552 MACHINE_SAMPLING_callingHostFunction(); 3580 3553 3581 JSValue* returnValue = constructData.native.function( exec, static_cast<JSObject*>(v), args);3582 r -= registerOffset;3554 JSValue* returnValue = constructData.native.function(callFrame, static_cast<JSObject*>(v), args); 3555 callFrame = CallFrame::create(callFrame->registers() - registerOffset); 3583 3556 3584 3557 VM_CHECK_EXCEPTION(); 3585 r[dst] = returnValue;3558 callFrame[dst] = returnValue; 3586 3559 3587 3560 if (*enabledProfilerReference) 3588 (*enabledProfilerReference)->didExecute( exec, static_cast<JSObject*>(v));3561 (*enabledProfilerReference)->didExecute(callFrame, static_cast<JSObject*>(v)); 3589 3562 3590 3563 ++vPC; … … 3594 3567 ASSERT(constructType == ConstructTypeNone); 3595 3568 3596 exceptionValue = createNotAConstructorError( exec, v, vPC, codeBlock(r));3569 exceptionValue = createNotAConstructorError(callFrame, v, vPC, callFrame->codeBlock()); 3597 3570 goto vm_throw; 3598 3571 } … … 3605 3578 3606 3579 int dst = vPC[1].u.operand;; 3607 if (LIKELY( r[dst].jsValue(exec)->isObject())) {3580 if (LIKELY(callFrame[dst].jsValue(callFrame)->isObject())) { 3608 3581 vPC += 3; 3609 3582 NEXT_OPCODE; … … 3611 3584 3612 3585 int override = vPC[2].u.operand; 3613 r[dst] = r[override];3586 callFrame[dst] = callFrame[override]; 3614 3587 3615 3588 vPC += 3; … … 3623 3596 */ 3624 3597 int scope = (++vPC)->u.operand; 3625 JSValue* v = r[scope].jsValue(exec);3626 JSObject* o = v->toObject( exec);3598 JSValue* v = callFrame[scope].jsValue(callFrame); 3599 JSObject* o = v->toObject(callFrame); 3627 3600 VM_CHECK_EXCEPTION(); 3628 3601 3629 r[RegisterFile::ScopeChain] = scopeChain(r)->push(o);3602 callFrame->setScopeChain(callFrame->scopeChain()->push(o)); 3630 3603 3631 3604 ++vPC; … … 3637 3610 Removes the top item from the current scope chain. 3638 3611 */ 3639 r[RegisterFile::ScopeChain] = scopeChain(r)->pop();3612 callFrame->setScopeChain(callFrame->scopeChain()->pop()); 3640 3613 3641 3614 ++vPC; … … 3653 3626 int base = (++vPC)->u.operand; 3654 3627 3655 r[dst] = JSPropertyNameIterator::create(exec, r[base].jsValue(exec));3628 callFrame[dst] = JSPropertyNameIterator::create(callFrame, callFrame[base].jsValue(callFrame)); 3656 3629 ++vPC; 3657 3630 NEXT_OPCODE; … … 3670 3643 int target = (++vPC)->u.operand; 3671 3644 3672 JSPropertyNameIterator* it = r[iter].jsPropertyNameIterator();3673 if (JSValue* temp = it->next( exec)) {3645 JSPropertyNameIterator* it = callFrame[iter].propertyNameIterator(); 3646 if (JSValue* temp = it->next(callFrame)) { 3674 3647 CHECK_FOR_TIMEOUT(); 3675 r[dst] = temp;3648 callFrame[dst] = temp; 3676 3649 vPC += target; 3677 3650 NEXT_OPCODE; … … 3692 3665 int target = (++vPC)->u.operand; 3693 3666 3694 ScopeChainNode* tmp = scopeChain(r);3667 ScopeChainNode* tmp = callFrame->scopeChain(); 3695 3668 while (count--) 3696 3669 tmp = tmp->pop(); 3697 r[RegisterFile::ScopeChain] = tmp;3670 callFrame->setScopeChain(tmp); 3698 3671 3699 3672 vPC += target; … … 3711 3684 in dst for GC. 3712 3685 */ 3713 r[RegisterFile::ScopeChain] = createExceptionScope(exec, vPC, r);3686 callFrame->setScopeChain(createExceptionScope(callFrame, vPC)); 3714 3687 3715 3688 vPC += 4; … … 3727 3700 */ 3728 3701 ASSERT(exceptionValue); 3729 ASSERT(! exec->hadException());3702 ASSERT(!globalData->exception); 3730 3703 int ex = (++vPC)->u.operand; 3731 r[ex] = exceptionValue;3704 callFrame[ex] = exceptionValue; 3732 3705 exceptionValue = 0; 3733 3706 … … 3747 3720 3748 3721 int ex = (++vPC)->u.operand; 3749 exceptionValue = r[ex].jsValue(exec);3750 3751 handlerVPC = throwException( exec, exceptionValue, vPC, r, true);3722 exceptionValue = callFrame[ex].jsValue(callFrame); 3723 3724 handlerVPC = throwException(callFrame, exceptionValue, vPC, true); 3752 3725 if (!handlerVPC) { 3753 3726 *exception = exceptionValue; … … 3774 3747 int dst = (++vPC)->u.operand; 3775 3748 int src = (++vPC)->u.operand; 3776 r[dst] = codeBlock(r)->unexpectedConstants[src];3749 callFrame[dst] = callFrame->codeBlock()->unexpectedConstants[src]; 3777 3750 3778 3751 ++vPC; … … 3791 3764 int message = (++vPC)->u.operand; 3792 3765 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());3766 CodeBlock* codeBlock = callFrame->codeBlock(); 3767 callFrame[dst] = Error::create(callFrame, (ErrorType)type, codeBlock->unexpectedConstants[message]->toString(callFrame), codeBlock->lineNumberForVPC(vPC), codeBlock->ownerNode->sourceID(), codeBlock->ownerNode->sourceURL()); 3795 3768 3796 3769 ++vPC; … … 3804 3777 */ 3805 3778 3806 if (c odeBlock(r)->needsFullScopeChain) {3807 ScopeChainNode* scopeChain = this->scopeChain(r);3779 if (callFrame->codeBlock()->needsFullScopeChain) { 3780 ScopeChainNode* scopeChain = callFrame->scopeChain(); 3808 3781 ASSERT(scopeChain->refCount > 1); 3809 3782 scopeChain->deref(); 3810 3783 } 3811 3784 int result = (++vPC)->u.operand; 3812 return r[result].jsValue(exec);3785 return callFrame[result].jsValue(callFrame); 3813 3786 } 3814 3787 BEGIN_OPCODE(op_put_getter) { … … 3827 3800 int function = (++vPC)->u.operand; 3828 3801 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)));3802 ASSERT(callFrame[base].jsValue(callFrame)->isObject()); 3803 JSObject* baseObj = static_cast<JSObject*>(callFrame[base].jsValue(callFrame)); 3804 Identifier& ident = callFrame->codeBlock()->identifiers[property]; 3805 ASSERT(callFrame[function].jsValue(callFrame)->isObject()); 3806 baseObj->defineGetter(callFrame, ident, static_cast<JSObject*>(callFrame[function].jsValue(callFrame))); 3834 3807 3835 3808 ++vPC; … … 3851 3824 int function = (++vPC)->u.operand; 3852 3825 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)));3826 ASSERT(callFrame[base].jsValue(callFrame)->isObject()); 3827 JSObject* baseObj = static_cast<JSObject*>(callFrame[base].jsValue(callFrame)); 3828 Identifier& ident = callFrame->codeBlock()->identifiers[property]; 3829 ASSERT(callFrame[function].jsValue(callFrame)->isObject()); 3830 baseObj->defineSetter(callFrame, ident, static_cast<JSObject*>(callFrame[function].jsValue(callFrame))); 3858 3831 3859 3832 ++vPC; … … 3868 3841 int retAddrDst = (++vPC)->u.operand; 3869 3842 int target = (++vPC)->u.operand; 3870 r[retAddrDst] = vPC + 1;3843 callFrame[retAddrDst] = vPC + 1; 3871 3844 3872 3845 vPC += target; … … 3881 3854 */ 3882 3855 int retAddrSrc = (++vPC)->u.operand; 3883 vPC = r[retAddrSrc].vPC();3856 vPC = callFrame[retAddrSrc].vPC(); 3884 3857 NEXT_OPCODE; 3885 3858 } … … 3894 3867 int lastLine = (++vPC)->u.operand; 3895 3868 3896 debug( exec, r, static_cast<DebugHookID>(debugHookID), firstLine, lastLine);3869 debug(callFrame, static_cast<DebugHookID>(debugHookID), firstLine, lastLine); 3897 3870 3898 3871 ++vPC; … … 3906 3879 exceptionValue = createInterruptedExecutionException(globalData); 3907 3880 } 3908 handlerVPC = throwException( exec, exceptionValue, vPC, r, false);3881 handlerVPC = throwException(callFrame, exceptionValue, vPC, false); 3909 3882 if (!handlerVPC) { 3910 3883 *exception = exceptionValue; … … 3922 3895 #undef VM_CHECK_EXCEPTION 3923 3896 #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) 3897 } 3898 3899 JSValue* Machine::retrieveArguments(CallFrame* callFrame, JSFunction* function) const 3900 { 3901 CallFrame* functionCallFrame = findFunctionCallFrame(callFrame, function); 3902 if (!functionCallFrame) 3931 3903 return jsNull(); 3932 3904 3933 CodeBlock* codeBlock = Machine::codeBlock(r);3905 CodeBlock* codeBlock = functionCallFrame->codeBlock(); 3934 3906 if (codeBlock->usesArguments) { 3935 3907 ASSERT(codeBlock->codeType == FunctionCode); 3936 3908 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());3909 int argumentsIndex = symbolTable.get(functionCallFrame->propertyNames().arguments.ustring().rep()).getIndex(); 3910 return functionCallFrame[argumentsIndex].jsValue(callFrame); 3911 } 3912 3913 Arguments* arguments = functionCallFrame->optionalCalleeArguments(); 3942 3914 if (!arguments) { 3943 arguments = new ( exec) Arguments(exec, r);3915 arguments = new (functionCallFrame) Arguments(functionCallFrame); 3944 3916 arguments->copyRegisters(); 3945 r[RegisterFile::OptionalCalleeArguments] = arguments; 3946 } 3947 ASSERT(arguments->isObject(&Arguments::info)); 3917 callFrame->setCalleeArguments(arguments); 3918 } 3948 3919 3949 3920 return arguments; 3950 3921 } 3951 3922 3952 JSValue* Machine::retrieveCaller( ExecState* exec, InternalFunction* function) const3953 { 3954 Register* r = this->callFrame(exec, function);3955 if (! r)3923 JSValue* Machine::retrieveCaller(CallFrame* callFrame, InternalFunction* function) const 3924 { 3925 CallFrame* functionCallFrame = findFunctionCallFrame(callFrame, function); 3926 if (!functionCallFrame) 3956 3927 return jsNull(); 3957 3928 3958 Register* callerR = r[RegisterFile::CallerRegisters].r();3959 if ( isHostCallFrame(callerR))3929 CallFrame* callerFrame = functionCallFrame->callerFrame(); 3930 if (callerFrame->hasHostCallFrameFlag()) 3960 3931 return jsNull(); 3961 3932 3962 JSValue* caller = caller R[RegisterFile::Callee].jsValue(exec);3933 JSValue* caller = callerFrame->callee(); 3963 3934 if (!caller) 3964 3935 return jsNull(); … … 3967 3938 } 3968 3939 3969 void Machine::retrieveLastCaller( ExecState* exec, int& lineNumber, intptr_t& sourceID, UString& sourceURL, JSValue*& function) const3940 void Machine::retrieveLastCaller(CallFrame* callFrame, int& lineNumber, intptr_t& sourceID, UString& sourceURL, JSValue*& function) const 3970 3941 { 3971 3942 function = 0; … … 3973 3944 sourceURL = UString(); 3974 3945 3975 Register* r = exec->registers(); 3976 Register* callerR = r[RegisterFile::CallerRegisters].r(); 3977 if (isHostCallFrame(callerR)) 3946 CallFrame* callerFrame = callFrame->callerFrame(); 3947 if (callerFrame->hasHostCallFrameFlag()) 3978 3948 return; 3979 3949 3980 CodeBlock* callerCodeBlock = c odeBlock(callerR);3950 CodeBlock* callerCodeBlock = callerFrame->codeBlock(); 3981 3951 if (!callerCodeBlock) 3982 3952 return; 3983 3953 3984 Instruction* vPC = vPCForPC(callerCodeBlock, r[RegisterFile::ReturnPC].v());3954 Instruction* vPC = vPCForPC(callerCodeBlock, callFrame->returnPC()); 3985 3955 lineNumber = callerCodeBlock->lineNumberForVPC(vPC - 1); 3986 3956 sourceID = callerCodeBlock->ownerNode->sourceID(); 3987 3957 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; 3958 function = callerFrame->callee(); 3959 } 3960 3961 CallFrame* Machine::findFunctionCallFrame(CallFrame* callFrame, InternalFunction* function) 3962 { 3963 for (CallFrame* candidate = callFrame; candidate; candidate = candidate->callerFrame()->removeHostCallFrameFlag()) { 3964 if (candidate->callee() == function) 3965 return candidate; 3966 } 4001 3967 return 0; 4002 3968 } 4003 3969 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)); 3970 void Machine::getArgumentsData(CallFrame* callFrame, JSFunction*& function, ptrdiff_t& firstParameterIndex, Register*& argv, int& argc) 3971 { 3972 function = callFrame->callee(); 4008 3973 4009 3974 CodeBlock* codeBlock = &function->m_body->generatedByteCode(); 4010 3975 int numParameters = codeBlock->numParameters; 4011 argc = callFrame [RegisterFile::ArgumentCount].i();3976 argc = callFrame->argumentCount(); 4012 3977 4013 3978 if (argc <= numParameters) 4014 argv = callFrame - RegisterFile::CallFrameHeaderSize - numParameters + 1; // + 1 to skip "this"3979 argv = callFrame->registers() - RegisterFile::CallFrameHeaderSize - numParameters + 1; // + 1 to skip "this" 4015 3980 else 4016 argv = callFrame - RegisterFile::CallFrameHeaderSize - numParameters - argc + 1; // + 1 to skip "this"3981 argv = callFrame->registers() - RegisterFile::CallFrameHeaderSize - numParameters - argc + 1; // + 1 to skip "this" 4017 3982 4018 3983 argc -= 1; // - 1 to skip "this" … … 4027 3992 } 4028 3993 4029 NEVER_INLINE void Machine::tryCTICachePutByID( ExecState* exec, CodeBlock* codeBlock, void* returnAddress, JSValue* baseValue, const PutPropertySlot& slot)3994 NEVER_INLINE void Machine::tryCTICachePutByID(CallFrame* callFrame, CodeBlock* codeBlock, void* returnAddress, JSValue* baseValue, const PutPropertySlot& slot) 4030 3995 { 4031 3996 // The interpreter checks for recursion here; I do not believe this can occur in CTI. … … 4069 4034 StructureIDChain* chain = structureID->cachedPrototypeChain(); 4070 4035 if (!chain) { 4071 chain = cachePrototypeChain( exec, structureID);4036 chain = cachePrototypeChain(callFrame, structureID); 4072 4037 if (!chain) { 4073 4038 // This happens if someone has manually inserted null into the prototype chain … … 4079 4044 vPC[7] = slot.cachedOffset(); 4080 4045 codeBlock->refStructureIDs(vPC); 4081 CTI::compilePutByIdTransition(this, exec, codeBlock, structureID->previousID(), structureID, slot.cachedOffset(), chain, returnAddress);4046 CTI::compilePutByIdTransition(this, callFrame, codeBlock, structureID->previousID(), structureID, slot.cachedOffset(), chain, returnAddress); 4082 4047 return; 4083 4048 } … … 4089 4054 4090 4055 #if USE(CTI_REPATCH_PIC) 4091 UNUSED_PARAM( exec);4056 UNUSED_PARAM(callFrame); 4092 4057 CTI::patchPutByIdReplace(codeBlock, structureID, slot.cachedOffset(), returnAddress); 4093 4058 #else 4094 CTI::compilePutByIdReplace(this, exec, codeBlock, structureID, slot.cachedOffset(), returnAddress);4059 CTI::compilePutByIdReplace(this, callFrame, codeBlock, structureID, slot.cachedOffset(), returnAddress); 4095 4060 #endif 4096 4061 } 4097 4062 4098 void* Machine::getCTIArrayLengthTrampoline( ExecState* exec, CodeBlock* codeBlock)4063 void* Machine::getCTIArrayLengthTrampoline(CallFrame* callFrame, CodeBlock* codeBlock) 4099 4064 { 4100 4065 if (!m_ctiArrayLengthTrampoline) 4101 m_ctiArrayLengthTrampoline = CTI::compileArrayLengthTrampoline(this, exec, codeBlock);4066 m_ctiArrayLengthTrampoline = CTI::compileArrayLengthTrampoline(this, callFrame, codeBlock); 4102 4067 4103 4068 return m_ctiArrayLengthTrampoline; 4104 4069 } 4105 4070 4106 void* Machine::getCTIStringLengthTrampoline( ExecState* exec, CodeBlock* codeBlock)4071 void* Machine::getCTIStringLengthTrampoline(CallFrame* callFrame, CodeBlock* codeBlock) 4107 4072 { 4108 4073 if (!m_ctiStringLengthTrampoline) 4109 m_ctiStringLengthTrampoline = CTI::compileStringLengthTrampoline(this, exec, codeBlock);4074 m_ctiStringLengthTrampoline = CTI::compileStringLengthTrampoline(this, callFrame, codeBlock); 4110 4075 4111 4076 return m_ctiStringLengthTrampoline; 4112 4077 } 4113 4078 4114 NEVER_INLINE void Machine::tryCTICacheGetByID( ExecState* exec, CodeBlock* codeBlock, void* returnAddress, JSValue* baseValue, const Identifier& propertyName, const PropertySlot& slot)4079 NEVER_INLINE void Machine::tryCTICacheGetByID(CallFrame* callFrame, CodeBlock* codeBlock, void* returnAddress, JSValue* baseValue, const Identifier& propertyName, const PropertySlot& slot) 4115 4080 { 4116 4081 // FIXME: Write a test that proves we need to check for recursion here just … … 4123 4088 } 4124 4089 4125 if (isJSArray(baseValue) && propertyName == exec->propertyNames().length) {4090 if (isJSArray(baseValue) && propertyName == callFrame->propertyNames().length) { 4126 4091 #if USE(CTI_REPATCH_PIC) 4127 CTI::compilePatchGetArrayLength(this, exec, codeBlock, returnAddress);4092 CTI::compilePatchGetArrayLength(this, callFrame, codeBlock, returnAddress); 4128 4093 #else 4129 ctiRepatchCallByReturnAddress(returnAddress, getCTIArrayLengthTrampoline( exec, codeBlock));4094 ctiRepatchCallByReturnAddress(returnAddress, getCTIArrayLengthTrampoline(callFrame, codeBlock)); 4130 4095 #endif 4131 4096 return; 4132 4097 } 4133 if (isJSString(baseValue) && propertyName == exec->propertyNames().length) {4098 if (isJSString(baseValue) && propertyName == callFrame->propertyNames().length) { 4134 4099 // The tradeoff of compiling an repatched inline string length access routine does not seem 4135 4100 // to pay off, so we currently only do this for arrays. 4136 ctiRepatchCallByReturnAddress(returnAddress, getCTIStringLengthTrampoline( exec, codeBlock));4101 ctiRepatchCallByReturnAddress(returnAddress, getCTIStringLengthTrampoline(callFrame, codeBlock)); 4137 4102 return; 4138 4103 } … … 4170 4135 CTI::patchGetByIdSelf(codeBlock, structureID, slot.cachedOffset(), returnAddress); 4171 4136 #else 4172 CTI::compileGetByIdSelf(this, exec, codeBlock, structureID, slot.cachedOffset(), returnAddress);4137 CTI::compileGetByIdSelf(this, callFrame, codeBlock, structureID, slot.cachedOffset(), returnAddress); 4173 4138 #endif 4174 4139 return; 4175 4140 } 4176 4141 4177 if (slot.slotBase() == structureID->prototypeForLookup( exec)) {4142 if (slot.slotBase() == structureID->prototypeForLookup(callFrame)) { 4178 4143 ASSERT(slot.slotBase()->isObject()); 4179 4144 … … 4194 4159 codeBlock->refStructureIDs(vPC); 4195 4160 4196 CTI::compileGetByIdProto(this, exec, codeBlock, structureID, slotBaseObject->structureID(), slot.cachedOffset(), returnAddress);4161 CTI::compileGetByIdProto(this, callFrame, codeBlock, structureID, slotBaseObject->structureID(), slot.cachedOffset(), returnAddress); 4197 4162 return; 4198 4163 } … … 4201 4166 JSObject* o = static_cast<JSObject*>(baseValue); 4202 4167 while (slot.slotBase() != o) { 4203 JSValue* v = o->structureID()->prototypeForLookup( exec);4168 JSValue* v = o->structureID()->prototypeForLookup(callFrame); 4204 4169 4205 4170 // If we didn't find slotBase in baseValue's prototype chain, then baseValue … … 4226 4191 StructureIDChain* chain = structureID->cachedPrototypeChain(); 4227 4192 if (!chain) 4228 chain = cachePrototypeChain( exec, structureID);4193 chain = cachePrototypeChain(callFrame, structureID); 4229 4194 4230 4195 ASSERT(chain); … … 4236 4201 codeBlock->refStructureIDs(vPC); 4237 4202 4238 CTI::compileGetByIdChain(this, exec, codeBlock, structureID, chain, count, slot.cachedOffset(), returnAddress);4203 CTI::compileGetByIdChain(this, callFrame, codeBlock, structureID, chain, count, slot.cachedOffset(), returnAddress); 4239 4204 } 4240 4205 … … 4291 4256 { 4292 4257 JSValue* v1 = ARG_src1; 4293 ExecState* exec = ARG_exec;4294 4295 JSObject* result = v1->toThisObject( exec);4258 CallFrame* callFrame = ARG_callFrame; 4259 4260 JSObject* result = v1->toThisObject(callFrame); 4296 4261 VM_CHECK_EXCEPTION_AT_END(); 4297 4262 return result; … … 4300 4265 void Machine::cti_op_end(CTI_ARGS) 4301 4266 { 4302 Register* r = ARG_r; 4303 ScopeChainNode* scopeChain = Machine::scopeChain(r); 4267 ScopeChainNode* scopeChain = ARG_callFrame->scopeChain(); 4304 4268 ASSERT(scopeChain->refCount > 1); 4305 4269 scopeChain->deref(); … … 4318 4282 return jsNumber(ARG_globalData, left + right); 4319 4283 4320 ExecState* exec = ARG_exec;4284 CallFrame* callFrame = ARG_callFrame; 4321 4285 4322 4286 bool leftIsString = v1->isString(); … … 4324 4288 RefPtr<UString::Rep> value = concatenate(static_cast<JSString*>(v1)->value().rep(), static_cast<JSString*>(v2)->value().rep()); 4325 4289 if (UNLIKELY(!value)) { 4326 throwOutOfMemoryError( exec);4290 throwOutOfMemoryError(callFrame); 4327 4291 VM_THROW_EXCEPTION(); 4328 4292 } … … 4337 4301 4338 4302 if (UNLIKELY(!value)) { 4339 throwOutOfMemoryError( exec);4303 throwOutOfMemoryError(callFrame); 4340 4304 VM_THROW_EXCEPTION(); 4341 4305 } … … 4344 4308 4345 4309 // All other cases are pretty uncommon 4346 JSValue* result = jsAddSlowCase( exec, v1, v2);4310 JSValue* result = jsAddSlowCase(callFrame, v1, v2); 4347 4311 VM_CHECK_EXCEPTION_AT_END(); 4348 4312 return result; … … 4353 4317 JSValue* v = ARG_src1; 4354 4318 4355 ExecState* exec = ARG_exec;4356 JSValue* result = jsNumber(ARG_globalData, v->toNumber( exec) + 1);4319 CallFrame* callFrame = ARG_callFrame; 4320 JSValue* result = jsNumber(ARG_globalData, v->toNumber(callFrame) + 1); 4357 4321 VM_CHECK_EXCEPTION_AT_END(); 4358 4322 return result; … … 4361 4325 void Machine::cti_timeout_check(CTI_ARGS) 4362 4326 { 4363 if (ARG_globalData->machine->checkTimeout(ARG_ exec->dynamicGlobalObject())) {4327 if (ARG_globalData->machine->checkTimeout(ARG_callFrame->dynamicGlobalObject())) { 4364 4328 ARG_globalData->exception = createInterruptedExecutionException(ARG_globalData); 4365 4329 VM_THROW_EXCEPTION_AT_END(); … … 4371 4335 JSValue* src1 = ARG_src1; 4372 4336 JSValue* src2 = ARG_src2; 4373 ExecState* exec = ARG_exec;4374 4375 bool result = jsLess( exec, src1, src2);4337 CallFrame* callFrame = ARG_callFrame; 4338 4339 bool result = jsLess(callFrame, src1, src2); 4376 4340 VM_CHECK_EXCEPTION_AT_END(); 4377 4341 return result; … … 4382 4346 JSValue* src1 = ARG_src1; 4383 4347 JSValue* src2 = ARG_src2; 4384 ExecState* exec = ARG_exec;4385 4386 bool result = jsLessEq( exec, src1, src2);4348 CallFrame* callFrame = ARG_callFrame; 4349 4350 bool result = jsLessEq(callFrame, src1, src2); 4387 4351 VM_CHECK_EXCEPTION_AT_END(); 4388 4352 return result; … … 4391 4355 JSValue* Machine::cti_op_new_object(CTI_ARGS) 4392 4356 { 4393 return constructEmptyObject(ARG_ exec);;4357 return constructEmptyObject(ARG_callFrame);; 4394 4358 } 4395 4359 4396 4360 void Machine::cti_op_put_by_id(CTI_ARGS) 4397 4361 { 4398 ExecState* exec = ARG_exec;4362 CallFrame* callFrame = ARG_callFrame; 4399 4363 Identifier& ident = *ARG_id2; 4400 4364 4401 4365 PutPropertySlot slot; 4402 ARG_src1->put( exec, ident, ARG_src3, slot);4366 ARG_src1->put(callFrame, ident, ARG_src3, slot); 4403 4367 4404 4368 ctiRepatchCallByReturnAddress(CTI_RETURN_ADDRESS, (void*)cti_op_put_by_id_second); … … 4409 4373 void Machine::cti_op_put_by_id_second(CTI_ARGS) 4410 4374 { 4411 ExecState* exec = ARG_exec; 4375 PutPropertySlot slot; 4376 ARG_src1->put(ARG_callFrame, *ARG_id2, ARG_src3, slot); 4377 ARG_globalData->machine->tryCTICachePutByID(ARG_callFrame, ARG_callFrame->codeBlock(), CTI_RETURN_ADDRESS, ARG_src1, slot); 4378 VM_CHECK_EXCEPTION_AT_END(); 4379 } 4380 4381 void Machine::cti_op_put_by_id_generic(CTI_ARGS) 4382 { 4383 PutPropertySlot slot; 4384 ARG_src1->put(ARG_callFrame, *ARG_id2, ARG_src3, slot); 4385 VM_CHECK_EXCEPTION_AT_END(); 4386 } 4387 4388 void Machine::cti_op_put_by_id_fail(CTI_ARGS) 4389 { 4390 CallFrame* callFrame = ARG_callFrame; 4412 4391 Identifier& ident = *ARG_id2; 4413 4392 4414 JSValue* baseValue = ARG_src1;4415 4393 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); 4394 ARG_src1->put(callFrame, ident, ARG_src3, slot); 4442 4395 4443 4396 // should probably uncachePutByID() ... this would mean doing a vPC lookup - might be worth just bleeding this until the end. … … 4449 4402 JSValue* Machine::cti_op_get_by_id(CTI_ARGS) 4450 4403 { 4451 ExecState* exec = ARG_exec;4404 CallFrame* callFrame = ARG_callFrame; 4452 4405 Identifier& ident = *ARG_id2; 4453 4406 4454 4407 JSValue* baseValue = ARG_src1; 4455 4408 PropertySlot slot(baseValue); 4456 JSValue* result = baseValue->get( exec, ident, slot);4409 JSValue* result = baseValue->get(callFrame, ident, slot); 4457 4410 4458 4411 ctiRepatchCallByReturnAddress(CTI_RETURN_ADDRESS, (void*)cti_op_get_by_id_second); … … 4464 4417 JSValue* Machine::cti_op_get_by_id_second(CTI_ARGS) 4465 4418 { 4466 ExecState* exec = ARG_exec;4419 CallFrame* callFrame = ARG_callFrame; 4467 4420 Identifier& ident = *ARG_id2; 4468 4421 4469 4422 JSValue* baseValue = ARG_src1; 4470 4423 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); 4424 JSValue* result = baseValue->get(callFrame, ident, slot); 4425 4426 ARG_globalData->machine->tryCTICacheGetByID(callFrame, callFrame->codeBlock(), CTI_RETURN_ADDRESS, baseValue, ident, slot); 4475 4427 4476 4428 VM_CHECK_EXCEPTION_AT_END(); … … 4480 4432 JSValue* Machine::cti_op_get_by_id_generic(CTI_ARGS) 4481 4433 { 4482 ExecState* exec = ARG_exec;4434 CallFrame* callFrame = ARG_callFrame; 4483 4435 Identifier& ident = *ARG_id2; 4484 4436 4485 4437 JSValue* baseValue = ARG_src1; 4486 4438 PropertySlot slot(baseValue); 4487 JSValue* result = baseValue->get( exec, ident, slot);4439 JSValue* result = baseValue->get(callFrame, ident, slot); 4488 4440 4489 4441 VM_CHECK_EXCEPTION_AT_END(); … … 4493 4445 JSValue* Machine::cti_op_get_by_id_fail(CTI_ARGS) 4494 4446 { 4495 ExecState* exec = ARG_exec;4447 CallFrame* callFrame = ARG_callFrame; 4496 4448 Identifier& ident = *ARG_id2; 4497 4449 4498 4450 JSValue* baseValue = ARG_src1; 4499 4451 PropertySlot slot(baseValue); 4500 JSValue* result = baseValue->get( exec, ident, slot);4452 JSValue* result = baseValue->get(callFrame, ident, slot); 4501 4453 4502 4454 // should probably uncacheGetByID() ... this would mean doing a vPC lookup - might be worth just bleeding this until the end. … … 4509 4461 JSValue* Machine::cti_op_instanceof(CTI_ARGS) 4510 4462 { 4511 ExecState* exec = ARG_exec;4463 CallFrame* callFrame = ARG_callFrame; 4512 4464 JSValue* value = ARG_src1; 4513 4465 JSValue* baseVal = ARG_src2; … … 4523 4475 4524 4476 if (!baseVal->isObject()) { 4525 Register* r = ARG_r;4526 CodeBlock* codeBlock = Machine::codeBlock(r);4477 CallFrame* callFrame = ARG_callFrame; 4478 CodeBlock* codeBlock = callFrame->codeBlock(); 4527 4479 ASSERT(codeBlock->ctiReturnAddressVPCMap.contains(CTI_RETURN_ADDRESS)); 4528 4480 unsigned vPCIndex = codeBlock->ctiReturnAddressVPCMap.get(CTI_RETURN_ADDRESS); 4529 ARG_globalData->exception = createInvalidParamError( exec, "instanceof", baseVal, codeBlock->instructions.begin() + vPCIndex, codeBlock);4481 ARG_globalData->exception = createInvalidParamError(callFrame, "instanceof", baseVal, codeBlock->instructions.begin() + vPCIndex, codeBlock); 4530 4482 VM_THROW_EXCEPTION(); 4531 4483 } … … 4535 4487 4536 4488 if (!proto->isObject()) { 4537 throwError( exec, TypeError, "instanceof called on an object with an invalid prototype property.");4489 throwError(callFrame, TypeError, "instanceof called on an object with an invalid prototype property."); 4538 4490 VM_THROW_EXCEPTION(); 4539 4491 } … … 4542 4494 return jsBoolean(false); 4543 4495 4544 JSValue* result = jsBoolean(static_cast<JSObject*>(baseCell)->hasInstance( exec, valueCell, protoCell));4496 JSValue* result = jsBoolean(static_cast<JSObject*>(baseCell)->hasInstance(callFrame, valueCell, protoCell)); 4545 4497 VM_CHECK_EXCEPTION_AT_END(); 4546 4498 … … 4550 4502 JSValue* Machine::cti_op_del_by_id(CTI_ARGS) 4551 4503 { 4552 ExecState* exec = ARG_exec;4504 CallFrame* callFrame = ARG_callFrame; 4553 4505 Identifier& ident = *ARG_id2; 4554 4506 4555 JSObject* baseObj = ARG_src1->toObject( exec);4556 4557 JSValue* result = jsBoolean(baseObj->deleteProperty( exec, ident));4507 JSObject* baseObj = ARG_src1->toObject(callFrame); 4508 4509 JSValue* result = jsBoolean(baseObj->deleteProperty(callFrame, ident)); 4558 4510 VM_CHECK_EXCEPTION_AT_END(); 4559 4511 return result; … … 4570 4522 return jsNumber(ARG_globalData, left * right); 4571 4523 4572 ExecState* exec = ARG_exec;4573 JSValue* result = jsNumber(ARG_globalData, src1->toNumber( exec) * src2->toNumber(exec));4524 CallFrame* callFrame = ARG_callFrame; 4525 JSValue* result = jsNumber(ARG_globalData, src1->toNumber(callFrame) * src2->toNumber(callFrame)); 4574 4526 VM_CHECK_EXCEPTION_AT_END(); 4575 4527 return result; … … 4578 4530 JSValue* Machine::cti_op_new_func(CTI_ARGS) 4579 4531 { 4580 return ARG_func1->makeFunction(ARG_ exec, Machine::scopeChain(ARG_r));4532 return ARG_func1->makeFunction(ARG_callFrame, ARG_callFrame->scopeChain()); 4581 4533 } 4582 4534 … … 4589 4541 4590 4542 if (UNLIKELY(*ARG_profilerReference != 0)) 4591 (*ARG_profilerReference)->willExecute( CallFrame::create(ARG_r), static_cast<JSObject*>(ARG_src1));4543 (*ARG_profilerReference)->willExecute(ARG_callFrame, static_cast<JSFunction*>(ARG_src1)); 4592 4544 4593 4545 ScopeChainNode* callDataScopeChain = static_cast<JSFunction*>(ARG_src1)->m_scopeChain.node(); 4594 4546 CodeBlock* newCodeBlock = &static_cast<JSFunction*>(ARG_src1)->m_body->byteCode(callDataScopeChain); 4595 4547 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));4548 CallFrame* callFrame = slideRegisterWindowForCall(newCodeBlock, ARG_registerFile, ARG_callFrame, ARG_int2, ARG_int3); 4549 if (UNLIKELY(!callFrame)) { 4550 ARG_globalData->exception = createStackOverflowError(ARG_callFrame); 4599 4551 VM_THROW_EXCEPTION_2(); 4600 4552 } 4601 4553 4602 VoidPtrPair pair = { newCodeBlock, r};4554 VoidPtrPair pair = { newCodeBlock, callFrame }; 4603 4555 return pair; 4604 4556 } … … 4606 4558 void* Machine::cti_vm_compile(CTI_ARGS) 4607 4559 { 4608 Register* r = ARG_r; 4609 CodeBlock* codeBlock = Machine::codeBlock(r); 4610 4560 CodeBlock* codeBlock = ARG_callFrame->codeBlock(); 4611 4561 if (!codeBlock->ctiCode) 4612 CTI::compile(ARG_globalData->machine, CallFrame::create(r), codeBlock); 4613 4562 CTI::compile(ARG_globalData->machine, ARG_callFrame, codeBlock); 4614 4563 return codeBlock->ctiCode; 4615 4564 } … … 4617 4566 JSValue* Machine::cti_op_push_activation(CTI_ARGS) 4618 4567 { 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); 4568 JSActivation* activation = new (ARG_globalData) JSActivation(ARG_callFrame, static_cast<FunctionBodyNode*>(ARG_callFrame->codeBlock()->ownerNode)); 4569 ARG_callFrame->setScopeChain(ARG_callFrame->scopeChain()->copy()->push(activation)); 4626 4570 return activation; 4627 4571 } … … 4639 4583 int registerOffset = ARG_int2; 4640 4584 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);4585 CallFrame* previousCallFrame = ARG_callFrame; 4586 CallFrame* callFrame = CallFrame::create(previousCallFrame->registers() + registerOffset); 4587 4588 callFrame->init(0, ARG_instr4 + 1, previousCallFrame->scopeChain(), previousCallFrame, 0, argCount, static_cast<JSFunction*>(funcVal)); 4589 ARG_setCallFrame(callFrame); 4646 4590 4647 4591 if (*ARG_profilerReference) 4648 (*ARG_profilerReference)->willExecute( CallFrame::create(r), static_cast<JSObject*>(funcVal));4649 4650 Register* argv = r- RegisterFile::CallFrameHeaderSize - argCount;4592 (*ARG_profilerReference)->willExecute(callFrame, static_cast<JSFunction*>(funcVal)); 4593 4594 Register* argv = ARG_callFrame->registers() - RegisterFile::CallFrameHeaderSize - argCount; 4651 4595 ArgList argList(argv + 1, argCount - 1); 4652 4596 4653 4597 CTI_MACHINE_SAMPLING_callingHostFunction(); 4654 4598 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);4599 JSValue* returnValue = callData.native.function(callFrame, static_cast<JSFunction*>(funcVal), argv[0].jsValue(callFrame), argList); 4600 ARG_setCallFrame(previousCallFrame); 4657 4601 VM_CHECK_EXCEPTION(); 4658 4602 4659 4603 if (*ARG_profilerReference) 4660 (*ARG_profilerReference)->didExecute( CallFrame::create(savedR), static_cast<JSObject*>(funcVal));4604 (*ARG_profilerReference)->didExecute(previousCallFrame, static_cast<JSFunction*>(funcVal)); 4661 4605 4662 4606 return returnValue; … … 4665 4609 ASSERT(callType == CallTypeNone); 4666 4610 4667 ARG_globalData->exception = createNotAFunctionError( CallFrame::create(ARG_r), funcVal, ARG_instr4, codeBlock(ARG_r));4611 ARG_globalData->exception = createNotAFunctionError(ARG_callFrame, funcVal, ARG_instr4, ARG_callFrame->codeBlock()); 4668 4612 VM_THROW_EXCEPTION(); 4669 4613 } … … 4671 4615 void Machine::cti_op_create_arguments(CTI_ARGS) 4672 4616 { 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; 4617 Arguments* arguments = new (ARG_globalData) Arguments(ARG_callFrame); 4618 ARG_callFrame->setCalleeArguments(arguments); 4619 ARG_callFrame[RegisterFile::ArgumentsRegister] = arguments; 4679 4620 } 4680 4621 4681 4622 void Machine::cti_op_tear_off_activation(CTI_ARGS) 4682 4623 { 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); 4624 ASSERT(ARG_callFrame->codeBlock()->needsFullScopeChain); 4625 ASSERT(ARG_src1->isObject(&JSActivation::info)); 4626 static_cast<JSActivation*>(ARG_src1)->copyRegisters(ARG_callFrame->optionalCalleeArguments()); 4692 4627 } 4693 4628 4694 4629 void Machine::cti_op_tear_off_arguments(CTI_ARGS) 4695 4630 { 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(); 4631 ASSERT(ARG_callFrame->codeBlock()->usesArguments && !ARG_callFrame->codeBlock()->needsFullScopeChain); 4632 ARG_callFrame->optionalCalleeArguments()->copyRegisters(); 4703 4633 } 4704 4634 4705 4635 void Machine::cti_op_ret_profiler(CTI_ARGS) 4706 4636 { 4707 ExecState* exec = ARG_exec;4708 4709 Register* r = ARG_r;4710 4637 ASSERT(*ARG_profilerReference); 4711 (*ARG_profilerReference)->didExecute( exec, static_cast<JSObject*>(r[RegisterFile::Callee].jsValue(exec)));4638 (*ARG_profilerReference)->didExecute(ARG_callFrame, ARG_callFrame->callee()); 4712 4639 } 4713 4640 4714 4641 void Machine::cti_op_ret_scopeChain(CTI_ARGS) 4715 4642 { 4716 Register* r = ARG_r; 4717 ASSERT(codeBlock(r)->needsFullScopeChain); 4718 scopeChain(r)->deref(); 4643 ASSERT(ARG_callFrame->codeBlock()->needsFullScopeChain); 4644 ARG_callFrame->scopeChain()->deref(); 4719 4645 } 4720 4646 4721 4647 JSValue* Machine::cti_op_new_array(CTI_ARGS) 4722 4648 { 4723 ArgList arg sList(ARG_registers1, ARG_int2);4724 return constructArray(ARG_ exec, argsList);4649 ArgList argList(ARG_registers1, ARG_int2); 4650 return constructArray(ARG_callFrame, argList); 4725 4651 } 4726 4652 4727 4653 JSValue* Machine::cti_op_resolve(CTI_ARGS) 4728 4654 { 4729 ExecState* exec = ARG_exec; 4730 Register* r = ARG_r; 4731 ScopeChainNode* scopeChain = Machine::scopeChain(r); 4655 CallFrame* callFrame = ARG_callFrame; 4656 ScopeChainNode* scopeChain = callFrame->scopeChain(); 4732 4657 4733 4658 ScopeChainIterator iter = scopeChain->begin(); … … 4739 4664 JSObject* o = *iter; 4740 4665 PropertySlot slot(o); 4741 if (o->getPropertySlot( exec, ident, slot)) {4742 JSValue* result = slot.getValue( exec, ident);4666 if (o->getPropertySlot(callFrame, ident, slot)) { 4667 JSValue* result = slot.getValue(callFrame, ident); 4743 4668 VM_CHECK_EXCEPTION_AT_END(); 4744 4669 return result; … … 4746 4671 } while (++iter != end); 4747 4672 4748 CodeBlock* codeBlock = Machine::codeBlock(r);4673 CodeBlock* codeBlock = callFrame->codeBlock(); 4749 4674 ASSERT(codeBlock->ctiReturnAddressVPCMap.contains(CTI_RETURN_ADDRESS)); 4750 4675 unsigned vPCIndex = codeBlock->ctiReturnAddressVPCMap.get(CTI_RETURN_ADDRESS); 4751 exec->setException(createUndefinedVariableError(exec, ident, codeBlock->instructions.begin() + vPCIndex, codeBlock));4676 ARG_globalData->exception = createUndefinedVariableError(callFrame, ident, codeBlock->instructions.begin() + vPCIndex, codeBlock); 4752 4677 VM_THROW_EXCEPTION(); 4753 4678 } … … 4756 4681 { 4757 4682 RegisterFile* registerFile = ARG_registerFile; 4758 Register* r = ARG_r;4683 CallFrame* callFrame = ARG_callFrame; 4759 4684 4760 4685 JSFunction* constructor = static_cast<JSFunction*>(ARG_src1); … … 4770 4695 4771 4696 if (*ARG_profilerReference) 4772 (*ARG_profilerReference)->willExecute( CallFrame::create(r), constructor);4697 (*ARG_profilerReference)->willExecute(callFrame, constructor); 4773 4698 4774 4699 ScopeChainNode* callDataScopeChain = constructor->m_scopeChain.node(); … … 4783 4708 JSObject* newObject = new (ARG_globalData) JSObject(structure); 4784 4709 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));4710 callFrame[firstArg] = newObject; // "this" value 4711 4712 callFrame = slideRegisterWindowForCall(newCodeBlock, registerFile, callFrame, registerOffset, argCount); 4713 if (UNLIKELY(!callFrame)) { 4714 ARG_globalData->exception = createStackOverflowError(ARG_callFrame); 4790 4715 VM_THROW_EXCEPTION_2(); 4791 4716 } 4792 4717 4793 VoidPtrPair pair = { newCodeBlock, r};4718 VoidPtrPair pair = { newCodeBlock, callFrame }; 4794 4719 return pair; 4795 4720 } … … 4797 4722 JSValue* Machine::cti_op_construct_NotJSConstruct(CTI_ARGS) 4798 4723 { 4799 ExecState* exec = ARG_exec; 4800 Register* r = ARG_r; 4724 CallFrame* callFrame = ARG_callFrame; 4801 4725 4802 4726 JSValue* constrVal = ARG_src1; … … 4811 4735 if (constructType == ConstructTypeHost) { 4812 4736 if (*ARG_profilerReference) 4813 (*ARG_profilerReference)->willExecute( exec, constructor);4814 4815 ArgList argList( r+ firstArg + 1, argCount - 1);4737 (*ARG_profilerReference)->willExecute(callFrame, constructor); 4738 4739 ArgList argList(callFrame->registers() + firstArg + 1, argCount - 1); 4816 4740 4817 4741 CTI_MACHINE_SAMPLING_callingHostFunction(); 4818 4742 4819 JSValue* returnValue = constructData.native.function( exec, constructor, argList);4743 JSValue* returnValue = constructData.native.function(callFrame, constructor, argList); 4820 4744 VM_CHECK_EXCEPTION(); 4821 4745 4822 4746 if (*ARG_profilerReference) 4823 (*ARG_profilerReference)->didExecute( exec, constructor);4747 (*ARG_profilerReference)->didExecute(callFrame, constructor); 4824 4748 4825 4749 return returnValue; … … 4828 4752 ASSERT(constructType == ConstructTypeNone); 4829 4753 4830 exec->setException(createNotAConstructorError(exec, constrVal, ARG_instr6, codeBlock(r)));4754 ARG_globalData->exception = createNotAConstructorError(callFrame, constrVal, ARG_instr6, callFrame->codeBlock()); 4831 4755 VM_THROW_EXCEPTION(); 4832 4756 } … … 4834 4758 JSValue* Machine::cti_op_get_by_val(CTI_ARGS) 4835 4759 { 4836 ExecState* exec = ARG_exec;4760 CallFrame* callFrame = ARG_callFrame; 4837 4761 Machine* machine = ARG_globalData->machine; 4838 4762 … … 4850 4774 result = jsArray->getIndex(i); 4851 4775 else 4852 result = jsArray->JSArray::get( exec, i);4776 result = jsArray->JSArray::get(callFrame, i); 4853 4777 } else if (machine->isJSString(baseValue) && static_cast<JSString*>(baseValue)->canGetIndex(i)) 4854 4778 result = static_cast<JSString*>(baseValue)->getIndex(ARG_globalData, i); 4855 4779 else 4856 result = baseValue->get( exec, i);4780 result = baseValue->get(callFrame, i); 4857 4781 } else { 4858 Identifier property( exec, subscript->toString(exec));4859 result = baseValue->get( exec, property);4782 Identifier property(callFrame, subscript->toString(callFrame)); 4783 result = baseValue->get(callFrame, property); 4860 4784 } 4861 4785 … … 4866 4790 VoidPtrPair Machine::cti_op_resolve_func(CTI_ARGS) 4867 4791 { 4868 ExecState* exec = ARG_exec; 4869 Register* r = ARG_r; 4870 ScopeChainNode* scopeChain = Machine::scopeChain(r); 4792 CallFrame* callFrame = ARG_callFrame; 4793 ScopeChainNode* scopeChain = callFrame->scopeChain(); 4871 4794 4872 4795 ScopeChainIterator iter = scopeChain->begin(); … … 4882 4805 base = *iter; 4883 4806 PropertySlot slot(base); 4884 if (base->getPropertySlot( exec, ident, slot)) {4807 if (base->getPropertySlot(callFrame, ident, slot)) { 4885 4808 // ECMA 11.2.3 says that if we hit an activation the this value should be null. 4886 4809 // However, section 10.2.3 says that in the case where the value provided … … 4890 4813 // that in host objects you always get a valid object for this. 4891 4814 // 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);4815 JSObject* thisObj = base->toThisObject(callFrame); 4816 JSValue* result = slot.getValue(callFrame, ident); 4894 4817 VM_CHECK_EXCEPTION_AT_END(); 4895 4818 … … 4900 4823 } while (iter != end); 4901 4824 4902 CodeBlock* codeBlock = Machine::codeBlock(r);4825 CodeBlock* codeBlock = callFrame->codeBlock(); 4903 4826 ASSERT(codeBlock->ctiReturnAddressVPCMap.contains(CTI_RETURN_ADDRESS)); 4904 4827 unsigned vPCIndex = codeBlock->ctiReturnAddressVPCMap.get(CTI_RETURN_ADDRESS); 4905 exec->setException(createUndefinedVariableError(exec, ident, codeBlock->instructions.begin() + vPCIndex, codeBlock));4828 ARG_globalData->exception = createUndefinedVariableError(callFrame, ident, codeBlock->instructions.begin() + vPCIndex, codeBlock); 4906 4829 VM_THROW_EXCEPTION_2(); 4907 4830 } … … 4917 4840 return jsNumber(ARG_globalData, left - right); 4918 4841 4919 ExecState* exec = ARG_exec;4920 JSValue* result = jsNumber(ARG_globalData, src1->toNumber( exec) - src2->toNumber(exec));4842 CallFrame* callFrame = ARG_callFrame; 4843 JSValue* result = jsNumber(ARG_globalData, src1->toNumber(callFrame) - src2->toNumber(callFrame)); 4921 4844 VM_CHECK_EXCEPTION_AT_END(); 4922 4845 return result; … … 4925 4848 void Machine::cti_op_put_by_val(CTI_ARGS) 4926 4849 { 4927 ExecState* exec = ARG_exec;4850 CallFrame* callFrame = ARG_callFrame; 4928 4851 Machine* machine = ARG_globalData->machine; 4929 4852 … … 4941 4864 jsArray->setIndex(i, value); 4942 4865 else 4943 jsArray->JSArray::put( exec, i, value);4866 jsArray->JSArray::put(callFrame, i, value); 4944 4867 } else 4945 baseValue->put( exec, i, value);4868 baseValue->put(callFrame, i, value); 4946 4869 } else { 4947 Identifier property( exec, subscript->toString(exec));4870 Identifier property(callFrame, subscript->toString(callFrame)); 4948 4871 if (!ARG_globalData->exception) { // Don't put to an object if toString threw an exception. 4949 4872 PutPropertySlot slot; 4950 baseValue->put( exec, property, value, slot);4873 baseValue->put(callFrame, property, value, slot); 4951 4874 } 4952 4875 } … … 4957 4880 void Machine::cti_op_put_by_val_array(CTI_ARGS) 4958 4881 { 4959 ExecState* exec = ARG_exec;4882 CallFrame* callFrame = ARG_callFrame; 4960 4883 4961 4884 JSValue* baseValue = ARG_src1; … … 4966 4889 4967 4890 if (LIKELY(i >= 0)) 4968 static_cast<JSArray*>(baseValue)->JSArray::put( exec, i, value);4891 static_cast<JSArray*>(baseValue)->JSArray::put(callFrame, i, value); 4969 4892 else { 4970 Identifier property( exec, JSImmediate::from(i)->toString(exec));4893 Identifier property(callFrame, JSImmediate::from(i)->toString(callFrame)); 4971 4894 // FIXME: can toString throw an exception here? 4972 4895 if (!ARG_globalData->exception) { // Don't put to an object if toString threw an exception. 4973 4896 PutPropertySlot slot; 4974 baseValue->put( exec, property, value, slot);4897 baseValue->put(callFrame, property, value, slot); 4975 4898 } 4976 4899 } … … 4981 4904 JSValue* Machine::cti_op_lesseq(CTI_ARGS) 4982 4905 { 4983 ExecState* exec = ARG_exec;4984 JSValue* result = jsBoolean(jsLessEq( exec, ARG_src1, ARG_src2));4906 CallFrame* callFrame = ARG_callFrame; 4907 JSValue* result = jsBoolean(jsLessEq(callFrame, ARG_src1, ARG_src2)); 4985 4908 VM_CHECK_EXCEPTION_AT_END(); 4986 4909 return result; … … 4991 4914 JSValue* src1 = ARG_src1; 4992 4915 4993 ExecState* exec = ARG_exec;4994 4995 bool result = src1->toBoolean( exec);4916 CallFrame* callFrame = ARG_callFrame; 4917 4918 bool result = src1->toBoolean(callFrame); 4996 4919 VM_CHECK_EXCEPTION_AT_END(); 4997 4920 return result; … … 5006 4929 return jsNumber(ARG_globalData, -v); 5007 4930 5008 ExecState* exec = ARG_exec;5009 JSValue* result = jsNumber(ARG_globalData, -src->toNumber( exec));4931 CallFrame* callFrame = ARG_callFrame; 4932 JSValue* result = jsNumber(ARG_globalData, -src->toNumber(callFrame)); 5010 4933 VM_CHECK_EXCEPTION_AT_END(); 5011 4934 return result; … … 5014 4937 JSValue* Machine::cti_op_resolve_base(CTI_ARGS) 5015 4938 { 5016 return inlineResolveBase(ARG_ exec, *ARG_id1, scopeChain(ARG_r));4939 return inlineResolveBase(ARG_callFrame, *ARG_id1, ARG_callFrame->scopeChain()); 5017 4940 } 5018 4941 5019 4942 JSValue* Machine::cti_op_resolve_skip(CTI_ARGS) 5020 4943 { 5021 ExecState* exec = ARG_exec; 5022 Register* r = ARG_r; 5023 ScopeChainNode* scopeChain = Machine::scopeChain(r); 4944 CallFrame* callFrame = ARG_callFrame; 4945 ScopeChainNode* scopeChain = callFrame->scopeChain(); 5024 4946 5025 4947 int skip = ARG_int2; … … 5036 4958 JSObject* o = *iter; 5037 4959 PropertySlot slot(o); 5038 if (o->getPropertySlot( exec, ident, slot)) {5039 JSValue* result = slot.getValue( exec, ident);4960 if (o->getPropertySlot(callFrame, ident, slot)) { 4961 JSValue* result = slot.getValue(callFrame, ident); 5040 4962 VM_CHECK_EXCEPTION_AT_END(); 5041 4963 return result; … … 5043 4965 } while (++iter != end); 5044 4966 5045 CodeBlock* codeBlock = Machine::codeBlock(r);4967 CodeBlock* codeBlock = callFrame->codeBlock(); 5046 4968 ASSERT(codeBlock->ctiReturnAddressVPCMap.contains(CTI_RETURN_ADDRESS)); 5047 4969 unsigned vPCIndex = codeBlock->ctiReturnAddressVPCMap.get(CTI_RETURN_ADDRESS); 5048 exec->setException(createUndefinedVariableError(exec, ident, codeBlock->instructions.begin() + vPCIndex, codeBlock));4970 ARG_globalData->exception = createUndefinedVariableError(callFrame, ident, codeBlock->instructions.begin() + vPCIndex, codeBlock); 5049 4971 VM_THROW_EXCEPTION(); 5050 4972 } … … 5052 4974 JSValue* Machine::cti_op_resolve_global(CTI_ARGS) 5053 4975 { 5054 ExecState* exec = ARG_exec;4976 CallFrame* callFrame = ARG_callFrame; 5055 4977 JSGlobalObject* globalObject = static_cast<JSGlobalObject*>(ARG_src1); 5056 4978 Identifier& ident = *ARG_id2; … … 5059 4981 5060 4982 PropertySlot slot(globalObject); 5061 if (globalObject->getPropertySlot( exec, ident, slot)) {5062 JSValue* result = slot.getValue( exec, ident);4983 if (globalObject->getPropertySlot(callFrame, ident, slot)) { 4984 JSValue* result = slot.getValue(callFrame, ident); 5063 4985 if (slot.isCacheable()) { 5064 4986 if (vPC[4].u.structureID) … … 5074 4996 } 5075 4997 5076 Register* r = ARG_r; 5077 exec->setException(createUndefinedVariableError(exec, ident, vPC, codeBlock(r))); 4998 ARG_globalData->exception = createUndefinedVariableError(callFrame, ident, vPC, callFrame->codeBlock()); 5078 4999 VM_THROW_EXCEPTION(); 5079 5000 } … … 5089 5010 return jsNumber(ARG_globalData, left / right); 5090 5011 5091 ExecState* exec = ARG_exec;5092 JSValue* result = jsNumber(ARG_globalData, src1->toNumber( exec) / src2->toNumber(exec));5012 CallFrame* callFrame = ARG_callFrame; 5013 JSValue* result = jsNumber(ARG_globalData, src1->toNumber(callFrame) / src2->toNumber(callFrame)); 5093 5014 VM_CHECK_EXCEPTION_AT_END(); 5094 5015 return result; … … 5099 5020 JSValue* v = ARG_src1; 5100 5021 5101 ExecState* exec = ARG_exec;5102 JSValue* result = jsNumber(ARG_globalData, v->toNumber( exec) - 1);5022 CallFrame* callFrame = ARG_callFrame; 5023 JSValue* result = jsNumber(ARG_globalData, v->toNumber(callFrame) - 1); 5103 5024 VM_CHECK_EXCEPTION_AT_END(); 5104 5025 return result; … … 5109 5030 JSValue* src1 = ARG_src1; 5110 5031 JSValue* src2 = ARG_src2; 5111 ExecState* exec = ARG_exec;5112 5113 bool result = jsLess( exec, src1, src2);5032 CallFrame* callFrame = ARG_callFrame; 5033 5034 bool result = jsLess(callFrame, src1, src2); 5114 5035 VM_CHECK_EXCEPTION_AT_END(); 5115 5036 return result; … … 5120 5041 JSValue* src = ARG_src1; 5121 5042 5122 ExecState* exec = ARG_exec;5123 5124 JSValue* result = jsBoolean(!src->toBoolean( exec));5043 CallFrame* callFrame = ARG_callFrame; 5044 5045 JSValue* result = jsBoolean(!src->toBoolean(callFrame)); 5125 5046 VM_CHECK_EXCEPTION_AT_END(); 5126 5047 return result; … … 5131 5052 JSValue* src1 = ARG_src1; 5132 5053 5133 ExecState* exec = ARG_exec;5134 5135 bool result = src1->toBoolean( exec);5054 CallFrame* callFrame = ARG_callFrame; 5055 5056 bool result = src1->toBoolean(callFrame); 5136 5057 VM_CHECK_EXCEPTION_AT_END(); 5137 5058 return result; … … 5142 5063 JSValue* v = ARG_src1; 5143 5064 5144 ExecState* exec = ARG_exec;5145 5146 JSValue* number = v->toJSNumber( exec);5065 CallFrame* callFrame = ARG_callFrame; 5066 5067 JSValue* number = v->toJSNumber(callFrame); 5147 5068 VM_CHECK_EXCEPTION_2(); 5148 5069 … … 5156 5077 JSValue* src2 = ARG_src2; 5157 5078 5158 ExecState* exec = ARG_exec;5079 CallFrame* callFrame = ARG_callFrame; 5159 5080 5160 5081 ASSERT(!JSImmediate::areBothImmediateNumbers(src1, src2)); 5161 JSValue* result = jsBoolean(equalSlowCaseInline( exec, src1, src2));5082 JSValue* result = jsBoolean(equalSlowCaseInline(callFrame, src1, src2)); 5162 5083 VM_CHECK_EXCEPTION_AT_END(); 5163 5084 return result; … … 5176 5097 return jsNumber(ARG_globalData, left << (right & 0x1f)); 5177 5098 5178 ExecState* exec = ARG_exec;5179 JSValue* result = jsNumber(ARG_globalData, (val->toInt32( exec)) << (shift->toUInt32(exec) & 0x1f));5099 CallFrame* callFrame = ARG_callFrame; 5100 JSValue* result = jsNumber(ARG_globalData, (val->toInt32(callFrame)) << (shift->toUInt32(callFrame) & 0x1f)); 5180 5101 VM_CHECK_EXCEPTION_AT_END(); 5181 5102 return result; … … 5192 5113 return jsNumber(ARG_globalData, left & right); 5193 5114 5194 ExecState* exec = ARG_exec;5195 JSValue* result = jsNumber(ARG_globalData, src1->toInt32( exec) & src2->toInt32(exec));5115 CallFrame* callFrame = ARG_callFrame; 5116 JSValue* result = jsNumber(ARG_globalData, src1->toInt32(callFrame) & src2->toInt32(callFrame)); 5196 5117 VM_CHECK_EXCEPTION_AT_END(); 5197 5118 return result; … … 5210 5131 return jsNumber(ARG_globalData, left >> (right & 0x1f)); 5211 5132 5212 ExecState* exec = ARG_exec;5213 JSValue* result = jsNumber(ARG_globalData, (val->toInt32( exec)) >> (shift->toUInt32(exec) & 0x1f));5133 CallFrame* callFrame = ARG_callFrame; 5134 JSValue* result = jsNumber(ARG_globalData, (val->toInt32(callFrame)) >> (shift->toUInt32(callFrame) & 0x1f)); 5214 5135 VM_CHECK_EXCEPTION_AT_END(); 5215 5136 return result; … … 5224 5145 return jsNumber(ARG_globalData, ~value); 5225 5146 5226 ExecState* exec = ARG_exec;5227 JSValue* result = jsNumber(ARG_globalData, ~src->toInt32( exec));5147 CallFrame* callFrame = ARG_callFrame; 5148 JSValue* result = jsNumber(ARG_globalData, ~src->toInt32(callFrame)); 5228 5149 VM_CHECK_EXCEPTION_AT_END(); 5229 5150 return result; … … 5232 5153 VoidPtrPair Machine::cti_op_resolve_with_base(CTI_ARGS) 5233 5154 { 5234 ExecState* exec = ARG_exec; 5235 Register* r = ARG_r; 5236 ScopeChainNode* scopeChain = Machine::scopeChain(r); 5155 CallFrame* callFrame = ARG_callFrame; 5156 ScopeChainNode* scopeChain = callFrame->scopeChain(); 5237 5157 5238 5158 ScopeChainIterator iter = scopeChain->begin(); … … 5248 5168 base = *iter; 5249 5169 PropertySlot slot(base); 5250 if (base->getPropertySlot( exec, ident, slot)) {5251 JSValue* result = slot.getValue( exec, ident);5170 if (base->getPropertySlot(callFrame, ident, slot)) { 5171 JSValue* result = slot.getValue(callFrame, ident); 5252 5172 VM_CHECK_EXCEPTION_AT_END(); 5253 5173 … … 5258 5178 } while (iter != end); 5259 5179 5260 CodeBlock* codeBlock = Machine::codeBlock(r);5180 CodeBlock* codeBlock = callFrame->codeBlock(); 5261 5181 ASSERT(codeBlock->ctiReturnAddressVPCMap.contains(CTI_RETURN_ADDRESS)); 5262 5182 unsigned vPCIndex = codeBlock->ctiReturnAddressVPCMap.get(CTI_RETURN_ADDRESS); 5263 exec->setException(createUndefinedVariableError(exec, ident, codeBlock->instructions.begin() + vPCIndex, codeBlock));5183 ARG_globalData->exception = createUndefinedVariableError(callFrame, ident, codeBlock->instructions.begin() + vPCIndex, codeBlock); 5264 5184 VM_THROW_EXCEPTION_2(); 5265 5185 } … … 5267 5187 JSValue* Machine::cti_op_new_func_exp(CTI_ARGS) 5268 5188 { 5269 return ARG_funcexp1->makeFunction(ARG_ exec, scopeChain(ARG_r));5189 return ARG_funcexp1->makeFunction(ARG_callFrame, ARG_callFrame->scopeChain()); 5270 5190 } 5271 5191 … … 5275 5195 JSValue* divisorValue = ARG_src2; 5276 5196 5277 ExecState* exec = ARG_exec;5278 double d = dividendValue->toNumber( exec);5279 JSValue* result = jsNumber(ARG_globalData, fmod(d, divisorValue->toNumber( exec)));5197 CallFrame* callFrame = ARG_callFrame; 5198 double d = dividendValue->toNumber(callFrame); 5199 JSValue* result = jsNumber(ARG_globalData, fmod(d, divisorValue->toNumber(callFrame))); 5280 5200 VM_CHECK_EXCEPTION_AT_END(); 5281 5201 return result; … … 5284 5204 JSValue* Machine::cti_op_less(CTI_ARGS) 5285 5205 { 5286 ExecState* exec = ARG_exec;5287 JSValue* result = jsBoolean(jsLess( exec, ARG_src1, ARG_src2));5206 CallFrame* callFrame = ARG_callFrame; 5207 JSValue* result = jsBoolean(jsLess(callFrame, ARG_src1, ARG_src2)); 5288 5208 VM_CHECK_EXCEPTION_AT_END(); 5289 5209 return result; … … 5297 5217 ASSERT(!JSImmediate::areBothImmediateNumbers(src1, src2)); 5298 5218 5299 ExecState* exec = ARG_exec;5300 JSValue* result = jsBoolean(!equalSlowCaseInline( exec, src1, src2));5219 CallFrame* callFrame = ARG_callFrame; 5220 JSValue* result = jsBoolean(!equalSlowCaseInline(callFrame, src1, src2)); 5301 5221 VM_CHECK_EXCEPTION_AT_END(); 5302 5222 return result; … … 5307 5227 JSValue* v = ARG_src1; 5308 5228 5309 ExecState* exec = ARG_exec;5310 5311 JSValue* number = v->toJSNumber( exec);5229 CallFrame* callFrame = ARG_callFrame; 5230 5231 JSValue* number = v->toJSNumber(callFrame); 5312 5232 VM_CHECK_EXCEPTION_2(); 5313 5233 … … 5321 5241 JSValue* shift = ARG_src2; 5322 5242 5323 ExecState* exec = ARG_exec;5243 CallFrame* callFrame = ARG_callFrame; 5324 5244 5325 5245 if (JSImmediate::areBothImmediateNumbers(val, shift) && !JSImmediate::isNegative(val)) 5326 5246 return JSImmediate::rightShiftImmediateNumbers(val, shift); 5327 5247 else { 5328 JSValue* result = jsNumber(ARG_globalData, (val->toUInt32( exec)) >> (shift->toUInt32(exec) & 0x1f));5248 JSValue* result = jsNumber(ARG_globalData, (val->toUInt32(callFrame)) >> (shift->toUInt32(callFrame) & 0x1f)); 5329 5249 VM_CHECK_EXCEPTION_AT_END(); 5330 5250 return result; … … 5337 5257 JSValue* src2 = ARG_src2; 5338 5258 5339 ExecState* exec = ARG_exec;5340 5341 JSValue* result = jsNumber(ARG_globalData, src1->toInt32( exec) ^ src2->toInt32(exec));5259 CallFrame* callFrame = ARG_callFrame; 5260 5261 JSValue* result = jsNumber(ARG_globalData, src1->toInt32(callFrame) ^ src2->toInt32(callFrame)); 5342 5262 VM_CHECK_EXCEPTION_AT_END(); 5343 5263 return result; … … 5346 5266 JSValue* Machine::cti_op_new_regexp(CTI_ARGS) 5347 5267 { 5348 return new (ARG_globalData) RegExpObject( scopeChain(ARG_r)->globalObject()->regExpStructure(), ARG_regexp1);5268 return new (ARG_globalData) RegExpObject(ARG_callFrame->lexicalGlobalObject()->regExpStructure(), ARG_regexp1); 5349 5269 } 5350 5270 … … 5354 5274 JSValue* src2 = ARG_src2; 5355 5275 5356 ExecState* exec = ARG_exec;5357 5358 JSValue* result = jsNumber(ARG_globalData, src1->toInt32( exec) | src2->toInt32(exec));5276 CallFrame* callFrame = ARG_callFrame; 5277 5278 JSValue* result = jsNumber(ARG_globalData, src1->toInt32(callFrame) | src2->toInt32(callFrame)); 5359 5279 VM_CHECK_EXCEPTION_AT_END(); 5360 5280 return result; … … 5363 5283 JSValue* Machine::cti_op_call_eval(CTI_ARGS) 5364 5284 { 5365 ExecState* exec = ARG_exec;5285 CallFrame* callFrame = ARG_callFrame; 5366 5286 RegisterFile* registerFile = ARG_registerFile; 5367 Register* r = ARG_r; 5368 CodeBlock* codeBlock = Machine::codeBlock(r); 5369 ScopeChainNode* scopeChain = Machine::scopeChain(r); 5287 CodeBlock* codeBlock = callFrame->codeBlock(); 5288 ScopeChainNode* scopeChain = callFrame->scopeChain(); 5370 5289 5371 5290 Machine* machine = ARG_globalData->machine; … … 5377 5296 5378 5297 if (baseVal == scopeChain->globalObject() && funcVal == scopeChain->globalObject()->evalFunction()) { 5379 JSObject* thisObject = static_cast<JSObject*>( r[codeBlock->thisRegister].jsValue(exec));5298 JSObject* thisObject = static_cast<JSObject*>(callFrame[codeBlock->thisRegister].jsValue(callFrame)); 5380 5299 JSValue* exceptionValue = 0; 5381 JSValue* result = machine->callEval( exec, thisObject, scopeChain, registerFile, r, registerOffset - RegisterFile::CallFrameHeaderSize - argCount, argCount, exceptionValue);5300 JSValue* result = machine->callEval(callFrame, thisObject, scopeChain, registerFile, registerOffset - RegisterFile::CallFrameHeaderSize - argCount, argCount, exceptionValue); 5382 5301 VM_CHECK_EXCEPTION_ARG(exceptionValue); 5383 5302 return result; … … 5389 5308 void* Machine::cti_op_throw(CTI_ARGS) 5390 5309 { 5391 ExecState* exec = ARG_exec; 5392 Register* r = ARG_r; 5393 CodeBlock* codeBlock = Machine::codeBlock(r); 5310 CallFrame* callFrame = ARG_callFrame; 5311 CodeBlock* codeBlock = callFrame->codeBlock(); 5394 5312 5395 5313 ASSERT(codeBlock->ctiReturnAddressVPCMap.contains(CTI_RETURN_ADDRESS)); … … 5399 5317 ASSERT(exceptionValue); 5400 5318 5401 Instruction* handlerVPC = ARG_globalData->machine->throwException( exec, exceptionValue, codeBlock->instructions.begin() + vPCIndex, r, true);5319 Instruction* handlerVPC = ARG_globalData->machine->throwException(callFrame, exceptionValue, codeBlock->instructions.begin() + vPCIndex, true); 5402 5320 5403 5321 if (!handlerVPC) { … … 5406 5324 } 5407 5325 5408 ARG_set R(r);5409 void* catchRoutine = Machine::codeBlock(r)->nativeExceptionCodeForHandlerVPC(handlerVPC);5326 ARG_setCallFrame(callFrame); 5327 void* catchRoutine = callFrame->codeBlock()->nativeExceptionCodeForHandlerVPC(handlerVPC); 5410 5328 ASSERT(catchRoutine); 5411 5329 ctiSetReturnAddress(&CTI_RETURN_ADDRESS, catchRoutine); … … 5415 5333 JSPropertyNameIterator* Machine::cti_op_get_pnames(CTI_ARGS) 5416 5334 { 5417 return JSPropertyNameIterator::create(ARG_ exec, ARG_src1);5335 return JSPropertyNameIterator::create(ARG_callFrame, ARG_src1); 5418 5336 } 5419 5337 … … 5421 5339 { 5422 5340 JSPropertyNameIterator* it = ARG_pni1; 5423 JSValue* temp = it->next(ARG_ exec);5341 JSValue* temp = it->next(ARG_callFrame); 5424 5342 if (!temp) 5425 5343 it->invalidate(); … … 5429 5347 void Machine::cti_op_push_scope(CTI_ARGS) 5430 5348 { 5431 ExecState* exec = ARG_exec; 5432 JSValue* v = ARG_src1; 5433 5434 JSObject* o = v->toObject(exec); 5349 JSObject* o = ARG_src1->toObject(ARG_callFrame); 5435 5350 VM_CHECK_EXCEPTION_VOID(); 5436 5437 Register* r = ARG_r; 5438 r[RegisterFile::ScopeChain] = scopeChain(r)->push(o); 5351 ARG_callFrame->setScopeChain(ARG_callFrame->scopeChain()->push(o)); 5439 5352 } 5440 5353 5441 5354 void Machine::cti_op_pop_scope(CTI_ARGS) 5442 5355 { 5443 Register* r = ARG_r;5444 r[RegisterFile::ScopeChain] = scopeChain(r)->pop();5356 CallFrame* callFrame = ARG_callFrame; 5357 callFrame->setScopeChain(callFrame->scopeChain()->pop()); 5445 5358 } 5446 5359 5447 5360 JSValue* Machine::cti_op_typeof(CTI_ARGS) 5448 5361 { 5449 return jsTypeStringForValue(ARG_ exec, ARG_src1);5362 return jsTypeStringForValue(ARG_callFrame, ARG_src1); 5450 5363 } 5451 5364 … … 5508 5421 { 5509 5422 JSValue* src = ARG_src1; 5510 ExecState* exec = ARG_exec;5511 5512 JSValue* result = src->toJSNumber( exec);5423 CallFrame* callFrame = ARG_callFrame; 5424 5425 JSValue* result = src->toJSNumber(callFrame); 5513 5426 VM_CHECK_EXCEPTION_AT_END(); 5514 5427 return result; … … 5517 5430 JSValue* Machine::cti_op_in(CTI_ARGS) 5518 5431 { 5519 ExecState* exec = ARG_exec;5432 CallFrame* callFrame = ARG_callFrame; 5520 5433 JSValue* baseVal = ARG_src2; 5521 5434 5522 5435 if (!baseVal->isObject()) { 5523 Register* r = ARG_r;5524 CodeBlock* codeBlock = Machine::codeBlock(r);5436 CallFrame* callFrame = ARG_callFrame; 5437 CodeBlock* codeBlock = callFrame->codeBlock(); 5525 5438 ASSERT(codeBlock->ctiReturnAddressVPCMap.contains(CTI_RETURN_ADDRESS)); 5526 5439 unsigned vPCIndex = codeBlock->ctiReturnAddressVPCMap.get(CTI_RETURN_ADDRESS); 5527 exec->setException(createInvalidParamError(exec, "in", baseVal, codeBlock->instructions.begin() + vPCIndex, codeBlock));5440 ARG_globalData->exception = createInvalidParamError(callFrame, "in", baseVal, codeBlock->instructions.begin() + vPCIndex, codeBlock); 5528 5441 VM_THROW_EXCEPTION(); 5529 5442 } … … 5534 5447 uint32_t i; 5535 5448 if (propName->getUInt32(i)) 5536 return jsBoolean(baseObj->hasProperty( exec, i));5537 5538 Identifier property( exec, propName->toString(exec));5449 return jsBoolean(baseObj->hasProperty(callFrame, i)); 5450 5451 Identifier property(callFrame, propName->toString(callFrame)); 5539 5452 VM_CHECK_EXCEPTION(); 5540 return jsBoolean(baseObj->hasProperty( exec, property));5453 return jsBoolean(baseObj->hasProperty(callFrame, property)); 5541 5454 } 5542 5455 5543 5456 JSValue* Machine::cti_op_push_new_scope(CTI_ARGS) 5544 5457 { 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);5458 JSObject* scope = new (ARG_globalData) JSStaticScopeObject(ARG_callFrame, *ARG_id1, ARG_src2, DontDelete); 5459 5460 CallFrame* callFrame = ARG_callFrame; 5461 callFrame->setScopeChain(callFrame->scopeChain()->push(scope)); 5549 5462 return scope; 5550 5463 } … … 5553 5466 { 5554 5467 unsigned count = ARG_int1; 5555 Register* r = ARG_r;5556 5557 ScopeChainNode* tmp = scopeChain(r);5468 CallFrame* callFrame = ARG_callFrame; 5469 5470 ScopeChainNode* tmp = callFrame->scopeChain(); 5558 5471 while (count--) 5559 5472 tmp = tmp->pop(); 5560 r[RegisterFile::ScopeChain] = tmp;5473 callFrame->setScopeChain(tmp); 5561 5474 } 5562 5475 5563 5476 void Machine::cti_op_put_by_index(CTI_ARGS) 5564 5477 { 5565 ExecState* exec = ARG_exec;5478 CallFrame* callFrame = ARG_callFrame; 5566 5479 unsigned property = ARG_int2; 5567 5480 5568 ARG_src1->put( exec, property, ARG_src3);5481 ARG_src1->put(callFrame, property, ARG_src3); 5569 5482 } 5570 5483 … … 5573 5486 JSValue* scrutinee = ARG_src1; 5574 5487 unsigned tableIndex = ARG_int2; 5575 Register* r = ARG_r;5576 CodeBlock* codeBlock = Machine::codeBlock(r);5488 CallFrame* callFrame = ARG_callFrame; 5489 CodeBlock* codeBlock = callFrame->codeBlock(); 5577 5490 5578 5491 if (JSImmediate::isNumber(scrutinee)) { … … 5588 5501 JSValue* scrutinee = ARG_src1; 5589 5502 unsigned tableIndex = ARG_int2; 5590 Register* r = ARG_r;5591 CodeBlock* codeBlock = Machine::codeBlock(r);5503 CallFrame* callFrame = ARG_callFrame; 5504 CodeBlock* codeBlock = callFrame->codeBlock(); 5592 5505 5593 5506 void* result = codeBlock->characterSwitchJumpTables[tableIndex].ctiDefault; … … 5606 5519 JSValue* scrutinee = ARG_src1; 5607 5520 unsigned tableIndex = ARG_int2; 5608 Register* r = ARG_r;5609 CodeBlock* codeBlock = Machine::codeBlock(r);5521 CallFrame* callFrame = ARG_callFrame; 5522 CodeBlock* codeBlock = callFrame->codeBlock(); 5610 5523 5611 5524 void* result = codeBlock->stringSwitchJumpTables[tableIndex].ctiDefault; … … 5621 5534 JSValue* Machine::cti_op_del_by_val(CTI_ARGS) 5622 5535 { 5623 ExecState* exec = ARG_exec;5536 CallFrame* callFrame = ARG_callFrame; 5624 5537 5625 5538 JSValue* baseValue = ARG_src1; 5626 JSObject* baseObj = baseValue->toObject( exec); // may throw5539 JSObject* baseObj = baseValue->toObject(callFrame); // may throw 5627 5540 5628 5541 JSValue* subscript = ARG_src2; … … 5630 5543 uint32_t i; 5631 5544 if (subscript->getUInt32(i)) 5632 result = jsBoolean(baseObj->deleteProperty( exec, i));5545 result = jsBoolean(baseObj->deleteProperty(callFrame, i)); 5633 5546 else { 5634 5547 VM_CHECK_EXCEPTION(); 5635 Identifier property( exec, subscript->toString(exec));5548 Identifier property(callFrame, subscript->toString(callFrame)); 5636 5549 VM_CHECK_EXCEPTION(); 5637 result = jsBoolean(baseObj->deleteProperty( exec, property));5550 result = jsBoolean(baseObj->deleteProperty(callFrame, property)); 5638 5551 } 5639 5552 … … 5644 5557 void Machine::cti_op_put_getter(CTI_ARGS) 5645 5558 { 5646 ExecState* exec = ARG_exec;5559 CallFrame* callFrame = ARG_callFrame; 5647 5560 5648 5561 ASSERT(ARG_src1->isObject()); … … 5650 5563 Identifier& ident = *ARG_id2; 5651 5564 ASSERT(ARG_src3->isObject()); 5652 baseObj->defineGetter( exec, ident, static_cast<JSObject*>(ARG_src3));5565 baseObj->defineGetter(callFrame, ident, static_cast<JSObject*>(ARG_src3)); 5653 5566 } 5654 5567 5655 5568 void Machine::cti_op_put_setter(CTI_ARGS) 5656 5569 { 5657 ExecState* exec = ARG_exec;5570 CallFrame* callFrame = ARG_callFrame; 5658 5571 5659 5572 ASSERT(ARG_src1->isObject()); … … 5661 5574 Identifier& ident = *ARG_id2; 5662 5575 ASSERT(ARG_src3->isObject()); 5663 baseObj->defineSetter( exec, ident, static_cast<JSObject*>(ARG_src3));5576 baseObj->defineSetter(callFrame, ident, static_cast<JSObject*>(ARG_src3)); 5664 5577 } 5665 5578 5666 5579 JSValue* Machine::cti_op_new_error(CTI_ARGS) 5667 5580 { 5668 ExecState* exec = ARG_exec; 5669 Register* r = ARG_r; 5670 CodeBlock* codeBlock = Machine::codeBlock(r); 5581 CallFrame* callFrame = ARG_callFrame; 5582 CodeBlock* codeBlock = callFrame->codeBlock(); 5671 5583 unsigned type = ARG_int1; 5672 5584 JSValue* message = ARG_src2; 5673 5585 unsigned lineNumber = ARG_int3; 5674 5586 5675 return Error::create( exec, static_cast<ErrorType>(type), message->toString(exec), lineNumber, codeBlock->ownerNode->sourceID(), codeBlock->ownerNode->sourceURL());5587 return Error::create(callFrame, static_cast<ErrorType>(type), message->toString(callFrame), lineNumber, codeBlock->ownerNode->sourceID(), codeBlock->ownerNode->sourceURL()); 5676 5588 } 5677 5589 5678 5590 void Machine::cti_op_debug(CTI_ARGS) 5679 5591 { 5680 ExecState* exec = ARG_exec; 5681 Register* r = ARG_r; 5592 CallFrame* callFrame = ARG_callFrame; 5682 5593 5683 5594 int debugHookID = ARG_int1; … … 5685 5596 int lastLine = ARG_int3; 5686 5597 5687 ARG_globalData->machine->debug( exec, r, static_cast<DebugHookID>(debugHookID), firstLine, lastLine);5598 ARG_globalData->machine->debug(callFrame, static_cast<DebugHookID>(debugHookID), firstLine, lastLine); 5688 5599 } 5689 5600 5690 5601 void* Machine::cti_vm_throw(CTI_ARGS) 5691 5602 { 5692 ExecState* exec = ARG_exec; 5693 Register* r = ARG_r; 5694 CodeBlock* codeBlock = Machine::codeBlock(r); 5603 CallFrame* callFrame = ARG_callFrame; 5604 CodeBlock* codeBlock = callFrame->codeBlock(); 5695 5605 5696 5606 ASSERT(codeBlock->ctiReturnAddressVPCMap.contains(ARG_globalData->throwReturnAddress)); … … 5701 5611 ARG_globalData->exception = 0; 5702 5612 5703 Instruction* handlerVPC = ARG_globalData->machine->throwException( exec, exceptionValue, codeBlock->instructions.begin() + vPCIndex, r, false);5613 Instruction* handlerVPC = ARG_globalData->machine->throwException(callFrame, exceptionValue, codeBlock->instructions.begin() + vPCIndex, false); 5704 5614 5705 5615 if (!handlerVPC) { … … 5708 5618 } 5709 5619 5710 ARG_set R(r);5711 void* catchRoutine = Machine::codeBlock(r)->nativeExceptionCodeForHandlerVPC(handlerVPC);5620 ARG_setCallFrame(callFrame); 5621 void* catchRoutine = callFrame->codeBlock()->nativeExceptionCodeForHandlerVPC(handlerVPC); 5712 5622 ASSERT(catchRoutine); 5713 5623 ctiSetReturnAddress(&CTI_RETURN_ADDRESS, catchRoutine);
Note:
See TracChangeset
for help on using the changeset viewer.