| 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 "vm/ast.h" | 10 #include "vm/ast.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 struct FieldInitExpression; | 28 struct FieldInitExpression; |
| 29 | 29 |
| 30 // The class ParsedFunction holds the result of parsing a function. | 30 // The class ParsedFunction holds the result of parsing a function. |
| 31 class ParsedFunction : ValueObject { | 31 class ParsedFunction : ValueObject { |
| 32 public: | 32 public: |
| 33 explicit ParsedFunction(const Function& function) | 33 explicit ParsedFunction(const Function& function) |
| 34 : function_(function), | 34 : function_(function), |
| 35 node_sequence_(NULL), | 35 node_sequence_(NULL), |
| 36 instantiator_(NULL), | 36 instantiator_(NULL), |
| 37 default_parameter_values_(Array::Handle()), | 37 default_parameter_values_(Array::Handle()), |
| 38 saved_context_var_(NULL), |
| 38 first_parameter_index_(0), | 39 first_parameter_index_(0), |
| 39 first_stack_local_index_(0), | 40 first_stack_local_index_(0), |
| 40 copied_parameter_count_(0), | 41 copied_parameter_count_(0), |
| 41 stack_local_count_(0) { } | 42 stack_local_count_(0) { } |
| 42 | 43 |
| 43 const Function& function() const { return function_; } | 44 const Function& function() const { return function_; } |
| 44 | 45 |
| 45 SequenceNode* node_sequence() const { return node_sequence_; } | 46 SequenceNode* node_sequence() const { return node_sequence_; } |
| 46 void set_node_sequence(SequenceNode* node_sequence) { | 47 void set_node_sequence(SequenceNode* node_sequence) { |
| 47 ASSERT(node_sequence != NULL); | 48 ASSERT(node_sequence != NULL); |
| 48 node_sequence_ = node_sequence; | 49 node_sequence_ = node_sequence; |
| 49 } | 50 } |
| 50 | 51 |
| 51 AstNode* instantiator() const { return instantiator_; } | 52 AstNode* instantiator() const { return instantiator_; } |
| 52 void set_instantiator(AstNode* instantiator) { | 53 void set_instantiator(AstNode* instantiator) { |
| 53 // May be NULL. | 54 // May be NULL. |
| 54 instantiator_ = instantiator; | 55 instantiator_ = instantiator; |
| 55 } | 56 } |
| 56 | 57 |
| 57 const Array& default_parameter_values() const { | 58 const Array& default_parameter_values() const { |
| 58 return default_parameter_values_; | 59 return default_parameter_values_; |
| 59 } | 60 } |
| 60 void set_default_parameter_values(const Array& default_parameter_values) { | 61 void set_default_parameter_values(const Array& default_parameter_values) { |
| 61 default_parameter_values_ = default_parameter_values.raw(); | 62 default_parameter_values_ = default_parameter_values.raw(); |
| 62 } | 63 } |
| 63 | 64 |
| 65 LocalVariable* saved_context_var() const { return saved_context_var_; } |
| 66 void set_saved_context_var(LocalVariable* saved_context_var) { |
| 67 ASSERT(saved_context_var != NULL); |
| 68 saved_context_var_ = saved_context_var; |
| 69 } |
| 70 |
| 64 int first_parameter_index() const { return first_parameter_index_; } | 71 int first_parameter_index() const { return first_parameter_index_; } |
| 65 int first_stack_local_index() const { return first_stack_local_index_; } | 72 int first_stack_local_index() const { return first_stack_local_index_; } |
| 66 int copied_parameter_count() const { return copied_parameter_count_; } | 73 int copied_parameter_count() const { return copied_parameter_count_; } |
| 67 int stack_local_count() const { return stack_local_count_; } | 74 int stack_local_count() const { return stack_local_count_; } |
| 68 | 75 |
| 69 void AllocateVariables(); | 76 void AllocateVariables(); |
| 70 | 77 |
| 71 private: | 78 private: |
| 72 const Function& function_; | 79 const Function& function_; |
| 73 SequenceNode* node_sequence_; | 80 SequenceNode* node_sequence_; |
| 74 AstNode* instantiator_; | 81 AstNode* instantiator_; |
| 75 Array& default_parameter_values_; | 82 Array& default_parameter_values_; |
| 83 LocalVariable* saved_context_var_; |
| 76 | 84 |
| 77 int first_parameter_index_; | 85 int first_parameter_index_; |
| 78 int first_stack_local_index_; | 86 int first_stack_local_index_; |
| 79 int copied_parameter_count_; | 87 int copied_parameter_count_; |
| 80 int stack_local_count_; | 88 int stack_local_count_; |
| 81 | 89 |
| 82 DISALLOW_COPY_AND_ASSIGN(ParsedFunction); | 90 DISALLOW_COPY_AND_ASSIGN(ParsedFunction); |
| 83 }; | 91 }; |
| 84 | 92 |
| 85 | 93 |
| (...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 496 // code at all points in the try block where an exit from the block is | 504 // code at all points in the try block where an exit from the block is |
| 497 // done using 'return', 'break' or 'continue' statements. | 505 // done using 'return', 'break' or 'continue' statements. |
| 498 TryBlocks* try_blocks_list_; | 506 TryBlocks* try_blocks_list_; |
| 499 | 507 |
| 500 DISALLOW_COPY_AND_ASSIGN(Parser); | 508 DISALLOW_COPY_AND_ASSIGN(Parser); |
| 501 }; | 509 }; |
| 502 | 510 |
| 503 } // namespace dart | 511 } // namespace dart |
| 504 | 512 |
| 505 #endif // VM_PARSER_H_ | 513 #endif // VM_PARSER_H_ |
| OLD | NEW |