OLD | NEW |
---|---|
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
59 void set_index(int index) { | 59 void set_index(int index) { |
60 ASSERT(!HasIndex()); | 60 ASSERT(!HasIndex()); |
61 ASSERT(index != kUnitializedIndex_); | 61 ASSERT(index != kUnitializedIndex_); |
62 index_ = index; | 62 index_ = index; |
63 } | 63 } |
64 | 64 |
65 void set_invisible(bool value) { | 65 void set_invisible(bool value) { |
66 is_invisible_ = value; | 66 is_invisible_ = value; |
67 } | 67 } |
68 | 68 |
69 bool Equals(const LocalVariable& other) const { | |
70 return HasIndex() && other.HasIndex() && | |
71 (index() == other.index()); | |
regis
2011/12/13 00:31:44
This is not correct. You need to check is_captured
srdjan
2011/12/13 00:39:38
Thanks!
| |
72 } | |
73 | |
69 private: | 74 private: |
70 static const int kUnitializedIndex_ = INT_MIN; | 75 static const int kUnitializedIndex_ = INT_MIN; |
71 | 76 |
72 const intptr_t token_index_; | 77 const intptr_t token_index_; |
73 const String& name_; | 78 const String& name_; |
74 LocalScope* owner_; // Local scope declaring this variable. | 79 LocalScope* owner_; // Local scope declaring this variable. |
75 | 80 |
76 const AbstractType& type_; // Declaration type of local variable. | 81 const AbstractType& type_; // Declaration type of local variable. |
77 | 82 |
78 bool is_final_; // If true, this variable is readonly. | 83 bool is_final_; // If true, this variable is readonly. |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
280 int num_context_variables_; // Only set if this scope is a context owner. | 285 int num_context_variables_; // Only set if this scope is a context owner. |
281 GrowableArray<LocalVariable*> variables_; | 286 GrowableArray<LocalVariable*> variables_; |
282 GrowableArray<SourceLabel*> labels_; | 287 GrowableArray<SourceLabel*> labels_; |
283 | 288 |
284 DISALLOW_COPY_AND_ASSIGN(LocalScope); | 289 DISALLOW_COPY_AND_ASSIGN(LocalScope); |
285 }; | 290 }; |
286 | 291 |
287 } // namespace dart | 292 } // namespace dart |
288 | 293 |
289 #endif // VM_SCOPES_H_ | 294 #endif // VM_SCOPES_H_ |
OLD | NEW |