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

Side by Side Diff: src/compiler/common-operator.h

Issue 931623002: [turbofan] Optimize certain chains of Branch into a Switch. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addrssed comments. Created 5 years, 10 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 unified diff | Download patch
« no previous file with comments | « src/compiler/code-generator.h ('k') | src/compiler/common-operator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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_COMMON_OPERATOR_H_ 5 #ifndef V8_COMPILER_COMMON_OPERATOR_H_
6 #define V8_COMPILER_COMMON_OPERATOR_H_ 6 #define V8_COMPILER_COMMON_OPERATOR_H_
7 7
8 #include "src/compiler/machine-type.h" 8 #include "src/compiler/machine-type.h"
9 #include "src/unique.h" 9 #include "src/unique.h"
10 10
(...skipping 15 matching lines...) Expand all
26 // Prediction hint for branches. 26 // Prediction hint for branches.
27 enum class BranchHint : uint8_t { kNone, kTrue, kFalse }; 27 enum class BranchHint : uint8_t { kNone, kTrue, kFalse };
28 28
29 inline size_t hash_value(BranchHint hint) { return static_cast<size_t>(hint); } 29 inline size_t hash_value(BranchHint hint) { return static_cast<size_t>(hint); }
30 30
31 std::ostream& operator<<(std::ostream&, BranchHint); 31 std::ostream& operator<<(std::ostream&, BranchHint);
32 32
33 BranchHint BranchHintOf(const Operator* const); 33 BranchHint BranchHintOf(const Operator* const);
34 34
35 35
36 size_t CaseIndexOf(const Operator* const);
37
38
39 class SelectParameters FINAL { 36 class SelectParameters FINAL {
40 public: 37 public:
41 explicit SelectParameters(MachineType type, 38 explicit SelectParameters(MachineType type,
42 BranchHint hint = BranchHint::kNone) 39 BranchHint hint = BranchHint::kNone)
43 : type_(type), hint_(hint) {} 40 : type_(type), hint_(hint) {}
44 41
45 MachineType type() const { return type_; } 42 MachineType type() const { return type_; }
46 BranchHint hint() const { return hint_; } 43 BranchHint hint() const { return hint_; }
47 44
48 private: 45 private:
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 // still unfoldable. This is required to properly connect non terminating 166 // still unfoldable. This is required to properly connect non terminating
170 // loops to end (in both the sea of nodes and the CFG). 167 // loops to end (in both the sea of nodes and the CFG).
171 const Operator* Always(); 168 const Operator* Always();
172 169
173 const Operator* Dead(); 170 const Operator* Dead();
174 const Operator* End(); 171 const Operator* End();
175 const Operator* Branch(BranchHint = BranchHint::kNone); 172 const Operator* Branch(BranchHint = BranchHint::kNone);
176 const Operator* IfTrue(); 173 const Operator* IfTrue();
177 const Operator* IfFalse(); 174 const Operator* IfFalse();
178 const Operator* Switch(size_t control_output_count); 175 const Operator* Switch(size_t control_output_count);
179 const Operator* Case(size_t index); 176 const Operator* IfValue(int32_t value);
177 const Operator* IfDefault();
180 const Operator* Throw(); 178 const Operator* Throw();
181 const Operator* Return(); 179 const Operator* Return();
182 180
183 const Operator* Start(int num_formal_parameters); 181 const Operator* Start(int num_formal_parameters);
184 const Operator* Loop(int control_input_count); 182 const Operator* Loop(int control_input_count);
185 const Operator* Merge(int control_input_count); 183 const Operator* Merge(int control_input_count);
186 const Operator* Parameter(int index); 184 const Operator* Parameter(int index);
187 185
188 const Operator* OsrNormalEntry(); 186 const Operator* OsrNormalEntry();
189 const Operator* OsrLoopEntry(); 187 const Operator* OsrLoopEntry();
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 Zone* const zone_; 220 Zone* const zone_;
223 221
224 DISALLOW_COPY_AND_ASSIGN(CommonOperatorBuilder); 222 DISALLOW_COPY_AND_ASSIGN(CommonOperatorBuilder);
225 }; 223 };
226 224
227 } // namespace compiler 225 } // namespace compiler
228 } // namespace internal 226 } // namespace internal
229 } // namespace v8 227 } // namespace v8
230 228
231 #endif // V8_COMPILER_COMMON_OPERATOR_H_ 229 #endif // V8_COMPILER_COMMON_OPERATOR_H_
OLDNEW
« no previous file with comments | « src/compiler/code-generator.h ('k') | src/compiler/common-operator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698