Index: src/runtime-profiler.cc |
diff --git a/src/runtime-profiler.cc b/src/runtime-profiler.cc |
index 1856359f764143c686fd8d68a10ac83ebf03f4b9..e0e981271205b5016b9d56eb4b57b8c29c505012 100644 |
--- a/src/runtime-profiler.cc |
+++ b/src/runtime-profiler.cc |
@@ -34,6 +34,7 @@ |
#include "compilation-cache.h" |
#include "deoptimizer.h" |
#include "execution.h" |
+#include "full-codegen.h" |
#include "global-handles.h" |
#include "isolate-inl.h" |
#include "mark-compact.h" |
@@ -81,7 +82,8 @@ STATIC_ASSERT(kTicksWhenNotEnoughTypeInfo < 256); |
// Maximum size in bytes of generated code for a function to be optimized |
// the very first time it is seen on the stack. |
-static const int kMaxSizeEarlyOpt = 500; |
+static const int kMaxSizeEarlyOpt = |
+ 5 * FullCodeGenerator::kBackEdgeDistanceUnit; |
Atomic32 RuntimeProfiler::state_ = 0; |
@@ -317,8 +319,6 @@ void RuntimeProfiler::OptimizeNow() { |
} |
if (!function->IsOptimizable()) continue; |
- |
- |
if (FLAG_watch_ic_patching) { |
int ticks = shared_code->profiler_ticks(); |
@@ -341,7 +341,7 @@ void RuntimeProfiler::OptimizeNow() { |
} |
} |
} else if (!any_ic_changed_ && |
- shared_code->instruction_size() < kMaxSizeEarlyOpt) { |
+ shared_code->instruction_size() < kMaxSizeEarlyOpt) { |
// If no IC was patched since the last tick and this function is very |
// small, optimistically optimize it now. |
Optimize(function, "small function"); |