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

Unified Diff: src/compiler/instruction-selector-impl.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/instruction-selector.cc ('k') | src/compiler/mips/instruction-selector-mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/instruction-selector-impl.h
diff --git a/src/compiler/instruction-selector-impl.h b/src/compiler/instruction-selector-impl.h
index 279cbcb805c0e5935e3a2226f1a50ff0d74009d3..657167ee7dc388fbe1b8c917dabfc691d204b441 100644
--- a/src/compiler/instruction-selector-impl.h
+++ b/src/compiler/instruction-selector-impl.h
@@ -15,6 +15,17 @@ namespace v8 {
namespace internal {
namespace compiler {
+// Helper struct containing data about a table or lookup switch.
+struct SwitchInfo {
+ int32_t min_value; // minimum value of {case_values}
+ int32_t max_value; // maximum value of {case_values}
+ size_t value_range; // |max_value - min_value| + 1
+ size_t case_count; // number of cases
+ int32_t* case_values; // actual case values, unsorted
+ BasicBlock** case_branches; // basic blocks corresponding to case values
+ BasicBlock* default_branch; // default branch target
+};
+
// A helper class for the instruction selector that simplifies construction of
// Operands. This class implements a base for architecture-specific helpers.
class OperandGenerator {
« no previous file with comments | « src/compiler/instruction-selector.cc ('k') | src/compiler/mips/instruction-selector-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698