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 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 outputs[output_count++] = g.DefineSameAsFirst(node); | 344 outputs[output_count++] = g.DefineSameAsFirst(node); |
345 if (cont->IsSet()) { | 345 if (cont->IsSet()) { |
346 outputs[output_count++] = g.DefineAsRegister(cont->result()); | 346 outputs[output_count++] = g.DefineAsRegister(cont->result()); |
347 } | 347 } |
348 | 348 |
349 DCHECK_NE(0, static_cast<int>(input_count)); | 349 DCHECK_NE(0, static_cast<int>(input_count)); |
350 DCHECK_NE(0, static_cast<int>(output_count)); | 350 DCHECK_NE(0, static_cast<int>(output_count)); |
351 DCHECK_GE(arraysize(inputs), input_count); | 351 DCHECK_GE(arraysize(inputs), input_count); |
352 DCHECK_GE(arraysize(outputs), output_count); | 352 DCHECK_GE(arraysize(outputs), output_count); |
353 | 353 |
354 Instruction* instr = selector->Emit(cont->Encode(opcode), output_count, | 354 selector->Emit(cont->Encode(opcode), output_count, outputs, input_count, |
355 outputs, input_count, inputs); | 355 inputs); |
356 if (cont->IsBranch()) instr->MarkAsControl(); | |
357 } | 356 } |
358 | 357 |
359 | 358 |
360 // Shared routine for multiple binary operations. | 359 // Shared routine for multiple binary operations. |
361 static void VisitBinop(InstructionSelector* selector, Node* node, | 360 static void VisitBinop(InstructionSelector* selector, Node* node, |
362 InstructionCode opcode) { | 361 InstructionCode opcode) { |
363 FlagsContinuation cont; | 362 FlagsContinuation cont; |
364 VisitBinop(selector, node, opcode, &cont); | 363 VisitBinop(selector, node, opcode, &cont); |
365 } | 364 } |
366 | 365 |
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
970 | 969 |
971 | 970 |
972 // Shared routine for multiple compare operations. | 971 // Shared routine for multiple compare operations. |
973 static void VisitCompare(InstructionSelector* selector, InstructionCode opcode, | 972 static void VisitCompare(InstructionSelector* selector, InstructionCode opcode, |
974 InstructionOperand* left, InstructionOperand* right, | 973 InstructionOperand* left, InstructionOperand* right, |
975 FlagsContinuation* cont) { | 974 FlagsContinuation* cont) { |
976 X64OperandGenerator g(selector); | 975 X64OperandGenerator g(selector); |
977 opcode = cont->Encode(opcode); | 976 opcode = cont->Encode(opcode); |
978 if (cont->IsBranch()) { | 977 if (cont->IsBranch()) { |
979 selector->Emit(opcode, NULL, left, right, g.Label(cont->true_block()), | 978 selector->Emit(opcode, NULL, left, right, g.Label(cont->true_block()), |
980 g.Label(cont->false_block()))->MarkAsControl(); | 979 g.Label(cont->false_block())); |
981 } else { | 980 } else { |
982 DCHECK(cont->IsSet()); | 981 DCHECK(cont->IsSet()); |
983 selector->Emit(opcode, g.DefineAsRegister(cont->result()), left, right); | 982 selector->Emit(opcode, g.DefineAsRegister(cont->result()), left, right); |
984 } | 983 } |
985 } | 984 } |
986 | 985 |
987 | 986 |
988 // Shared routine for multiple compare operations. | 987 // Shared routine for multiple compare operations. |
989 static void VisitCompare(InstructionSelector* selector, InstructionCode opcode, | 988 static void VisitCompare(InstructionSelector* selector, InstructionCode opcode, |
990 Node* left, Node* right, FlagsContinuation* cont, | 989 Node* left, Node* right, FlagsContinuation* cont, |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1308 MachineOperatorBuilder::kFloat64Ceil | | 1307 MachineOperatorBuilder::kFloat64Ceil | |
1309 MachineOperatorBuilder::kFloat64RoundTruncate | | 1308 MachineOperatorBuilder::kFloat64RoundTruncate | |
1310 MachineOperatorBuilder::kWord32ShiftIsSafe; | 1309 MachineOperatorBuilder::kWord32ShiftIsSafe; |
1311 } | 1310 } |
1312 return MachineOperatorBuilder::kNoFlags; | 1311 return MachineOperatorBuilder::kNoFlags; |
1313 } | 1312 } |
1314 | 1313 |
1315 } // namespace compiler | 1314 } // namespace compiler |
1316 } // namespace internal | 1315 } // namespace internal |
1317 } // namespace v8 | 1316 } // namespace v8 |
OLD | NEW |