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

Unified Diff: src/debug.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
« no previous file with comments | « src/d8.h ('k') | src/gdb-jit.cc » ('j') | src/hashmap.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug.cc
diff --git a/src/debug.cc b/src/debug.cc
index dad5234887a315548494cacc6d0aef737731dde5..854b507c47339fd21a9d61eb58ed6ebf3e32f4b5 100644
--- a/src/debug.cc
+++ b/src/debug.cc
@@ -519,7 +519,7 @@ void ScriptCache::Add(Handle<Script> script) {
// Create an entry in the hash map for the script.
int id = script->id()->value();
HashMap::Entry* entry =
- HashMap::Lookup(reinterpret_cast<void*>(id), Hash(id), true);
+ HashMap::LookupOrInsert(reinterpret_cast<void*>(id), Hash(id));
if (entry->value != NULL) {
#ifdef DEBUG
// The code deserializer may introduce duplicate Script objects.
@@ -582,7 +582,8 @@ void ScriptCache::HandleWeakScript(
// Remove the corresponding entry from the cache.
ScriptCache* script_cache =
reinterpret_cast<ScriptCache*>(data.GetParameter());
- HashMap::Entry* entry = script_cache->Lookup(key, hash, false);
+ HashMap::Entry* entry = script_cache->Lookup(key, hash);
+ DCHECK_NOT_NULL(entry);
Object** location = reinterpret_cast<Object**>(entry->value);
script_cache->Remove(key, hash);
« no previous file with comments | « src/d8.h ('k') | src/gdb-jit.cc » ('j') | src/hashmap.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698