Changeset 49409 in webkit for trunk/JavaScriptCore/interpreter/Interpreter.cpp
- Timestamp:
- Oct 9, 2009, 5:30:49 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/interpreter/Interpreter.cpp
r48905 r49409 92 92 NEVER_INLINE bool Interpreter::resolve(CallFrame* callFrame, Instruction* vPC, JSValue& exceptionValue) 93 93 { 94 int dst = (vPC + 1)->u.operand;95 int property = (vPC + 2)->u.operand;94 int dst = vPC[1].u.operand; 95 int property = vPC[2].u.operand; 96 96 97 97 ScopeChainNode* scopeChain = callFrame->scopeChain(); … … 122 122 CodeBlock* codeBlock = callFrame->codeBlock(); 123 123 124 int dst = (vPC + 1)->u.operand;125 int property = (vPC + 2)->u.operand;126 int skip = (vPC + 3)->u.operand + codeBlock->needsFullScopeChain();124 int dst = vPC[1].u.operand; 125 int property = vPC[2].u.operand; 126 int skip = vPC[3].u.operand + codeBlock->needsFullScopeChain(); 127 127 128 128 ScopeChainNode* scopeChain = callFrame->scopeChain(); … … 153 153 NEVER_INLINE bool Interpreter::resolveGlobal(CallFrame* callFrame, Instruction* vPC, JSValue& exceptionValue) 154 154 { 155 int dst = (vPC + 1)->u.operand;156 JSGlobalObject* globalObject = static_cast<JSGlobalObject*>( (vPC + 2)->u.jsCell);155 int dst = vPC[1].u.operand; 156 JSGlobalObject* globalObject = static_cast<JSGlobalObject*>(vPC[2].u.jsCell); 157 157 ASSERT(globalObject->isGlobalObject()); 158 int property = (vPC + 3)->u.operand;159 Structure* structure = (vPC + 4)->u.structure;160 int offset = (vPC + 5)->u.operand;158 int property = vPC[3].u.operand; 159 Structure* structure = vPC[4].u.structure; 160 int offset = vPC[5].u.operand; 161 161 162 162 if (structure == globalObject->structure()) { … … 193 193 NEVER_INLINE void Interpreter::resolveBase(CallFrame* callFrame, Instruction* vPC) 194 194 { 195 int dst = (vPC + 1)->u.operand;196 int property = (vPC + 2)->u.operand;195 int dst = vPC[1].u.operand; 196 int property = vPC[2].u.operand; 197 197 callFrame->r(dst) = JSValue(JSC::resolveBase(callFrame, callFrame->codeBlock()->identifier(property), callFrame->scopeChain())); 198 198 } … … 200 200 NEVER_INLINE bool Interpreter::resolveBaseAndProperty(CallFrame* callFrame, Instruction* vPC, JSValue& exceptionValue) 201 201 { 202 int baseDst = (vPC + 1)->u.operand;203 int propDst = (vPC + 2)->u.operand;204 int property = (vPC + 3)->u.operand;202 int baseDst = vPC[1].u.operand; 203 int propDst = vPC[2].u.operand; 204 int property = vPC[3].u.operand; 205 205 206 206 ScopeChainNode* scopeChain = callFrame->scopeChain(); … … 225 225 callFrame->r(propDst) = JSValue(result); 226 226 callFrame->r(baseDst) = JSValue(base); 227 return true;228 }229 ++iter;230 } while (iter != end);231 232 exceptionValue = createUndefinedVariableError(callFrame, ident, vPC - codeBlock->instructions().begin(), codeBlock);233 return false;234 }235 236 NEVER_INLINE bool Interpreter::resolveBaseAndFunc(CallFrame* callFrame, Instruction* vPC, JSValue& exceptionValue)237 {238 int baseDst = (vPC + 1)->u.operand;239 int funcDst = (vPC + 2)->u.operand;240 int property = (vPC + 3)->u.operand;241 242 ScopeChainNode* scopeChain = callFrame->scopeChain();243 ScopeChainIterator iter = scopeChain->begin();244 ScopeChainIterator end = scopeChain->end();245 246 // FIXME: add scopeDepthIsZero optimization247 248 ASSERT(iter != end);249 250 CodeBlock* codeBlock = callFrame->codeBlock();251 Identifier& ident = codeBlock->identifier(property);252 JSObject* base;253 do {254 base = *iter;255 PropertySlot slot(base);256 if (base->getPropertySlot(callFrame, ident, slot)) {257 // ECMA 11.2.3 says that if we hit an activation the this value should be null.258 // However, section 10.2.3 says that in the case where the value provided259 // by the caller is null, the global object should be used. It also says260 // that the section does not apply to internal functions, but for simplicity261 // of implementation we use the global object anyway here. This guarantees262 // that in host objects you always get a valid object for this.263 // We also handle wrapper substitution for the global object at the same time.264 JSObject* thisObj = base->toThisObject(callFrame);265 JSValue result = slot.getValue(callFrame, ident);266 exceptionValue = callFrame->globalData().exception;267 if (exceptionValue)268 return false;269 270 callFrame->r(baseDst) = JSValue(thisObj);271 callFrame->r(funcDst) = JSValue(result);272 227 return true; 273 228 } … … 929 884 NEVER_INLINE ScopeChainNode* Interpreter::createExceptionScope(CallFrame* callFrame, const Instruction* vPC) 930 885 { 931 int dst = (++vPC)->u.operand;886 int dst = vPC[1].u.operand; 932 887 CodeBlock* codeBlock = callFrame->codeBlock(); 933 Identifier& property = codeBlock->identifier( (++vPC)->u.operand);934 JSValue value = callFrame->r( (++vPC)->u.operand).jsValue();888 Identifier& property = codeBlock->identifier(vPC[2].u.operand); 889 JSValue value = callFrame->r(vPC[3].u.operand).jsValue(); 935 890 JSObject* scope = new (callFrame) JSStaticScopeObject(callFrame, property, value, DontDelete); 936 891 callFrame->r(dst) = JSValue(scope); … … 1214 1169 constructor, and puts the result in register dst. 1215 1170 */ 1216 int dst = (++vPC)->u.operand;1171 int dst = vPC[1].u.operand; 1217 1172 callFrame->r(dst) = JSValue(constructEmptyObject(callFrame)); 1218 1173 1219 ++vPC;1174 vPC += OPCODE_LENGTH(op_new_object); 1220 1175 NEXT_INSTRUCTION(); 1221 1176 } … … 1228 1183 taken from registers starting at register firstArg. 1229 1184 */ 1230 int dst = (++vPC)->u.operand;1231 int firstArg = (++vPC)->u.operand;1232 int argCount = (++vPC)->u.operand;1185 int dst = vPC[1].u.operand; 1186 int firstArg = vPC[2].u.operand; 1187 int argCount = vPC[3].u.operand; 1233 1188 ArgList args(callFrame->registers() + firstArg, argCount); 1234 1189 callFrame->r(dst) = JSValue(constructArray(callFrame, args)); 1235 1190 1236 ++vPC;1191 vPC += OPCODE_LENGTH(op_new_array); 1237 1192 NEXT_INSTRUCTION(); 1238 1193 } … … 1244 1199 register dst. 1245 1200 */ 1246 int dst = (++vPC)->u.operand;1247 int regExp = (++vPC)->u.operand;1201 int dst = vPC[1].u.operand; 1202 int regExp = vPC[2].u.operand; 1248 1203 callFrame->r(dst) = JSValue(new (globalData) RegExpObject(callFrame->scopeChain()->globalObject->regExpStructure(), callFrame->codeBlock()->regexp(regExp))); 1249 1204 1250 ++vPC;1205 vPC += OPCODE_LENGTH(op_new_regexp); 1251 1206 NEXT_INSTRUCTION(); 1252 1207 } … … 1256 1211 Copies register src to register dst. 1257 1212 */ 1258 int dst = (++vPC)->u.operand;1259 int src = (++vPC)->u.operand;1213 int dst = vPC[1].u.operand; 1214 int src = vPC[2].u.operand; 1260 1215 callFrame->r(dst) = callFrame->r(src); 1261 1216 1262 ++vPC;1217 vPC += OPCODE_LENGTH(op_mov); 1263 1218 NEXT_INSTRUCTION(); 1264 1219 } … … 1270 1225 as a boolean in register dst. 1271 1226 */ 1272 int dst = (++vPC)->u.operand;1273 JSValue src1 = callFrame->r( (++vPC)->u.operand).jsValue();1274 JSValue src2 = callFrame->r( (++vPC)->u.operand).jsValue();1227 int dst = vPC[1].u.operand; 1228 JSValue src1 = callFrame->r(vPC[2].u.operand).jsValue(); 1229 JSValue src2 = callFrame->r(vPC[3].u.operand).jsValue(); 1275 1230 if (src1.isInt32() && src2.isInt32()) 1276 1231 callFrame->r(dst) = jsBoolean(src1.asInt32() == src2.asInt32()); … … 1281 1236 } 1282 1237 1283 ++vPC;1238 vPC += OPCODE_LENGTH(op_eq); 1284 1239 NEXT_INSTRUCTION(); 1285 1240 } … … 1290 1245 operator, and puts the result as a boolean in register dst. 1291 1246 */ 1292 int dst = (++vPC)->u.operand;1293 JSValue src = callFrame->r( (++vPC)->u.operand).jsValue();1247 int dst = vPC[1].u.operand; 1248 JSValue src = callFrame->r(vPC[2].u.operand).jsValue(); 1294 1249 1295 1250 if (src.isUndefinedOrNull()) { 1296 1251 callFrame->r(dst) = jsBoolean(true); 1297 ++vPC;1252 vPC += OPCODE_LENGTH(op_eq_null); 1298 1253 NEXT_INSTRUCTION(); 1299 1254 } 1300 1255 1301 1256 callFrame->r(dst) = jsBoolean(src.isCell() && src.asCell()->structure()->typeInfo().masqueradesAsUndefined()); 1302 ++vPC;1257 vPC += OPCODE_LENGTH(op_eq_null); 1303 1258 NEXT_INSTRUCTION(); 1304 1259 } … … 1310 1265 result as a boolean in register dst. 1311 1266 */ 1312 int dst = (++vPC)->u.operand;1313 JSValue src1 = callFrame->r( (++vPC)->u.operand).jsValue();1314 JSValue src2 = callFrame->r( (++vPC)->u.operand).jsValue();1267 int dst = vPC[1].u.operand; 1268 JSValue src1 = callFrame->r(vPC[2].u.operand).jsValue(); 1269 JSValue src2 = callFrame->r(vPC[3].u.operand).jsValue(); 1315 1270 if (src1.isInt32() && src2.isInt32()) 1316 1271 callFrame->r(dst) = jsBoolean(src1.asInt32() != src2.asInt32()); … … 1321 1276 } 1322 1277 1323 ++vPC;1278 vPC += OPCODE_LENGTH(op_neq); 1324 1279 NEXT_INSTRUCTION(); 1325 1280 } … … 1330 1285 operator, and puts the result as a boolean in register dst. 1331 1286 */ 1332 int dst = (++vPC)->u.operand;1333 JSValue src = callFrame->r( (++vPC)->u.operand).jsValue();1287 int dst = vPC[1].u.operand; 1288 JSValue src = callFrame->r(vPC[2].u.operand).jsValue(); 1334 1289 1335 1290 if (src.isUndefinedOrNull()) { 1336 1291 callFrame->r(dst) = jsBoolean(false); 1337 ++vPC;1292 vPC += OPCODE_LENGTH(op_neq_null); 1338 1293 NEXT_INSTRUCTION(); 1339 1294 } 1340 1295 1341 1296 callFrame->r(dst) = jsBoolean(!src.isCell() || !asCell(src)->structure()->typeInfo().masqueradesAsUndefined()); 1342 ++vPC;1297 vPC += OPCODE_LENGTH(op_neq_null); 1343 1298 NEXT_INSTRUCTION(); 1344 1299 } … … 1350 1305 result as a boolean in register dst. 1351 1306 */ 1352 int dst = (++vPC)->u.operand;1353 JSValue src1 = callFrame->r( (++vPC)->u.operand).jsValue();1354 JSValue src2 = callFrame->r( (++vPC)->u.operand).jsValue();1307 int dst = vPC[1].u.operand; 1308 JSValue src1 = callFrame->r(vPC[2].u.operand).jsValue(); 1309 JSValue src2 = callFrame->r(vPC[3].u.operand).jsValue(); 1355 1310 callFrame->r(dst) = jsBoolean(JSValue::strictEqual(src1, src2)); 1356 1311 1357 ++vPC;1312 vPC += OPCODE_LENGTH(op_stricteq); 1358 1313 NEXT_INSTRUCTION(); 1359 1314 } … … 1365 1320 puts the result as a boolean in register dst. 1366 1321 */ 1367 int dst = (++vPC)->u.operand;1368 JSValue src1 = callFrame->r( (++vPC)->u.operand).jsValue();1369 JSValue src2 = callFrame->r( (++vPC)->u.operand).jsValue();1322 int dst = vPC[1].u.operand; 1323 JSValue src1 = callFrame->r(vPC[2].u.operand).jsValue(); 1324 JSValue src2 = callFrame->r(vPC[3].u.operand).jsValue(); 1370 1325 callFrame->r(dst) = jsBoolean(!JSValue::strictEqual(src1, src2)); 1371 1326 1372 ++vPC;1327 vPC += OPCODE_LENGTH(op_nstricteq); 1373 1328 NEXT_INSTRUCTION(); 1374 1329 } … … 1380 1335 a boolean in register dst. 1381 1336 */ 1382 int dst = (++vPC)->u.operand;1383 JSValue src1 = callFrame->r( (++vPC)->u.operand).jsValue();1384 JSValue src2 = callFrame->r( (++vPC)->u.operand).jsValue();1337 int dst = vPC[1].u.operand; 1338 JSValue src1 = callFrame->r(vPC[2].u.operand).jsValue(); 1339 JSValue src2 = callFrame->r(vPC[3].u.operand).jsValue(); 1385 1340 JSValue result = jsBoolean(jsLess(callFrame, src1, src2)); 1386 1341 CHECK_FOR_EXCEPTION(); 1387 1342 callFrame->r(dst) = result; 1388 1343 1389 ++vPC;1344 vPC += OPCODE_LENGTH(op_less); 1390 1345 NEXT_INSTRUCTION(); 1391 1346 } … … 1397 1352 puts the result as a boolean in register dst. 1398 1353 */ 1399 int dst = (++vPC)->u.operand;1400 JSValue src1 = callFrame->r( (++vPC)->u.operand).jsValue();1401 JSValue src2 = callFrame->r( (++vPC)->u.operand).jsValue();1354 int dst = vPC[1].u.operand; 1355 JSValue src1 = callFrame->r(vPC[2].u.operand).jsValue(); 1356 JSValue src2 = callFrame->r(vPC[3].u.operand).jsValue(); 1402 1357 JSValue result = jsBoolean(jsLessEq(callFrame, src1, src2)); 1403 1358 CHECK_FOR_EXCEPTION(); 1404 1359 callFrame->r(dst) = result; 1405 1360 1406 ++vPC;1361 vPC += OPCODE_LENGTH(op_lesseq); 1407 1362 NEXT_INSTRUCTION(); 1408 1363 } … … 1413 1368 back in register srcDst. 1414 1369 */ 1415 int srcDst = (++vPC)->u.operand;1370 int srcDst = vPC[1].u.operand; 1416 1371 JSValue v = callFrame->r(srcDst).jsValue(); 1417 1372 if (v.isInt32() && v.asInt32() < INT_MAX) … … 1423 1378 } 1424 1379 1425 ++vPC;1380 vPC += OPCODE_LENGTH(op_pre_inc); 1426 1381 NEXT_INSTRUCTION(); 1427 1382 } … … 1432 1387 back in register srcDst. 1433 1388 */ 1434 int srcDst = (++vPC)->u.operand;1389 int srcDst = vPC[1].u.operand; 1435 1390 JSValue v = callFrame->r(srcDst).jsValue(); 1436 1391 if (v.isInt32() && v.asInt32() > INT_MIN) … … 1442 1397 } 1443 1398 1444 ++vPC;1399 vPC += OPCODE_LENGTH(op_pre_dec); 1445 1400 NEXT_INSTRUCTION(); 1446 1401 } … … 1452 1407 back to register srcDst. 1453 1408 */ 1454 int dst = (++vPC)->u.operand;1455 int srcDst = (++vPC)->u.operand;1409 int dst = vPC[1].u.operand; 1410 int srcDst = vPC[2].u.operand; 1456 1411 JSValue v = callFrame->r(srcDst).jsValue(); 1457 1412 if (v.isInt32() && v.asInt32() < INT_MAX) { … … 1465 1420 } 1466 1421 1467 ++vPC;1422 vPC += OPCODE_LENGTH(op_post_inc); 1468 1423 NEXT_INSTRUCTION(); 1469 1424 } … … 1475 1430 back to register srcDst. 1476 1431 */ 1477 int dst = (++vPC)->u.operand;1478 int srcDst = (++vPC)->u.operand;1432 int dst = vPC[1].u.operand; 1433 int srcDst = vPC[2].u.operand; 1479 1434 JSValue v = callFrame->r(srcDst).jsValue(); 1480 1435 if (v.isInt32() && v.asInt32() > INT_MIN) { … … 1488 1443 } 1489 1444 1490 ++vPC;1445 vPC += OPCODE_LENGTH(op_post_dec); 1491 1446 NEXT_INSTRUCTION(); 1492 1447 } … … 1497 1452 in register dst. 1498 1453 */ 1499 int dst = (++vPC)->u.operand;1500 int src = (++vPC)->u.operand;1454 int dst = vPC[1].u.operand; 1455 int src = vPC[2].u.operand; 1501 1456 1502 1457 JSValue srcVal = callFrame->r(src).jsValue(); … … 1510 1465 } 1511 1466 1512 ++vPC;1467 vPC += OPCODE_LENGTH(op_to_jsnumber); 1513 1468 NEXT_INSTRUCTION(); 1514 1469 } … … 1519 1474 result in register dst. 1520 1475 */ 1521 int dst = (++vPC)->u.operand;1522 JSValue src = callFrame->r( (++vPC)->u.operand).jsValue();1476 int dst = vPC[1].u.operand; 1477 JSValue src = callFrame->r(vPC[2].u.operand).jsValue(); 1523 1478 if (src.isInt32() && src.asInt32()) 1524 1479 callFrame->r(dst) = jsNumber(callFrame, -src.asInt32()); … … 1529 1484 } 1530 1485 1531 ++vPC;1486 vPC += OPCODE_LENGTH(op_negate); 1532 1487 NEXT_INSTRUCTION(); 1533 1488 } … … 1539 1494 numeric add, depending on the types of the operands.) 1540 1495 */ 1541 int dst = (++vPC)->u.operand;1542 JSValue src1 = callFrame->r( (++vPC)->u.operand).jsValue();1543 JSValue src2 = callFrame->r( (++vPC)->u.operand).jsValue();1496 int dst = vPC[1].u.operand; 1497 JSValue src1 = callFrame->r(vPC[2].u.operand).jsValue(); 1498 JSValue src2 = callFrame->r(vPC[3].u.operand).jsValue(); 1544 1499 if (src1.isInt32() && src2.isInt32() && !(src1.asInt32() | src2.asInt32() & 0xc0000000)) // no overflow 1545 1500 callFrame->r(dst) = jsNumber(callFrame, src1.asInt32() + src2.asInt32()); … … 1549 1504 callFrame->r(dst) = result; 1550 1505 } 1551 vPC += 2;1506 vPC += OPCODE_LENGTH(op_add); 1552 1507 NEXT_INSTRUCTION(); 1553 1508 } … … 1558 1513 numbers), and puts the product in register dst. 1559 1514 */ 1560 int dst = (++vPC)->u.operand;1561 JSValue src1 = callFrame->r( (++vPC)->u.operand).jsValue();1562 JSValue src2 = callFrame->r( (++vPC)->u.operand).jsValue();1515 int dst = vPC[1].u.operand; 1516 JSValue src1 = callFrame->r(vPC[2].u.operand).jsValue(); 1517 JSValue src2 = callFrame->r(vPC[3].u.operand).jsValue(); 1563 1518 if (src1.isInt32() && src2.isInt32() && !(src1.asInt32() | src2.asInt32() >> 15)) // no overflow 1564 1519 callFrame->r(dst) = jsNumber(callFrame, src1.asInt32() * src2.asInt32()); … … 1569 1524 } 1570 1525 1571 vPC += 2;1526 vPC += OPCODE_LENGTH(op_mul); 1572 1527 NEXT_INSTRUCTION(); 1573 1528 } … … 1579 1534 quotient in register dst. 1580 1535 */ 1581 int dst = (++vPC)->u.operand;1582 JSValue dividend = callFrame->r( (++vPC)->u.operand).jsValue();1583 JSValue divisor = callFrame->r( (++vPC)->u.operand).jsValue();1536 int dst = vPC[1].u.operand; 1537 JSValue dividend = callFrame->r(vPC[2].u.operand).jsValue(); 1538 JSValue divisor = callFrame->r(vPC[3].u.operand).jsValue(); 1584 1539 1585 1540 JSValue result = jsNumber(callFrame, dividend.toNumber(callFrame) / divisor.toNumber(callFrame)); … … 1587 1542 callFrame->r(dst) = result; 1588 1543 1589 vPC += 2;1544 vPC += OPCODE_LENGTH(op_div); 1590 1545 NEXT_INSTRUCTION(); 1591 1546 } … … 1597 1552 remainder in register dst. 1598 1553 */ 1599 int dst = (++vPC)->u.operand;1600 JSValue dividend = callFrame->r( (++vPC)->u.operand).jsValue();1601 JSValue divisor = callFrame->r( (++vPC)->u.operand).jsValue();1554 int dst = vPC[1].u.operand; 1555 JSValue dividend = callFrame->r(vPC[2].u.operand).jsValue(); 1556 JSValue divisor = callFrame->r(vPC[3].u.operand).jsValue(); 1602 1557 1603 1558 if (dividend.isInt32() && divisor.isInt32() && divisor.asInt32() != 0) { … … 1605 1560 ASSERT(result); 1606 1561 callFrame->r(dst) = result; 1607 ++vPC;1562 vPC += OPCODE_LENGTH(op_mod); 1608 1563 NEXT_INSTRUCTION(); 1609 1564 } … … 1616 1571 CHECK_FOR_EXCEPTION(); 1617 1572 callFrame->r(dst) = result; 1618 ++vPC;1573 vPC += OPCODE_LENGTH(op_mod); 1619 1574 NEXT_INSTRUCTION(); 1620 1575 } … … 1626 1581 register dst. 1627 1582 */ 1628 int dst = (++vPC)->u.operand;1629 JSValue src1 = callFrame->r( (++vPC)->u.operand).jsValue();1630 JSValue src2 = callFrame->r( (++vPC)->u.operand).jsValue();1583 int dst = vPC[1].u.operand; 1584 JSValue src1 = callFrame->r(vPC[2].u.operand).jsValue(); 1585 JSValue src2 = callFrame->r(vPC[3].u.operand).jsValue(); 1631 1586 if (src1.isInt32() && src2.isInt32() && !(src1.asInt32() | src2.asInt32() & 0xc0000000)) // no overflow 1632 1587 callFrame->r(dst) = jsNumber(callFrame, src1.asInt32() - src2.asInt32()); … … 1636 1591 callFrame->r(dst) = result; 1637 1592 } 1638 vPC += 2;1593 vPC += OPCODE_LENGTH(op_sub); 1639 1594 NEXT_INSTRUCTION(); 1640 1595 } … … 1646 1601 in register dst. 1647 1602 */ 1648 int dst = (++vPC)->u.operand;1649 JSValue val = callFrame->r( (++vPC)->u.operand).jsValue();1650 JSValue shift = callFrame->r( (++vPC)->u.operand).jsValue();1603 int dst = vPC[1].u.operand; 1604 JSValue val = callFrame->r(vPC[2].u.operand).jsValue(); 1605 JSValue shift = callFrame->r(vPC[3].u.operand).jsValue(); 1651 1606 1652 1607 if (val.isInt32() && shift.isInt32()) … … 1658 1613 } 1659 1614 1660 ++vPC;1615 vPC += OPCODE_LENGTH(op_lshift); 1661 1616 NEXT_INSTRUCTION(); 1662 1617 } … … 1668 1623 uint32), and puts the result in register dst. 1669 1624 */ 1670 int dst = (++vPC)->u.operand;1671 JSValue val = callFrame->r( (++vPC)->u.operand).jsValue();1672 JSValue shift = callFrame->r( (++vPC)->u.operand).jsValue();1625 int dst = vPC[1].u.operand; 1626 JSValue val = callFrame->r(vPC[2].u.operand).jsValue(); 1627 JSValue shift = callFrame->r(vPC[3].u.operand).jsValue(); 1673 1628 1674 1629 if (val.isInt32() && shift.isInt32()) … … 1680 1635 } 1681 1636 1682 ++vPC;1637 vPC += OPCODE_LENGTH(op_rshift); 1683 1638 NEXT_INSTRUCTION(); 1684 1639 } … … 1690 1645 uint32), and puts the result in register dst. 1691 1646 */ 1692 int dst = (++vPC)->u.operand;1693 JSValue val = callFrame->r( (++vPC)->u.operand).jsValue();1694 JSValue shift = callFrame->r( (++vPC)->u.operand).jsValue();1647 int dst = vPC[1].u.operand; 1648 JSValue val = callFrame->r(vPC[2].u.operand).jsValue(); 1649 JSValue shift = callFrame->r(vPC[3].u.operand).jsValue(); 1695 1650 if (val.isUInt32() && shift.isInt32()) 1696 1651 callFrame->r(dst) = jsNumber(callFrame, val.asInt32() >> (shift.asInt32() & 0x1f)); … … 1701 1656 } 1702 1657 1703 ++vPC;1658 vPC += OPCODE_LENGTH(op_urshift); 1704 1659 NEXT_INSTRUCTION(); 1705 1660 } … … 1711 1666 in register dst. 1712 1667 */ 1713 int dst = (++vPC)->u.operand;1714 JSValue src1 = callFrame->r( (++vPC)->u.operand).jsValue();1715 JSValue src2 = callFrame->r( (++vPC)->u.operand).jsValue();1668 int dst = vPC[1].u.operand; 1669 JSValue src1 = callFrame->r(vPC[2].u.operand).jsValue(); 1670 JSValue src2 = callFrame->r(vPC[3].u.operand).jsValue(); 1716 1671 if (src1.isInt32() && src2.isInt32()) 1717 1672 callFrame->r(dst) = jsNumber(callFrame, src1.asInt32() & src2.asInt32()); … … 1722 1677 } 1723 1678 1724 vPC += 2;1679 vPC += OPCODE_LENGTH(op_bitand); 1725 1680 NEXT_INSTRUCTION(); 1726 1681 } … … 1732 1687 in register dst. 1733 1688 */ 1734 int dst = (++vPC)->u.operand;1735 JSValue src1 = callFrame->r( (++vPC)->u.operand).jsValue();1736 JSValue src2 = callFrame->r( (++vPC)->u.operand).jsValue();1689 int dst = vPC[1].u.operand; 1690 JSValue src1 = callFrame->r(vPC[2].u.operand).jsValue(); 1691 JSValue src2 = callFrame->r(vPC[3].u.operand).jsValue(); 1737 1692 if (src1.isInt32() && src2.isInt32()) 1738 1693 callFrame->r(dst) = jsNumber(callFrame, src1.asInt32() ^ src2.asInt32()); … … 1743 1698 } 1744 1699 1745 vPC += 2;1700 vPC += OPCODE_LENGTH(op_bitxor); 1746 1701 NEXT_INSTRUCTION(); 1747 1702 } … … 1753 1708 result in register dst. 1754 1709 */ 1755 int dst = (++vPC)->u.operand;1756 JSValue src1 = callFrame->r( (++vPC)->u.operand).jsValue();1757 JSValue src2 = callFrame->r( (++vPC)->u.operand).jsValue();1710 int dst = vPC[1].u.operand; 1711 JSValue src1 = callFrame->r(vPC[2].u.operand).jsValue(); 1712 JSValue src2 = callFrame->r(vPC[3].u.operand).jsValue(); 1758 1713 if (src1.isInt32() && src2.isInt32()) 1759 1714 callFrame->r(dst) = jsNumber(callFrame, src1.asInt32() | src2.asInt32()); … … 1764 1719 } 1765 1720 1766 vPC += 2;1721 vPC += OPCODE_LENGTH(op_bitor); 1767 1722 NEXT_INSTRUCTION(); 1768 1723 } … … 1773 1728 and puts the result in register dst. 1774 1729 */ 1775 int dst = (++vPC)->u.operand;1776 JSValue src = callFrame->r( (++vPC)->u.operand).jsValue();1730 int dst = vPC[1].u.operand; 1731 JSValue src = callFrame->r(vPC[2].u.operand).jsValue(); 1777 1732 if (src.isInt32()) 1778 1733 callFrame->r(dst) = jsNumber(callFrame, ~src.asInt32()); … … 1782 1737 callFrame->r(dst) = result; 1783 1738 } 1784 ++vPC;1739 vPC += OPCODE_LENGTH(op_bitnot); 1785 1740 NEXT_INSTRUCTION(); 1786 1741 } … … 1791 1746 boolean), and puts the result in register dst. 1792 1747 */ 1793 int dst = (++vPC)->u.operand;1794 int src = (++vPC)->u.operand;1748 int dst = vPC[1].u.operand; 1749 int src = vPC[2].u.operand; 1795 1750 JSValue result = jsBoolean(!callFrame->r(src).jsValue().toBoolean(callFrame)); 1796 1751 CHECK_FOR_EXCEPTION(); 1797 1752 callFrame->r(dst) = result; 1798 1753 1799 ++vPC;1754 vPC += OPCODE_LENGTH(op_not); 1800 1755 NEXT_INSTRUCTION(); 1801 1756 } … … 1827 1782 callFrame->r(dst) = jsBoolean(result); 1828 1783 1829 vPC += 5;1784 vPC += OPCODE_LENGTH(op_instanceof); 1830 1785 NEXT_INSTRUCTION(); 1831 1786 } … … 1836 1791 rules, and puts the result in register dst. 1837 1792 */ 1838 int dst = (++vPC)->u.operand;1839 int src = (++vPC)->u.operand;1793 int dst = vPC[1].u.operand; 1794 int src = vPC[2].u.operand; 1840 1795 callFrame->r(dst) = JSValue(jsTypeStringForValue(callFrame, callFrame->r(src).jsValue())); 1841 1796 1842 ++vPC;1797 vPC += OPCODE_LENGTH(op_typeof); 1843 1798 NEXT_INSTRUCTION(); 1844 1799 } … … 1850 1805 in register dst. 1851 1806 */ 1852 int dst = (++vPC)->u.operand;1853 int src = (++vPC)->u.operand;1807 int dst = vPC[1].u.operand; 1808 int src = vPC[2].u.operand; 1854 1809 JSValue v = callFrame->r(src).jsValue(); 1855 1810 callFrame->r(dst) = jsBoolean(v.isCell() ? v.asCell()->structure()->typeInfo().masqueradesAsUndefined() : v.isUndefined()); 1856 1811 1857 ++vPC;1812 vPC += OPCODE_LENGTH(op_is_undefined); 1858 1813 NEXT_INSTRUCTION(); 1859 1814 } … … 1865 1820 in register dst. 1866 1821 */ 1867 int dst = (++vPC)->u.operand;1868 int src = (++vPC)->u.operand;1822 int dst = vPC[1].u.operand; 1823 int src = vPC[2].u.operand; 1869 1824 callFrame->r(dst) = jsBoolean(callFrame->r(src).jsValue().isBoolean()); 1870 1825 1871 ++vPC;1826 vPC += OPCODE_LENGTH(op_is_boolean); 1872 1827 NEXT_INSTRUCTION(); 1873 1828 } … … 1879 1834 in register dst. 1880 1835 */ 1881 int dst = (++vPC)->u.operand;1882 int src = (++vPC)->u.operand;1836 int dst = vPC[1].u.operand; 1837 int src = vPC[2].u.operand; 1883 1838 callFrame->r(dst) = jsBoolean(callFrame->r(src).jsValue().isNumber()); 1884 1839 1885 ++vPC;1840 vPC += OPCODE_LENGTH(op_is_number); 1886 1841 NEXT_INSTRUCTION(); 1887 1842 } … … 1893 1848 in register dst. 1894 1849 */ 1895 int dst = (++vPC)->u.operand;1896 int src = (++vPC)->u.operand;1850 int dst = vPC[1].u.operand; 1851 int src = vPC[2].u.operand; 1897 1852 callFrame->r(dst) = jsBoolean(callFrame->r(src).jsValue().isString()); 1898 1853 1899 ++vPC;1854 vPC += OPCODE_LENGTH(op_is_string); 1900 1855 NEXT_INSTRUCTION(); 1901 1856 } … … 1907 1862 in register dst. 1908 1863 */ 1909 int dst = (++vPC)->u.operand;1910 int src = (++vPC)->u.operand;1864 int dst = vPC[1].u.operand; 1865 int src = vPC[2].u.operand; 1911 1866 callFrame->r(dst) = jsBoolean(jsIsObjectType(callFrame->r(src).jsValue())); 1912 1867 1913 ++vPC;1868 vPC += OPCODE_LENGTH(op_is_object); 1914 1869 NEXT_INSTRUCTION(); 1915 1870 } … … 1921 1876 in register dst. 1922 1877 */ 1923 int dst = (++vPC)->u.operand;1924 int src = (++vPC)->u.operand;1878 int dst = vPC[1].u.operand; 1879 int src = vPC[2].u.operand; 1925 1880 callFrame->r(dst) = jsBoolean(jsIsFunctionType(callFrame->r(src).jsValue())); 1926 1881 1927 ++vPC;1882 vPC += OPCODE_LENGTH(op_is_function); 1928 1883 NEXT_INSTRUCTION(); 1929 1884 } … … 1937 1892 object. 1938 1893 */ 1939 int dst = (++vPC)->u.operand;1940 int property = (++vPC)->u.operand;1941 int base = (++vPC)->u.operand;1894 int dst = vPC[1].u.operand; 1895 int property = vPC[2].u.operand; 1896 int base = vPC[3].u.operand; 1942 1897 1943 1898 JSValue baseVal = callFrame->r(base).jsValue(); … … 1958 1913 } 1959 1914 1960 ++vPC;1915 vPC += OPCODE_LENGTH(op_in); 1961 1916 NEXT_INSTRUCTION(); 1962 1917 } … … 1971 1926 goto vm_throw; 1972 1927 1973 vPC += 3;1928 vPC += OPCODE_LENGTH(op_resolve); 1974 1929 NEXT_INSTRUCTION(); 1975 1930 } … … 1984 1939 goto vm_throw; 1985 1940 1986 vPC += 4;1941 vPC += OPCODE_LENGTH(op_resolve_skip); 1987 1942 1988 1943 NEXT_INSTRUCTION(); … … 1999 1954 goto vm_throw; 2000 1955 2001 vPC += 6;1956 vPC += OPCODE_LENGTH(op_resolve_global); 2002 1957 2003 1958 NEXT_INSTRUCTION(); … … 2008 1963 Gets the global var at global slot index and places it in register dst. 2009 1964 */ 2010 int dst = (++vPC)->u.operand;2011 JSGlobalObject* scope = static_cast<JSGlobalObject*>( (++vPC)->u.jsCell);1965 int dst = vPC[1].u.operand; 1966 JSGlobalObject* scope = static_cast<JSGlobalObject*>(vPC[2].u.jsCell); 2012 1967 ASSERT(scope->isGlobalObject()); 2013 int index = (++vPC)->u.operand;1968 int index = vPC[3].u.operand; 2014 1969 2015 1970 callFrame->r(dst) = scope->registerAt(index); 2016 ++vPC;1971 vPC += OPCODE_LENGTH(op_get_global_var); 2017 1972 NEXT_INSTRUCTION(); 2018 1973 } … … 2022 1977 Puts value into global slot index. 2023 1978 */ 2024 JSGlobalObject* scope = static_cast<JSGlobalObject*>( (++vPC)->u.jsCell);1979 JSGlobalObject* scope = static_cast<JSGlobalObject*>(vPC[1].u.jsCell); 2025 1980 ASSERT(scope->isGlobalObject()); 2026 int index = (++vPC)->u.operand;2027 int value = (++vPC)->u.operand;1981 int index = vPC[2].u.operand; 1982 int value = vPC[3].u.operand; 2028 1983 2029 1984 scope->registerAt(index) = JSValue(callFrame->r(value).jsValue()); 2030 ++vPC;1985 vPC += OPCODE_LENGTH(op_put_global_var); 2031 1986 NEXT_INSTRUCTION(); 2032 1987 } … … 2037 1992 the top of the scope chain, and places it in register dst 2038 1993 */ 2039 int dst = (++vPC)->u.operand;2040 int index = (++vPC)->u.operand;2041 int skip = (++vPC)->u.operand + callFrame->codeBlock()->needsFullScopeChain();1994 int dst = vPC[1].u.operand; 1995 int index = vPC[2].u.operand; 1996 int skip = vPC[3].u.operand + callFrame->codeBlock()->needsFullScopeChain(); 2042 1997 2043 1998 ScopeChainNode* scopeChain = callFrame->scopeChain(); … … 2053 2008 JSVariableObject* scope = static_cast<JSVariableObject*>(*iter); 2054 2009 callFrame->r(dst) = scope->registerAt(index); 2055 ++vPC;2010 vPC += OPCODE_LENGTH(op_get_scoped_var); 2056 2011 NEXT_INSTRUCTION(); 2057 2012 } … … 2060 2015 2061 2016 */ 2062 int index = (++vPC)->u.operand;2063 int skip = (++vPC)->u.operand + callFrame->codeBlock()->needsFullScopeChain();2064 int value = (++vPC)->u.operand;2017 int index = vPC[1].u.operand; 2018 int skip = vPC[2].u.operand + callFrame->codeBlock()->needsFullScopeChain(); 2019 int value = vPC[3].u.operand; 2065 2020 2066 2021 ScopeChainNode* scopeChain = callFrame->scopeChain(); … … 2076 2031 JSVariableObject* scope = static_cast<JSVariableObject*>(*iter); 2077 2032 scope->registerAt(index) = JSValue(callFrame->r(value).jsValue()); 2078 ++vPC;2033 vPC += OPCODE_LENGTH(op_put_scoped_var); 2079 2034 NEXT_INSTRUCTION(); 2080 2035 } … … 2089 2044 resolveBase(callFrame, vPC); 2090 2045 2091 vPC += 3;2046 vPC += OPCODE_LENGTH(op_resolve_base); 2092 2047 NEXT_INSTRUCTION(); 2093 2048 } … … 2107 2062 goto vm_throw; 2108 2063 2109 vPC += 4;2064 vPC += OPCODE_LENGTH(op_resolve_with_base); 2110 2065 NEXT_INSTRUCTION(); 2111 2066 } … … 2130 2085 2131 2086 callFrame->r(dst) = result; 2132 vPC += 8;2087 vPC += OPCODE_LENGTH(op_get_by_id); 2133 2088 NEXT_INSTRUCTION(); 2134 2089 } … … 2156 2111 callFrame->r(dst) = JSValue(baseObject->getDirectOffset(offset)); 2157 2112 2158 vPC += 8;2113 vPC += OPCODE_LENGTH(op_get_by_id_self); 2159 2114 NEXT_INSTRUCTION(); 2160 2115 } … … 2190 2145 callFrame->r(dst) = JSValue(protoObject->getDirectOffset(offset)); 2191 2146 2192 vPC += 8;2147 vPC += OPCODE_LENGTH(op_get_by_id_proto); 2193 2148 NEXT_INSTRUCTION(); 2194 2149 } … … 2203 2158 ASSERT_NOT_REACHED(); 2204 2159 // This case of the switch must not be empty, else (op_get_by_id_self_list == op_get_by_id_chain)! 2205 vPC += 8;2160 vPC += OPCODE_LENGTH(op_get_by_id_self_list); 2206 2161 NEXT_INSTRUCTION(); 2207 2162 } … … 2210 2165 ASSERT_NOT_REACHED(); 2211 2166 // This case of the switch must not be empty, else (op_get_by_id_proto_list == op_get_by_id_chain)! 2212 vPC += 8;2167 vPC += OPCODE_LENGTH(op_get_by_id_proto_list); 2213 2168 NEXT_INSTRUCTION(); 2214 2169 } … … 2245 2200 callFrame->r(dst) = JSValue(baseObject->getDirectOffset(offset)); 2246 2201 2247 vPC += 8;2202 vPC += OPCODE_LENGTH(op_get_by_id_chain); 2248 2203 NEXT_INSTRUCTION(); 2249 2204 } … … 2275 2230 2276 2231 callFrame->r(dst) = result; 2277 vPC += 8;2232 vPC += OPCODE_LENGTH(op_get_by_id_generic); 2278 2233 NEXT_INSTRUCTION(); 2279 2234 } … … 2291 2246 int dst = vPC[1].u.operand; 2292 2247 callFrame->r(dst) = jsNumber(callFrame, asArray(baseValue)->length()); 2293 vPC += 8;2248 vPC += OPCODE_LENGTH(op_get_array_length); 2294 2249 NEXT_INSTRUCTION(); 2295 2250 } … … 2311 2266 int dst = vPC[1].u.operand; 2312 2267 callFrame->r(dst) = jsNumber(callFrame, asString(baseValue)->value().size()); 2313 vPC += 8;2268 vPC += OPCODE_LENGTH(op_get_string_length); 2314 2269 NEXT_INSTRUCTION(); 2315 2270 } … … 2341 2296 tryCachePutByID(callFrame, codeBlock, vPC, baseValue, slot); 2342 2297 2343 vPC += 8;2298 vPC += OPCODE_LENGTH(op_put_by_id); 2344 2299 NEXT_INSTRUCTION(); 2345 2300 } … … 2386 2341 baseObject->putDirectOffset(offset, callFrame->r(value).jsValue()); 2387 2342 2388 vPC += 8;2343 vPC += OPCODE_LENGTH(op_put_by_id_transition); 2389 2344 NEXT_INSTRUCTION(); 2390 2345 } … … 2421 2376 baseObject->putDirectOffset(offset, callFrame->r(value).jsValue()); 2422 2377 2423 vPC += 8;2378 vPC += OPCODE_LENGTH(op_put_by_id_replace); 2424 2379 NEXT_INSTRUCTION(); 2425 2380 } … … 2448 2403 CHECK_FOR_EXCEPTION(); 2449 2404 2450 vPC += 8;2405 vPC += OPCODE_LENGTH(op_put_by_id_generic); 2451 2406 NEXT_INSTRUCTION(); 2452 2407 } … … 2459 2414 to register dst. 2460 2415 */ 2461 int dst = (++vPC)->u.operand;2462 int base = (++vPC)->u.operand;2463 int property = (++vPC)->u.operand;2416 int dst = vPC[1].u.operand; 2417 int base = vPC[2].u.operand; 2418 int property = vPC[3].u.operand; 2464 2419 2465 2420 JSObject* baseObj = callFrame->r(base).jsValue().toObject(callFrame); … … 2468 2423 CHECK_FOR_EXCEPTION(); 2469 2424 callFrame->r(dst) = result; 2470 ++vPC;2425 vPC += OPCODE_LENGTH(op_del_by_id); 2471 2426 NEXT_INSTRUCTION(); 2472 2427 } … … 2479 2434 but numbers are treated more efficiently. 2480 2435 */ 2481 int dst = (++vPC)->u.operand;2482 int base = (++vPC)->u.operand;2483 int property = (++vPC)->u.operand;2436 int dst = vPC[1].u.operand; 2437 int base = vPC[2].u.operand; 2438 int property = vPC[3].u.operand; 2484 2439 2485 2440 JSValue baseValue = callFrame->r(base).jsValue(); … … 2509 2464 CHECK_FOR_EXCEPTION(); 2510 2465 callFrame->r(dst) = result; 2511 ++vPC;2466 vPC += OPCODE_LENGTH(op_get_by_val); 2512 2467 NEXT_INSTRUCTION(); 2513 2468 } … … 2523 2478 the register file. 2524 2479 */ 2525 int base = (++vPC)->u.operand;2526 int property = (++vPC)->u.operand;2527 int value = (++vPC)->u.operand;2480 int base = vPC[1].u.operand; 2481 int property = vPC[2].u.operand; 2482 int value = vPC[3].u.operand; 2528 2483 2529 2484 JSValue baseValue = callFrame->r(base).jsValue(); … … 2559 2514 2560 2515 CHECK_FOR_EXCEPTION(); 2561 ++vPC;2516 vPC += OPCODE_LENGTH(op_put_by_val); 2562 2517 NEXT_INSTRUCTION(); 2563 2518 } … … 2570 2525 to register dst. 2571 2526 */ 2572 int dst = (++vPC)->u.operand;2573 int base = (++vPC)->u.operand;2574 int property = (++vPC)->u.operand;2527 int dst = vPC[1].u.operand; 2528 int base = vPC[2].u.operand; 2529 int property = vPC[3].u.operand; 2575 2530 2576 2531 JSObject* baseObj = callFrame->r(base).jsValue().toObject(callFrame); // may throw … … 2590 2545 CHECK_FOR_EXCEPTION(); 2591 2546 callFrame->r(dst) = result; 2592 ++vPC;2547 vPC += OPCODE_LENGTH(op_del_by_val); 2593 2548 NEXT_INSTRUCTION(); 2594 2549 } … … 2605 2560 This opcode is mainly used to initialize array literals. 2606 2561 */ 2607 int base = (++vPC)->u.operand;2608 unsigned property = (++vPC)->u.operand;2609 int value = (++vPC)->u.operand;2562 int base = vPC[1].u.operand; 2563 unsigned property = vPC[2].u.operand; 2564 int value = vPC[3].u.operand; 2610 2565 2611 2566 callFrame->r(base).jsValue().put(callFrame, property, callFrame->r(value).jsValue()); 2612 2567 2613 ++vPC;2568 vPC += OPCODE_LENGTH(op_put_by_index); 2614 2569 NEXT_INSTRUCTION(); 2615 2570 } … … 2626 2581 OpcodeStats::resetLastInstruction(); 2627 2582 #endif 2628 int target = (++vPC)->u.operand;2583 int target = vPC[1].u.operand; 2629 2584 CHECK_FOR_TIMEOUT(); 2630 2585 vPC += target; … … 2640 2595 OpcodeStats::resetLastInstruction(); 2641 2596 #endif 2642 int target = (++vPC)->u.operand;2597 int target = vPC[1].u.operand; 2643 2598 2644 2599 vPC += target; … … 2654 2609 the JS timeout is reached. 2655 2610 */ 2656 int cond = (++vPC)->u.operand;2657 int target = (++vPC)->u.operand;2611 int cond = vPC[1].u.operand; 2612 int target = vPC[2].u.operand; 2658 2613 if (callFrame->r(cond).jsValue().toBoolean(callFrame)) { 2659 2614 vPC += target; … … 2662 2617 } 2663 2618 2664 ++vPC;2619 vPC += OPCODE_LENGTH(op_loop_if_true); 2665 2620 NEXT_INSTRUCTION(); 2666 2621 } … … 2671 2626 only if register cond converts to boolean as true. 2672 2627 */ 2673 int cond = (++vPC)->u.operand;2674 int target = (++vPC)->u.operand;2628 int cond = vPC[1].u.operand; 2629 int target = vPC[2].u.operand; 2675 2630 if (callFrame->r(cond).jsValue().toBoolean(callFrame)) { 2676 2631 vPC += target; … … 2678 2633 } 2679 2634 2680 ++vPC;2635 vPC += OPCODE_LENGTH(op_jtrue); 2681 2636 NEXT_INSTRUCTION(); 2682 2637 } … … 2687 2642 only if register cond converts to boolean as false. 2688 2643 */ 2689 int cond = (++vPC)->u.operand;2690 int target = (++vPC)->u.operand;2644 int cond = vPC[1].u.operand; 2645 int target = vPC[2].u.operand; 2691 2646 if (!callFrame->r(cond).jsValue().toBoolean(callFrame)) { 2692 2647 vPC += target; … … 2694 2649 } 2695 2650 2696 ++vPC;2651 vPC += OPCODE_LENGTH(op_jfalse); 2697 2652 NEXT_INSTRUCTION(); 2698 2653 } … … 2703 2658 only if register src is null. 2704 2659 */ 2705 int src = (++vPC)->u.operand;2706 int target = (++vPC)->u.operand;2660 int src = vPC[1].u.operand; 2661 int target = vPC[2].u.operand; 2707 2662 JSValue srcValue = callFrame->r(src).jsValue(); 2708 2663 … … 2712 2667 } 2713 2668 2714 ++vPC;2669 vPC += OPCODE_LENGTH(op_jeq_null); 2715 2670 NEXT_INSTRUCTION(); 2716 2671 } … … 2721 2676 only if register src is not null. 2722 2677 */ 2723 int src = (++vPC)->u.operand;2724 int target = (++vPC)->u.operand;2678 int src = vPC[1].u.operand; 2679 int target = vPC[2].u.operand; 2725 2680 JSValue srcValue = callFrame->r(src).jsValue(); 2726 2681 … … 2730 2685 } 2731 2686 2732 ++vPC;2687 vPC += OPCODE_LENGTH(op_jneq_null); 2733 2688 NEXT_INSTRUCTION(); 2734 2689 } … … 2739 2694 to ptr, using pointer equality. 2740 2695 */ 2741 int src = (++vPC)->u.operand;2742 JSValue ptr = JSValue( (++vPC)->u.jsCell);2743 int target = (++vPC)->u.operand;2696 int src = vPC[1].u.operand; 2697 JSValue ptr = JSValue(vPC[2].u.jsCell); 2698 int target = vPC[3].u.operand; 2744 2699 JSValue srcValue = callFrame->r(src).jsValue(); 2745 2700 if (srcValue != ptr) { … … 2748 2703 } 2749 2704 2750 ++vPC;2705 vPC += OPCODE_LENGTH(op_jneq_ptr); 2751 2706 NEXT_INSTRUCTION(); 2752 2707 } … … 2762 2717 the JS timeout is reached. 2763 2718 */ 2764 JSValue src1 = callFrame->r( (++vPC)->u.operand).jsValue();2765 JSValue src2 = callFrame->r( (++vPC)->u.operand).jsValue();2766 int target = (++vPC)->u.operand;2719 JSValue src1 = callFrame->r(vPC[1].u.operand).jsValue(); 2720 JSValue src2 = callFrame->r(vPC[2].u.operand).jsValue(); 2721 int target = vPC[3].u.operand; 2767 2722 2768 2723 bool result = jsLess(callFrame, src1, src2); … … 2775 2730 } 2776 2731 2777 ++vPC;2732 vPC += OPCODE_LENGTH(op_loop_if_less); 2778 2733 NEXT_INSTRUCTION(); 2779 2734 } … … 2789 2744 the JS timeout is reached. 2790 2745 */ 2791 JSValue src1 = callFrame->r( (++vPC)->u.operand).jsValue();2792 JSValue src2 = callFrame->r( (++vPC)->u.operand).jsValue();2793 int target = (++vPC)->u.operand;2746 JSValue src1 = callFrame->r(vPC[1].u.operand).jsValue(); 2747 JSValue src2 = callFrame->r(vPC[2].u.operand).jsValue(); 2748 int target = vPC[3].u.operand; 2794 2749 2795 2750 bool result = jsLessEq(callFrame, src1, src2); … … 2802 2757 } 2803 2758 2804 ++vPC;2759 vPC += OPCODE_LENGTH(op_loop_if_lesseq); 2805 2760 NEXT_INSTRUCTION(); 2806 2761 } … … 2813 2768 result of the comparison is false. 2814 2769 */ 2815 JSValue src1 = callFrame->r( (++vPC)->u.operand).jsValue();2816 JSValue src2 = callFrame->r( (++vPC)->u.operand).jsValue();2817 int target = (++vPC)->u.operand;2770 JSValue src1 = callFrame->r(vPC[1].u.operand).jsValue(); 2771 JSValue src2 = callFrame->r(vPC[2].u.operand).jsValue(); 2772 int target = vPC[3].u.operand; 2818 2773 2819 2774 bool result = jsLess(callFrame, src1, src2); … … 2825 2780 } 2826 2781 2827 ++vPC;2782 vPC += OPCODE_LENGTH(op_jnless); 2828 2783 NEXT_INSTRUCTION(); 2829 2784 } … … 2836 2791 if and only if theresult of the comparison is false. 2837 2792 */ 2838 JSValue src1 = callFrame->r( (++vPC)->u.operand).jsValue();2839 JSValue src2 = callFrame->r( (++vPC)->u.operand).jsValue();2840 int target = (++vPC)->u.operand;2793 JSValue src1 = callFrame->r(vPC[1].u.operand).jsValue(); 2794 JSValue src2 = callFrame->r(vPC[2].u.operand).jsValue(); 2795 int target = vPC[3].u.operand; 2841 2796 2842 2797 bool result = jsLessEq(callFrame, src1, src2); … … 2848 2803 } 2849 2804 2850 ++vPC;2805 vPC += OPCODE_LENGTH(op_jnlesseq); 2851 2806 NEXT_INSTRUCTION(); 2852 2807 } … … 2860 2815 that value is used as the jump offset, otherwise defaultOffset is used. 2861 2816 */ 2862 int tableIndex = (++vPC)->u.operand;2863 int defaultOffset = (++vPC)->u.operand;2864 JSValue scrutinee = callFrame->r( (++vPC)->u.operand).jsValue();2817 int tableIndex = vPC[1].u.operand; 2818 int defaultOffset = vPC[2].u.operand; 2819 JSValue scrutinee = callFrame->r(vPC[3].u.operand).jsValue(); 2865 2820 if (scrutinee.isInt32()) 2866 2821 vPC += callFrame->codeBlock()->immediateSwitchJumpTable(tableIndex).offsetForValue(scrutinee.asInt32(), defaultOffset); … … 2884 2839 that value is used as the jump offset, otherwise defaultOffset is used. 2885 2840 */ 2886 int tableIndex = (++vPC)->u.operand;2887 int defaultOffset = (++vPC)->u.operand;2888 JSValue scrutinee = callFrame->r( (++vPC)->u.operand).jsValue();2841 int tableIndex = vPC[1].u.operand; 2842 int defaultOffset = vPC[2].u.operand; 2843 JSValue scrutinee = callFrame->r(vPC[3].u.operand).jsValue(); 2889 2844 if (!scrutinee.isString()) 2890 2845 vPC += defaultOffset; … … 2907 2862 jump offset, otherwise defaultOffset is used. 2908 2863 */ 2909 int tableIndex = (++vPC)->u.operand;2910 int defaultOffset = (++vPC)->u.operand;2911 JSValue scrutinee = callFrame->r( (++vPC)->u.operand).jsValue();2864 int tableIndex = vPC[1].u.operand; 2865 int defaultOffset = vPC[2].u.operand; 2866 JSValue scrutinee = callFrame->r(vPC[3].u.operand).jsValue(); 2912 2867 if (!scrutinee.isString()) 2913 2868 vPC += defaultOffset; … … 2924 2879 puts the result in register dst. 2925 2880 */ 2926 int dst = (++vPC)->u.operand;2927 int func = (++vPC)->u.operand;2881 int dst = vPC[1].u.operand; 2882 int func = vPC[2].u.operand; 2928 2883 2929 2884 callFrame->r(dst) = JSValue(callFrame->codeBlock()->functionDecl(func)->make(callFrame, callFrame->scopeChain())); 2930 2885 2931 ++vPC;2886 vPC += OPCODE_LENGTH(op_new_func); 2932 2887 NEXT_INSTRUCTION(); 2933 2888 } … … 2940 2895 puts the result in register dst. 2941 2896 */ 2942 int dst = (++vPC)->u.operand;2943 int funcIndex = (++vPC)->u.operand;2897 int dst = vPC[1].u.operand; 2898 int funcIndex = vPC[2].u.operand; 2944 2899 2945 2900 FunctionExecutable* function = callFrame->codeBlock()->functionExpr(funcIndex); … … 2960 2915 callFrame->r(dst) = JSValue(func); 2961 2916 2962 ++vPC;2917 vPC += OPCODE_LENGTH(op_new_func_exp); 2963 2918 NEXT_INSTRUCTION(); 2964 2919 } … … 2993 2948 callFrame->r(dst) = result; 2994 2949 2995 vPC += 5;2950 vPC += OPCODE_LENGTH(op_call_eval); 2996 2951 NEXT_INSTRUCTION(); 2997 2952 } … … 3067 3022 callFrame->r(dst) = returnValue; 3068 3023 3069 vPC += 5;3024 vPC += OPCODE_LENGTH(op_call); 3070 3025 NEXT_INSTRUCTION(); 3071 3026 } … … 3077 3032 } 3078 3033 DEFINE_OPCODE(op_load_varargs) { 3079 int argCountDst = (++vPC)->u.operand;3080 int argsOffset = (++vPC)->u.operand;3034 int argCountDst = vPC[1].u.operand; 3035 int argsOffset = vPC[2].u.operand; 3081 3036 3082 3037 JSValue arguments = callFrame->r(argsOffset).jsValue(); … … 3150 3105 CHECK_FOR_EXCEPTION(); 3151 3106 callFrame->r(argCountDst) = Register::withInt(argCount + 1); 3152 ++vPC;3107 vPC += OPCODE_LENGTH(op_load_varargs); 3153 3108 NEXT_INSTRUCTION(); 3154 3109 } … … 3221 3176 callFrame->r(dst) = returnValue; 3222 3177 3223 vPC += 5;3178 vPC += OPCODE_LENGTH(op_call_varargs); 3224 3179 NEXT_INSTRUCTION(); 3225 3180 } … … 3243 3198 */ 3244 3199 3245 int src = (++vPC)->u.operand;3200 int src = vPC[1].u.operand; 3246 3201 ASSERT(callFrame->codeBlock()->needsFullScopeChain()); 3247 3202 3248 3203 asActivation(callFrame->r(src).jsValue())->copyRegisters(callFrame->optionalCalleeArguments()); 3249 3204 3250 ++vPC;3205 vPC += OPCODE_LENGTH(op_tear_off_activation); 3251 3206 NEXT_INSTRUCTION(); 3252 3207 } … … 3269 3224 callFrame->optionalCalleeArguments()->copyRegisters(); 3270 3225 3271 ++vPC;3226 vPC += OPCODE_LENGTH(op_tear_off_arguments); 3272 3227 NEXT_INSTRUCTION(); 3273 3228 } … … 3282 3237 */ 3283 3238 3284 int result = (++vPC)->u.operand;3239 int result = vPC[1].u.operand; 3285 3240 3286 3241 if (callFrame->codeBlock()->needsFullScopeChain()) … … 3317 3272 callFrame->r(i) = jsUndefined(); 3318 3273 3319 ++vPC;3274 vPC += OPCODE_LENGTH(op_enter); 3320 3275 NEXT_INSTRUCTION(); 3321 3276 } … … 3339 3294 callFrame->r(i) = jsUndefined(); 3340 3295 3341 int dst = (++vPC)->u.operand;3296 int dst = vPC[1].u.operand; 3342 3297 JSActivation* activation = new (globalData) JSActivation(callFrame, static_cast<FunctionExecutable*>(codeBlock->ownerExecutable())); 3343 3298 callFrame->r(dst) = JSValue(activation); 3344 3299 callFrame->setScopeChain(callFrame->scopeChain()->copy()->push(activation)); 3345 3300 3346 ++vPC;3301 vPC += OPCODE_LENGTH(op_enter_with_activation); 3347 3302 NEXT_INSTRUCTION(); 3348 3303 } … … 3359 3314 */ 3360 3315 3361 int thisRegister = (++vPC)->u.operand;3316 int thisRegister = vPC[1].u.operand; 3362 3317 JSValue thisVal = callFrame->r(thisRegister).jsValue(); 3363 3318 if (thisVal.needsThisConversion()) 3364 3319 callFrame->r(thisRegister) = JSValue(thisVal.toThisObject(callFrame)); 3365 3320 3366 ++vPC;3321 vPC += OPCODE_LENGTH(op_convert_this); 3367 3322 NEXT_INSTRUCTION(); 3368 3323 } … … 3378 3333 */ 3379 3334 callFrame->r(RegisterFile::ArgumentsRegister) = JSValue(); 3380 ++vPC;3335 vPC += OPCODE_LENGTH(op_init_arguments); 3381 3336 NEXT_INSTRUCTION(); 3382 3337 } … … 3394 3349 callFrame->r(RegisterFile::ArgumentsRegister) = JSValue(arguments); 3395 3350 } 3396 ++vPC;3351 vPC += OPCODE_LENGTH(op_create_arguments); 3397 3352 NEXT_INSTRUCTION(); 3398 3353 } … … 3472 3427 callFrame->r(dst) = JSValue(returnValue); 3473 3428 3474 vPC += 7;3429 vPC += OPCODE_LENGTH(op_construct); 3475 3430 NEXT_INSTRUCTION(); 3476 3431 } … … 3490 3445 int dst = vPC[1].u.operand; 3491 3446 if (LIKELY(callFrame->r(dst).jsValue().isObject())) { 3492 vPC += 3;3447 vPC += OPCODE_LENGTH(op_construct_verify); 3493 3448 NEXT_INSTRUCTION(); 3494 3449 } … … 3497 3452 callFrame->r(dst) = callFrame->r(override); 3498 3453 3499 vPC += 3;3454 vPC += OPCODE_LENGTH(op_construct_verify); 3500 3455 NEXT_INSTRUCTION(); 3501 3456 } 3502 3457 DEFINE_OPCODE(op_strcat) { 3503 int dst = (++vPC)->u.operand;3504 int src = (++vPC)->u.operand;3505 int count = (++vPC)->u.operand;3458 int dst = vPC[1].u.operand; 3459 int src = vPC[2].u.operand; 3460 int count = vPC[3].u.operand; 3506 3461 3507 3462 callFrame->r(dst) = concatenateStrings(callFrame, &callFrame->registers()[src], count); 3508 ++vPC;3463 vPC += OPCODE_LENGTH(op_strcat); 3509 3464 3510 3465 NEXT_INSTRUCTION(); 3511 3466 } 3512 3467 DEFINE_OPCODE(op_to_primitive) { 3513 int dst = (++vPC)->u.operand;3514 int src = (++vPC)->u.operand;3468 int dst = vPC[1].u.operand; 3469 int src = vPC[2].u.operand; 3515 3470 3516 3471 callFrame->r(dst) = callFrame->r(src).jsValue().toPrimitive(callFrame); 3517 ++vPC;3472 vPC += OPCODE_LENGTH(op_to_primitive); 3518 3473 3519 3474 NEXT_INSTRUCTION(); … … 3526 3481 are replaced by the result of toObject conversion of the scope. 3527 3482 */ 3528 int scope = (++vPC)->u.operand;3483 int scope = vPC[1].u.operand; 3529 3484 JSValue v = callFrame->r(scope).jsValue(); 3530 3485 JSObject* o = v.toObject(callFrame); … … 3534 3489 callFrame->setScopeChain(callFrame->scopeChain()->push(o)); 3535 3490 3536 ++vPC;3491 vPC += OPCODE_LENGTH(op_push_scope); 3537 3492 NEXT_INSTRUCTION(); 3538 3493 } … … 3544 3499 callFrame->setScopeChain(callFrame->scopeChain()->pop()); 3545 3500 3546 ++vPC;3501 vPC += OPCODE_LENGTH(op_pop_scope); 3547 3502 NEXT_INSTRUCTION(); 3548 3503 } … … 3555 3510 register. 3556 3511 */ 3557 int dst = (++vPC)->u.operand;3558 int base = (++vPC)->u.operand;3512 int dst = vPC[1].u.operand; 3513 int base = vPC[2].u.operand; 3559 3514 3560 3515 callFrame->r(dst) = JSPropertyNameIterator::create(callFrame, callFrame->r(base).jsValue()); 3561 ++vPC;3516 vPC += OPCODE_LENGTH(op_get_pnames); 3562 3517 NEXT_INSTRUCTION(); 3563 3518 } … … 3571 3526 instruction. 3572 3527 */ 3573 int dst = (++vPC)->u.operand;3574 int iter = (++vPC)->u.operand;3575 int target = (++vPC)->u.operand;3528 int dst = vPC[1].u.operand; 3529 int iter = vPC[2].u.operand; 3530 int target = vPC[3].u.operand; 3576 3531 3577 3532 JSPropertyNameIterator* it = callFrame->r(iter).propertyNameIterator(); … … 3584 3539 it->invalidate(); 3585 3540 3586 ++vPC;3541 vPC += OPCODE_LENGTH(op_next_pname); 3587 3542 NEXT_INSTRUCTION(); 3588 3543 } … … 3594 3549 target. 3595 3550 */ 3596 int count = (++vPC)->u.operand;3597 int target = (++vPC)->u.operand;3551 int count = vPC[1].u.operand; 3552 int target = vPC[2].u.operand; 3598 3553 3599 3554 ScopeChainNode* tmp = callFrame->scopeChain(); … … 3618 3573 callFrame->setScopeChain(createExceptionScope(callFrame, vPC)); 3619 3574 3620 vPC += 4;3575 vPC += OPCODE_LENGTH(op_push_new_scope); 3621 3576 NEXT_INSTRUCTION(); 3622 3577 } … … 3633 3588 ASSERT(exceptionValue); 3634 3589 ASSERT(!globalData->exception); 3635 int ex = (++vPC)->u.operand;3590 int ex = vPC[1].u.operand; 3636 3591 callFrame->r(ex) = exceptionValue; 3637 3592 exceptionValue = JSValue(); 3638 3593 3639 ++vPC;3594 vPC += OPCODE_LENGTH(op_catch); 3640 3595 NEXT_INSTRUCTION(); 3641 3596 } … … 3651 3606 */ 3652 3607 3653 int ex = (++vPC)->u.operand;3608 int ex = vPC[1].u.operand; 3654 3609 exceptionValue = callFrame->r(ex).jsValue(); 3655 3610 … … 3671 3626 written to register dst. 3672 3627 */ 3673 int dst = (++vPC)->u.operand;3674 int type = (++vPC)->u.operand;3675 int message = (++vPC)->u.operand;3628 int dst = vPC[1].u.operand; 3629 int type = vPC[2].u.operand; 3630 int message = vPC[3].u.operand; 3676 3631 3677 3632 CodeBlock* codeBlock = callFrame->codeBlock(); 3678 3633 callFrame->r(dst) = JSValue(Error::create(callFrame, (ErrorType)type, callFrame->r(message).jsValue().toString(callFrame), codeBlock->lineNumberForBytecodeOffset(callFrame, vPC - codeBlock->instructions().begin()), codeBlock->ownerExecutable()->sourceID(), codeBlock->ownerExecutable()->sourceURL())); 3679 3634 3680 ++vPC;3635 vPC += OPCODE_LENGTH(op_new_error); 3681 3636 NEXT_INSTRUCTION(); 3682 3637 } … … 3693 3648 scopeChain->deref(); 3694 3649 } 3695 int result = (++vPC)->u.operand;3650 int result = vPC[1].u.operand; 3696 3651 return callFrame->r(result).jsValue(); 3697 3652 } … … 3707 3662 the register file. 3708 3663 */ 3709 int base = (++vPC)->u.operand;3710 int property = (++vPC)->u.operand;3711 int function = (++vPC)->u.operand;3664 int base = vPC[1].u.operand; 3665 int property = vPC[2].u.operand; 3666 int function = vPC[3].u.operand; 3712 3667 3713 3668 ASSERT(callFrame->r(base).jsValue().isObject()); … … 3717 3672 baseObj->defineGetter(callFrame, ident, asObject(callFrame->r(function).jsValue())); 3718 3673 3719 ++vPC;3674 vPC += OPCODE_LENGTH(op_put_getter); 3720 3675 NEXT_INSTRUCTION(); 3721 3676 } … … 3731 3686 the register file. 3732 3687 */ 3733 int base = (++vPC)->u.operand;3734 int property = (++vPC)->u.operand;3735 int function = (++vPC)->u.operand;3688 int base = vPC[1].u.operand; 3689 int property = vPC[2].u.operand; 3690 int function = vPC[3].u.operand; 3736 3691 3737 3692 ASSERT(callFrame->r(base).jsValue().isObject()); … … 3741 3696 baseObj->defineSetter(callFrame, ident, asObject(callFrame->r(function).jsValue()), 0); 3742 3697 3743 ++vPC;3698 vPC += OPCODE_LENGTH(op_put_setter); 3744 3699 NEXT_INSTRUCTION(); 3745 3700 } … … 3754 3709 register and jumps to offset target from the current instruction. 3755 3710 */ 3756 int retAddrDst = (++vPC)->u.operand;3757 int target = (++vPC)->u.operand;3758 callFrame->r(retAddrDst) = vPC + 1;3711 int retAddrDst = vPC[1].u.operand; 3712 int target = vPC[2].u.operand; 3713 callFrame->r(retAddrDst) = vPC + OPCODE_LENGTH(op_jsr); 3759 3714 3760 3715 vPC += target; … … 3768 3723 register, not as an immediate. 3769 3724 */ 3770 int retAddrSrc = (++vPC)->u.operand;3725 int retAddrSrc = vPC[1].u.operand; 3771 3726 vPC = callFrame->r(retAddrSrc).vPC(); 3772 3727 NEXT_INSTRUCTION(); … … 3778 3733 is only generated while the debugger is attached. 3779 3734 */ 3780 int debugHookID = (++vPC)->u.operand;3781 int firstLine = (++vPC)->u.operand;3782 int lastLine = (++vPC)->u.operand;3735 int debugHookID = vPC[1].u.operand; 3736 int firstLine = vPC[2].u.operand; 3737 int lastLine = vPC[3].u.operand; 3783 3738 3784 3739 debug(callFrame, static_cast<DebugHookID>(debugHookID), firstLine, lastLine); 3785 3740 3786 ++vPC;3741 vPC += OPCODE_LENGTH(op_debug); 3787 3742 NEXT_INSTRUCTION(); 3788 3743 } … … 3798 3753 (*enabledProfilerReference)->willExecute(callFrame, callFrame->r(function).jsValue()); 3799 3754 3800 vPC += 2;3755 vPC += OPCODE_LENGTH(op_profile_will_call); 3801 3756 NEXT_INSTRUCTION(); 3802 3757 } … … 3812 3767 (*enabledProfilerReference)->didExecute(callFrame, callFrame->r(function).jsValue()); 3813 3768 3814 vPC += 2;3769 vPC += OPCODE_LENGTH(op_profile_did_call); 3815 3770 NEXT_INSTRUCTION(); 3816 3771 }
Note:
See TracChangeset
for help on using the changeset viewer.