| 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 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 const Class& toplevel_class, | 356 const Class& toplevel_class, |
| 357 intptr_t metadata_pos); | 357 intptr_t metadata_pos); |
| 358 void ParseTypedef(const GrowableObjectArray& pending_classes, | 358 void ParseTypedef(const GrowableObjectArray& pending_classes, |
| 359 const Class& toplevel_class, | 359 const Class& toplevel_class, |
| 360 intptr_t metadata_pos); | 360 intptr_t metadata_pos); |
| 361 void ParseTopLevelVariable(TopLevel* top_level, intptr_t metadata_pos); | 361 void ParseTopLevelVariable(TopLevel* top_level, intptr_t metadata_pos); |
| 362 void ParseTopLevelFunction(TopLevel* top_level, intptr_t metadata_pos); | 362 void ParseTopLevelFunction(TopLevel* top_level, intptr_t metadata_pos); |
| 363 void ParseTopLevelAccessor(TopLevel* top_level, intptr_t metadata_pos); | 363 void ParseTopLevelAccessor(TopLevel* top_level, intptr_t metadata_pos); |
| 364 RawArray* EvaluateMetadata(); | 364 RawArray* EvaluateMetadata(); |
| 365 | 365 |
| 366 RawFunction::AsyncModifier ParseFunctionModifier(); |
| 367 |
| 366 // Support for parsing libraries. | 368 // Support for parsing libraries. |
| 367 RawObject* CallLibraryTagHandler(Dart_LibraryTag tag, | 369 RawObject* CallLibraryTagHandler(Dart_LibraryTag tag, |
| 368 intptr_t token_pos, | 370 intptr_t token_pos, |
| 369 const String& url); | 371 const String& url); |
| 370 void ParseIdentList(GrowableObjectArray* names); | 372 void ParseIdentList(GrowableObjectArray* names); |
| 371 void ParseLibraryDefinition(); | 373 void ParseLibraryDefinition(); |
| 372 void ParseLibraryName(); | 374 void ParseLibraryName(); |
| 373 void ParseLibraryImportExport(intptr_t metadata_pos); | 375 void ParseLibraryImportExport(intptr_t metadata_pos); |
| 374 void ParseLibraryPart(); | 376 void ParseLibraryPart(); |
| 375 void ParsePartHeader(); | 377 void ParsePartHeader(); |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 456 intptr_t token_pos, | 458 intptr_t token_pos, |
| 457 AstNode* receiver); | 459 AstNode* receiver); |
| 458 static void AddFormalParamsToFunction(const ParamList* params, | 460 static void AddFormalParamsToFunction(const ParamList* params, |
| 459 const Function& func); | 461 const Function& func); |
| 460 void AddFormalParamsToScope(const ParamList* params, LocalScope* scope); | 462 void AddFormalParamsToScope(const ParamList* params, LocalScope* scope); |
| 461 | 463 |
| 462 SequenceNode* ParseConstructor(const Function& func, | 464 SequenceNode* ParseConstructor(const Function& func, |
| 463 Array* default_parameter_values); | 465 Array* default_parameter_values); |
| 464 SequenceNode* ParseFunc(const Function& func, | 466 SequenceNode* ParseFunc(const Function& func, |
| 465 Array* default_parameter_values); | 467 Array* default_parameter_values); |
| 468 RawClass* GetClassForAsync(const String& class_name); |
| 466 | 469 |
| 467 void ParseNativeFunctionBlock(const ParamList* params, const Function& func); | 470 void ParseNativeFunctionBlock(const ParamList* params, const Function& func); |
| 468 | 471 |
| 469 SequenceNode* ParseInstanceGetter(const Function& func); | 472 SequenceNode* ParseInstanceGetter(const Function& func); |
| 470 SequenceNode* ParseInstanceSetter(const Function& func); | 473 SequenceNode* ParseInstanceSetter(const Function& func); |
| 471 SequenceNode* ParseStaticFinalGetter(const Function& func); | 474 SequenceNode* ParseStaticFinalGetter(const Function& func); |
| 472 SequenceNode* ParseStaticInitializer(const Function& func); | 475 SequenceNode* ParseStaticInitializer(const Function& func); |
| 473 SequenceNode* ParseMethodExtractor(const Function& func); | 476 SequenceNode* ParseMethodExtractor(const Function& func); |
| 474 SequenceNode* ParseNoSuchMethodDispatcher(const Function& func, | 477 SequenceNode* ParseNoSuchMethodDispatcher(const Function& func, |
| 475 Array* default_values); | 478 Array* default_values); |
| 476 SequenceNode* ParseInvokeFieldDispatcher(const Function& func, | 479 SequenceNode* ParseInvokeFieldDispatcher(const Function& func, |
| 477 Array* default_values); | 480 Array* default_values); |
| 478 void BuildDispatcherScope(const Function& func, | 481 void BuildDispatcherScope(const Function& func, |
| 479 const ArgumentsDescriptor& desc, | 482 const ArgumentsDescriptor& desc, |
| 480 Array* default_values); | 483 Array* default_values); |
| 481 | 484 |
| 482 void ChainNewBlock(LocalScope* outer_scope); | 485 void ChainNewBlock(LocalScope* outer_scope); |
| 483 void OpenBlock(); | 486 void OpenBlock(); |
| 484 void OpenLoopBlock(); | 487 void OpenLoopBlock(); |
| 485 void OpenFunctionBlock(const Function& func); | 488 void OpenFunctionBlock(const Function& func); |
| 489 RawFunction* OpenAsyncFunction(intptr_t formal_param_pos); |
| 486 SequenceNode* CloseBlock(); | 490 SequenceNode* CloseBlock(); |
| 491 SequenceNode* CloseAsyncFunction(const Function& closure, |
| 492 SequenceNode* closure_node); |
| 493 void CloseAsyncClosure(SequenceNode* body); |
| 494 |
| 487 | 495 |
| 488 LocalVariable* LookupPhaseParameter(); | 496 LocalVariable* LookupPhaseParameter(); |
| 489 LocalVariable* LookupReceiver(LocalScope* from_scope, bool test_only); | 497 LocalVariable* LookupReceiver(LocalScope* from_scope, bool test_only); |
| 490 LocalVariable* LookupTypeArgumentsParameter(LocalScope* from_scope, | 498 LocalVariable* LookupTypeArgumentsParameter(LocalScope* from_scope, |
| 491 bool test_only); | 499 bool test_only); |
| 492 void CaptureInstantiator(); | 500 void CaptureInstantiator(); |
| 493 AstNode* LoadReceiver(intptr_t token_pos); | 501 AstNode* LoadReceiver(intptr_t token_pos); |
| 494 AstNode* LoadTypeArgumentsParameter(intptr_t token_pos); | 502 AstNode* LoadTypeArgumentsParameter(intptr_t token_pos); |
| 495 AstNode* LoadFieldIfUnresolved(AstNode* node); | 503 AstNode* LoadFieldIfUnresolved(AstNode* node); |
| 496 AstNode* LoadClosure(PrimaryNode* primary); | 504 AstNode* LoadClosure(PrimaryNode* primary); |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 732 int16_t last_used_try_index_; | 740 int16_t last_used_try_index_; |
| 733 | 741 |
| 734 bool unregister_pending_function_; | 742 bool unregister_pending_function_; |
| 735 | 743 |
| 736 DISALLOW_COPY_AND_ASSIGN(Parser); | 744 DISALLOW_COPY_AND_ASSIGN(Parser); |
| 737 }; | 745 }; |
| 738 | 746 |
| 739 } // namespace dart | 747 } // namespace dart |
| 740 | 748 |
| 741 #endif // VM_PARSER_H_ | 749 #endif // VM_PARSER_H_ |
| OLD | NEW |