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 <assert.h> // For assert | 5 #include <assert.h> // For assert |
6 #include <limits.h> // For LONG_MIN, LONG_MAX. | 6 #include <limits.h> // For LONG_MIN, LONG_MAX. |
7 | 7 |
8 #if V8_TARGET_ARCH_PPC | 8 #if V8_TARGET_ARCH_PPC |
9 | 9 |
10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
(...skipping 1684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1695 | 1695 |
1696 void MacroAssembler::CompareObjectType(Register object, Register map, | 1696 void MacroAssembler::CompareObjectType(Register object, Register map, |
1697 Register type_reg, InstanceType type) { | 1697 Register type_reg, InstanceType type) { |
1698 const Register temp = type_reg.is(no_reg) ? r0 : type_reg; | 1698 const Register temp = type_reg.is(no_reg) ? r0 : type_reg; |
1699 | 1699 |
1700 LoadP(map, FieldMemOperand(object, HeapObject::kMapOffset)); | 1700 LoadP(map, FieldMemOperand(object, HeapObject::kMapOffset)); |
1701 CompareInstanceType(map, temp, type); | 1701 CompareInstanceType(map, temp, type); |
1702 } | 1702 } |
1703 | 1703 |
1704 | 1704 |
1705 void MacroAssembler::CheckObjectTypeRange(Register object, Register map, | |
1706 InstanceType min_type, | |
1707 InstanceType max_type, | |
1708 Label* false_label) { | |
1709 STATIC_ASSERT(Map::kInstanceTypeOffset < 4096); | |
1710 STATIC_ASSERT(LAST_TYPE < 256); | |
1711 LoadP(map, FieldMemOperand(object, HeapObject::kMapOffset)); | |
1712 lbz(ip, FieldMemOperand(map, Map::kInstanceTypeOffset)); | |
1713 subi(ip, ip, Operand(min_type)); | |
1714 cmpli(ip, Operand(max_type - min_type)); | |
1715 bgt(false_label); | |
1716 } | |
1717 | |
1718 | |
1719 void MacroAssembler::CompareInstanceType(Register map, Register type_reg, | 1705 void MacroAssembler::CompareInstanceType(Register map, Register type_reg, |
1720 InstanceType type) { | 1706 InstanceType type) { |
1721 STATIC_ASSERT(Map::kInstanceTypeOffset < 4096); | 1707 STATIC_ASSERT(Map::kInstanceTypeOffset < 4096); |
1722 STATIC_ASSERT(LAST_TYPE < 256); | 1708 STATIC_ASSERT(LAST_TYPE < 256); |
1723 lbz(type_reg, FieldMemOperand(map, Map::kInstanceTypeOffset)); | 1709 lbz(type_reg, FieldMemOperand(map, Map::kInstanceTypeOffset)); |
1724 cmpi(type_reg, Operand(type)); | 1710 cmpi(type_reg, Operand(type)); |
1725 } | 1711 } |
1726 | 1712 |
1727 | 1713 |
1728 void MacroAssembler::CompareRoot(Register obj, Heap::RootListIndex index) { | 1714 void MacroAssembler::CompareRoot(Register obj, Heap::RootListIndex index) { |
(...skipping 2711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4440 } | 4426 } |
4441 if (mag.shift > 0) srawi(result, result, mag.shift); | 4427 if (mag.shift > 0) srawi(result, result, mag.shift); |
4442 ExtractBit(r0, dividend, 31); | 4428 ExtractBit(r0, dividend, 31); |
4443 add(result, result, r0); | 4429 add(result, result, r0); |
4444 } | 4430 } |
4445 | 4431 |
4446 } // namespace internal | 4432 } // namespace internal |
4447 } // namespace v8 | 4433 } // namespace v8 |
4448 | 4434 |
4449 #endif // V8_TARGET_ARCH_PPC | 4435 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |