| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved.7 | 1 // Copyright 2012 the V8 project authors. All rights reserved.7 |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 5369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5380 | 5380 |
| 5381 Register result = ToRegister(instr->result()); | 5381 Register result = ToRegister(instr->result()); |
| 5382 Register scratch = ToRegister(instr->temp1()); | 5382 Register scratch = ToRegister(instr->temp1()); |
| 5383 Register scratch2 = ToRegister(instr->temp2()); | 5383 Register scratch2 = ToRegister(instr->temp2()); |
| 5384 | 5384 |
| 5385 // Allocate memory for the object. | 5385 // Allocate memory for the object. |
| 5386 AllocationFlags flags = TAG_OBJECT; | 5386 AllocationFlags flags = TAG_OBJECT; |
| 5387 if (instr->hydrogen()->MustAllocateDoubleAligned()) { | 5387 if (instr->hydrogen()->MustAllocateDoubleAligned()) { |
| 5388 flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT); | 5388 flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT); |
| 5389 } | 5389 } |
| 5390 if (instr->hydrogen()->IsOldPointerSpaceAllocation()) { | 5390 if (instr->hydrogen()->IsOldSpaceAllocation()) { |
| 5391 DCHECK(!instr->hydrogen()->IsOldDataSpaceAllocation()); | |
| 5392 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); | 5391 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); |
| 5393 flags = static_cast<AllocationFlags>(flags | PRETENURE_OLD_POINTER_SPACE); | 5392 flags = static_cast<AllocationFlags>(flags | PRETENURE); |
| 5394 } else if (instr->hydrogen()->IsOldDataSpaceAllocation()) { | |
| 5395 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); | |
| 5396 flags = static_cast<AllocationFlags>(flags | PRETENURE_OLD_DATA_SPACE); | |
| 5397 } | 5393 } |
| 5398 if (instr->size()->IsConstantOperand()) { | 5394 if (instr->size()->IsConstantOperand()) { |
| 5399 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); | 5395 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); |
| 5400 if (size <= Page::kMaxRegularHeapObjectSize) { | 5396 if (size <= Page::kMaxRegularHeapObjectSize) { |
| 5401 __ Allocate(size, result, scratch, scratch2, deferred->entry(), flags); | 5397 __ Allocate(size, result, scratch, scratch2, deferred->entry(), flags); |
| 5402 } else { | 5398 } else { |
| 5403 __ jmp(deferred->entry()); | 5399 __ jmp(deferred->entry()); |
| 5404 } | 5400 } |
| 5405 } else { | 5401 } else { |
| 5406 Register size = ToRegister(instr->size()); | 5402 Register size = ToRegister(instr->size()); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5448 __ Push(Smi::FromInt(size)); | 5444 __ Push(Smi::FromInt(size)); |
| 5449 } else { | 5445 } else { |
| 5450 // We should never get here at runtime => abort | 5446 // We should never get here at runtime => abort |
| 5451 __ stop("invalid allocation size"); | 5447 __ stop("invalid allocation size"); |
| 5452 return; | 5448 return; |
| 5453 } | 5449 } |
| 5454 } | 5450 } |
| 5455 | 5451 |
| 5456 int flags = AllocateDoubleAlignFlag::encode( | 5452 int flags = AllocateDoubleAlignFlag::encode( |
| 5457 instr->hydrogen()->MustAllocateDoubleAligned()); | 5453 instr->hydrogen()->MustAllocateDoubleAligned()); |
| 5458 if (instr->hydrogen()->IsOldPointerSpaceAllocation()) { | 5454 if (instr->hydrogen()->IsOldSpaceAllocation()) { |
| 5459 DCHECK(!instr->hydrogen()->IsOldDataSpaceAllocation()); | |
| 5460 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); | 5455 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); |
| 5461 flags = AllocateTargetSpace::update(flags, OLD_POINTER_SPACE); | 5456 flags = AllocateTargetSpace::update(flags, OLD_SPACE); |
| 5462 } else if (instr->hydrogen()->IsOldDataSpaceAllocation()) { | |
| 5463 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); | |
| 5464 flags = AllocateTargetSpace::update(flags, OLD_DATA_SPACE); | |
| 5465 } else { | 5457 } else { |
| 5466 flags = AllocateTargetSpace::update(flags, NEW_SPACE); | 5458 flags = AllocateTargetSpace::update(flags, NEW_SPACE); |
| 5467 } | 5459 } |
| 5468 __ Push(Smi::FromInt(flags)); | 5460 __ Push(Smi::FromInt(flags)); |
| 5469 | 5461 |
| 5470 CallRuntimeFromDeferred( | 5462 CallRuntimeFromDeferred( |
| 5471 Runtime::kAllocateInTargetSpace, 2, instr, instr->context()); | 5463 Runtime::kAllocateInTargetSpace, 2, instr, instr->context()); |
| 5472 __ StoreToSafepointRegisterSlot(v0, result); | 5464 __ StoreToSafepointRegisterSlot(v0, result); |
| 5473 } | 5465 } |
| 5474 | 5466 |
| (...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5988 __ li(at, scope_info); | 5980 __ li(at, scope_info); |
| 5989 __ Push(at, ToRegister(instr->function())); | 5981 __ Push(at, ToRegister(instr->function())); |
| 5990 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5982 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
| 5991 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5983 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 5992 } | 5984 } |
| 5993 | 5985 |
| 5994 | 5986 |
| 5995 #undef __ | 5987 #undef __ |
| 5996 | 5988 |
| 5997 } } // namespace v8::internal | 5989 } } // namespace v8::internal |
| OLD | NEW |