| 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 const AstRawString* raw_name() const { return name_; } | 75 const AstRawString* raw_name() const { return name_; } |
| 76 VariableMode mode() const { return mode_; } | 76 VariableMode mode() const { return mode_; } |
| 77 bool has_forced_context_allocation() const { | 77 bool has_forced_context_allocation() const { |
| 78 return force_context_allocation_; | 78 return force_context_allocation_; |
| 79 } | 79 } |
| 80 void ForceContextAllocation() { | 80 void ForceContextAllocation() { |
| 81 ASSERT(mode_ != TEMPORARY); | 81 ASSERT(mode_ != TEMPORARY); |
| 82 force_context_allocation_ = true; | 82 force_context_allocation_ = true; |
| 83 } | 83 } |
| 84 bool is_used() { return is_used_; } | 84 bool is_used() { return is_used_; } |
| 85 void set_is_used() { is_used_ = true; } | 85 void set_is_used(bool flag) { is_used_ = flag; } |
| 86 bool maybe_assigned() { return maybe_assigned_; } | |
| 87 void set_maybe_assigned() { maybe_assigned_ = true; } | |
| 88 | 86 |
| 89 int initializer_position() { return initializer_position_; } | 87 int initializer_position() { return initializer_position_; } |
| 90 void set_initializer_position(int pos) { initializer_position_ = pos; } | 88 void set_initializer_position(int pos) { initializer_position_ = pos; } |
| 91 | 89 |
| 92 bool IsVariable(Handle<String> n) const { | 90 bool IsVariable(Handle<String> n) const { |
| 93 return !is_this() && name().is_identical_to(n); | 91 return !is_this() && name().is_identical_to(n); |
| 94 } | 92 } |
| 95 | 93 |
| 96 bool IsUnallocated() const { return location_ == UNALLOCATED; } | 94 bool IsUnallocated() const { return location_ == UNALLOCATED; } |
| 97 bool IsParameter() const { return location_ == PARAMETER; } | 95 bool IsParameter() const { return location_ == PARAMETER; } |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 // sloppy 'eval' calls between the reference scope (inclusive) and the | 150 // sloppy 'eval' calls between the reference scope (inclusive) and the |
| 153 // binding scope (exclusive). | 151 // binding scope (exclusive). |
| 154 Variable* local_if_not_shadowed_; | 152 Variable* local_if_not_shadowed_; |
| 155 | 153 |
| 156 // Valid as a reference? (const and this are not valid, for example) | 154 // Valid as a reference? (const and this are not valid, for example) |
| 157 bool is_valid_ref_; | 155 bool is_valid_ref_; |
| 158 | 156 |
| 159 // Usage info. | 157 // Usage info. |
| 160 bool force_context_allocation_; // set by variable resolver | 158 bool force_context_allocation_; // set by variable resolver |
| 161 bool is_used_; | 159 bool is_used_; |
| 162 bool maybe_assigned_; | |
| 163 InitializationFlag initialization_flag_; | 160 InitializationFlag initialization_flag_; |
| 164 | 161 |
| 165 // Module type info. | 162 // Module type info. |
| 166 Interface* interface_; | 163 Interface* interface_; |
| 167 }; | 164 }; |
| 168 | 165 |
| 169 | 166 |
| 170 } } // namespace v8::internal | 167 } } // namespace v8::internal |
| 171 | 168 |
| 172 #endif // V8_VARIABLES_H_ | 169 #endif // V8_VARIABLES_H_ |
| OLD | NEW |