Changeset 27339 in webkit for trunk/JavaScriptCore/kjs/nodes.cpp
- Timestamp:
- Oct 31, 2007, 10:02:30 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/nodes.cpp
r27308 r27339 429 429 JSValue* LocalVarAccessNode::evaluate(ExecState* exec) 430 430 { 431 ActivationImp* variableObject = static_cast<ActivationImp*>(exec->variableObject()); 432 ASSERT(variableObject->isActivation()); 433 ASSERT(variableObject == exec->scopeChain().top()); 434 return variableObject->localStorage()[index].value; 431 ASSERT(static_cast<ActivationImp*>(exec->variableObject())->isActivation()); 432 ASSERT(static_cast<ActivationImp*>(exec->variableObject()) == exec->scopeChain().top()); 433 return exec->localStorage()[index].value; 435 434 } 436 435 … … 766 765 JSValue* LocalVarFunctionCallNode::evaluate(ExecState* exec) 767 766 { 768 ActivationImp* variableObject = static_cast<ActivationImp*>(exec->variableObject()); 769 ASSERT(variableObject->isActivation()); 770 ASSERT(variableObject == exec->scopeChain().top()); 771 772 JSValue* v = variableObject->localStorage()[index].value; 767 ASSERT(static_cast<ActivationImp*>(exec->variableObject())->isActivation()); 768 ASSERT(static_cast<ActivationImp*>(exec->variableObject()) == exec->scopeChain().top()); 769 770 JSValue* v = exec->localStorage()[index].value; 773 771 774 772 if (!v->isObject()) … … 933 931 JSValue* PostIncLocalVarNode::evaluate(ExecState* exec) 934 932 { 935 ActivationImp* variableObject = static_cast<ActivationImp*>(exec->variableObject()); 936 ASSERT(variableObject->isActivation()); 937 ASSERT(variableObject == exec->scopeChain().top()); 938 939 JSValue** slot = &variableObject->localStorage()[index].value; 933 ASSERT(static_cast<ActivationImp*>(exec->variableObject())->isActivation()); 934 ASSERT(static_cast<ActivationImp*>(exec->variableObject()) == exec->scopeChain().top()); 935 936 JSValue** slot = &exec->localStorage()[index].value; 940 937 double n = (*slot)->toNumber(exec); 941 938 *slot = jsNumber(n + 1); … … 984 981 JSValue* PostDecLocalVarNode::evaluate(ExecState* exec) 985 982 { 986 ActivationImp* variableObject = static_cast<ActivationImp*>(exec->variableObject()); 987 ASSERT(variableObject->isActivation()); 988 ASSERT(variableObject == exec->scopeChain().top()); 989 990 JSValue** slot = &variableObject->localStorage()[index].value; 983 ASSERT(static_cast<ActivationImp*>(exec->variableObject())->isActivation()); 984 ASSERT(static_cast<ActivationImp*>(exec->variableObject()) == exec->scopeChain().top()); 985 986 JSValue** slot = &exec->localStorage()[index].value; 991 987 double n = (*slot)->toNumber(exec); 992 988 *slot = jsNumber(n - 1); … … 1282 1278 JSValue* LocalVarTypeOfNode::evaluate(ExecState* exec) 1283 1279 { 1284 A ctivationImp* variableObject = static_cast<ActivationImp*>(exec->variableObject());1285 ASSERT( variableObject->isActivation());1286 ASSERT(variableObject == exec->scopeChain().top()); 1287 return typeStringForValue( variableObject->localStorage()[m_index].value);1280 ASSERT(static_cast<ActivationImp*>(exec->variableObject())->isActivation()); 1281 ASSERT(static_cast<ActivationImp*>(exec->variableObject()) == exec->scopeChain().top()); 1282 1283 return typeStringForValue(exec->localStorage()[m_index].value); 1288 1284 } 1289 1285 … … 1335 1331 JSValue* PreIncLocalVarNode::evaluate(ExecState* exec) 1336 1332 { 1337 ActivationImp* variableObject = static_cast<ActivationImp*>(exec->variableObject()); 1338 ASSERT(variableObject->isActivation()); 1339 ASSERT(variableObject == exec->scopeChain().top()); 1340 JSValue* v = variableObject->localStorage()[m_index].value; 1341 1342 double n = v->toNumber(exec); 1333 ASSERT(static_cast<ActivationImp*>(exec->variableObject())->isActivation()); 1334 ASSERT(static_cast<ActivationImp*>(exec->variableObject()) == exec->scopeChain().top()); 1335 JSValue** slot = &exec->localStorage()[m_index].value; 1336 1337 double n = (*slot)->toNumber(exec); 1343 1338 JSValue* n2 = jsNumber(n + 1); 1344 variableObject->localStorage()[m_index].value= n2;1339 *slot = n2; 1345 1340 return n2; 1346 1341 } … … 1384 1379 JSValue* PreDecLocalVarNode::evaluate(ExecState* exec) 1385 1380 { 1386 ActivationImp* variableObject = static_cast<ActivationImp*>(exec->variableObject()); 1387 ASSERT(variableObject->isActivation()); 1388 ASSERT(variableObject == exec->scopeChain().top()); 1389 JSValue* v = variableObject->localStorage()[m_index].value; 1390 1391 double n = v->toNumber(exec); 1381 ASSERT(static_cast<ActivationImp*>(exec->variableObject())->isActivation()); 1382 ASSERT(static_cast<ActivationImp*>(exec->variableObject()) == exec->scopeChain().top()); 1383 JSValue** slot = &exec->localStorage()[m_index].value; 1384 1385 double n = (*slot)->toNumber(exec); 1392 1386 JSValue* n2 = jsNumber(n - 1); 1393 variableObject->localStorage()[m_index].value= n2;1387 *slot = n2; 1394 1388 return n2; 1395 1389 } … … 2201 2195 JSValue* ReadModifyLocalVarNode::evaluate(ExecState* exec) 2202 2196 { 2203 ActivationImp* variableObject = static_cast<ActivationImp*>(exec->variableObject()); 2204 ASSERT(variableObject->isActivation()); 2205 ASSERT(variableObject == exec->scopeChain().top()); 2206 JSValue* v; 2207 JSValue** slot = &variableObject->localStorage()[m_index].value; 2197 ASSERT(static_cast<ActivationImp*>(exec->variableObject())->isActivation()); 2198 ASSERT(static_cast<ActivationImp*>(exec->variableObject()) == exec->scopeChain().top()); 2199 JSValue** slot = &exec->localStorage()[m_index].value; 2208 2200 2209 2201 ASSERT(m_oper != OpEqual); 2210 2202 JSValue* v2 = m_right->evaluate(exec); 2211 v = valueForReadModifyAssignment(exec, *slot, v2, m_oper);2203 JSValue* v = valueForReadModifyAssignment(exec, *slot, v2, m_oper); 2212 2204 2213 2205 KJS_CHECKEXCEPTIONVALUE … … 2219 2211 JSValue* AssignLocalVarNode::evaluate(ExecState* exec) 2220 2212 { 2221 ActivationImp* variableObject = static_cast<ActivationImp*>(exec->variableObject()); 2222 ASSERT(variableObject->isActivation()); 2223 ASSERT(variableObject == exec->scopeChain().top()); 2213 ASSERT(static_cast<ActivationImp*>(exec->variableObject())->isActivation()); 2214 ASSERT(static_cast<ActivationImp*>(exec->variableObject()) == exec->scopeChain().top()); 2224 2215 JSValue* v = m_right->evaluate(exec); 2225 2216 2226 2217 KJS_CHECKEXCEPTIONVALUE 2227 2218 2228 variableObject->localStorage()[m_index].value = v;2219 exec->localStorage()[m_index].value = v; 2229 2220 2230 2221 return v; … … 3569 3560 localStorage.append(LocalStorageEntry(node->makeFunction(exec), minAttributes)); 3570 3561 } 3562 3563 exec->updateLocalStorage(); 3571 3564 } 3572 3565
Note:
See TracChangeset
for help on using the changeset viewer.