| Index: src/ast/scopes.cc
|
| diff --git a/src/ast/scopes.cc b/src/ast/scopes.cc
|
| index d45b02091cd805d1b0e5ec8fad07f651cac2ca7b..e274d8964733063b099df1a694a802e4fc112cdb 100644
|
| --- a/src/ast/scopes.cc
|
| +++ b/src/ast/scopes.cc
|
| @@ -36,9 +36,8 @@ Variable* VariableMap::Declare(Zone* zone, Scope* scope,
|
| // AstRawStrings are unambiguous, i.e., the same string is always represented
|
| // by the same AstRawString*.
|
| // FIXME(marja): fix the type of Lookup.
|
| - Entry* p =
|
| - ZoneHashMap::LookupOrInsert(const_cast<AstRawString*>(name), name->hash(),
|
| - ZoneAllocationPolicy(zone));
|
| + Entry* p = ZoneHashMap::LookupOrInsert(const_cast<AstRawString*>(name),
|
| + name->hash());
|
| if (added) *added = p->value == nullptr;
|
| if (p->value == nullptr) {
|
| // The variable has not been declared yet -> insert it.
|
| @@ -54,11 +53,10 @@ void VariableMap::Remove(Variable* var) {
|
| ZoneHashMap::Remove(const_cast<AstRawString*>(name), name->hash());
|
| }
|
|
|
| -void VariableMap::Add(Zone* zone, Variable* var) {
|
| +void VariableMap::Add(Variable* var) {
|
| const AstRawString* name = var->raw_name();
|
| - Entry* p =
|
| - ZoneHashMap::LookupOrInsert(const_cast<AstRawString*>(name), name->hash(),
|
| - ZoneAllocationPolicy(zone));
|
| + Entry* p = ZoneHashMap::LookupOrInsert(const_cast<AstRawString*>(name),
|
| + name->hash());
|
| DCHECK_NULL(p->value);
|
| DCHECK_EQ(name, p->key);
|
| p->value = var;
|
| @@ -77,13 +75,12 @@ Variable* VariableMap::Lookup(const AstRawString* name) {
|
| SloppyBlockFunctionMap::SloppyBlockFunctionMap(Zone* zone)
|
| : ZoneHashMap(ZoneHashMap::PointersMatch, 8, ZoneAllocationPolicy(zone)) {}
|
|
|
| -void SloppyBlockFunctionMap::Declare(Zone* zone, const AstRawString* name,
|
| +void SloppyBlockFunctionMap::Declare(const AstRawString* name,
|
| SloppyBlockFunctionStatement* stmt) {
|
| // AstRawStrings are unambiguous, i.e., the same string is always represented
|
| // by the same AstRawString*.
|
| - Entry* p =
|
| - ZoneHashMap::LookupOrInsert(const_cast<AstRawString*>(name), name->hash(),
|
| - ZoneAllocationPolicy(zone));
|
| + Entry* p = ZoneHashMap::LookupOrInsert(const_cast<AstRawString*>(name),
|
| + name->hash());
|
| stmt->set_next(static_cast<SloppyBlockFunctionStatement*>(p->value));
|
| p->value = stmt;
|
| }
|
| @@ -694,7 +691,7 @@ void Scope::Snapshot::Reparent(DeclarationScope* new_parent) const {
|
| new_parent->AddLocal(local);
|
| if (local->mode() == VAR) {
|
| outer_closure->variables_.Remove(local);
|
| - new_parent->variables_.Add(new_parent->zone(), local);
|
| + new_parent->variables_.Add(local);
|
| }
|
| }
|
| outer_closure->locals_.Rewind(top_local_);
|
|
|