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_SELECTOR_IMPL_H_ | 5 #ifndef V8_COMPILER_INSTRUCTION_SELECTOR_IMPL_H_ |
6 #define V8_COMPILER_INSTRUCTION_SELECTOR_IMPL_H_ | 6 #define V8_COMPILER_INSTRUCTION_SELECTOR_IMPL_H_ |
7 | 7 |
8 #include "src/compiler/instruction.h" | 8 #include "src/compiler/instruction.h" |
9 #include "src/compiler/instruction-selector.h" | 9 #include "src/compiler/instruction-selector.h" |
10 #include "src/compiler/linkage.h" | 10 #include "src/compiler/linkage.h" |
11 #include "src/compiler/schedule.h" | 11 #include "src/compiler/schedule.h" |
12 #include "src/macro-assembler.h" | 12 #include "src/macro-assembler.h" |
13 | 13 |
14 namespace v8 { | 14 namespace v8 { |
15 namespace internal { | 15 namespace internal { |
16 namespace compiler { | 16 namespace compiler { |
17 | 17 |
| 18 // Helper struct containing data about a table or lookup switch. |
| 19 struct SwitchInfo { |
| 20 int32_t min_value; // minimum value of {case_values} |
| 21 int32_t max_value; // maximum value of {case_values} |
| 22 size_t value_range; // |max_value - min_value| + 1 |
| 23 size_t case_count; // number of cases |
| 24 int32_t* case_values; // actual case values, unsorted |
| 25 BasicBlock** case_branches; // basic blocks corresponding to case values |
| 26 BasicBlock* default_branch; // default branch target |
| 27 }; |
| 28 |
18 // A helper class for the instruction selector that simplifies construction of | 29 // A helper class for the instruction selector that simplifies construction of |
19 // Operands. This class implements a base for architecture-specific helpers. | 30 // Operands. This class implements a base for architecture-specific helpers. |
20 class OperandGenerator { | 31 class OperandGenerator { |
21 public: | 32 public: |
22 explicit OperandGenerator(InstructionSelector* selector) | 33 explicit OperandGenerator(InstructionSelector* selector) |
23 : selector_(selector) {} | 34 : selector_(selector) {} |
24 | 35 |
25 InstructionOperand NoOutput() { | 36 InstructionOperand NoOutput() { |
26 return InstructionOperand(); // Generates an invalid operand. | 37 return InstructionOperand(); // Generates an invalid operand. |
27 } | 38 } |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 : (frame_state_descriptor->GetTotalSize() + | 380 : (frame_state_descriptor->GetTotalSize() + |
370 1); // Include deopt id. | 381 1); // Include deopt id. |
371 } | 382 } |
372 }; | 383 }; |
373 | 384 |
374 } // namespace compiler | 385 } // namespace compiler |
375 } // namespace internal | 386 } // namespace internal |
376 } // namespace v8 | 387 } // namespace v8 |
377 | 388 |
378 #endif // V8_COMPILER_INSTRUCTION_SELECTOR_IMPL_H_ | 389 #endif // V8_COMPILER_INSTRUCTION_SELECTOR_IMPL_H_ |
OLD | NEW |