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

Unified Diff: src/scopes.h

Issue 949763003: WIP: new.target (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: src/scopes.h
diff --git a/src/scopes.h b/src/scopes.h
index c58d124939676e876a848d5741c94552bab76fa8..dfaa0ad0e5ca2b3d6a48fd9e99c662c7c5b2b8bf 100644
--- a/src/scopes.h
+++ b/src/scopes.h
@@ -216,6 +216,9 @@ class Scope: public ZoneObject {
// Inform the scope that the corresponding code uses "this".
void RecordThisUsage() { scope_uses_this_ = true; }
+ // Inform the scope that the corresponding code uses "new.target".
+ void RecordNewTargetUsage() { scope_uses_new_target_ = true; }
+
// Set the language mode flag (unless disabled by a global flag).
void SetLanguageMode(LanguageMode language_mode) {
language_mode_ = language_mode;
@@ -316,6 +319,11 @@ class Scope: public ZoneObject {
bool uses_this() const { return scope_uses_this_; }
// Does any inner scope access "this".
bool inner_uses_this() const { return inner_scope_uses_this_; }
+ // Does this scope access "new.target".
+ bool uses_new_target() const { return scope_uses_new_target_; }
+ // Does any inner scope access "new.target".
+ bool inner_uses_tnew_target() const { return inner_scope_uses_new_target_; }
+
// ---------------------------------------------------------------------------
// Accessors.
@@ -539,6 +547,8 @@ class Scope: public ZoneObject {
bool scope_uses_super_property_;
// This scope uses "this".
bool scope_uses_this_;
+ // This scope uses "new.target".
+ bool scope_uses_new_target_;
// This scope contains an "use asm" annotation.
bool asm_module_;
// This scope's outer context is an asm module.
@@ -555,6 +565,7 @@ class Scope: public ZoneObject {
bool inner_scope_uses_arguments_;
bool inner_scope_uses_super_property_;
bool inner_scope_uses_this_;
+ bool inner_scope_uses_new_target_;
bool force_eager_compilation_;
bool force_context_allocation_;

Powered by Google App Engine
This is Rietveld 408576698