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

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

Issue 596783002: Refactor bailout reasons and disable optimization in more cases. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: remove bogus assertion Created 6 years, 3 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/objects.cc ('k') | src/parser.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 // 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/optimizing-compiler-thread.h" 5 #include "src/optimizing-compiler-thread.h"
6 6
7 #include "src/v8.h" 7 #include "src/v8.h"
8 8
9 #include "src/base/atomicops.h" 9 #include "src/base/atomicops.h"
10 #include "src/full-codegen.h" 10 #include "src/full-codegen.h"
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 DCHECK(!IsOptimizerThread()); 219 DCHECK(!IsOptimizerThread());
220 HandleScope handle_scope(isolate_); 220 HandleScope handle_scope(isolate_);
221 221
222 OptimizedCompileJob* job; 222 OptimizedCompileJob* job;
223 while (output_queue_.Dequeue(&job)) { 223 while (output_queue_.Dequeue(&job)) {
224 CompilationInfo* info = job->info(); 224 CompilationInfo* info = job->info();
225 Handle<JSFunction> function(*info->closure()); 225 Handle<JSFunction> function(*info->closure());
226 if (info->is_osr()) { 226 if (info->is_osr()) {
227 if (FLAG_trace_osr) { 227 if (FLAG_trace_osr) {
228 PrintF("[COSR - "); 228 PrintF("[COSR - ");
229 info->closure()->PrintName(); 229 function->ShortPrint();
230 PrintF(" is ready for install and entry at AST id %d]\n", 230 PrintF(" is ready for install and entry at AST id %d]\n",
231 info->osr_ast_id().ToInt()); 231 info->osr_ast_id().ToInt());
232 } 232 }
233 job->WaitForInstall(); 233 job->WaitForInstall();
234 // Remove stack check that guards OSR entry on original code. 234 // Remove stack check that guards OSR entry on original code.
235 Handle<Code> code = info->unoptimized_code(); 235 Handle<Code> code = info->unoptimized_code();
236 uint32_t offset = code->TranslateAstIdToPcOffset(info->osr_ast_id()); 236 uint32_t offset = code->TranslateAstIdToPcOffset(info->osr_ast_id());
237 BackEdgeTable::RemoveStackCheck(code, offset); 237 BackEdgeTable::RemoveStackCheck(code, offset);
238 } else { 238 } else {
239 if (function->IsOptimized()) { 239 if (function->IsOptimized()) {
240 if (FLAG_trace_concurrent_recompilation) {
241 PrintF(" ** Aborting compilation for ");
242 function->ShortPrint();
243 PrintF(" as it has already been optimized.\n");
244 }
240 DisposeOptimizedCompileJob(job, false); 245 DisposeOptimizedCompileJob(job, false);
241 } else { 246 } else {
242 Handle<Code> code = Compiler::GetConcurrentlyOptimizedCode(job); 247 Handle<Code> code = Compiler::GetConcurrentlyOptimizedCode(job);
243 function->ReplaceCode( 248 function->ReplaceCode(
244 code.is_null() ? function->shared()->code() : *code); 249 code.is_null() ? function->shared()->code() : *code);
245 } 250 }
246 } 251 }
247 } 252 }
248 } 253 }
249 254
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 368
364 369
365 bool OptimizingCompilerThread::IsOptimizerThread() { 370 bool OptimizingCompilerThread::IsOptimizerThread() {
366 base::LockGuard<base::Mutex> lock_guard(&thread_id_mutex_); 371 base::LockGuard<base::Mutex> lock_guard(&thread_id_mutex_);
367 return ThreadId::Current().ToInteger() == thread_id_; 372 return ThreadId::Current().ToInteger() == thread_id_;
368 } 373 }
369 #endif 374 #endif
370 375
371 376
372 } } // namespace v8::internal 377 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | src/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698