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

Unified Diff: src/scopes.cc

Issue 1074943002: Split TemplateHashMapImpl::Lookup into two methods (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix arm (and ppc) builds Created 5 years, 8 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.cc
diff --git a/src/scopes.cc b/src/scopes.cc
index 3d46d158ac877ad88ad4724d5184e4c6c275166b..512834bdfee4040b4f910b1a8b78d15c21ae905d 100644
--- a/src/scopes.cc
+++ b/src/scopes.cc
@@ -36,8 +36,9 @@ Variable* VariableMap::Declare(Scope* scope, const AstRawString* name,
// 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::Lookup(const_cast<AstRawString*>(name), name->hash(),
- true, ZoneAllocationPolicy(zone()));
+ Entry* p =
+ ZoneHashMap::LookupOrInsert(const_cast<AstRawString*>(name), name->hash(),
+ ZoneAllocationPolicy(zone()));
if (p->value == NULL) {
// The variable has not been declared yet -> insert it.
DCHECK(p->key == name);
@@ -49,8 +50,7 @@ Variable* VariableMap::Declare(Scope* scope, const AstRawString* name,
Variable* VariableMap::Lookup(const AstRawString* name) {
- Entry* p = ZoneHashMap::Lookup(const_cast<AstRawString*>(name), name->hash(),
- false, ZoneAllocationPolicy(NULL));
+ Entry* p = ZoneHashMap::Lookup(const_cast<AstRawString*>(name), name->hash());
if (p != NULL) {
DCHECK(reinterpret_cast<const AstRawString*>(p->key) == name);
DCHECK(p->value != NULL);

Powered by Google App Engine
This is Rietveld 408576698