| 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 DCHECK(initialization_flag() != kNeedsInitialization || | 71 DCHECK(initialization_flag() != kNeedsInitialization || |
| 72 IsLexicalVariableMode(mode())); | 72 IsLexicalVariableMode(mode())); |
| 73 return initialization_flag() == kNeedsInitialization; | 73 return initialization_flag() == kNeedsInitialization; |
| 74 } | 74 } |
| 75 bool throw_on_const_assignment(LanguageMode language_mode) const { | 75 bool throw_on_const_assignment(LanguageMode language_mode) const { |
| 76 return kind() != SLOPPY_FUNCTION_NAME_VARIABLE || is_strict(language_mode); | 76 return kind() != SLOPPY_FUNCTION_NAME_VARIABLE || is_strict(language_mode); |
| 77 } | 77 } |
| 78 | 78 |
| 79 bool is_function() const { return kind() == FUNCTION_VARIABLE; } | 79 bool is_function() const { return kind() == FUNCTION_VARIABLE; } |
| 80 bool is_this() const { return kind() == THIS_VARIABLE; } | 80 bool is_this() const { return kind() == THIS_VARIABLE; } |
| 81 bool is_arguments() const { return kind() == ARGUMENTS_VARIABLE; } | |
| 82 bool is_sloppy_function_name() const { | 81 bool is_sloppy_function_name() const { |
| 83 return kind() == SLOPPY_FUNCTION_NAME_VARIABLE; | 82 return kind() == SLOPPY_FUNCTION_NAME_VARIABLE; |
| 84 } | 83 } |
| 85 | 84 |
| 86 Variable* local_if_not_shadowed() const { | 85 Variable* local_if_not_shadowed() const { |
| 87 DCHECK(mode() == DYNAMIC_LOCAL && local_if_not_shadowed_ != NULL); | 86 DCHECK(mode() == DYNAMIC_LOCAL && local_if_not_shadowed_ != NULL); |
| 88 return local_if_not_shadowed_; | 87 return local_if_not_shadowed_; |
| 89 } | 88 } |
| 90 | 89 |
| 91 void set_local_if_not_shadowed(Variable* local) { | 90 void set_local_if_not_shadowed(Variable* local) { |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 class InitializationFlagField | 144 class InitializationFlagField |
| 146 : public BitField16<InitializationFlag, IsUsedField::kNext, 2> {}; | 145 : public BitField16<InitializationFlag, IsUsedField::kNext, 2> {}; |
| 147 class MaybeAssignedFlagField | 146 class MaybeAssignedFlagField |
| 148 : public BitField16<MaybeAssignedFlag, InitializationFlagField::kNext, | 147 : public BitField16<MaybeAssignedFlag, InitializationFlagField::kNext, |
| 149 2> {}; | 148 2> {}; |
| 150 }; | 149 }; |
| 151 } // namespace internal | 150 } // namespace internal |
| 152 } // namespace v8 | 151 } // namespace v8 |
| 153 | 152 |
| 154 #endif // V8_AST_VARIABLES_H_ | 153 #endif // V8_AST_VARIABLES_H_ |
| OLD | NEW |