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 #ifndef V8_COMPILER_INSTRUCTION_H_ | 5 #ifndef V8_COMPILER_INSTRUCTION_H_ |
6 #define V8_COMPILER_INSTRUCTION_H_ | 6 #define V8_COMPILER_INSTRUCTION_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <iosfwd> | 9 #include <iosfwd> |
10 #include <map> | 10 #include <map> |
(...skipping 797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
808 } | 808 } |
809 | 809 |
810 static Instruction* New(Zone* zone, InstructionCode opcode, | 810 static Instruction* New(Zone* zone, InstructionCode opcode, |
811 size_t output_count, InstructionOperand* outputs, | 811 size_t output_count, InstructionOperand* outputs, |
812 size_t input_count, InstructionOperand* inputs, | 812 size_t input_count, InstructionOperand* inputs, |
813 size_t temp_count, InstructionOperand* temps) { | 813 size_t temp_count, InstructionOperand* temps) { |
814 DCHECK(opcode >= 0); | 814 DCHECK(opcode >= 0); |
815 DCHECK(output_count == 0 || outputs != nullptr); | 815 DCHECK(output_count == 0 || outputs != nullptr); |
816 DCHECK(input_count == 0 || inputs != nullptr); | 816 DCHECK(input_count == 0 || inputs != nullptr); |
817 DCHECK(temp_count == 0 || temps != nullptr); | 817 DCHECK(temp_count == 0 || temps != nullptr); |
| 818 // TODO(jarin/mstarzinger): Handle this gracefully. See crbug.com/582702. |
| 819 CHECK(InputCountField::is_valid(input_count)); |
| 820 |
818 size_t total_extra_ops = output_count + input_count + temp_count; | 821 size_t total_extra_ops = output_count + input_count + temp_count; |
819 if (total_extra_ops != 0) total_extra_ops--; | 822 if (total_extra_ops != 0) total_extra_ops--; |
820 int size = static_cast<int>( | 823 int size = static_cast<int>( |
821 RoundUp(sizeof(Instruction), sizeof(InstructionOperand)) + | 824 RoundUp(sizeof(Instruction), sizeof(InstructionOperand)) + |
822 total_extra_ops * sizeof(InstructionOperand)); | 825 total_extra_ops * sizeof(InstructionOperand)); |
823 return new (zone->New(size)) Instruction( | 826 return new (zone->New(size)) Instruction( |
824 opcode, output_count, outputs, input_count, inputs, temp_count, temps); | 827 opcode, output_count, outputs, input_count, inputs, temp_count, temps); |
825 } | 828 } |
826 | 829 |
827 Instruction* MarkAsCall() { | 830 Instruction* MarkAsCall() { |
(...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1467 | 1470 |
1468 | 1471 |
1469 std::ostream& operator<<(std::ostream& os, | 1472 std::ostream& operator<<(std::ostream& os, |
1470 const PrintableInstructionSequence& code); | 1473 const PrintableInstructionSequence& code); |
1471 | 1474 |
1472 } // namespace compiler | 1475 } // namespace compiler |
1473 } // namespace internal | 1476 } // namespace internal |
1474 } // namespace v8 | 1477 } // namespace v8 |
1475 | 1478 |
1476 #endif // V8_COMPILER_INSTRUCTION_H_ | 1479 #endif // V8_COMPILER_INSTRUCTION_H_ |
OLD | NEW |