Changeset 27100 in webkit for trunk/JavaScriptCore/kjs/function.cpp
- Timestamp:
- Oct 26, 2007, 3:36:45 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/function.cpp
r27097 r27100 70 70 71 71 // enter a new execution context 72 Context ctx(globalObj, exec->dynamicInterpreter(), thisObj, body.get(), 73 FunctionCode, exec->context(), this, &args); 74 ExecState newExec(exec->dynamicInterpreter(), &ctx); 72 ExecState newExec(exec->dynamicInterpreter(), globalObj, thisObj, body.get(), 73 FunctionCode, exec, this, &args); 75 74 if (exec->hadException()) 76 75 newExec.setException(exec->exception()); 77 ctx.setExecState(&newExec);78 76 79 77 Debugger* dbg = exec->dynamicInterpreter()->debugger(); … … 128 126 { 129 127 FunctionImp* thisObj = static_cast<FunctionImp*>(slot.slotBase()); 130 Context* context = exec->m_context;131 while ( context) {132 if ( context->function() == thisObj)133 return static_cast<ActivationImp*>( context->activationObject())->get(exec, propertyName);134 context = context->callingContext();128 ExecState* e = exec; 129 while (e) { 130 if (e->function() == thisObj) 131 return static_cast<ActivationImp*>(e->activationObject())->get(exec, propertyName); 132 e = e->callingExecState(); 135 133 } 136 134 return jsNull(); … … 140 138 { 141 139 FunctionImp* thisObj = static_cast<FunctionImp*>(slot.slotBase()); 142 Context* context = exec->m_context;143 while ( context) {144 if ( context->function() == thisObj)140 ExecState* e = exec; 141 while (e) { 142 if (e->function() == thisObj) 145 143 break; 146 context = context->callingContext();147 } 148 149 if (! context)144 e = e->callingExecState(); 145 } 146 147 if (!e) 150 148 return jsNull(); 151 149 152 Context* callingContext = context->callingContext();153 if (!calling Context)150 ExecState* callingExecState = e->callingExecState(); 151 if (!callingExecState) 154 152 return jsNull(); 155 153 156 FunctionImp* callingFunction = calling Context->function();154 FunctionImp* callingFunction = callingExecState->function(); 157 155 if (!callingFunction) 158 156 return jsNull(); … … 745 743 // enter a new execution context 746 744 Interpreter* interpreter = switchGlobal ? static_cast<JSGlobalObject*>(thisObj)->interpreter() : exec->dynamicInterpreter(); 747 JSObject* thisVal = static_cast<JSObject*>(exec->context()->thisValue()); 748 Context ctx(interpreter->globalObject(), 749 interpreter, 750 thisVal, 751 progNode.get(), 752 EvalCode, 753 exec->context()); 754 ExecState newExec(interpreter, &ctx); 745 JSObject* thisVal = static_cast<JSObject*>(exec->thisValue()); 746 ExecState newExec(interpreter, interpreter->globalObject(), thisVal, progNode.get(), EvalCode, exec); 755 747 if (exec->hadException()) 756 748 newExec.setException(exec->exception()); 757 ctx.setExecState(&newExec);758 749 759 750 if (switchGlobal) { 760 ctx.pushScope(thisObj);761 ctx.setVariableObject(thisObj);751 newExec.pushScope(thisObj); 752 newExec.setVariableObject(thisObj); 762 753 } 763 754 … … 765 756 766 757 if (switchGlobal) 767 ctx.popScope();758 newExec.popScope(); 768 759 769 760 // if an exception occured, propogate it back to the previous execution object
Note:
See TracChangeset
for help on using the changeset viewer.