Commit 03e4ddcf authored by erik.corry@gmail.com's avatar erik.corry@gmail.com

Loosen up code logging test that was sensitive to GC timing.

Review URL: https://chromiumcodereview.appspot.com/10918096

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12463 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent caef39a3
......@@ -11127,21 +11127,28 @@ static void event_handler(const v8::JitCodeEvent* event) {
break;
case v8::JitCodeEvent::CODE_MOVED: {
++move_events;
uint32_t hash = i::ComputePointerHash(event->code_start);
// We should never see code move that we haven't seen before.
// We would like to never see code move that we haven't seen before,
// but the code creation event does not happen until the line endings
// have been calculated (this is so that we can report the line in the
// script at which the function source is found, see
// 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);
CHECK(entry != NULL);
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);
entry->value = reinterpret_cast<void*>(event->code_len);
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);
entry->value = reinterpret_cast<void*>(event->code_len);
}
}
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment