| 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 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 712 } | 712 } |
| 713 | 713 |
| 714 | 714 |
| 715 LInstruction* LChunkBuilder::DoDeoptimize(HDeoptimize* instr) { | 715 LInstruction* LChunkBuilder::DoDeoptimize(HDeoptimize* instr) { |
| 716 return AssignEnvironment(new(zone()) LDeoptimize); | 716 return AssignEnvironment(new(zone()) LDeoptimize); |
| 717 } | 717 } |
| 718 | 718 |
| 719 | 719 |
| 720 LInstruction* LChunkBuilder::DoShift(Token::Value op, | 720 LInstruction* LChunkBuilder::DoShift(Token::Value op, |
| 721 HBitwiseBinaryOperation* instr) { | 721 HBitwiseBinaryOperation* instr) { |
| 722 if (instr->representation().IsSmiOrInteger32()) { | 722 if (instr->representation().IsTagged()) { |
| 723 ASSERT(instr->left()->representation().Equals(instr->representation())); | 723 ASSERT(instr->left()->representation().IsTagged()); |
| 724 ASSERT(instr->right()->representation().Equals(instr->representation())); | 724 ASSERT(instr->right()->representation().IsTagged()); |
| 725 LOperand* left = UseRegisterAtStart(instr->left()); | |
| 726 | 725 |
| 727 HValue* right_value = instr->right(); | 726 LOperand* left = UseFixed(instr->left(), rdx); |
| 728 LOperand* right = NULL; | 727 LOperand* right = UseFixed(instr->right(), rax); |
| 729 int constant_value = 0; | 728 LArithmeticT* result = new(zone()) LArithmeticT(op, left, right); |
| 730 if (right_value->IsConstant()) { | 729 return MarkAsCall(DefineFixed(result, rax), instr); |
| 731 HConstant* constant = HConstant::cast(right_value); | 730 } |
| 732 right = chunk_->DefineConstantOperand(constant); | 731 |
| 733 constant_value = constant->Integer32Value() & 0x1f; | 732 ASSERT(instr->representation().IsSmiOrInteger32()); |
| 733 ASSERT(instr->left()->representation().Equals(instr->representation())); |
| 734 ASSERT(instr->right()->representation().Equals(instr->representation())); |
| 735 LOperand* left = UseRegisterAtStart(instr->left()); |
| 736 |
| 737 HValue* right_value = instr->right(); |
| 738 LOperand* right = NULL; |
| 739 int constant_value = 0; |
| 740 if (right_value->IsConstant()) { |
| 741 HConstant* constant = HConstant::cast(right_value); |
| 742 right = chunk_->DefineConstantOperand(constant); |
| 743 constant_value = constant->Integer32Value() & 0x1f; |
| 744 } else { |
| 745 right = UseFixed(right_value, rcx); |
| 746 } |
| 747 |
| 748 // Shift operations can only deoptimize if we do a logical shift by 0 and |
| 749 // the result cannot be truncated to int32. |
| 750 bool does_deopt = false; |
| 751 if (op == Token::SHR && constant_value == 0) { |
| 752 if (FLAG_opt_safe_uint32_operations) { |
| 753 does_deopt = !instr->CheckFlag(HInstruction::kUint32); |
| 734 } else { | 754 } else { |
| 735 right = UseFixed(right_value, rcx); | 755 does_deopt = !instr->CheckUsesForFlag(HValue::kTruncatingToInt32); |
| 736 } | 756 } |
| 757 } |
| 737 | 758 |
| 738 // Shift operations can only deoptimize if we do a logical shift by 0 and | 759 LInstruction* result = |
| 739 // the result cannot be truncated to int32. | 760 DefineSameAsFirst(new(zone()) LShiftI(op, left, right, does_deopt)); |
| 740 bool does_deopt = false; | 761 return does_deopt ? AssignEnvironment(result) : result; |
| 741 if (op == Token::SHR && constant_value == 0) { | |
| 742 if (FLAG_opt_safe_uint32_operations) { | |
| 743 does_deopt = !instr->CheckFlag(HInstruction::kUint32); | |
| 744 } else { | |
| 745 does_deopt = !instr->CheckUsesForFlag(HValue::kTruncatingToInt32); | |
| 746 } | |
| 747 } | |
| 748 | |
| 749 LInstruction* result = | |
| 750 DefineSameAsFirst(new(zone()) LShiftI(op, left, right, does_deopt)); | |
| 751 return does_deopt ? AssignEnvironment(result) : result; | |
| 752 } else { | |
| 753 return DoArithmeticT(op, instr); | |
| 754 } | |
| 755 } | 762 } |
| 756 | 763 |
| 757 | 764 |
| 758 LInstruction* LChunkBuilder::DoArithmeticD(Token::Value op, | 765 LInstruction* LChunkBuilder::DoArithmeticD(Token::Value op, |
| 759 HArithmeticBinaryOperation* instr) { | 766 HArithmeticBinaryOperation* instr) { |
| 760 ASSERT(instr->representation().IsDouble()); | 767 ASSERT(instr->representation().IsDouble()); |
| 761 ASSERT(instr->left()->representation().IsDouble()); | 768 ASSERT(instr->left()->representation().IsDouble()); |
| 762 ASSERT(instr->right()->representation().IsDouble()); | 769 ASSERT(instr->right()->representation().IsDouble()); |
| 763 if (op == Token::MOD) { | 770 ASSERT(op != Token::MOD); |
| 764 LOperand* left = UseRegisterAtStart(instr->BetterLeftOperand()); | 771 LOperand* left = UseRegisterAtStart(instr->BetterLeftOperand()); |
| 765 LOperand* right = UseFixedDouble(instr->BetterRightOperand(), xmm1); | 772 LOperand* right = UseRegisterAtStart(instr->BetterRightOperand()); |
| 766 LArithmeticD* result = new(zone()) LArithmeticD(op, left, right); | 773 LArithmeticD* result = new(zone()) LArithmeticD(op, left, right); |
| 767 return MarkAsCall(DefineSameAsFirst(result), instr); | 774 return DefineSameAsFirst(result); |
| 768 } else { | |
| 769 LOperand* left = UseRegisterAtStart(instr->BetterLeftOperand()); | |
| 770 LOperand* right = UseRegisterAtStart(instr->BetterRightOperand()); | |
| 771 LArithmeticD* result = new(zone()) LArithmeticD(op, left, right); | |
| 772 return DefineSameAsFirst(result); | |
| 773 } | |
| 774 } | 775 } |
| 775 | 776 |
| 776 | 777 |
| 777 LInstruction* LChunkBuilder::DoArithmeticT(Token::Value op, | 778 LInstruction* LChunkBuilder::DoArithmeticT(Token::Value op, |
| 778 HBinaryOperation* instr) { | 779 HArithmeticBinaryOperation* instr) { |
| 780 ASSERT(op == Token::ADD || |
| 781 op == Token::DIV || |
| 782 op == Token::MOD || |
| 783 op == Token::MUL || |
| 784 op == Token::SUB); |
| 779 HValue* left = instr->left(); | 785 HValue* left = instr->left(); |
| 780 HValue* right = instr->right(); | 786 HValue* right = instr->right(); |
| 781 ASSERT(left->representation().IsTagged()); | 787 ASSERT(left->representation().IsTagged()); |
| 782 ASSERT(right->representation().IsTagged()); | 788 ASSERT(right->representation().IsTagged()); |
| 783 LOperand* left_operand = UseFixed(left, rdx); | 789 LOperand* left_operand = UseFixed(left, rdx); |
| 784 LOperand* right_operand = UseFixed(right, rax); | 790 LOperand* right_operand = UseFixed(right, rax); |
| 785 LArithmeticT* result = | 791 LArithmeticT* result = |
| 786 new(zone()) LArithmeticT(op, left_operand, right_operand); | 792 new(zone()) LArithmeticT(op, left_operand, right_operand); |
| 787 return MarkAsCall(DefineFixed(result, rax), instr); | 793 return MarkAsCall(DefineFixed(result, rax), instr); |
| 788 } | 794 } |
| (...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1335 | 1341 |
| 1336 LInstruction* LChunkBuilder::DoShl(HShl* instr) { | 1342 LInstruction* LChunkBuilder::DoShl(HShl* instr) { |
| 1337 return DoShift(Token::SHL, instr); | 1343 return DoShift(Token::SHL, instr); |
| 1338 } | 1344 } |
| 1339 | 1345 |
| 1340 | 1346 |
| 1341 LInstruction* LChunkBuilder::DoBitwise(HBitwise* instr) { | 1347 LInstruction* LChunkBuilder::DoBitwise(HBitwise* instr) { |
| 1342 if (instr->representation().IsSmiOrInteger32()) { | 1348 if (instr->representation().IsSmiOrInteger32()) { |
| 1343 ASSERT(instr->left()->representation().Equals(instr->representation())); | 1349 ASSERT(instr->left()->representation().Equals(instr->representation())); |
| 1344 ASSERT(instr->right()->representation().Equals(instr->representation())); | 1350 ASSERT(instr->right()->representation().Equals(instr->representation())); |
| 1345 ASSERT(instr->CheckFlag(HValue::kTruncatingToInt32)); | |
| 1346 | 1351 |
| 1347 LOperand* left = UseRegisterAtStart(instr->BetterLeftOperand()); | 1352 LOperand* left = UseRegisterAtStart(instr->BetterLeftOperand()); |
| 1348 LOperand* right = UseOrConstantAtStart(instr->BetterRightOperand()); | 1353 LOperand* right = UseOrConstantAtStart(instr->BetterRightOperand()); |
| 1349 return DefineSameAsFirst(new(zone()) LBitI(left, right)); | 1354 return DefineSameAsFirst(new(zone()) LBitI(left, right)); |
| 1350 } else { | 1355 } else { |
| 1351 return DoArithmeticT(instr->op(), instr); | 1356 ASSERT(instr->representation().IsTagged()); |
| 1357 ASSERT(instr->left()->representation().IsTagged()); |
| 1358 ASSERT(instr->right()->representation().IsTagged()); |
| 1359 |
| 1360 LOperand* left = UseFixed(instr->left(), rdx); |
| 1361 LOperand* right = UseFixed(instr->right(), rax); |
| 1362 LArithmeticT* result = new(zone()) LArithmeticT(instr->op(), left, right); |
| 1363 return MarkAsCall(DefineFixed(result, rax), instr); |
| 1352 } | 1364 } |
| 1353 } | 1365 } |
| 1354 | 1366 |
| 1355 | 1367 |
| 1356 LInstruction* LChunkBuilder::DoDiv(HDiv* instr) { | 1368 LInstruction* LChunkBuilder::DoDiv(HDiv* instr) { |
| 1357 if (instr->representation().IsSmiOrInteger32()) { | 1369 if (instr->representation().IsDouble()) { |
| 1370 return DoArithmeticD(Token::DIV, instr); |
| 1371 } else if (instr->representation().IsSmiOrInteger32()) { |
| 1358 ASSERT(instr->left()->representation().Equals(instr->representation())); | 1372 ASSERT(instr->left()->representation().Equals(instr->representation())); |
| 1359 ASSERT(instr->right()->representation().Equals(instr->representation())); | 1373 ASSERT(instr->right()->representation().Equals(instr->representation())); |
| 1360 if (instr->HasPowerOf2Divisor()) { | 1374 if (instr->HasPowerOf2Divisor()) { |
| 1361 ASSERT(!instr->CheckFlag(HValue::kCanBeDivByZero)); | 1375 ASSERT(!instr->CheckFlag(HValue::kCanBeDivByZero)); |
| 1362 LOperand* value = UseRegisterAtStart(instr->left()); | 1376 LOperand* value = UseRegisterAtStart(instr->left()); |
| 1363 LDivI* div = | 1377 LDivI* div = |
| 1364 new(zone()) LDivI(value, UseOrConstant(instr->right()), NULL); | 1378 new(zone()) LDivI(value, UseOrConstant(instr->right()), NULL); |
| 1365 return AssignEnvironment(DefineSameAsFirst(div)); | 1379 return AssignEnvironment(DefineSameAsFirst(div)); |
| 1366 } | 1380 } |
| 1367 // The temporary operand is necessary to ensure that right is not allocated | 1381 // The temporary operand is necessary to ensure that right is not allocated |
| 1368 // into rdx. | 1382 // into rdx. |
| 1369 LOperand* temp = FixedTemp(rdx); | 1383 LOperand* temp = FixedTemp(rdx); |
| 1370 LOperand* dividend = UseFixed(instr->left(), rax); | 1384 LOperand* dividend = UseFixed(instr->left(), rax); |
| 1371 LOperand* divisor = UseRegister(instr->right()); | 1385 LOperand* divisor = UseRegister(instr->right()); |
| 1372 LDivI* result = new(zone()) LDivI(dividend, divisor, temp); | 1386 LDivI* result = new(zone()) LDivI(dividend, divisor, temp); |
| 1373 return AssignEnvironment(DefineFixed(result, rax)); | 1387 return AssignEnvironment(DefineFixed(result, rax)); |
| 1374 } else if (instr->representation().IsDouble()) { | |
| 1375 return DoArithmeticD(Token::DIV, instr); | |
| 1376 } else { | 1388 } else { |
| 1389 ASSERT(instr->representation().IsTagged()); |
| 1377 return DoArithmeticT(Token::DIV, instr); | 1390 return DoArithmeticT(Token::DIV, instr); |
| 1378 } | 1391 } |
| 1379 } | 1392 } |
| 1380 | 1393 |
| 1381 | 1394 |
| 1382 HValue* LChunkBuilder::SimplifiedDivisorForMathFloorOfDiv(HValue* divisor) { | 1395 HValue* LChunkBuilder::SimplifiedDivisorForMathFloorOfDiv(HValue* divisor) { |
| 1383 if (divisor->IsConstant() && | 1396 if (divisor->IsConstant() && |
| 1384 HConstant::cast(divisor)->HasInteger32Value()) { | 1397 HConstant::cast(divisor)->HasInteger32Value()) { |
| 1385 HConstant* constant_val = HConstant::cast(divisor); | 1398 HConstant* constant_val = HConstant::cast(divisor); |
| 1386 return constant_val->CopyToRepresentation(Representation::Integer32(), | 1399 return constant_val->CopyToRepresentation(Representation::Integer32(), |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1465 return (right->CanBeZero() || | 1478 return (right->CanBeZero() || |
| 1466 (left->RangeCanInclude(kMinInt) && | 1479 (left->RangeCanInclude(kMinInt) && |
| 1467 right->RangeCanInclude(-1) && | 1480 right->RangeCanInclude(-1) && |
| 1468 instr->CheckFlag(HValue::kBailoutOnMinusZero)) || | 1481 instr->CheckFlag(HValue::kBailoutOnMinusZero)) || |
| 1469 (left->CanBeNegative() && | 1482 (left->CanBeNegative() && |
| 1470 instr->CanBeZero() && | 1483 instr->CanBeZero() && |
| 1471 instr->CheckFlag(HValue::kBailoutOnMinusZero))) | 1484 instr->CheckFlag(HValue::kBailoutOnMinusZero))) |
| 1472 ? AssignEnvironment(result) | 1485 ? AssignEnvironment(result) |
| 1473 : result; | 1486 : result; |
| 1474 } | 1487 } |
| 1475 } else if (instr->representation().IsDouble()) { | 1488 } else if (instr->representation().IsTagged()) { |
| 1476 return DoArithmeticD(Token::MOD, instr); | 1489 return DoArithmeticT(Token::MOD, instr); |
| 1477 } else { | 1490 } else { |
| 1478 return DoArithmeticT(Token::MOD, instr); | 1491 ASSERT(instr->representation().IsDouble()); |
| 1492 // We call a C function for double modulo. It can't trigger a GC. We need to |
| 1493 // use fixed result register for the call. |
| 1494 // TODO(fschneider): Allow any register as input registers. |
| 1495 LArithmeticD* mod = new(zone()) LArithmeticD(Token::MOD, |
| 1496 UseFixedDouble(left, xmm2), |
| 1497 UseFixedDouble(right, xmm1)); |
| 1498 return MarkAsCall(DefineFixedDouble(mod, xmm1), instr); |
| 1479 } | 1499 } |
| 1480 } | 1500 } |
| 1481 | 1501 |
| 1482 | 1502 |
| 1483 LInstruction* LChunkBuilder::DoMul(HMul* instr) { | 1503 LInstruction* LChunkBuilder::DoMul(HMul* instr) { |
| 1484 if (instr->representation().IsSmiOrInteger32()) { | 1504 if (instr->representation().IsSmiOrInteger32()) { |
| 1485 ASSERT(instr->left()->representation().Equals(instr->representation())); | 1505 ASSERT(instr->left()->representation().Equals(instr->representation())); |
| 1486 ASSERT(instr->right()->representation().Equals(instr->representation())); | 1506 ASSERT(instr->right()->representation().Equals(instr->representation())); |
| 1487 LOperand* left = UseRegisterAtStart(instr->BetterLeftOperand()); | 1507 LOperand* left = UseRegisterAtStart(instr->BetterLeftOperand()); |
| 1488 LOperand* right = UseOrConstant(instr->BetterRightOperand()); | 1508 LOperand* right = UseOrConstant(instr->BetterRightOperand()); |
| 1489 LMulI* mul = new(zone()) LMulI(left, right); | 1509 LMulI* mul = new(zone()) LMulI(left, right); |
| 1490 if (instr->CheckFlag(HValue::kCanOverflow) || | 1510 if (instr->CheckFlag(HValue::kCanOverflow) || |
| 1491 instr->CheckFlag(HValue::kBailoutOnMinusZero)) { | 1511 instr->CheckFlag(HValue::kBailoutOnMinusZero)) { |
| 1492 AssignEnvironment(mul); | 1512 AssignEnvironment(mul); |
| 1493 } | 1513 } |
| 1494 return DefineSameAsFirst(mul); | 1514 return DefineSameAsFirst(mul); |
| 1495 } else if (instr->representation().IsDouble()) { | 1515 } else if (instr->representation().IsDouble()) { |
| 1496 return DoArithmeticD(Token::MUL, instr); | 1516 return DoArithmeticD(Token::MUL, instr); |
| 1497 } else { | 1517 } else { |
| 1518 ASSERT(instr->representation().IsTagged()); |
| 1498 return DoArithmeticT(Token::MUL, instr); | 1519 return DoArithmeticT(Token::MUL, instr); |
| 1499 } | 1520 } |
| 1500 } | 1521 } |
| 1501 | 1522 |
| 1502 | 1523 |
| 1503 LInstruction* LChunkBuilder::DoSub(HSub* instr) { | 1524 LInstruction* LChunkBuilder::DoSub(HSub* instr) { |
| 1504 if (instr->representation().IsSmiOrInteger32()) { | 1525 if (instr->representation().IsSmiOrInteger32()) { |
| 1505 ASSERT(instr->left()->representation().Equals(instr->representation())); | 1526 ASSERT(instr->left()->representation().Equals(instr->representation())); |
| 1506 ASSERT(instr->right()->representation().Equals(instr->representation())); | 1527 ASSERT(instr->right()->representation().Equals(instr->representation())); |
| 1507 LOperand* left = UseRegisterAtStart(instr->left()); | 1528 LOperand* left = UseRegisterAtStart(instr->left()); |
| 1508 LOperand* right = UseOrConstantAtStart(instr->right()); | 1529 LOperand* right = UseOrConstantAtStart(instr->right()); |
| 1509 LSubI* sub = new(zone()) LSubI(left, right); | 1530 LSubI* sub = new(zone()) LSubI(left, right); |
| 1510 LInstruction* result = DefineSameAsFirst(sub); | 1531 LInstruction* result = DefineSameAsFirst(sub); |
| 1511 if (instr->CheckFlag(HValue::kCanOverflow)) { | 1532 if (instr->CheckFlag(HValue::kCanOverflow)) { |
| 1512 result = AssignEnvironment(result); | 1533 result = AssignEnvironment(result); |
| 1513 } | 1534 } |
| 1514 return result; | 1535 return result; |
| 1515 } else if (instr->representation().IsDouble()) { | 1536 } else if (instr->representation().IsDouble()) { |
| 1516 return DoArithmeticD(Token::SUB, instr); | 1537 return DoArithmeticD(Token::SUB, instr); |
| 1517 } else { | 1538 } else { |
| 1539 ASSERT(instr->representation().IsTagged()); |
| 1518 return DoArithmeticT(Token::SUB, instr); | 1540 return DoArithmeticT(Token::SUB, instr); |
| 1519 } | 1541 } |
| 1520 } | 1542 } |
| 1521 | 1543 |
| 1522 | 1544 |
| 1523 LInstruction* LChunkBuilder::DoAdd(HAdd* instr) { | 1545 LInstruction* LChunkBuilder::DoAdd(HAdd* instr) { |
| 1524 if (instr->representation().IsSmiOrInteger32()) { | 1546 if (instr->representation().IsSmiOrInteger32()) { |
| 1525 // Check to see if it would be advantageous to use an lea instruction rather | 1547 // Check to see if it would be advantageous to use an lea instruction rather |
| 1526 // than an add. This is the case when no overflow check is needed and there | 1548 // than an add. This is the case when no overflow check is needed and there |
| 1527 // are multiple uses of the add's inputs, so using a 3-register add will | 1549 // are multiple uses of the add's inputs, so using a 3-register add will |
| (...skipping 11 matching lines...) Expand all Loading... |
| 1539 LInstruction* result = use_lea | 1561 LInstruction* result = use_lea |
| 1540 ? DefineAsRegister(add) | 1562 ? DefineAsRegister(add) |
| 1541 : DefineSameAsFirst(add); | 1563 : DefineSameAsFirst(add); |
| 1542 if (can_overflow) { | 1564 if (can_overflow) { |
| 1543 result = AssignEnvironment(result); | 1565 result = AssignEnvironment(result); |
| 1544 } | 1566 } |
| 1545 return result; | 1567 return result; |
| 1546 } else if (instr->representation().IsDouble()) { | 1568 } else if (instr->representation().IsDouble()) { |
| 1547 return DoArithmeticD(Token::ADD, instr); | 1569 return DoArithmeticD(Token::ADD, instr); |
| 1548 } else { | 1570 } else { |
| 1571 ASSERT(instr->representation().IsTagged()); |
| 1549 return DoArithmeticT(Token::ADD, instr); | 1572 return DoArithmeticT(Token::ADD, instr); |
| 1550 } | 1573 } |
| 1551 return NULL; | 1574 return NULL; |
| 1552 } | 1575 } |
| 1553 | 1576 |
| 1554 | 1577 |
| 1555 LInstruction* LChunkBuilder::DoMathMinMax(HMathMinMax* instr) { | 1578 LInstruction* LChunkBuilder::DoMathMinMax(HMathMinMax* instr) { |
| 1556 LOperand* left = NULL; | 1579 LOperand* left = NULL; |
| 1557 LOperand* right = NULL; | 1580 LOperand* right = NULL; |
| 1558 if (instr->representation().IsSmiOrInteger32()) { | 1581 if (instr->representation().IsSmiOrInteger32()) { |
| (...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1904 return AssignEnvironment(new(zone()) LCheckNonSmi(value)); | 1927 return AssignEnvironment(new(zone()) LCheckNonSmi(value)); |
| 1905 } | 1928 } |
| 1906 | 1929 |
| 1907 | 1930 |
| 1908 LInstruction* LChunkBuilder::DoCheckSmi(HCheckSmi* instr) { | 1931 LInstruction* LChunkBuilder::DoCheckSmi(HCheckSmi* instr) { |
| 1909 LOperand* value = UseRegisterAtStart(instr->value()); | 1932 LOperand* value = UseRegisterAtStart(instr->value()); |
| 1910 return AssignEnvironment(new(zone()) LCheckSmi(value)); | 1933 return AssignEnvironment(new(zone()) LCheckSmi(value)); |
| 1911 } | 1934 } |
| 1912 | 1935 |
| 1913 | 1936 |
| 1937 LInstruction* LChunkBuilder::DoIsNumberAndBranch(HIsNumberAndBranch* instr) { |
| 1938 return new(zone()) LIsNumberAndBranch( |
| 1939 UseRegisterOrConstantAtStart(instr->value())); |
| 1940 } |
| 1941 |
| 1942 |
| 1914 LInstruction* LChunkBuilder::DoCheckInstanceType(HCheckInstanceType* instr) { | 1943 LInstruction* LChunkBuilder::DoCheckInstanceType(HCheckInstanceType* instr) { |
| 1915 LOperand* value = UseRegisterAtStart(instr->value()); | 1944 LOperand* value = UseRegisterAtStart(instr->value()); |
| 1916 LCheckInstanceType* result = new(zone()) LCheckInstanceType(value); | 1945 LCheckInstanceType* result = new(zone()) LCheckInstanceType(value); |
| 1917 return AssignEnvironment(result); | 1946 return AssignEnvironment(result); |
| 1918 } | 1947 } |
| 1919 | 1948 |
| 1920 | 1949 |
| 1921 LInstruction* LChunkBuilder::DoCheckValue(HCheckValue* instr) { | 1950 LInstruction* LChunkBuilder::DoCheckValue(HCheckValue* instr) { |
| 1922 LOperand* value = UseRegisterAtStart(instr->value()); | 1951 LOperand* value = UseRegisterAtStart(instr->value()); |
| 1923 return AssignEnvironment(new(zone()) LCheckValue(value)); | 1952 return AssignEnvironment(new(zone()) LCheckValue(value)); |
| (...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2519 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2548 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
| 2520 LOperand* object = UseRegister(instr->object()); | 2549 LOperand* object = UseRegister(instr->object()); |
| 2521 LOperand* index = UseTempRegister(instr->index()); | 2550 LOperand* index = UseTempRegister(instr->index()); |
| 2522 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); | 2551 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); |
| 2523 } | 2552 } |
| 2524 | 2553 |
| 2525 | 2554 |
| 2526 } } // namespace v8::internal | 2555 } } // namespace v8::internal |
| 2527 | 2556 |
| 2528 #endif // V8_TARGET_ARCH_X64 | 2557 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |