| 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 return !is_this() && name().is_identical_to(n); | 86 return !is_this() && name().is_identical_to(n); |
| 87 } | 87 } |
| 88 | 88 |
| 89 bool IsUnallocated() const { return location_ == UNALLOCATED; } | 89 bool IsUnallocated() const { return location_ == UNALLOCATED; } |
| 90 bool IsParameter() const { return location_ == PARAMETER; } | 90 bool IsParameter() const { return location_ == PARAMETER; } |
| 91 bool IsStackLocal() const { return location_ == LOCAL; } | 91 bool IsStackLocal() const { return location_ == LOCAL; } |
| 92 bool IsStackAllocated() const { return IsParameter() || IsStackLocal(); } | 92 bool IsStackAllocated() const { return IsParameter() || IsStackLocal(); } |
| 93 bool IsContextSlot() const { return location_ == CONTEXT; } | 93 bool IsContextSlot() const { return location_ == CONTEXT; } |
| 94 bool IsLookupSlot() const { return location_ == LOOKUP; } | 94 bool IsLookupSlot() const { return location_ == LOOKUP; } |
| 95 bool IsGlobalObjectProperty() const; | 95 bool IsGlobalObjectProperty() const; |
| 96 bool IsStaticGlobalObjectProperty() const; |
| 96 | 97 |
| 97 bool is_dynamic() const { return IsDynamicVariableMode(mode_); } | 98 bool is_dynamic() const { return IsDynamicVariableMode(mode_); } |
| 98 bool is_const_mode() const { return IsImmutableVariableMode(mode_); } | 99 bool is_const_mode() const { return IsImmutableVariableMode(mode_); } |
| 99 bool binding_needs_init() const { | 100 bool binding_needs_init() const { |
| 100 return initialization_flag_ == kNeedsInitialization; | 101 return initialization_flag_ == kNeedsInitialization; |
| 101 } | 102 } |
| 102 | 103 |
| 103 bool is_function() const { return kind_ == FUNCTION; } | 104 bool is_function() const { return kind_ == FUNCTION; } |
| 104 bool is_class() const { return kind_ == CLASS; } | 105 bool is_class() const { return kind_ == CLASS; } |
| 105 bool is_this() const { return kind_ == THIS; } | 106 bool is_this() const { return kind_ == THIS; } |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 | 211 |
| 211 private: | 212 private: |
| 212 // For classes we keep track of consecutive groups of delcarations. They are | 213 // For classes we keep track of consecutive groups of delcarations. They are |
| 213 // needed for strong mode scoping checks. TODO(marja, rossberg): Implement | 214 // needed for strong mode scoping checks. TODO(marja, rossberg): Implement |
| 214 // checks for functions too. | 215 // checks for functions too. |
| 215 int declaration_group_start_; | 216 int declaration_group_start_; |
| 216 }; | 217 }; |
| 217 } } // namespace v8::internal | 218 } } // namespace v8::internal |
| 218 | 219 |
| 219 #endif // V8_VARIABLES_H_ | 220 #endif // V8_VARIABLES_H_ |
| OLD | NEW |