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