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

Side by Side Diff: src/scopes.h

Issue 1180043004: Revert of Add script context with context-allocated "const this" (Closed) Base URL: https://chromium.googlesource.com/v8/v8@master
Patch Set: Created 5 years, 6 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/snapshot/snapshot-common.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 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 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 DCHECK_NOT_NULL(receiver_); 348 DCHECK_NOT_NULL(receiver_);
349 return receiver_; 349 return receiver_;
350 } 350 }
351 351
352 Variable* LookupThis() { return Lookup(ast_value_factory_->this_string()); } 352 Variable* LookupThis() { return Lookup(ast_value_factory_->this_string()); }
353 353
354 // TODO(wingo): Add a GLOBAL_SCOPE scope type which will lexically allocate 354 // TODO(wingo): Add a GLOBAL_SCOPE scope type which will lexically allocate
355 // "this" (and no other variable) on the native context. Script scopes then 355 // "this" (and no other variable) on the native context. Script scopes then
356 // will not have a "this" declaration. 356 // will not have a "this" declaration.
357 bool has_this_declaration() const { 357 bool has_this_declaration() const {
358 return (is_function_scope() && !is_arrow_scope()) || is_module_scope(); 358 return (is_function_scope() && !is_arrow_scope()) || is_module_scope() ||
359 is_script_scope();
359 } 360 }
360 361
361 // The variable corresponding to the 'new.target' value. 362 // The variable corresponding to the 'new.target' value.
362 Variable* new_target_var() { return new_target_; } 363 Variable* new_target_var() { return new_target_; }
363 364
364 // The variable holding the function literal for named function 365 // The variable holding the function literal for named function
365 // literals, or NULL. Only valid for function scopes. 366 // literals, or NULL. Only valid for function scopes.
366 VariableDeclaration* function() const { 367 VariableDeclaration* function() const {
367 DCHECK(is_function_scope()); 368 DCHECK(is_function_scope());
368 return function_; 369 return function_;
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
765 PendingCompilationErrorHandler pending_error_handler_; 766 PendingCompilationErrorHandler pending_error_handler_;
766 767
767 // For tracking which classes are declared consecutively. Needed for strong 768 // For tracking which classes are declared consecutively. Needed for strong
768 // mode. 769 // mode.
769 int class_declaration_group_start_; 770 int class_declaration_group_start_;
770 }; 771 };
771 772
772 } } // namespace v8::internal 773 } } // namespace v8::internal
773 774
774 #endif // V8_SCOPES_H_ 775 #endif // V8_SCOPES_H_
OLDNEW
« no previous file with comments | « src/scopeinfo.cc ('k') | src/snapshot/snapshot-common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698