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

Unified Diff: src/compiler.cc

Issue 159783002: Re-optimize faster after making a pretenuring decision. Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 7 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/compiler.h ('k') | src/deoptimizer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler.cc
diff --git a/src/compiler.cc b/src/compiler.cc
index 7b9f705bc36112af01f9e3fcb070f73bda6447a6..bc4e8cd265e58eb75a55ed93154f0afd5d9a1738 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -1272,6 +1272,43 @@ void Compiler::RecordFunctionCompilation(Logger::LogEventsAndTags tag,
}
+void Compiler::Optimize(JSFunction* function, const char* reason) {
+ ASSERT(function->IsOptimizable());
+
+ if (FLAG_trace_opt && function->PassesFilter(FLAG_hydrogen_filter)) {
+ PrintF("[marking ");
+ function->ShortPrint();
+ PrintF(" for recompilation, reason: %s", reason);
+ if (FLAG_type_info_threshold > 0) {
+ int typeinfo, total, percentage;
+ Code* code = function->shared()->code();
+ code->GetICCounts(&typeinfo, &total, &percentage);
+ PrintF(", ICs with typeinfo: %d/%d (%d%%)", typeinfo, total, percentage);
+ }
+ PrintF("]\n");
+ }
+
+ Isolate* isolate = function->GetIsolate();
+
+ if (isolate->concurrent_recompilation_enabled() &&
+ !isolate->bootstrapper()->IsActive()) {
+ if (isolate->concurrent_osr_enabled() &&
+ isolate->optimizing_compiler_thread()->IsQueuedForOSR(function)) {
+ // 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;
+ }
+ ASSERT(!function->IsInOptimizationQueue());
+ function->MarkForConcurrentOptimization();
+ } else {
+ // The next call to the function will trigger optimization.
+ function->MarkForOptimization();
+ }
+}
+
+
CompilationPhase::CompilationPhase(const char* name, CompilationInfo* info)
: name_(name), info_(info), zone_(info->isolate()) {
if (FLAG_hydrogen_stats) {
« no previous file with comments | « src/compiler.h ('k') | src/deoptimizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698