OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
776 | 776 |
777 LInstruction* LChunkBuilder::DoArithmeticT(Token::Value op, | 777 LInstruction* LChunkBuilder::DoArithmeticT(Token::Value op, |
778 HArithmeticBinaryOperation* instr) { | 778 HArithmeticBinaryOperation* instr) { |
779 ASSERT(op == Token::ADD || | 779 ASSERT(op == Token::ADD || |
780 op == Token::DIV || | 780 op == Token::DIV || |
781 op == Token::MOD || | 781 op == Token::MOD || |
782 op == Token::MUL || | 782 op == Token::MUL || |
783 op == Token::SUB); | 783 op == Token::SUB); |
784 HValue* left = instr->left(); | 784 HValue* left = instr->left(); |
785 HValue* right = instr->right(); | 785 HValue* right = instr->right(); |
786 ASSERT(left->representation().IsSmiOrTagged()); | 786 ASSERT(left->representation().IsTagged()); |
787 ASSERT(right->representation().IsSmiOrTagged()); | 787 ASSERT(right->representation().IsTagged()); |
788 LOperand* left_operand = UseFixed(left, a1); | 788 LOperand* left_operand = UseFixed(left, a1); |
789 LOperand* right_operand = UseFixed(right, a0); | 789 LOperand* right_operand = UseFixed(right, a0); |
790 LArithmeticT* result = | 790 LArithmeticT* result = |
791 new(zone()) LArithmeticT(op, left_operand, right_operand); | 791 new(zone()) LArithmeticT(op, left_operand, right_operand); |
792 return MarkAsCall(DefineFixed(result, v0), instr); | 792 return MarkAsCall(DefineFixed(result, v0), instr); |
793 } | 793 } |
794 | 794 |
795 | 795 |
796 void LChunkBuilder::DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block) { | 796 void LChunkBuilder::DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block) { |
797 ASSERT(is_building()); | 797 ASSERT(is_building()); |
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1308 return DoShift(Token::SAR, instr); | 1308 return DoShift(Token::SAR, instr); |
1309 } | 1309 } |
1310 | 1310 |
1311 | 1311 |
1312 LInstruction* LChunkBuilder::DoShl(HShl* instr) { | 1312 LInstruction* LChunkBuilder::DoShl(HShl* instr) { |
1313 return DoShift(Token::SHL, instr); | 1313 return DoShift(Token::SHL, instr); |
1314 } | 1314 } |
1315 | 1315 |
1316 | 1316 |
1317 LInstruction* LChunkBuilder::DoBitwise(HBitwise* instr) { | 1317 LInstruction* LChunkBuilder::DoBitwise(HBitwise* instr) { |
1318 if (instr->representation().IsInteger32()) { | 1318 if (instr->representation().IsSmiOrInteger32()) { |
1319 ASSERT(instr->left()->representation().IsInteger32()); | 1319 ASSERT(instr->left()->representation().Equals(instr->representation())); |
1320 ASSERT(instr->right()->representation().IsInteger32()); | 1320 ASSERT(instr->right()->representation().Equals(instr->representation())); |
1321 | 1321 |
1322 LOperand* left = UseRegisterAtStart(instr->BetterLeftOperand()); | 1322 LOperand* left = UseRegisterAtStart(instr->BetterLeftOperand()); |
1323 LOperand* right = UseOrConstantAtStart(instr->BetterRightOperand()); | 1323 LOperand* right = UseOrConstantAtStart(instr->BetterRightOperand()); |
1324 return DefineAsRegister(new(zone()) LBitI(left, right)); | 1324 return DefineAsRegister(new(zone()) LBitI(left, right)); |
1325 } else { | 1325 } else { |
1326 ASSERT(instr->representation().IsSmiOrTagged()); | 1326 ASSERT(instr->representation().IsTagged()); |
1327 ASSERT(instr->left()->representation().IsSmiOrTagged()); | 1327 ASSERT(instr->left()->representation().IsTagged()); |
1328 ASSERT(instr->right()->representation().IsSmiOrTagged()); | 1328 ASSERT(instr->right()->representation().IsTagged()); |
1329 | 1329 |
1330 LOperand* left = UseFixed(instr->left(), a1); | 1330 LOperand* left = UseFixed(instr->left(), a1); |
1331 LOperand* right = UseFixed(instr->right(), a0); | 1331 LOperand* right = UseFixed(instr->right(), a0); |
1332 LArithmeticT* result = new(zone()) LArithmeticT(instr->op(), left, right); | 1332 LArithmeticT* result = new(zone()) LArithmeticT(instr->op(), left, right); |
1333 return MarkAsCall(DefineFixed(result, v0), instr); | 1333 return MarkAsCall(DefineFixed(result, v0), instr); |
1334 } | 1334 } |
1335 } | 1335 } |
1336 | 1336 |
1337 | 1337 |
1338 LInstruction* LChunkBuilder::DoBitNot(HBitNot* instr) { | 1338 LInstruction* LChunkBuilder::DoBitNot(HBitNot* instr) { |
1339 ASSERT(instr->value()->representation().IsInteger32()); | 1339 ASSERT(instr->value()->representation().IsInteger32()); |
1340 ASSERT(instr->representation().IsInteger32()); | 1340 ASSERT(instr->representation().IsInteger32()); |
1341 if (instr->HasNoUses()) return NULL; | 1341 if (instr->HasNoUses()) return NULL; |
1342 LOperand* value = UseRegisterAtStart(instr->value()); | 1342 LOperand* value = UseRegisterAtStart(instr->value()); |
1343 return DefineAsRegister(new(zone()) LBitNotI(value)); | 1343 return DefineAsRegister(new(zone()) LBitNotI(value)); |
1344 } | 1344 } |
1345 | 1345 |
1346 | 1346 |
1347 LInstruction* LChunkBuilder::DoDiv(HDiv* instr) { | 1347 LInstruction* LChunkBuilder::DoDiv(HDiv* instr) { |
1348 if (instr->representation().IsDouble()) { | 1348 if (instr->representation().IsDouble()) { |
1349 return DoArithmeticD(Token::DIV, instr); | 1349 return DoArithmeticD(Token::DIV, instr); |
1350 } else if (instr->representation().IsInteger32()) { | 1350 } else if (instr->representation().IsSmiOrInteger32()) { |
| 1351 ASSERT(instr->left()->representation().Equals(instr->representation())); |
| 1352 ASSERT(instr->right()->representation().Equals(instr->representation())); |
1351 LOperand* dividend = UseRegister(instr->left()); | 1353 LOperand* dividend = UseRegister(instr->left()); |
1352 LOperand* divisor = UseRegister(instr->right()); | 1354 LOperand* divisor = UseRegister(instr->right()); |
1353 LDivI* div = new(zone()) LDivI(dividend, divisor); | 1355 LDivI* div = new(zone()) LDivI(dividend, divisor); |
1354 return AssignEnvironment(DefineAsRegister(div)); | 1356 return AssignEnvironment(DefineAsRegister(div)); |
1355 } else { | 1357 } else { |
1356 return DoArithmeticT(Token::DIV, instr); | 1358 return DoArithmeticT(Token::DIV, instr); |
1357 } | 1359 } |
1358 } | 1360 } |
1359 | 1361 |
1360 | 1362 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1407 ASSERT(right->IsConstant() && | 1409 ASSERT(right->IsConstant() && |
1408 HConstant::cast(right)->HasInteger32Value()); | 1410 HConstant::cast(right)->HasInteger32Value()); |
1409 return AssignEnvironment(DefineAsRegister( | 1411 return AssignEnvironment(DefineAsRegister( |
1410 new(zone()) LMathFloorOfDiv(dividend, divisor, remainder))); | 1412 new(zone()) LMathFloorOfDiv(dividend, divisor, remainder))); |
1411 } | 1413 } |
1412 | 1414 |
1413 | 1415 |
1414 LInstruction* LChunkBuilder::DoMod(HMod* instr) { | 1416 LInstruction* LChunkBuilder::DoMod(HMod* instr) { |
1415 HValue* left = instr->left(); | 1417 HValue* left = instr->left(); |
1416 HValue* right = instr->right(); | 1418 HValue* right = instr->right(); |
1417 if (instr->representation().IsInteger32()) { | 1419 if (instr->representation().IsSmiOrInteger32()) { |
1418 ASSERT(left->representation().IsInteger32()); | 1420 ASSERT(instr->left()->representation().Equals(instr->representation())); |
1419 ASSERT(right->representation().IsInteger32()); | 1421 ASSERT(instr->right()->representation().Equals(instr->representation())); |
1420 if (instr->HasPowerOf2Divisor()) { | 1422 if (instr->HasPowerOf2Divisor()) { |
1421 ASSERT(!right->CanBeZero()); | 1423 ASSERT(!right->CanBeZero()); |
1422 LModI* mod = new(zone()) LModI(UseRegisterAtStart(left), | 1424 LModI* mod = new(zone()) LModI(UseRegisterAtStart(left), |
1423 UseOrConstant(right)); | 1425 UseOrConstant(right)); |
1424 LInstruction* result = DefineAsRegister(mod); | 1426 LInstruction* result = DefineAsRegister(mod); |
1425 return (left->CanBeNegative() && | 1427 return (left->CanBeNegative() && |
1426 instr->CheckFlag(HValue::kBailoutOnMinusZero)) | 1428 instr->CheckFlag(HValue::kBailoutOnMinusZero)) |
1427 ? AssignEnvironment(result) | 1429 ? AssignEnvironment(result) |
1428 : result; | 1430 : result; |
1429 } else if (instr->fixed_right_arg().has_value) { | 1431 } else if (instr->fixed_right_arg().has_value) { |
1430 LModI* mod = new(zone()) LModI(UseRegisterAtStart(left), | 1432 LModI* mod = new(zone()) LModI(UseRegisterAtStart(left), |
1431 UseRegisterAtStart(right)); | 1433 UseRegisterAtStart(right)); |
1432 return AssignEnvironment(DefineAsRegister(mod)); | 1434 return AssignEnvironment(DefineAsRegister(mod)); |
1433 } else { | 1435 } else { |
1434 LModI* mod = new(zone()) LModI(UseRegister(left), | 1436 LModI* mod = new(zone()) LModI(UseRegister(left), |
1435 UseRegister(right), | 1437 UseRegister(right), |
1436 TempRegister(), | 1438 TempRegister(), |
1437 FixedTemp(f20), | 1439 FixedTemp(f20), |
1438 FixedTemp(f22)); | 1440 FixedTemp(f22)); |
1439 LInstruction* result = DefineAsRegister(mod); | 1441 LInstruction* result = DefineAsRegister(mod); |
1440 return (right->CanBeZero() || | 1442 return (right->CanBeZero() || |
1441 (left->RangeCanInclude(kMinInt) && | 1443 (left->RangeCanInclude(kMinInt) && |
1442 right->RangeCanInclude(-1)) || | 1444 right->RangeCanInclude(-1)) || |
1443 instr->CheckFlag(HValue::kBailoutOnMinusZero)) | 1445 instr->CheckFlag(HValue::kBailoutOnMinusZero)) |
1444 ? AssignEnvironment(result) | 1446 ? AssignEnvironment(result) |
1445 : result; | 1447 : result; |
1446 } | 1448 } |
1447 } else if (instr->representation().IsSmiOrTagged()) { | 1449 } else if (instr->representation().IsTagged()) { |
1448 return DoArithmeticT(Token::MOD, instr); | 1450 return DoArithmeticT(Token::MOD, instr); |
1449 } else { | 1451 } else { |
1450 ASSERT(instr->representation().IsDouble()); | 1452 ASSERT(instr->representation().IsDouble()); |
1451 // We call a C function for double modulo. It can't trigger a GC. We need | 1453 // We call a C function for double modulo. It can't trigger a GC. We need |
1452 // to use fixed result register for the call. | 1454 // to use fixed result register for the call. |
1453 // TODO(fschneider): Allow any register as input registers. | 1455 // TODO(fschneider): Allow any register as input registers. |
1454 LArithmeticD* mod = new(zone()) LArithmeticD(Token::MOD, | 1456 LArithmeticD* mod = new(zone()) LArithmeticD(Token::MOD, |
1455 UseFixedDouble(left, f2), | 1457 UseFixedDouble(left, f2), |
1456 UseFixedDouble(right, f4)); | 1458 UseFixedDouble(right, f4)); |
1457 return MarkAsCall(DefineFixedDouble(mod, f2), instr); | 1459 return MarkAsCall(DefineFixedDouble(mod, f2), instr); |
1458 } | 1460 } |
1459 } | 1461 } |
1460 | 1462 |
1461 | 1463 |
1462 LInstruction* LChunkBuilder::DoMul(HMul* instr) { | 1464 LInstruction* LChunkBuilder::DoMul(HMul* instr) { |
1463 if (instr->representation().IsInteger32()) { | 1465 if (instr->representation().IsSmiOrInteger32()) { |
1464 ASSERT(instr->left()->representation().IsInteger32()); | 1466 ASSERT(instr->left()->representation().Equals(instr->representation())); |
1465 ASSERT(instr->right()->representation().IsInteger32()); | 1467 ASSERT(instr->right()->representation().Equals(instr->representation())); |
1466 LOperand* left; | 1468 LOperand* left; |
1467 LOperand* right = UseOrConstant(instr->BetterRightOperand()); | 1469 LOperand* right = UseOrConstant(instr->BetterRightOperand()); |
1468 LOperand* temp = NULL; | 1470 LOperand* temp = NULL; |
1469 if (instr->CheckFlag(HValue::kBailoutOnMinusZero) && | 1471 if (instr->CheckFlag(HValue::kBailoutOnMinusZero) && |
1470 (instr->CheckFlag(HValue::kCanOverflow) || | 1472 (instr->CheckFlag(HValue::kCanOverflow) || |
1471 !right->IsConstantOperand())) { | 1473 !right->IsConstantOperand())) { |
1472 left = UseRegister(instr->BetterLeftOperand()); | 1474 left = UseRegister(instr->BetterLeftOperand()); |
1473 temp = TempRegister(); | 1475 temp = TempRegister(); |
1474 } else { | 1476 } else { |
1475 left = UseRegisterAtStart(instr->BetterLeftOperand()); | 1477 left = UseRegisterAtStart(instr->BetterLeftOperand()); |
(...skipping 22 matching lines...) Expand all Loading... |
1498 } | 1500 } |
1499 } | 1501 } |
1500 return DoArithmeticD(Token::MUL, instr); | 1502 return DoArithmeticD(Token::MUL, instr); |
1501 } else { | 1503 } else { |
1502 return DoArithmeticT(Token::MUL, instr); | 1504 return DoArithmeticT(Token::MUL, instr); |
1503 } | 1505 } |
1504 } | 1506 } |
1505 | 1507 |
1506 | 1508 |
1507 LInstruction* LChunkBuilder::DoSub(HSub* instr) { | 1509 LInstruction* LChunkBuilder::DoSub(HSub* instr) { |
1508 if (instr->representation().IsInteger32()) { | 1510 if (instr->representation().IsSmiOrInteger32()) { |
1509 ASSERT(instr->left()->representation().IsInteger32()); | 1511 ASSERT(instr->left()->representation().Equals(instr->representation())); |
1510 ASSERT(instr->right()->representation().IsInteger32()); | 1512 ASSERT(instr->right()->representation().Equals(instr->representation())); |
1511 LOperand* left = UseRegisterAtStart(instr->left()); | 1513 LOperand* left = UseRegisterAtStart(instr->left()); |
1512 LOperand* right = UseOrConstantAtStart(instr->right()); | 1514 LOperand* right = UseOrConstantAtStart(instr->right()); |
1513 LSubI* sub = new(zone()) LSubI(left, right); | 1515 LSubI* sub = new(zone()) LSubI(left, right); |
1514 LInstruction* result = DefineAsRegister(sub); | 1516 LInstruction* result = DefineAsRegister(sub); |
1515 if (instr->CheckFlag(HValue::kCanOverflow)) { | 1517 if (instr->CheckFlag(HValue::kCanOverflow)) { |
1516 result = AssignEnvironment(result); | 1518 result = AssignEnvironment(result); |
1517 } | 1519 } |
1518 return result; | 1520 return result; |
1519 } else if (instr->representation().IsDouble()) { | 1521 } else if (instr->representation().IsDouble()) { |
1520 return DoArithmeticD(Token::SUB, instr); | 1522 return DoArithmeticD(Token::SUB, instr); |
1521 } else { | 1523 } else { |
1522 return DoArithmeticT(Token::SUB, instr); | 1524 return DoArithmeticT(Token::SUB, instr); |
1523 } | 1525 } |
1524 } | 1526 } |
1525 | 1527 |
1526 | 1528 |
1527 LInstruction* LChunkBuilder::DoMultiplyAdd(HMul* mul, HValue* addend) { | 1529 LInstruction* LChunkBuilder::DoMultiplyAdd(HMul* mul, HValue* addend) { |
1528 LOperand* multiplier_op = UseRegisterAtStart(mul->left()); | 1530 LOperand* multiplier_op = UseRegisterAtStart(mul->left()); |
1529 LOperand* multiplicand_op = UseRegisterAtStart(mul->right()); | 1531 LOperand* multiplicand_op = UseRegisterAtStart(mul->right()); |
1530 LOperand* addend_op = UseRegisterAtStart(addend); | 1532 LOperand* addend_op = UseRegisterAtStart(addend); |
1531 return DefineSameAsFirst(new(zone()) LMultiplyAddD(addend_op, multiplier_op, | 1533 return DefineSameAsFirst(new(zone()) LMultiplyAddD(addend_op, multiplier_op, |
1532 multiplicand_op)); | 1534 multiplicand_op)); |
1533 } | 1535 } |
1534 | 1536 |
1535 | 1537 |
1536 LInstruction* LChunkBuilder::DoAdd(HAdd* instr) { | 1538 LInstruction* LChunkBuilder::DoAdd(HAdd* instr) { |
1537 if (instr->representation().IsInteger32()) { | 1539 if (instr->representation().IsSmiOrInteger32()) { |
1538 ASSERT(instr->left()->representation().IsInteger32()); | 1540 ASSERT(instr->left()->representation().Equals(instr->representation())); |
1539 ASSERT(instr->right()->representation().IsInteger32()); | 1541 ASSERT(instr->right()->representation().Equals(instr->representation())); |
1540 LOperand* left = UseRegisterAtStart(instr->BetterLeftOperand()); | 1542 LOperand* left = UseRegisterAtStart(instr->BetterLeftOperand()); |
1541 LOperand* right = UseOrConstantAtStart(instr->BetterRightOperand()); | 1543 LOperand* right = UseOrConstantAtStart(instr->BetterRightOperand()); |
1542 LAddI* add = new(zone()) LAddI(left, right); | 1544 LAddI* add = new(zone()) LAddI(left, right); |
1543 LInstruction* result = DefineAsRegister(add); | 1545 LInstruction* result = DefineAsRegister(add); |
1544 if (instr->CheckFlag(HValue::kCanOverflow)) { | 1546 if (instr->CheckFlag(HValue::kCanOverflow)) { |
1545 result = AssignEnvironment(result); | 1547 result = AssignEnvironment(result); |
1546 } | 1548 } |
1547 return result; | 1549 return result; |
1548 } else if (instr->representation().IsDouble()) { | 1550 } else if (instr->representation().IsDouble()) { |
1549 if (kArchVariant == kMips32r2) { | 1551 if (kArchVariant == kMips32r2) { |
1550 if (instr->left()->IsMul()) | 1552 if (instr->left()->IsMul()) |
1551 return DoMultiplyAdd(HMul::cast(instr->left()), instr->right()); | 1553 return DoMultiplyAdd(HMul::cast(instr->left()), instr->right()); |
1552 | 1554 |
1553 if (instr->right()->IsMul()) { | 1555 if (instr->right()->IsMul()) { |
1554 ASSERT(!instr->left()->IsMul()); | 1556 ASSERT(!instr->left()->IsMul()); |
1555 return DoMultiplyAdd(HMul::cast(instr->right()), instr->left()); | 1557 return DoMultiplyAdd(HMul::cast(instr->right()), instr->left()); |
1556 } | 1558 } |
1557 } | 1559 } |
1558 return DoArithmeticD(Token::ADD, instr); | 1560 return DoArithmeticD(Token::ADD, instr); |
1559 } else { | 1561 } else { |
1560 ASSERT(instr->representation().IsSmiOrTagged()); | 1562 ASSERT(instr->representation().IsTagged()); |
1561 return DoArithmeticT(Token::ADD, instr); | 1563 return DoArithmeticT(Token::ADD, instr); |
1562 } | 1564 } |
1563 } | 1565 } |
1564 | 1566 |
1565 | 1567 |
1566 LInstruction* LChunkBuilder::DoMathMinMax(HMathMinMax* instr) { | 1568 LInstruction* LChunkBuilder::DoMathMinMax(HMathMinMax* instr) { |
1567 LOperand* left = NULL; | 1569 LOperand* left = NULL; |
1568 LOperand* right = NULL; | 1570 LOperand* right = NULL; |
1569 if (instr->representation().IsInteger32()) { | 1571 if (instr->representation().IsSmiOrInteger32()) { |
1570 ASSERT(instr->left()->representation().IsInteger32()); | 1572 ASSERT(instr->left()->representation().Equals(instr->representation())); |
1571 ASSERT(instr->right()->representation().IsInteger32()); | 1573 ASSERT(instr->right()->representation().Equals(instr->representation())); |
1572 left = UseRegisterAtStart(instr->BetterLeftOperand()); | 1574 left = UseRegisterAtStart(instr->BetterLeftOperand()); |
1573 right = UseOrConstantAtStart(instr->BetterRightOperand()); | 1575 right = UseOrConstantAtStart(instr->BetterRightOperand()); |
1574 } else { | 1576 } else { |
1575 ASSERT(instr->representation().IsDouble()); | 1577 ASSERT(instr->representation().IsDouble()); |
1576 ASSERT(instr->left()->representation().IsDouble()); | 1578 ASSERT(instr->left()->representation().IsDouble()); |
1577 ASSERT(instr->right()->representation().IsDouble()); | 1579 ASSERT(instr->right()->representation().IsDouble()); |
1578 left = UseRegisterAtStart(instr->left()); | 1580 left = UseRegisterAtStart(instr->left()); |
1579 right = UseRegisterAtStart(instr->right()); | 1581 right = UseRegisterAtStart(instr->right()); |
1580 } | 1582 } |
1581 return DefineAsRegister(new(zone()) LMathMinMax(left, right)); | 1583 return DefineAsRegister(new(zone()) LMathMinMax(left, right)); |
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2116 | 2118 |
2117 | 2119 |
2118 LInstruction* LChunkBuilder::DoLoadExternalArrayPointer( | 2120 LInstruction* LChunkBuilder::DoLoadExternalArrayPointer( |
2119 HLoadExternalArrayPointer* instr) { | 2121 HLoadExternalArrayPointer* instr) { |
2120 LOperand* input = UseRegisterAtStart(instr->value()); | 2122 LOperand* input = UseRegisterAtStart(instr->value()); |
2121 return DefineAsRegister(new(zone()) LLoadExternalArrayPointer(input)); | 2123 return DefineAsRegister(new(zone()) LLoadExternalArrayPointer(input)); |
2122 } | 2124 } |
2123 | 2125 |
2124 | 2126 |
2125 LInstruction* LChunkBuilder::DoLoadKeyed(HLoadKeyed* instr) { | 2127 LInstruction* LChunkBuilder::DoLoadKeyed(HLoadKeyed* instr) { |
2126 ASSERT(instr->key()->representation().IsInteger32() || | 2128 ASSERT(instr->key()->representation().IsSmiOrInteger32()); |
2127 instr->key()->representation().IsSmi()); | |
2128 ElementsKind elements_kind = instr->elements_kind(); | 2129 ElementsKind elements_kind = instr->elements_kind(); |
2129 LOperand* key = UseRegisterOrConstantAtStart(instr->key()); | 2130 LOperand* key = UseRegisterOrConstantAtStart(instr->key()); |
2130 LLoadKeyed* result = NULL; | 2131 LLoadKeyed* result = NULL; |
2131 | 2132 |
2132 if (!instr->is_external()) { | 2133 if (!instr->is_external()) { |
2133 LOperand* obj = NULL; | 2134 LOperand* obj = NULL; |
2134 if (instr->representation().IsDouble()) { | 2135 if (instr->representation().IsDouble()) { |
2135 obj = UseTempRegister(instr->elements()); | 2136 obj = UseTempRegister(instr->elements()); |
2136 } else { | 2137 } else { |
2137 ASSERT(instr->representation().IsSmiOrTagged()); | 2138 ASSERT(instr->representation().IsSmiOrTagged()); |
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2558 | 2559 |
2559 | 2560 |
2560 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2561 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2561 LOperand* object = UseRegister(instr->object()); | 2562 LOperand* object = UseRegister(instr->object()); |
2562 LOperand* index = UseRegister(instr->index()); | 2563 LOperand* index = UseRegister(instr->index()); |
2563 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); | 2564 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); |
2564 } | 2565 } |
2565 | 2566 |
2566 | 2567 |
2567 } } // namespace v8::internal | 2568 } } // namespace v8::internal |
OLD | NEW |