Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1153)

Side by Side Diff: test/cctest/compiler/function-tester.cc

Issue 2534393002: Split parsing of functions and top-level code into two separate methods (Closed)
Patch Set: updates Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/v8.gyp ('k') | test/cctest/compiler/test-loop-assignment-analysis.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "test/cctest/compiler/function-tester.h" 5 #include "test/cctest/compiler/function-tester.h"
6 6
7 #include "src/ast/ast-numbering.h" 7 #include "src/ast/ast-numbering.h"
8 #include "src/compilation-info.h" 8 #include "src/compilation-info.h"
9 #include "src/compiler.h" 9 #include "src/compiler.h"
10 #include "src/compiler/linkage.h" 10 #include "src/compiler/linkage.h"
11 #include "src/compiler/pipeline.h" 11 #include "src/compiler/pipeline.h"
12 #include "src/execution.h" 12 #include "src/execution.h"
13 #include "src/full-codegen/full-codegen.h" 13 #include "src/full-codegen/full-codegen.h"
14 #include "src/handles.h" 14 #include "src/handles.h"
15 #include "src/objects-inl.h" 15 #include "src/objects-inl.h"
16 #include "src/parsing/parse-info.h" 16 #include "src/parsing/parse-info.h"
17 #include "src/parsing/parser.h" 17 #include "src/parsing/parsing.h"
18 #include "test/cctest/cctest.h" 18 #include "test/cctest/cctest.h"
19 19
20 namespace v8 { 20 namespace v8 {
21 namespace internal { 21 namespace internal {
22 namespace compiler { 22 namespace compiler {
23 23
24 FunctionTester::FunctionTester(const char* source, uint32_t flags) 24 FunctionTester::FunctionTester(const char* source, uint32_t flags)
25 : isolate(main_isolate()), 25 : isolate(main_isolate()),
26 function((FLAG_allow_natives_syntax = true, NewFunction(source))), 26 function((FLAG_allow_natives_syntax = true, NewFunction(source))),
27 flags_(flags) { 27 flags_(flags) {
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 return function; 182 return function;
183 } 183 }
184 184
185 // Compile the given machine graph instead of the source of the function 185 // Compile the given machine graph instead of the source of the function
186 // and replace the JSFunction's code with the result. 186 // and replace the JSFunction's code with the result.
187 Handle<JSFunction> FunctionTester::CompileGraph(Graph* graph) { 187 Handle<JSFunction> FunctionTester::CompileGraph(Graph* graph) {
188 Zone zone(function->GetIsolate()->allocator(), ZONE_NAME); 188 Zone zone(function->GetIsolate()->allocator(), ZONE_NAME);
189 ParseInfo parse_info(&zone, handle(function->shared())); 189 ParseInfo parse_info(&zone, handle(function->shared()));
190 CompilationInfo info(&parse_info, function); 190 CompilationInfo info(&parse_info, function);
191 191
192 CHECK(Parser::ParseStatic(info.parse_info())); 192 CHECK(parsing::ParseFunction(info.parse_info()));
193 info.SetOptimizing(); 193 info.SetOptimizing();
194 194
195 Handle<Code> code = Pipeline::GenerateCodeForTesting(&info, graph); 195 Handle<Code> code = Pipeline::GenerateCodeForTesting(&info, graph);
196 CHECK(!code.is_null()); 196 CHECK(!code.is_null());
197 function->ReplaceCode(*code); 197 function->ReplaceCode(*code);
198 return function; 198 return function;
199 } 199 }
200 200
201 } // namespace compiler 201 } // namespace compiler
202 } // namespace internal 202 } // namespace internal
203 } // namespace v8 203 } // namespace v8
OLDNEW
« no previous file with comments | « src/v8.gyp ('k') | test/cctest/compiler/test-loop-assignment-analysis.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698