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 return_ = | 89 Node* zero = graph()->NewNode(common()->Int32Constant(0)); |
90 graph()->NewNode(common()->Return(), value, effect_, graph()->start()); | 90 return_ = graph()->NewNode(common()->Return(), zero, value, effect_, |
| 91 graph()->start()); |
91 effect_ = NULL; | 92 effect_ = NULL; |
92 } | 93 } |
93 | 94 |
94 // Close the graph. | 95 // Close the graph. |
95 void End() { | 96 void End() { |
96 Node* end = graph()->NewNode(common()->End(1), return_); | 97 Node* end = graph()->NewNode(common()->End(1), return_); |
97 graph()->SetEnd(end); | 98 graph()->SetEnd(end); |
98 } | 99 } |
99 | 100 |
100 Node* PointerConstant(void* value) { | 101 Node* PointerConstant(void* value) { |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 Node* return_; | 307 Node* return_; |
307 Node** parameters_; | 308 Node** parameters_; |
308 MaybeHandle<Code> code_; | 309 MaybeHandle<Code> code_; |
309 }; | 310 }; |
310 | 311 |
311 } // namespace compiler | 312 } // namespace compiler |
312 } // namespace internal | 313 } // namespace internal |
313 } // namespace v8 | 314 } // namespace v8 |
314 | 315 |
315 #endif // V8_CCTEST_COMPILER_GRAPH_BUILDER_TESTER_H_ | 316 #endif // V8_CCTEST_COMPILER_GRAPH_BUILDER_TESTER_H_ |
OLD | NEW |