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_MIPS | 7 #if V8_TARGET_ARCH_MIPS |
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 4191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4202 sw(a1, MemOperand(at)); | 4202 sw(a1, MemOperand(at)); |
4203 } | 4203 } |
4204 | 4204 |
4205 | 4205 |
4206 void MacroAssembler::Allocate(int object_size, | 4206 void MacroAssembler::Allocate(int object_size, |
4207 Register result, | 4207 Register result, |
4208 Register scratch1, | 4208 Register scratch1, |
4209 Register scratch2, | 4209 Register scratch2, |
4210 Label* gc_required, | 4210 Label* gc_required, |
4211 AllocationFlags flags) { | 4211 AllocationFlags flags) { |
4212 DCHECK(object_size <= Page::kMaxRegularHeapObjectSize); | 4212 DCHECK(object_size <= kMaxRegularHeapObjectSize); |
4213 DCHECK((flags & ALLOCATION_FOLDED) == 0); | 4213 DCHECK((flags & ALLOCATION_FOLDED) == 0); |
4214 if (!FLAG_inline_new) { | 4214 if (!FLAG_inline_new) { |
4215 if (emit_debug_code()) { | 4215 if (emit_debug_code()) { |
4216 // Trash the registers to simulate an allocation failure. | 4216 // Trash the registers to simulate an allocation failure. |
4217 li(result, 0x7091); | 4217 li(result, 0x7091); |
4218 li(scratch1, 0x7191); | 4218 li(scratch1, 0x7191); |
4219 li(scratch2, 0x7291); | 4219 li(scratch2, 0x7291); |
4220 } | 4220 } |
4221 jmp(gc_required); | 4221 jmp(gc_required); |
4222 return; | 4222 return; |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4384 sw(result_end, MemOperand(top_address)); | 4384 sw(result_end, MemOperand(top_address)); |
4385 } | 4385 } |
4386 | 4386 |
4387 // Tag object. | 4387 // Tag object. |
4388 Addu(result, result, Operand(kHeapObjectTag)); | 4388 Addu(result, result, Operand(kHeapObjectTag)); |
4389 } | 4389 } |
4390 | 4390 |
4391 void MacroAssembler::FastAllocate(int object_size, Register result, | 4391 void MacroAssembler::FastAllocate(int object_size, Register result, |
4392 Register scratch1, Register scratch2, | 4392 Register scratch1, Register scratch2, |
4393 AllocationFlags flags) { | 4393 AllocationFlags flags) { |
4394 DCHECK(object_size <= Page::kMaxRegularHeapObjectSize); | 4394 DCHECK(object_size <= kMaxRegularHeapObjectSize); |
4395 DCHECK(!AreAliased(result, scratch1, scratch2, t9, at)); | 4395 DCHECK(!AreAliased(result, scratch1, scratch2, t9, at)); |
4396 | 4396 |
4397 // Make object size into bytes. | 4397 // Make object size into bytes. |
4398 if ((flags & SIZE_IN_WORDS) != 0) { | 4398 if ((flags & SIZE_IN_WORDS) != 0) { |
4399 object_size *= kPointerSize; | 4399 object_size *= kPointerSize; |
4400 } | 4400 } |
4401 DCHECK_EQ(0, object_size & kObjectAlignmentMask); | 4401 DCHECK_EQ(0, object_size & kObjectAlignmentMask); |
4402 | 4402 |
4403 ExternalReference allocation_top = | 4403 ExternalReference allocation_top = |
4404 AllocationUtils::GetAllocationTopReference(isolate(), flags); | 4404 AllocationUtils::GetAllocationTopReference(isolate(), flags); |
(...skipping 2575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6980 if (mag.shift > 0) sra(result, result, mag.shift); | 6980 if (mag.shift > 0) sra(result, result, mag.shift); |
6981 srl(at, dividend, 31); | 6981 srl(at, dividend, 31); |
6982 Addu(result, result, Operand(at)); | 6982 Addu(result, result, Operand(at)); |
6983 } | 6983 } |
6984 | 6984 |
6985 | 6985 |
6986 } // namespace internal | 6986 } // namespace internal |
6987 } // namespace v8 | 6987 } // namespace v8 |
6988 | 6988 |
6989 #endif // V8_TARGET_ARCH_MIPS | 6989 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |