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

Unified Diff: src/compiler.cc

Issue 752613002: Revert "Remove deprecated ShouldSelfOptimize machinery." (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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/compiler.h ('k') | src/flag-definitions.h » ('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 ce7a43c5412d8c32ad3584489271540741c396ef..82412a3b16a0b5ba30672d08adbab1dc805e0f20 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -276,6 +276,18 @@ Code::Flags CompilationInfo::flags() const {
}
+// Primitive functions are unlikely to be picked up by the stack-walking
+// profiler, so they trigger their own optimization when they're called
+// for the SharedFunctionInfo::kCallsUntilPrimitiveOptimization-th time.
+bool CompilationInfo::ShouldSelfOptimize() {
+ return FLAG_crankshaft &&
+ !function()->flags()->Contains(kDontSelfOptimize) &&
+ !function()->dont_optimize() &&
+ function()->scope()->AllowsLazyCompilation() &&
+ (shared_info().is_null() || !shared_info()->optimization_disabled());
+}
+
+
void CompilationInfo::PrepareForCompilation(Scope* scope) {
DCHECK(scope_ == NULL);
scope_ = scope;
« no previous file with comments | « src/compiler.h ('k') | src/flag-definitions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698