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_AST_VARIABLES_H_ | 5 #ifndef V8_AST_VARIABLES_H_ |
6 #define V8_AST_VARIABLES_H_ | 6 #define V8_AST_VARIABLES_H_ |
7 | 7 |
8 #include "src/ast/ast-value-factory.h" | 8 #include "src/ast/ast-value-factory.h" |
9 #include "src/globals.h" | 9 #include "src/globals.h" |
10 #include "src/zone/zone.h" | 10 #include "src/zone/zone.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 | 57 |
58 bool IsUnallocated() const { | 58 bool IsUnallocated() const { |
59 return location() == VariableLocation::UNALLOCATED; | 59 return location() == VariableLocation::UNALLOCATED; |
60 } | 60 } |
61 bool IsParameter() const { return location() == VariableLocation::PARAMETER; } | 61 bool IsParameter() const { return location() == VariableLocation::PARAMETER; } |
62 bool IsStackLocal() const { return location() == VariableLocation::LOCAL; } | 62 bool IsStackLocal() const { return location() == VariableLocation::LOCAL; } |
63 bool IsStackAllocated() const { return IsParameter() || IsStackLocal(); } | 63 bool IsStackAllocated() const { return IsParameter() || IsStackLocal(); } |
64 bool IsContextSlot() const { return location() == VariableLocation::CONTEXT; } | 64 bool IsContextSlot() const { return location() == VariableLocation::CONTEXT; } |
65 bool IsLookupSlot() const { return location() == VariableLocation::LOOKUP; } | 65 bool IsLookupSlot() const { return location() == VariableLocation::LOOKUP; } |
66 bool IsGlobalObjectProperty() const; | 66 bool IsGlobalObjectProperty() const; |
67 bool IsStaticGlobalObjectProperty() const; | |
68 | 67 |
69 bool is_dynamic() const { return IsDynamicVariableMode(mode()); } | 68 bool is_dynamic() const { return IsDynamicVariableMode(mode()); } |
70 bool binding_needs_init() const { | 69 bool binding_needs_init() const { |
71 DCHECK(initialization_flag() != kNeedsInitialization || | 70 DCHECK(initialization_flag() != kNeedsInitialization || |
72 IsLexicalVariableMode(mode())); | 71 IsLexicalVariableMode(mode())); |
73 return initialization_flag() == kNeedsInitialization; | 72 return initialization_flag() == kNeedsInitialization; |
74 } | 73 } |
75 bool throw_on_const_assignment(LanguageMode language_mode) const { | 74 bool throw_on_const_assignment(LanguageMode language_mode) const { |
76 return kind() != SLOPPY_FUNCTION_NAME_VARIABLE || is_strict(language_mode); | 75 return kind() != SLOPPY_FUNCTION_NAME_VARIABLE || is_strict(language_mode); |
77 } | 76 } |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 class InitializationFlagField | 143 class InitializationFlagField |
145 : public BitField16<InitializationFlag, IsUsedField::kNext, 2> {}; | 144 : public BitField16<InitializationFlag, IsUsedField::kNext, 2> {}; |
146 class MaybeAssignedFlagField | 145 class MaybeAssignedFlagField |
147 : public BitField16<MaybeAssignedFlag, InitializationFlagField::kNext, | 146 : public BitField16<MaybeAssignedFlag, InitializationFlagField::kNext, |
148 2> {}; | 147 2> {}; |
149 }; | 148 }; |
150 } // namespace internal | 149 } // namespace internal |
151 } // namespace v8 | 150 } // namespace v8 |
152 | 151 |
153 #endif // V8_AST_VARIABLES_H_ | 152 #endif // V8_AST_VARIABLES_H_ |
OLD | NEW |