OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_VARIABLES_H_ | 5 #ifndef V8_VARIABLES_H_ |
6 #define V8_VARIABLES_H_ | 6 #define V8_VARIABLES_H_ |
7 | 7 |
8 #include "src/ast-value-factory.h" | 8 #include "src/ast-value-factory.h" |
9 #include "src/interface.h" | 9 #include "src/interface.h" |
10 #include "src/zone.h" | 10 #include "src/zone.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 // scope is only used to follow the context chain length. | 68 // scope is only used to follow the context chain length. |
69 Scope* scope() const { return scope_; } | 69 Scope* scope() const { return scope_; } |
70 | 70 |
71 Handle<String> name() const { return name_->string(); } | 71 Handle<String> name() const { return name_->string(); } |
72 const AstRawString* raw_name() const { return name_; } | 72 const AstRawString* raw_name() const { return name_; } |
73 VariableMode mode() const { return mode_; } | 73 VariableMode mode() const { return mode_; } |
74 bool has_forced_context_allocation() const { | 74 bool has_forced_context_allocation() const { |
75 return force_context_allocation_; | 75 return force_context_allocation_; |
76 } | 76 } |
77 void ForceContextAllocation() { | 77 void ForceContextAllocation() { |
78 ASSERT(mode_ != TEMPORARY); | 78 DCHECK(mode_ != TEMPORARY); |
79 force_context_allocation_ = true; | 79 force_context_allocation_ = true; |
80 } | 80 } |
81 bool is_used() { return is_used_; } | 81 bool is_used() { return is_used_; } |
82 void set_is_used() { is_used_ = true; } | 82 void set_is_used() { is_used_ = true; } |
83 MaybeAssignedFlag maybe_assigned() const { return maybe_assigned_; } | 83 MaybeAssignedFlag maybe_assigned() const { return maybe_assigned_; } |
84 void set_maybe_assigned() { maybe_assigned_ = kMaybeAssigned; } | 84 void set_maybe_assigned() { maybe_assigned_ = kMaybeAssigned; } |
85 | 85 |
86 int initializer_position() { return initializer_position_; } | 86 int initializer_position() { return initializer_position_; } |
87 void set_initializer_position(int pos) { initializer_position_ = pos; } | 87 void set_initializer_position(int pos) { initializer_position_ = pos; } |
88 | 88 |
(...skipping 17 matching lines...) Expand all Loading... |
106 | 106 |
107 bool is_this() const { return kind_ == THIS; } | 107 bool is_this() const { return kind_ == THIS; } |
108 bool is_arguments() const { return kind_ == ARGUMENTS; } | 108 bool is_arguments() const { return kind_ == ARGUMENTS; } |
109 | 109 |
110 // True if the variable is named eval and not known to be shadowed. | 110 // True if the variable is named eval and not known to be shadowed. |
111 bool is_possibly_eval(Isolate* isolate) const { | 111 bool is_possibly_eval(Isolate* isolate) const { |
112 return IsVariable(isolate->factory()->eval_string()); | 112 return IsVariable(isolate->factory()->eval_string()); |
113 } | 113 } |
114 | 114 |
115 Variable* local_if_not_shadowed() const { | 115 Variable* local_if_not_shadowed() const { |
116 ASSERT(mode_ == DYNAMIC_LOCAL && local_if_not_shadowed_ != NULL); | 116 DCHECK(mode_ == DYNAMIC_LOCAL && local_if_not_shadowed_ != NULL); |
117 return local_if_not_shadowed_; | 117 return local_if_not_shadowed_; |
118 } | 118 } |
119 | 119 |
120 void set_local_if_not_shadowed(Variable* local) { | 120 void set_local_if_not_shadowed(Variable* local) { |
121 local_if_not_shadowed_ = local; | 121 local_if_not_shadowed_ = local; |
122 } | 122 } |
123 | 123 |
124 Location location() const { return location_; } | 124 Location location() const { return location_; } |
125 int index() const { return index_; } | 125 int index() const { return index_; } |
126 InitializationFlag initialization_flag() const { | 126 InitializationFlag initialization_flag() const { |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 MaybeAssignedFlag maybe_assigned_; | 160 MaybeAssignedFlag maybe_assigned_; |
161 | 161 |
162 // Module type info. | 162 // Module type info. |
163 Interface* interface_; | 163 Interface* interface_; |
164 }; | 164 }; |
165 | 165 |
166 | 166 |
167 } } // namespace v8::internal | 167 } } // namespace v8::internal |
168 | 168 |
169 #endif // V8_VARIABLES_H_ | 169 #endif // V8_VARIABLES_H_ |
OLD | NEW |