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

Side by Side Diff: src/optimizing-compiler-thread.cc

Issue 18287003: Join threads after stopping. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: addressed comments Created 7 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « src/marking-thread.cc ('k') | src/sweeper-thread.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 delete optimizing_compiler->info(); 123 delete optimizing_compiler->info();
124 } 124 }
125 } 125 }
126 126
127 if (FLAG_trace_parallel_recompilation) { 127 if (FLAG_trace_parallel_recompilation) {
128 double compile_time = static_cast<double>(time_spent_compiling_); 128 double compile_time = static_cast<double>(time_spent_compiling_);
129 double total_time = static_cast<double>(time_spent_total_); 129 double total_time = static_cast<double>(time_spent_total_);
130 double percentage = (compile_time * 100) / total_time; 130 double percentage = (compile_time * 100) / total_time;
131 PrintF(" ** Compiler thread did %.2f%% useful work\n", percentage); 131 PrintF(" ** Compiler thread did %.2f%% useful work\n", percentage);
132 } 132 }
133
134 Join();
133 } 135 }
134 136
135 137
136 void OptimizingCompilerThread::InstallOptimizedFunctions() { 138 void OptimizingCompilerThread::InstallOptimizedFunctions() {
137 ASSERT(!IsOptimizerThread()); 139 ASSERT(!IsOptimizerThread());
138 HandleScope handle_scope(isolate_); 140 HandleScope handle_scope(isolate_);
139 OptimizingCompiler* compiler; 141 OptimizingCompiler* compiler;
140 while (true) { 142 while (true) {
141 { // Memory barrier to ensure marked functions are queued. 143 { // Memory barrier to ensure marked functions are queued.
142 ScopedLock marked_and_queued(install_mutex_); 144 ScopedLock marked_and_queued(install_mutex_);
(...skipping 18 matching lines...) Expand all
161 #ifdef DEBUG 163 #ifdef DEBUG
162 bool OptimizingCompilerThread::IsOptimizerThread() { 164 bool OptimizingCompilerThread::IsOptimizerThread() {
163 if (!FLAG_parallel_recompilation) return false; 165 if (!FLAG_parallel_recompilation) return false;
164 ScopedLock lock(thread_id_mutex_); 166 ScopedLock lock(thread_id_mutex_);
165 return ThreadId::Current().ToInteger() == thread_id_; 167 return ThreadId::Current().ToInteger() == thread_id_;
166 } 168 }
167 #endif 169 #endif
168 170
169 171
170 } } // namespace v8::internal 172 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/marking-thread.cc ('k') | src/sweeper-thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698