Changeset 27100 in webkit for trunk/JavaScriptCore/kjs/nodes.cpp
- Timestamp:
- Oct 26, 2007, 3:36:45 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/nodes.cpp
r27097 r27100 181 181 static inline int currentSourceId(ExecState* exec) 182 182 { 183 return exec->c ontext()->currentBody()->sourceId();183 return exec->currentBody()->sourceId(); 184 184 } 185 185 … … 187 187 static inline const UString& currentSourceURL(ExecState* exec) 188 188 { 189 return exec->c ontext()->currentBody()->sourceURL();189 return exec->currentBody()->sourceURL(); 190 190 } 191 191 … … 371 371 JSValue *ThisNode::evaluate(ExecState *exec) 372 372 { 373 return exec-> context()->thisValue();373 return exec->thisValue(); 374 374 } 375 375 … … 379 379 JSValue *ResolveNode::evaluate(ExecState *exec) 380 380 { 381 const ScopeChain& chain = exec-> context()->scopeChain();381 const ScopeChain& chain = exec->scopeChain(); 382 382 ScopeChainIterator iter = chain.begin(); 383 383 ScopeChainIterator end = chain.end(); … … 649 649 JSValue *FunctionCallResolveNode::evaluate(ExecState *exec) 650 650 { 651 const ScopeChain& chain = exec-> context()->scopeChain();651 const ScopeChain& chain = exec->scopeChain(); 652 652 ScopeChainIterator iter = chain.begin(); 653 653 ScopeChainIterator end = chain.end(); … … 792 792 JSValue *PostfixResolveNode::evaluate(ExecState *exec) 793 793 { 794 const ScopeChain& chain = exec-> context()->scopeChain();794 const ScopeChain& chain = exec->scopeChain(); 795 795 ScopeChainIterator iter = chain.begin(); 796 796 ScopeChainIterator end = chain.end(); … … 894 894 JSValue *DeleteResolveNode::evaluate(ExecState *exec) 895 895 { 896 const ScopeChain& chain = exec-> context()->scopeChain();896 const ScopeChain& chain = exec->scopeChain(); 897 897 ScopeChainIterator iter = chain.begin(); 898 898 ScopeChainIterator end = chain.end(); … … 999 999 JSValue *TypeOfResolveNode::evaluate(ExecState *exec) 1000 1000 { 1001 const ScopeChain& chain = exec-> context()->scopeChain();1001 const ScopeChain& chain = exec->scopeChain(); 1002 1002 ScopeChainIterator iter = chain.begin(); 1003 1003 ScopeChainIterator end = chain.end(); … … 1037 1037 JSValue *PrefixResolveNode::evaluate(ExecState *exec) 1038 1038 { 1039 const ScopeChain& chain = exec-> context()->scopeChain();1039 const ScopeChain& chain = exec->scopeChain(); 1040 1040 ScopeChainIterator iter = chain.begin(); 1041 1041 ScopeChainIterator end = chain.end(); … … 1611 1611 JSValue *AssignResolveNode::evaluate(ExecState *exec) 1612 1612 { 1613 const ScopeChain& chain = exec-> context()->scopeChain();1613 const ScopeChain& chain = exec->scopeChain(); 1614 1614 ScopeChainIterator iter = chain.begin(); 1615 1615 ScopeChainIterator end = chain.end(); … … 1805 1805 JSValue* VarDeclNode::evaluate(ExecState* exec) 1806 1806 { 1807 const ScopeChain& chain = exec-> context()->scopeChain();1808 JSObject* variableObject = exec-> context()->variableObject();1807 const ScopeChain& chain = exec->scopeChain(); 1808 JSObject* variableObject = exec->variableObject(); 1809 1809 1810 1810 ASSERT(!chain.isEmpty()); … … 1815 1815 JSValue* val = init ? init->evaluate(exec) : jsUndefined(); 1816 1816 int flags = Internal; 1817 if (exec->co ntext()->codeType() != EvalCode)1817 if (exec->codeType() != EvalCode) 1818 1818 flags |= DontDelete; 1819 1819 if (varType == VarDeclNode::Constant) … … 1984 1984 1985 1985 do { 1986 exec-> context()->pushIteration();1986 exec->pushIteration(); 1987 1987 c = statement->execute(exec); 1988 exec-> context()->popIteration();1988 exec->popIteration(); 1989 1989 1990 1990 if (exec->dynamicInterpreter()->timedOut()) … … 2033 2033 return Completion(Normal, value); 2034 2034 2035 exec-> context()->pushIteration();2035 exec->pushIteration(); 2036 2036 c = statement->execute(exec); 2037 exec-> context()->popIteration();2037 exec->popIteration(); 2038 2038 2039 2039 if (exec->dynamicInterpreter()->timedOut()) … … 2079 2079 } 2080 2080 2081 exec-> context()->pushIteration();2081 exec->pushIteration(); 2082 2082 Completion c = statement->execute(exec); 2083 exec-> context()->popIteration();2083 exec->popIteration(); 2084 2084 if (c.isValueCompletion()) 2085 2085 cval = c.value(); … … 2175 2175 const Identifier &ident = static_cast<ResolveNode *>(lexpr.get())->identifier(); 2176 2176 2177 const ScopeChain& chain = exec-> context()->scopeChain();2177 const ScopeChain& chain = exec->scopeChain(); 2178 2178 ScopeChainIterator iter = chain.begin(); 2179 2179 ScopeChainIterator end = chain.end(); … … 2218 2218 KJS_CHECKEXCEPTION 2219 2219 2220 exec-> context()->pushIteration();2220 exec->pushIteration(); 2221 2221 c = statement->execute(exec); 2222 exec-> context()->popIteration();2222 exec->popIteration(); 2223 2223 if (c.isValueCompletion()) 2224 2224 retval = c.value(); … … 2243 2243 KJS_BREAKPOINT; 2244 2244 2245 if (ident.isEmpty() && !exec-> context()->inIteration())2245 if (ident.isEmpty() && !exec->inIteration()) 2246 2246 return createErrorCompletion(exec, SyntaxError, "Invalid continue statement."); 2247 if (!ident.isEmpty() && !exec-> context()->seenLabels()->contains(ident))2247 if (!ident.isEmpty() && !exec->seenLabels()->contains(ident)) 2248 2248 return createErrorCompletion(exec, SyntaxError, "Label %s not found.", ident); 2249 2249 return Completion(Continue, &ident); … … 2257 2257 KJS_BREAKPOINT; 2258 2258 2259 if (ident.isEmpty() && !exec-> context()->inIteration() &&2260 !exec-> context()->inSwitch())2259 if (ident.isEmpty() && !exec->inIteration() && 2260 !exec->inSwitch()) 2261 2261 return createErrorCompletion(exec, SyntaxError, "Invalid break statement."); 2262 if (!ident.isEmpty() && !exec-> context()->seenLabels()->contains(ident))2262 if (!ident.isEmpty() && !exec->seenLabels()->contains(ident)) 2263 2263 return createErrorCompletion(exec, SyntaxError, "Label %s not found."); 2264 2264 return Completion(Break, &ident); … … 2272 2272 KJS_BREAKPOINT; 2273 2273 2274 CodeType codeType = exec->co ntext()->codeType();2274 CodeType codeType = exec->codeType(); 2275 2275 if (codeType != FunctionCode) 2276 2276 return createErrorCompletion(exec, SyntaxError, "Invalid return statement."); … … 2302 2302 JSObject *o = v->toObject(exec); 2303 2303 KJS_CHECKEXCEPTION 2304 exec-> context()->pushScope(o);2304 exec->pushScope(o); 2305 2305 Completion res = statement->execute(exec); 2306 exec-> context()->popScope();2306 exec->popScope(); 2307 2307 2308 2308 return res; … … 2476 2476 KJS_CHECKEXCEPTION 2477 2477 2478 exec-> context()->pushSwitch();2478 exec->pushSwitch(); 2479 2479 Completion res = block->evalBlock(exec,v); 2480 exec-> context()->popSwitch();2480 exec->popSwitch(); 2481 2481 2482 2482 if ((res.complType() == Break) && ls.contains(res.target())) … … 2496 2496 Completion LabelNode::execute(ExecState *exec) 2497 2497 { 2498 if (!exec-> context()->seenLabels()->push(label))2498 if (!exec->seenLabels()->push(label)) 2499 2499 return createErrorCompletion(exec, SyntaxError, "Duplicated label %s found.", label); 2500 2500 Completion e = statement->execute(exec); 2501 exec-> context()->seenLabels()->pop();2501 exec->seenLabels()->pop(); 2502 2502 2503 2503 if ((e.complType() == Break) && (e.target() == label)) … … 2545 2545 JSObject *obj = new JSObject; 2546 2546 obj->put(exec, exceptionIdent, c.value(), DontDelete); 2547 exec-> context()->pushScope(obj);2547 exec->pushScope(obj); 2548 2548 c = catchBlock->execute(exec); 2549 exec-> context()->popScope();2549 exec->popScope(); 2550 2550 } 2551 2551 … … 2611 2611 size_t i, size; 2612 2612 2613 Context* context = exec->context(); 2614 JSObject* variableObject = context->variableObject(); 2613 JSObject* variableObject = exec->variableObject(); 2615 2614 2616 2615 int minAttributes = Internal | DontDelete; … … 2625 2624 } 2626 2625 2627 const List& args = * context->arguments();2626 const List& args = *exec->arguments(); 2628 2627 for (i = 0, size = m_parameters.size(); i < size; ++i) 2629 2628 variableObject->put(exec, m_parameters[i], args[i], DontDelete); … … 2639 2638 size_t i, size; 2640 2639 2641 Context* context = exec->context(); 2642 JSObject* variableObject = context->variableObject(); 2640 JSObject* variableObject = exec->variableObject(); 2643 2641 2644 int minAttributes = Internal | (exec->co ntext()->codeType() != EvalCode ? DontDelete : 0);2642 int minAttributes = Internal | (exec->codeType() != EvalCode ? DontDelete : 0); 2645 2643 2646 2644 for (i = 0, size = m_varStack.size(); i < size; ++i) { … … 2685 2683 initializeDeclarationStacks(exec); 2686 2684 2687 if (exec->co ntext()->codeType() == FunctionCode)2685 if (exec->codeType() == FunctionCode) 2688 2686 processDeclarationsFunctionCode(exec); 2689 2687 else … … 2712 2710 FunctionImp* FuncDeclNode::makeFunction(ExecState* exec) 2713 2711 { 2714 FunctionImp *func = new FunctionImp(exec, ident, body.get(), exec-> context()->scopeChain());2712 FunctionImp *func = new FunctionImp(exec, ident, body.get(), exec->scopeChain()); 2715 2713 2716 2714 JSObject *proto = exec->lexicalInterpreter()->builtinObject()->construct(exec, List::empty()); … … 2738 2736 JSValue *FuncExprNode::evaluate(ExecState *exec) 2739 2737 { 2740 Context *context = exec->context();2741 2738 bool named = !ident.isNull(); 2742 2739 JSObject *functionScopeObject = 0; … … 2747 2744 // be contained as single property in an anonymous object. 2748 2745 functionScopeObject = new JSObject; 2749 context->pushScope(functionScopeObject);2750 } 2751 2752 FunctionImp* func = new FunctionImp(exec, ident, body.get(), context->scopeChain());2746 exec->pushScope(functionScopeObject); 2747 } 2748 2749 FunctionImp* func = new FunctionImp(exec, ident, body.get(), exec->scopeChain()); 2753 2750 JSObject* proto = exec->lexicalInterpreter()->builtinObject()->construct(exec, List::empty()); 2754 2751 proto->put(exec, exec->propertyNames().constructor, func, ReadOnly | DontDelete | DontEnum); … … 2756 2753 2757 2754 if (named) { 2758 functionScopeObject->put(exec, ident, func, Internal | ReadOnly | ( context->codeType() == EvalCode ? 0 : DontDelete));2759 context->popScope();2755 functionScopeObject->put(exec, ident, func, Internal | ReadOnly | (exec->codeType() == EvalCode ? 0 : DontDelete)); 2756 exec->popScope(); 2760 2757 } 2761 2758
Note:
See TracChangeset
for help on using the changeset viewer.