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 27 matching lines...) Expand all Loading... |
38 // The class ParsedFunction holds the result of parsing a function. | 38 // The class ParsedFunction holds the result of parsing a function. |
39 class ParsedFunction : public ZoneAllocated { | 39 class ParsedFunction : public ZoneAllocated { |
40 public: | 40 public: |
41 ParsedFunction(Isolate* isolate, const Function& function) | 41 ParsedFunction(Isolate* isolate, const Function& function) |
42 : function_(function), | 42 : function_(function), |
43 code_(Code::Handle(isolate, function.unoptimized_code())), | 43 code_(Code::Handle(isolate, function.unoptimized_code())), |
44 node_sequence_(NULL), | 44 node_sequence_(NULL), |
45 instantiator_(NULL), | 45 instantiator_(NULL), |
46 default_parameter_values_(Array::ZoneHandle(isolate, Array::null())), | 46 default_parameter_values_(Array::ZoneHandle(isolate, Array::null())), |
47 current_context_var_(NULL), | 47 current_context_var_(NULL), |
48 saved_entry_context_var_(NULL), | |
49 expression_temp_var_(NULL), | 48 expression_temp_var_(NULL), |
50 finally_return_temp_var_(NULL), | 49 finally_return_temp_var_(NULL), |
51 deferred_prefixes_(new ZoneGrowableArray<const LibraryPrefix*>()), | 50 deferred_prefixes_(new ZoneGrowableArray<const LibraryPrefix*>()), |
52 first_parameter_index_(0), | 51 first_parameter_index_(0), |
53 first_stack_local_index_(0), | 52 first_stack_local_index_(0), |
54 num_copied_params_(0), | 53 num_copied_params_(0), |
55 num_stack_locals_(0), | 54 num_stack_locals_(0), |
56 have_seen_await_expr_(false), | 55 have_seen_await_expr_(false), |
57 saved_try_ctx_(NULL), | 56 saved_try_ctx_(NULL), |
58 async_saved_try_ctx_name_(String::ZoneHandle(isolate, String::null())), | 57 async_saved_try_ctx_name_(String::ZoneHandle(isolate, String::null())), |
(...skipping 26 matching lines...) Expand all Loading... |
85 void set_default_parameter_values(const Array& default_parameter_values) { | 84 void set_default_parameter_values(const Array& default_parameter_values) { |
86 ASSERT(default_parameter_values.IsZoneHandle() || | 85 ASSERT(default_parameter_values.IsZoneHandle() || |
87 default_parameter_values.InVMHeap()); | 86 default_parameter_values.InVMHeap()); |
88 default_parameter_values_ = default_parameter_values.raw(); | 87 default_parameter_values_ = default_parameter_values.raw(); |
89 } | 88 } |
90 | 89 |
91 LocalVariable* current_context_var() const { | 90 LocalVariable* current_context_var() const { |
92 return current_context_var_; | 91 return current_context_var_; |
93 } | 92 } |
94 | 93 |
95 LocalVariable* saved_entry_context_var() const { | |
96 return saved_entry_context_var_; | |
97 } | |
98 void set_saved_entry_context_var(LocalVariable* saved_entry_context_var) { | |
99 ASSERT(saved_entry_context_var != NULL); | |
100 saved_entry_context_var_ = saved_entry_context_var; | |
101 } | |
102 | |
103 LocalVariable* expression_temp_var() const { | 94 LocalVariable* expression_temp_var() const { |
104 ASSERT(has_expression_temp_var()); | 95 ASSERT(has_expression_temp_var()); |
105 return expression_temp_var_; | 96 return expression_temp_var_; |
106 } | 97 } |
107 void set_expression_temp_var(LocalVariable* value) { | 98 void set_expression_temp_var(LocalVariable* value) { |
108 ASSERT(!has_expression_temp_var()); | 99 ASSERT(!has_expression_temp_var()); |
109 expression_temp_var_ = value; | 100 expression_temp_var_ = value; |
110 } | 101 } |
111 bool has_expression_temp_var() const { | 102 bool has_expression_temp_var() const { |
112 return expression_temp_var_ != NULL; | 103 return expression_temp_var_ != NULL; |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 | 157 |
167 Isolate* isolate() const { return isolate_; } | 158 Isolate* isolate() const { return isolate_; } |
168 | 159 |
169 private: | 160 private: |
170 const Function& function_; | 161 const Function& function_; |
171 Code& code_; | 162 Code& code_; |
172 SequenceNode* node_sequence_; | 163 SequenceNode* node_sequence_; |
173 LocalVariable* instantiator_; | 164 LocalVariable* instantiator_; |
174 Array& default_parameter_values_; | 165 Array& default_parameter_values_; |
175 LocalVariable* current_context_var_; | 166 LocalVariable* current_context_var_; |
176 LocalVariable* saved_entry_context_var_; | |
177 LocalVariable* expression_temp_var_; | 167 LocalVariable* expression_temp_var_; |
178 LocalVariable* finally_return_temp_var_; | 168 LocalVariable* finally_return_temp_var_; |
179 ZoneGrowableArray<const LibraryPrefix*>* deferred_prefixes_; | 169 ZoneGrowableArray<const LibraryPrefix*>* deferred_prefixes_; |
180 | 170 |
181 int first_parameter_index_; | 171 int first_parameter_index_; |
182 int first_stack_local_index_; | 172 int first_stack_local_index_; |
183 int num_copied_params_; | 173 int num_copied_params_; |
184 int num_stack_locals_; | 174 int num_stack_locals_; |
185 bool have_seen_await_expr_; | 175 bool have_seen_await_expr_; |
186 LocalVariable* saved_try_ctx_; | 176 LocalVariable* saved_try_ctx_; |
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
812 bool unregister_pending_function_; | 802 bool unregister_pending_function_; |
813 | 803 |
814 LocalScope* async_temp_scope_; | 804 LocalScope* async_temp_scope_; |
815 | 805 |
816 DISALLOW_COPY_AND_ASSIGN(Parser); | 806 DISALLOW_COPY_AND_ASSIGN(Parser); |
817 }; | 807 }; |
818 | 808 |
819 } // namespace dart | 809 } // namespace dart |
820 | 810 |
821 #endif // VM_PARSER_H_ | 811 #endif // VM_PARSER_H_ |
OLD | NEW |