OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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_BYTECODE_GRAPH_BUILDER_H_ | 5 #ifndef V8_COMPILER_BYTECODE_GRAPH_BUILDER_H_ |
6 #define V8_COMPILER_BYTECODE_GRAPH_BUILDER_H_ | 6 #define V8_COMPILER_BYTECODE_GRAPH_BUILDER_H_ |
7 | 7 |
8 #include "src/compiler/bytecode-analysis.h" | 8 #include "src/compiler/bytecode-analysis.h" |
9 #include "src/compiler/js-graph.h" | 9 #include "src/compiler/js-graph.h" |
10 #include "src/compiler/liveness-analyzer.h" | 10 #include "src/compiler/liveness-analyzer.h" |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 Node* NewNode(const Operator* op, Node* n1, Node* n2, Node* n3) { | 78 Node* NewNode(const Operator* op, Node* n1, Node* n2, Node* n3) { |
79 Node* buffer[] = {n1, n2, n3}; | 79 Node* buffer[] = {n1, n2, n3}; |
80 return MakeNode(op, arraysize(buffer), buffer, false); | 80 return MakeNode(op, arraysize(buffer), buffer, false); |
81 } | 81 } |
82 | 82 |
83 Node* NewNode(const Operator* op, Node* n1, Node* n2, Node* n3, Node* n4) { | 83 Node* NewNode(const Operator* op, Node* n1, Node* n2, Node* n3, Node* n4) { |
84 Node* buffer[] = {n1, n2, n3, n4}; | 84 Node* buffer[] = {n1, n2, n3, n4}; |
85 return MakeNode(op, arraysize(buffer), buffer, false); | 85 return MakeNode(op, arraysize(buffer), buffer, false); |
86 } | 86 } |
87 | 87 |
88 Node* NewNode(const Operator* op, Node* n1, Node* n2, Node* n3, Node* n4, | |
89 Node* n5) { | |
90 Node* buffer[] = {n1, n2, n3, n4, n5}; | |
91 return MakeNode(op, arraysize(buffer), buffer, false); | |
92 } | |
93 | |
94 // Helpers to create new control nodes. | 88 // Helpers to create new control nodes. |
95 Node* NewIfTrue() { return NewNode(common()->IfTrue()); } | 89 Node* NewIfTrue() { return NewNode(common()->IfTrue()); } |
96 Node* NewIfFalse() { return NewNode(common()->IfFalse()); } | 90 Node* NewIfFalse() { return NewNode(common()->IfFalse()); } |
97 Node* NewMerge() { return NewNode(common()->Merge(1), true); } | 91 Node* NewMerge() { return NewNode(common()->Merge(1), true); } |
98 Node* NewLoop() { return NewNode(common()->Loop(1), true); } | 92 Node* NewLoop() { return NewNode(common()->Loop(1), true); } |
99 Node* NewBranch(Node* condition, BranchHint hint = BranchHint::kNone) { | 93 Node* NewBranch(Node* condition, BranchHint hint = BranchHint::kNone) { |
100 return NewNode(common()->Branch(hint), condition); | 94 return NewNode(common()->Branch(hint), condition); |
101 } | 95 } |
102 | 96 |
103 // Creates a new Phi node having {count} input values. | 97 // Creates a new Phi node having {count} input values. |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 static int const kBinaryOperationSmiHintIndex = 2; | 314 static int const kBinaryOperationSmiHintIndex = 2; |
321 | 315 |
322 DISALLOW_COPY_AND_ASSIGN(BytecodeGraphBuilder); | 316 DISALLOW_COPY_AND_ASSIGN(BytecodeGraphBuilder); |
323 }; | 317 }; |
324 | 318 |
325 } // namespace compiler | 319 } // namespace compiler |
326 } // namespace internal | 320 } // namespace internal |
327 } // namespace v8 | 321 } // namespace v8 |
328 | 322 |
329 #endif // V8_COMPILER_BYTECODE_GRAPH_BUILDER_H_ | 323 #endif // V8_COMPILER_BYTECODE_GRAPH_BUILDER_H_ |
OLD | NEW |