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 #include "src/compiler/node-properties-inl.h" | 7 #include "src/compiler/node-properties-inl.h" |
8 | 8 |
9 namespace v8 { | 9 namespace v8 { |
10 namespace internal { | 10 namespace internal { |
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 if (cont->IsSet()) { | 367 if (cont->IsSet()) { |
368 // TODO(turbofan): Use byte register here. | 368 // TODO(turbofan): Use byte register here. |
369 outputs[output_count++] = g.DefineAsRegister(cont->result()); | 369 outputs[output_count++] = g.DefineAsRegister(cont->result()); |
370 } | 370 } |
371 | 371 |
372 DCHECK_NE(0, input_count); | 372 DCHECK_NE(0, input_count); |
373 DCHECK_NE(0, output_count); | 373 DCHECK_NE(0, output_count); |
374 DCHECK_GE(arraysize(inputs), input_count); | 374 DCHECK_GE(arraysize(inputs), input_count); |
375 DCHECK_GE(arraysize(outputs), output_count); | 375 DCHECK_GE(arraysize(outputs), output_count); |
376 | 376 |
377 Instruction* instr = selector->Emit(cont->Encode(opcode), output_count, | 377 selector->Emit(cont->Encode(opcode), output_count, outputs, input_count, |
378 outputs, input_count, inputs); | 378 inputs); |
379 if (cont->IsBranch()) instr->MarkAsControl(); | |
380 } | 379 } |
381 | 380 |
382 | 381 |
383 // Shared routine for multiple binary operations. | 382 // Shared routine for multiple binary operations. |
384 static void VisitBinop(InstructionSelector* selector, Node* node, | 383 static void VisitBinop(InstructionSelector* selector, Node* node, |
385 InstructionCode opcode) { | 384 InstructionCode opcode) { |
386 FlagsContinuation cont; | 385 FlagsContinuation cont; |
387 VisitBinop(selector, node, opcode, &cont); | 386 VisitBinop(selector, node, opcode, &cont); |
388 } | 387 } |
389 | 388 |
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
769 | 768 |
770 namespace { | 769 namespace { |
771 | 770 |
772 // Shared routine for multiple compare operations. | 771 // Shared routine for multiple compare operations. |
773 void VisitCompare(InstructionSelector* selector, InstructionCode opcode, | 772 void VisitCompare(InstructionSelector* selector, InstructionCode opcode, |
774 InstructionOperand* left, InstructionOperand* right, | 773 InstructionOperand* left, InstructionOperand* right, |
775 FlagsContinuation* cont) { | 774 FlagsContinuation* cont) { |
776 IA32OperandGenerator g(selector); | 775 IA32OperandGenerator g(selector); |
777 if (cont->IsBranch()) { | 776 if (cont->IsBranch()) { |
778 selector->Emit(cont->Encode(opcode), NULL, left, right, | 777 selector->Emit(cont->Encode(opcode), NULL, left, right, |
779 g.Label(cont->true_block()), | 778 g.Label(cont->true_block()), g.Label(cont->false_block())); |
780 g.Label(cont->false_block()))->MarkAsControl(); | |
781 } else { | 779 } else { |
782 DCHECK(cont->IsSet()); | 780 DCHECK(cont->IsSet()); |
783 // TODO(titzer): Needs byte register. | 781 // TODO(titzer): Needs byte register. |
784 selector->Emit(cont->Encode(opcode), g.DefineAsRegister(cont->result()), | 782 selector->Emit(cont->Encode(opcode), g.DefineAsRegister(cont->result()), |
785 left, right); | 783 left, right); |
786 } | 784 } |
787 } | 785 } |
788 | 786 |
789 | 787 |
790 // Shared routine for multiple compare operations. | 788 // Shared routine for multiple compare operations. |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1002 return MachineOperatorBuilder::kFloat64Floor | | 1000 return MachineOperatorBuilder::kFloat64Floor | |
1003 MachineOperatorBuilder::kFloat64Ceil | | 1001 MachineOperatorBuilder::kFloat64Ceil | |
1004 MachineOperatorBuilder::kFloat64RoundTruncate | | 1002 MachineOperatorBuilder::kFloat64RoundTruncate | |
1005 MachineOperatorBuilder::kWord32ShiftIsSafe; | 1003 MachineOperatorBuilder::kWord32ShiftIsSafe; |
1006 } | 1004 } |
1007 return MachineOperatorBuilder::Flag::kNoFlags; | 1005 return MachineOperatorBuilder::Flag::kNoFlags; |
1008 } | 1006 } |
1009 } // namespace compiler | 1007 } // namespace compiler |
1010 } // namespace internal | 1008 } // namespace internal |
1011 } // namespace v8 | 1009 } // namespace v8 |
OLD | NEW |