OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 <utility> | 5 #include <utility> |
6 | 6 |
7 #include "src/compiler/pipeline.h" | 7 #include "src/compiler/pipeline.h" |
8 #include "src/execution.h" | 8 #include "src/execution.h" |
9 #include "src/handles.h" | 9 #include "src/handles.h" |
10 #include "src/interpreter/bytecode-array-builder.h" | 10 #include "src/interpreter/bytecode-array-builder.h" |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 CHECK(function->shared()->HasBytecodeArray()); | 122 CHECK(function->shared()->HasBytecodeArray()); |
123 | 123 |
124 // TODO(mstarzinger): We should be able to prime CompilationInfo without | 124 // TODO(mstarzinger): We should be able to prime CompilationInfo without |
125 // having to instantiate a ParseInfo first. Fix this! | 125 // having to instantiate a ParseInfo first. Fix this! |
126 ParseInfo parse_info(zone_, function); | 126 ParseInfo parse_info(zone_, function); |
127 | 127 |
128 CompilationInfo compilation_info(&parse_info, function); | 128 CompilationInfo compilation_info(&parse_info, function); |
129 compilation_info.SetOptimizing(); | 129 compilation_info.SetOptimizing(); |
130 compilation_info.MarkAsDeoptimizationEnabled(); | 130 compilation_info.MarkAsDeoptimizationEnabled(); |
131 compilation_info.MarkAsOptimizeFromBytecode(); | 131 compilation_info.MarkAsOptimizeFromBytecode(); |
132 compiler::Pipeline pipeline(&compilation_info); | 132 Handle<Code> code = Pipeline::GenerateCodeForTesting(&compilation_info); |
133 Handle<Code> code = pipeline.GenerateCode(); | |
134 function->ReplaceCode(*code); | 133 function->ReplaceCode(*code); |
135 | 134 |
136 return function; | 135 return function; |
137 } | 136 } |
138 | 137 |
139 DISALLOW_COPY_AND_ASSIGN(BytecodeGraphTester); | 138 DISALLOW_COPY_AND_ASSIGN(BytecodeGraphTester); |
140 }; | 139 }; |
141 | 140 |
142 | 141 |
143 #define SPACE() | 142 #define SPACE() |
(...skipping 2788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2932 | 2931 |
2933 BytecodeGraphTester tester(isolate, zone, script.start()); | 2932 BytecodeGraphTester tester(isolate, zone, script.start()); |
2934 auto callable = tester.GetCallable<>(); | 2933 auto callable = tester.GetCallable<>(); |
2935 Handle<Object> return_value = callable().ToHandleChecked(); | 2934 Handle<Object> return_value = callable().ToHandleChecked(); |
2936 CHECK(return_value->SameValue(*snippet.return_value())); | 2935 CHECK(return_value->SameValue(*snippet.return_value())); |
2937 } | 2936 } |
2938 | 2937 |
2939 } // namespace compiler | 2938 } // namespace compiler |
2940 } // namespace internal | 2939 } // namespace internal |
2941 } // namespace v8 | 2940 } // namespace v8 |
OLD | NEW |