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/arm/lithium-codegen-arm.h" | 7 #include "src/arm/lithium-codegen-arm.h" |
8 #include "src/arm/lithium-gap-resolver-arm.h" | 8 #include "src/arm/lithium-gap-resolver-arm.h" |
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 5360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5371 | 5371 |
5372 Register result = ToRegister(instr->result()); | 5372 Register result = ToRegister(instr->result()); |
5373 Register scratch = ToRegister(instr->temp1()); | 5373 Register scratch = ToRegister(instr->temp1()); |
5374 Register scratch2 = ToRegister(instr->temp2()); | 5374 Register scratch2 = ToRegister(instr->temp2()); |
5375 | 5375 |
5376 // Allocate memory for the object. | 5376 // Allocate memory for the object. |
5377 AllocationFlags flags = TAG_OBJECT; | 5377 AllocationFlags flags = TAG_OBJECT; |
5378 if (instr->hydrogen()->MustAllocateDoubleAligned()) { | 5378 if (instr->hydrogen()->MustAllocateDoubleAligned()) { |
5379 flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT); | 5379 flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT); |
5380 } | 5380 } |
5381 if (instr->hydrogen()->IsOldSpaceAllocation()) { | 5381 if (instr->hydrogen()->IsOldPointerSpaceAllocation()) { |
| 5382 DCHECK(!instr->hydrogen()->IsOldDataSpaceAllocation()); |
5382 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); | 5383 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); |
5383 flags = static_cast<AllocationFlags>(flags | PRETENURE); | 5384 flags = static_cast<AllocationFlags>(flags | PRETENURE_OLD_POINTER_SPACE); |
| 5385 } else if (instr->hydrogen()->IsOldDataSpaceAllocation()) { |
| 5386 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); |
| 5387 flags = static_cast<AllocationFlags>(flags | PRETENURE_OLD_DATA_SPACE); |
5384 } | 5388 } |
5385 | 5389 |
5386 if (instr->size()->IsConstantOperand()) { | 5390 if (instr->size()->IsConstantOperand()) { |
5387 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); | 5391 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); |
5388 if (size <= Page::kMaxRegularHeapObjectSize) { | 5392 if (size <= Page::kMaxRegularHeapObjectSize) { |
5389 __ Allocate(size, result, scratch, scratch2, deferred->entry(), flags); | 5393 __ Allocate(size, result, scratch, scratch2, deferred->entry(), flags); |
5390 } else { | 5394 } else { |
5391 __ jmp(deferred->entry()); | 5395 __ jmp(deferred->entry()); |
5392 } | 5396 } |
5393 } else { | 5397 } else { |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5435 __ Push(Smi::FromInt(size)); | 5439 __ Push(Smi::FromInt(size)); |
5436 } else { | 5440 } else { |
5437 // We should never get here at runtime => abort | 5441 // We should never get here at runtime => abort |
5438 __ stop("invalid allocation size"); | 5442 __ stop("invalid allocation size"); |
5439 return; | 5443 return; |
5440 } | 5444 } |
5441 } | 5445 } |
5442 | 5446 |
5443 int flags = AllocateDoubleAlignFlag::encode( | 5447 int flags = AllocateDoubleAlignFlag::encode( |
5444 instr->hydrogen()->MustAllocateDoubleAligned()); | 5448 instr->hydrogen()->MustAllocateDoubleAligned()); |
5445 if (instr->hydrogen()->IsOldSpaceAllocation()) { | 5449 if (instr->hydrogen()->IsOldPointerSpaceAllocation()) { |
| 5450 DCHECK(!instr->hydrogen()->IsOldDataSpaceAllocation()); |
5446 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); | 5451 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); |
5447 flags = AllocateTargetSpace::update(flags, OLD_SPACE); | 5452 flags = AllocateTargetSpace::update(flags, OLD_POINTER_SPACE); |
| 5453 } else if (instr->hydrogen()->IsOldDataSpaceAllocation()) { |
| 5454 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); |
| 5455 flags = AllocateTargetSpace::update(flags, OLD_DATA_SPACE); |
5448 } else { | 5456 } else { |
5449 flags = AllocateTargetSpace::update(flags, NEW_SPACE); | 5457 flags = AllocateTargetSpace::update(flags, NEW_SPACE); |
5450 } | 5458 } |
5451 __ Push(Smi::FromInt(flags)); | 5459 __ Push(Smi::FromInt(flags)); |
5452 | 5460 |
5453 CallRuntimeFromDeferred( | 5461 CallRuntimeFromDeferred( |
5454 Runtime::kAllocateInTargetSpace, 2, instr, instr->context()); | 5462 Runtime::kAllocateInTargetSpace, 2, instr, instr->context()); |
5455 __ StoreToSafepointRegisterSlot(r0, result); | 5463 __ StoreToSafepointRegisterSlot(r0, result); |
5456 } | 5464 } |
5457 | 5465 |
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5928 __ Push(scope_info); | 5936 __ Push(scope_info); |
5929 __ push(ToRegister(instr->function())); | 5937 __ push(ToRegister(instr->function())); |
5930 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5938 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
5931 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5939 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5932 } | 5940 } |
5933 | 5941 |
5934 | 5942 |
5935 #undef __ | 5943 #undef __ |
5936 | 5944 |
5937 } } // namespace v8::internal | 5945 } } // namespace v8::internal |
OLD | NEW |