| 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 18 matching lines...) Expand all Loading... |
| 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 : public ZoneAllocated { | 31 class ParsedFunction : public ZoneAllocated { |
| 32 public: | 32 public: |
| 33 static const int kFirstLocalSlotIndex = -2; | 33 static const int kFirstLocalSlotIndex = -2; |
| 34 | 34 |
| 35 explicit ParsedFunction(const Function& function) | 35 explicit ParsedFunction(const Function& function) |
| 36 : function_(function), | 36 : function_(function), |
| 37 node_sequence_(NULL), | 37 node_sequence_(NULL), |
| 38 instantiator_(NULL), | 38 instantiator_(NULL), |
| 39 default_parameter_values_(Array::Handle()), | 39 default_parameter_values_(Array::ZoneHandle()), |
| 40 saved_context_var_(NULL), | 40 saved_context_var_(NULL), |
| 41 expression_temp_var_(NULL), | 41 expression_temp_var_(NULL), |
| 42 first_parameter_index_(0), | 42 first_parameter_index_(0), |
| 43 first_stack_local_index_(0), | 43 first_stack_local_index_(0), |
| 44 num_copied_params_(0), | 44 num_copied_params_(0), |
| 45 num_stack_locals_(0) { } | 45 num_stack_locals_(0) { |
| 46 ASSERT(function.IsZoneHandle()); |
| 47 } |
| 46 | 48 |
| 47 const Function& function() const { return function_; } | 49 const Function& function() const { return function_; } |
| 48 | 50 |
| 49 SequenceNode* node_sequence() const { return node_sequence_; } | 51 SequenceNode* node_sequence() const { return node_sequence_; } |
| 50 void SetNodeSequence(SequenceNode* node_sequence); | 52 void SetNodeSequence(SequenceNode* node_sequence); |
| 51 | 53 |
| 52 AstNode* instantiator() const { return instantiator_; } | 54 AstNode* instantiator() const { return instantiator_; } |
| 53 void set_instantiator(AstNode* instantiator) { | 55 void set_instantiator(AstNode* instantiator) { |
| 54 // May be NULL. | 56 // May be NULL. |
| 55 instantiator_ = instantiator; | 57 instantiator_ = instantiator; |
| 56 } | 58 } |
| 57 | 59 |
| 58 const Array& default_parameter_values() const { | 60 const Array& default_parameter_values() const { |
| 59 return default_parameter_values_; | 61 return default_parameter_values_; |
| 60 } | 62 } |
| 61 void set_default_parameter_values(const Array& default_parameter_values) { | 63 void set_default_parameter_values(const Array& default_parameter_values) { |
| 64 ASSERT(default_parameter_values.IsZoneHandle()); |
| 62 default_parameter_values_ = default_parameter_values.raw(); | 65 default_parameter_values_ = default_parameter_values.raw(); |
| 63 } | 66 } |
| 64 | 67 |
| 65 LocalVariable* saved_context_var() const { return saved_context_var_; } | 68 LocalVariable* saved_context_var() const { return saved_context_var_; } |
| 66 void set_saved_context_var(LocalVariable* saved_context_var) { | 69 void set_saved_context_var(LocalVariable* saved_context_var) { |
| 67 ASSERT(saved_context_var != NULL); | 70 ASSERT(saved_context_var != NULL); |
| 68 saved_context_var_ = saved_context_var; | 71 saved_context_var_ = saved_context_var; |
| 69 } | 72 } |
| 70 | 73 |
| 71 // Returns NULL if this function does not save the arguments descriptor on | 74 // Returns NULL if this function does not save the arguments descriptor on |
| (...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 625 | 628 |
| 626 // Allocate temporary only once per function. | 629 // Allocate temporary only once per function. |
| 627 LocalVariable* expression_temp_; | 630 LocalVariable* expression_temp_; |
| 628 | 631 |
| 629 DISALLOW_COPY_AND_ASSIGN(Parser); | 632 DISALLOW_COPY_AND_ASSIGN(Parser); |
| 630 }; | 633 }; |
| 631 | 634 |
| 632 } // namespace dart | 635 } // namespace dart |
| 633 | 636 |
| 634 #endif // VM_PARSER_H_ | 637 #endif // VM_PARSER_H_ |
| OLD | NEW |