Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(607)

Side by Side Diff: runtime/vm/parser.h

Issue 10915022: Implement argument definition test in the vm. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "vm/ast.h" 10 #include "vm/ast.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 void set_default_parameter_values(const Array& default_parameter_values) { 61 void set_default_parameter_values(const Array& default_parameter_values) {
62 default_parameter_values_ = default_parameter_values.raw(); 62 default_parameter_values_ = default_parameter_values.raw();
63 } 63 }
64 64
65 LocalVariable* saved_context_var() const { return saved_context_var_; } 65 LocalVariable* saved_context_var() const { return saved_context_var_; }
66 void set_saved_context_var(LocalVariable* saved_context_var) { 66 void set_saved_context_var(LocalVariable* saved_context_var) {
67 ASSERT(saved_context_var != NULL); 67 ASSERT(saved_context_var != NULL);
68 saved_context_var_ = saved_context_var; 68 saved_context_var_ = saved_context_var;
69 } 69 }
70 70
71 // Returns NULL if this function does not save the arguments descriptor on
72 // entry.
73 LocalVariable* GetSavedArgumentsDescriptorVar() const;
74
71 LocalVariable* expression_temp_var() const { 75 LocalVariable* expression_temp_var() const {
72 ASSERT(has_expression_temp_var()); 76 ASSERT(has_expression_temp_var());
73 return expression_temp_var_; 77 return expression_temp_var_;
74 } 78 }
75 void set_expression_temp_var(LocalVariable* value) { 79 void set_expression_temp_var(LocalVariable* value) {
76 ASSERT(!has_expression_temp_var()); 80 ASSERT(!has_expression_temp_var());
77 expression_temp_var_ = value; 81 expression_temp_var_ = value;
78 } 82 }
79 bool has_expression_temp_var() const { 83 bool has_expression_temp_var() const {
80 return expression_temp_var_ != NULL; 84 return expression_temp_var_ != NULL;
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 AstNode* ParseStringLiteral(); 456 AstNode* ParseStringLiteral();
453 String* ParseImportStringLiteral(); 457 String* ParseImportStringLiteral();
454 AstNode* ParseCompoundLiteral(); 458 AstNode* ParseCompoundLiteral();
455 AstNode* ParseListLiteral(intptr_t type_pos, 459 AstNode* ParseListLiteral(intptr_t type_pos,
456 bool is_const, 460 bool is_const,
457 const AbstractTypeArguments& type_arguments); 461 const AbstractTypeArguments& type_arguments);
458 AstNode* ParseMapLiteral(intptr_t type_pos, 462 AstNode* ParseMapLiteral(intptr_t type_pos,
459 bool is_const, 463 bool is_const,
460 const AbstractTypeArguments& type_arguments); 464 const AbstractTypeArguments& type_arguments);
461 AstNode* ParseNewOperator(); 465 AstNode* ParseNewOperator();
466 AstNode* ParseArgumentDefinitionTest();
462 467
463 // An implicit argument, if non-null, is prepended to the returned list. 468 // An implicit argument, if non-null, is prepended to the returned list.
464 ArgumentListNode* ParseActualParameters(ArgumentListNode* implicit_arguments, 469 ArgumentListNode* ParseActualParameters(ArgumentListNode* implicit_arguments,
465 bool require_const); 470 bool require_const);
466 AstNode* ParseStaticCall(const Class& cls, 471 AstNode* ParseStaticCall(const Class& cls,
467 const String& method_name, 472 const String& method_name,
468 intptr_t ident_pos); 473 intptr_t ident_pos);
469 AstNode* ParseInstanceCall(AstNode* receiver, const String& method_name); 474 AstNode* ParseInstanceCall(AstNode* receiver, const String& method_name);
470 AstNode* ParseClosureCall(AstNode* closure); 475 AstNode* ParseClosureCall(AstNode* closure);
471 AstNode* GenerateStaticFieldLookup(const Field& field, 476 AstNode* GenerateStaticFieldLookup(const Field& field,
472 intptr_t ident_pos); 477 intptr_t ident_pos);
473 AstNode* ParseStaticFieldAccess(const Class& cls, 478 AstNode* ParseStaticFieldAccess(const Class& cls,
474 const String& field_name, 479 const String& field_name,
475 intptr_t ident_pos, 480 intptr_t ident_pos,
476 bool consume_cascades); 481 bool consume_cascades);
477 482
478 LocalVariable* LookupLocalScope(const String& ident); 483 LocalVariable* LookupLocalScope(const String& ident);
484 bool IsFormalParameter(const String& ident,
485 Function* owner_function,
486 LocalScope** owner_scope,
487 intptr_t* local_index);
479 void CheckInstanceFieldAccess(intptr_t field_pos, const String& field_name); 488 void CheckInstanceFieldAccess(intptr_t field_pos, const String& field_name);
480 RawClass* TypeParametersScopeClass() const; 489 RawClass* TypeParametersScopeClass() const;
481 const Type* ReceiverType(intptr_t type_pos) const; 490 const Type* ReceiverType(intptr_t type_pos) const;
482 bool IsInstantiatorRequired() const; 491 bool IsInstantiatorRequired() const;
483 bool IsDefinedInLexicalScope(const String& ident); 492 bool IsDefinedInLexicalScope(const String& ident);
484 bool ResolveIdentInLocalScope(intptr_t ident_pos, 493 bool ResolveIdentInLocalScope(intptr_t ident_pos,
485 const String &ident, 494 const String &ident,
486 AstNode** node); 495 AstNode** node);
487 static const bool kResolveLocally = true; 496 static const bool kResolveLocally = true;
488 static const bool kResolveIncludingImports = false; 497 static const bool kResolveIncludingImports = false;
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
594 603
595 // Allocate temporary only once per function. 604 // Allocate temporary only once per function.
596 LocalVariable* expression_temp_; 605 LocalVariable* expression_temp_;
597 606
598 DISALLOW_COPY_AND_ASSIGN(Parser); 607 DISALLOW_COPY_AND_ASSIGN(Parser);
599 }; 608 };
600 609
601 } // namespace dart 610 } // namespace dart
602 611
603 #endif // VM_PARSER_H_ 612 #endif // VM_PARSER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698