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

Side by Side Diff: test/cctest/compiler/test-loop-assignment-analysis.cc

Issue 2645403002: [Compiler] Enable use of seperate zones for parsing and compiling. (Closed)
Patch Set: Add back header Created 3 years, 10 months 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
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 "src/ast/scopes.h" 5 #include "src/ast/scopes.h"
6 #include "src/compilation-info.h" 6 #include "src/compilation-info.h"
7 #include "src/compiler/ast-loop-assignment-analyzer.h" 7 #include "src/compiler/ast-loop-assignment-analyzer.h"
8 #include "src/objects-inl.h" 8 #include "src/objects-inl.h"
9 #include "src/parsing/parse-info.h" 9 #include "src/parsing/parse-info.h"
10 #include "src/parsing/parsing.h" 10 #include "src/parsing/parsing.h"
(...skipping 16 matching lines...) Expand all
27 ScopedVector<char> program(kBufferSize); 27 ScopedVector<char> program(kBufferSize);
28 SNPrintF(program, "function f(a,b,c) { %s; } f;", body); 28 SNPrintF(program, "function f(a,b,c) { %s; } f;", body);
29 v8::Local<v8::Value> v = CompileRun(program.start()); 29 v8::Local<v8::Value> v = CompileRun(program.start());
30 Handle<Object> obj = v8::Utils::OpenHandle(*v); 30 Handle<Object> obj = v8::Utils::OpenHandle(*v);
31 function = Handle<JSFunction>::cast(obj); 31 function = Handle<JSFunction>::cast(obj);
32 } 32 }
33 33
34 void CheckLoopAssignedCount(int expected, const char* var_name) { 34 void CheckLoopAssignedCount(int expected, const char* var_name) {
35 // TODO(titzer): don't scope analyze every single time. 35 // TODO(titzer): don't scope analyze every single time.
36 ParseInfo parse_info(handle(function->shared())); 36 ParseInfo parse_info(handle(function->shared()));
37 CompilationInfo info(&parse_info, function); 37 CompilationInfo info(parse_info.zone(), &parse_info, function);
38 38
39 CHECK(parsing::ParseFunction(&parse_info)); 39 CHECK(parsing::ParseFunction(&parse_info));
40 CHECK(Rewriter::Rewrite(&parse_info)); 40 CHECK(Rewriter::Rewrite(&parse_info));
41 DeclarationScope::Analyze(&parse_info, AnalyzeMode::kRegular); 41 DeclarationScope::Analyze(&parse_info, AnalyzeMode::kRegular);
42 42
43 DeclarationScope* scope = info.literal()->scope(); 43 DeclarationScope* scope = info.literal()->scope();
44 AstValueFactory* factory = parse_info.ast_value_factory(); 44 AstValueFactory* factory = parse_info.ast_value_factory();
45 CHECK(scope); 45 CHECK(scope);
46 46
47 if (result == NULL) { 47 if (result == NULL) {
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 275
276 f.CheckLoopAssignedCount(1, "x"); 276 f.CheckLoopAssignedCount(1, "x");
277 f.CheckLoopAssignedCount(3, "y"); 277 f.CheckLoopAssignedCount(3, "y");
278 f.CheckLoopAssignedCount(5, "z"); 278 f.CheckLoopAssignedCount(5, "z");
279 f.CheckLoopAssignedCount(0, "w"); 279 f.CheckLoopAssignedCount(0, "w");
280 } 280 }
281 281
282 } // namespace compiler 282 } // namespace compiler
283 } // namespace internal 283 } // namespace internal
284 } // namespace v8 284 } // namespace v8
OLDNEW
« no previous file with comments | « test/cctest/compiler/test-linkage.cc ('k') | test/cctest/compiler/test-run-bytecode-graph-builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698