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 5403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5414 | 5414 |
5415 Register result = ToRegister(instr->result()); | 5415 Register result = ToRegister(instr->result()); |
5416 Register scratch = ToRegister(instr->temp1()); | 5416 Register scratch = ToRegister(instr->temp1()); |
5417 Register scratch2 = ToRegister(instr->temp2()); | 5417 Register scratch2 = ToRegister(instr->temp2()); |
5418 | 5418 |
5419 // Allocate memory for the object. | 5419 // Allocate memory for the object. |
5420 AllocationFlags flags = TAG_OBJECT; | 5420 AllocationFlags flags = TAG_OBJECT; |
5421 if (instr->hydrogen()->MustAllocateDoubleAligned()) { | 5421 if (instr->hydrogen()->MustAllocateDoubleAligned()) { |
5422 flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT); | 5422 flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT); |
5423 } | 5423 } |
5424 if (instr->hydrogen()->IsOldPointerSpaceAllocation()) { | 5424 if (instr->hydrogen()->IsOldSpaceAllocation()) { |
5425 DCHECK(!instr->hydrogen()->IsOldDataSpaceAllocation()); | |
5426 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); | 5425 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); |
5427 flags = static_cast<AllocationFlags>(flags | PRETENURE_OLD_POINTER_SPACE); | 5426 flags = static_cast<AllocationFlags>(flags | PRETENURE); |
5428 } else if (instr->hydrogen()->IsOldDataSpaceAllocation()) { | |
5429 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); | |
5430 flags = static_cast<AllocationFlags>(flags | PRETENURE_OLD_DATA_SPACE); | |
5431 } | 5427 } |
5432 if (instr->size()->IsConstantOperand()) { | 5428 if (instr->size()->IsConstantOperand()) { |
5433 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); | 5429 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); |
5434 if (size <= Page::kMaxRegularHeapObjectSize) { | 5430 if (size <= Page::kMaxRegularHeapObjectSize) { |
5435 __ Allocate(size, result, scratch, scratch2, deferred->entry(), flags); | 5431 __ Allocate(size, result, scratch, scratch2, deferred->entry(), flags); |
5436 } else { | 5432 } else { |
5437 __ jmp(deferred->entry()); | 5433 __ jmp(deferred->entry()); |
5438 } | 5434 } |
5439 } else { | 5435 } else { |
5440 Register size = ToRegister(instr->size()); | 5436 Register size = ToRegister(instr->size()); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5482 __ Push(Smi::FromInt(size)); | 5478 __ Push(Smi::FromInt(size)); |
5483 } else { | 5479 } else { |
5484 // We should never get here at runtime => abort | 5480 // We should never get here at runtime => abort |
5485 __ stop("invalid allocation size"); | 5481 __ stop("invalid allocation size"); |
5486 return; | 5482 return; |
5487 } | 5483 } |
5488 } | 5484 } |
5489 | 5485 |
5490 int flags = AllocateDoubleAlignFlag::encode( | 5486 int flags = AllocateDoubleAlignFlag::encode( |
5491 instr->hydrogen()->MustAllocateDoubleAligned()); | 5487 instr->hydrogen()->MustAllocateDoubleAligned()); |
5492 if (instr->hydrogen()->IsOldPointerSpaceAllocation()) { | 5488 if (instr->hydrogen()->IsOldSpaceAllocation()) { |
5493 DCHECK(!instr->hydrogen()->IsOldDataSpaceAllocation()); | |
5494 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); | 5489 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); |
5495 flags = AllocateTargetSpace::update(flags, OLD_POINTER_SPACE); | 5490 flags = AllocateTargetSpace::update(flags, OLD_SPACE); |
5496 } else if (instr->hydrogen()->IsOldDataSpaceAllocation()) { | |
5497 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); | |
5498 flags = AllocateTargetSpace::update(flags, OLD_DATA_SPACE); | |
5499 } else { | 5491 } else { |
5500 flags = AllocateTargetSpace::update(flags, NEW_SPACE); | 5492 flags = AllocateTargetSpace::update(flags, NEW_SPACE); |
5501 } | 5493 } |
5502 __ Push(Smi::FromInt(flags)); | 5494 __ Push(Smi::FromInt(flags)); |
5503 | 5495 |
5504 CallRuntimeFromDeferred( | 5496 CallRuntimeFromDeferred( |
5505 Runtime::kAllocateInTargetSpace, 2, instr, instr->context()); | 5497 Runtime::kAllocateInTargetSpace, 2, instr, instr->context()); |
5506 __ StoreToSafepointRegisterSlot(v0, result); | 5498 __ StoreToSafepointRegisterSlot(v0, result); |
5507 } | 5499 } |
5508 | 5500 |
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6022 __ li(at, scope_info); | 6014 __ li(at, scope_info); |
6023 __ Push(at, ToRegister(instr->function())); | 6015 __ Push(at, ToRegister(instr->function())); |
6024 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6016 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6025 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6017 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6026 } | 6018 } |
6027 | 6019 |
6028 | 6020 |
6029 #undef __ | 6021 #undef __ |
6030 | 6022 |
6031 } } // namespace v8::internal | 6023 } } // namespace v8::internal |
OLD | NEW |