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

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

Issue 774763002: Cleanups. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years 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
« no previous file with comments | « runtime/vm/intrinsifier.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "platform/assert.h" 10 #include "platform/assert.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 : function_(function), 44 : function_(function),
45 code_(Code::Handle(isolate, function.unoptimized_code())), 45 code_(Code::Handle(isolate, function.unoptimized_code())),
46 node_sequence_(NULL), 46 node_sequence_(NULL),
47 regexp_compile_data_(NULL), 47 regexp_compile_data_(NULL),
48 instantiator_(NULL), 48 instantiator_(NULL),
49 default_parameter_values_(Array::ZoneHandle(isolate, Array::null())), 49 default_parameter_values_(Array::ZoneHandle(isolate, Array::null())),
50 current_context_var_(NULL), 50 current_context_var_(NULL),
51 expression_temp_var_(NULL), 51 expression_temp_var_(NULL),
52 finally_return_temp_var_(NULL), 52 finally_return_temp_var_(NULL),
53 deferred_prefixes_(new ZoneGrowableArray<const LibraryPrefix*>()), 53 deferred_prefixes_(new ZoneGrowableArray<const LibraryPrefix*>()),
54 guarded_fields_(new ZoneGrowableArray<const Field*>()),
54 first_parameter_index_(0), 55 first_parameter_index_(0),
55 first_stack_local_index_(0), 56 first_stack_local_index_(0),
56 num_copied_params_(0), 57 num_copied_params_(0),
57 num_stack_locals_(0), 58 num_stack_locals_(0),
58 have_seen_await_expr_(false), 59 have_seen_await_expr_(false),
59 saved_try_ctx_(NULL), 60 saved_try_ctx_(NULL),
60 async_saved_try_ctx_name_(String::ZoneHandle(isolate, String::null())), 61 async_saved_try_ctx_name_(String::ZoneHandle(isolate, String::null())),
61 isolate_(isolate) { 62 isolate_(isolate) {
62 ASSERT(function.IsZoneHandle()); 63 ASSERT(function.IsZoneHandle());
63 // Every function has a local variable for the current context. 64 // Every function has a local variable for the current context.
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 void EnsureFinallyReturnTemp(); 126 void EnsureFinallyReturnTemp();
126 127
127 LocalVariable* EnsureExpressionTemp(); 128 LocalVariable* EnsureExpressionTemp();
128 129
129 bool HasDeferredPrefixes() const { return deferred_prefixes_->length() != 0; } 130 bool HasDeferredPrefixes() const { return deferred_prefixes_->length() != 0; }
130 ZoneGrowableArray<const LibraryPrefix*>* deferred_prefixes() const { 131 ZoneGrowableArray<const LibraryPrefix*>* deferred_prefixes() const {
131 return deferred_prefixes_; 132 return deferred_prefixes_;
132 } 133 }
133 void AddDeferredPrefix(const LibraryPrefix& prefix); 134 void AddDeferredPrefix(const LibraryPrefix& prefix);
134 135
136 ZoneGrowableArray<const Field*>* guarded_fields() const {
137 return guarded_fields_;
138 }
139
135 int first_parameter_index() const { return first_parameter_index_; } 140 int first_parameter_index() const { return first_parameter_index_; }
136 int first_stack_local_index() const { return first_stack_local_index_; } 141 int first_stack_local_index() const { return first_stack_local_index_; }
137 int num_copied_params() const { return num_copied_params_; } 142 int num_copied_params() const { return num_copied_params_; }
138 int num_stack_locals() const { return num_stack_locals_; } 143 int num_stack_locals() const { return num_stack_locals_; }
144 int num_non_copied_params() const {
145 return (num_copied_params_ == 0)
146 ? function().num_fixed_parameters() : 0;
147 }
139 148
140 void AllocateVariables(); 149 void AllocateVariables();
141 void AllocateIrregexpVariables(intptr_t num_stack_locals); 150 void AllocateIrregexpVariables(intptr_t num_stack_locals);
142 151
143 void record_await() { have_seen_await_expr_ = true; } 152 void record_await() { have_seen_await_expr_ = true; }
144 bool have_seen_await() const { return have_seen_await_expr_; } 153 bool have_seen_await() const { return have_seen_await_expr_; }
145 154
146 void set_saved_try_ctx(LocalVariable* saved_try_ctx) { 155 void set_saved_try_ctx(LocalVariable* saved_try_ctx) {
147 ASSERT((saved_try_ctx == NULL) || !saved_try_ctx->is_captured()); 156 ASSERT((saved_try_ctx == NULL) || !saved_try_ctx->is_captured());
148 saved_try_ctx_ = saved_try_ctx; 157 saved_try_ctx_ = saved_try_ctx;
(...skipping 18 matching lines...) Expand all
167 const Function& function_; 176 const Function& function_;
168 Code& code_; 177 Code& code_;
169 SequenceNode* node_sequence_; 178 SequenceNode* node_sequence_;
170 RegExpCompileData* regexp_compile_data_; 179 RegExpCompileData* regexp_compile_data_;
171 LocalVariable* instantiator_; 180 LocalVariable* instantiator_;
172 Array& default_parameter_values_; 181 Array& default_parameter_values_;
173 LocalVariable* current_context_var_; 182 LocalVariable* current_context_var_;
174 LocalVariable* expression_temp_var_; 183 LocalVariable* expression_temp_var_;
175 LocalVariable* finally_return_temp_var_; 184 LocalVariable* finally_return_temp_var_;
176 ZoneGrowableArray<const LibraryPrefix*>* deferred_prefixes_; 185 ZoneGrowableArray<const LibraryPrefix*>* deferred_prefixes_;
186 ZoneGrowableArray<const Field*>* guarded_fields_;
177 187
178 int first_parameter_index_; 188 int first_parameter_index_;
179 int first_stack_local_index_; 189 int first_stack_local_index_;
180 int num_copied_params_; 190 int num_copied_params_;
181 int num_stack_locals_; 191 int num_stack_locals_;
182 bool have_seen_await_expr_; 192 bool have_seen_await_expr_;
183 LocalVariable* saved_try_ctx_; 193 LocalVariable* saved_try_ctx_;
184 String& async_saved_try_ctx_name_; 194 String& async_saved_try_ctx_name_;
185 195
186 Isolate* isolate_; 196 Isolate* isolate_;
(...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after
813 bool unregister_pending_function_; 823 bool unregister_pending_function_;
814 824
815 LocalScope* async_temp_scope_; 825 LocalScope* async_temp_scope_;
816 826
817 DISALLOW_COPY_AND_ASSIGN(Parser); 827 DISALLOW_COPY_AND_ASSIGN(Parser);
818 }; 828 };
819 829
820 } // namespace dart 830 } // namespace dart
821 831
822 #endif // VM_PARSER_H_ 832 #endif // VM_PARSER_H_
OLDNEW
« no previous file with comments | « runtime/vm/intrinsifier.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698