| 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 #include "src/code-factory.h" |     7 #include "src/code-factory.h" | 
|     8 #include "src/code-stubs.h" |     8 #include "src/code-stubs.h" | 
|     9 #include "src/cpu-profiler.h" |     9 #include "src/cpu-profiler.h" | 
|    10 #include "src/hydrogen-osr.h" |    10 #include "src/hydrogen-osr.h" | 
| (...skipping 5439 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  5450  |  5450  | 
|  5451   Register result = ToRegister(instr->result()); |  5451   Register result = ToRegister(instr->result()); | 
|  5452   Register scratch = ToRegister(instr->temp1()); |  5452   Register scratch = ToRegister(instr->temp1()); | 
|  5453   Register scratch2 = ToRegister(instr->temp2()); |  5453   Register scratch2 = ToRegister(instr->temp2()); | 
|  5454  |  5454  | 
|  5455   // Allocate memory for the object. |  5455   // Allocate memory for the object. | 
|  5456   AllocationFlags flags = TAG_OBJECT; |  5456   AllocationFlags flags = TAG_OBJECT; | 
|  5457   if (instr->hydrogen()->MustAllocateDoubleAligned()) { |  5457   if (instr->hydrogen()->MustAllocateDoubleAligned()) { | 
|  5458     flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT); |  5458     flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT); | 
|  5459   } |  5459   } | 
|  5460   if (instr->hydrogen()->IsOldPointerSpaceAllocation()) { |  5460   if (instr->hydrogen()->IsOldSpaceAllocation()) { | 
|  5461     DCHECK(!instr->hydrogen()->IsOldDataSpaceAllocation()); |  | 
|  5462     DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); |  5461     DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); | 
|  5463     flags = static_cast<AllocationFlags>(flags | PRETENURE_OLD_POINTER_SPACE); |  5462     flags = static_cast<AllocationFlags>(flags | PRETENURE); | 
|  5464   } else if (instr->hydrogen()->IsOldDataSpaceAllocation()) { |  | 
|  5465     DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); |  | 
|  5466     flags = static_cast<AllocationFlags>(flags | PRETENURE_OLD_DATA_SPACE); |  | 
|  5467   } |  5463   } | 
|  5468   if (instr->size()->IsConstantOperand()) { |  5464   if (instr->size()->IsConstantOperand()) { | 
|  5469     int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); |  5465     int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); | 
|  5470     if (size <= Page::kMaxRegularHeapObjectSize) { |  5466     if (size <= Page::kMaxRegularHeapObjectSize) { | 
|  5471       __ Allocate(size, result, scratch, scratch2, deferred->entry(), flags); |  5467       __ Allocate(size, result, scratch, scratch2, deferred->entry(), flags); | 
|  5472     } else { |  5468     } else { | 
|  5473       __ jmp(deferred->entry()); |  5469       __ jmp(deferred->entry()); | 
|  5474     } |  5470     } | 
|  5475   } else { |  5471   } else { | 
|  5476     Register size = ToRegister(instr->size()); |  5472     Register size = ToRegister(instr->size()); | 
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  5519       __ Push(v0); |  5515       __ Push(v0); | 
|  5520     } else { |  5516     } else { | 
|  5521       // We should never get here at runtime => abort |  5517       // We should never get here at runtime => abort | 
|  5522       __ stop("invalid allocation size"); |  5518       __ stop("invalid allocation size"); | 
|  5523       return; |  5519       return; | 
|  5524     } |  5520     } | 
|  5525   } |  5521   } | 
|  5526  |  5522  | 
|  5527   int flags = AllocateDoubleAlignFlag::encode( |  5523   int flags = AllocateDoubleAlignFlag::encode( | 
|  5528       instr->hydrogen()->MustAllocateDoubleAligned()); |  5524       instr->hydrogen()->MustAllocateDoubleAligned()); | 
|  5529   if (instr->hydrogen()->IsOldPointerSpaceAllocation()) { |  5525   if (instr->hydrogen()->IsOldSpaceAllocation()) { | 
|  5530     DCHECK(!instr->hydrogen()->IsOldDataSpaceAllocation()); |  | 
|  5531     DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); |  5526     DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); | 
|  5532     flags = AllocateTargetSpace::update(flags, OLD_POINTER_SPACE); |  5527     flags = AllocateTargetSpace::update(flags, OLD_SPACE); | 
|  5533   } else if (instr->hydrogen()->IsOldDataSpaceAllocation()) { |  | 
|  5534     DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); |  | 
|  5535     flags = AllocateTargetSpace::update(flags, OLD_DATA_SPACE); |  | 
|  5536   } else { |  5528   } else { | 
|  5537     flags = AllocateTargetSpace::update(flags, NEW_SPACE); |  5529     flags = AllocateTargetSpace::update(flags, NEW_SPACE); | 
|  5538   } |  5530   } | 
|  5539   __ li(v0, Operand(Smi::FromInt(flags))); |  5531   __ li(v0, Operand(Smi::FromInt(flags))); | 
|  5540   __ Push(v0); |  5532   __ Push(v0); | 
|  5541  |  5533  | 
|  5542   CallRuntimeFromDeferred( |  5534   CallRuntimeFromDeferred( | 
|  5543       Runtime::kAllocateInTargetSpace, 2, instr, instr->context()); |  5535       Runtime::kAllocateInTargetSpace, 2, instr, instr->context()); | 
|  5544   __ StoreToSafepointRegisterSlot(v0, result); |  5536   __ StoreToSafepointRegisterSlot(v0, result); | 
|  5545 } |  5537 } | 
| (...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  6058   __ li(at, scope_info); |  6050   __ li(at, scope_info); | 
|  6059   __ Push(at, ToRegister(instr->function())); |  6051   __ Push(at, ToRegister(instr->function())); | 
|  6060   CallRuntime(Runtime::kPushBlockContext, 2, instr); |  6052   CallRuntime(Runtime::kPushBlockContext, 2, instr); | 
|  6061   RecordSafepoint(Safepoint::kNoLazyDeopt); |  6053   RecordSafepoint(Safepoint::kNoLazyDeopt); | 
|  6062 } |  6054 } | 
|  6063  |  6055  | 
|  6064  |  6056  | 
|  6065 #undef __ |  6057 #undef __ | 
|  6066  |  6058  | 
|  6067 } }  // namespace v8::internal |  6059 } }  // namespace v8::internal | 
| OLD | NEW |