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 #include "src/v8.h" | 7 #include "src/v8.h" |
8 | 8 |
9 #if V8_TARGET_ARCH_MIPS | 9 #if V8_TARGET_ARCH_MIPS |
10 | 10 |
(...skipping 3331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3342 lw(t9, MemOperand(topaddr)); | 3342 lw(t9, MemOperand(topaddr)); |
3343 Check(eq, kUnexpectedAllocationTop, result, Operand(t9)); | 3343 Check(eq, kUnexpectedAllocationTop, result, Operand(t9)); |
3344 } | 3344 } |
3345 // Load allocation limit into t9. Result already contains allocation top. | 3345 // Load allocation limit into t9. Result already contains allocation top. |
3346 lw(t9, MemOperand(topaddr, limit - top)); | 3346 lw(t9, MemOperand(topaddr, limit - top)); |
3347 } | 3347 } |
3348 | 3348 |
3349 if ((flags & DOUBLE_ALIGNMENT) != 0) { | 3349 if ((flags & DOUBLE_ALIGNMENT) != 0) { |
3350 // Align the next allocation. Storing the filler map without checking top is | 3350 // Align the next allocation. Storing the filler map without checking top is |
3351 // safe in new-space because the limit of the heap is aligned there. | 3351 // safe in new-space because the limit of the heap is aligned there. |
3352 DCHECK((flags & PRETENURE_OLD_POINTER_SPACE) == 0); | |
3353 DCHECK(kPointerAlignment * 2 == kDoubleAlignment); | 3352 DCHECK(kPointerAlignment * 2 == kDoubleAlignment); |
3354 And(scratch2, result, Operand(kDoubleAlignmentMask)); | 3353 And(scratch2, result, Operand(kDoubleAlignmentMask)); |
3355 Label aligned; | 3354 Label aligned; |
3356 Branch(&aligned, eq, scratch2, Operand(zero_reg)); | 3355 Branch(&aligned, eq, scratch2, Operand(zero_reg)); |
3357 if ((flags & PRETENURE_OLD_DATA_SPACE) != 0) { | 3356 if ((flags & PRETENURE) != 0) { |
3358 Branch(gc_required, Ugreater_equal, result, Operand(t9)); | 3357 Branch(gc_required, Ugreater_equal, result, Operand(t9)); |
3359 } | 3358 } |
3360 li(scratch2, Operand(isolate()->factory()->one_pointer_filler_map())); | 3359 li(scratch2, Operand(isolate()->factory()->one_pointer_filler_map())); |
3361 sw(scratch2, MemOperand(result)); | 3360 sw(scratch2, MemOperand(result)); |
3362 Addu(result, result, Operand(kDoubleSize / 2)); | 3361 Addu(result, result, Operand(kDoubleSize / 2)); |
3363 bind(&aligned); | 3362 bind(&aligned); |
3364 } | 3363 } |
3365 | 3364 |
3366 // Calculate new top and bail out if new space is exhausted. Use result | 3365 // Calculate new top and bail out if new space is exhausted. Use result |
3367 // to calculate the new top. | 3366 // to calculate the new top. |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3429 lw(t9, MemOperand(topaddr)); | 3428 lw(t9, MemOperand(topaddr)); |
3430 Check(eq, kUnexpectedAllocationTop, result, Operand(t9)); | 3429 Check(eq, kUnexpectedAllocationTop, result, Operand(t9)); |
3431 } | 3430 } |
3432 // Load allocation limit into t9. Result already contains allocation top. | 3431 // Load allocation limit into t9. Result already contains allocation top. |
3433 lw(t9, MemOperand(topaddr, limit - top)); | 3432 lw(t9, MemOperand(topaddr, limit - top)); |
3434 } | 3433 } |
3435 | 3434 |
3436 if ((flags & DOUBLE_ALIGNMENT) != 0) { | 3435 if ((flags & DOUBLE_ALIGNMENT) != 0) { |
3437 // Align the next allocation. Storing the filler map without checking top is | 3436 // Align the next allocation. Storing the filler map without checking top is |
3438 // safe in new-space because the limit of the heap is aligned there. | 3437 // safe in new-space because the limit of the heap is aligned there. |
3439 DCHECK((flags & PRETENURE_OLD_POINTER_SPACE) == 0); | |
3440 DCHECK(kPointerAlignment * 2 == kDoubleAlignment); | 3438 DCHECK(kPointerAlignment * 2 == kDoubleAlignment); |
3441 And(scratch2, result, Operand(kDoubleAlignmentMask)); | 3439 And(scratch2, result, Operand(kDoubleAlignmentMask)); |
3442 Label aligned; | 3440 Label aligned; |
3443 Branch(&aligned, eq, scratch2, Operand(zero_reg)); | 3441 Branch(&aligned, eq, scratch2, Operand(zero_reg)); |
3444 if ((flags & PRETENURE_OLD_DATA_SPACE) != 0) { | 3442 if ((flags & PRETENURE) != 0) { |
3445 Branch(gc_required, Ugreater_equal, result, Operand(t9)); | 3443 Branch(gc_required, Ugreater_equal, result, Operand(t9)); |
3446 } | 3444 } |
3447 li(scratch2, Operand(isolate()->factory()->one_pointer_filler_map())); | 3445 li(scratch2, Operand(isolate()->factory()->one_pointer_filler_map())); |
3448 sw(scratch2, MemOperand(result)); | 3446 sw(scratch2, MemOperand(result)); |
3449 Addu(result, result, Operand(kDoubleSize / 2)); | 3447 Addu(result, result, Operand(kDoubleSize / 2)); |
3450 bind(&aligned); | 3448 bind(&aligned); |
3451 } | 3449 } |
3452 | 3450 |
3453 // Calculate new top and bail out if new space is exhausted. Use result | 3451 // Calculate new top and bail out if new space is exhausted. Use result |
3454 // to calculate the new top. Object size may be in words so a shift is | 3452 // to calculate the new top. Object size may be in words so a shift is |
(...skipping 2631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6086 } | 6084 } |
6087 if (mag.shift > 0) sra(result, result, mag.shift); | 6085 if (mag.shift > 0) sra(result, result, mag.shift); |
6088 srl(at, dividend, 31); | 6086 srl(at, dividend, 31); |
6089 Addu(result, result, Operand(at)); | 6087 Addu(result, result, Operand(at)); |
6090 } | 6088 } |
6091 | 6089 |
6092 | 6090 |
6093 } } // namespace v8::internal | 6091 } } // namespace v8::internal |
6094 | 6092 |
6095 #endif // V8_TARGET_ARCH_MIPS | 6093 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |