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

Side by Side Diff: src/scopes.h

Issue 1135243004: [es6] Support super.property in eval and arrow functions (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Try feedback slot Created 5 years, 7 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
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_SCOPES_H_ 5 #ifndef V8_SCOPES_H_
6 #define V8_SCOPES_H_ 6 #define V8_SCOPES_H_
7 7
8 #include "src/ast.h" 8 #include "src/ast.h"
9 #include "src/pending-compilation-error-handler.h" 9 #include "src/pending-compilation-error-handler.h"
10 #include "src/zone.h" 10 #include "src/zone.h"
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 if (rest_index_ >= 0) return false; 402 if (rest_index_ >= 0) return false;
403 return true; 403 return true;
404 } 404 }
405 405
406 // The local variable 'arguments' if we need to allocate it; NULL otherwise. 406 // The local variable 'arguments' if we need to allocate it; NULL otherwise.
407 Variable* arguments() const { 407 Variable* arguments() const {
408 DCHECK(!is_arrow_scope() || arguments_ == nullptr); 408 DCHECK(!is_arrow_scope() || arguments_ == nullptr);
409 return arguments_; 409 return arguments_;
410 } 410 }
411 411
412 // A local variable to the [[HomeObject]] used by methods if we need to
413 // allocate it; NULL otherwise.
414 Variable* home_object_var() const {
415 // TODO(arv): Cleanup
416 // DCHECK(IsConciseMethod(function_kind()) ||
417 // IsAccessorFunction(function_kind()) ||
418 // IsConstructor(function_kind()));
419 DCHECK(!is_arrow_scope() || home_object_ == nullptr);
420 return home_object_;
421 }
422
412 // Declarations list. 423 // Declarations list.
413 ZoneList<Declaration*>* declarations() { return &decls_; } 424 ZoneList<Declaration*>* declarations() { return &decls_; }
414 425
415 // Inner scope list. 426 // Inner scope list.
416 ZoneList<Scope*>* inner_scopes() { return &inner_scopes_; } 427 ZoneList<Scope*>* inner_scopes() { return &inner_scopes_; }
417 428
418 // The scope immediately surrounding this scope, or NULL. 429 // The scope immediately surrounding this scope, or NULL.
419 Scope* outer_scope() const { return outer_scope_; } 430 Scope* outer_scope() const { return outer_scope_; }
420 431
421 // The ModuleDescriptor for this scope; only for module scopes. 432 // The ModuleDescriptor for this scope; only for module scopes.
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 // Declarations. 570 // Declarations.
560 ZoneList<Declaration*> decls_; 571 ZoneList<Declaration*> decls_;
561 // Convenience variable. 572 // Convenience variable.
562 Variable* receiver_; 573 Variable* receiver_;
563 // Function variable, if any; function scopes only. 574 // Function variable, if any; function scopes only.
564 VariableDeclaration* function_; 575 VariableDeclaration* function_;
565 // new.target variable, function scopes only. 576 // new.target variable, function scopes only.
566 Variable* new_target_; 577 Variable* new_target_;
567 // Convenience variable; function scopes only. 578 // Convenience variable; function scopes only.
568 Variable* arguments_; 579 Variable* arguments_;
580 // Convenience variable; method scopes only.
581 Variable* home_object_;
569 // Module descriptor; module scopes only. 582 // Module descriptor; module scopes only.
570 ModuleDescriptor* module_descriptor_; 583 ModuleDescriptor* module_descriptor_;
571 584
572 // Illegal redeclaration. 585 // Illegal redeclaration.
573 Expression* illegal_redecl_; 586 Expression* illegal_redecl_;
574 587
575 // Scope-specific information computed during parsing. 588 // Scope-specific information computed during parsing.
576 // 589 //
577 // This scope is inside a 'with' of some outer scope. 590 // This scope is inside a 'with' of some outer scope.
578 bool scope_inside_with_; 591 bool scope_inside_with_;
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
752 PendingCompilationErrorHandler pending_error_handler_; 765 PendingCompilationErrorHandler pending_error_handler_;
753 766
754 // For tracking which classes are declared consecutively. Needed for strong 767 // For tracking which classes are declared consecutively. Needed for strong
755 // mode. 768 // mode.
756 int class_declaration_group_start_; 769 int class_declaration_group_start_;
757 }; 770 };
758 771
759 } } // namespace v8::internal 772 } } // namespace v8::internal
760 773
761 #endif // V8_SCOPES_H_ 774 #endif // V8_SCOPES_H_
OLDNEW
« src/ast-numbering.cc ('K') | « src/runtime/runtime-classes.cc ('k') | src/scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698