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_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
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 5208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5219 DeferredAllocate* deferred = new(zone()) DeferredAllocate(this, instr); | 5219 DeferredAllocate* deferred = new(zone()) DeferredAllocate(this, instr); |
5220 | 5220 |
5221 Register result = ToRegister(instr->result()); | 5221 Register result = ToRegister(instr->result()); |
5222 Register temp = ToRegister(instr->temp()); | 5222 Register temp = ToRegister(instr->temp()); |
5223 | 5223 |
5224 // Allocate memory for the object. | 5224 // Allocate memory for the object. |
5225 AllocationFlags flags = TAG_OBJECT; | 5225 AllocationFlags flags = TAG_OBJECT; |
5226 if (instr->hydrogen()->MustAllocateDoubleAligned()) { | 5226 if (instr->hydrogen()->MustAllocateDoubleAligned()) { |
5227 flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT); | 5227 flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT); |
5228 } | 5228 } |
5229 if (instr->hydrogen()->IsOldPointerSpaceAllocation()) { | 5229 if (instr->hydrogen()->IsOldSpaceAllocation()) { |
5230 DCHECK(!instr->hydrogen()->IsOldDataSpaceAllocation()); | |
5231 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); | 5230 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); |
5232 flags = static_cast<AllocationFlags>(flags | PRETENURE_OLD_POINTER_SPACE); | 5231 flags = static_cast<AllocationFlags>(flags | PRETENURE); |
5233 } else if (instr->hydrogen()->IsOldDataSpaceAllocation()) { | |
5234 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); | |
5235 flags = static_cast<AllocationFlags>(flags | PRETENURE_OLD_DATA_SPACE); | |
5236 } | 5232 } |
5237 | 5233 |
5238 if (instr->size()->IsConstantOperand()) { | 5234 if (instr->size()->IsConstantOperand()) { |
5239 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); | 5235 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); |
5240 if (size <= Page::kMaxRegularHeapObjectSize) { | 5236 if (size <= Page::kMaxRegularHeapObjectSize) { |
5241 __ Allocate(size, result, temp, no_reg, deferred->entry(), flags); | 5237 __ Allocate(size, result, temp, no_reg, deferred->entry(), flags); |
5242 } else { | 5238 } else { |
5243 __ jmp(deferred->entry()); | 5239 __ jmp(deferred->entry()); |
5244 } | 5240 } |
5245 } else { | 5241 } else { |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5288 __ push(Immediate(Smi::FromInt(size))); | 5284 __ push(Immediate(Smi::FromInt(size))); |
5289 } else { | 5285 } else { |
5290 // We should never get here at runtime => abort | 5286 // We should never get here at runtime => abort |
5291 __ int3(); | 5287 __ int3(); |
5292 return; | 5288 return; |
5293 } | 5289 } |
5294 } | 5290 } |
5295 | 5291 |
5296 int flags = AllocateDoubleAlignFlag::encode( | 5292 int flags = AllocateDoubleAlignFlag::encode( |
5297 instr->hydrogen()->MustAllocateDoubleAligned()); | 5293 instr->hydrogen()->MustAllocateDoubleAligned()); |
5298 if (instr->hydrogen()->IsOldPointerSpaceAllocation()) { | 5294 if (instr->hydrogen()->IsOldSpaceAllocation()) { |
5299 DCHECK(!instr->hydrogen()->IsOldDataSpaceAllocation()); | |
5300 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); | 5295 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); |
5301 flags = AllocateTargetSpace::update(flags, OLD_POINTER_SPACE); | 5296 flags = AllocateTargetSpace::update(flags, OLD_SPACE); |
5302 } else if (instr->hydrogen()->IsOldDataSpaceAllocation()) { | |
5303 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); | |
5304 flags = AllocateTargetSpace::update(flags, OLD_DATA_SPACE); | |
5305 } else { | 5297 } else { |
5306 flags = AllocateTargetSpace::update(flags, NEW_SPACE); | 5298 flags = AllocateTargetSpace::update(flags, NEW_SPACE); |
5307 } | 5299 } |
5308 __ push(Immediate(Smi::FromInt(flags))); | 5300 __ push(Immediate(Smi::FromInt(flags))); |
5309 | 5301 |
5310 CallRuntimeFromDeferred( | 5302 CallRuntimeFromDeferred( |
5311 Runtime::kAllocateInTargetSpace, 2, instr, instr->context()); | 5303 Runtime::kAllocateInTargetSpace, 2, instr, instr->context()); |
5312 __ StoreToSafepointRegisterSlot(result, eax); | 5304 __ StoreToSafepointRegisterSlot(result, eax); |
5313 } | 5305 } |
5314 | 5306 |
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5781 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5773 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
5782 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5774 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5783 } | 5775 } |
5784 | 5776 |
5785 | 5777 |
5786 #undef __ | 5778 #undef __ |
5787 | 5779 |
5788 } } // namespace v8::internal | 5780 } } // namespace v8::internal |
5789 | 5781 |
5790 #endif // V8_TARGET_ARCH_IA32 | 5782 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |