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

Unified Diff: src/d8.h

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/d8.h
diff --git a/src/d8.h b/src/d8.h
index 90dde1541ee9b30d57ad0268256dbb8acd56b299..1d73c0e1c26bd1489d137d98fee4bf29513ee5a2 100644
--- a/src/d8.h
+++ b/src/d8.h
@@ -58,18 +58,14 @@ class CounterMap {
public:
CounterMap(): hash_map_(Match) { }
Counter* Lookup(const char* name) {
- i::HashMap::Entry* answer = hash_map_.Lookup(
- const_cast<char*>(name),
- Hash(name),
- false);
+ i::HashMap::Entry* answer =
+ hash_map_.Lookup(const_cast<char*>(name), Hash(name));
if (!answer) return NULL;
return reinterpret_cast<Counter*>(answer->value);
}
void Set(const char* name, Counter* value) {
- i::HashMap::Entry* answer = hash_map_.Lookup(
- const_cast<char*>(name),
- Hash(name),
- true);
+ i::HashMap::Entry* answer =
+ hash_map_.LookupOrInsert(const_cast<char*>(name), Hash(name));
DCHECK(answer != NULL);
answer->value = value;
}
« no previous file with comments | « src/compiler/state-values-utils.cc ('k') | src/debug.cc » ('j') | src/hashmap.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698