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

Unified Diff: src/ast/scopes.h

Issue 2223773002: Move zone_ to Scope (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/ast/scopes.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/scopes.h
diff --git a/src/ast/scopes.h b/src/ast/scopes.h
index 3b12835e9fdc4efbc0b9c4922c704c0dc4b0c558..80cbe63cbed7b1701509793a2aac742bbd09846b 100644
--- a/src/ast/scopes.h
+++ b/src/ast/scopes.h
@@ -20,18 +20,12 @@ class VariableMap: public ZoneHashMap {
public:
explicit VariableMap(Zone* zone);
- virtual ~VariableMap();
-
- Variable* Declare(Scope* scope, const AstRawString* name, VariableMode mode,
- Variable::Kind kind, InitializationFlag initialization_flag,
+ Variable* Declare(Zone* zone, Scope* scope, const AstRawString* name,
+ VariableMode mode, Variable::Kind kind,
+ InitializationFlag initialization_flag,
MaybeAssignedFlag maybe_assigned_flag = kNotAssigned);
Variable* Lookup(const AstRawString* name);
-
- Zone* zone() const { return zone_; }
-
- private:
- Zone* zone_;
};
@@ -61,16 +55,9 @@ class DynamicScopePart : public ZoneObject {
class SloppyBlockFunctionMap : public ZoneHashMap {
public:
explicit SloppyBlockFunctionMap(Zone* zone);
-
- virtual ~SloppyBlockFunctionMap();
-
- void Declare(const AstRawString* name,
+ void Declare(Zone* zone, const AstRawString* name,
SloppyBlockFunctionStatement* statement);
-
typedef ZoneVector<SloppyBlockFunctionStatement*> Vector;
-
- private:
- Zone* zone_;
};
@@ -150,7 +137,7 @@ class Scope: public ZoneObject {
// to the passed-in scope.
void PropagateUsageFlagsToScope(Scope* other);
- Zone* zone() const { return variables_.zone(); }
+ Zone* zone() const { return zone_; }
// ---------------------------------------------------------------------------
// Declarations
@@ -464,6 +451,8 @@ class Scope: public ZoneObject {
bool HasSimpleParameters();
private:
+ Zone* zone_;
+
// Scope tree.
Scope* outer_scope_; // the immediately enclosing outer scope, or NULL
Scope* inner_scope_; // an inner scope of this scope
@@ -835,6 +824,11 @@ class DeclarationScope : public Scope {
ZoneList<Variable*>* temps() { return &temps_; }
+ void DeclareSloppyBlockFunction(const AstRawString* name,
+ SloppyBlockFunctionStatement* statement) {
+ sloppy_block_function_map_.Declare(zone(), name, statement);
+ }
+
SloppyBlockFunctionMap* sloppy_block_function_map() {
return &sloppy_block_function_map_;
}
« no previous file with comments | « no previous file | src/ast/scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698