Commit 9eec1530 authored by Yang Guo's avatar Yang Guo Committed by Commit Bot

[serializer] clear debug info for code cache.

Debug info carries more information than just break points. It also carries
debugging-related flags and data for block coverage and type profiling.

In production we won't run into the situation where debug info is created with
the debugger not enabled. But this way seems a bit more robust.

Bug: v8:7396
Change-Id: I6989bbab82a3c597a43dde382a74114f945adf5f
Reviewed-on: https://chromium-review.googlesource.com/898923Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Reviewed-by: 's avatarMythri Alle <mythria@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51057}
parent 0ee2eefd
......@@ -134,14 +134,16 @@ void CodeSerializer::SerializeObject(HeapObject* obj, HowToCode how_to_code,
// TODO(7110): Enable serializing of Asm modules once the AsmWasmData
// is context independent.
DCHECK(!sfi->IsApiFunction() && !sfi->HasAsmWasmData());
// Do not serialize when a debugger is active.
DCHECK(sfi->debug_info()->IsSmi());
// Clear debug info.
Object* debug_info = sfi->debug_info();
sfi->set_debug_info(Smi::kZero);
// Mark SFI to indicate whether the code is cached.
bool was_deserialized = sfi->deserialized();
sfi->set_deserialized(sfi->is_compiled());
SerializeGeneric(obj, how_to_code, where_to_point);
sfi->set_deserialized(was_deserialized);
sfi->set_debug_info(debug_info);
return;
}
......
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