| 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_FUNCTION_TESTER_H_ | 5 #ifndef V8_CCTEST_COMPILER_FUNCTION_TESTER_H_ |
| 6 #define V8_CCTEST_COMPILER_FUNCTION_TESTER_H_ | 6 #define V8_CCTEST_COMPILER_FUNCTION_TESTER_H_ |
| 7 | 7 |
| 8 #include "src/v8.h" | 8 #include "src/v8.h" |
| 9 #include "test/cctest/cctest.h" | 9 #include "test/cctest/cctest.h" |
| 10 | 10 |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 Handle<JSFunction> CompileGraph(Graph* graph) { | 209 Handle<JSFunction> CompileGraph(Graph* graph) { |
| 210 CHECK(Pipeline::SupportedTarget()); | 210 CHECK(Pipeline::SupportedTarget()); |
| 211 CompilationInfoWithZone info(function); | 211 CompilationInfoWithZone info(function); |
| 212 | 212 |
| 213 CHECK(Parser::Parse(&info)); | 213 CHECK(Parser::Parse(&info)); |
| 214 info.SetOptimizing(BailoutId::None(), | 214 info.SetOptimizing(BailoutId::None(), |
| 215 Handle<Code>(function->shared()->code())); | 215 Handle<Code>(function->shared()->code())); |
| 216 CHECK(Compiler::Analyze(&info)); | 216 CHECK(Compiler::Analyze(&info)); |
| 217 CHECK(Compiler::EnsureDeoptimizationSupport(&info)); | 217 CHECK(Compiler::EnsureDeoptimizationSupport(&info)); |
| 218 | 218 |
| 219 Pipeline pipeline(&info); | 219 Handle<Code> code = Pipeline::GenerateCodeForTesting(&info, graph); |
| 220 Linkage linkage(info.zone(), &info); | |
| 221 Handle<Code> code = pipeline.GenerateCodeForMachineGraph(&linkage, graph); | |
| 222 CHECK(!code.is_null()); | 220 CHECK(!code.is_null()); |
| 223 function->ReplaceCode(*code); | 221 function->ReplaceCode(*code); |
| 224 return function; | 222 return function; |
| 225 } | 223 } |
| 226 }; | 224 }; |
| 227 } | 225 } |
| 228 } | 226 } |
| 229 } // namespace v8::internal::compiler | 227 } // namespace v8::internal::compiler |
| 230 | 228 |
| 231 #endif // V8_CCTEST_COMPILER_FUNCTION_TESTER_H_ | 229 #endif // V8_CCTEST_COMPILER_FUNCTION_TESTER_H_ |
| OLD | NEW |