| 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/zone.h" | 9 #include "src/zone.h" |
| 10 | 10 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 // scope is only used to follow the context chain length. | 37 // scope is only used to follow the context chain length. |
| 38 Scope* scope() const { return scope_; } | 38 Scope* scope() const { return scope_; } |
| 39 | 39 |
| 40 Handle<String> name() const { return name_->string(); } | 40 Handle<String> name() const { return name_->string(); } |
| 41 const AstRawString* raw_name() const { return name_; } | 41 const AstRawString* raw_name() const { return name_; } |
| 42 VariableMode mode() const { return mode_; } | 42 VariableMode mode() const { return mode_; } |
| 43 bool has_forced_context_allocation() const { | 43 bool has_forced_context_allocation() const { |
| 44 return force_context_allocation_; | 44 return force_context_allocation_; |
| 45 } | 45 } |
| 46 void ForceContextAllocation() { | 46 void ForceContextAllocation() { |
| 47 DCHECK(mode_ != TEMPORARY); | |
| 48 force_context_allocation_ = true; | 47 force_context_allocation_ = true; |
| 49 } | 48 } |
| 50 bool is_used() { return is_used_; } | 49 bool is_used() { return is_used_; } |
| 51 void set_is_used() { is_used_ = true; } | 50 void set_is_used() { is_used_ = true; } |
| 52 MaybeAssignedFlag maybe_assigned() const { return maybe_assigned_; } | 51 MaybeAssignedFlag maybe_assigned() const { return maybe_assigned_; } |
| 53 void set_maybe_assigned() { maybe_assigned_ = kMaybeAssigned; } | 52 void set_maybe_assigned() { maybe_assigned_ = kMaybeAssigned; } |
| 54 | 53 |
| 55 int initializer_position() { return initializer_position_; } | 54 int initializer_position() { return initializer_position_; } |
| 56 void set_initializer_position(int pos) { initializer_position_ = pos; } | 55 void set_initializer_position(int pos) { initializer_position_ = pos; } |
| 57 | 56 |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 | 189 |
| 191 private: | 190 private: |
| 192 // For classes we keep track of consecutive groups of delcarations. They are | 191 // For classes we keep track of consecutive groups of delcarations. They are |
| 193 // needed for strong mode scoping checks. TODO(marja, rossberg): Implement | 192 // needed for strong mode scoping checks. TODO(marja, rossberg): Implement |
| 194 // checks for functions too. | 193 // checks for functions too. |
| 195 int declaration_group_start_; | 194 int declaration_group_start_; |
| 196 }; | 195 }; |
| 197 } } // namespace v8::internal | 196 } } // namespace v8::internal |
| 198 | 197 |
| 199 #endif // V8_VARIABLES_H_ | 198 #endif // V8_VARIABLES_H_ |
| OLD | NEW |