OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/ppc/lithium-codegen-ppc.h" | 5 #include "src/crankshaft/ppc/lithium-codegen-ppc.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/hydrogen-osr.h" | 10 #include "src/crankshaft/hydrogen-osr.h" |
(...skipping 5353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5364 } | 5364 } |
5365 if (instr->hydrogen()->IsOldSpaceAllocation()) { | 5365 if (instr->hydrogen()->IsOldSpaceAllocation()) { |
5366 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); | 5366 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); |
5367 flags = static_cast<AllocationFlags>(flags | PRETENURE); | 5367 flags = static_cast<AllocationFlags>(flags | PRETENURE); |
5368 } | 5368 } |
5369 | 5369 |
5370 if (instr->hydrogen()->IsAllocationFoldingDominator()) { | 5370 if (instr->hydrogen()->IsAllocationFoldingDominator()) { |
5371 flags = static_cast<AllocationFlags>(flags | ALLOCATION_FOLDING_DOMINATOR); | 5371 flags = static_cast<AllocationFlags>(flags | ALLOCATION_FOLDING_DOMINATOR); |
5372 } | 5372 } |
5373 | 5373 |
5374 if (instr->hydrogen()->IsAllocationFolded()) { | 5374 DCHECK(!instr->hydrogen()->IsAllocationFolded()); |
5375 flags = static_cast<AllocationFlags>(flags | ALLOCATION_FOLDED); | |
5376 } | |
5377 | 5375 |
5378 if (instr->size()->IsConstantOperand()) { | 5376 if (instr->size()->IsConstantOperand()) { |
5379 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); | 5377 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); |
5380 CHECK(size <= Page::kMaxRegularHeapObjectSize); | 5378 CHECK(size <= Page::kMaxRegularHeapObjectSize); |
5381 __ Allocate(size, result, scratch, scratch2, deferred->entry(), flags); | 5379 __ Allocate(size, result, scratch, scratch2, deferred->entry(), flags); |
5382 } else { | 5380 } else { |
5383 Register size = ToRegister(instr->size()); | 5381 Register size = ToRegister(instr->size()); |
5384 __ Allocate(size, result, scratch, scratch2, deferred->entry(), flags); | 5382 __ Allocate(size, result, scratch, scratch2, deferred->entry(), flags); |
5385 } | 5383 } |
5386 | 5384 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5461 Register top_address = scratch0(); | 5459 Register top_address = scratch0(); |
5462 __ subi(r3, r3, Operand(kHeapObjectTag)); | 5460 __ subi(r3, r3, Operand(kHeapObjectTag)); |
5463 __ mov(top_address, Operand(allocation_top)); | 5461 __ mov(top_address, Operand(allocation_top)); |
5464 __ StoreP(r3, MemOperand(top_address)); | 5462 __ StoreP(r3, MemOperand(top_address)); |
5465 __ addi(r3, r3, Operand(kHeapObjectTag)); | 5463 __ addi(r3, r3, Operand(kHeapObjectTag)); |
5466 } | 5464 } |
5467 } | 5465 } |
5468 | 5466 |
5469 void LCodeGen::DoFastAllocate(LFastAllocate* instr) { | 5467 void LCodeGen::DoFastAllocate(LFastAllocate* instr) { |
5470 DCHECK(instr->hydrogen()->IsAllocationFolded()); | 5468 DCHECK(instr->hydrogen()->IsAllocationFolded()); |
| 5469 DCHECK(!instr->hydrogen()->IsAllocationFoldingDominator()); |
5471 Register result = ToRegister(instr->result()); | 5470 Register result = ToRegister(instr->result()); |
5472 Register scratch1 = ToRegister(instr->temp1()); | 5471 Register scratch1 = ToRegister(instr->temp1()); |
5473 Register scratch2 = ToRegister(instr->temp2()); | 5472 Register scratch2 = ToRegister(instr->temp2()); |
5474 | 5473 |
5475 AllocationFlags flags = NO_ALLOCATION_FLAGS; | 5474 AllocationFlags flags = ALLOCATION_FOLDED; |
5476 if (instr->hydrogen()->MustAllocateDoubleAligned()) { | 5475 if (instr->hydrogen()->MustAllocateDoubleAligned()) { |
5477 flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT); | 5476 flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT); |
5478 } | 5477 } |
5479 if (instr->hydrogen()->IsOldSpaceAllocation()) { | 5478 if (instr->hydrogen()->IsOldSpaceAllocation()) { |
5480 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); | 5479 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); |
5481 flags = static_cast<AllocationFlags>(flags | PRETENURE); | 5480 flags = static_cast<AllocationFlags>(flags | PRETENURE); |
5482 } | 5481 } |
5483 if (!instr->hydrogen()->IsAllocationFoldingDominator()) { | 5482 if (instr->size()->IsConstantOperand()) { |
5484 if (instr->size()->IsConstantOperand()) { | 5483 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); |
5485 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); | 5484 CHECK(size <= Page::kMaxRegularHeapObjectSize); |
5486 CHECK(size <= Page::kMaxRegularHeapObjectSize); | 5485 __ FastAllocate(size, result, scratch1, scratch2, flags); |
5487 __ FastAllocate(size, result, scratch1, scratch2, flags); | 5486 } else { |
5488 } else { | 5487 Register size = ToRegister(instr->size()); |
5489 Register size = ToRegister(instr->size()); | 5488 __ FastAllocate(size, result, scratch1, scratch2, flags); |
5490 __ FastAllocate(size, result, scratch1, scratch2, flags); | |
5491 } | |
5492 } | 5489 } |
5493 } | 5490 } |
5494 | 5491 |
5495 | 5492 |
5496 void LCodeGen::DoTypeof(LTypeof* instr) { | 5493 void LCodeGen::DoTypeof(LTypeof* instr) { |
5497 DCHECK(ToRegister(instr->value()).is(r6)); | 5494 DCHECK(ToRegister(instr->value()).is(r6)); |
5498 DCHECK(ToRegister(instr->result()).is(r3)); | 5495 DCHECK(ToRegister(instr->result()).is(r3)); |
5499 Label end, do_call; | 5496 Label end, do_call; |
5500 Register value_register = ToRegister(instr->value()); | 5497 Register value_register = ToRegister(instr->value()); |
5501 __ JumpIfNotSmi(value_register, &do_call); | 5498 __ JumpIfNotSmi(value_register, &do_call); |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5836 __ LoadP(result, | 5833 __ LoadP(result, |
5837 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize)); | 5834 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize)); |
5838 __ bind(deferred->exit()); | 5835 __ bind(deferred->exit()); |
5839 __ bind(&done); | 5836 __ bind(&done); |
5840 } | 5837 } |
5841 | 5838 |
5842 #undef __ | 5839 #undef __ |
5843 | 5840 |
5844 } // namespace internal | 5841 } // namespace internal |
5845 } // namespace v8 | 5842 } // namespace v8 |
OLD | NEW |