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 | |
2650 void MacroAssembler::LoadTransitionedArrayMapConditional( | 2644 void MacroAssembler::LoadTransitionedArrayMapConditional( |
2651 ElementsKind expected_kind, | 2645 ElementsKind expected_kind, |
2652 ElementsKind transitioned_kind, | 2646 ElementsKind transitioned_kind, |
2653 Register map_in_out, | 2647 Register map_in_out, |
2654 Register scratch, | 2648 Register scratch, |
2655 Label* no_map_match) { | 2649 Label* no_map_match) { |
2656 // Load the global or builtins object from the current context. | 2650 // Load the global or builtins object from the current context. |
2657 ldr(scratch, | 2651 ldr(scratch, |
2658 MemOperand(cp, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); | 2652 MemOperand(cp, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); |
2659 ldr(scratch, FieldMemOperand(scratch, GlobalObject::kNativeContextOffset)); | 2653 ldr(scratch, FieldMemOperand(scratch, GlobalObject::kNativeContextOffset)); |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2800 tst(object, Operand(kSmiTagMask)); | 2794 tst(object, Operand(kSmiTagMask)); |
2801 Check(ne, kOperandIsASmiAndNotAName); | 2795 Check(ne, kOperandIsASmiAndNotAName); |
2802 push(object); | 2796 push(object); |
2803 ldr(object, FieldMemOperand(object, HeapObject::kMapOffset)); | 2797 ldr(object, FieldMemOperand(object, HeapObject::kMapOffset)); |
2804 CompareInstanceType(object, object, LAST_NAME_TYPE); | 2798 CompareInstanceType(object, object, LAST_NAME_TYPE); |
2805 pop(object); | 2799 pop(object); |
2806 Check(le, kOperandIsNotAName); | 2800 Check(le, kOperandIsNotAName); |
2807 } | 2801 } |
2808 } | 2802 } |
2809 | 2803 |
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(ne, kOperandIsNotAFunction); | |
2820 } | |
2821 } | |
2822 | |
2823 | 2804 |
2824 void MacroAssembler::AssertUndefinedOrAllocationSite(Register object, | 2805 void MacroAssembler::AssertUndefinedOrAllocationSite(Register object, |
2825 Register scratch) { | 2806 Register scratch) { |
2826 if (emit_debug_code()) { | 2807 if (emit_debug_code()) { |
2827 Label done_checking; | 2808 Label done_checking; |
2828 AssertNotSmi(object); | 2809 AssertNotSmi(object); |
2829 CompareRoot(object, Heap::kUndefinedValueRootIndex); | 2810 CompareRoot(object, Heap::kUndefinedValueRootIndex); |
2830 b(eq, &done_checking); | 2811 b(eq, &done_checking); |
2831 ldr(scratch, FieldMemOperand(object, HeapObject::kMapOffset)); | 2812 ldr(scratch, FieldMemOperand(object, HeapObject::kMapOffset)); |
2832 CompareRoot(scratch, Heap::kAllocationSiteMapRootIndex); | 2813 CompareRoot(scratch, Heap::kAllocationSiteMapRootIndex); |
(...skipping 959 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3792 } | 3773 } |
3793 } | 3774 } |
3794 if (mag.shift > 0) mov(result, Operand(result, ASR, mag.shift)); | 3775 if (mag.shift > 0) mov(result, Operand(result, ASR, mag.shift)); |
3795 add(result, result, Operand(dividend, LSR, 31)); | 3776 add(result, result, Operand(dividend, LSR, 31)); |
3796 } | 3777 } |
3797 | 3778 |
3798 } // namespace internal | 3779 } // namespace internal |
3799 } // namespace v8 | 3780 } // namespace v8 |
3800 | 3781 |
3801 #endif // V8_TARGET_ARCH_ARM | 3782 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |