OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_X64 | 5 #if V8_TARGET_ARCH_X64 |
6 | 6 |
7 #include "src/crankshaft/x64/lithium-codegen-x64.h" | 7 #include "src/crankshaft/x64/lithium-codegen-x64.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 5155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5166 flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT); | 5166 flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT); |
5167 } | 5167 } |
5168 if (instr->hydrogen()->IsOldSpaceAllocation()) { | 5168 if (instr->hydrogen()->IsOldSpaceAllocation()) { |
5169 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); | 5169 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); |
5170 flags = static_cast<AllocationFlags>(flags | PRETENURE); | 5170 flags = static_cast<AllocationFlags>(flags | PRETENURE); |
5171 } | 5171 } |
5172 | 5172 |
5173 if (instr->hydrogen()->IsAllocationFoldingDominator()) { | 5173 if (instr->hydrogen()->IsAllocationFoldingDominator()) { |
5174 flags = static_cast<AllocationFlags>(flags | ALLOCATION_FOLDING_DOMINATOR); | 5174 flags = static_cast<AllocationFlags>(flags | ALLOCATION_FOLDING_DOMINATOR); |
5175 } | 5175 } |
5176 | 5176 DCHECK(!instr->hydrogen()->IsAllocationFolded()); |
5177 if (instr->hydrogen()->IsAllocationFolded()) { | |
5178 flags = static_cast<AllocationFlags>(flags | ALLOCATION_FOLDED); | |
5179 } | |
5180 | 5177 |
5181 if (instr->size()->IsConstantOperand()) { | 5178 if (instr->size()->IsConstantOperand()) { |
5182 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); | 5179 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); |
5183 CHECK(size <= Page::kMaxRegularHeapObjectSize); | 5180 CHECK(size <= Page::kMaxRegularHeapObjectSize); |
5184 __ Allocate(size, result, temp, no_reg, deferred->entry(), flags); | 5181 __ Allocate(size, result, temp, no_reg, deferred->entry(), flags); |
5185 } else { | 5182 } else { |
5186 Register size = ToRegister(instr->size()); | 5183 Register size = ToRegister(instr->size()); |
5187 __ Allocate(size, result, temp, no_reg, deferred->entry(), flags); | 5184 __ Allocate(size, result, temp, no_reg, deferred->entry(), flags); |
5188 } | 5185 } |
5189 | 5186 |
(...skipping 12 matching lines...) Expand all Loading... |
5202 __ bind(&loop); | 5199 __ bind(&loop); |
5203 __ Move(FieldOperand(result, temp, times_pointer_size, 0), | 5200 __ Move(FieldOperand(result, temp, times_pointer_size, 0), |
5204 isolate()->factory()->one_pointer_filler_map()); | 5201 isolate()->factory()->one_pointer_filler_map()); |
5205 __ decl(temp); | 5202 __ decl(temp); |
5206 __ j(not_zero, &loop); | 5203 __ j(not_zero, &loop); |
5207 } | 5204 } |
5208 } | 5205 } |
5209 | 5206 |
5210 void LCodeGen::DoFastAllocate(LFastAllocate* instr) { | 5207 void LCodeGen::DoFastAllocate(LFastAllocate* instr) { |
5211 DCHECK(instr->hydrogen()->IsAllocationFolded()); | 5208 DCHECK(instr->hydrogen()->IsAllocationFolded()); |
| 5209 DCHECK(!instr->hydrogen()->IsAllocationFoldingDominator()); |
5212 Register result = ToRegister(instr->result()); | 5210 Register result = ToRegister(instr->result()); |
5213 Register temp = ToRegister(instr->temp()); | 5211 Register temp = ToRegister(instr->temp()); |
5214 | 5212 |
5215 AllocationFlags flags = NO_ALLOCATION_FLAGS; | 5213 AllocationFlags flags = ALLOCATION_FOLDED; |
5216 if (instr->hydrogen()->MustAllocateDoubleAligned()) { | 5214 if (instr->hydrogen()->MustAllocateDoubleAligned()) { |
5217 flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT); | 5215 flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT); |
5218 } | 5216 } |
5219 if (instr->hydrogen()->IsOldSpaceAllocation()) { | 5217 if (instr->hydrogen()->IsOldSpaceAllocation()) { |
5220 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); | 5218 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); |
5221 flags = static_cast<AllocationFlags>(flags | PRETENURE); | 5219 flags = static_cast<AllocationFlags>(flags | PRETENURE); |
5222 } | 5220 } |
5223 if (!instr->hydrogen()->IsAllocationFoldingDominator()) { | 5221 if (instr->size()->IsConstantOperand()) { |
5224 if (instr->size()->IsConstantOperand()) { | 5222 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); |
5225 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); | 5223 CHECK(size <= Page::kMaxRegularHeapObjectSize); |
5226 CHECK(size <= Page::kMaxRegularHeapObjectSize); | 5224 __ FastAllocate(size, result, temp, flags); |
5227 __ FastAllocate(size, result, temp, flags); | 5225 } else { |
5228 } else { | 5226 Register size = ToRegister(instr->size()); |
5229 Register size = ToRegister(instr->size()); | 5227 __ FastAllocate(size, result, temp, flags); |
5230 __ FastAllocate(size, result, temp, flags); | |
5231 } | |
5232 } | 5228 } |
5233 } | 5229 } |
5234 | 5230 |
5235 void LCodeGen::DoDeferredAllocate(LAllocate* instr) { | 5231 void LCodeGen::DoDeferredAllocate(LAllocate* instr) { |
5236 Register result = ToRegister(instr->result()); | 5232 Register result = ToRegister(instr->result()); |
5237 | 5233 |
5238 // TODO(3095996): Get rid of this. For now, we need to make the | 5234 // TODO(3095996): Get rid of this. For now, we need to make the |
5239 // result register contain a valid pointer because it is already | 5235 // result register contain a valid pointer because it is already |
5240 // contained in the register pointer map. | 5236 // contained in the register pointer map. |
5241 __ Move(result, Smi::FromInt(0)); | 5237 __ Move(result, Smi::FromInt(0)); |
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5640 __ bind(deferred->exit()); | 5636 __ bind(deferred->exit()); |
5641 __ bind(&done); | 5637 __ bind(&done); |
5642 } | 5638 } |
5643 | 5639 |
5644 #undef __ | 5640 #undef __ |
5645 | 5641 |
5646 } // namespace internal | 5642 } // namespace internal |
5647 } // namespace v8 | 5643 } // namespace v8 |
5648 | 5644 |
5649 #endif // V8_TARGET_ARCH_X64 | 5645 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |