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 2733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2744 STATIC_ASSERT(kSmiTag == 0); | 2744 STATIC_ASSERT(kSmiTag == 0); |
2745 TestIfSmi(object, r0); | 2745 TestIfSmi(object, r0); |
2746 Check(ne, kOperandIsASmiAndNotABoundFunction, cr0); | 2746 Check(ne, kOperandIsASmiAndNotABoundFunction, cr0); |
2747 push(object); | 2747 push(object); |
2748 CompareObjectType(object, object, object, JS_BOUND_FUNCTION_TYPE); | 2748 CompareObjectType(object, object, object, JS_BOUND_FUNCTION_TYPE); |
2749 pop(object); | 2749 pop(object); |
2750 Check(eq, kOperandIsNotABoundFunction); | 2750 Check(eq, kOperandIsNotABoundFunction); |
2751 } | 2751 } |
2752 } | 2752 } |
2753 | 2753 |
| 2754 void MacroAssembler::AssertReceiver(Register object) { |
| 2755 if (emit_debug_code()) { |
| 2756 STATIC_ASSERT(kSmiTag == 0); |
| 2757 TestIfSmi(object, r0); |
| 2758 Check(ne, kOperandIsASmiAndNotAReceiver, cr0); |
| 2759 push(object); |
| 2760 STATIC_ASSERT(LAST_TYPE == LAST_JS_RECEIVER_TYPE); |
| 2761 CompareObjectType(object, object, object, FIRST_JS_RECEIVER_TYPE); |
| 2762 pop(object); |
| 2763 Check(ge, kOperandIsNotAReceiver); |
| 2764 } |
| 2765 } |
2754 | 2766 |
2755 void MacroAssembler::AssertUndefinedOrAllocationSite(Register object, | 2767 void MacroAssembler::AssertUndefinedOrAllocationSite(Register object, |
2756 Register scratch) { | 2768 Register scratch) { |
2757 if (emit_debug_code()) { | 2769 if (emit_debug_code()) { |
2758 Label done_checking; | 2770 Label done_checking; |
2759 AssertNotSmi(object); | 2771 AssertNotSmi(object); |
2760 CompareRoot(object, Heap::kUndefinedValueRootIndex); | 2772 CompareRoot(object, Heap::kUndefinedValueRootIndex); |
2761 beq(&done_checking); | 2773 beq(&done_checking); |
2762 LoadP(scratch, FieldMemOperand(object, HeapObject::kMapOffset)); | 2774 LoadP(scratch, FieldMemOperand(object, HeapObject::kMapOffset)); |
2763 CompareRoot(scratch, Heap::kAllocationSiteMapRootIndex); | 2775 CompareRoot(scratch, Heap::kAllocationSiteMapRootIndex); |
(...skipping 1624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4388 } | 4400 } |
4389 if (mag.shift > 0) srawi(result, result, mag.shift); | 4401 if (mag.shift > 0) srawi(result, result, mag.shift); |
4390 ExtractBit(r0, dividend, 31); | 4402 ExtractBit(r0, dividend, 31); |
4391 add(result, result, r0); | 4403 add(result, result, r0); |
4392 } | 4404 } |
4393 | 4405 |
4394 } // namespace internal | 4406 } // namespace internal |
4395 } // namespace v8 | 4407 } // namespace v8 |
4396 | 4408 |
4397 #endif // V8_TARGET_ARCH_PPC | 4409 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |