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

Side by Side Diff: src/compiler-dispatcher/compiler-dispatcher.cc

Issue 2650883002: Reland: [Compiler] Enable handles created during parsing and scope analysis to be deferred. (Closed)
Patch Set: Remove unused variable 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 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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-dispatcher/compiler-dispatcher.h" 5 #include "src/compiler-dispatcher/compiler-dispatcher.h"
6 6
7 #include "include/v8-platform.h" 7 #include "include/v8-platform.h"
8 #include "include/v8.h" 8 #include "include/v8.h"
9 #include "src/base/platform/time.h" 9 #include "src/base/platform/time.h"
10 #include "src/cancelable-task.h" 10 #include "src/cancelable-task.h"
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 function->ShortPrint(); 280 function->ShortPrint();
281 PrintF("\n"); 281 PrintF("\n");
282 } 282 }
283 JobMap::const_iterator job = GetJobFor(function); 283 JobMap::const_iterator job = GetJobFor(function);
284 DoNextStepOnMainThread(isolate_, job->second.get(), 284 DoNextStepOnMainThread(isolate_, job->second.get(),
285 ExceptionHandling::kSwallow); 285 ExceptionHandling::kSwallow);
286 ConsiderJobForBackgroundProcessing(job->second.get()); 286 ConsiderJobForBackgroundProcessing(job->second.get());
287 return true; 287 return true;
288 } 288 }
289 289
290 bool CompilerDispatcher::Enqueue(Handle<SharedFunctionInfo> function, 290 bool CompilerDispatcher::Enqueue(
291 FunctionLiteral* literal) { 291 Handle<SharedFunctionInfo> function, FunctionLiteral* literal,
292 std::shared_ptr<Zone> parse_zone,
293 std::shared_ptr<DeferredHandles> parse_handles,
294 std::shared_ptr<DeferredHandles> compile_handles) {
292 if (!CanEnqueue(function)) return false; 295 if (!CanEnqueue(function)) return false;
293 if (IsEnqueued(function)) return true; 296 if (IsEnqueued(function)) return true;
294 297
295 if (trace_compiler_dispatcher_) { 298 if (trace_compiler_dispatcher_) {
296 PrintF("CompilerDispatcher: enqueuing "); 299 PrintF("CompilerDispatcher: enqueuing ");
297 function->ShortPrint(); 300 function->ShortPrint();
298 PrintF(" for compile\n"); 301 PrintF(" for compile\n");
299 } 302 }
300 303
301 std::unique_ptr<CompilerDispatcherJob> job(new CompilerDispatcherJob( 304 std::unique_ptr<CompilerDispatcherJob> job(new CompilerDispatcherJob(
302 isolate_, tracer_.get(), function, literal, max_stack_size_)); 305 isolate_, tracer_.get(), function, literal, parse_zone, parse_handles,
306 compile_handles, max_stack_size_));
303 std::pair<int, int> key(Script::cast(function->script())->id(), 307 std::pair<int, int> key(Script::cast(function->script())->id(),
304 function->function_literal_id()); 308 function->function_literal_id());
305 jobs_.insert(std::make_pair(key, std::move(job))); 309 jobs_.insert(std::make_pair(key, std::move(job)));
306 ScheduleIdleTaskIfNeeded(); 310 ScheduleIdleTaskIfNeeded();
307 return true; 311 return true;
308 } 312 }
309 313
310 bool CompilerDispatcher::EnqueueAndStep(Handle<SharedFunctionInfo> function, 314 bool CompilerDispatcher::EnqueueAndStep(
311 FunctionLiteral* literal) { 315 Handle<SharedFunctionInfo> function, FunctionLiteral* literal,
312 if (!Enqueue(function, literal)) return false; 316 std::shared_ptr<Zone> parse_zone,
317 std::shared_ptr<DeferredHandles> parse_handles,
318 std::shared_ptr<DeferredHandles> compile_handles) {
319 if (!Enqueue(function, literal, parse_zone, parse_handles, compile_handles)) {
320 return false;
321 }
313 322
314 if (trace_compiler_dispatcher_) { 323 if (trace_compiler_dispatcher_) {
315 PrintF("CompilerDispatcher: stepping "); 324 PrintF("CompilerDispatcher: stepping ");
316 function->ShortPrint(); 325 function->ShortPrint();
317 PrintF("\n"); 326 PrintF("\n");
318 } 327 }
319 JobMap::const_iterator job = GetJobFor(function); 328 JobMap::const_iterator job = GetJobFor(function);
320 DoNextStepOnMainThread(isolate_, job->second.get(), 329 DoNextStepOnMainThread(isolate_, job->second.get(),
321 ExceptionHandling::kSwallow); 330 ExceptionHandling::kSwallow);
322 ConsiderJobForBackgroundProcessing(job->second.get()); 331 ConsiderJobForBackgroundProcessing(job->second.get());
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
693 lock.reset(); 702 lock.reset();
694 DoNextStepOnMainThread(isolate_, job->second.get(), 703 DoNextStepOnMainThread(isolate_, job->second.get(),
695 ExceptionHandling::kSwallow); 704 ExceptionHandling::kSwallow);
696 } 705 }
697 } 706 }
698 if (jobs_.size() > too_long_jobs) ScheduleIdleTaskIfNeeded(); 707 if (jobs_.size() > too_long_jobs) ScheduleIdleTaskIfNeeded();
699 } 708 }
700 709
701 } // namespace internal 710 } // namespace internal
702 } // namespace v8 711 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler-dispatcher/compiler-dispatcher.h ('k') | src/compiler-dispatcher/compiler-dispatcher-job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698