| 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 | 6 |
| 7 #include "lib/invocation_mirror.h" | 7 #include "lib/invocation_mirror.h" |
| 8 #include "platform/utils.h" | 8 #include "platform/utils.h" |
| 9 #include "vm/ast_transformer.h" | 9 #include "vm/ast_transformer.h" |
| 10 #include "vm/bootstrap.h" | 10 #include "vm/bootstrap.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 DEFINE_FLAG(bool, enable_mirrors, true, | 41 DEFINE_FLAG(bool, enable_mirrors, true, |
| 42 "Disable to make importing dart:mirrors an error."); | 42 "Disable to make importing dart:mirrors an error."); |
| 43 DEFINE_FLAG(bool, load_deferred_eagerly, false, | 43 DEFINE_FLAG(bool, load_deferred_eagerly, false, |
| 44 "Load deferred libraries eagerly."); | 44 "Load deferred libraries eagerly."); |
| 45 DEFINE_FLAG(bool, trace_parser, false, "Trace parser operations."); | 45 DEFINE_FLAG(bool, trace_parser, false, "Trace parser operations."); |
| 46 DEFINE_FLAG(bool, supermixin, false, "Allow super calls in mixins."); | 46 DEFINE_FLAG(bool, supermixin, false, "Allow super calls in mixins."); |
| 47 DEFINE_FLAG(bool, warn_mixin_typedef, true, "Warning on legacy mixin typedef."); | 47 DEFINE_FLAG(bool, warn_mixin_typedef, true, "Warning on legacy mixin typedef."); |
| 48 | 48 |
| 49 DECLARE_FLAG(bool, lazy_dispatchers); | 49 DECLARE_FLAG(bool, lazy_dispatchers); |
| 50 DECLARE_FLAG(bool, load_deferred_eagerly); | 50 DECLARE_FLAG(bool, load_deferred_eagerly); |
| 51 DECLARE_FLAG(bool, profile_vm); |
| 51 DECLARE_FLAG(bool, throw_on_javascript_int_overflow); | 52 DECLARE_FLAG(bool, throw_on_javascript_int_overflow); |
| 52 DECLARE_FLAG(bool, warn_on_javascript_compatibility); | 53 DECLARE_FLAG(bool, warn_on_javascript_compatibility); |
| 53 | 54 |
| 54 // Quick access to the current isolate and zone. | 55 // Quick access to the current isolate and zone. |
| 55 #define I (isolate()) | 56 #define I (isolate()) |
| 56 #define Z (zone()) | 57 #define Z (zone()) |
| 57 | 58 |
| 58 | 59 |
| 59 #if defined(DEBUG) | 60 #if defined(DEBUG) |
| 60 class TraceParser : public ValueObject { | 61 class TraceParser : public ValueObject { |
| (...skipping 768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 829 UNREACHABLE(); | 830 UNREACHABLE(); |
| 830 return Object::null(); | 831 return Object::null(); |
| 831 } | 832 } |
| 832 | 833 |
| 833 | 834 |
| 834 void Parser::ParseFunction(ParsedFunction* parsed_function) { | 835 void Parser::ParseFunction(ParsedFunction* parsed_function) { |
| 835 Isolate* isolate = parsed_function->isolate(); | 836 Isolate* isolate = parsed_function->isolate(); |
| 836 Zone* zone = parsed_function->zone(); | 837 Zone* zone = parsed_function->zone(); |
| 837 CSTAT_TIMER_SCOPE(isolate, parser_timer); | 838 CSTAT_TIMER_SCOPE(isolate, parser_timer); |
| 838 INC_STAT(isolate, num_functions_compiled, 1); | 839 INC_STAT(isolate, num_functions_compiled, 1); |
| 840 VMTagScope tagScope(isolate, VMTag::kCompileParseFunctionTagId, |
| 841 FLAG_profile_vm); |
| 842 |
| 839 ASSERT(isolate->long_jump_base()->IsSafeToJump()); | 843 ASSERT(isolate->long_jump_base()->IsSafeToJump()); |
| 840 ASSERT(parsed_function != NULL); | 844 ASSERT(parsed_function != NULL); |
| 841 const Function& func = parsed_function->function(); | 845 const Function& func = parsed_function->function(); |
| 842 const Script& script = Script::Handle(zone, func.script()); | 846 const Script& script = Script::Handle(zone, func.script()); |
| 843 Parser parser(script, parsed_function, func.token_pos()); | 847 Parser parser(script, parsed_function, func.token_pos()); |
| 844 SequenceNode* node_sequence = NULL; | 848 SequenceNode* node_sequence = NULL; |
| 845 Array& default_parameter_values = Array::ZoneHandle(zone, Array::null()); | 849 Array& default_parameter_values = Array::ZoneHandle(zone, Array::null()); |
| 846 switch (func.kind()) { | 850 switch (func.kind()) { |
| 847 case RawFunction::kClosureFunction: | 851 case RawFunction::kClosureFunction: |
| 848 if (func.IsImplicitClosureFunction()) { | 852 if (func.IsImplicitClosureFunction()) { |
| (...skipping 12963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13812 void Parser::SkipQualIdent() { | 13816 void Parser::SkipQualIdent() { |
| 13813 ASSERT(IsIdentifier()); | 13817 ASSERT(IsIdentifier()); |
| 13814 ConsumeToken(); | 13818 ConsumeToken(); |
| 13815 if (CurrentToken() == Token::kPERIOD) { | 13819 if (CurrentToken() == Token::kPERIOD) { |
| 13816 ConsumeToken(); // Consume the kPERIOD token. | 13820 ConsumeToken(); // Consume the kPERIOD token. |
| 13817 ExpectIdentifier("identifier expected after '.'"); | 13821 ExpectIdentifier("identifier expected after '.'"); |
| 13818 } | 13822 } |
| 13819 } | 13823 } |
| 13820 | 13824 |
| 13821 } // namespace dart | 13825 } // namespace dart |
| OLD | NEW |