Commit 30ab4668 authored by Jakob Linke's avatar Jakob Linke Committed by V8 LUCI CQ

[code] Add a ShortPrint impl for CodeDataContainer

.. just because it's convenient to see the object type and code kind for
short prints.

Before:
 - code: 0x014c00257515 <Other heap object (CODE_DATA_CONTAINER_TYPE)>

After:
 - code: 0x39b7002573b1 <CodeDataContainer MAGLEV>

Bug: v8:11880
Change-Id: I02576ffdef509ed021fc5632ea19448387188130
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3826255Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
Commit-Queue: Jakob Linke <jgruber@chromium.org>
Auto-Submit: Jakob Linke <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82518}
parent a199f099
...@@ -2048,6 +2048,19 @@ void HeapObject::HeapObjectShortPrint(std::ostream& os) { ...@@ -2048,6 +2048,19 @@ void HeapObject::HeapObjectShortPrint(std::ostream& os) {
os << ">"; os << ">";
break; break;
} }
case CODE_DATA_CONTAINER_TYPE: {
#ifdef V8_EXTERNAL_CODE_SPACE
CodeDataContainer code = CodeDataContainer::cast(*this);
os << "<CodeDataContainer " << CodeKindToString(code.kind());
if (code.is_builtin()) {
os << " " << Builtins::name(code.builtin_id());
}
os << ">";
#else
os << "<CodeDataContainer>";
#endif // V8_EXTERNAL_CODE_SPACE
break;
}
case CODE_TYPE: { case CODE_TYPE: {
Code code = Code::cast(*this); Code code = Code::cast(*this);
os << "<Code " << CodeKindToString(code.kind()); os << "<Code " << CodeKindToString(code.kind());
......
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