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

Side by Side Diff: arguments/src/scopes.h

Issue 6667076: Remove arguments shadow from scopes, stop rewriting parameters. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental
Patch Set: Created 9 years, 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 ASSERT(is_function_scope()); 247 ASSERT(is_function_scope());
248 return params_[index]; 248 return params_[index];
249 } 249 }
250 250
251 int num_parameters() const { return params_.length(); } 251 int num_parameters() const { return params_.length(); }
252 252
253 // The local variable 'arguments' if we need to allocate it; NULL otherwise. 253 // The local variable 'arguments' if we need to allocate it; NULL otherwise.
254 // If arguments() exist, arguments_shadow() exists, too. 254 // If arguments() exist, arguments_shadow() exists, too.
255 Variable* arguments() const { return arguments_; } 255 Variable* arguments() const { return arguments_; }
256 256
257 // The '.arguments' shadow variable if we need to allocate it; NULL otherwise.
258 // If arguments_shadow() exist, arguments() exists, too.
259 Variable* arguments_shadow() const { return arguments_shadow_; }
260
261 // Declarations list. 257 // Declarations list.
262 ZoneList<Declaration*>* declarations() { return &decls_; } 258 ZoneList<Declaration*>* declarations() { return &decls_; }
263 259
264 260
265 261
266 // --------------------------------------------------------------------------- 262 // ---------------------------------------------------------------------------
267 // Variable allocation. 263 // Variable allocation.
268 264
269 // Collect all used locals in this scope. 265 // Collect all used locals in this scope.
270 template<class Allocator> 266 template<class Allocator>
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 // Unresolved variables referred to from this scope. 342 // Unresolved variables referred to from this scope.
347 ZoneList<VariableProxy*> unresolved_; 343 ZoneList<VariableProxy*> unresolved_;
348 // Declarations. 344 // Declarations.
349 ZoneList<Declaration*> decls_; 345 ZoneList<Declaration*> decls_;
350 // Convenience variable. 346 // Convenience variable.
351 Variable* receiver_; 347 Variable* receiver_;
352 // Function variable, if any; function scopes only. 348 // Function variable, if any; function scopes only.
353 Variable* function_; 349 Variable* function_;
354 // Convenience variable; function scopes only. 350 // Convenience variable; function scopes only.
355 Variable* arguments_; 351 Variable* arguments_;
356 // Convenience variable; function scopes only.
357 Variable* arguments_shadow_;
358 352
359 // Illegal redeclaration. 353 // Illegal redeclaration.
360 Expression* illegal_redecl_; 354 Expression* illegal_redecl_;
361 355
362 // Scope-specific information. 356 // Scope-specific information.
363 bool scope_inside_with_; // this scope is inside a 'with' of some outer scope 357 bool scope_inside_with_; // this scope is inside a 'with' of some outer scope
364 bool scope_contains_with_; // this scope contains a 'with' statement 358 bool scope_contains_with_; // this scope contains a 'with' statement
365 bool scope_calls_eval_; // this scope contains an 'eval' call 359 bool scope_calls_eval_; // this scope contains an 'eval' call
366 bool strict_mode_; // this scope is a strict mode scope 360 bool strict_mode_; // this scope is a strict mode scope
367 361
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 void SetDefaults(Type type, 418 void SetDefaults(Type type,
425 Scope* outer_scope, 419 Scope* outer_scope,
426 SerializedScopeInfo* scope_info) { 420 SerializedScopeInfo* scope_info) {
427 outer_scope_ = outer_scope; 421 outer_scope_ = outer_scope;
428 type_ = type; 422 type_ = type;
429 scope_name_ = Factory::empty_symbol(); 423 scope_name_ = Factory::empty_symbol();
430 dynamics_ = NULL; 424 dynamics_ = NULL;
431 receiver_ = NULL; 425 receiver_ = NULL;
432 function_ = NULL; 426 function_ = NULL;
433 arguments_ = NULL; 427 arguments_ = NULL;
434 arguments_shadow_ = NULL;
435 illegal_redecl_ = NULL; 428 illegal_redecl_ = NULL;
436 scope_inside_with_ = false; 429 scope_inside_with_ = false;
437 scope_contains_with_ = false; 430 scope_contains_with_ = false;
438 scope_calls_eval_ = false; 431 scope_calls_eval_ = false;
439 // Inherit the strict mode from the parent scope. 432 // Inherit the strict mode from the parent scope.
440 strict_mode_ = (outer_scope != NULL) && outer_scope->strict_mode_; 433 strict_mode_ = (outer_scope != NULL) && outer_scope->strict_mode_;
441 outer_scope_calls_eval_ = false; 434 outer_scope_calls_eval_ = false;
442 inner_scope_calls_eval_ = false; 435 inner_scope_calls_eval_ = false;
443 outer_scope_is_eval_scope_ = false; 436 outer_scope_is_eval_scope_ = false;
444 force_eager_compilation_ = false; 437 force_eager_compilation_ = false;
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 int nesting_level_; 488 int nesting_level_;
496 // Nesting level of outermost scope that is contained in a with statement, 489 // Nesting level of outermost scope that is contained in a with statement,
497 // or kNotInsideWith if there are no with's around the current scope. 490 // or kNotInsideWith if there are no with's around the current scope.
498 int inside_with_level_; 491 int inside_with_level_;
499 }; 492 };
500 493
501 494
502 } } // namespace v8::internal 495 } } // namespace v8::internal
503 496
504 #endif // V8_SCOPES_H_ 497 #endif // V8_SCOPES_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698