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

Side by Side Diff: test/cctest/compiler/test-pipeline.cc

Issue 1685633002: [interpreter] CompilationInfo::unoptimized_code only for OSR. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_interpreter-pipeline-1
Patch Set: Addressed comments. Created 4 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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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/compiler.h" 5 #include "src/compiler.h"
6 #include "src/compiler/pipeline.h" 6 #include "src/compiler/pipeline.h"
7 #include "src/handles.h" 7 #include "src/handles.h"
8 #include "src/parsing/parser.h" 8 #include "src/parsing/parser.h"
9 #include "test/cctest/cctest.h" 9 #include "test/cctest/cctest.h"
10 10
11 namespace v8 { 11 namespace v8 {
12 namespace internal { 12 namespace internal {
13 namespace compiler { 13 namespace compiler {
14 14
15 static void RunPipeline(Zone* zone, const char* source) { 15 static void RunPipeline(Zone* zone, const char* source) {
16 Handle<JSFunction> function = Handle<JSFunction>::cast(v8::Utils::OpenHandle( 16 Handle<JSFunction> function = Handle<JSFunction>::cast(v8::Utils::OpenHandle(
17 *v8::Local<v8::Function>::Cast(CompileRun(source)))); 17 *v8::Local<v8::Function>::Cast(CompileRun(source))));
18 ParseInfo parse_info(zone, function); 18 ParseInfo parse_info(zone, function);
19 CHECK(Compiler::ParseAndAnalyze(&parse_info)); 19 CHECK(Compiler::ParseAndAnalyze(&parse_info));
20 CompilationInfo info(&parse_info); 20 CompilationInfo info(&parse_info);
21 info.SetOptimizing(BailoutId::None(), Handle<Code>(function->code())); 21 info.SetOptimizing();
22 22
23 Pipeline pipeline(&info); 23 Pipeline pipeline(&info);
24 Handle<Code> code = pipeline.GenerateCode(); 24 Handle<Code> code = pipeline.GenerateCode();
25 CHECK(!code.is_null()); 25 CHECK(!code.is_null());
26 } 26 }
27 27
28 28
29 TEST(PipelineTyped) { 29 TEST(PipelineTyped) {
30 HandleAndZoneScope handles; 30 HandleAndZoneScope handles;
31 FLAG_turbo_types = true; 31 FLAG_turbo_types = true;
32 RunPipeline(handles.main_zone(), "(function(a,b) { return a + b; })"); 32 RunPipeline(handles.main_zone(), "(function(a,b) { return a + b; })");
33 } 33 }
34 34
35 35
36 TEST(PipelineGeneric) { 36 TEST(PipelineGeneric) {
37 HandleAndZoneScope handles; 37 HandleAndZoneScope handles;
38 FLAG_turbo_types = false; 38 FLAG_turbo_types = false;
39 RunPipeline(handles.main_zone(), "(function(a,b) { return a + b; })"); 39 RunPipeline(handles.main_zone(), "(function(a,b) { return a + b; })");
40 } 40 }
41 41
42 } // namespace compiler 42 } // namespace compiler
43 } // namespace internal 43 } // namespace internal
44 } // namespace v8 44 } // namespace v8
OLDNEW
« no previous file with comments | « test/cctest/compiler/function-tester.h ('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