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) { ...@@ -1269,10 +1269,6 @@ void FeedbackNexus::Print(std::ostream& os) {
case FeedbackSlotKind::kStoreGlobalSloppy: case FeedbackSlotKind::kStoreGlobalSloppy:
case FeedbackSlotKind::kStoreGlobalStrict: case FeedbackSlotKind::kStoreGlobalStrict:
case FeedbackSlotKind::kStoreInArrayLiteral: case FeedbackSlotKind::kStoreInArrayLiteral:
case FeedbackSlotKind::kSetKeyedSloppy:
case FeedbackSlotKind::kSetKeyedStrict:
case FeedbackSlotKind::kSetNamedSloppy:
case FeedbackSlotKind::kSetNamedStrict:
case FeedbackSlotKind::kDefineNamedOwn: { case FeedbackSlotKind::kDefineNamedOwn: {
os << InlineCacheState2String(ic_state()); os << InlineCacheState2String(ic_state());
break; break;
...@@ -1306,6 +1302,24 @@ void FeedbackNexus::Print(std::ostream& os) { ...@@ -1306,6 +1302,24 @@ void FeedbackNexus::Print(std::ostream& os) {
} }
break; 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: { case FeedbackSlotKind::kBinaryOp: {
os << "BinaryOp:" << GetBinaryOperationFeedback(); os << "BinaryOp:" << GetBinaryOperationFeedback();
break; break;
......
...@@ -553,8 +553,8 @@ void StoreHandler::PrintHandler(Object handler, std::ostream& os) { ...@@ -553,8 +553,8 @@ void StoreHandler::PrintHandler(Object handler, std::ostream& os) {
} else { } else {
os << "StoreHandler("; os << "StoreHandler(";
StoreHandler store_handler = StoreHandler::cast(handler); StoreHandler store_handler = StoreHandler::cast(handler);
if (store_handler.smi_handler().IsCode()) { if (store_handler.smi_handler().IsCodeT()) {
Code code = Code::cast(store_handler.smi_handler()); CodeT code = CodeT::cast(store_handler.smi_handler());
os << "builtin = "; os << "builtin = ";
code.ShortPrint(os); code.ShortPrint(os);
} else { } else {
...@@ -565,9 +565,10 @@ void StoreHandler::PrintHandler(Object handler, std::ostream& os) { ...@@ -565,9 +565,10 @@ void StoreHandler::PrintHandler(Object handler, std::ostream& os) {
<< LookupOnLookupStartObjectBits::decode(raw_handler) << ", "; << LookupOnLookupStartObjectBits::decode(raw_handler) << ", ";
PrintSmiStoreHandler(raw_handler, os); PrintSmiStoreHandler(raw_handler, os);
} }
DCHECK_GE(store_handler.data_field_count(), 1); if (store_handler.data_field_count() >= 1) {
os << ", data1 = "; os << ", data1 = ";
store_handler.data1().ShortPrint(os); store_handler.data1().ShortPrint(os);
}
if (store_handler.data_field_count() >= 2) { if (store_handler.data_field_count() >= 2) {
os << ", data2 = "; os << ", data2 = ";
store_handler.data2().ShortPrint(os); 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