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 1539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1550 : UseOrConstantAtStart(right_candidate); | 1550 : UseOrConstantAtStart(right_candidate); |
1551 LAddI* add = new(zone()) LAddI(left, right); | 1551 LAddI* add = new(zone()) LAddI(left, right); |
1552 bool can_overflow = instr->CheckFlag(HValue::kCanOverflow); | 1552 bool can_overflow = instr->CheckFlag(HValue::kCanOverflow); |
1553 LInstruction* result = use_lea | 1553 LInstruction* result = use_lea |
1554 ? DefineAsRegister(add) | 1554 ? DefineAsRegister(add) |
1555 : DefineSameAsFirst(add); | 1555 : DefineSameAsFirst(add); |
1556 if (can_overflow) { | 1556 if (can_overflow) { |
1557 result = AssignEnvironment(result); | 1557 result = AssignEnvironment(result); |
1558 } | 1558 } |
1559 return result; | 1559 return result; |
| 1560 } else if (instr->representation().IsExternal()) { |
| 1561 ASSERT(instr->left()->representation().IsExternal()); |
| 1562 ASSERT(instr->right()->representation().IsInteger32()); |
| 1563 ASSERT(!instr->CheckFlag(HValue::kCanOverflow)); |
| 1564 bool use_lea = LAddI::UseLea(instr); |
| 1565 LOperand* left = UseRegisterAtStart(instr->left()); |
| 1566 HValue* right_candidate = instr->right(); |
| 1567 LOperand* right = use_lea |
| 1568 ? UseRegisterOrConstantAtStart(right_candidate) |
| 1569 : UseOrConstantAtStart(right_candidate); |
| 1570 LAddI* add = new(zone()) LAddI(left, right); |
| 1571 LInstruction* result = use_lea |
| 1572 ? DefineAsRegister(add) |
| 1573 : DefineSameAsFirst(add); |
| 1574 return result; |
1560 } else if (instr->representation().IsDouble()) { | 1575 } else if (instr->representation().IsDouble()) { |
1561 return DoArithmeticD(Token::ADD, instr); | 1576 return DoArithmeticD(Token::ADD, instr); |
1562 } else { | 1577 } else { |
1563 return DoArithmeticT(Token::ADD, instr); | 1578 return DoArithmeticT(Token::ADD, instr); |
1564 } | 1579 } |
1565 return NULL; | 1580 return NULL; |
1566 } | 1581 } |
1567 | 1582 |
1568 | 1583 |
1569 LInstruction* LChunkBuilder::DoMathMinMax(HMathMinMax* instr) { | 1584 LInstruction* LChunkBuilder::DoMathMinMax(HMathMinMax* instr) { |
(...skipping 1051 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2621 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2636 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2622 LOperand* object = UseRegister(instr->object()); | 2637 LOperand* object = UseRegister(instr->object()); |
2623 LOperand* index = UseTempRegister(instr->index()); | 2638 LOperand* index = UseTempRegister(instr->index()); |
2624 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); | 2639 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); |
2625 } | 2640 } |
2626 | 2641 |
2627 | 2642 |
2628 } } // namespace v8::internal | 2643 } } // namespace v8::internal |
2629 | 2644 |
2630 #endif // V8_TARGET_ARCH_X64 | 2645 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |