| 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 #include "src/crankshaft/arm64/lithium-codegen-arm64.h" | 5 #include "src/crankshaft/arm64/lithium-codegen-arm64.h" |
| 6 | 6 |
| 7 #include "src/arm64/frames-arm64.h" | 7 #include "src/arm64/frames-arm64.h" |
| 8 #include "src/base/bits.h" | 8 #include "src/base/bits.h" |
| 9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
| 10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
| (...skipping 1411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1422 } | 1422 } |
| 1423 | 1423 |
| 1424 if (instr->hydrogen()->IsOldSpaceAllocation()) { | 1424 if (instr->hydrogen()->IsOldSpaceAllocation()) { |
| 1425 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); | 1425 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); |
| 1426 flags = static_cast<AllocationFlags>(flags | PRETENURE); | 1426 flags = static_cast<AllocationFlags>(flags | PRETENURE); |
| 1427 } | 1427 } |
| 1428 | 1428 |
| 1429 if (instr->hydrogen()->IsAllocationFoldingDominator()) { | 1429 if (instr->hydrogen()->IsAllocationFoldingDominator()) { |
| 1430 flags = static_cast<AllocationFlags>(flags | ALLOCATION_FOLDING_DOMINATOR); | 1430 flags = static_cast<AllocationFlags>(flags | ALLOCATION_FOLDING_DOMINATOR); |
| 1431 } | 1431 } |
| 1432 | 1432 DCHECK(!instr->hydrogen()->IsAllocationFolded()); |
| 1433 if (instr->hydrogen()->IsAllocationFolded()) { | |
| 1434 flags = static_cast<AllocationFlags>(flags | ALLOCATION_FOLDED); | |
| 1435 } | |
| 1436 | 1433 |
| 1437 if (instr->size()->IsConstantOperand()) { | 1434 if (instr->size()->IsConstantOperand()) { |
| 1438 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); | 1435 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); |
| 1439 CHECK(size <= Page::kMaxRegularHeapObjectSize); | 1436 CHECK(size <= Page::kMaxRegularHeapObjectSize); |
| 1440 __ Allocate(size, result, temp1, temp2, deferred->entry(), flags); | 1437 __ Allocate(size, result, temp1, temp2, deferred->entry(), flags); |
| 1441 } else { | 1438 } else { |
| 1442 Register size = ToRegister32(instr->size()); | 1439 Register size = ToRegister32(instr->size()); |
| 1443 __ Sxtw(size.X(), size); | 1440 __ Sxtw(size.X(), size); |
| 1444 __ Allocate(size.X(), result, temp1, temp2, deferred->entry(), flags); | 1441 __ Allocate(size.X(), result, temp1, temp2, deferred->entry(), flags); |
| 1445 } | 1442 } |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1510 Register top_address = x10; | 1507 Register top_address = x10; |
| 1511 __ Sub(x0, x0, Operand(kHeapObjectTag)); | 1508 __ Sub(x0, x0, Operand(kHeapObjectTag)); |
| 1512 __ Mov(top_address, Operand(allocation_top)); | 1509 __ Mov(top_address, Operand(allocation_top)); |
| 1513 __ Str(x0, MemOperand(top_address)); | 1510 __ Str(x0, MemOperand(top_address)); |
| 1514 __ Add(x0, x0, Operand(kHeapObjectTag)); | 1511 __ Add(x0, x0, Operand(kHeapObjectTag)); |
| 1515 } | 1512 } |
| 1516 } | 1513 } |
| 1517 | 1514 |
| 1518 void LCodeGen::DoFastAllocate(LFastAllocate* instr) { | 1515 void LCodeGen::DoFastAllocate(LFastAllocate* instr) { |
| 1519 DCHECK(instr->hydrogen()->IsAllocationFolded()); | 1516 DCHECK(instr->hydrogen()->IsAllocationFolded()); |
| 1517 DCHECK(!instr->hydrogen()->IsAllocationFoldingDominator()); |
| 1520 Register result = ToRegister(instr->result()); | 1518 Register result = ToRegister(instr->result()); |
| 1521 Register scratch1 = ToRegister(instr->temp1()); | 1519 Register scratch1 = ToRegister(instr->temp1()); |
| 1522 Register scratch2 = ToRegister(instr->temp2()); | 1520 Register scratch2 = ToRegister(instr->temp2()); |
| 1523 | 1521 |
| 1524 AllocationFlags flags = NO_ALLOCATION_FLAGS; | 1522 AllocationFlags flags = ALLOCATION_FOLDED; |
| 1525 if (instr->hydrogen()->MustAllocateDoubleAligned()) { | 1523 if (instr->hydrogen()->MustAllocateDoubleAligned()) { |
| 1526 flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT); | 1524 flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT); |
| 1527 } | 1525 } |
| 1528 if (instr->hydrogen()->IsOldSpaceAllocation()) { | 1526 if (instr->hydrogen()->IsOldSpaceAllocation()) { |
| 1529 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); | 1527 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); |
| 1530 flags = static_cast<AllocationFlags>(flags | PRETENURE); | 1528 flags = static_cast<AllocationFlags>(flags | PRETENURE); |
| 1531 } | 1529 } |
| 1532 if (!instr->hydrogen()->IsAllocationFoldingDominator()) { | 1530 if (instr->size()->IsConstantOperand()) { |
| 1533 if (instr->size()->IsConstantOperand()) { | 1531 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); |
| 1534 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); | 1532 CHECK(size <= Page::kMaxRegularHeapObjectSize); |
| 1535 CHECK(size <= Page::kMaxRegularHeapObjectSize); | 1533 __ FastAllocate(size, result, scratch1, scratch2, flags); |
| 1536 __ FastAllocate(size, result, scratch1, scratch2, flags); | 1534 } else { |
| 1537 } else { | 1535 Register size = ToRegister(instr->size()); |
| 1538 Register size = ToRegister(instr->size()); | 1536 __ FastAllocate(size, result, scratch1, scratch2, flags); |
| 1539 __ FastAllocate(size, result, scratch1, scratch2, flags); | |
| 1540 } | |
| 1541 } | 1537 } |
| 1542 } | 1538 } |
| 1543 | 1539 |
| 1544 | 1540 |
| 1545 void LCodeGen::DoApplyArguments(LApplyArguments* instr) { | 1541 void LCodeGen::DoApplyArguments(LApplyArguments* instr) { |
| 1546 Register receiver = ToRegister(instr->receiver()); | 1542 Register receiver = ToRegister(instr->receiver()); |
| 1547 Register function = ToRegister(instr->function()); | 1543 Register function = ToRegister(instr->function()); |
| 1548 Register length = ToRegister32(instr->length()); | 1544 Register length = ToRegister32(instr->length()); |
| 1549 | 1545 |
| 1550 Register elements = ToRegister(instr->elements()); | 1546 Register elements = ToRegister(instr->elements()); |
| (...skipping 4226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5777 // Index is equal to negated out of object property index plus 1. | 5773 // Index is equal to negated out of object property index plus 1. |
| 5778 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); | 5774 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); |
| 5779 __ Ldr(result, FieldMemOperand(result, | 5775 __ Ldr(result, FieldMemOperand(result, |
| 5780 FixedArray::kHeaderSize - kPointerSize)); | 5776 FixedArray::kHeaderSize - kPointerSize)); |
| 5781 __ Bind(deferred->exit()); | 5777 __ Bind(deferred->exit()); |
| 5782 __ Bind(&done); | 5778 __ Bind(&done); |
| 5783 } | 5779 } |
| 5784 | 5780 |
| 5785 } // namespace internal | 5781 } // namespace internal |
| 5786 } // namespace v8 | 5782 } // namespace v8 |
| OLD | NEW |