| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 <assert.h> // For assert | 5 #include <assert.h> // For assert |
| 6 #include <limits.h> // For LONG_MIN, LONG_MAX. | 6 #include <limits.h> // For LONG_MIN, LONG_MAX. |
| 7 | 7 |
| 8 #include "src/v8.h" | 8 #include "src/v8.h" |
| 9 | 9 |
| 10 #if V8_TARGET_ARCH_PPC | 10 #if V8_TARGET_ARCH_PPC |
| (...skipping 1565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1576 } | 1576 } |
| 1577 StoreP(scratch2, MemOperand(topaddr)); | 1577 StoreP(scratch2, MemOperand(topaddr)); |
| 1578 | 1578 |
| 1579 // Tag object if requested. | 1579 // Tag object if requested. |
| 1580 if ((flags & TAG_OBJECT) != 0) { | 1580 if ((flags & TAG_OBJECT) != 0) { |
| 1581 addi(result, result, Operand(kHeapObjectTag)); | 1581 addi(result, result, Operand(kHeapObjectTag)); |
| 1582 } | 1582 } |
| 1583 } | 1583 } |
| 1584 | 1584 |
| 1585 | 1585 |
| 1586 void MacroAssembler::UndoAllocationInNewSpace(Register object, | |
| 1587 Register scratch) { | |
| 1588 ExternalReference new_space_allocation_top = | |
| 1589 ExternalReference::new_space_allocation_top_address(isolate()); | |
| 1590 | |
| 1591 // Make sure the object has no tag before resetting top. | |
| 1592 ClearRightImm(object, object, Operand(kHeapObjectTagSize)); | |
| 1593 #ifdef DEBUG | |
| 1594 // Check that the object un-allocated is below the current top. | |
| 1595 mov(scratch, Operand(new_space_allocation_top)); | |
| 1596 LoadP(scratch, MemOperand(scratch)); | |
| 1597 cmp(object, scratch); | |
| 1598 Check(lt, kUndoAllocationOfNonAllocatedMemory); | |
| 1599 #endif | |
| 1600 // Write the address of the object to un-allocate as the current top. | |
| 1601 mov(scratch, Operand(new_space_allocation_top)); | |
| 1602 StoreP(object, MemOperand(scratch)); | |
| 1603 } | |
| 1604 | |
| 1605 | |
| 1606 void MacroAssembler::AllocateTwoByteString(Register result, Register length, | 1586 void MacroAssembler::AllocateTwoByteString(Register result, Register length, |
| 1607 Register scratch1, Register scratch2, | 1587 Register scratch1, Register scratch2, |
| 1608 Register scratch3, | 1588 Register scratch3, |
| 1609 Label* gc_required) { | 1589 Label* gc_required) { |
| 1610 // Calculate the number of bytes needed for the characters in the string while | 1590 // Calculate the number of bytes needed for the characters in the string while |
| 1611 // observing object alignment. | 1591 // observing object alignment. |
| 1612 DCHECK((SeqTwoByteString::kHeaderSize & kObjectAlignmentMask) == 0); | 1592 DCHECK((SeqTwoByteString::kHeaderSize & kObjectAlignmentMask) == 0); |
| 1613 slwi(scratch1, length, Operand(1)); // Length in bytes, not chars. | 1593 slwi(scratch1, length, Operand(1)); // Length in bytes, not chars. |
| 1614 addi(scratch1, scratch1, | 1594 addi(scratch1, scratch1, |
| 1615 Operand(kObjectAlignmentMask + SeqTwoByteString::kHeaderSize)); | 1595 Operand(kObjectAlignmentMask + SeqTwoByteString::kHeaderSize)); |
| (...skipping 3046 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4662 } | 4642 } |
| 4663 if (mag.shift > 0) srawi(result, result, mag.shift); | 4643 if (mag.shift > 0) srawi(result, result, mag.shift); |
| 4664 ExtractBit(r0, dividend, 31); | 4644 ExtractBit(r0, dividend, 31); |
| 4665 add(result, result, r0); | 4645 add(result, result, r0); |
| 4666 } | 4646 } |
| 4667 | 4647 |
| 4668 } // namespace internal | 4648 } // namespace internal |
| 4669 } // namespace v8 | 4649 } // namespace v8 |
| 4670 | 4650 |
| 4671 #endif // V8_TARGET_ARCH_PPC | 4651 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |