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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
77 Node* NewNode(const Operator* op, Node* n1, Node* n2, Node* n3) { | 77 Node* NewNode(const Operator* op, Node* n1, Node* n2, Node* n3) { |
78 Node* buffer[] = {n1, n2, n3}; | 78 Node* buffer[] = {n1, n2, n3}; |
79 return MakeNode(op, arraysize(buffer), buffer, false); | 79 return MakeNode(op, arraysize(buffer), buffer, false); |
80 } | 80 } |
81 | 81 |
82 Node* NewNode(const Operator* op, Node* n1, Node* n2, Node* n3, Node* n4) { | 82 Node* NewNode(const Operator* op, Node* n1, Node* n2, Node* n3, Node* n4) { |
83 Node* buffer[] = {n1, n2, n3, n4}; | 83 Node* buffer[] = {n1, n2, n3, n4}; |
84 return MakeNode(op, arraysize(buffer), buffer, false); | 84 return MakeNode(op, arraysize(buffer), buffer, false); |
85 } | 85 } |
86 | 86 |
87 Node* NewNode(const Operator* op, Node* n1, Node* n2, Node* n3, Node* n4, | |
ahaas
2017/03/20 09:34:43
You could be super fancy and do this with variadic
ahaas
2017/03/20 09:53:36
better use
template<typename... Nodes>
Node*
Franzi
2017/03/20 15:38:39
No chance to be super fancy :( Don't need NewNode(
| |
88 Node* n5) { | |
89 Node* buffer[] = {n1, n2, n3, n4, n5}; | |
90 return MakeNode(op, arraysize(buffer), buffer, false); | |
91 } | |
92 | |
87 // Helpers to create new control nodes. | 93 // Helpers to create new control nodes. |
88 Node* NewIfTrue() { return NewNode(common()->IfTrue()); } | 94 Node* NewIfTrue() { return NewNode(common()->IfTrue()); } |
89 Node* NewIfFalse() { return NewNode(common()->IfFalse()); } | 95 Node* NewIfFalse() { return NewNode(common()->IfFalse()); } |
90 Node* NewMerge() { return NewNode(common()->Merge(1), true); } | 96 Node* NewMerge() { return NewNode(common()->Merge(1), true); } |
91 Node* NewLoop() { return NewNode(common()->Loop(1), true); } | 97 Node* NewLoop() { return NewNode(common()->Loop(1), true); } |
92 Node* NewBranch(Node* condition, BranchHint hint = BranchHint::kNone) { | 98 Node* NewBranch(Node* condition, BranchHint hint = BranchHint::kNone) { |
93 return NewNode(common()->Branch(hint), condition); | 99 return NewNode(common()->Branch(hint), condition); |
94 } | 100 } |
95 | 101 |
96 // Creates a new Phi node having {count} input values. | 102 // Creates a new Phi node having {count} input values. |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
349 static int const kBinaryOperationSmiHintIndex = 2; | 355 static int const kBinaryOperationSmiHintIndex = 2; |
350 | 356 |
351 DISALLOW_COPY_AND_ASSIGN(BytecodeGraphBuilder); | 357 DISALLOW_COPY_AND_ASSIGN(BytecodeGraphBuilder); |
352 }; | 358 }; |
353 | 359 |
354 } // namespace compiler | 360 } // namespace compiler |
355 } // namespace internal | 361 } // namespace internal |
356 } // namespace v8 | 362 } // namespace v8 |
357 | 363 |
358 #endif // V8_COMPILER_BYTECODE_GRAPH_BUILDER_H_ | 364 #endif // V8_COMPILER_BYTECODE_GRAPH_BUILDER_H_ |
OLD | NEW |