Commit aab330fd authored by Leszek Swirski's avatar Leszek Swirski Committed by V8 LUCI CQ

[ic] Add more detailed printing

Print polymorphic feedback, and include instance type in printed maps.

Change-Id: I34b71fbd5c94a1b615b17646dcd7a729a4ff4eac
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3677299Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#80837}
parent ce9d6d49
......@@ -1246,7 +1246,6 @@ void FeedbackNexus::Print(std::ostream& os) {
case FeedbackSlotKind::kLoadGlobalInsideTypeof:
case FeedbackSlotKind::kLoadGlobalNotInsideTypeof:
case FeedbackSlotKind::kLoadKeyed:
case FeedbackSlotKind::kLoadProperty:
case FeedbackSlotKind::kDefineKeyedOwnPropertyInLiteral:
case FeedbackSlotKind::kStoreGlobalSloppy:
case FeedbackSlotKind::kStoreGlobalStrict:
......@@ -1257,10 +1256,20 @@ void FeedbackNexus::Print(std::ostream& os) {
case FeedbackSlotKind::kSetNamedStrict:
case FeedbackSlotKind::kDefineNamedOwn: {
os << InlineCacheState2String(ic_state());
if (kind() == FeedbackSlotKind::kLoadProperty &&
ic_state() == InlineCacheState::MONOMORPHIC) {
os << "\n ";
break;
}
case FeedbackSlotKind::kLoadProperty: {
os << InlineCacheState2String(ic_state());
if (ic_state() == InlineCacheState::MONOMORPHIC) {
os << "\n " << Brief(GetFeedback().GetHeapObject()) << ": ";
LoadHandler::PrintHandler(GetFeedbackExtra().GetHeapObjectOrSmi(), os);
} else if (ic_state() == InlineCacheState::POLYMORPHIC) {
WeakFixedArray array =
WeakFixedArray::cast(GetFeedback().GetHeapObject());
for (int i = 0; i < array.length(); i += 2) {
os << "\n " << Brief(array.Get(i)) << ": ";
LoadHandler::PrintHandler(array.Get(i + 1).GetHeapObjectOrSmi(), os);
}
}
break;
}
......
......@@ -1851,12 +1851,16 @@ void HeapObject::HeapObjectShortPrint(std::ostream& os) {
case MAP_TYPE: {
os << "<Map";
Map mapInstance = Map::cast(*this);
if (mapInstance.IsJSObjectMap()) {
os << "(" << ElementsKindToString(mapInstance.elements_kind()) << ")";
} else if (mapInstance.instance_size() != kVariableSizeSentinel) {
if (mapInstance.instance_size() != kVariableSizeSentinel) {
os << "[" << mapInstance.instance_size() << "]";
}
os << ">";
os << "(";
if (mapInstance.IsJSObjectMap()) {
os << ElementsKindToString(mapInstance.elements_kind());
} else {
os << mapInstance.instance_type();
}
os << ")>";
} break;
case AWAIT_CONTEXT_TYPE: {
os << "<AwaitContext generator= ";
......
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