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 "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_X87 | 7 #if V8_TARGET_ARCH_X87 |
8 | 8 |
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 5811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5822 new(zone()) DeferredAllocate(this, instr, x87_stack_); | 5822 new(zone()) DeferredAllocate(this, instr, x87_stack_); |
5823 | 5823 |
5824 Register result = ToRegister(instr->result()); | 5824 Register result = ToRegister(instr->result()); |
5825 Register temp = ToRegister(instr->temp()); | 5825 Register temp = ToRegister(instr->temp()); |
5826 | 5826 |
5827 // Allocate memory for the object. | 5827 // Allocate memory for the object. |
5828 AllocationFlags flags = TAG_OBJECT; | 5828 AllocationFlags flags = TAG_OBJECT; |
5829 if (instr->hydrogen()->MustAllocateDoubleAligned()) { | 5829 if (instr->hydrogen()->MustAllocateDoubleAligned()) { |
5830 flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT); | 5830 flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT); |
5831 } | 5831 } |
5832 if (instr->hydrogen()->IsOldPointerSpaceAllocation()) { | 5832 if (instr->hydrogen()->IsOldSpaceAllocation()) { |
5833 DCHECK(!instr->hydrogen()->IsOldDataSpaceAllocation()); | |
5834 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); | 5833 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); |
5835 flags = static_cast<AllocationFlags>(flags | PRETENURE_OLD_POINTER_SPACE); | 5834 flags = static_cast<AllocationFlags>(flags | PRETENURE); |
5836 } else if (instr->hydrogen()->IsOldDataSpaceAllocation()) { | |
5837 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); | |
5838 flags = static_cast<AllocationFlags>(flags | PRETENURE_OLD_DATA_SPACE); | |
5839 } | 5835 } |
5840 | 5836 |
5841 if (instr->size()->IsConstantOperand()) { | 5837 if (instr->size()->IsConstantOperand()) { |
5842 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); | 5838 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); |
5843 if (size <= Page::kMaxRegularHeapObjectSize) { | 5839 if (size <= Page::kMaxRegularHeapObjectSize) { |
5844 __ Allocate(size, result, temp, no_reg, deferred->entry(), flags); | 5840 __ Allocate(size, result, temp, no_reg, deferred->entry(), flags); |
5845 } else { | 5841 } else { |
5846 __ jmp(deferred->entry()); | 5842 __ jmp(deferred->entry()); |
5847 } | 5843 } |
5848 } else { | 5844 } else { |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5891 __ push(Immediate(Smi::FromInt(size))); | 5887 __ push(Immediate(Smi::FromInt(size))); |
5892 } else { | 5888 } else { |
5893 // We should never get here at runtime => abort | 5889 // We should never get here at runtime => abort |
5894 __ int3(); | 5890 __ int3(); |
5895 return; | 5891 return; |
5896 } | 5892 } |
5897 } | 5893 } |
5898 | 5894 |
5899 int flags = AllocateDoubleAlignFlag::encode( | 5895 int flags = AllocateDoubleAlignFlag::encode( |
5900 instr->hydrogen()->MustAllocateDoubleAligned()); | 5896 instr->hydrogen()->MustAllocateDoubleAligned()); |
5901 if (instr->hydrogen()->IsOldPointerSpaceAllocation()) { | 5897 if (instr->hydrogen()->IsOldSpaceAllocation()) { |
5902 DCHECK(!instr->hydrogen()->IsOldDataSpaceAllocation()); | |
5903 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); | 5898 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); |
5904 flags = AllocateTargetSpace::update(flags, OLD_POINTER_SPACE); | 5899 flags = AllocateTargetSpace::update(flags, OLD_SPACE); |
5905 } else if (instr->hydrogen()->IsOldDataSpaceAllocation()) { | |
5906 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); | |
5907 flags = AllocateTargetSpace::update(flags, OLD_DATA_SPACE); | |
5908 } else { | 5900 } else { |
5909 flags = AllocateTargetSpace::update(flags, NEW_SPACE); | 5901 flags = AllocateTargetSpace::update(flags, NEW_SPACE); |
5910 } | 5902 } |
5911 __ push(Immediate(Smi::FromInt(flags))); | 5903 __ push(Immediate(Smi::FromInt(flags))); |
5912 | 5904 |
5913 CallRuntimeFromDeferred( | 5905 CallRuntimeFromDeferred( |
5914 Runtime::kAllocateInTargetSpace, 2, instr, instr->context()); | 5906 Runtime::kAllocateInTargetSpace, 2, instr, instr->context()); |
5915 __ StoreToSafepointRegisterSlot(result, eax); | 5907 __ StoreToSafepointRegisterSlot(result, eax); |
5916 } | 5908 } |
5917 | 5909 |
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6387 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6379 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6388 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6380 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6389 } | 6381 } |
6390 | 6382 |
6391 | 6383 |
6392 #undef __ | 6384 #undef __ |
6393 | 6385 |
6394 } } // namespace v8::internal | 6386 } } // namespace v8::internal |
6395 | 6387 |
6396 #endif // V8_TARGET_ARCH_X87 | 6388 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |