OLD | NEW |
1 | 1 |
2 // Copyright 2012 the V8 project authors. All rights reserved. | 2 // Copyright 2012 the V8 project authors. All rights reserved. |
3 // Use of this source code is governed by a BSD-style license that can be | 3 // Use of this source code is governed by a BSD-style license that can be |
4 // found in the LICENSE file. | 4 // found in the LICENSE file. |
5 | 5 |
6 #include <limits.h> // For LONG_MIN, LONG_MAX. | 6 #include <limits.h> // For LONG_MIN, LONG_MAX. |
7 | 7 |
8 #if V8_TARGET_ARCH_MIPS | 8 #if V8_TARGET_ARCH_MIPS |
9 | 9 |
10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
(...skipping 3315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3326 if (emit_debug_code()) { | 3326 if (emit_debug_code()) { |
3327 // Trash the registers to simulate an allocation failure. | 3327 // Trash the registers to simulate an allocation failure. |
3328 li(result, 0x7091); | 3328 li(result, 0x7091); |
3329 li(scratch1, 0x7191); | 3329 li(scratch1, 0x7191); |
3330 li(scratch2, 0x7291); | 3330 li(scratch2, 0x7291); |
3331 } | 3331 } |
3332 jmp(gc_required); | 3332 jmp(gc_required); |
3333 return; | 3333 return; |
3334 } | 3334 } |
3335 | 3335 |
3336 DCHECK(!AreAliased(result, scratch1, scratch2, t9)); | 3336 DCHECK(!AreAliased(result, scratch1, scratch2, t9, at)); |
3337 | 3337 |
3338 // Make object size into bytes. | 3338 // Make object size into bytes. |
3339 if ((flags & SIZE_IN_WORDS) != 0) { | 3339 if ((flags & SIZE_IN_WORDS) != 0) { |
3340 object_size *= kPointerSize; | 3340 object_size *= kPointerSize; |
3341 } | 3341 } |
3342 DCHECK_EQ(0, object_size & kObjectAlignmentMask); | 3342 DCHECK_EQ(0, object_size & kObjectAlignmentMask); |
3343 | 3343 |
3344 // Check relative positions of allocation top and limit addresses. | 3344 // Check relative positions of allocation top and limit addresses. |
3345 // ARM adds additional checks to make sure the ldm instruction can be | 3345 // ARM adds additional checks to make sure the ldm instruction can be |
3346 // used. On MIPS we don't have ldm so we don't need additional checks either. | 3346 // used. On MIPS we don't have ldm so we don't need additional checks either. |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3412 li(result, 0x7091); | 3412 li(result, 0x7091); |
3413 li(scratch, 0x7191); | 3413 li(scratch, 0x7191); |
3414 li(result_end, 0x7291); | 3414 li(result_end, 0x7291); |
3415 } | 3415 } |
3416 jmp(gc_required); | 3416 jmp(gc_required); |
3417 return; | 3417 return; |
3418 } | 3418 } |
3419 | 3419 |
3420 // |object_size| and |result_end| may overlap if the DOUBLE_ALIGNMENT flag | 3420 // |object_size| and |result_end| may overlap if the DOUBLE_ALIGNMENT flag |
3421 // is not specified. Other registers must not overlap. | 3421 // is not specified. Other registers must not overlap. |
3422 DCHECK(!AreAliased(object_size, result, scratch, t9)); | 3422 DCHECK(!AreAliased(object_size, result, scratch, t9, at)); |
3423 DCHECK(!AreAliased(result_end, result, scratch, t9)); | 3423 DCHECK(!AreAliased(result_end, result, scratch, t9, at)); |
3424 DCHECK((flags & DOUBLE_ALIGNMENT) == 0 || !object_size.is(result_end)); | 3424 DCHECK((flags & DOUBLE_ALIGNMENT) == 0 || !object_size.is(result_end)); |
3425 | 3425 |
3426 // Check relative positions of allocation top and limit addresses. | 3426 // Check relative positions of allocation top and limit addresses. |
3427 // ARM adds additional checks to make sure the ldm instruction can be | 3427 // ARM adds additional checks to make sure the ldm instruction can be |
3428 // used. On MIPS we don't have ldm so we don't need additional checks either. | 3428 // used. On MIPS we don't have ldm so we don't need additional checks either. |
3429 ExternalReference allocation_top = | 3429 ExternalReference allocation_top = |
3430 AllocationUtils::GetAllocationTopReference(isolate(), flags); | 3430 AllocationUtils::GetAllocationTopReference(isolate(), flags); |
3431 ExternalReference allocation_limit = | 3431 ExternalReference allocation_limit = |
3432 AllocationUtils::GetAllocationLimitReference(isolate(), flags); | 3432 AllocationUtils::GetAllocationLimitReference(isolate(), flags); |
3433 intptr_t top = reinterpret_cast<intptr_t>(allocation_top.address()); | 3433 intptr_t top = reinterpret_cast<intptr_t>(allocation_top.address()); |
(...skipping 2401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5835 if (mag.shift > 0) sra(result, result, mag.shift); | 5835 if (mag.shift > 0) sra(result, result, mag.shift); |
5836 srl(at, dividend, 31); | 5836 srl(at, dividend, 31); |
5837 Addu(result, result, Operand(at)); | 5837 Addu(result, result, Operand(at)); |
5838 } | 5838 } |
5839 | 5839 |
5840 | 5840 |
5841 } // namespace internal | 5841 } // namespace internal |
5842 } // namespace v8 | 5842 } // namespace v8 |
5843 | 5843 |
5844 #endif // V8_TARGET_ARCH_MIPS | 5844 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |