Changeset 37366 in webkit for trunk/JavaScriptCore/VM/Machine.cpp
- Timestamp:
- Oct 6, 2008, 8:53:47 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/VM/Machine.cpp
r37337 r37366 702 702 printf("[ArgumentCount] | %10p | %10p \n", it, (*it).v()); ++it; 703 703 printf("[Callee] | %10p | %10p \n", it, (*it).v()); ++it; 704 printf("[OptionalCalleeActivation] | %10p | %10p \n", it, (*it).v()); ++it;705 704 printf("[OptionalCalleeArguments] | %10p | %10p \n", it, (*it).v()); ++it; 706 705 printf("----------------------------------------------------\n"); … … 776 775 } 777 776 778 if (oldCodeBlock->needsFullScopeChain)779 scopeChain->deref();780 781 777 // If this call frame created an activation or an 'arguments' object, tear it off. 782 if (JSActivation* activation = static_cast<JSActivation*>(r[RegisterFile::OptionalCalleeActivation].getJSValue())) { 778 if (oldCodeBlock->codeType == FunctionCode && oldCodeBlock->needsFullScopeChain) { 779 while (!scopeChain->object->isObject(&JSActivation::info)) 780 scopeChain = scopeChain->pop(); 781 JSActivation* activation = static_cast<JSActivation*>(scopeChain->object); 783 782 ASSERT(activation->isObject(&JSActivation::info)); 783 784 784 Arguments* arguments = static_cast<Arguments*>(r[RegisterFile::OptionalCalleeArguments].getJSValue()); 785 785 ASSERT(!arguments || arguments->isObject(&Arguments::info)); 786 786 787 activation->copyRegisters(arguments); 787 788 } else if (Arguments* arguments = static_cast<Arguments*>(r[RegisterFile::OptionalCalleeArguments].getJSValue())) { … … 790 791 arguments->copyRegisters(); 791 792 } 792 793 794 if (oldCodeBlock->needsFullScopeChain) 795 scopeChain->deref(); 796 793 797 void* returnPC = r[RegisterFile::ReturnPC].v(); 794 798 r = r[RegisterFile::CallerRegisters].r(); … … 3357 3361 } 3358 3362 BEGIN_OPCODE(op_tear_off_activation) { 3359 JSActivation* activation = static_cast<JSActivation*>(r[RegisterFile::OptionalCalleeActivation].getJSValue()); 3363 int src = (++vPC)->u.operand; 3364 JSActivation* activation = static_cast<JSActivation*>(r[src].getJSValue()); 3360 3365 ASSERT(codeBlock(r)->needsFullScopeChain); 3361 3366 ASSERT(activation->isObject(&JSActivation::info)); … … 3433 3438 } 3434 3439 BEGIN_OPCODE(op_enter_with_activation) { 3435 /* enter_with_activation 3440 /* enter_with_activation dst(r) 3436 3441 3437 3442 Initializes local variables to undefined, fills constant 3438 3443 registers with their values, creates an activation object, 3439 and places the new activation both in the activation slot 3440 in the call frame and at the top of the scope chain. If the 3441 code block does not require an activation, enter should be 3442 used instead. 3444 and places the new activation both in dst and at the top 3445 of the scope chain. If the code block does not require an 3446 activation, enter should be used instead. 3443 3447 3444 3448 This opcode should only be used at the beginning of a code … … 3455 3459 r[i] = codeBlock->constantRegisters[j]; 3456 3460 3461 int dst = (++vPC)->u.operand; 3457 3462 JSActivation* activation = new (globalData) JSActivation(exec, static_cast<FunctionBodyNode*>(codeBlock->ownerNode), r); 3458 r[ RegisterFile::OptionalCalleeActivation] = activation;3463 r[dst] = activation; 3459 3464 r[RegisterFile::ScopeChain] = scopeChain(r)->copy()->push(activation); 3460 3465 … … 4582 4587 r[RegisterFile::ArgumentCount] = ARG_int3; // original argument count (for the sake of the "arguments" object) 4583 4588 r[RegisterFile::Callee] = ARG_src1; 4584 r[RegisterFile::OptionalCalleeActivation] = nullJSValue;4585 4589 r[RegisterFile::OptionalCalleeArguments] = nullJSValue; 4586 4590 … … 4601 4605 } 4602 4606 4603 voidMachine::cti_op_push_activation(CTI_ARGS)4607 JSValue* Machine::cti_op_push_activation(CTI_ARGS) 4604 4608 { 4605 4609 ExecState* exec = ARG_exec; … … 4609 4613 4610 4614 JSActivation* activation = new (ARG_globalData) JSActivation(exec, static_cast<FunctionBodyNode*>(codeBlock->ownerNode), r); 4611 r[RegisterFile::OptionalCalleeActivation] = activation;4612 4615 r[RegisterFile::ScopeChain] = scopeChain->copy()->push(activation); 4616 return activation; 4613 4617 } 4614 4618 … … 4669 4673 Register* r = ARG_r; 4670 4674 4671 JSActivation* activation = static_cast<JSActivation*>( r[RegisterFile::OptionalCalleeActivation].getJSValue());4675 JSActivation* activation = static_cast<JSActivation*>(ARG_src1); 4672 4676 ASSERT(codeBlock(r)->needsFullScopeChain); 4673 4677 ASSERT(activation->isObject(&JSActivation::info)); … … 4786 4790 r[RegisterFile::ArgumentCount] = argCount; // original argument count (for the sake of the "arguments" object) 4787 4791 r[RegisterFile::Callee] = constructor; 4788 r[RegisterFile::OptionalCalleeActivation] = nullJSValue;4789 4792 r[RegisterFile::OptionalCalleeArguments] = nullJSValue; 4790 4793
Note:
See TracChangeset
for help on using the changeset viewer.