OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/crankshaft/ppc/lithium-codegen-ppc.h" | 5 #include "src/crankshaft/ppc/lithium-codegen-ppc.h" |
6 | 6 |
7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/builtins/builtins-constructor.h" | 8 #include "src/builtins/builtins-constructor.h" |
9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 1689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1700 const bool isInteger = !instr->hydrogen()->representation().IsSmi(); | 1700 const bool isInteger = !instr->hydrogen()->representation().IsSmi(); |
1701 #else | 1701 #else |
1702 const bool isInteger = false; | 1702 const bool isInteger = false; |
1703 #endif | 1703 #endif |
1704 if (!can_overflow || isInteger) { | 1704 if (!can_overflow || isInteger) { |
1705 if (right->IsConstantOperand()) { | 1705 if (right->IsConstantOperand()) { |
1706 __ Add(result, left, -(ToOperand(right).immediate()), r0); | 1706 __ Add(result, left, -(ToOperand(right).immediate()), r0); |
1707 } else { | 1707 } else { |
1708 __ sub(result, left, EmitLoadRegister(right, ip)); | 1708 __ sub(result, left, EmitLoadRegister(right, ip)); |
1709 } | 1709 } |
| 1710 if (can_overflow) { |
1710 #if V8_TARGET_ARCH_PPC64 | 1711 #if V8_TARGET_ARCH_PPC64 |
1711 if (can_overflow) { | |
1712 __ TestIfInt32(result, r0); | 1712 __ TestIfInt32(result, r0); |
| 1713 #else |
| 1714 __ TestIfInt32(scratch0(), result, r0); |
| 1715 #endif |
1713 DeoptimizeIf(ne, instr, DeoptimizeReason::kOverflow); | 1716 DeoptimizeIf(ne, instr, DeoptimizeReason::kOverflow); |
1714 } | 1717 } |
1715 #endif | 1718 |
1716 } else { | 1719 } else { |
1717 if (right->IsConstantOperand()) { | 1720 if (right->IsConstantOperand()) { |
1718 __ AddAndCheckForOverflow(result, left, -(ToOperand(right).immediate()), | 1721 __ AddAndCheckForOverflow(result, left, -(ToOperand(right).immediate()), |
1719 scratch0(), r0); | 1722 scratch0(), r0); |
1720 } else { | 1723 } else { |
1721 __ SubAndCheckForOverflow(result, left, EmitLoadRegister(right, ip), | 1724 __ SubAndCheckForOverflow(result, left, EmitLoadRegister(right, ip), |
1722 scratch0(), r0); | 1725 scratch0(), r0); |
1723 } | 1726 } |
1724 DeoptimizeIf(lt, instr, DeoptimizeReason::kOverflow, cr0); | 1727 DeoptimizeIf(lt, instr, DeoptimizeReason::kOverflow, cr0); |
1725 } | 1728 } |
(...skipping 3911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5637 __ LoadP(result, | 5640 __ LoadP(result, |
5638 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize)); | 5641 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize)); |
5639 __ bind(deferred->exit()); | 5642 __ bind(deferred->exit()); |
5640 __ bind(&done); | 5643 __ bind(&done); |
5641 } | 5644 } |
5642 | 5645 |
5643 #undef __ | 5646 #undef __ |
5644 | 5647 |
5645 } // namespace internal | 5648 } // namespace internal |
5646 } // namespace v8 | 5649 } // namespace v8 |
OLD | NEW |