| 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/compiler/instruction-selector-impl.h" | 5 #include "src/compiler/instruction-selector-impl.h" |
| 6 #include "src/compiler/node-matchers.h" | 6 #include "src/compiler/node-matchers.h" |
| 7 | 7 |
| 8 namespace v8 { | 8 namespace v8 { |
| 9 namespace internal { | 9 namespace internal { |
| 10 namespace compiler { | 10 namespace compiler { |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 Instruction* instr = selector->Emit(cont->Encode(opcode), output_count, | 140 Instruction* instr = selector->Emit(cont->Encode(opcode), output_count, |
| 141 outputs, input_count, inputs); | 141 outputs, input_count, inputs); |
| 142 if (cont->IsBranch()) instr->MarkAsControl(); | 142 if (cont->IsBranch()) instr->MarkAsControl(); |
| 143 } | 143 } |
| 144 | 144 |
| 145 | 145 |
| 146 // Shared routine for multiple binary operations. | 146 // Shared routine for multiple binary operations. |
| 147 static void VisitBinop(InstructionSelector* selector, Node* node, | 147 static void VisitBinop(InstructionSelector* selector, Node* node, |
| 148 ArchOpcode opcode, ImmediateMode operand_mode) { | 148 ArchOpcode opcode, ImmediateMode operand_mode) { |
| 149 FlagsContinuation cont; | 149 FlagsContinuation cont; |
| 150 VisitBinop(selector, node, opcode, operand_mode); | 150 VisitBinop(selector, node, opcode, operand_mode, &cont); |
| 151 } | 151 } |
| 152 | 152 |
| 153 | 153 |
| 154 void InstructionSelector::VisitLoad(Node* node) { | 154 void InstructionSelector::VisitLoad(Node* node) { |
| 155 MachineRepresentation rep = OpParameter<MachineRepresentation>(node); | 155 MachineRepresentation rep = OpParameter<MachineRepresentation>(node); |
| 156 Arm64OperandGenerator g(this); | 156 Arm64OperandGenerator g(this); |
| 157 Node* base = node->InputAt(0); | 157 Node* base = node->InputAt(0); |
| 158 Node* index = node->InputAt(1); | 158 Node* index = node->InputAt(1); |
| 159 | 159 |
| 160 InstructionOperand* result = rep == kMachineFloat64 | 160 InstructionOperand* result = rep == kMachineFloat64 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 case kMachineWord64: | 240 case kMachineWord64: |
| 241 opcode = kArm64StoreWord64; | 241 opcode = kArm64StoreWord64; |
| 242 break; | 242 break; |
| 243 default: | 243 default: |
| 244 UNREACHABLE(); | 244 UNREACHABLE(); |
| 245 return; | 245 return; |
| 246 } | 246 } |
| 247 if (g.CanBeImmediate(index, kLoadStoreImm)) { | 247 if (g.CanBeImmediate(index, kLoadStoreImm)) { |
| 248 Emit(opcode | AddressingModeField::encode(kMode_MRI), NULL, | 248 Emit(opcode | AddressingModeField::encode(kMode_MRI), NULL, |
| 249 g.UseRegister(base), g.UseImmediate(index), val); | 249 g.UseRegister(base), g.UseImmediate(index), val); |
| 250 } else if (g.CanBeImmediate(index, kLoadStoreImm)) { | 250 } else if (g.CanBeImmediate(base, kLoadStoreImm)) { |
| 251 Emit(opcode | AddressingModeField::encode(kMode_MRI), NULL, | 251 Emit(opcode | AddressingModeField::encode(kMode_MRI), NULL, |
| 252 g.UseRegister(index), g.UseImmediate(base), val); | 252 g.UseRegister(index), g.UseImmediate(base), val); |
| 253 } else { | 253 } else { |
| 254 Emit(opcode | AddressingModeField::encode(kMode_MRR), NULL, | 254 Emit(opcode | AddressingModeField::encode(kMode_MRR), NULL, |
| 255 g.UseRegister(base), g.UseRegister(index), val); | 255 g.UseRegister(base), g.UseRegister(index), val); |
| 256 } | 256 } |
| 257 } | 257 } |
| 258 | 258 |
| 259 | 259 |
| 260 void InstructionSelector::VisitWord32And(Node* node) { | 260 void InstructionSelector::VisitWord32And(Node* node) { |
| (...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 662 DCHECK(deoptimization == NULL && continuation == NULL); | 662 DCHECK(deoptimization == NULL && continuation == NULL); |
| 663 Emit(kArm64Drop | MiscField::encode(aligned_push_count), NULL); | 663 Emit(kArm64Drop | MiscField::encode(aligned_push_count), NULL); |
| 664 } | 664 } |
| 665 } | 665 } |
| 666 | 666 |
| 667 #endif // V8_TURBOFAN_TARGET | 667 #endif // V8_TURBOFAN_TARGET |
| 668 | 668 |
| 669 } // namespace compiler | 669 } // namespace compiler |
| 670 } // namespace internal | 670 } // namespace internal |
| 671 } // namespace v8 | 671 } // namespace v8 |
| OLD | NEW |