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

Unified Diff: src/runtime-profiler.cc

Issue 2667573002: [Turbofan] don't optimize from bytecode > 250K in size. (Closed)
Patch Set: comments Created 3 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime-profiler.cc
diff --git a/src/runtime-profiler.cc b/src/runtime-profiler.cc
index 70c61b1cebe5ded8306ad58bce21bdb13c18d2cf..1a1ef6a847e9aae8497a61deeddf78065083973a 100644
--- a/src/runtime-profiler.cc
+++ b/src/runtime-profiler.cc
@@ -57,6 +57,12 @@ static const int kMaxSizeEarlyOpt =
static const int kMaxSizeEarlyOptIgnition =
5 * interpreter::Interpreter::kCodeSizeMultiplier;
+// Certain functions are simply too big to be worth optimizing.
+// We aren't using the code size multiplier here because there is no
+// "kMaxSizeOpt" with which we would need to normalize. This constant is
+// only for optimization decisions coming into TurboFan from Ignition.
+static const int kMaxSizeOptIgnition = 250 * 1024;
+
#define OPTIMIZATION_REASON_LIST(V) \
V(DoNotOptimize, "do not optimize") \
V(HotAndStable, "hot and stable") \
@@ -394,6 +400,10 @@ OptimizationReason RuntimeProfiler::ShouldOptimizeIgnition(
SharedFunctionInfo* shared = function->shared();
int ticks = shared->profiler_ticks();
+ if (shared->bytecode_array()->Size() > kMaxSizeOptIgnition) {
+ return OptimizationReason::kDoNotOptimize;
+ }
+
if (ticks >= kProfilerTicksBeforeOptimization) {
int typeinfo, generic, total, type_percentage, generic_percentage;
GetICCounts(function, &typeinfo, &generic, &total, &type_percentage,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698