| 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/crankshaft/arm/lithium-codegen-arm.h" | 5 #include "src/crankshaft/arm/lithium-codegen-arm.h" |
| 6 | 6 |
| 7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
| 8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
| 9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
| 10 #include "src/crankshaft/arm/lithium-gap-resolver-arm.h" | 10 #include "src/crankshaft/arm/lithium-gap-resolver-arm.h" |
| (...skipping 5094 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5105 flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT); | 5105 flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT); |
| 5106 } | 5106 } |
| 5107 if (instr->hydrogen()->IsOldSpaceAllocation()) { | 5107 if (instr->hydrogen()->IsOldSpaceAllocation()) { |
| 5108 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); | 5108 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); |
| 5109 flags = static_cast<AllocationFlags>(flags | PRETENURE); | 5109 flags = static_cast<AllocationFlags>(flags | PRETENURE); |
| 5110 } | 5110 } |
| 5111 | 5111 |
| 5112 if (instr->hydrogen()->IsAllocationFoldingDominator()) { | 5112 if (instr->hydrogen()->IsAllocationFoldingDominator()) { |
| 5113 flags = static_cast<AllocationFlags>(flags | ALLOCATION_FOLDING_DOMINATOR); | 5113 flags = static_cast<AllocationFlags>(flags | ALLOCATION_FOLDING_DOMINATOR); |
| 5114 } | 5114 } |
| 5115 | 5115 DCHECK(!instr->hydrogen()->IsAllocationFolded()); |
| 5116 if (instr->hydrogen()->IsAllocationFolded()) { | |
| 5117 flags = static_cast<AllocationFlags>(flags | ALLOCATION_FOLDED); | |
| 5118 } | |
| 5119 | 5116 |
| 5120 if (instr->size()->IsConstantOperand()) { | 5117 if (instr->size()->IsConstantOperand()) { |
| 5121 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); | 5118 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); |
| 5122 CHECK(size <= Page::kMaxRegularHeapObjectSize); | 5119 CHECK(size <= Page::kMaxRegularHeapObjectSize); |
| 5123 __ Allocate(size, result, scratch, scratch2, deferred->entry(), flags); | 5120 __ Allocate(size, result, scratch, scratch2, deferred->entry(), flags); |
| 5124 } else { | 5121 } else { |
| 5125 Register size = ToRegister(instr->size()); | 5122 Register size = ToRegister(instr->size()); |
| 5126 __ Allocate(size, result, scratch, scratch2, deferred->entry(), flags); | 5123 __ Allocate(size, result, scratch, scratch2, deferred->entry(), flags); |
| 5127 } | 5124 } |
| 5128 | 5125 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5199 Register top_address = scratch0(); | 5196 Register top_address = scratch0(); |
| 5200 __ sub(r0, r0, Operand(kHeapObjectTag)); | 5197 __ sub(r0, r0, Operand(kHeapObjectTag)); |
| 5201 __ mov(top_address, Operand(allocation_top)); | 5198 __ mov(top_address, Operand(allocation_top)); |
| 5202 __ str(r0, MemOperand(top_address)); | 5199 __ str(r0, MemOperand(top_address)); |
| 5203 __ add(r0, r0, Operand(kHeapObjectTag)); | 5200 __ add(r0, r0, Operand(kHeapObjectTag)); |
| 5204 } | 5201 } |
| 5205 } | 5202 } |
| 5206 | 5203 |
| 5207 void LCodeGen::DoFastAllocate(LFastAllocate* instr) { | 5204 void LCodeGen::DoFastAllocate(LFastAllocate* instr) { |
| 5208 DCHECK(instr->hydrogen()->IsAllocationFolded()); | 5205 DCHECK(instr->hydrogen()->IsAllocationFolded()); |
| 5206 DCHECK(!instr->hydrogen()->IsAllocationFoldingDominator()); |
| 5209 Register result = ToRegister(instr->result()); | 5207 Register result = ToRegister(instr->result()); |
| 5210 Register scratch1 = ToRegister(instr->temp1()); | 5208 Register scratch1 = ToRegister(instr->temp1()); |
| 5211 Register scratch2 = ToRegister(instr->temp2()); | 5209 Register scratch2 = ToRegister(instr->temp2()); |
| 5212 | 5210 |
| 5213 AllocationFlags flags = NO_ALLOCATION_FLAGS; | 5211 AllocationFlags flags = ALLOCATION_FOLDED; |
| 5214 if (instr->hydrogen()->MustAllocateDoubleAligned()) { | 5212 if (instr->hydrogen()->MustAllocateDoubleAligned()) { |
| 5215 flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT); | 5213 flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT); |
| 5216 } | 5214 } |
| 5217 if (instr->hydrogen()->IsOldSpaceAllocation()) { | 5215 if (instr->hydrogen()->IsOldSpaceAllocation()) { |
| 5218 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); | 5216 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); |
| 5219 flags = static_cast<AllocationFlags>(flags | PRETENURE); | 5217 flags = static_cast<AllocationFlags>(flags | PRETENURE); |
| 5220 } | 5218 } |
| 5221 if (!instr->hydrogen()->IsAllocationFoldingDominator()) { | 5219 if (instr->size()->IsConstantOperand()) { |
| 5222 if (instr->size()->IsConstantOperand()) { | 5220 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); |
| 5223 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); | 5221 CHECK(size <= Page::kMaxRegularHeapObjectSize); |
| 5224 CHECK(size <= Page::kMaxRegularHeapObjectSize); | 5222 __ FastAllocate(size, result, scratch1, scratch2, flags); |
| 5225 __ FastAllocate(size, result, scratch1, scratch2, flags); | 5223 } else { |
| 5226 } else { | 5224 Register size = ToRegister(instr->size()); |
| 5227 Register size = ToRegister(instr->size()); | 5225 __ FastAllocate(size, result, scratch1, scratch2, flags); |
| 5228 __ FastAllocate(size, result, scratch1, scratch2, flags); | |
| 5229 } | |
| 5230 } | 5226 } |
| 5231 } | 5227 } |
| 5232 | 5228 |
| 5233 | 5229 |
| 5234 void LCodeGen::DoTypeof(LTypeof* instr) { | 5230 void LCodeGen::DoTypeof(LTypeof* instr) { |
| 5235 DCHECK(ToRegister(instr->value()).is(r3)); | 5231 DCHECK(ToRegister(instr->value()).is(r3)); |
| 5236 DCHECK(ToRegister(instr->result()).is(r0)); | 5232 DCHECK(ToRegister(instr->result()).is(r0)); |
| 5237 Label end, do_call; | 5233 Label end, do_call; |
| 5238 Register value_register = ToRegister(instr->value()); | 5234 Register value_register = ToRegister(instr->value()); |
| 5239 __ JumpIfNotSmi(value_register, &do_call); | 5235 __ JumpIfNotSmi(value_register, &do_call); |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5586 __ ldr(result, FieldMemOperand(scratch, | 5582 __ ldr(result, FieldMemOperand(scratch, |
| 5587 FixedArray::kHeaderSize - kPointerSize)); | 5583 FixedArray::kHeaderSize - kPointerSize)); |
| 5588 __ bind(deferred->exit()); | 5584 __ bind(deferred->exit()); |
| 5589 __ bind(&done); | 5585 __ bind(&done); |
| 5590 } | 5586 } |
| 5591 | 5587 |
| 5592 #undef __ | 5588 #undef __ |
| 5593 | 5589 |
| 5594 } // namespace internal | 5590 } // namespace internal |
| 5595 } // namespace v8 | 5591 } // namespace v8 |
| OLD | NEW |