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

[printer] Add printing of StoreIC feedback slots

Change-Id: I947359645587f63fad4413e340177027e42812d0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3916642
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83428}
parent 17814804
......@@ -1269,10 +1269,6 @@ void FeedbackNexus::Print(std::ostream& os) {
case FeedbackSlotKind::kStoreGlobalSloppy:
case FeedbackSlotKind::kStoreGlobalStrict:
case FeedbackSlotKind::kStoreInArrayLiteral:
case FeedbackSlotKind::kSetKeyedSloppy:
case FeedbackSlotKind::kSetKeyedStrict:
case FeedbackSlotKind::kSetNamedSloppy:
case FeedbackSlotKind::kSetNamedStrict:
case FeedbackSlotKind::kDefineNamedOwn: {
os << InlineCacheState2String(ic_state());
break;
......@@ -1306,6 +1302,24 @@ void FeedbackNexus::Print(std::ostream& os) {
}
break;
}
case FeedbackSlotKind::kSetNamedSloppy:
case FeedbackSlotKind::kSetNamedStrict:
case FeedbackSlotKind::kSetKeyedSloppy:
case FeedbackSlotKind::kSetKeyedStrict: {
os << InlineCacheState2String(ic_state());
if (ic_state() == InlineCacheState::MONOMORPHIC) {
os << "\n " << Brief(GetFeedback()) << ": ";
StoreHandler::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)) << ": ";
StoreHandler::PrintHandler(array.Get(i + 1).GetHeapObjectOrSmi(), os);
}
}
break;
}
case FeedbackSlotKind::kBinaryOp: {
os << "BinaryOp:" << GetBinaryOperationFeedback();
break;
......
......@@ -553,8 +553,8 @@ void StoreHandler::PrintHandler(Object handler, std::ostream& os) {
} else {
os << "StoreHandler(";
StoreHandler store_handler = StoreHandler::cast(handler);
if (store_handler.smi_handler().IsCode()) {
Code code = Code::cast(store_handler.smi_handler());
if (store_handler.smi_handler().IsCodeT()) {
CodeT code = CodeT::cast(store_handler.smi_handler());
os << "builtin = ";
code.ShortPrint(os);
} else {
......@@ -565,9 +565,10 @@ void StoreHandler::PrintHandler(Object handler, std::ostream& os) {
<< LookupOnLookupStartObjectBits::decode(raw_handler) << ", ";
PrintSmiStoreHandler(raw_handler, os);
}
DCHECK_GE(store_handler.data_field_count(), 1);
if (store_handler.data_field_count() >= 1) {
os << ", data1 = ";
store_handler.data1().ShortPrint(os);
}
if (store_handler.data_field_count() >= 2) {
os << ", data2 = ";
store_handler.data2().ShortPrint(os);
......
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