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