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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 MaybeAssignedFlag maybe_assigned_flag = kNotAssigned, | 57 MaybeAssignedFlag maybe_assigned_flag = kNotAssigned, |
58 Interface* interface = Interface::NewValue()); | 58 Interface* interface = Interface::NewValue()); |
59 | 59 |
60 // Printing support | 60 // Printing support |
61 static const char* Mode2String(VariableMode mode); | 61 static const char* Mode2String(VariableMode mode); |
62 | 62 |
63 bool IsValidReference() { return is_valid_ref_; } | 63 bool IsValidReference() { return is_valid_ref_; } |
64 | 64 |
65 // The source code for an eval() call may refer to a variable that is | 65 // The source code for an eval() call may refer to a variable that is |
66 // in an outer scope about which we don't know anything (it may not | 66 // in an outer scope about which we don't know anything (it may not |
67 // be the global scope). scope() is NULL in that case. Currently the | 67 // be the script scope). scope() is NULL in that case. Currently the |
68 // scope is only used to follow the context chain length. | 68 // scope is only used to follow the context chain length. |
69 Scope* scope() const { return scope_; } | 69 Scope* scope() const { return scope_; } |
70 | 70 |
71 Handle<String> name() const { return name_->string(); } | 71 Handle<String> name() const { return name_->string(); } |
72 const AstRawString* raw_name() const { return name_; } | 72 const AstRawString* raw_name() const { return name_; } |
73 VariableMode mode() const { return mode_; } | 73 VariableMode mode() const { return mode_; } |
74 bool has_forced_context_allocation() const { | 74 bool has_forced_context_allocation() const { |
75 return force_context_allocation_; | 75 return force_context_allocation_; |
76 } | 76 } |
77 void ForceContextAllocation() { | 77 void ForceContextAllocation() { |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 MaybeAssignedFlag maybe_assigned_; | 160 MaybeAssignedFlag maybe_assigned_; |
161 | 161 |
162 // Module type info. | 162 // Module type info. |
163 Interface* interface_; | 163 Interface* interface_; |
164 }; | 164 }; |
165 | 165 |
166 | 166 |
167 } } // namespace v8::internal | 167 } } // namespace v8::internal |
168 | 168 |
169 #endif // V8_VARIABLES_H_ | 169 #endif // V8_VARIABLES_H_ |
OLD | NEW |