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

Side by Side Diff: runtime/vm/parser.cc

Issue 1523833003: Add more compiler timeline durations (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years 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 unified diff | Download patch
« runtime/vm/compiler.cc ('K') | « runtime/vm/flow_graph_compiler.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/parser.h" 5 #include "vm/parser.h"
6 #include "vm/flags.h" 6 #include "vm/flags.h"
7 7
8 #ifndef DART_PRECOMPILED 8 #ifndef DART_PRECOMPILED
9 9
10 #include "lib/invocation_mirror.h" 10 #include "lib/invocation_mirror.h"
(...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after
806 return functions_; 806 return functions_;
807 } 807 }
808 808
809 private: 809 private:
810 Zone* zone_; 810 Zone* zone_;
811 GrowableArray<const Field*> fields_; 811 GrowableArray<const Field*> fields_;
812 GrowableArray<const Function*> functions_; 812 GrowableArray<const Function*> functions_;
813 }; 813 };
814 814
815 815
816 void Parser::ParseClass(const Class& cls) { 816 void Parser::ParseClass(const Class& cls) {
Florian Schneider 2015/12/15 09:47:27 Maybe also add a timeline event for ParseClass?
Cutch 2015/12/15 16:59:26 Done.
817 Thread* thread = Thread::Current(); 817 Thread* thread = Thread::Current();
818 Zone* zone = thread->zone(); 818 Zone* zone = thread->zone();
819 const int64_t num_tokes_before = STAT_VALUE(thread, num_tokens_consumed); 819 const int64_t num_tokes_before = STAT_VALUE(thread, num_tokens_consumed);
820 if (!cls.is_synthesized_class()) { 820 if (!cls.is_synthesized_class()) {
821 ASSERT(thread->long_jump_base()->IsSafeToJump()); 821 ASSERT(thread->long_jump_base()->IsSafeToJump());
822 CSTAT_TIMER_SCOPE(thread, parser_timer); 822 CSTAT_TIMER_SCOPE(thread, parser_timer);
823 const Script& script = Script::Handle(zone, cls.script()); 823 const Script& script = Script::Handle(zone, cls.script());
824 const Library& lib = Library::Handle(zone, cls.library()); 824 const Library& lib = Library::Handle(zone, cls.library());
825 Parser parser(script, lib, cls.token_pos()); 825 Parser parser(script, lib, cls.token_pos());
826 parser.ParseClassDefinition(cls); 826 parser.ParseClassDefinition(cls);
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
919 919
920 920
921 void Parser::ParseFunction(ParsedFunction* parsed_function) { 921 void Parser::ParseFunction(ParsedFunction* parsed_function) {
922 Thread* thread = parsed_function->thread(); 922 Thread* thread = parsed_function->thread();
923 ASSERT(thread == Thread::Current()); 923 ASSERT(thread == Thread::Current());
924 Zone* zone = thread->zone(); 924 Zone* zone = thread->zone();
925 CSTAT_TIMER_SCOPE(thread, parser_timer); 925 CSTAT_TIMER_SCOPE(thread, parser_timer);
926 INC_STAT(thread, num_functions_parsed, 1); 926 INC_STAT(thread, num_functions_parsed, 1);
927 VMTagScope tagScope(thread, VMTag::kCompileParseFunctionTagId, 927 VMTagScope tagScope(thread, VMTag::kCompileParseFunctionTagId,
928 FLAG_profile_vm); 928 FLAG_profile_vm);
929 929 TimelineDurationScope tds(thread,
930 thread->isolate()->GetCompilerStream(),
931 "ParseFunction");
930 ASSERT(thread->long_jump_base()->IsSafeToJump()); 932 ASSERT(thread->long_jump_base()->IsSafeToJump());
931 ASSERT(parsed_function != NULL); 933 ASSERT(parsed_function != NULL);
932 const Function& func = parsed_function->function(); 934 const Function& func = parsed_function->function();
933 const Script& script = Script::Handle(zone, func.script()); 935 const Script& script = Script::Handle(zone, func.script());
934 Parser parser(script, parsed_function, func.token_pos()); 936 Parser parser(script, parsed_function, func.token_pos());
935 SequenceNode* node_sequence = NULL; 937 SequenceNode* node_sequence = NULL;
936 switch (func.kind()) { 938 switch (func.kind()) {
937 case RawFunction::kClosureFunction: 939 case RawFunction::kClosureFunction:
938 if (func.IsImplicitClosureFunction()) { 940 if (func.IsImplicitClosureFunction()) {
939 node_sequence = 941 node_sequence =
(...skipping 13523 matching lines...) Expand 10 before | Expand all | Expand 10 after
14463 const ArgumentListNode& function_args, 14465 const ArgumentListNode& function_args,
14464 const LocalVariable* temp_for_last_arg, 14466 const LocalVariable* temp_for_last_arg,
14465 bool is_super_invocation) { 14467 bool is_super_invocation) {
14466 UNREACHABLE(); 14468 UNREACHABLE();
14467 return NULL; 14469 return NULL;
14468 } 14470 }
14469 14471
14470 } // namespace dart 14472 } // namespace dart
14471 14473
14472 #endif // DART_PRECOMPILED 14474 #endif // DART_PRECOMPILED
OLDNEW
« runtime/vm/compiler.cc ('K') | « runtime/vm/flow_graph_compiler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698