| 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 2911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2922 Register scratch1, | 2922 Register scratch1, |
| 2923 Register scratch2, | 2923 Register scratch2, |
| 2924 Register heap_number_map, | 2924 Register heap_number_map, |
| 2925 Label* gc_required) { | 2925 Label* gc_required) { |
| 2926 AllocateHeapNumber(result, scratch1, scratch2, heap_number_map, gc_required); | 2926 AllocateHeapNumber(result, scratch1, scratch2, heap_number_map, gc_required); |
| 2927 sub(scratch1, result, Operand(kHeapObjectTag)); | 2927 sub(scratch1, result, Operand(kHeapObjectTag)); |
| 2928 vstr(value, scratch1, HeapNumber::kValueOffset); | 2928 vstr(value, scratch1, HeapNumber::kValueOffset); |
| 2929 } | 2929 } |
| 2930 | 2930 |
| 2931 | 2931 |
| 2932 // Copies a fixed number of fields of heap objects from src to dst. | |
| 2933 void MacroAssembler::CopyFields(Register dst, | |
| 2934 Register src, | |
| 2935 LowDwVfpRegister double_scratch, | |
| 2936 int field_count) { | |
| 2937 int double_count = field_count / (DwVfpRegister::kSizeInBytes / kPointerSize); | |
| 2938 for (int i = 0; i < double_count; i++) { | |
| 2939 vldr(double_scratch, FieldMemOperand(src, i * DwVfpRegister::kSizeInBytes)); | |
| 2940 vstr(double_scratch, FieldMemOperand(dst, i * DwVfpRegister::kSizeInBytes)); | |
| 2941 } | |
| 2942 | |
| 2943 STATIC_ASSERT(SwVfpRegister::kSizeInBytes == kPointerSize); | |
| 2944 STATIC_ASSERT(2 * SwVfpRegister::kSizeInBytes == DwVfpRegister::kSizeInBytes); | |
| 2945 | |
| 2946 int remain = field_count % (DwVfpRegister::kSizeInBytes / kPointerSize); | |
| 2947 if (remain != 0) { | |
| 2948 vldr(double_scratch.low(), | |
| 2949 FieldMemOperand(src, (field_count - 1) * kPointerSize)); | |
| 2950 vstr(double_scratch.low(), | |
| 2951 FieldMemOperand(dst, (field_count - 1) * kPointerSize)); | |
| 2952 } | |
| 2953 } | |
| 2954 | |
| 2955 | |
| 2956 void MacroAssembler::CopyBytes(Register src, | 2932 void MacroAssembler::CopyBytes(Register src, |
| 2957 Register dst, | 2933 Register dst, |
| 2958 Register length, | 2934 Register length, |
| 2959 Register scratch) { | 2935 Register scratch) { |
| 2960 Label align_loop_1, word_loop, byte_loop, byte_loop_1, done; | 2936 Label align_loop_1, word_loop, byte_loop, byte_loop_1, done; |
| 2961 | 2937 |
| 2962 // Align src before copying in word size chunks. | 2938 // Align src before copying in word size chunks. |
| 2963 cmp(length, Operand(kPointerSize)); | 2939 cmp(length, Operand(kPointerSize)); |
| 2964 b(le, &byte_loop); | 2940 b(le, &byte_loop); |
| 2965 | 2941 |
| (...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3707 } | 3683 } |
| 3708 } | 3684 } |
| 3709 if (mag.shift > 0) mov(result, Operand(result, ASR, mag.shift)); | 3685 if (mag.shift > 0) mov(result, Operand(result, ASR, mag.shift)); |
| 3710 add(result, result, Operand(dividend, LSR, 31)); | 3686 add(result, result, Operand(dividend, LSR, 31)); |
| 3711 } | 3687 } |
| 3712 | 3688 |
| 3713 } // namespace internal | 3689 } // namespace internal |
| 3714 } // namespace v8 | 3690 } // namespace v8 |
| 3715 | 3691 |
| 3716 #endif // V8_TARGET_ARCH_ARM | 3692 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |