OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 <limits.h> // For LONG_MIN, LONG_MAX. | 5 #include <limits.h> // For LONG_MIN, LONG_MAX. |
6 | 6 |
7 #if V8_TARGET_ARCH_ARM | 7 #if V8_TARGET_ARCH_ARM |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/base/division-by-constant.h" | 10 #include "src/base/division-by-constant.h" |
(...skipping 2623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2634 } | 2634 } |
2635 } else { | 2635 } else { |
2636 // Slot is in the current function context. Move it into the | 2636 // Slot is in the current function context. Move it into the |
2637 // destination register in case we store into it (the write barrier | 2637 // destination register in case we store into it (the write barrier |
2638 // cannot be allowed to destroy the context in esi). | 2638 // cannot be allowed to destroy the context in esi). |
2639 mov(dst, cp); | 2639 mov(dst, cp); |
2640 } | 2640 } |
2641 } | 2641 } |
2642 | 2642 |
2643 | 2643 |
| 2644 void MacroAssembler::LoadGlobalProxy(Register dst) { |
| 2645 ldr(dst, GlobalObjectOperand()); |
| 2646 ldr(dst, FieldMemOperand(dst, GlobalObject::kGlobalProxyOffset)); |
| 2647 } |
| 2648 |
| 2649 |
2644 void MacroAssembler::LoadTransitionedArrayMapConditional( | 2650 void MacroAssembler::LoadTransitionedArrayMapConditional( |
2645 ElementsKind expected_kind, | 2651 ElementsKind expected_kind, |
2646 ElementsKind transitioned_kind, | 2652 ElementsKind transitioned_kind, |
2647 Register map_in_out, | 2653 Register map_in_out, |
2648 Register scratch, | 2654 Register scratch, |
2649 Label* no_map_match) { | 2655 Label* no_map_match) { |
2650 // Load the global or builtins object from the current context. | 2656 // Load the global or builtins object from the current context. |
2651 ldr(scratch, | 2657 ldr(scratch, |
2652 MemOperand(cp, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); | 2658 MemOperand(cp, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); |
2653 ldr(scratch, FieldMemOperand(scratch, GlobalObject::kNativeContextOffset)); | 2659 ldr(scratch, FieldMemOperand(scratch, GlobalObject::kNativeContextOffset)); |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2795 Check(ne, kOperandIsASmiAndNotAName); | 2801 Check(ne, kOperandIsASmiAndNotAName); |
2796 push(object); | 2802 push(object); |
2797 ldr(object, FieldMemOperand(object, HeapObject::kMapOffset)); | 2803 ldr(object, FieldMemOperand(object, HeapObject::kMapOffset)); |
2798 CompareInstanceType(object, object, LAST_NAME_TYPE); | 2804 CompareInstanceType(object, object, LAST_NAME_TYPE); |
2799 pop(object); | 2805 pop(object); |
2800 Check(le, kOperandIsNotAName); | 2806 Check(le, kOperandIsNotAName); |
2801 } | 2807 } |
2802 } | 2808 } |
2803 | 2809 |
2804 | 2810 |
| 2811 void MacroAssembler::AssertFunction(Register object) { |
| 2812 if (emit_debug_code()) { |
| 2813 STATIC_ASSERT(kSmiTag == 0); |
| 2814 tst(object, Operand(kSmiTagMask)); |
| 2815 Check(ne, kOperandIsASmiAndNotAFunction); |
| 2816 push(object); |
| 2817 CompareObjectType(object, object, object, JS_FUNCTION_TYPE); |
| 2818 pop(object); |
| 2819 Check(eq, kOperandIsNotAFunction); |
| 2820 } |
| 2821 } |
| 2822 |
| 2823 |
2805 void MacroAssembler::AssertUndefinedOrAllocationSite(Register object, | 2824 void MacroAssembler::AssertUndefinedOrAllocationSite(Register object, |
2806 Register scratch) { | 2825 Register scratch) { |
2807 if (emit_debug_code()) { | 2826 if (emit_debug_code()) { |
2808 Label done_checking; | 2827 Label done_checking; |
2809 AssertNotSmi(object); | 2828 AssertNotSmi(object); |
2810 CompareRoot(object, Heap::kUndefinedValueRootIndex); | 2829 CompareRoot(object, Heap::kUndefinedValueRootIndex); |
2811 b(eq, &done_checking); | 2830 b(eq, &done_checking); |
2812 ldr(scratch, FieldMemOperand(object, HeapObject::kMapOffset)); | 2831 ldr(scratch, FieldMemOperand(object, HeapObject::kMapOffset)); |
2813 CompareRoot(scratch, Heap::kAllocationSiteMapRootIndex); | 2832 CompareRoot(scratch, Heap::kAllocationSiteMapRootIndex); |
2814 Assert(eq, kExpectedUndefinedOrCell); | 2833 Assert(eq, kExpectedUndefinedOrCell); |
(...skipping 958 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3773 } | 3792 } |
3774 } | 3793 } |
3775 if (mag.shift > 0) mov(result, Operand(result, ASR, mag.shift)); | 3794 if (mag.shift > 0) mov(result, Operand(result, ASR, mag.shift)); |
3776 add(result, result, Operand(dividend, LSR, 31)); | 3795 add(result, result, Operand(dividend, LSR, 31)); |
3777 } | 3796 } |
3778 | 3797 |
3779 } // namespace internal | 3798 } // namespace internal |
3780 } // namespace v8 | 3799 } // namespace v8 |
3781 | 3800 |
3782 #endif // V8_TARGET_ARCH_ARM | 3801 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |