| 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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 } | 169 } |
| 170 if (flags_ & CompilationInfo::kTypingEnabled) { | 170 if (flags_ & CompilationInfo::kTypingEnabled) { |
| 171 info.MarkAsTypingEnabled(); | 171 info.MarkAsTypingEnabled(); |
| 172 } | 172 } |
| 173 CHECK(Compiler::Analyze(info.parse_info())); | 173 CHECK(Compiler::Analyze(info.parse_info())); |
| 174 CHECK(Compiler::EnsureDeoptimizationSupport(&info)); | 174 CHECK(Compiler::EnsureDeoptimizationSupport(&info)); |
| 175 | 175 |
| 176 Pipeline pipeline(&info); | 176 Pipeline pipeline(&info); |
| 177 Handle<Code> code = pipeline.GenerateCode(); | 177 Handle<Code> code = pipeline.GenerateCode(); |
| 178 CHECK(!code.is_null()); | 178 CHECK(!code.is_null()); |
| 179 info.dependencies()->Commit(code); |
| 179 info.context()->native_context()->AddOptimizedCode(*code); | 180 info.context()->native_context()->AddOptimizedCode(*code); |
| 180 function->ReplaceCode(*code); | 181 function->ReplaceCode(*code); |
| 181 return function; | 182 return function; |
| 182 } | 183 } |
| 183 | 184 |
| 184 static Handle<JSFunction> ForMachineGraph(Graph* graph) { | 185 static Handle<JSFunction> ForMachineGraph(Graph* graph) { |
| 185 JSFunction* p = NULL; | 186 JSFunction* p = NULL; |
| 186 { // because of the implicit handle scope of FunctionTester. | 187 { // because of the implicit handle scope of FunctionTester. |
| 187 FunctionTester f(graph); | 188 FunctionTester f(graph); |
| 188 p = *f.function; | 189 p = *f.function; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 210 CHECK(!code.is_null()); | 211 CHECK(!code.is_null()); |
| 211 function->ReplaceCode(*code); | 212 function->ReplaceCode(*code); |
| 212 return function; | 213 return function; |
| 213 } | 214 } |
| 214 }; | 215 }; |
| 215 } // namespace compiler | 216 } // namespace compiler |
| 216 } // namespace internal | 217 } // namespace internal |
| 217 } // namespace v8 | 218 } // namespace v8 |
| 218 | 219 |
| 219 #endif // V8_CCTEST_COMPILER_FUNCTION_TESTER_H_ | 220 #endif // V8_CCTEST_COMPILER_FUNCTION_TESTER_H_ |
| OLD | NEW |