Index: src/runtime-profiler.cc |
=================================================================== |
--- src/runtime-profiler.cc (revision 10686) |
+++ src/runtime-profiler.cc (working copy) |
@@ -256,6 +256,16 @@ |
function->shared()->set_profiler_ticks(ticks + 1); |
} |
} else { // !FLAG_counting_profiler |
+ // Only record top-level code on top of the execution stack and |
Jakob Kummerow
2012/02/14 10:08:26
It seems this entire addition is independent of th
fschneider
2012/02/14 13:03:11
Done.
Good point. It should work with both profil
|
+ // avoid optimizing excessively large scripts since top-level code |
+ // will be executed only once. |
+ const int kMaxToplevelSourceSize = 10 * 1024; |
+ if (function->shared()->is_toplevel() |
+ && (frame_count > 1 |
+ || function->shared()->SourceSize() > kMaxToplevelSourceSize)) { |
+ continue; |
+ } |
+ |
samples[sample_count++] = function; |
int function_size = function->shared()->SourceSize(); |