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 4353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4364 sd(a1, MemOperand(at)); | 4364 sd(a1, MemOperand(at)); |
4365 } | 4365 } |
4366 | 4366 |
4367 | 4367 |
4368 void MacroAssembler::Allocate(int object_size, | 4368 void MacroAssembler::Allocate(int object_size, |
4369 Register result, | 4369 Register result, |
4370 Register scratch1, | 4370 Register scratch1, |
4371 Register scratch2, | 4371 Register scratch2, |
4372 Label* gc_required, | 4372 Label* gc_required, |
4373 AllocationFlags flags) { | 4373 AllocationFlags flags) { |
4374 DCHECK(object_size <= Page::kMaxRegularHeapObjectSize); | 4374 DCHECK(object_size <= kMaxRegularHeapObjectSize); |
4375 if (!FLAG_inline_new) { | 4375 if (!FLAG_inline_new) { |
4376 if (emit_debug_code()) { | 4376 if (emit_debug_code()) { |
4377 // Trash the registers to simulate an allocation failure. | 4377 // Trash the registers to simulate an allocation failure. |
4378 li(result, 0x7091); | 4378 li(result, 0x7091); |
4379 li(scratch1, 0x7191); | 4379 li(scratch1, 0x7191); |
4380 li(scratch2, 0x7291); | 4380 li(scratch2, 0x7291); |
4381 } | 4381 } |
4382 jmp(gc_required); | 4382 jmp(gc_required); |
4383 return; | 4383 return; |
4384 } | 4384 } |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4528 sd(result_end, MemOperand(top_address)); | 4528 sd(result_end, MemOperand(top_address)); |
4529 } | 4529 } |
4530 | 4530 |
4531 // Tag object if. | 4531 // Tag object if. |
4532 Daddu(result, result, Operand(kHeapObjectTag)); | 4532 Daddu(result, result, Operand(kHeapObjectTag)); |
4533 } | 4533 } |
4534 | 4534 |
4535 void MacroAssembler::FastAllocate(int object_size, Register result, | 4535 void MacroAssembler::FastAllocate(int object_size, Register result, |
4536 Register scratch1, Register scratch2, | 4536 Register scratch1, Register scratch2, |
4537 AllocationFlags flags) { | 4537 AllocationFlags flags) { |
4538 DCHECK(object_size <= Page::kMaxRegularHeapObjectSize); | 4538 DCHECK(object_size <= kMaxRegularHeapObjectSize); |
4539 DCHECK(!AreAliased(result, scratch1, scratch2, at)); | 4539 DCHECK(!AreAliased(result, scratch1, scratch2, at)); |
4540 | 4540 |
4541 // Make object size into bytes. | 4541 // Make object size into bytes. |
4542 if ((flags & SIZE_IN_WORDS) != 0) { | 4542 if ((flags & SIZE_IN_WORDS) != 0) { |
4543 object_size *= kPointerSize; | 4543 object_size *= kPointerSize; |
4544 } | 4544 } |
4545 DCHECK(0 == (object_size & kObjectAlignmentMask)); | 4545 DCHECK(0 == (object_size & kObjectAlignmentMask)); |
4546 | 4546 |
4547 ExternalReference allocation_top = | 4547 ExternalReference allocation_top = |
4548 AllocationUtils::GetAllocationTopReference(isolate(), flags); | 4548 AllocationUtils::GetAllocationTopReference(isolate(), flags); |
(...skipping 2858 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7407 if (mag.shift > 0) sra(result, result, mag.shift); | 7407 if (mag.shift > 0) sra(result, result, mag.shift); |
7408 srl(at, dividend, 31); | 7408 srl(at, dividend, 31); |
7409 Addu(result, result, Operand(at)); | 7409 Addu(result, result, Operand(at)); |
7410 } | 7410 } |
7411 | 7411 |
7412 | 7412 |
7413 } // namespace internal | 7413 } // namespace internal |
7414 } // namespace v8 | 7414 } // namespace v8 |
7415 | 7415 |
7416 #endif // V8_TARGET_ARCH_MIPS64 | 7416 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |