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

Unified Diff: src/runtime-profiler.cc

Issue 9187005: Enable optimization of top-level code. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 8 years, 10 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
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();

Powered by Google App Engine
This is Rietveld 408576698