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