Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(104)

Unified Diff: src/objects-printer.cc

Issue 2084913006: [ic] Let LoadGlobalIC load the variable name from TypeFeedbackMetadata. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@fix-load-ic-slow-stub
Patch Set: Addressing comments Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/interface-descriptors.cc ('k') | src/runtime/runtime.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-printer.cc
diff --git a/src/objects-printer.cc b/src/objects-printer.cc
index 151749b74d2e64f97e9e56e4c69a53747d2c159b..da907eb4ec2f025af40821e5bd9e57ee3303cf9f 100644
--- a/src/objects-printer.cc
+++ b/src/objects-printer.cc
@@ -578,6 +578,40 @@ void TransitionArray::TransitionArrayPrint(std::ostream& os) { // NOLINT
os << "\n";
}
+template void FeedbackVectorSpecBase<StaticFeedbackVectorSpec>::Print();
+template void FeedbackVectorSpecBase<FeedbackVectorSpec>::Print();
+
+template <typename Derived>
+void FeedbackVectorSpecBase<Derived>::Print() {
+ OFStream os(stdout);
+ FeedbackVectorSpecPrint(os);
+ os << std::flush;
+}
+
+template <typename Derived>
+void FeedbackVectorSpecBase<Derived>::FeedbackVectorSpecPrint(
+ std::ostream& os) { // NOLINT
+ int slot_count = This()->slots();
+ os << " - slot_count: " << slot_count;
+ if (slot_count == 0) {
+ os << " (empty)\n";
+ return;
+ }
+
+ for (int slot = 0, name_index = 0; slot < slot_count;) {
+ FeedbackVectorSlotKind kind = This()->GetKind(slot);
+ int entry_size = TypeFeedbackMetadata::GetSlotSize(kind);
+ DCHECK_LT(0, entry_size);
+
+ os << "\n Slot #" << slot << " " << kind;
+ if (TypeFeedbackMetadata::SlotRequiresName(kind)) {
+ os << ", " << Brief(*This()->GetName(name_index++));
+ }
+
+ slot += entry_size;
+ }
+ os << "\n";
+}
void TypeFeedbackMetadata::Print() {
OFStream os(stdout);
@@ -594,12 +628,16 @@ void TypeFeedbackMetadata::TypeFeedbackMetadataPrint(
os << " (empty)\n";
return;
}
+ os << "\n - slot_count: " << slot_count();
TypeFeedbackMetadataIterator iter(this);
while (iter.HasNext()) {
FeedbackVectorSlot slot = iter.Next();
FeedbackVectorSlotKind kind = iter.kind();
os << "\n Slot " << slot << " " << kind;
+ if (TypeFeedbackMetadata::SlotRequiresName(kind)) {
+ os << ", " << Brief(iter.name());
+ }
}
os << "\n";
}
@@ -625,7 +663,11 @@ void TypeFeedbackVector::TypeFeedbackVectorPrint(std::ostream& os) { // NOLINT
FeedbackVectorSlot slot = iter.Next();
FeedbackVectorSlotKind kind = iter.kind();
- os << "\n Slot " << slot << " " << kind << " ";
+ os << "\n Slot " << slot << " " << kind;
+ if (TypeFeedbackMetadata::SlotRequiresName(kind)) {
+ os << ", " << Brief(iter.name());
+ }
+ os << " ";
switch (kind) {
case FeedbackVectorSlotKind::LOAD_IC: {
LoadICNexus nexus(this, slot);
« no previous file with comments | « src/interface-descriptors.cc ('k') | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698