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 2918 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2929 Register scratch1, | 2929 Register scratch1, |
2930 Register scratch2, | 2930 Register scratch2, |
2931 Register heap_number_map, | 2931 Register heap_number_map, |
2932 Label* gc_required) { | 2932 Label* gc_required) { |
2933 AllocateHeapNumber(result, scratch1, scratch2, heap_number_map, gc_required); | 2933 AllocateHeapNumber(result, scratch1, scratch2, heap_number_map, gc_required); |
2934 sub(scratch1, result, Operand(kHeapObjectTag)); | 2934 sub(scratch1, result, Operand(kHeapObjectTag)); |
2935 vstr(value, scratch1, HeapNumber::kValueOffset); | 2935 vstr(value, scratch1, HeapNumber::kValueOffset); |
2936 } | 2936 } |
2937 | 2937 |
2938 | 2938 |
| 2939 void MacroAssembler::AllocateJSValue(Register result, Register constructor, |
| 2940 Register value, Register scratch1, |
| 2941 Register scratch2, Label* gc_required) { |
| 2942 DCHECK(!result.is(constructor)); |
| 2943 DCHECK(!result.is(scratch1)); |
| 2944 DCHECK(!result.is(scratch2)); |
| 2945 DCHECK(!result.is(value)); |
| 2946 |
| 2947 // Allocate JSValue in new space. |
| 2948 Allocate(JSValue::kSize, result, scratch1, scratch2, gc_required, TAG_OBJECT); |
| 2949 |
| 2950 // Initialize the JSValue. |
| 2951 LoadGlobalFunctionInitialMap(constructor, scratch1, scratch2); |
| 2952 str(scratch1, FieldMemOperand(result, HeapObject::kMapOffset)); |
| 2953 LoadRoot(scratch1, Heap::kEmptyFixedArrayRootIndex); |
| 2954 str(scratch1, FieldMemOperand(result, JSObject::kPropertiesOffset)); |
| 2955 str(scratch1, FieldMemOperand(result, JSObject::kElementsOffset)); |
| 2956 str(value, FieldMemOperand(result, JSValue::kValueOffset)); |
| 2957 STATIC_ASSERT(JSValue::kSize == 4 * kPointerSize); |
| 2958 } |
| 2959 |
| 2960 |
2939 void MacroAssembler::CopyBytes(Register src, | 2961 void MacroAssembler::CopyBytes(Register src, |
2940 Register dst, | 2962 Register dst, |
2941 Register length, | 2963 Register length, |
2942 Register scratch) { | 2964 Register scratch) { |
2943 Label align_loop_1, word_loop, byte_loop, byte_loop_1, done; | 2965 Label align_loop_1, word_loop, byte_loop, byte_loop_1, done; |
2944 | 2966 |
2945 // Align src before copying in word size chunks. | 2967 // Align src before copying in word size chunks. |
2946 cmp(length, Operand(kPointerSize)); | 2968 cmp(length, Operand(kPointerSize)); |
2947 b(le, &byte_loop); | 2969 b(le, &byte_loop); |
2948 | 2970 |
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3595 } | 3617 } |
3596 } | 3618 } |
3597 if (mag.shift > 0) mov(result, Operand(result, ASR, mag.shift)); | 3619 if (mag.shift > 0) mov(result, Operand(result, ASR, mag.shift)); |
3598 add(result, result, Operand(dividend, LSR, 31)); | 3620 add(result, result, Operand(dividend, LSR, 31)); |
3599 } | 3621 } |
3600 | 3622 |
3601 } // namespace internal | 3623 } // namespace internal |
3602 } // namespace v8 | 3624 } // namespace v8 |
3603 | 3625 |
3604 #endif // V8_TARGET_ARCH_ARM | 3626 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |