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

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

Issue 2237873002: Declare 'this' as DYNAMIC_GLOBAL on the script_scope (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase and partly restore for debugger Created 4 years, 4 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 | « no previous file | src/ast/scopes.cc » ('j') | src/ast/scopes.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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_SCOPES_H_ 5 #ifndef V8_AST_SCOPES_H_
6 #define V8_AST_SCOPES_H_ 6 #define V8_AST_SCOPES_H_
7 7
8 #include "src/ast/ast.h" 8 #include "src/ast/ast.h"
9 #include "src/base/hashmap.h" 9 #include "src/base/hashmap.h"
10 #include "src/globals.h" 10 #include "src/globals.h"
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 435
436 // Check that the scope has positions assigned. 436 // Check that the scope has positions assigned.
437 void CheckScopePositions(); 437 void CheckScopePositions();
438 438
439 // Check that all Scopes in the scope tree use the same Zone. 439 // Check that all Scopes in the scope tree use the same Zone.
440 void CheckZones(); 440 void CheckZones();
441 #endif 441 #endif
442 442
443 // Retrieve `IsSimpleParameterList` of current or outer function. 443 // Retrieve `IsSimpleParameterList` of current or outer function.
444 bool HasSimpleParameters(); 444 bool HasSimpleParameters();
445 void set_is_debug_evaluate_scope() { is_debug_evaluate_scope_ = true; }
445 446
446 private: 447 private:
447 Zone* zone_; 448 Zone* zone_;
448 449
449 // Scope tree. 450 // Scope tree.
450 Scope* outer_scope_; // the immediately enclosing outer scope, or NULL 451 Scope* outer_scope_; // the immediately enclosing outer scope, or NULL
451 Scope* inner_scope_; // an inner scope of this scope 452 Scope* inner_scope_; // an inner scope of this scope
452 Scope* sibling_; // a sibling inner scope of the outer scope of this scope. 453 Scope* sibling_; // a sibling inner scope of the outer scope of this scope.
453 454
454 // The variables declared in this scope: 455 // The variables declared in this scope:
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 bool scope_uses_super_property_ : 1; 499 bool scope_uses_super_property_ : 1;
499 // This scope has a parameter called "arguments". 500 // This scope has a parameter called "arguments".
500 bool has_arguments_parameter_ : 1; 501 bool has_arguments_parameter_ : 1;
501 // This scope contains an "use asm" annotation. 502 // This scope contains an "use asm" annotation.
502 bool asm_module_ : 1; 503 bool asm_module_ : 1;
503 // This scope's outer context is an asm module. 504 // This scope's outer context is an asm module.
504 bool asm_function_ : 1; 505 bool asm_function_ : 1;
505 // This scope's declarations might not be executed in order (e.g., switch). 506 // This scope's declarations might not be executed in order (e.g., switch).
506 bool scope_nonlinear_ : 1; 507 bool scope_nonlinear_ : 1;
507 bool is_hidden_ : 1; 508 bool is_hidden_ : 1;
509 // Temporary workaround that allows masking of 'this' in debug-evalute scopes.
510 bool is_debug_evaluate_scope_ : 1;
508 511
509 // Computed via PropagateScopeInfo. 512 // Computed via PropagateScopeInfo.
510 bool outer_scope_calls_sloppy_eval_ : 1; 513 bool outer_scope_calls_sloppy_eval_ : 1;
511 bool inner_scope_calls_eval_ : 1; 514 bool inner_scope_calls_eval_ : 1;
512 bool force_eager_compilation_ : 1; 515 bool force_eager_compilation_ : 1;
513 bool force_context_allocation_ : 1; 516 bool force_context_allocation_ : 1;
514 517
515 // True if it doesn't need scope resolution (e.g., if the scope was 518 // True if it doesn't need scope resolution (e.g., if the scope was
516 // constructed based on a serialized scope info or a catch context). 519 // constructed based on a serialized scope info or a catch context).
517 bool already_resolved_ : 1; 520 bool already_resolved_ : 1;
518 bool already_resolved() { return already_resolved_; } 521 bool already_resolved() { return already_resolved_; }
519 522
520 // True if it holds 'var' declarations. 523 // True if it holds 'var' declarations.
521 bool is_declaration_scope_ : 1; 524 bool is_declaration_scope_ : 1;
522 525
523 // Create a non-local variable with a given name. 526 // Create a non-local variable with a given name.
524 // These variables are looked up dynamically at runtime. 527 // These variables are looked up dynamically at runtime.
525 Variable* NonLocal(const AstRawString* name, VariableMode mode, 528 Variable* NonLocal(const AstRawString* name, VariableMode mode);
526 Variable::Kind variable_kind);
527 529
528 // Variable resolution. 530 // Variable resolution.
529 // Possible results of a recursive variable lookup telling if and how a 531 // Possible results of a recursive variable lookup telling if and how a
530 // variable is bound. These are returned in the output parameter *binding_kind 532 // variable is bound. These are returned in the output parameter *binding_kind
531 // of the LookupRecursive function. 533 // of the LookupRecursive function.
532 enum BindingKind { 534 enum BindingKind {
533 // The variable reference could be statically resolved to a variable binding 535 // The variable reference could be statically resolved to a variable binding
534 // which is returned. There is no 'with' statement between the reference and 536 // which is returned. There is no 'with' statement between the reference and
535 // the binding and no scope between the reference scope (inclusive) and 537 // the binding and no scope between the reference scope (inclusive) and
536 // binding scope (exclusive) makes a sloppy 'eval' call. 538 // binding scope (exclusive) makes a sloppy 'eval' call.
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
892 // Convenience variable; Subclass constructor only 894 // Convenience variable; Subclass constructor only
893 Variable* this_function_; 895 Variable* this_function_;
894 // Module descriptor; module scopes only. 896 // Module descriptor; module scopes only.
895 ModuleDescriptor* module_descriptor_; 897 ModuleDescriptor* module_descriptor_;
896 }; 898 };
897 899
898 } // namespace internal 900 } // namespace internal
899 } // namespace v8 901 } // namespace v8
900 902
901 #endif // V8_AST_SCOPES_H_ 903 #endif // V8_AST_SCOPES_H_
OLDNEW
« no previous file with comments | « no previous file | src/ast/scopes.cc » ('j') | src/ast/scopes.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698