| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 int index() const { | 55 int index() const { |
| 56 ASSERT(HasIndex()); | 56 ASSERT(HasIndex()); |
| 57 return index_; | 57 return index_; |
| 58 } | 58 } |
| 59 | 59 |
| 60 // Assign an index to a local. This function can be called more than once | 60 // Assign an index to a local. This function can be called more than once |
| 61 // on the same on local (e.g., if we tried to compile in one mode, bailed | 61 // on the same on local (e.g., if we tried to compile in one mode, bailed |
| 62 // out, and fell back to a different compilation mode). In any case, it | 62 // out, and fell back to a different compilation mode). In any case, it |
| 63 // should not change the index once set. | 63 // should not change the index once set. |
| 64 void set_index(int index) { | 64 void set_index(int index) { |
| 65 ASSERT(!HasIndex() || (index_ == index)); | 65 ASSERT(!HasIndex()); |
| 66 ASSERT(index != kUnitializedIndex); | 66 ASSERT(index != kUnitializedIndex); |
| 67 index_ = index; | 67 index_ = index; |
| 68 } | 68 } |
| 69 | 69 |
| 70 void set_invisible(bool value) { | 70 void set_invisible(bool value) { |
| 71 is_invisible_ = value; | 71 is_invisible_ = value; |
| 72 } | 72 } |
| 73 | 73 |
| 74 bool Equals(const LocalVariable& other) const; | 74 bool Equals(const LocalVariable& other) const; |
| 75 | 75 |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 intptr_t end_token_index_; // Token index of end of scope. | 299 intptr_t end_token_index_; // Token index of end of scope. |
| 300 GrowableArray<LocalVariable*> variables_; | 300 GrowableArray<LocalVariable*> variables_; |
| 301 GrowableArray<SourceLabel*> labels_; | 301 GrowableArray<SourceLabel*> labels_; |
| 302 | 302 |
| 303 DISALLOW_COPY_AND_ASSIGN(LocalScope); | 303 DISALLOW_COPY_AND_ASSIGN(LocalScope); |
| 304 }; | 304 }; |
| 305 | 305 |
| 306 } // namespace dart | 306 } // namespace dart |
| 307 | 307 |
| 308 #endif // VM_SCOPES_H_ | 308 #endif // VM_SCOPES_H_ |
| OLD | NEW |