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

Unified Diff: src/compiler/instruction-selector.h

Issue 1019803005: [turbofan] Factor out common switch-related code in instruction selectors. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/ia32/instruction-selector-ia32.cc ('k') | src/compiler/instruction-selector.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/instruction-selector.h
diff --git a/src/compiler/instruction-selector.h b/src/compiler/instruction-selector.h
index 937ed4db34f2497686e1f12ed1b50f255c85c108..fcf205a8d9f8530ce918211d8e1b5a22a5e2ce08 100644
--- a/src/compiler/instruction-selector.h
+++ b/src/compiler/instruction-selector.h
@@ -22,6 +22,7 @@ class BasicBlock;
struct CallBuffer; // TODO(bmeurer): Remove this.
class FlagsContinuation;
class Linkage;
+struct SwitchInfo;
typedef ZoneVector<InstructionOperand> InstructionOperandVector;
@@ -134,6 +135,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 +206,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);
« no previous file with comments | « src/compiler/ia32/instruction-selector-ia32.cc ('k') | src/compiler/instruction-selector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698