| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/compiler/code-generator.h" | 5 #include "src/compiler/code-generator.h" |
| 6 | 6 |
| 7 #include "src/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
| 8 #include "src/compiler/code-generator-impl.h" | 8 #include "src/compiler/code-generator-impl.h" |
| 9 #include "src/compiler/gap-resolver.h" | 9 #include "src/compiler/gap-resolver.h" |
| 10 #include "src/compiler/node-matchers.h" | 10 #include "src/compiler/node-matchers.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 case Constant::kHeapObject: | 60 case Constant::kHeapObject: |
| 61 case Constant::kRpoNumber: | 61 case Constant::kRpoNumber: |
| 62 break; | 62 break; |
| 63 } | 63 } |
| 64 UNREACHABLE(); | 64 UNREACHABLE(); |
| 65 return Operand::Zero(); | 65 return Operand::Zero(); |
| 66 } | 66 } |
| 67 | 67 |
| 68 MemOperand MemoryOperand(AddressingMode* mode, size_t* first_index) { | 68 MemOperand MemoryOperand(AddressingMode* mode, size_t* first_index) { |
| 69 const size_t index = *first_index; | 69 const size_t index = *first_index; |
| 70 *mode = AddressingModeField::decode(instr_->opcode()); | 70 if (mode) *mode = AddressingModeField::decode(instr_->opcode()); |
| 71 switch (*mode) { | 71 switch (AddressingModeField::decode(instr_->opcode())) { |
| 72 case kMode_None: | 72 case kMode_None: |
| 73 break; | 73 break; |
| 74 case kMode_MRI: | 74 case kMode_MRI: |
| 75 *first_index += 2; | 75 *first_index += 2; |
| 76 return MemOperand(InputRegister(index + 0), InputInt32(index + 1)); | 76 return MemOperand(InputRegister(index + 0), InputInt32(index + 1)); |
| 77 case kMode_MRR: | 77 case kMode_MRR: |
| 78 *first_index += 2; | 78 *first_index += 2; |
| 79 return MemOperand(InputRegister(index + 0), InputRegister(index + 1)); | 79 return MemOperand(InputRegister(index + 0), InputRegister(index + 1)); |
| 80 } | 80 } |
| 81 UNREACHABLE(); | 81 UNREACHABLE(); |
| 82 return MemOperand(r0); | 82 return MemOperand(r0); |
| 83 } | 83 } |
| 84 | 84 |
| 85 MemOperand MemoryOperand(AddressingMode* mode, size_t first_index = 0) { | 85 MemOperand MemoryOperand(AddressingMode* mode = NULL, |
| 86 size_t first_index = 0) { |
| 86 return MemoryOperand(mode, &first_index); | 87 return MemoryOperand(mode, &first_index); |
| 87 } | 88 } |
| 88 | 89 |
| 89 MemOperand ToMemOperand(InstructionOperand* op) const { | 90 MemOperand ToMemOperand(InstructionOperand* op) const { |
| 90 DCHECK_NOT_NULL(op); | 91 DCHECK_NOT_NULL(op); |
| 91 DCHECK(op->IsStackSlot() || op->IsDoubleStackSlot()); | 92 DCHECK(op->IsStackSlot() || op->IsDoubleStackSlot()); |
| 92 return SlotToMemOperand(AllocatedOperand::cast(op)->index()); | 93 return SlotToMemOperand(AllocatedOperand::cast(op)->index()); |
| 93 } | 94 } |
| 94 | 95 |
| 95 MemOperand SlotToMemOperand(int slot) const { | 96 MemOperand SlotToMemOperand(int slot) const { |
| (...skipping 1557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1653 #else | 1654 #else |
| 1654 UNREACHABLE(); | 1655 UNREACHABLE(); |
| 1655 #endif | 1656 #endif |
| 1656 break; | 1657 break; |
| 1657 case kCheckedStoreFloat32: | 1658 case kCheckedStoreFloat32: |
| 1658 ASSEMBLE_CHECKED_STORE_FLOAT32(); | 1659 ASSEMBLE_CHECKED_STORE_FLOAT32(); |
| 1659 break; | 1660 break; |
| 1660 case kCheckedStoreFloat64: | 1661 case kCheckedStoreFloat64: |
| 1661 ASSEMBLE_CHECKED_STORE_DOUBLE(); | 1662 ASSEMBLE_CHECKED_STORE_DOUBLE(); |
| 1662 break; | 1663 break; |
| 1664 case kAtomicLoadInt8: |
| 1665 __ LoadB(i.OutputRegister(), i.MemoryOperand()); |
| 1666 break; |
| 1667 case kAtomicLoadUint8: |
| 1668 __ LoadlB(i.OutputRegister(), i.MemoryOperand()); |
| 1669 break; |
| 1670 case kAtomicLoadInt16: |
| 1671 __ LoadHalfWordP(i.OutputRegister(), i.MemoryOperand()); |
| 1672 break; |
| 1673 case kAtomicLoadUint16: |
| 1674 __ LoadLogicalHalfWordP(i.OutputRegister(), i.MemoryOperand()); |
| 1675 break; |
| 1676 case kAtomicLoadWord32: |
| 1677 __ Load(i.OutputRegister(), i.MemoryOperand()); |
| 1678 break; |
| 1663 default: | 1679 default: |
| 1664 UNREACHABLE(); | 1680 UNREACHABLE(); |
| 1665 break; | 1681 break; |
| 1666 } | 1682 } |
| 1667 } // NOLINT(readability/fn_size) | 1683 } // NOLINT(readability/fn_size) |
| 1668 | 1684 |
| 1669 // Assembles branches after an instruction. | 1685 // Assembles branches after an instruction. |
| 1670 void CodeGenerator::AssembleArchBranch(Instruction* instr, BranchInfo* branch) { | 1686 void CodeGenerator::AssembleArchBranch(Instruction* instr, BranchInfo* branch) { |
| 1671 S390OperandConverter i(this, instr); | 1687 S390OperandConverter i(this, instr); |
| 1672 Label* tlabel = branch->true_label; | 1688 Label* tlabel = branch->true_label; |
| (...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2102 padding_size -= 2; | 2118 padding_size -= 2; |
| 2103 } | 2119 } |
| 2104 } | 2120 } |
| 2105 } | 2121 } |
| 2106 | 2122 |
| 2107 #undef __ | 2123 #undef __ |
| 2108 | 2124 |
| 2109 } // namespace compiler | 2125 } // namespace compiler |
| 2110 } // namespace internal | 2126 } // namespace internal |
| 2111 } // namespace v8 | 2127 } // namespace v8 |
| OLD | NEW |