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 3496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3507 } | 3507 } |
3508 sw(scratch2, MemOperand(topaddr)); | 3508 sw(scratch2, MemOperand(topaddr)); |
3509 | 3509 |
3510 // Tag object if requested. | 3510 // Tag object if requested. |
3511 if ((flags & TAG_OBJECT) != 0) { | 3511 if ((flags & TAG_OBJECT) != 0) { |
3512 Addu(result, result, Operand(kHeapObjectTag)); | 3512 Addu(result, result, Operand(kHeapObjectTag)); |
3513 } | 3513 } |
3514 } | 3514 } |
3515 | 3515 |
3516 | 3516 |
3517 void MacroAssembler::UndoAllocationInNewSpace(Register object, | |
3518 Register scratch) { | |
3519 ExternalReference new_space_allocation_top = | |
3520 ExternalReference::new_space_allocation_top_address(isolate()); | |
3521 | |
3522 // Make sure the object has no tag before resetting top. | |
3523 And(object, object, Operand(~kHeapObjectTagMask)); | |
3524 #ifdef DEBUG | |
3525 // Check that the object un-allocated is below the current top. | |
3526 li(scratch, Operand(new_space_allocation_top)); | |
3527 lw(scratch, MemOperand(scratch)); | |
3528 Check(less, kUndoAllocationOfNonAllocatedMemory, | |
3529 object, Operand(scratch)); | |
3530 #endif | |
3531 // Write the address of the object to un-allocate as the current top. | |
3532 li(scratch, Operand(new_space_allocation_top)); | |
3533 sw(object, MemOperand(scratch)); | |
3534 } | |
3535 | |
3536 | |
3537 void MacroAssembler::AllocateTwoByteString(Register result, | 3517 void MacroAssembler::AllocateTwoByteString(Register result, |
3538 Register length, | 3518 Register length, |
3539 Register scratch1, | 3519 Register scratch1, |
3540 Register scratch2, | 3520 Register scratch2, |
3541 Register scratch3, | 3521 Register scratch3, |
3542 Label* gc_required) { | 3522 Label* gc_required) { |
3543 // Calculate the number of bytes needed for the characters in the string while | 3523 // Calculate the number of bytes needed for the characters in the string while |
3544 // observing object alignment. | 3524 // observing object alignment. |
3545 DCHECK((SeqTwoByteString::kHeaderSize & kObjectAlignmentMask) == 0); | 3525 DCHECK((SeqTwoByteString::kHeaderSize & kObjectAlignmentMask) == 0); |
3546 sll(scratch1, length, 1); // Length in bytes, not chars. | 3526 sll(scratch1, length, 1); // Length in bytes, not chars. |
(...skipping 2579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6126 if (mag.shift > 0) sra(result, result, mag.shift); | 6106 if (mag.shift > 0) sra(result, result, mag.shift); |
6127 srl(at, dividend, 31); | 6107 srl(at, dividend, 31); |
6128 Addu(result, result, Operand(at)); | 6108 Addu(result, result, Operand(at)); |
6129 } | 6109 } |
6130 | 6110 |
6131 | 6111 |
6132 } // namespace internal | 6112 } // namespace internal |
6133 } // namespace v8 | 6113 } // namespace v8 |
6134 | 6114 |
6135 #endif // V8_TARGET_ARCH_MIPS | 6115 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |