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

Unified Diff: src/objects.cc

Issue 703603003: Reland "Optimize function across closures." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix Created 6 years, 1 month 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/objects.h ('k') | src/objects-inl.h » ('j') | src/runtime-profiler.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 9933e9c61497c8d3307ea4643cc96b65bc0eca07..7e1d8b6b5a6d0066276c0870023973ab230c0622 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -9202,12 +9202,27 @@ void JSFunction::MarkForOptimization() {
}
-void JSFunction::MarkForConcurrentOptimization() {
- DCHECK(is_compiled() || GetIsolate()->DebuggerHasBreakPoints());
+void JSFunction::AttemptConcurrentOptimization() {
+ Isolate* isolate = GetIsolate();
+ if (!isolate->concurrent_recompilation_enabled() ||
+ isolate->bootstrapper()->IsActive()) {
+ MarkForOptimization();
+ return;
+ }
+ if (isolate->concurrent_osr_enabled() &&
+ isolate->optimizing_compiler_thread()->IsQueuedForOSR(this)) {
+ // Do not attempt regular recompilation if we already queued this for OSR.
+ // TODO(yangguo): This is necessary so that we don't install optimized
+ // code on a function that is already optimized, since OSR and regular
+ // recompilation race. This goes away as soon as OSR becomes one-shot.
+ return;
+ }
+ DCHECK(!IsInOptimizationQueue());
+ DCHECK(is_compiled() || isolate->DebuggerHasBreakPoints());
DCHECK(!IsOptimized());
DCHECK(shared()->allows_lazy_compilation() || code()->optimizable());
DCHECK(!shared()->is_generator());
- DCHECK(GetIsolate()->concurrent_recompilation_enabled());
+ DCHECK(isolate->concurrent_recompilation_enabled());
if (FLAG_trace_concurrent_recompilation) {
PrintF(" ** Marking ");
ShortPrint();
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.h » ('j') | src/runtime-profiler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698