Index: src/runtime-profiler.cc |
diff --git a/src/runtime-profiler.cc b/src/runtime-profiler.cc |
index 5815a83c937e05ef0e81e8fa52b18e8de3b28562..400fcbaa842348c6dada32ce1ceedaf03c409c30 100644 |
--- a/src/runtime-profiler.cc |
+++ b/src/runtime-profiler.cc |
@@ -205,8 +205,10 @@ void RuntimeProfiler::OptimizeNow() { |
JSFunction* samples[kSamplerFrameCount]; |
int sample_count = 0; |
int frame_count = 0; |
+ int frame_count_limit = FLAG_watch_ic_patching ? FLAG_frame_count |
+ : kSamplerFrameCount; |
for (JavaScriptFrameIterator it(isolate_); |
- frame_count++ < kSamplerFrameCount && !it.done(); |
+ frame_count++ < frame_count_limit && !it.done(); |
it.Advance()) { |
JavaScriptFrame* frame = it.frame(); |
JSFunction* function = JSFunction::cast(frame->function()); |