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

Unified Diff: src/optimizing-compiler-thread.cc

Issue 148503002: A64: Synchronize with r15545. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 11 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/optimizing-compiler-thread.h ('k') | src/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/optimizing-compiler-thread.cc
diff --git a/src/optimizing-compiler-thread.cc b/src/optimizing-compiler-thread.cc
index b9ff7d83eca369c0b194ab2cd40ccdec5c9379be..21ef237107194d06a897110444c01710eae31bd0 100644
--- a/src/optimizing-compiler-thread.cc
+++ b/src/optimizing-compiler-thread.cc
@@ -39,7 +39,9 @@ namespace internal {
void OptimizingCompilerThread::Run() {
#ifdef DEBUG
- thread_id_ = ThreadId::Current().ToInteger();
+ { ScopedLock lock(thread_id_mutex_);
+ thread_id_ = ThreadId::Current().ToInteger();
+ }
#endif
Isolate::SetIsolateThreadLocals(isolate_, NULL);
DisallowHeapAllocation no_allocation;
@@ -113,8 +115,11 @@ void OptimizingCompilerThread::Stop() {
InstallOptimizedFunctions();
} else {
OptimizingCompiler* optimizing_compiler;
+ // The optimizing compiler is allocated in the CompilationInfo's zone.
while (input_queue_.Dequeue(&optimizing_compiler)) {
- // The optimizing compiler is allocated in the CompilationInfo's zone.
+ delete optimizing_compiler->info();
+ }
+ while (output_queue_.Dequeue(&optimizing_compiler)) {
delete optimizing_compiler->info();
}
}
@@ -125,6 +130,8 @@ void OptimizingCompilerThread::Stop() {
double percentage = (compile_time * 100) / total_time;
PrintF(" ** Compiler thread did %.2f%% useful work\n", percentage);
}
+
+ Join();
}
@@ -156,6 +163,7 @@ void OptimizingCompilerThread::QueueForOptimization(
#ifdef DEBUG
bool OptimizingCompilerThread::IsOptimizerThread() {
if (!FLAG_parallel_recompilation) return false;
+ ScopedLock lock(thread_id_mutex_);
return ThreadId::Current().ToInteger() == thread_id_;
}
#endif
« no previous file with comments | « src/optimizing-compiler-thread.h ('k') | src/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698