Add histogram timer scope for preparsing.
authorlrn@chromium.org <lrn@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 24 Nov 2011 13:24:30 +0000 (13:24 +0000)
committerlrn@chromium.org <lrn@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 24 Nov 2011 13:24:30 +0000 (13:24 +0000)
Currently the parser benchmark doesn't count preparsing, since it doesn't
know when it's preparsing.

Review URL: http://codereview.chromium.org/8692001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10060 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/parser.cc

index e19af1c..0b56735 100644 (file)
@@ -5353,6 +5353,7 @@ static ScriptDataImpl* DoPreParse(UC16CharacterStream* source,
                                   int flags,
                                   ParserRecorder* recorder) {
   Isolate* isolate = Isolate::Current();
+  HistogramTimerScope timer(isolate->counters()->pre_parse());
   Scanner scanner(isolate->unicode_cache());
   scanner.SetHarmonyScoping((flags & kHarmonyScoping) != 0);
   scanner.Initialize(source);