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 4010 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4021 FPURegister value, | 4021 FPURegister value, |
4022 Register scratch1, | 4022 Register scratch1, |
4023 Register scratch2, | 4023 Register scratch2, |
4024 Label* gc_required) { | 4024 Label* gc_required) { |
4025 LoadRoot(t8, Heap::kHeapNumberMapRootIndex); | 4025 LoadRoot(t8, Heap::kHeapNumberMapRootIndex); |
4026 AllocateHeapNumber(result, scratch1, scratch2, t8, gc_required); | 4026 AllocateHeapNumber(result, scratch1, scratch2, t8, gc_required); |
4027 sdc1(value, FieldMemOperand(result, HeapNumber::kValueOffset)); | 4027 sdc1(value, FieldMemOperand(result, HeapNumber::kValueOffset)); |
4028 } | 4028 } |
4029 | 4029 |
4030 | 4030 |
| 4031 void MacroAssembler::AllocateJSValue(Register result, Register constructor, |
| 4032 Register value, Register scratch1, |
| 4033 Register scratch2, Label* gc_required) { |
| 4034 DCHECK(!result.is(constructor)); |
| 4035 DCHECK(!result.is(scratch1)); |
| 4036 DCHECK(!result.is(scratch2)); |
| 4037 DCHECK(!result.is(value)); |
| 4038 |
| 4039 // Allocate JSValue in new space. |
| 4040 Allocate(JSValue::kSize, result, scratch1, scratch2, gc_required, TAG_OBJECT); |
| 4041 |
| 4042 // Initialize the JSValue. |
| 4043 LoadGlobalFunctionInitialMap(constructor, scratch1, scratch2); |
| 4044 sd(scratch1, FieldMemOperand(result, HeapObject::kMapOffset)); |
| 4045 LoadRoot(scratch1, Heap::kEmptyFixedArrayRootIndex); |
| 4046 sd(scratch1, FieldMemOperand(result, JSObject::kPropertiesOffset)); |
| 4047 sd(scratch1, FieldMemOperand(result, JSObject::kElementsOffset)); |
| 4048 sd(value, FieldMemOperand(result, JSValue::kValueOffset)); |
| 4049 STATIC_ASSERT(JSValue::kSize == 4 * kPointerSize); |
| 4050 } |
| 4051 |
| 4052 |
4031 void MacroAssembler::CopyBytes(Register src, | 4053 void MacroAssembler::CopyBytes(Register src, |
4032 Register dst, | 4054 Register dst, |
4033 Register length, | 4055 Register length, |
4034 Register scratch) { | 4056 Register scratch) { |
4035 Label align_loop_1, word_loop, byte_loop, byte_loop_1, done; | 4057 Label align_loop_1, word_loop, byte_loop, byte_loop_1, done; |
4036 | 4058 |
4037 // Align src before copying in word size chunks. | 4059 // Align src before copying in word size chunks. |
4038 Branch(&byte_loop, le, length, Operand(kPointerSize)); | 4060 Branch(&byte_loop, le, length, Operand(kPointerSize)); |
4039 bind(&align_loop_1); | 4061 bind(&align_loop_1); |
4040 And(scratch, src, kPointerSize - 1); | 4062 And(scratch, src, kPointerSize - 1); |
(...skipping 2442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6483 if (mag.shift > 0) sra(result, result, mag.shift); | 6505 if (mag.shift > 0) sra(result, result, mag.shift); |
6484 srl(at, dividend, 31); | 6506 srl(at, dividend, 31); |
6485 Addu(result, result, Operand(at)); | 6507 Addu(result, result, Operand(at)); |
6486 } | 6508 } |
6487 | 6509 |
6488 | 6510 |
6489 } // namespace internal | 6511 } // namespace internal |
6490 } // namespace v8 | 6512 } // namespace v8 |
6491 | 6513 |
6492 #endif // V8_TARGET_ARCH_MIPS64 | 6514 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |