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 #if V8_TARGET_ARCH_X87 | 5 #if V8_TARGET_ARCH_X87 |
6 | 6 |
7 #include "src/crankshaft/x87/lithium-codegen-x87.h" | 7 #include "src/crankshaft/x87/lithium-codegen-x87.h" |
8 | 8 |
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 5404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5415 flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT); | 5415 flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT); |
5416 } | 5416 } |
5417 if (instr->hydrogen()->IsOldSpaceAllocation()) { | 5417 if (instr->hydrogen()->IsOldSpaceAllocation()) { |
5418 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); | 5418 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); |
5419 flags = static_cast<AllocationFlags>(flags | PRETENURE); | 5419 flags = static_cast<AllocationFlags>(flags | PRETENURE); |
5420 } | 5420 } |
5421 | 5421 |
5422 if (instr->hydrogen()->IsAllocationFoldingDominator()) { | 5422 if (instr->hydrogen()->IsAllocationFoldingDominator()) { |
5423 flags = static_cast<AllocationFlags>(flags | ALLOCATION_FOLDING_DOMINATOR); | 5423 flags = static_cast<AllocationFlags>(flags | ALLOCATION_FOLDING_DOMINATOR); |
5424 } | 5424 } |
5425 | 5425 DCHECK(!instr->hydrogen()->IsAllocationFolded()); |
5426 if (instr->hydrogen()->IsAllocationFolded()) { | |
5427 flags = static_cast<AllocationFlags>(flags | ALLOCATION_FOLDED); | |
5428 } | |
5429 | 5426 |
5430 if (instr->size()->IsConstantOperand()) { | 5427 if (instr->size()->IsConstantOperand()) { |
5431 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); | 5428 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); |
5432 CHECK(size <= Page::kMaxRegularHeapObjectSize); | 5429 CHECK(size <= Page::kMaxRegularHeapObjectSize); |
5433 __ Allocate(size, result, temp, no_reg, deferred->entry(), flags); | 5430 __ Allocate(size, result, temp, no_reg, deferred->entry(), flags); |
5434 } else { | 5431 } else { |
5435 Register size = ToRegister(instr->size()); | 5432 Register size = ToRegister(instr->size()); |
5436 __ Allocate(size, result, temp, no_reg, deferred->entry(), flags); | 5433 __ Allocate(size, result, temp, no_reg, deferred->entry(), flags); |
5437 } | 5434 } |
5438 | 5435 |
(...skipping 12 matching lines...) Expand all Loading... |
5451 __ bind(&loop); | 5448 __ bind(&loop); |
5452 __ mov(FieldOperand(result, temp, times_pointer_size, 0), | 5449 __ mov(FieldOperand(result, temp, times_pointer_size, 0), |
5453 isolate()->factory()->one_pointer_filler_map()); | 5450 isolate()->factory()->one_pointer_filler_map()); |
5454 __ dec(temp); | 5451 __ dec(temp); |
5455 __ j(not_zero, &loop); | 5452 __ j(not_zero, &loop); |
5456 } | 5453 } |
5457 } | 5454 } |
5458 | 5455 |
5459 void LCodeGen::DoFastAllocate(LFastAllocate* instr) { | 5456 void LCodeGen::DoFastAllocate(LFastAllocate* instr) { |
5460 DCHECK(instr->hydrogen()->IsAllocationFolded()); | 5457 DCHECK(instr->hydrogen()->IsAllocationFolded()); |
| 5458 DCHECK(!instr->hydrogen()->IsAllocationFoldingDominator()); |
5461 Register result = ToRegister(instr->result()); | 5459 Register result = ToRegister(instr->result()); |
5462 Register temp = ToRegister(instr->temp()); | 5460 Register temp = ToRegister(instr->temp()); |
5463 | 5461 |
5464 AllocationFlags flags = NO_ALLOCATION_FLAGS; | 5462 AllocationFlags flags = ALLOCATION_FOLDED; |
5465 if (instr->hydrogen()->MustAllocateDoubleAligned()) { | 5463 if (instr->hydrogen()->MustAllocateDoubleAligned()) { |
5466 flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT); | 5464 flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT); |
5467 } | 5465 } |
5468 if (instr->hydrogen()->IsOldSpaceAllocation()) { | 5466 if (instr->hydrogen()->IsOldSpaceAllocation()) { |
5469 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); | 5467 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); |
5470 flags = static_cast<AllocationFlags>(flags | PRETENURE); | 5468 flags = static_cast<AllocationFlags>(flags | PRETENURE); |
5471 } | 5469 } |
5472 if (!instr->hydrogen()->IsAllocationFoldingDominator()) { | 5470 if (instr->size()->IsConstantOperand()) { |
5473 if (instr->size()->IsConstantOperand()) { | 5471 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); |
5474 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); | 5472 CHECK(size <= Page::kMaxRegularHeapObjectSize); |
5475 CHECK(size <= Page::kMaxRegularHeapObjectSize); | 5473 __ FastAllocate(size, result, temp, flags); |
5476 __ FastAllocate(size, result, temp, flags); | 5474 } else { |
5477 } else { | 5475 Register size = ToRegister(instr->size()); |
5478 Register size = ToRegister(instr->size()); | 5476 __ FastAllocate(size, result, temp, flags); |
5479 __ FastAllocate(size, result, temp, flags); | |
5480 } | |
5481 } | 5477 } |
5482 } | 5478 } |
5483 | 5479 |
5484 void LCodeGen::DoDeferredAllocate(LAllocate* instr) { | 5480 void LCodeGen::DoDeferredAllocate(LAllocate* instr) { |
5485 Register result = ToRegister(instr->result()); | 5481 Register result = ToRegister(instr->result()); |
5486 | 5482 |
5487 // TODO(3095996): Get rid of this. For now, we need to make the | 5483 // TODO(3095996): Get rid of this. For now, we need to make the |
5488 // result register contain a valid pointer because it is already | 5484 // result register contain a valid pointer because it is already |
5489 // contained in the register pointer map. | 5485 // contained in the register pointer map. |
5490 __ Move(result, Immediate(Smi::FromInt(0))); | 5486 __ Move(result, Immediate(Smi::FromInt(0))); |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5888 __ bind(deferred->exit()); | 5884 __ bind(deferred->exit()); |
5889 __ bind(&done); | 5885 __ bind(&done); |
5890 } | 5886 } |
5891 | 5887 |
5892 #undef __ | 5888 #undef __ |
5893 | 5889 |
5894 } // namespace internal | 5890 } // namespace internal |
5895 } // namespace v8 | 5891 } // namespace v8 |
5896 | 5892 |
5897 #endif // V8_TARGET_ARCH_X87 | 5893 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |