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 "platform/assert.h" | 8 #include "platform/assert.h" |
9 #include "platform/globals.h" | 9 #include "platform/globals.h" |
10 #include "vm/allocation.h" | 10 #include "vm/allocation.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 void set_invisible(bool value) { | 72 void set_invisible(bool value) { |
73 is_invisible_ = value; | 73 is_invisible_ = value; |
74 } | 74 } |
75 bool is_invisible() const { return is_invisible_; } | 75 bool is_invisible() const { return is_invisible_; } |
76 | 76 |
77 bool is_captured_parameter() const { return is_captured_parameter_; } | 77 bool is_captured_parameter() const { return is_captured_parameter_; } |
78 void set_is_captured_parameter(bool value) { | 78 void set_is_captured_parameter(bool value) { |
79 is_captured_parameter_ = value; | 79 is_captured_parameter_ = value; |
80 } | 80 } |
81 | 81 |
| 82 // By convention, internal variables start with a colon. |
| 83 bool IsInternal() const { |
| 84 return name_.CharAt(0) == ':'; |
| 85 } |
| 86 |
82 bool IsConst() const { | 87 bool IsConst() const { |
83 return const_value_ != NULL; | 88 return const_value_ != NULL; |
84 } | 89 } |
85 | 90 |
86 void SetConstValue(const Instance& value) { | 91 void SetConstValue(const Instance& value) { |
87 ASSERT(value.IsZoneHandle() || value.IsReadOnlyHandle()); | 92 ASSERT(value.IsZoneHandle() || value.IsReadOnlyHandle()); |
88 const_value_ = &value; | 93 const_value_ = &value; |
89 } | 94 } |
90 | 95 |
91 const Instance* ConstValue() const { | 96 const Instance* ConstValue() const { |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 // List of names referenced in this scope and its children that | 379 // List of names referenced in this scope and its children that |
375 // are not resolved to local variables. | 380 // are not resolved to local variables. |
376 GrowableArray<NameReference*> referenced_; | 381 GrowableArray<NameReference*> referenced_; |
377 | 382 |
378 DISALLOW_COPY_AND_ASSIGN(LocalScope); | 383 DISALLOW_COPY_AND_ASSIGN(LocalScope); |
379 }; | 384 }; |
380 | 385 |
381 } // namespace dart | 386 } // namespace dart |
382 | 387 |
383 #endif // VM_SCOPES_H_ | 388 #endif // VM_SCOPES_H_ |
OLD | NEW |