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_SCOPES_H_ | 5 #ifndef VM_SCOPES_H_ |
6 #define VM_SCOPES_H_ | 6 #define VM_SCOPES_H_ |
7 | 7 |
8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
9 #include "vm/assembler.h" | 9 #include "vm/assembler.h" |
10 #include "vm/growable_array.h" | 10 #include "vm/growable_array.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
56 bool HasIndex() const { | 56 bool HasIndex() const { |
57 return index_ != kUnitializedIndex; | 57 return index_ != kUnitializedIndex; |
58 } | 58 } |
59 int index() const { | 59 int index() const { |
60 ASSERT(HasIndex()); | 60 ASSERT(HasIndex()); |
61 return index_; | 61 return index_; |
62 } | 62 } |
63 | 63 |
64 // Assign an index to a local. | 64 // Assign an index to a local. |
65 void set_index(int index) { | 65 void set_index(int index) { |
66 ASSERT(!HasIndex()); | |
hausner
2013/05/28 17:00:47
Why are you removing these asserts? Does your chan
Florian Schneider
2013/05/30 09:29:31
I'm setting the index of the new dynamically alloc
| |
67 ASSERT(index != kUnitializedIndex); | |
68 index_ = index; | 66 index_ = index; |
69 } | 67 } |
70 | 68 |
71 void set_invisible(bool value) { | 69 void set_invisible(bool value) { |
72 is_invisible_ = value; | 70 is_invisible_ = value; |
73 } | 71 } |
74 | 72 |
75 bool IsConst() const { | 73 bool IsConst() const { |
76 return const_value_ != NULL; | 74 return const_value_ != NULL; |
77 } | 75 } |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
361 intptr_t end_token_pos_; // Token index of end of scope. | 359 intptr_t end_token_pos_; // Token index of end of scope. |
362 GrowableArray<LocalVariable*> variables_; | 360 GrowableArray<LocalVariable*> variables_; |
363 GrowableArray<SourceLabel*> labels_; | 361 GrowableArray<SourceLabel*> labels_; |
364 | 362 |
365 DISALLOW_COPY_AND_ASSIGN(LocalScope); | 363 DISALLOW_COPY_AND_ASSIGN(LocalScope); |
366 }; | 364 }; |
367 | 365 |
368 } // namespace dart | 366 } // namespace dart |
369 | 367 |
370 #endif // VM_SCOPES_H_ | 368 #endif // VM_SCOPES_H_ |
OLD | NEW |