Chromium Code Reviews| Index: src/compiler/instruction-selector.h |
| diff --git a/src/compiler/instruction-selector.h b/src/compiler/instruction-selector.h |
| index 937ed4db34f2497686e1f12ed1b50f255c85c108..d5156106bb8b51e0ee452c725cd37d7b1a133d16 100644 |
| --- a/src/compiler/instruction-selector.h |
| +++ b/src/compiler/instruction-selector.h |
| @@ -23,6 +23,16 @@ struct CallBuffer; // TODO(bmeurer): Remove this. |
| class FlagsContinuation; |
| class Linkage; |
| +struct SwitchInfo { |
|
Benedikt Meurer
2015/03/25 17:52:48
Please move this struct to the -impl.h file, and a
titzer
2015/03/26 08:27:37
Done.
|
| + int32_t min_value; |
| + int32_t max_value; |
| + size_t value_range; |
| + size_t case_count; |
| + int32_t* case_values; |
| + BasicBlock** case_branches; |
| + BasicBlock* default_branch; |
| +}; |
| + |
| typedef ZoneVector<InstructionOperand> InstructionOperandVector; |
| @@ -134,6 +144,10 @@ class InstructionSelector FINAL { |
| private: |
| friend class OperandGenerator; |
| + void EmitTableSwitch(const SwitchInfo& sw, InstructionOperand& index_operand); |
| + void EmitLookupSwitch(const SwitchInfo& sw, |
| + InstructionOperand& value_operand); |
| + |
| // Inform the instruction selection that {node} was just defined. |
| void MarkAsDefined(Node* node); |
| @@ -201,9 +215,7 @@ class InstructionSelector FINAL { |
| void VisitCall(Node* call, BasicBlock* handler); |
| void VisitGoto(BasicBlock* target); |
| void VisitBranch(Node* input, BasicBlock* tbranch, BasicBlock* fbranch); |
| - void VisitSwitch(Node* node, BasicBlock* default_branch, |
| - BasicBlock** case_branches, int32_t* case_values, |
| - size_t case_count, int32_t min_value, int32_t max_value); |
| + void VisitSwitch(Node* node, const SwitchInfo& sw); |
| void VisitDeoptimize(Node* value); |
| void VisitReturn(Node* value); |
| void VisitThrow(Node* value); |