OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_CCTEST_COMPILER_GRAPH_BUILDER_TESTER_H_ | 5 #ifndef V8_CCTEST_COMPILER_GRAPH_BUILDER_TESTER_H_ |
6 #define V8_CCTEST_COMPILER_GRAPH_BUILDER_TESTER_H_ | 6 #define V8_CCTEST_COMPILER_GRAPH_BUILDER_TESTER_H_ |
7 | 7 |
8 #include "src/compilation-info.h" | 8 #include "src/compilation-info.h" |
9 #include "src/compiler/common-operator.h" | 9 #include "src/compiler/common-operator.h" |
10 #include "src/compiler/instruction-selector.h" | 10 #include "src/compiler/instruction-selector.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 | 79 |
80 // Initialize graph and builder. | 80 // Initialize graph and builder. |
81 void Begin(int num_parameters) { | 81 void Begin(int num_parameters) { |
82 CHECK_NULL(graph()->start()); | 82 CHECK_NULL(graph()->start()); |
83 Node* start = graph()->NewNode(common()->Start(num_parameters + 3)); | 83 Node* start = graph()->NewNode(common()->Start(num_parameters + 3)); |
84 graph()->SetStart(start); | 84 graph()->SetStart(start); |
85 effect_ = start; | 85 effect_ = start; |
86 } | 86 } |
87 | 87 |
88 void Return(Node* value) { | 88 void Return(Node* value) { |
89 Node* zero = graph()->NewNode(common()->Int32Constant(0)); | 89 return_ = |
90 return_ = graph()->NewNode(common()->Return(), zero, value, effect_, | 90 graph()->NewNode(common()->Return(), value, effect_, graph()->start()); |
91 graph()->start()); | |
92 effect_ = NULL; | 91 effect_ = NULL; |
93 } | 92 } |
94 | 93 |
95 // Close the graph. | 94 // Close the graph. |
96 void End() { | 95 void End() { |
97 Node* end = graph()->NewNode(common()->End(1), return_); | 96 Node* end = graph()->NewNode(common()->End(1), return_); |
98 graph()->SetEnd(end); | 97 graph()->SetEnd(end); |
99 } | 98 } |
100 | 99 |
101 Node* PointerConstant(void* value) { | 100 Node* PointerConstant(void* value) { |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 Node* return_; | 306 Node* return_; |
308 Node** parameters_; | 307 Node** parameters_; |
309 MaybeHandle<Code> code_; | 308 MaybeHandle<Code> code_; |
310 }; | 309 }; |
311 | 310 |
312 } // namespace compiler | 311 } // namespace compiler |
313 } // namespace internal | 312 } // namespace internal |
314 } // namespace v8 | 313 } // namespace v8 |
315 | 314 |
316 #endif // V8_CCTEST_COMPILER_GRAPH_BUILDER_TESTER_H_ | 315 #endif // V8_CCTEST_COMPILER_GRAPH_BUILDER_TESTER_H_ |
OLD | NEW |