| OLD | NEW |
| 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 805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 816 | 816 |
| 817 void Parser::ParseClass(const Class& cls) { | 817 void Parser::ParseClass(const Class& cls) { |
| 818 Thread* thread = Thread::Current(); | 818 Thread* thread = Thread::Current(); |
| 819 Zone* zone = thread->zone(); | 819 Zone* zone = thread->zone(); |
| 820 const int64_t num_tokes_before = STAT_VALUE(thread, num_tokens_consumed); | 820 const int64_t num_tokes_before = STAT_VALUE(thread, num_tokens_consumed); |
| 821 TimelineDurationScope tds(thread, | 821 TimelineDurationScope tds(thread, |
| 822 thread->isolate()->GetCompilerStream(), | 822 thread->isolate()->GetCompilerStream(), |
| 823 "ParseClass"); | 823 "ParseClass"); |
| 824 if (tds.enabled()) { | 824 if (tds.enabled()) { |
| 825 tds.SetNumArguments(1); | 825 tds.SetNumArguments(1); |
| 826 tds.CopyArgument( | 826 tds.CopyArgument(0, "class", String::Handle(cls.Name()).ToCString()); |
| 827 0, | |
| 828 "class", | |
| 829 const_cast<char*>(String::Handle(cls.Name()).ToCString())); | |
| 830 } | 827 } |
| 831 if (!cls.is_synthesized_class()) { | 828 if (!cls.is_synthesized_class()) { |
| 832 ASSERT(thread->long_jump_base()->IsSafeToJump()); | 829 ASSERT(thread->long_jump_base()->IsSafeToJump()); |
| 833 CSTAT_TIMER_SCOPE(thread, parser_timer); | 830 CSTAT_TIMER_SCOPE(thread, parser_timer); |
| 834 const Script& script = Script::Handle(zone, cls.script()); | 831 const Script& script = Script::Handle(zone, cls.script()); |
| 835 const Library& lib = Library::Handle(zone, cls.library()); | 832 const Library& lib = Library::Handle(zone, cls.library()); |
| 836 Parser parser(script, lib, cls.token_pos()); | 833 Parser parser(script, lib, cls.token_pos()); |
| 837 parser.ParseClassDefinition(cls); | 834 parser.ParseClassDefinition(cls); |
| 838 } else if (cls.is_enum_class()) { | 835 } else if (cls.is_enum_class()) { |
| 839 ASSERT(thread->long_jump_base()->IsSafeToJump()); | 836 ASSERT(thread->long_jump_base()->IsSafeToJump()); |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 940 TimelineDurationScope tds(thread, | 937 TimelineDurationScope tds(thread, |
| 941 thread->isolate()->GetCompilerStream(), | 938 thread->isolate()->GetCompilerStream(), |
| 942 "ParseFunction"); | 939 "ParseFunction"); |
| 943 ASSERT(thread->long_jump_base()->IsSafeToJump()); | 940 ASSERT(thread->long_jump_base()->IsSafeToJump()); |
| 944 ASSERT(parsed_function != NULL); | 941 ASSERT(parsed_function != NULL); |
| 945 const Function& func = parsed_function->function(); | 942 const Function& func = parsed_function->function(); |
| 946 const Script& script = Script::Handle(zone, func.script()); | 943 const Script& script = Script::Handle(zone, func.script()); |
| 947 Parser parser(script, parsed_function, func.token_pos()); | 944 Parser parser(script, parsed_function, func.token_pos()); |
| 948 if (tds.enabled()) { | 945 if (tds.enabled()) { |
| 949 tds.SetNumArguments(1); | 946 tds.SetNumArguments(1); |
| 950 tds.CopyArgument( | 947 tds.CopyArgument(0, "function", String::Handle(func.name()).ToCString()); |
| 951 0, | |
| 952 "function", | |
| 953 const_cast<char*>(String::Handle(func.name()).ToCString())); | |
| 954 } | 948 } |
| 955 SequenceNode* node_sequence = NULL; | 949 SequenceNode* node_sequence = NULL; |
| 956 switch (func.kind()) { | 950 switch (func.kind()) { |
| 957 case RawFunction::kClosureFunction: | 951 case RawFunction::kClosureFunction: |
| 958 if (func.IsImplicitClosureFunction()) { | 952 if (func.IsImplicitClosureFunction()) { |
| 959 node_sequence = | 953 node_sequence = |
| 960 parser.ParseImplicitClosure(func); | 954 parser.ParseImplicitClosure(func); |
| 961 break; | 955 break; |
| 962 } | 956 } |
| 963 if (func.IsConstructorClosureFunction()) { | 957 if (func.IsConstructorClosureFunction()) { |
| (...skipping 13530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14494 const ArgumentListNode& function_args, | 14488 const ArgumentListNode& function_args, |
| 14495 const LocalVariable* temp_for_last_arg, | 14489 const LocalVariable* temp_for_last_arg, |
| 14496 bool is_super_invocation) { | 14490 bool is_super_invocation) { |
| 14497 UNREACHABLE(); | 14491 UNREACHABLE(); |
| 14498 return NULL; | 14492 return NULL; |
| 14499 } | 14493 } |
| 14500 | 14494 |
| 14501 } // namespace dart | 14495 } // namespace dart |
| 14502 | 14496 |
| 14503 #endif // DART_PRECOMPILED | 14497 #endif // DART_PRECOMPILED |
| OLD | NEW |