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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 // Parse top level of a class and register all functions/fields. | 192 // Parse top level of a class and register all functions/fields. |
193 static void ParseClass(const Class& cls); | 193 static void ParseClass(const Class& cls); |
194 | 194 |
195 static void ParseFunction(ParsedFunction* parsed_function); | 195 static void ParseFunction(ParsedFunction* parsed_function); |
196 | 196 |
197 // Parse and evaluate the metadata expressions at token_pos in the | 197 // Parse and evaluate the metadata expressions at token_pos in the |
198 // class namespace of class cls (which can be the implicit toplevel | 198 // class namespace of class cls (which can be the implicit toplevel |
199 // class if the metadata is at the top-level). | 199 // class if the metadata is at the top-level). |
200 static RawObject* ParseMetadata(const Class& cls, intptr_t token_pos); | 200 static RawObject* ParseMetadata(const Class& cls, intptr_t token_pos); |
201 | 201 |
| 202 // Build a function containing the initializer expression of the |
| 203 // given static field. |
| 204 static ParsedFunction* ParseStaticFieldInitializer(const Field& field); |
| 205 |
202 // Parse a function to retrieve parameter information that is not retained in | 206 // Parse a function to retrieve parameter information that is not retained in |
203 // the dart::Function object. Returns either an error if the parse fails | 207 // the dart::Function object. Returns either an error if the parse fails |
204 // (which could be the case for local functions), or a flat array of entries | 208 // (which could be the case for local functions), or a flat array of entries |
205 // for each parameter. Each parameter entry contains: | 209 // for each parameter. Each parameter entry contains: |
206 // * a Dart bool indicating whether the parameter was declared final | 210 // * a Dart bool indicating whether the parameter was declared final |
207 // * its default value (or null if none was declared) | 211 // * its default value (or null if none was declared) |
208 // * an array of metadata (or null if no metadata was declared). | 212 // * an array of metadata (or null if no metadata was declared). |
209 enum { | 213 enum { |
210 kParameterIsFinalOffset, | 214 kParameterIsFinalOffset, |
211 kParameterDefaultValueOffset, | 215 kParameterDefaultValueOffset, |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
500 Array* default_parameter_values); | 504 Array* default_parameter_values); |
501 SequenceNode* ParseFunc(const Function& func, | 505 SequenceNode* ParseFunc(const Function& func, |
502 Array* default_parameter_values); | 506 Array* default_parameter_values); |
503 RawClass* GetClassForAsync(const String& class_name); | 507 RawClass* GetClassForAsync(const String& class_name); |
504 | 508 |
505 void ParseNativeFunctionBlock(const ParamList* params, const Function& func); | 509 void ParseNativeFunctionBlock(const ParamList* params, const Function& func); |
506 | 510 |
507 SequenceNode* ParseInstanceGetter(const Function& func); | 511 SequenceNode* ParseInstanceGetter(const Function& func); |
508 SequenceNode* ParseInstanceSetter(const Function& func); | 512 SequenceNode* ParseInstanceSetter(const Function& func); |
509 SequenceNode* ParseStaticFinalGetter(const Function& func); | 513 SequenceNode* ParseStaticFinalGetter(const Function& func); |
510 SequenceNode* ParseStaticInitializer(const Function& func); | 514 SequenceNode* ParseStaticInitializer(); |
511 SequenceNode* ParseMethodExtractor(const Function& func); | 515 SequenceNode* ParseMethodExtractor(const Function& func); |
512 SequenceNode* ParseNoSuchMethodDispatcher(const Function& func, | 516 SequenceNode* ParseNoSuchMethodDispatcher(const Function& func, |
513 Array* default_values); | 517 Array* default_values); |
514 SequenceNode* ParseInvokeFieldDispatcher(const Function& func, | 518 SequenceNode* ParseInvokeFieldDispatcher(const Function& func, |
515 Array* default_values); | 519 Array* default_values); |
| 520 |
516 void BuildDispatcherScope(const Function& func, | 521 void BuildDispatcherScope(const Function& func, |
517 const ArgumentsDescriptor& desc, | 522 const ArgumentsDescriptor& desc, |
518 Array* default_values); | 523 Array* default_values); |
519 | 524 |
520 void ChainNewBlock(LocalScope* outer_scope); | 525 void ChainNewBlock(LocalScope* outer_scope); |
521 void OpenBlock(); | 526 void OpenBlock(); |
522 void OpenLoopBlock(); | 527 void OpenLoopBlock(); |
523 void OpenFunctionBlock(const Function& func); | 528 void OpenFunctionBlock(const Function& func); |
524 void OpenAsyncClosure(); | 529 void OpenAsyncClosure(); |
525 RawFunction* OpenAsyncFunction(intptr_t formal_param_pos); | 530 RawFunction* OpenAsyncFunction(intptr_t formal_param_pos); |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
778 int16_t last_used_try_index_; | 783 int16_t last_used_try_index_; |
779 | 784 |
780 bool unregister_pending_function_; | 785 bool unregister_pending_function_; |
781 | 786 |
782 DISALLOW_COPY_AND_ASSIGN(Parser); | 787 DISALLOW_COPY_AND_ASSIGN(Parser); |
783 }; | 788 }; |
784 | 789 |
785 } // namespace dart | 790 } // namespace dart |
786 | 791 |
787 #endif // VM_PARSER_H_ | 792 #endif // VM_PARSER_H_ |
OLD | NEW |