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 1544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1555 : UseOrConstantAtStart(right_candidate); | 1555 : UseOrConstantAtStart(right_candidate); |
1556 LAddI* add = new(zone()) LAddI(left, right); | 1556 LAddI* add = new(zone()) LAddI(left, right); |
1557 bool can_overflow = instr->CheckFlag(HValue::kCanOverflow); | 1557 bool can_overflow = instr->CheckFlag(HValue::kCanOverflow); |
1558 LInstruction* result = use_lea | 1558 LInstruction* result = use_lea |
1559 ? DefineAsRegister(add) | 1559 ? DefineAsRegister(add) |
1560 : DefineSameAsFirst(add); | 1560 : DefineSameAsFirst(add); |
1561 if (can_overflow) { | 1561 if (can_overflow) { |
1562 result = AssignEnvironment(result); | 1562 result = AssignEnvironment(result); |
1563 } | 1563 } |
1564 return result; | 1564 return result; |
| 1565 } else if (instr->representation().IsExternal()) { |
| 1566 ASSERT(instr->left()->representation().IsExternal()); |
| 1567 ASSERT(instr->right()->representation().IsInteger32()); |
| 1568 ASSERT(!instr->CheckFlag(HValue::kCanOverflow)); |
| 1569 bool use_lea = LAddI::UseLea(instr); |
| 1570 LOperand* left = UseRegisterAtStart(instr->left()); |
| 1571 HValue* right_candidate = instr->right(); |
| 1572 LOperand* right = use_lea |
| 1573 ? UseRegisterOrConstantAtStart(right_candidate) |
| 1574 : UseOrConstantAtStart(right_candidate); |
| 1575 LAddI* add = new(zone()) LAddI(left, right); |
| 1576 LInstruction* result = use_lea |
| 1577 ? DefineAsRegister(add) |
| 1578 : DefineSameAsFirst(add); |
| 1579 return result; |
1565 } else if (instr->representation().IsDouble()) { | 1580 } else if (instr->representation().IsDouble()) { |
1566 return DoArithmeticD(Token::ADD, instr); | 1581 return DoArithmeticD(Token::ADD, instr); |
1567 } else { | 1582 } else { |
1568 return DoArithmeticT(Token::ADD, instr); | 1583 return DoArithmeticT(Token::ADD, instr); |
1569 } | 1584 } |
1570 return NULL; | 1585 return NULL; |
1571 } | 1586 } |
1572 | 1587 |
1573 | 1588 |
1574 LInstruction* LChunkBuilder::DoMathMinMax(HMathMinMax* instr) { | 1589 LInstruction* LChunkBuilder::DoMathMinMax(HMathMinMax* instr) { |
(...skipping 1041 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2616 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2631 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2617 LOperand* object = UseRegister(instr->object()); | 2632 LOperand* object = UseRegister(instr->object()); |
2618 LOperand* index = UseTempRegister(instr->index()); | 2633 LOperand* index = UseTempRegister(instr->index()); |
2619 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); | 2634 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); |
2620 } | 2635 } |
2621 | 2636 |
2622 | 2637 |
2623 } } // namespace v8::internal | 2638 } } // namespace v8::internal |
2624 | 2639 |
2625 #endif // V8_TARGET_ARCH_X64 | 2640 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |