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