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

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

Issue 189603006: Do not overwrite already optimized code. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 9 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 | « no previous file | src/runtime.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 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 info->closure()->PrintName(); 251 info->closure()->PrintName();
252 PrintF(" is ready for install and entry at AST id %d]\n", 252 PrintF(" is ready for install and entry at AST id %d]\n",
253 info->osr_ast_id().ToInt()); 253 info->osr_ast_id().ToInt());
254 } 254 }
255 job->WaitForInstall(); 255 job->WaitForInstall();
256 // Remove stack check that guards OSR entry on original code. 256 // Remove stack check that guards OSR entry on original code.
257 Handle<Code> code = info->unoptimized_code(); 257 Handle<Code> code = info->unoptimized_code();
258 uint32_t offset = code->TranslateAstIdToPcOffset(info->osr_ast_id()); 258 uint32_t offset = code->TranslateAstIdToPcOffset(info->osr_ast_id());
259 BackEdgeTable::RemoveStackCheck(code, offset); 259 BackEdgeTable::RemoveStackCheck(code, offset);
260 } else { 260 } else {
261 Handle<Code> code = Compiler::GetConcurrentlyOptimizedCode(job); 261 if (function->IsOptimized()) {
262 function->ReplaceCode( 262 DisposeOptimizedCompileJob(job, false);
263 code.is_null() ? function->shared()->code() : *code); 263 } else {
264 Handle<Code> code = Compiler::GetConcurrentlyOptimizedCode(job);
265 function->ReplaceCode(
266 code.is_null() ? function->shared()->code() : *code);
267 }
264 } 268 }
265 } 269 }
266 } 270 }
267 271
268 272
269 void OptimizingCompilerThread::QueueForOptimization(OptimizedCompileJob* job) { 273 void OptimizingCompilerThread::QueueForOptimization(OptimizedCompileJob* job) {
270 ASSERT(IsQueueAvailable()); 274 ASSERT(IsQueueAvailable());
271 ASSERT(!IsOptimizerThread()); 275 ASSERT(!IsOptimizerThread());
272 CompilationInfo* info = job->info(); 276 CompilationInfo* info = job->info();
273 if (info->is_osr()) { 277 if (info->is_osr()) {
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 385
382 386
383 bool OptimizingCompilerThread::IsOptimizerThread() { 387 bool OptimizingCompilerThread::IsOptimizerThread() {
384 LockGuard<Mutex> lock_guard(&thread_id_mutex_); 388 LockGuard<Mutex> lock_guard(&thread_id_mutex_);
385 return ThreadId::Current().ToInteger() == thread_id_; 389 return ThreadId::Current().ToInteger() == thread_id_;
386 } 390 }
387 #endif 391 #endif
388 392
389 393
390 } } // namespace v8::internal 394 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698