Changeset 35291 in webkit for trunk/JavaScriptCore/VM/Machine.cpp
- Timestamp:
- Jul 22, 2008, 10:10:05 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/VM/Machine.cpp
r35245 r35291 370 370 callFrame[RegisterFile::CalledAsConstructor] = calledAsConstructor; 371 371 callFrame[RegisterFile::Callee] = function; 372 callFrame[RegisterFile::OptionalCalleeActivation] = static_cast<intptr_t>(0);372 callFrame[RegisterFile::OptionalCalleeActivation] = nullJSValue; 373 373 } 374 374 … … 444 444 return jsUndefined(); 445 445 446 JSValue* program = r[argv + 1].jsValue( );446 JSValue* program = r[argv + 1].jsValue(exec); 447 447 448 448 if (!program->isString()) … … 519 519 end = it + registerFile->numGlobals(); 520 520 while (it != end) { 521 printf("[global var] | %10p | %10p \n", it, (*it). jsValue());521 printf("[global var] | %10p | %10p \n", it, (*it).v()); 522 522 ++it; 523 523 } … … 526 526 527 527 it = r - codeBlock->numLocals - RegisterFile::CallFrameHeaderSize; 528 printf("[CallerCodeBlock] | %10p | %10p \n", it, (*it). jsValue()); ++it;529 printf("[ReturnVPC] | %10p | %10p \n", it, (*it). jsValue()); ++it;530 printf("[CallerScopeChain] | %10p | %10p \n", it, (*it). jsValue()); ++it;531 printf("[CallerRegisterOffset] | %10p | %10p \n", it, (*it). jsValue()); ++it;532 printf("[ReturnValueRegister] | %10p | %10p \n", it, (*it). jsValue()); ++it;533 printf("[ArgumentStartRegister] | %10p | %10p \n", it, (*it). jsValue()); ++it;534 printf("[ArgumentCount] | %10p | %10p \n", it, (*it). jsValue()); ++it;535 printf("[CalledAsConstructor] | %10p | %10p \n", it, (*it). jsValue()); ++it;536 printf("[Callee] | %10p | %10p \n", it, (*it). jsValue()); ++it;537 printf("[OptionalCalleeActivation] | %10p | %10p \n", it, (*it). jsValue()); ++it;528 printf("[CallerCodeBlock] | %10p | %10p \n", it, (*it).v()); ++it; 529 printf("[ReturnVPC] | %10p | %10p \n", it, (*it).v()); ++it; 530 printf("[CallerScopeChain] | %10p | %10p \n", it, (*it).v()); ++it; 531 printf("[CallerRegisterOffset] | %10p | %10p \n", it, (*it).v()); ++it; 532 printf("[ReturnValueRegister] | %10p | %10p \n", it, (*it).v()); ++it; 533 printf("[ArgumentStartRegister] | %10p | %10p \n", it, (*it).v()); ++it; 534 printf("[ArgumentCount] | %10p | %10p \n", it, (*it).v()); ++it; 535 printf("[CalledAsConstructor] | %10p | %10p \n", it, (*it).v()); ++it; 536 printf("[Callee] | %10p | %10p \n", it, (*it).v()); ++it; 537 printf("[OptionalCalleeActivation] | %10p | %10p \n", it, (*it).v()); ++it; 538 538 printf("----------------------------------------------------\n"); 539 539 540 printf("[this] | %10p | %10p \n", it, (*it). jsValue()); ++it;540 printf("[this] | %10p | %10p \n", it, (*it).v()); ++it; 541 541 end = it + max(codeBlock->numParameters - 1, 0); // - 1 to skip "this" 542 542 if (it != end) { 543 543 do { 544 printf("[param] | %10p | %10p \n", it, (*it). jsValue());544 printf("[param] | %10p | %10p \n", it, (*it).v()); 545 545 ++it; 546 546 } while (it != end); … … 552 552 if (it != end) { 553 553 do { 554 printf("[var] | %10p | %10p \n", it, (*it). jsValue());554 printf("[var] | %10p | %10p \n", it, (*it).v()); 555 555 ++it; 556 556 } while (it != end); … … 562 562 if (it != end) { 563 563 do { 564 printf("[temp] | %10p | %10p \n", it, (*it). jsValue());564 printf("[temp] | %10p | %10p \n", it, (*it).v()); 565 565 ++it; 566 566 } while (it != end); … … 586 586 if (Debugger* debugger = exec->dynamicGlobalObject()->debugger()) { 587 587 DebuggerCallFrame debuggerCallFrame(exec->dynamicGlobalObject(), codeBlock, scopeChain, r, exceptionValue); 588 if (callFrame[RegisterFile::Callee].jsValue( ))588 if (callFrame[RegisterFile::Callee].jsValue(exec)) 589 589 debugger->returnEvent(debuggerCallFrame, codeBlock->ownerNode->sourceId(), codeBlock->ownerNode->lastLine()); 590 590 else … … 593 593 594 594 if (Profiler* profiler = *Profiler::enabledProfilerReference()) { 595 if (callFrame[RegisterFile::Callee].jsValue( ))596 profiler->didExecute(exec, static_cast<JSObject*>(callFrame[RegisterFile::Callee].jsValue( )));595 if (callFrame[RegisterFile::Callee].jsValue(exec)) 596 profiler->didExecute(exec, static_cast<JSObject*>(callFrame[RegisterFile::Callee].jsValue(exec))); 597 597 else 598 598 profiler->didExecute(exec, codeBlock->ownerNode->sourceURL(), codeBlock->ownerNode->lineNo()); … … 603 603 604 604 // If this call frame created an activation, tear it off. 605 if (JSActivation* activation = static_cast<JSActivation*>(callFrame[RegisterFile::OptionalCalleeActivation].jsValue( ))) {605 if (JSActivation* activation = static_cast<JSActivation*>(callFrame[RegisterFile::OptionalCalleeActivation].jsValue(exec))) { 606 606 ASSERT(activation->isActivationObject()); 607 607 activation->copyRegisters(); … … 1122 1122 */ 1123 1123 int dst = (++vPC)->u.operand; 1124 JSValue* src1 = r[(++vPC)->u.operand].jsValue( );1125 JSValue* src2 = r[(++vPC)->u.operand].jsValue( );1124 JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec); 1125 JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec); 1126 1126 if (JSImmediate::areBothImmediateNumbers(src1, src2)) 1127 1127 r[dst] = jsBoolean(reinterpret_cast<intptr_t>(src1) == reinterpret_cast<intptr_t>(src2)); … … 1143 1143 */ 1144 1144 int dst = (++vPC)->u.operand; 1145 JSValue* src1 = r[(++vPC)->u.operand].jsValue( );1146 JSValue* src2 = r[(++vPC)->u.operand].jsValue( );1145 JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec); 1146 JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec); 1147 1147 if (JSImmediate::areBothImmediateNumbers(src1, src2)) 1148 1148 r[dst] = jsBoolean(reinterpret_cast<intptr_t>(src1) != reinterpret_cast<intptr_t>(src2)); … … 1164 1164 */ 1165 1165 int dst = (++vPC)->u.operand; 1166 JSValue* src1 = r[(++vPC)->u.operand].jsValue( );1167 JSValue* src2 = r[(++vPC)->u.operand].jsValue( );1166 JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec); 1167 JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec); 1168 1168 if (JSImmediate::areBothImmediateNumbers(src1, src2)) 1169 1169 r[dst] = jsBoolean(reinterpret_cast<intptr_t>(src1) == reinterpret_cast<intptr_t>(src2)); … … 1182 1182 */ 1183 1183 int dst = (++vPC)->u.operand; 1184 JSValue* src1 = r[(++vPC)->u.operand].jsValue( );1185 JSValue* src2 = r[(++vPC)->u.operand].jsValue( );1184 JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec); 1185 JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec); 1186 1186 if (JSImmediate::areBothImmediateNumbers(src1, src2)) 1187 1187 r[dst] = jsBoolean(reinterpret_cast<intptr_t>(src1) != reinterpret_cast<intptr_t>(src2)); … … 1200 1200 */ 1201 1201 int dst = (++vPC)->u.operand; 1202 JSValue* src1 = r[(++vPC)->u.operand].jsValue( );1203 JSValue* src2 = r[(++vPC)->u.operand].jsValue( );1202 JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec); 1203 JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec); 1204 1204 JSValue* result = jsBoolean(jsLess(exec, src1, src2)); 1205 1205 VM_CHECK_EXCEPTION(); … … 1217 1217 */ 1218 1218 int dst = (++vPC)->u.operand; 1219 JSValue* src1 = r[(++vPC)->u.operand].jsValue( );1220 JSValue* src2 = r[(++vPC)->u.operand].jsValue( );1219 JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec); 1220 JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec); 1221 1221 JSValue* result = jsBoolean(jsLessEq(exec, src1, src2)); 1222 1222 VM_CHECK_EXCEPTION(); … … 1233 1233 */ 1234 1234 int srcDst = (++vPC)->u.operand; 1235 JSValue* v = r[srcDst].jsValue( );1235 JSValue* v = r[srcDst].jsValue(exec); 1236 1236 if (JSImmediate::canDoFastAdditiveOperations(v)) 1237 1237 r[srcDst] = JSImmediate::incImmediateNumber(v); … … 1252 1252 */ 1253 1253 int srcDst = (++vPC)->u.operand; 1254 JSValue* v = r[srcDst].jsValue( );1254 JSValue* v = r[srcDst].jsValue(exec); 1255 1255 if (JSImmediate::canDoFastAdditiveOperations(v)) 1256 1256 r[srcDst] = JSImmediate::decImmediateNumber(v); … … 1273 1273 int dst = (++vPC)->u.operand; 1274 1274 int srcDst = (++vPC)->u.operand; 1275 JSValue* v = r[srcDst].jsValue( );1275 JSValue* v = r[srcDst].jsValue(exec); 1276 1276 if (JSImmediate::canDoFastAdditiveOperations(v)) { 1277 1277 r[dst] = v; 1278 1278 r[srcDst] = JSImmediate::incImmediateNumber(v); 1279 1279 } else { 1280 JSValue* number = r[srcDst].jsValue( )->toJSNumber(exec);1280 JSValue* number = r[srcDst].jsValue(exec)->toJSNumber(exec); 1281 1281 VM_CHECK_EXCEPTION(); 1282 1282 r[dst] = number; … … 1296 1296 int dst = (++vPC)->u.operand; 1297 1297 int srcDst = (++vPC)->u.operand; 1298 JSValue* v = r[srcDst].jsValue( );1298 JSValue* v = r[srcDst].jsValue(exec); 1299 1299 if (JSImmediate::canDoFastAdditiveOperations(v)) { 1300 1300 r[dst] = v; 1301 1301 r[srcDst] = JSImmediate::decImmediateNumber(v); 1302 1302 } else { 1303 JSValue* number = r[srcDst].jsValue( )->toJSNumber(exec);1303 JSValue* number = r[srcDst].jsValue(exec)->toJSNumber(exec); 1304 1304 VM_CHECK_EXCEPTION(); 1305 1305 r[dst] = number; … … 1318 1318 int dst = (++vPC)->u.operand; 1319 1319 int src = (++vPC)->u.operand; 1320 JSValue* result = r[src].jsValue( )->toJSNumber(exec);1320 JSValue* result = r[src].jsValue(exec)->toJSNumber(exec); 1321 1321 VM_CHECK_EXCEPTION(); 1322 1322 … … 1334 1334 int dst = (++vPC)->u.operand; 1335 1335 int src = (++vPC)->u.operand; 1336 JSValue* result = jsNumber(exec, -r[src].jsValue( )->toNumber(exec));1336 JSValue* result = jsNumber(exec, -r[src].jsValue(exec)->toNumber(exec)); 1337 1337 VM_CHECK_EXCEPTION(); 1338 1338 r[dst] = result; … … 1349 1349 */ 1350 1350 int dst = (++vPC)->u.operand; 1351 JSValue* src1 = r[(++vPC)->u.operand].jsValue( );1352 JSValue* src2 = r[(++vPC)->u.operand].jsValue( );1351 JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec); 1352 JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec); 1353 1353 if (JSImmediate::canDoFastAdditiveOperations(src1) && JSImmediate::canDoFastAdditiveOperations(src2)) 1354 1354 r[dst] = JSImmediate::addImmediateNumbers(src1, src2); … … 1368 1368 */ 1369 1369 int dst = (++vPC)->u.operand; 1370 JSValue* src1 = r[(++vPC)->u.operand].jsValue( );1371 JSValue* src2 = r[(++vPC)->u.operand].jsValue( );1370 JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec); 1371 JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec); 1372 1372 JSValue* result = jsNumber(exec, src1->toNumber(exec) * src2->toNumber(exec)); 1373 1373 VM_CHECK_EXCEPTION(); … … 1387 1387 int dividend = (++vPC)->u.operand; 1388 1388 int divisor = (++vPC)->u.operand; 1389 JSValue* result = jsNumber(exec, r[dividend].jsValue( )->toNumber(exec) / r[divisor].jsValue()->toNumber(exec));1389 JSValue* result = jsNumber(exec, r[dividend].jsValue(exec)->toNumber(exec) / r[divisor].jsValue(exec)->toNumber(exec)); 1390 1390 VM_CHECK_EXCEPTION(); 1391 1391 r[dst] = result; … … 1403 1403 int dividend = (++vPC)->u.operand; 1404 1404 int divisor = (++vPC)->u.operand; 1405 double d = r[dividend].jsValue( )->toNumber(exec);1406 JSValue* result = jsNumber(exec, fmod(d, r[divisor].jsValue( )->toNumber(exec)));1405 double d = r[dividend].jsValue(exec)->toNumber(exec); 1406 JSValue* result = jsNumber(exec, fmod(d, r[divisor].jsValue(exec)->toNumber(exec))); 1407 1407 VM_CHECK_EXCEPTION(); 1408 1408 r[dst] = result; … … 1418 1418 */ 1419 1419 int dst = (++vPC)->u.operand; 1420 JSValue* src1 = r[(++vPC)->u.operand].jsValue( );1421 JSValue* src2 = r[(++vPC)->u.operand].jsValue( );1420 JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec); 1421 JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec); 1422 1422 if (JSImmediate::canDoFastAdditiveOperations(src1) && JSImmediate::canDoFastAdditiveOperations(src2)) 1423 1423 r[dst] = JSImmediate::subImmediateNumbers(src1, src2); … … 1438 1438 */ 1439 1439 int dst = (++vPC)->u.operand; 1440 JSValue* val = r[(++vPC)->u.operand].jsValue( );1441 JSValue* shift = r[(++vPC)->u.operand].jsValue( );1440 JSValue* val = r[(++vPC)->u.operand].jsValue(exec); 1441 JSValue* shift = r[(++vPC)->u.operand].jsValue(exec); 1442 1442 if (JSImmediate::areBothImmediateNumbers(val, shift)) 1443 1443 r[dst] = jsNumber(exec, JSImmediate::getTruncatedInt32(val) << (JSImmediate::toTruncatedUInt32(shift) & 0x1f)); … … 1459 1459 */ 1460 1460 int dst = (++vPC)->u.operand; 1461 JSValue* val = r[(++vPC)->u.operand].jsValue( );1462 JSValue* shift = r[(++vPC)->u.operand].jsValue( );1461 JSValue* val = r[(++vPC)->u.operand].jsValue(exec); 1462 JSValue* shift = r[(++vPC)->u.operand].jsValue(exec); 1463 1463 if (JSImmediate::areBothImmediateNumbers(val, shift)) 1464 1464 r[dst] = JSImmediate::rightShiftImmediateNumbers(val, shift); … … 1480 1480 */ 1481 1481 int dst = (++vPC)->u.operand; 1482 JSValue* val = r[(++vPC)->u.operand].jsValue( );1483 JSValue* shift = r[(++vPC)->u.operand].jsValue( );1482 JSValue* val = r[(++vPC)->u.operand].jsValue(exec); 1483 JSValue* shift = r[(++vPC)->u.operand].jsValue(exec); 1484 1484 if (JSImmediate::areBothImmediateNumbers(val, shift) && !JSImmediate::isNegative(val)) 1485 1485 r[dst] = JSImmediate::rightShiftImmediateNumbers(val, shift); … … 1501 1501 */ 1502 1502 int dst = (++vPC)->u.operand; 1503 JSValue* src1 = r[(++vPC)->u.operand].jsValue( );1504 JSValue* src2 = r[(++vPC)->u.operand].jsValue( );1503 JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec); 1504 JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec); 1505 1505 if (JSImmediate::areBothImmediateNumbers(src1, src2)) 1506 1506 r[dst] = JSImmediate::andImmediateNumbers(src1, src2); … … 1522 1522 */ 1523 1523 int dst = (++vPC)->u.operand; 1524 JSValue* src1 = r[(++vPC)->u.operand].jsValue( );1525 JSValue* src2 = r[(++vPC)->u.operand].jsValue( );1524 JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec); 1525 JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec); 1526 1526 if (JSImmediate::areBothImmediateNumbers(src1, src2)) 1527 1527 r[dst] = JSImmediate::xorImmediateNumbers(src1, src2); … … 1543 1543 */ 1544 1544 int dst = (++vPC)->u.operand; 1545 JSValue* src1 = r[(++vPC)->u.operand].jsValue( );1546 JSValue* src2 = r[(++vPC)->u.operand].jsValue( );1545 JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec); 1546 JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec); 1547 1547 if (JSImmediate::areBothImmediateNumbers(src1, src2)) 1548 1548 r[dst] = JSImmediate::orImmediateNumbers(src1, src2); … … 1564 1564 int dst = (++vPC)->u.operand; 1565 1565 int src = (++vPC)->u.operand; 1566 JSValue* result = jsNumber(exec, ~r[src].jsValue( )->toInt32(exec));1566 JSValue* result = jsNumber(exec, ~r[src].jsValue(exec)->toInt32(exec)); 1567 1567 VM_CHECK_EXCEPTION(); 1568 1568 r[dst] = result; … … 1579 1579 int dst = (++vPC)->u.operand; 1580 1580 int src = (++vPC)->u.operand; 1581 JSValue* result = jsBoolean(!r[src].jsValue( )->toBoolean(exec));1581 JSValue* result = jsBoolean(!r[src].jsValue(exec)->toBoolean(exec)); 1582 1582 VM_CHECK_EXCEPTION(); 1583 1583 r[dst] = result; … … 1599 1599 int base = (++vPC)->u.operand; 1600 1600 1601 JSValue* baseVal = r[base].jsValue( );1601 JSValue* baseVal = r[base].jsValue(exec); 1602 1602 1603 1603 if (isNotObject(exec, true, codeBlock, vPC, baseVal, exceptionValue)) … … 1605 1605 1606 1606 JSObject* baseObj = static_cast<JSObject*>(baseVal); 1607 r[dst] = jsBoolean(baseObj->implementsHasInstance() ? baseObj->hasInstance(exec, r[value].jsValue( )) : false);1607 r[dst] = jsBoolean(baseObj->implementsHasInstance() ? baseObj->hasInstance(exec, r[value].jsValue(exec)) : false); 1608 1608 1609 1609 ++vPC; … … 1618 1618 int dst = (++vPC)->u.operand; 1619 1619 int src = (++vPC)->u.operand; 1620 r[dst] = jsTypeStringForValue(exec, r[src].jsValue( ));1620 r[dst] = jsTypeStringForValue(exec, r[src].jsValue(exec)); 1621 1621 1622 1622 ++vPC; … … 1636 1636 int base = (++vPC)->u.operand; 1637 1637 1638 JSValue* baseVal = r[base].jsValue( );1638 JSValue* baseVal = r[base].jsValue(exec); 1639 1639 if (isNotObject(exec, false, codeBlock, vPC, baseVal, exceptionValue)) 1640 1640 goto vm_throw; … … 1642 1642 JSObject* baseObj = static_cast<JSObject*>(baseVal); 1643 1643 1644 JSValue* propName = r[property].jsValue( );1644 JSValue* propName = r[property].jsValue(exec); 1645 1645 1646 1646 uint32_t i; … … 1725 1725 ASSERT((*iter)->isVariableObject()); 1726 1726 JSVariableObject* scope = static_cast<JSVariableObject*>(*iter); 1727 scope->registerAt(index) = r[value].jsValue( );1727 scope->registerAt(index) = r[value].jsValue(exec); 1728 1728 ++vPC; 1729 1729 NEXT_OPCODE; … … 1793 1793 1794 1794 Identifier& ident = codeBlock->identifiers[property]; 1795 JSValue *result = r[base].jsValue( )->get(exec, ident);1795 JSValue *result = r[base].jsValue(exec)->get(exec, ident); 1796 1796 VM_CHECK_EXCEPTION(); 1797 1797 r[dst] = result; … … 1813 1813 1814 1814 Identifier& ident = codeBlock->identifiers[property]; 1815 r[base].jsValue( )->put(exec, ident, r[value].jsValue());1815 r[base].jsValue(exec)->put(exec, ident, r[value].jsValue(exec)); 1816 1816 1817 1817 VM_CHECK_EXCEPTION(); … … 1831 1831 int property = (++vPC)->u.operand; 1832 1832 1833 JSObject* baseObj = r[base].jsValue( )->toObject(exec);1833 JSObject* baseObj = r[base].jsValue(exec)->toObject(exec); 1834 1834 1835 1835 Identifier& ident = codeBlock->identifiers[property]; … … 1852 1852 int property = (++vPC)->u.operand; 1853 1853 1854 JSValue* baseValue = r[base].jsValue( );1855 JSValue* subscript = r[property].jsValue( );1854 JSValue* baseValue = r[base].jsValue(exec); 1855 JSValue* subscript = r[property].jsValue(exec); 1856 1856 1857 1857 JSValue* result; … … 1895 1895 int value = (++vPC)->u.operand; 1896 1896 1897 JSValue* baseValue = r[base].jsValue( );1898 JSValue* subscript = r[property].jsValue( );1897 JSValue* baseValue = r[base].jsValue(exec); 1898 JSValue* subscript = r[property].jsValue(exec); 1899 1899 1900 1900 unsigned i; … … 1905 1905 JSArray* jsArray = static_cast<JSArray*>(baseValue); 1906 1906 if (jsArray->canSetIndex(i)) 1907 jsArray->setIndex(i, r[value].jsValue( ));1907 jsArray->setIndex(i, r[value].jsValue(exec)); 1908 1908 else 1909 jsArray->JSArray::put(exec, i, r[value].jsValue( ));1909 jsArray->JSArray::put(exec, i, r[value].jsValue(exec)); 1910 1910 } else 1911 baseValue->put(exec, i, r[value].jsValue( ));1911 baseValue->put(exec, i, r[value].jsValue(exec)); 1912 1912 } else { 1913 1913 Identifier property(exec, subscript->toString(exec)); 1914 1914 if (!exec->hadException()) // Don't put to an object if toString threw an exception. 1915 baseValue->put(exec, property, r[value].jsValue( ));1915 baseValue->put(exec, property, r[value].jsValue(exec)); 1916 1916 } 1917 1917 … … 1932 1932 int property = (++vPC)->u.operand; 1933 1933 1934 JSObject* baseObj = r[base].jsValue( )->toObject(exec); // may throw1935 1936 JSValue* subscript = r[property].jsValue( );1934 JSObject* baseObj = r[base].jsValue(exec)->toObject(exec); // may throw 1935 1936 JSValue* subscript = r[property].jsValue(exec); 1937 1937 JSValue* result; 1938 1938 uint32_t i; … … 1967 1967 int value = (++vPC)->u.operand; 1968 1968 1969 r[base].jsValue( )->put(exec, property, r[value].jsValue());1969 r[base].jsValue(exec)->put(exec, property, r[value].jsValue(exec)); 1970 1970 1971 1971 ++vPC; … … 2014 2014 int cond = (++vPC)->u.operand; 2015 2015 int target = (++vPC)->u.operand; 2016 if (r[cond].jsValue( )->toBoolean(exec)) {2016 if (r[cond].jsValue(exec)->toBoolean(exec)) { 2017 2017 vPC += target; 2018 2018 CHECK_FOR_TIMEOUT(); … … 2031 2031 int cond = (++vPC)->u.operand; 2032 2032 int target = (++vPC)->u.operand; 2033 if (r[cond].jsValue( )->toBoolean(exec)) {2033 if (r[cond].jsValue(exec)->toBoolean(exec)) { 2034 2034 vPC += target; 2035 2035 NEXT_OPCODE; … … 2047 2047 int cond = (++vPC)->u.operand; 2048 2048 int target = (++vPC)->u.operand; 2049 if (!r[cond].jsValue( )->toBoolean(exec)) {2049 if (!r[cond].jsValue(exec)->toBoolean(exec)) { 2050 2050 vPC += target; 2051 2051 NEXT_OPCODE; … … 2066 2066 the JS timeout is reached. 2067 2067 */ 2068 JSValue* src1 = r[(++vPC)->u.operand].jsValue( );2069 JSValue* src2 = r[(++vPC)->u.operand].jsValue( );2068 JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec); 2069 JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec); 2070 2070 int target = (++vPC)->u.operand; 2071 2071 … … 2090 2090 result of the comparison is true. 2091 2091 */ 2092 JSValue* src1 = r[(++vPC)->u.operand].jsValue( );2093 JSValue* src2 = r[(++vPC)->u.operand].jsValue( );2092 JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec); 2093 JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec); 2094 2094 int target = (++vPC)->u.operand; 2095 2095 … … 2113 2113 result of the comparison is false. 2114 2114 */ 2115 JSValue* src1 = r[(++vPC)->u.operand].jsValue( );2116 JSValue* src2 = r[(++vPC)->u.operand].jsValue( );2115 JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec); 2116 JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec); 2117 2117 int target = (++vPC)->u.operand; 2118 2118 … … 2178 2178 int argCount = (++vPC)->u.operand; 2179 2179 2180 JSValue* funcVal = r[func].jsValue( );2181 JSValue* baseVal = r[thisVal].jsValue( );2180 JSValue* funcVal = r[func].jsValue(exec); 2181 JSValue* baseVal = r[thisVal].jsValue(exec); 2182 2182 2183 2183 if (baseVal == scopeChain->globalObject() && funcVal == scopeChain->globalObject()->evalFunction()) { 2184 JSObject* thisObject = static_cast<JSObject*>(r[codeBlock->thisRegister].jsValue( ));2184 JSObject* thisObject = static_cast<JSObject*>(r[codeBlock->thisRegister].jsValue(exec)); 2185 2185 JSValue* result = callEval(exec, thisObject, scopeChain, registerFile, r, firstArg, argCount, exceptionValue); 2186 2186 if (exceptionValue) … … 2250 2250 int argCount = (++vPC)->u.operand; 2251 2251 2252 JSValue* v = r[func].jsValue( );2252 JSValue* v = r[func].jsValue(exec); 2253 2253 2254 2254 CallData callData; … … 2263 2263 CodeBlock* newCodeBlock = &functionBodyNode->byteCode(callDataScopeChain); 2264 2264 2265 r[firstArg] = thisVal == missingThisObjectMarker() ? exec->globalThisValue() : r[thisVal].jsValue( );2265 r[firstArg] = thisVal == missingThisObjectMarker() ? exec->globalThisValue() : r[thisVal].jsValue(exec); 2266 2266 2267 2267 Register* callFrame = r + firstArg - RegisterFile::CallFrameHeaderSize; … … 2289 2289 (*enabledProfilerReference)->willExecute(exec, static_cast<JSObject*>(v)); 2290 2290 2291 JSValue* thisValue = thisVal == missingThisObjectMarker() ? exec->globalThisValue() : r[thisVal].jsValue( );2291 JSValue* thisValue = thisVal == missingThisObjectMarker() ? exec->globalThisValue() : r[thisVal].jsValue(exec); 2292 2292 ArgList args(r + firstArg + 1, argCount - 1); 2293 2293 … … 2322 2322 2323 2323 Register* callFrame = r - codeBlock->numLocals - RegisterFile::CallFrameHeaderSize; 2324 if (JSActivation* activation = static_cast<JSActivation*>(callFrame[RegisterFile::OptionalCalleeActivation].jsValue( ))) {2324 if (JSActivation* activation = static_cast<JSActivation*>(callFrame[RegisterFile::OptionalCalleeActivation].jsValue(exec))) { 2325 2325 ASSERT(!codeBlock->needsFullScopeChain || scopeChain->object == activation); 2326 2326 ASSERT(activation->isActivationObject()); … … 2329 2329 2330 2330 if (*enabledProfilerReference) 2331 (*enabledProfilerReference)->didExecute(exec, static_cast<JSObject*>(callFrame[RegisterFile::Callee].jsValue( )));2331 (*enabledProfilerReference)->didExecute(exec, static_cast<JSObject*>(callFrame[RegisterFile::Callee].jsValue(exec))); 2332 2332 2333 2333 if (codeBlock->needsFullScopeChain) 2334 2334 scopeChain->deref(); 2335 2335 2336 JSValue* returnValue = r[result].jsValue( );2336 JSValue* returnValue = r[result].jsValue(exec); 2337 2337 if (callFrame[RegisterFile::CalledAsConstructor].i() && !returnValue->isObject()) { 2338 JSValue* thisObject = callFrame[RegisterFile::CallFrameHeaderSize].jsValue( );2338 JSValue* thisObject = callFrame[RegisterFile::CallFrameHeaderSize].jsValue(exec); 2339 2339 returnValue = thisObject; 2340 2340 } … … 2370 2370 int argCount = (++vPC)->u.operand; 2371 2371 2372 JSValue* constrVal = r[constr].jsValue( );2372 JSValue* constrVal = r[constr].jsValue(exec); 2373 2373 2374 2374 ConstructData constructData; … … 2441 2441 */ 2442 2442 int scope = (++vPC)->u.operand; 2443 JSValue* v = r[scope].jsValue( );2443 JSValue* v = r[scope].jsValue(exec); 2444 2444 JSObject* o = v->toObject(exec); 2445 2445 VM_CHECK_EXCEPTION(); … … 2471 2471 int base = (++vPC)->u.operand; 2472 2472 2473 r[dst] = JSPropertyNameIterator::create(exec, r[base].jsValue( ));2473 r[dst] = JSPropertyNameIterator::create(exec, r[base].jsValue(exec)); 2474 2474 ++vPC; 2475 2475 NEXT_OPCODE; … … 2546 2546 2547 2547 int ex = (++vPC)->u.operand; 2548 exceptionValue = r[ex].jsValue( );2548 exceptionValue = r[ex].jsValue(exec); 2549 2549 2550 2550 handlerVPC = throwException(exec, exceptionValue, vPC, codeBlock, k, scopeChain, r, true); … … 2578 2578 int message = (++vPC)->u.operand; 2579 2579 2580 r[dst] = Error::create(exec, (ErrorType)type, k[message]. toString(exec), codeBlock->lineNumberForVPC(vPC), codeBlock->ownerNode->sourceId(), codeBlock->ownerNode->sourceURL());2580 r[dst] = Error::create(exec, (ErrorType)type, k[message].jsValue(exec)->toString(exec), codeBlock->lineNumberForVPC(vPC), codeBlock->ownerNode->sourceId(), codeBlock->ownerNode->sourceURL()); 2581 2581 2582 2582 ++vPC; … … 2595 2595 } 2596 2596 int result = (++vPC)->u.operand; 2597 return r[result].jsValue( );2597 return r[result].jsValue(exec); 2598 2598 } 2599 2599 BEGIN_OPCODE(op_put_getter) { … … 2612 2612 int function = (++vPC)->u.operand; 2613 2613 2614 ASSERT(r[base].jsValue( )->isObject());2615 JSObject* baseObj = static_cast<JSObject*>(r[base].jsValue( ));2614 ASSERT(r[base].jsValue(exec)->isObject()); 2615 JSObject* baseObj = static_cast<JSObject*>(r[base].jsValue(exec)); 2616 2616 Identifier& ident = codeBlock->identifiers[property]; 2617 ASSERT(r[function].jsValue( )->isObject());2618 baseObj->defineGetter(exec, ident, static_cast<JSObject*>(r[function].jsValue( )));2617 ASSERT(r[function].jsValue(exec)->isObject()); 2618 baseObj->defineGetter(exec, ident, static_cast<JSObject*>(r[function].jsValue(exec))); 2619 2619 2620 2620 ++vPC; … … 2636 2636 int function = (++vPC)->u.operand; 2637 2637 2638 ASSERT(r[base].jsValue( )->isObject());2639 JSObject* baseObj = static_cast<JSObject*>(r[base].jsValue( ));2638 ASSERT(r[base].jsValue(exec)->isObject()); 2639 JSObject* baseObj = static_cast<JSObject*>(r[base].jsValue(exec)); 2640 2640 Identifier& ident = codeBlock->identifiers[property]; 2641 ASSERT(r[function].jsValue( )->isObject());2642 baseObj->defineSetter(exec, ident, static_cast<JSObject*>(r[function].jsValue( )));2641 ASSERT(r[function].jsValue(exec)->isObject()); 2642 baseObj->defineSetter(exec, ident, static_cast<JSObject*>(r[function].jsValue(exec))); 2643 2643 2644 2644 ++vPC; … … 2708 2708 return jsNull(); 2709 2709 2710 JSActivation* activation = static_cast<JSActivation*>(callFrame[RegisterFile::OptionalCalleeActivation].jsValue( ));2710 JSActivation* activation = static_cast<JSActivation*>(callFrame[RegisterFile::OptionalCalleeActivation].jsValue(exec)); 2711 2711 if (!activation) { 2712 2712 CodeBlock* codeBlock = &function->m_body->generatedByteCode(); … … 2729 2729 2730 2730 Register* callerCallFrame = callFrame[RegisterFile::CallerRegisters].r() - callerCodeBlock->numLocals - RegisterFile::CallFrameHeaderSize; 2731 if (JSValue* caller = callerCallFrame[RegisterFile::Callee].jsValue( ))2731 if (JSValue* caller = callerCallFrame[RegisterFile::Callee].jsValue(exec)) 2732 2732 return caller; 2733 2733 … … 2747 2747 } 2748 2748 2749 if (callFrame[RegisterFile::Callee].jsValue( ) == function)2749 if (callFrame[RegisterFile::Callee].jsValue(exec) == function) 2750 2750 return callFrame; 2751 2751 … … 2762 2762 void Machine::getArgumentsData(Register* callFrame, JSFunction*& function, Register*& argv, int& argc) 2763 2763 { 2764 function = static_cast<JSFunction*>(callFrame[RegisterFile::Callee]. jsValue());2764 function = static_cast<JSFunction*>(callFrame[RegisterFile::Callee].getJSValue()); 2765 2765 ASSERT(function->inherits(&JSFunction::info)); 2766 2766
Note:
See TracChangeset
for help on using the changeset viewer.