| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 | 171 |
| 172 Variable* local_if_not_shadowed() const { | 172 Variable* local_if_not_shadowed() const { |
| 173 ASSERT(mode_ == DYNAMIC_LOCAL && local_if_not_shadowed_ != NULL); | 173 ASSERT(mode_ == DYNAMIC_LOCAL && local_if_not_shadowed_ != NULL); |
| 174 return local_if_not_shadowed_; | 174 return local_if_not_shadowed_; |
| 175 } | 175 } |
| 176 | 176 |
| 177 void set_local_if_not_shadowed(Variable* local) { | 177 void set_local_if_not_shadowed(Variable* local) { |
| 178 local_if_not_shadowed_ = local; | 178 local_if_not_shadowed_ = local; |
| 179 } | 179 } |
| 180 | 180 |
| 181 Expression* rewrite() const { return rewrite_; } | 181 Slot* rewrite() const { return rewrite_; } |
| 182 void set_rewrite(Expression* expr) { rewrite_ = expr; } | 182 void set_rewrite(Slot* expr) { rewrite_ = expr; } |
| 183 | 183 |
| 184 StaticType* type() { return &type_; } | 184 StaticType* type() { return &type_; } |
| 185 | 185 |
| 186 private: | 186 private: |
| 187 Scope* scope_; | 187 Scope* scope_; |
| 188 Handle<String> name_; | 188 Handle<String> name_; |
| 189 Mode mode_; | 189 Mode mode_; |
| 190 Kind kind_; | 190 Kind kind_; |
| 191 | 191 |
| 192 Variable* local_if_not_shadowed_; | 192 Variable* local_if_not_shadowed_; |
| 193 | 193 |
| 194 // Static type information | 194 // Static type information |
| 195 StaticType type_; | 195 StaticType type_; |
| 196 | 196 |
| 197 // Code generation. | 197 // Code generation. |
| 198 // rewrite_ is usually a Slot or a Property, but may be any expression. | 198 Slot* rewrite_; |
| 199 Expression* rewrite_; | |
| 200 | 199 |
| 201 // Valid as a LHS? (const and this are not valid LHS, for example) | 200 // Valid as a LHS? (const and this are not valid LHS, for example) |
| 202 bool is_valid_LHS_; | 201 bool is_valid_LHS_; |
| 203 | 202 |
| 204 // Usage info. | 203 // Usage info. |
| 205 bool is_accessed_from_inner_scope_; // set by variable resolver | 204 bool is_accessed_from_inner_scope_; // set by variable resolver |
| 206 bool is_used_; | 205 bool is_used_; |
| 207 }; | 206 }; |
| 208 | 207 |
| 209 | 208 |
| 210 } } // namespace v8::internal | 209 } } // namespace v8::internal |
| 211 | 210 |
| 212 #endif // V8_VARIABLES_H_ | 211 #endif // V8_VARIABLES_H_ |
| OLD | NEW |