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

Unified Diff: runtime/vm/parser.cc

Issue 9150040: Fix compiler stats timer code (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 11 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
« no previous file with comments | « runtime/vm/object.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
===================================================================
--- runtime/vm/parser.cc (revision 3438)
+++ runtime/vm/parser.cc (working copy)
@@ -228,13 +228,10 @@
void Parser::ParseCompilationUnit(const Library& library,
const Script& script) {
+ TimerScope timer(FLAG_compiler_stats, &CompilerStats::parser_timer);
Parser parser(script, library);
- if (FLAG_compiler_stats) {
- CompilerStats::parser_timer.Start();
- }
parser.ParseTopLevel();
if (FLAG_compiler_stats) {
- CompilerStats::parser_timer.Stop();
CompilerStats::num_tokens_total += parser.tokens_.Length();
}
}
@@ -556,6 +553,7 @@
void Parser::ParseFunction(ParsedFunction* parsed_function) {
+ TimerScope timer(FLAG_compiler_stats, &CompilerStats::parser_timer);
Isolate* isolate = Isolate::Current();
// Compilation can be nested, preserve the ast node id.
const int prev_ast_node_id = isolate->ast_node_id();
@@ -565,9 +563,6 @@
const Class& cls = Class::Handle(isolate, func.owner());
const Script& script = Script::Handle(isolate, cls.script());
Parser parser(script, func, func.token_index());
- if (FLAG_compiler_stats) {
- CompilerStats::parser_timer.Start();
- }
SequenceNode* node_sequence = NULL;
Array& default_parameter_values = Array::Handle(isolate, Array::null());
switch (func.kind()) {
@@ -616,9 +611,6 @@
}
parsed_function->set_default_parameter_values(default_parameter_values);
- if (FLAG_compiler_stats) {
- CompilerStats::parser_timer.Stop();
- }
isolate->set_ast_node_id(prev_ast_node_id);
}
« no previous file with comments | « runtime/vm/object.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698