5 #ifndef V8_COMPILER_BRANCH_ELIMINATION_H_ 6 #define V8_COMPILER_BRANCH_ELIMINATION_H_ 8 #include "src/base/compiler-specific.h" 9 #include "src/compiler/functional-list.h" 10 #include "src/compiler/graph-reducer.h" 11 #include "src/compiler/node-aux-data.h" 12 #include "src/globals.h" 19 class CommonOperatorBuilder;
23 :
public NON_EXPORTED_BASE(AdvancedReducer) {
28 const char* reducer_name()
const override {
return "BranchElimination"; }
33 struct BranchCondition {
38 bool operator==(BranchCondition other)
const {
39 return condition == other.condition && branch == other.branch &&
40 is_true == other.is_true;
42 bool operator!=(BranchCondition other)
const {
return !(*
this == other); }
48 class ControlPathConditions :
public FunctionalList<BranchCondition> {
50 bool LookupCondition(
Node* condition,
Node** branch,
bool* is_true)
const;
51 void AddCondition(
Zone* zone,
Node* condition,
Node* branch,
bool is_true,
52 ControlPathConditions hint);
67 Reduction UpdateConditions(
Node* node, ControlPathConditions conditions);
68 Reduction UpdateConditions(
Node* node, ControlPathConditions prev_conditions,
69 Node* current_condition,
Node* current_branch,
72 Node* dead()
const {
return dead_; }
74 JSGraph* jsgraph()
const {
return jsgraph_; }
93 #endif // V8_COMPILER_BRANCH_ELIMINATION_H_