| 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 #ifndef VM_PARSER_H_ | 5 #ifndef VM_PARSER_H_ |
| 6 #define VM_PARSER_H_ | 6 #define VM_PARSER_H_ |
| 7 | 7 |
| 8 #include "include/dart_api.h" | 8 #include "include/dart_api.h" |
| 9 | 9 |
| 10 #include "platform/assert.h" | 10 #include "platform/assert.h" |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 // Parse top level of a class and register all functions/fields. | 173 // Parse top level of a class and register all functions/fields. |
| 174 static void ParseClass(const Class& cls); | 174 static void ParseClass(const Class& cls); |
| 175 | 175 |
| 176 static void ParseFunction(ParsedFunction* parsed_function); | 176 static void ParseFunction(ParsedFunction* parsed_function); |
| 177 | 177 |
| 178 // Parse and evaluate the metadata expressions at token_pos in the | 178 // Parse and evaluate the metadata expressions at token_pos in the |
| 179 // class namespace of class cls (which can be the implicit toplevel | 179 // class namespace of class cls (which can be the implicit toplevel |
| 180 // class if the metadata is at the top-level). | 180 // class if the metadata is at the top-level). |
| 181 static RawObject* ParseMetadata(const Class& cls, intptr_t token_pos); | 181 static RawObject* ParseMetadata(const Class& cls, intptr_t token_pos); |
| 182 | 182 |
| 183 // Build a function containing the initializer expression of the |
| 184 // given static field. |
| 185 static ParsedFunction* ParseStaticFieldInitializer(const Field& field); |
| 186 |
| 183 // Parse a function to retrieve parameter information that is not retained in | 187 // Parse a function to retrieve parameter information that is not retained in |
| 184 // the dart::Function object. Returns either an error if the parse fails | 188 // the dart::Function object. Returns either an error if the parse fails |
| 185 // (which could be the case for local functions), or a flat array of entries | 189 // (which could be the case for local functions), or a flat array of entries |
| 186 // for each parameter. Each parameter entry contains: | 190 // for each parameter. Each parameter entry contains: |
| 187 // * a Dart bool indicating whether the parameter was declared final | 191 // * a Dart bool indicating whether the parameter was declared final |
| 188 // * its default value (or null if none was declared) | 192 // * its default value (or null if none was declared) |
| 189 // * an array of metadata (or null if no metadata was declared). | 193 // * an array of metadata (or null if no metadata was declared). |
| 190 enum { | 194 enum { |
| 191 kParameterIsFinalOffset, | 195 kParameterIsFinalOffset, |
| 192 kParameterDefaultValueOffset, | 196 kParameterDefaultValueOffset, |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 481 Array* default_parameter_values); | 485 Array* default_parameter_values); |
| 482 SequenceNode* ParseFunc(const Function& func, | 486 SequenceNode* ParseFunc(const Function& func, |
| 483 Array* default_parameter_values); | 487 Array* default_parameter_values); |
| 484 RawClass* GetClassForAsync(const String& class_name); | 488 RawClass* GetClassForAsync(const String& class_name); |
| 485 | 489 |
| 486 void ParseNativeFunctionBlock(const ParamList* params, const Function& func); | 490 void ParseNativeFunctionBlock(const ParamList* params, const Function& func); |
| 487 | 491 |
| 488 SequenceNode* ParseInstanceGetter(const Function& func); | 492 SequenceNode* ParseInstanceGetter(const Function& func); |
| 489 SequenceNode* ParseInstanceSetter(const Function& func); | 493 SequenceNode* ParseInstanceSetter(const Function& func); |
| 490 SequenceNode* ParseStaticFinalGetter(const Function& func); | 494 SequenceNode* ParseStaticFinalGetter(const Function& func); |
| 491 SequenceNode* ParseStaticInitializer(const Function& func); | 495 SequenceNode* ParseStaticInitializer(); |
| 492 SequenceNode* ParseMethodExtractor(const Function& func); | 496 SequenceNode* ParseMethodExtractor(const Function& func); |
| 493 SequenceNode* ParseNoSuchMethodDispatcher(const Function& func, | 497 SequenceNode* ParseNoSuchMethodDispatcher(const Function& func, |
| 494 Array* default_values); | 498 Array* default_values); |
| 495 SequenceNode* ParseInvokeFieldDispatcher(const Function& func, | 499 SequenceNode* ParseInvokeFieldDispatcher(const Function& func, |
| 496 Array* default_values); | 500 Array* default_values); |
| 501 |
| 497 void BuildDispatcherScope(const Function& func, | 502 void BuildDispatcherScope(const Function& func, |
| 498 const ArgumentsDescriptor& desc, | 503 const ArgumentsDescriptor& desc, |
| 499 Array* default_values); | 504 Array* default_values); |
| 500 | 505 |
| 501 void ChainNewBlock(LocalScope* outer_scope); | 506 void ChainNewBlock(LocalScope* outer_scope); |
| 502 void OpenBlock(); | 507 void OpenBlock(); |
| 503 void OpenLoopBlock(); | 508 void OpenLoopBlock(); |
| 504 void OpenFunctionBlock(const Function& func); | 509 void OpenFunctionBlock(const Function& func); |
| 505 RawFunction* OpenAsyncFunction(intptr_t formal_param_pos); | 510 RawFunction* OpenAsyncFunction(intptr_t formal_param_pos); |
| 506 SequenceNode* CloseBlock(); | 511 SequenceNode* CloseBlock(); |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 756 int16_t last_used_try_index_; | 761 int16_t last_used_try_index_; |
| 757 | 762 |
| 758 bool unregister_pending_function_; | 763 bool unregister_pending_function_; |
| 759 | 764 |
| 760 DISALLOW_COPY_AND_ASSIGN(Parser); | 765 DISALLOW_COPY_AND_ASSIGN(Parser); |
| 761 }; | 766 }; |
| 762 | 767 |
| 763 } // namespace dart | 768 } // namespace dart |
| 764 | 769 |
| 765 #endif // VM_PARSER_H_ | 770 #endif // VM_PARSER_H_ |
| OLD | NEW |