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

Unified Diff: src/ast/scopes.cc

Issue 2345233003: [base] Move hashmap allocator to a field (Closed)
Patch Set: Created 4 years, 3 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 | « src/ast/ast.cc ('k') | src/base/hashmap.h » ('j') | src/base/hashmap.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/scopes.cc
diff --git a/src/ast/scopes.cc b/src/ast/scopes.cc
index d45b02091cd805d1b0e5ec8fad07f651cac2ca7b..b53382598ab1815abf6810c356bbf467fdcee570 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.
@@ -56,9 +55,8 @@ void VariableMap::Remove(Variable* var) {
void VariableMap::Add(Zone* zone, 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;
@@ -81,9 +79,8 @@ void SloppyBlockFunctionMap::Declare(Zone* zone, 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;
}
« no previous file with comments | « src/ast/ast.cc ('k') | src/base/hashmap.h » ('j') | src/base/hashmap.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698