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

Unified Diff: src/ast/variables.h

Issue 2475433002: Turn Scope::locals_ into a ThreadedList (Closed)
Patch Set: Addressed comments Created 4 years, 1 month 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
« no previous file with comments | « src/ast/scopes.cc ('k') | src/ast/variables.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/variables.h
diff --git a/src/ast/variables.h b/src/ast/variables.h
index 44cfd412cfbac0d5c9fc0e7b95b44ac0ce20ce0b..afde9c507c3263e8991a5891a18ece1762fb5051 100644
--- a/src/ast/variables.h
+++ b/src/ast/variables.h
@@ -123,6 +123,8 @@ class Variable final : public ZoneObject {
return mode == VAR ? kCreatedInitialized : kNeedsInitialization;
}
+ typedef ThreadedList<Variable> List;
+
private:
Scope* scope_;
const AstRawString* name_;
@@ -132,6 +134,7 @@ class Variable final : public ZoneObject {
// sloppy 'eval' calls between the reference scope (inclusive) and the
// binding scope (exclusive).
Variable* local_if_not_shadowed_;
+ Variable* next_;
int index_;
int initializer_position_;
uint16_t bit_field_;
@@ -150,6 +153,11 @@ class Variable final : public ZoneObject {
class MaybeAssignedFlagField
: public BitField16<MaybeAssignedFlag, InitializationFlagField::kNext,
2> {};
+ Variable** next() { return &next_; }
+ friend List;
+ // To reset next to nullptr upon resetting after preparsing.
+ // TODO(verwaest): Remove once we properly preparse parameters.
+ friend class DeclarationScope;
};
} // namespace internal
} // namespace v8
« no previous file with comments | « src/ast/scopes.cc ('k') | src/ast/variables.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698