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_MIPS64 | 9 #if V8_TARGET_ARCH_MIPS64 |
10 | 10 |
(...skipping 3551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3562 } | 3562 } |
3563 sd(scratch2, MemOperand(topaddr)); | 3563 sd(scratch2, MemOperand(topaddr)); |
3564 | 3564 |
3565 // Tag object if requested. | 3565 // Tag object if requested. |
3566 if ((flags & TAG_OBJECT) != 0) { | 3566 if ((flags & TAG_OBJECT) != 0) { |
3567 Daddu(result, result, Operand(kHeapObjectTag)); | 3567 Daddu(result, result, Operand(kHeapObjectTag)); |
3568 } | 3568 } |
3569 } | 3569 } |
3570 | 3570 |
3571 | 3571 |
3572 void MacroAssembler::UndoAllocationInNewSpace(Register object, | |
3573 Register scratch) { | |
3574 ExternalReference new_space_allocation_top = | |
3575 ExternalReference::new_space_allocation_top_address(isolate()); | |
3576 | |
3577 // Make sure the object has no tag before resetting top. | |
3578 And(object, object, Operand(~kHeapObjectTagMask)); | |
3579 #ifdef DEBUG | |
3580 // Check that the object un-allocated is below the current top. | |
3581 li(scratch, Operand(new_space_allocation_top)); | |
3582 ld(scratch, MemOperand(scratch)); | |
3583 Check(less, kUndoAllocationOfNonAllocatedMemory, | |
3584 object, Operand(scratch)); | |
3585 #endif | |
3586 // Write the address of the object to un-allocate as the current top. | |
3587 li(scratch, Operand(new_space_allocation_top)); | |
3588 sd(object, MemOperand(scratch)); | |
3589 } | |
3590 | |
3591 | |
3592 void MacroAssembler::AllocateTwoByteString(Register result, | 3572 void MacroAssembler::AllocateTwoByteString(Register result, |
3593 Register length, | 3573 Register length, |
3594 Register scratch1, | 3574 Register scratch1, |
3595 Register scratch2, | 3575 Register scratch2, |
3596 Register scratch3, | 3576 Register scratch3, |
3597 Label* gc_required) { | 3577 Label* gc_required) { |
3598 // Calculate the number of bytes needed for the characters in the string while | 3578 // Calculate the number of bytes needed for the characters in the string while |
3599 // observing object alignment. | 3579 // observing object alignment. |
3600 DCHECK((SeqTwoByteString::kHeaderSize & kObjectAlignmentMask) == 0); | 3580 DCHECK((SeqTwoByteString::kHeaderSize & kObjectAlignmentMask) == 0); |
3601 dsll(scratch1, length, 1); // Length in bytes, not chars. | 3581 dsll(scratch1, length, 1); // Length in bytes, not chars. |
(...skipping 2754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6356 if (mag.shift > 0) sra(result, result, mag.shift); | 6336 if (mag.shift > 0) sra(result, result, mag.shift); |
6357 srl(at, dividend, 31); | 6337 srl(at, dividend, 31); |
6358 Addu(result, result, Operand(at)); | 6338 Addu(result, result, Operand(at)); |
6359 } | 6339 } |
6360 | 6340 |
6361 | 6341 |
6362 } // namespace internal | 6342 } // namespace internal |
6363 } // namespace v8 | 6343 } // namespace v8 |
6364 | 6344 |
6365 #endif // V8_TARGET_ARCH_MIPS64 | 6345 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |