| 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 #if V8_TARGET_ARCH_X64 | 7 #if V8_TARGET_ARCH_X64 | 
| 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 5362 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 5373       new(zone()) DeferredAllocate(this, instr); | 5373       new(zone()) DeferredAllocate(this, instr); | 
| 5374 | 5374 | 
| 5375   Register result = ToRegister(instr->result()); | 5375   Register result = ToRegister(instr->result()); | 
| 5376   Register temp = ToRegister(instr->temp()); | 5376   Register temp = ToRegister(instr->temp()); | 
| 5377 | 5377 | 
| 5378   // Allocate memory for the object. | 5378   // Allocate memory for the object. | 
| 5379   AllocationFlags flags = TAG_OBJECT; | 5379   AllocationFlags flags = TAG_OBJECT; | 
| 5380   if (instr->hydrogen()->MustAllocateDoubleAligned()) { | 5380   if (instr->hydrogen()->MustAllocateDoubleAligned()) { | 
| 5381     flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT); | 5381     flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT); | 
| 5382   } | 5382   } | 
| 5383   if (instr->hydrogen()->IsOldPointerSpaceAllocation()) { | 5383   if (instr->hydrogen()->IsOldSpaceAllocation()) { | 
| 5384     DCHECK(!instr->hydrogen()->IsOldDataSpaceAllocation()); |  | 
| 5385     DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); | 5384     DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); | 
| 5386     flags = static_cast<AllocationFlags>(flags | PRETENURE_OLD_POINTER_SPACE); | 5385     flags = static_cast<AllocationFlags>(flags | PRETENURE); | 
| 5387   } else if (instr->hydrogen()->IsOldDataSpaceAllocation()) { |  | 
| 5388     DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); |  | 
| 5389     flags = static_cast<AllocationFlags>(flags | PRETENURE_OLD_DATA_SPACE); |  | 
| 5390   } | 5386   } | 
| 5391 | 5387 | 
| 5392   if (instr->size()->IsConstantOperand()) { | 5388   if (instr->size()->IsConstantOperand()) { | 
| 5393     int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); | 5389     int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); | 
| 5394     if (size <= Page::kMaxRegularHeapObjectSize) { | 5390     if (size <= Page::kMaxRegularHeapObjectSize) { | 
| 5395       __ Allocate(size, result, temp, no_reg, deferred->entry(), flags); | 5391       __ Allocate(size, result, temp, no_reg, deferred->entry(), flags); | 
| 5396     } else { | 5392     } else { | 
| 5397       __ jmp(deferred->entry()); | 5393       __ jmp(deferred->entry()); | 
| 5398     } | 5394     } | 
| 5399   } else { | 5395   } else { | 
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 5435     Register size = ToRegister(instr->size()); | 5431     Register size = ToRegister(instr->size()); | 
| 5436     DCHECK(!size.is(result)); | 5432     DCHECK(!size.is(result)); | 
| 5437     __ Integer32ToSmi(size, size); | 5433     __ Integer32ToSmi(size, size); | 
| 5438     __ Push(size); | 5434     __ Push(size); | 
| 5439   } else { | 5435   } else { | 
| 5440     int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); | 5436     int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); | 
| 5441     __ Push(Smi::FromInt(size)); | 5437     __ Push(Smi::FromInt(size)); | 
| 5442   } | 5438   } | 
| 5443 | 5439 | 
| 5444   int flags = 0; | 5440   int flags = 0; | 
| 5445   if (instr->hydrogen()->IsOldPointerSpaceAllocation()) { | 5441   if (instr->hydrogen()->IsOldSpaceAllocation()) { | 
| 5446     DCHECK(!instr->hydrogen()->IsOldDataSpaceAllocation()); |  | 
| 5447     DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); | 5442     DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); | 
| 5448     flags = AllocateTargetSpace::update(flags, OLD_POINTER_SPACE); | 5443     flags = AllocateTargetSpace::update(flags, OLD_SPACE); | 
| 5449   } else if (instr->hydrogen()->IsOldDataSpaceAllocation()) { |  | 
| 5450     DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); |  | 
| 5451     flags = AllocateTargetSpace::update(flags, OLD_DATA_SPACE); |  | 
| 5452   } else { | 5444   } else { | 
| 5453     flags = AllocateTargetSpace::update(flags, NEW_SPACE); | 5445     flags = AllocateTargetSpace::update(flags, NEW_SPACE); | 
| 5454   } | 5446   } | 
| 5455   __ Push(Smi::FromInt(flags)); | 5447   __ Push(Smi::FromInt(flags)); | 
| 5456 | 5448 | 
| 5457   CallRuntimeFromDeferred( | 5449   CallRuntimeFromDeferred( | 
| 5458       Runtime::kAllocateInTargetSpace, 2, instr, instr->context()); | 5450       Runtime::kAllocateInTargetSpace, 2, instr, instr->context()); | 
| 5459   __ StoreToSafepointRegisterSlot(result, rax); | 5451   __ StoreToSafepointRegisterSlot(result, rax); | 
| 5460 } | 5452 } | 
| 5461 | 5453 | 
| (...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 5939   CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5931   CallRuntime(Runtime::kPushBlockContext, 2, instr); | 
| 5940   RecordSafepoint(Safepoint::kNoLazyDeopt); | 5932   RecordSafepoint(Safepoint::kNoLazyDeopt); | 
| 5941 } | 5933 } | 
| 5942 | 5934 | 
| 5943 | 5935 | 
| 5944 #undef __ | 5936 #undef __ | 
| 5945 | 5937 | 
| 5946 } }  // namespace v8::internal | 5938 } }  // namespace v8::internal | 
| 5947 | 5939 | 
| 5948 #endif  // V8_TARGET_ARCH_X64 | 5940 #endif  // V8_TARGET_ARCH_X64 | 
| OLD | NEW | 
|---|