Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(258)

Side by Side Diff: src/scopes.h

Issue 3432022: Clean up some messiness in Scopes. (Closed)
Patch Set: Created 10 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/scopeinfo.cc ('k') | src/scopes.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 // Only valid for function scopes. 226 // Only valid for function scopes.
227 Variable* parameter(int index) const { 227 Variable* parameter(int index) const {
228 ASSERT(is_function_scope()); 228 ASSERT(is_function_scope());
229 return params_[index]; 229 return params_[index];
230 } 230 }
231 231
232 int num_parameters() const { return params_.length(); } 232 int num_parameters() const { return params_.length(); }
233 233
234 // The local variable 'arguments' if we need to allocate it; NULL otherwise. 234 // The local variable 'arguments' if we need to allocate it; NULL otherwise.
235 // If arguments() exist, arguments_shadow() exists, too. 235 // If arguments() exist, arguments_shadow() exists, too.
236 VariableProxy* arguments() const { return arguments_; } 236 Variable* arguments() const { return arguments_; }
237 237
238 // The '.arguments' shadow variable if we need to allocate it; NULL otherwise. 238 // The '.arguments' shadow variable if we need to allocate it; NULL otherwise.
239 // If arguments_shadow() exist, arguments() exists, too. 239 // If arguments_shadow() exist, arguments() exists, too.
240 VariableProxy* arguments_shadow() const { return arguments_shadow_; } 240 Variable* arguments_shadow() const { return arguments_shadow_; }
241 241
242 // Declarations list. 242 // Declarations list.
243 ZoneList<Declaration*>* declarations() { return &decls_; } 243 ZoneList<Declaration*>* declarations() { return &decls_; }
244 244
245 245
246 246
247 // --------------------------------------------------------------------------- 247 // ---------------------------------------------------------------------------
248 // Variable allocation. 248 // Variable allocation.
249 249
250 // Collect all used locals in this scope. 250 // Collect all used locals in this scope.
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 DynamicScopePart* dynamics_; 315 DynamicScopePart* dynamics_;
316 // Unresolved variables referred to from this scope. 316 // Unresolved variables referred to from this scope.
317 ZoneList<VariableProxy*> unresolved_; 317 ZoneList<VariableProxy*> unresolved_;
318 // Declarations. 318 // Declarations.
319 ZoneList<Declaration*> decls_; 319 ZoneList<Declaration*> decls_;
320 // Convenience variable. 320 // Convenience variable.
321 Variable* receiver_; 321 Variable* receiver_;
322 // Function variable, if any; function scopes only. 322 // Function variable, if any; function scopes only.
323 Variable* function_; 323 Variable* function_;
324 // Convenience variable; function scopes only. 324 // Convenience variable; function scopes only.
325 VariableProxy* arguments_; 325 Variable* arguments_;
326 // Convenience variable; function scopes only. 326 // Convenience variable; function scopes only.
327 VariableProxy* arguments_shadow_; 327 Variable* arguments_shadow_;
328 328
329 // Illegal redeclaration. 329 // Illegal redeclaration.
330 Expression* illegal_redecl_; 330 Expression* illegal_redecl_;
331 331
332 // Scope-specific information. 332 // Scope-specific information.
333 bool scope_inside_with_; // this scope is inside a 'with' of some outer scope 333 bool scope_inside_with_; // this scope is inside a 'with' of some outer scope
334 bool scope_contains_with_; // this scope contains a 'with' statement 334 bool scope_contains_with_; // this scope contains a 'with' statement
335 bool scope_calls_eval_; // this scope contains an 'eval' call 335 bool scope_calls_eval_; // this scope contains an 'eval' call
336 336
337 // Computed via PropagateScopeInfo. 337 // Computed via PropagateScopeInfo.
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 virtual VariableProxy* NewUnresolved(Handle<String> name, bool inside_with) { 391 virtual VariableProxy* NewUnresolved(Handle<String> name, bool inside_with) {
392 return NULL; 392 return NULL;
393 } 393 }
394 virtual VariableProxy* NewTemporary(Handle<String> name) { return NULL; } 394 virtual VariableProxy* NewTemporary(Handle<String> name) { return NULL; }
395 }; 395 };
396 396
397 397
398 } } // namespace v8::internal 398 } } // namespace v8::internal
399 399
400 #endif // V8_SCOPES_H_ 400 #endif // V8_SCOPES_H_
OLDNEW
« no previous file with comments | « src/scopeinfo.cc ('k') | src/scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698