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

Unified Diff: src/compiler.cc

Issue 1179393008: [turbofan] Enable concurrent (re)compilation. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix debug name computation. Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler.h ('k') | src/compiler/ia32/instruction-selector-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler.cc
diff --git a/src/compiler.cc b/src/compiler.cc
index ca9cccd32b2a7ce9f62d8255513e90f17e35eff2..3d3a088ffd54c75624bf82d45d3cc8c4d1a9732b 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -706,9 +706,9 @@ bool GetOptimizedCodeNow(CompilationInfo* info) {
TRACE_EVENT0("v8", "V8.OptimizeCode");
bool use_turbofan = UseTurboFan(info);
- OptimizedCompileJob* job = use_turbofan
- ? compiler::Pipeline::NewCompilationJob(info)
- : new (info->zone()) HCompilationJob(info);
+ base::SmartPointer<OptimizedCompileJob> job(
+ use_turbofan ? compiler::Pipeline::NewCompilationJob(info)
+ : new HCompilationJob(info));
// Parsing is not required when optimizing from existing bytecode.
if (!use_turbofan || !info->shared_info()->HasBytecodeArray()) {
@@ -755,9 +755,9 @@ bool GetOptimizedCodeLater(CompilationInfo* info) {
}
bool use_turbofan = UseTurboFan(info);
- OptimizedCompileJob* job = use_turbofan
- ? compiler::Pipeline::NewCompilationJob(info)
- : new (info->zone()) HCompilationJob(info);
+ base::SmartPointer<OptimizedCompileJob> job(
+ use_turbofan ? compiler::Pipeline::NewCompilationJob(info)
+ : new HCompilationJob(info));
// All handles below this point will be allocated in a deferred handle scope
// that is detached and handed off to the background thread when we return.
@@ -778,7 +778,8 @@ bool GetOptimizedCodeLater(CompilationInfo* info) {
TRACE_EVENT0("v8", "V8.RecompileSynchronous");
if (job->CreateGraph() != OptimizedCompileJob::SUCCEEDED) return false;
- isolate->optimizing_compile_dispatcher()->QueueForOptimization(job);
+ isolate->optimizing_compile_dispatcher()->QueueForOptimization(job.get());
+ job.Detach(); // The background recompile job owns this now.
if (FLAG_trace_concurrent_recompilation) {
PrintF(" ** Queued ");
@@ -1725,7 +1726,7 @@ MaybeHandle<Code> Compiler::GetOptimizedCodeForOSR(Handle<JSFunction> function,
void Compiler::FinalizeOptimizedCompileJob(OptimizedCompileJob* job) {
// Take ownership of compilation info. Deleting compilation info
- // also tears down the zone and the recompile job.
+ // also tears down the zone.
base::SmartPointer<CompilationInfo> info(job->info());
Isolate* isolate = info->isolate();
@@ -1761,6 +1762,7 @@ void Compiler::FinalizeOptimizedCompileJob(OptimizedCompileJob* job) {
PrintF("]\n");
}
info->closure()->ReplaceCode(*info->code());
+ delete job;
return;
}
}
@@ -1772,6 +1774,7 @@ void Compiler::FinalizeOptimizedCompileJob(OptimizedCompileJob* job) {
PrintF(" because: %s]\n", GetBailoutReason(info->bailout_reason()));
}
info->closure()->ReplaceCode(shared->code());
+ delete job;
}
void Compiler::PostInstantiation(Handle<JSFunction> function,
« no previous file with comments | « src/compiler.h ('k') | src/compiler/ia32/instruction-selector-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698