Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(118)

Side by Side Diff: src/compiler/instruction.h

Issue 2021433003: [turbofan] Add a CHECK for max node input count (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698