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_MIPS64 | 7 #if V8_TARGET_ARCH_MIPS64 |
8 | 8 |
9 #include "src/base/division-by-constant.h" | 9 #include "src/base/division-by-constant.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 3800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3811 FPURegister value, | 3811 FPURegister value, |
3812 Register scratch1, | 3812 Register scratch1, |
3813 Register scratch2, | 3813 Register scratch2, |
3814 Label* gc_required) { | 3814 Label* gc_required) { |
3815 LoadRoot(t8, Heap::kHeapNumberMapRootIndex); | 3815 LoadRoot(t8, Heap::kHeapNumberMapRootIndex); |
3816 AllocateHeapNumber(result, scratch1, scratch2, t8, gc_required); | 3816 AllocateHeapNumber(result, scratch1, scratch2, t8, gc_required); |
3817 sdc1(value, FieldMemOperand(result, HeapNumber::kValueOffset)); | 3817 sdc1(value, FieldMemOperand(result, HeapNumber::kValueOffset)); |
3818 } | 3818 } |
3819 | 3819 |
3820 | 3820 |
3821 // Copies a fixed number of fields of heap objects from src to dst. | |
3822 void MacroAssembler::CopyFields(Register dst, | |
3823 Register src, | |
3824 RegList temps, | |
3825 int field_count) { | |
3826 DCHECK((temps & dst.bit()) == 0); | |
3827 DCHECK((temps & src.bit()) == 0); | |
3828 // Primitive implementation using only one temporary register. | |
3829 | |
3830 Register tmp = no_reg; | |
3831 // Find a temp register in temps list. | |
3832 for (int i = 0; i < kNumRegisters; i++) { | |
3833 if ((temps & (1 << i)) != 0) { | |
3834 tmp.reg_code = i; | |
3835 break; | |
3836 } | |
3837 } | |
3838 DCHECK(!tmp.is(no_reg)); | |
3839 | |
3840 for (int i = 0; i < field_count; i++) { | |
3841 ld(tmp, FieldMemOperand(src, i * kPointerSize)); | |
3842 sd(tmp, FieldMemOperand(dst, i * kPointerSize)); | |
3843 } | |
3844 } | |
3845 | |
3846 | |
3847 void MacroAssembler::CopyBytes(Register src, | 3821 void MacroAssembler::CopyBytes(Register src, |
3848 Register dst, | 3822 Register dst, |
3849 Register length, | 3823 Register length, |
3850 Register scratch) { | 3824 Register scratch) { |
3851 Label align_loop_1, word_loop, byte_loop, byte_loop_1, done; | 3825 Label align_loop_1, word_loop, byte_loop, byte_loop_1, done; |
3852 | 3826 |
3853 // Align src before copying in word size chunks. | 3827 // Align src before copying in word size chunks. |
3854 Branch(&byte_loop, le, length, Operand(kPointerSize)); | 3828 Branch(&byte_loop, le, length, Operand(kPointerSize)); |
3855 bind(&align_loop_1); | 3829 bind(&align_loop_1); |
3856 And(scratch, src, kPointerSize - 1); | 3830 And(scratch, src, kPointerSize - 1); |
(...skipping 2407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6264 if (mag.shift > 0) sra(result, result, mag.shift); | 6238 if (mag.shift > 0) sra(result, result, mag.shift); |
6265 srl(at, dividend, 31); | 6239 srl(at, dividend, 31); |
6266 Addu(result, result, Operand(at)); | 6240 Addu(result, result, Operand(at)); |
6267 } | 6241 } |
6268 | 6242 |
6269 | 6243 |
6270 } // namespace internal | 6244 } // namespace internal |
6271 } // namespace v8 | 6245 } // namespace v8 |
6272 | 6246 |
6273 #endif // V8_TARGET_ARCH_MIPS64 | 6247 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |