| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/arm64/lithium-codegen-arm64.h" | 7 #include "src/arm64/lithium-codegen-arm64.h" |
| 8 #include "src/arm64/lithium-gap-resolver-arm64.h" | 8 #include "src/arm64/lithium-gap-resolver-arm64.h" |
| 9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
| 10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
| (...skipping 1562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1573 Register result = ToRegister(instr->result()); | 1573 Register result = ToRegister(instr->result()); |
| 1574 Register temp1 = ToRegister(instr->temp1()); | 1574 Register temp1 = ToRegister(instr->temp1()); |
| 1575 Register temp2 = ToRegister(instr->temp2()); | 1575 Register temp2 = ToRegister(instr->temp2()); |
| 1576 | 1576 |
| 1577 // Allocate memory for the object. | 1577 // Allocate memory for the object. |
| 1578 AllocationFlags flags = TAG_OBJECT; | 1578 AllocationFlags flags = TAG_OBJECT; |
| 1579 if (instr->hydrogen()->MustAllocateDoubleAligned()) { | 1579 if (instr->hydrogen()->MustAllocateDoubleAligned()) { |
| 1580 flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT); | 1580 flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT); |
| 1581 } | 1581 } |
| 1582 | 1582 |
| 1583 if (instr->hydrogen()->IsOldSpaceAllocation()) { | 1583 if (instr->hydrogen()->IsOldPointerSpaceAllocation()) { |
| 1584 DCHECK(!instr->hydrogen()->IsOldDataSpaceAllocation()); |
| 1584 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); | 1585 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); |
| 1585 flags = static_cast<AllocationFlags>(flags | PRETENURE); | 1586 flags = static_cast<AllocationFlags>(flags | PRETENURE_OLD_POINTER_SPACE); |
| 1587 } else if (instr->hydrogen()->IsOldDataSpaceAllocation()) { |
| 1588 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); |
| 1589 flags = static_cast<AllocationFlags>(flags | PRETENURE_OLD_DATA_SPACE); |
| 1586 } | 1590 } |
| 1587 | 1591 |
| 1588 if (instr->size()->IsConstantOperand()) { | 1592 if (instr->size()->IsConstantOperand()) { |
| 1589 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); | 1593 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); |
| 1590 if (size <= Page::kMaxRegularHeapObjectSize) { | 1594 if (size <= Page::kMaxRegularHeapObjectSize) { |
| 1591 __ Allocate(size, result, temp1, temp2, deferred->entry(), flags); | 1595 __ Allocate(size, result, temp1, temp2, deferred->entry(), flags); |
| 1592 } else { | 1596 } else { |
| 1593 __ B(deferred->entry()); | 1597 __ B(deferred->entry()); |
| 1594 } | 1598 } |
| 1595 } else { | 1599 } else { |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1630 PushSafepointRegistersScope scope(this); | 1634 PushSafepointRegistersScope scope(this); |
| 1631 // We're in a SafepointRegistersScope so we can use any scratch registers. | 1635 // We're in a SafepointRegistersScope so we can use any scratch registers. |
| 1632 Register size = x0; | 1636 Register size = x0; |
| 1633 if (instr->size()->IsConstantOperand()) { | 1637 if (instr->size()->IsConstantOperand()) { |
| 1634 __ Mov(size, ToSmi(LConstantOperand::cast(instr->size()))); | 1638 __ Mov(size, ToSmi(LConstantOperand::cast(instr->size()))); |
| 1635 } else { | 1639 } else { |
| 1636 __ SmiTag(size, ToRegister32(instr->size()).X()); | 1640 __ SmiTag(size, ToRegister32(instr->size()).X()); |
| 1637 } | 1641 } |
| 1638 int flags = AllocateDoubleAlignFlag::encode( | 1642 int flags = AllocateDoubleAlignFlag::encode( |
| 1639 instr->hydrogen()->MustAllocateDoubleAligned()); | 1643 instr->hydrogen()->MustAllocateDoubleAligned()); |
| 1640 if (instr->hydrogen()->IsOldSpaceAllocation()) { | 1644 if (instr->hydrogen()->IsOldPointerSpaceAllocation()) { |
| 1645 DCHECK(!instr->hydrogen()->IsOldDataSpaceAllocation()); |
| 1641 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); | 1646 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); |
| 1642 flags = AllocateTargetSpace::update(flags, OLD_SPACE); | 1647 flags = AllocateTargetSpace::update(flags, OLD_POINTER_SPACE); |
| 1648 } else if (instr->hydrogen()->IsOldDataSpaceAllocation()) { |
| 1649 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); |
| 1650 flags = AllocateTargetSpace::update(flags, OLD_DATA_SPACE); |
| 1643 } else { | 1651 } else { |
| 1644 flags = AllocateTargetSpace::update(flags, NEW_SPACE); | 1652 flags = AllocateTargetSpace::update(flags, NEW_SPACE); |
| 1645 } | 1653 } |
| 1646 __ Mov(x10, Smi::FromInt(flags)); | 1654 __ Mov(x10, Smi::FromInt(flags)); |
| 1647 __ Push(size, x10); | 1655 __ Push(size, x10); |
| 1648 | 1656 |
| 1649 CallRuntimeFromDeferred( | 1657 CallRuntimeFromDeferred( |
| 1650 Runtime::kAllocateInTargetSpace, 2, instr, instr->context()); | 1658 Runtime::kAllocateInTargetSpace, 2, instr, instr->context()); |
| 1651 __ StoreToSafepointRegisterSlot(x0, ToRegister(instr->result())); | 1659 __ StoreToSafepointRegisterSlot(x0, ToRegister(instr->result())); |
| 1652 } | 1660 } |
| (...skipping 4409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6062 Handle<ScopeInfo> scope_info = instr->scope_info(); | 6070 Handle<ScopeInfo> scope_info = instr->scope_info(); |
| 6063 __ Push(scope_info); | 6071 __ Push(scope_info); |
| 6064 __ Push(ToRegister(instr->function())); | 6072 __ Push(ToRegister(instr->function())); |
| 6065 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6073 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
| 6066 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6074 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 6067 } | 6075 } |
| 6068 | 6076 |
| 6069 | 6077 |
| 6070 | 6078 |
| 6071 } } // namespace v8::internal | 6079 } } // namespace v8::internal |
| OLD | NEW |