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

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

Issue 908173003: Parsing: Make Parser not know about Isolate during background parsing. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: main thread check Created 5 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
« no previous file with comments | « src/runtime/runtime-internal.cc ('k') | test/cctest/compiler/test-codegen-deopt.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 #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
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 147
148 Handle<Object> true_value() { return isolate->factory()->true_value(); } 148 Handle<Object> true_value() { return isolate->factory()->true_value(); }
149 149
150 Handle<Object> false_value() { return isolate->factory()->false_value(); } 150 Handle<Object> false_value() { return isolate->factory()->false_value(); }
151 151
152 Handle<JSFunction> Compile(Handle<JSFunction> function) { 152 Handle<JSFunction> Compile(Handle<JSFunction> function) {
153 // TODO(titzer): make this method private. 153 // TODO(titzer): make this method private.
154 #if V8_TURBOFAN_TARGET 154 #if V8_TURBOFAN_TARGET
155 CompilationInfoWithZone info(function); 155 CompilationInfoWithZone info(function);
156 156
157 CHECK(Parser::Parse(&info)); 157 CHECK(Parser::ParseStatic(&info));
158 info.SetOptimizing(BailoutId::None(), Handle<Code>(function->code())); 158 info.SetOptimizing(BailoutId::None(), Handle<Code>(function->code()));
159 if (flags_ & CompilationInfo::kContextSpecializing) { 159 if (flags_ & CompilationInfo::kContextSpecializing) {
160 info.MarkAsContextSpecializing(); 160 info.MarkAsContextSpecializing();
161 } 161 }
162 if (flags_ & CompilationInfo::kInliningEnabled) { 162 if (flags_ & CompilationInfo::kInliningEnabled) {
163 info.MarkAsInliningEnabled(); 163 info.MarkAsInliningEnabled();
164 } 164 }
165 if (flags_ & CompilationInfo::kTypingEnabled) { 165 if (flags_ & CompilationInfo::kTypingEnabled) {
166 info.MarkAsTypingEnabled(); 166 info.MarkAsTypingEnabled();
167 } 167 }
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 203
204 private: 204 private:
205 uint32_t flags_; 205 uint32_t flags_;
206 206
207 // Compile the given machine graph instead of the source of the function 207 // Compile the given machine graph instead of the source of the function
208 // and replace the JSFunction's code with the result. 208 // and replace the JSFunction's code with the result.
209 Handle<JSFunction> CompileGraph(Graph* graph) { 209 Handle<JSFunction> CompileGraph(Graph* graph) {
210 CHECK(Pipeline::SupportedTarget()); 210 CHECK(Pipeline::SupportedTarget());
211 CompilationInfoWithZone info(function); 211 CompilationInfoWithZone info(function);
212 212
213 CHECK(Parser::Parse(&info)); 213 CHECK(Parser::ParseStatic(&info));
214 info.SetOptimizing(BailoutId::None(), 214 info.SetOptimizing(BailoutId::None(),
215 Handle<Code>(function->shared()->code())); 215 Handle<Code>(function->shared()->code()));
216 CHECK(Compiler::Analyze(&info)); 216 CHECK(Compiler::Analyze(&info));
217 CHECK(Compiler::EnsureDeoptimizationSupport(&info)); 217 CHECK(Compiler::EnsureDeoptimizationSupport(&info));
218 218
219 Handle<Code> code = Pipeline::GenerateCodeForTesting(&info, graph); 219 Handle<Code> code = Pipeline::GenerateCodeForTesting(&info, graph);
220 CHECK(!code.is_null()); 220 CHECK(!code.is_null());
221 function->ReplaceCode(*code); 221 function->ReplaceCode(*code);
222 return function; 222 return function;
223 } 223 }
224 }; 224 };
225 } 225 }
226 } 226 }
227 } // namespace v8::internal::compiler 227 } // namespace v8::internal::compiler
228 228
229 #endif // V8_CCTEST_COMPILER_FUNCTION_TESTER_H_ 229 #endif // V8_CCTEST_COMPILER_FUNCTION_TESTER_H_
OLDNEW
« no previous file with comments | « src/runtime/runtime-internal.cc ('k') | test/cctest/compiler/test-codegen-deopt.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698