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

Unified Diff: test/cctest/test-api.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: test/cctest/test-api.cc
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
index e01e8f19a941824b3e4c244c4d7debda3789ef72..9520e853cc0f51e932d3414c6fbce9313fcf414d 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -12352,10 +12352,8 @@ static void event_handler(const v8::JitCodeEvent* event) {
CHECK(event->code_start != NULL);
CHECK_NE(0, static_cast<int>(event->code_len));
CHECK(event->name.str != NULL);
- i::HashMap::Entry* entry =
- code_map->Lookup(event->code_start,
- i::ComputePointerHash(event->code_start),
- true);
+ i::HashMap::Entry* entry = code_map->LookupOrInsert(
+ event->code_start, i::ComputePointerHash(event->code_start));
entry->value = reinterpret_cast<void*>(event->code_len);
if (FunctionNameIs("bar", event)) {
@@ -12373,18 +12371,16 @@ static void event_handler(const v8::JitCodeEvent* event) {
// Compiler::RecordFunctionCompilation) and the line endings
// calculations can cause a GC, which can move the newly created code
// before its existence can be logged.
- i::HashMap::Entry* entry =
- code_map->Lookup(event->code_start, hash, false);
+ i::HashMap::Entry* entry = code_map->Lookup(event->code_start, hash);
if (entry != NULL) {
++move_events;
CHECK_EQ(reinterpret_cast<void*>(event->code_len), entry->value);
code_map->Remove(event->code_start, hash);
- entry = code_map->Lookup(event->new_code_start,
- i::ComputePointerHash(event->new_code_start),
- true);
- CHECK(entry != NULL);
marja 2015/04/10 07:59:58 Why did you remove this CHECK?
adamk 2015/04/13 18:34:41 Basically because it's testing internal invariants
+ entry = code_map->LookupOrInsert(
+ event->new_code_start,
+ i::ComputePointerHash(event->new_code_start));
entry->value = reinterpret_cast<void*>(event->code_len);
}
}
@@ -12402,10 +12398,8 @@ static void event_handler(const v8::JitCodeEvent* event) {
DummyJitCodeLineInfo* line_info = new DummyJitCodeLineInfo();
v8::JitCodeEvent* temp_event = const_cast<v8::JitCodeEvent*>(event);
temp_event->user_data = line_info;
- i::HashMap::Entry* entry =
- jitcode_line_info->Lookup(line_info,
- i::ComputePointerHash(line_info),
- true);
+ i::HashMap::Entry* entry = jitcode_line_info->LookupOrInsert(
+ line_info, i::ComputePointerHash(line_info));
entry->value = reinterpret_cast<void*>(line_info);
}
break;
@@ -12416,7 +12410,7 @@ static void event_handler(const v8::JitCodeEvent* event) {
CHECK(event->user_data != NULL);
uint32_t hash = i::ComputePointerHash(event->user_data);
i::HashMap::Entry* entry =
- jitcode_line_info->Lookup(event->user_data, hash, false);
+ jitcode_line_info->Lookup(event->user_data, hash);
CHECK(entry != NULL);
delete reinterpret_cast<DummyJitCodeLineInfo*>(event->user_data);
}
@@ -12426,7 +12420,7 @@ static void event_handler(const v8::JitCodeEvent* event) {
CHECK(event->user_data != NULL);
uint32_t hash = i::ComputePointerHash(event->user_data);
i::HashMap::Entry* entry =
- jitcode_line_info->Lookup(event->user_data, hash, false);
+ jitcode_line_info->Lookup(event->user_data, hash);
CHECK(entry != NULL);
}
break;
« src/hashmap.h ('K') | « src/strings-storage.cc ('k') | test/cctest/test-hashmap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698