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 |
| 11 #include "src/ast-numbering.h" |
11 #include "src/compiler.h" | 12 #include "src/compiler.h" |
12 #include "src/compiler/linkage.h" | 13 #include "src/compiler/linkage.h" |
13 #include "src/compiler/pipeline.h" | 14 #include "src/compiler/pipeline.h" |
14 #include "src/execution.h" | 15 #include "src/execution.h" |
15 #include "src/full-codegen.h" | 16 #include "src/full-codegen.h" |
16 #include "src/handles.h" | 17 #include "src/handles.h" |
17 #include "src/objects-inl.h" | 18 #include "src/objects-inl.h" |
18 #include "src/parser.h" | 19 #include "src/parser.h" |
19 #include "src/rewriter.h" | 20 #include "src/rewriter.h" |
20 #include "src/scopes.h" | 21 #include "src/scopes.h" |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 info.MarkAsContextSpecializing(); | 160 info.MarkAsContextSpecializing(); |
160 } | 161 } |
161 if (flags_ & CompilationInfo::kInliningEnabled) { | 162 if (flags_ & CompilationInfo::kInliningEnabled) { |
162 info.MarkAsInliningEnabled(); | 163 info.MarkAsInliningEnabled(); |
163 } | 164 } |
164 if (flags_ & CompilationInfo::kTypingEnabled) { | 165 if (flags_ & CompilationInfo::kTypingEnabled) { |
165 info.MarkAsTypingEnabled(); | 166 info.MarkAsTypingEnabled(); |
166 } | 167 } |
167 CHECK(Rewriter::Rewrite(&info)); | 168 CHECK(Rewriter::Rewrite(&info)); |
168 CHECK(Scope::Analyze(&info)); | 169 CHECK(Scope::Analyze(&info)); |
| 170 CHECK(AstNumbering::Renumber(info.function(), info.zone())); |
169 CHECK(Compiler::EnsureDeoptimizationSupport(&info)); | 171 CHECK(Compiler::EnsureDeoptimizationSupport(&info)); |
170 | 172 |
171 Pipeline pipeline(&info); | 173 Pipeline pipeline(&info); |
172 Handle<Code> code = pipeline.GenerateCode(); | 174 Handle<Code> code = pipeline.GenerateCode(); |
173 if (FLAG_turbo_deoptimization) { | 175 if (FLAG_turbo_deoptimization) { |
174 info.context()->native_context()->AddOptimizedCode(*code); | 176 info.context()->native_context()->AddOptimizedCode(*code); |
175 } | 177 } |
176 | 178 |
177 CHECK(!code.is_null()); | 179 CHECK(!code.is_null()); |
178 function->ReplaceCode(*code); | 180 function->ReplaceCode(*code); |
(...skipping 29 matching lines...) Expand all Loading... |
208 // and replace the JSFunction's code with the result. | 210 // and replace the JSFunction's code with the result. |
209 Handle<JSFunction> CompileGraph(Graph* graph) { | 211 Handle<JSFunction> CompileGraph(Graph* graph) { |
210 CHECK(Pipeline::SupportedTarget()); | 212 CHECK(Pipeline::SupportedTarget()); |
211 CompilationInfoWithZone info(function); | 213 CompilationInfoWithZone info(function); |
212 | 214 |
213 CHECK(Parser::Parse(&info)); | 215 CHECK(Parser::Parse(&info)); |
214 info.SetOptimizing(BailoutId::None(), | 216 info.SetOptimizing(BailoutId::None(), |
215 Handle<Code>(function->shared()->code())); | 217 Handle<Code>(function->shared()->code())); |
216 CHECK(Rewriter::Rewrite(&info)); | 218 CHECK(Rewriter::Rewrite(&info)); |
217 CHECK(Scope::Analyze(&info)); | 219 CHECK(Scope::Analyze(&info)); |
| 220 CHECK(AstNumbering::Renumber(info.function(), info.zone())); |
218 CHECK(Compiler::EnsureDeoptimizationSupport(&info)); | 221 CHECK(Compiler::EnsureDeoptimizationSupport(&info)); |
219 | 222 |
220 Pipeline pipeline(&info); | 223 Pipeline pipeline(&info); |
221 Linkage linkage(&info); | 224 Linkage linkage(&info); |
222 Handle<Code> code = pipeline.GenerateCodeForMachineGraph(&linkage, graph); | 225 Handle<Code> code = pipeline.GenerateCodeForMachineGraph(&linkage, graph); |
223 CHECK(!code.is_null()); | 226 CHECK(!code.is_null()); |
224 function->ReplaceCode(*code); | 227 function->ReplaceCode(*code); |
225 return function; | 228 return function; |
226 } | 229 } |
227 }; | 230 }; |
228 } | 231 } |
229 } | 232 } |
230 } // namespace v8::internal::compiler | 233 } // namespace v8::internal::compiler |
231 | 234 |
232 #endif // V8_CCTEST_COMPILER_FUNCTION_TESTER_H_ | 235 #endif // V8_CCTEST_COMPILER_FUNCTION_TESTER_H_ |
OLD | NEW |