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

Unified Diff: src/objects-printer.cc

Issue 1225403005: Special printing for type feedback vectors. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 5 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 | « no previous file | src/type-feedback-vector.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 fdcaa74670c11d14caa5fb2f955291946dbd3298..2f0b1b31eec2fa380b305865f323d9c01fbd154b 100644
--- a/src/objects-printer.cc
+++ b/src/objects-printer.cc
@@ -503,6 +503,61 @@ void FixedDoubleArray::FixedDoubleArrayPrint(std::ostream& os) { // NOLINT
}
+void TypeFeedbackVector::Print() {
+ OFStream os(stdout);
+ TypeFeedbackVectorPrint(os);
+ os << std::flush;
+}
+
+
+void TypeFeedbackVector::TypeFeedbackVectorPrint(std::ostream& os) { // NOLINT
+ HeapObject::PrintHeader(os, "TypeFeedbackVector");
+ os << " - length: " << length();
+ if (length() == 0) {
+ os << " (empty)\n";
+ return;
+ }
+
+ os << "\n - ics with type info: " << ic_with_type_info_count();
+ os << "\n - generic ics: " << ic_generic_count();
+
+ if (Slots() > 0) {
+ for (int i = 0; i < Slots(); i++) {
+ FeedbackVectorSlot slot(i);
+ os << "\n Slot " << i << " [" << GetIndex(slot)
+ << "]: " << Brief(Get(slot));
+ }
+ }
+
+ if (ICSlots() > 0) {
+ DCHECK(elements_per_ic_slot() == 2);
+
+ for (int i = 0; i < ICSlots(); i++) {
+ FeedbackVectorICSlot slot(i);
+ Code::Kind kind = GetKind(slot);
+ os << "\n ICSlot " << i;
+ if (kind == Code::LOAD_IC) {
+ LoadICNexus nexus(this, slot);
+ os << " LOAD_IC " << Code::ICState2String(nexus.StateFromFeedback());
+ } else if (kind == Code::KEYED_LOAD_IC) {
+ KeyedLoadICNexus nexus(this, slot);
+ os << " KEYED_LOAD_IC "
+ << Code::ICState2String(nexus.StateFromFeedback());
+ } else {
+ DCHECK(kind == Code::CALL_IC);
+ CallICNexus nexus(this, slot);
+ os << " CALL_IC " << Code::ICState2String(nexus.StateFromFeedback());
+ }
+
+ os << "\n [" << GetIndex(slot) << "]: " << Brief(Get(slot));
+ os << "\n [" << (GetIndex(slot) + 1)
+ << "]: " << Brief(get(GetIndex(slot) + 1));
+ }
+ }
+ os << "\n";
+}
+
+
void JSValue::JSValuePrint(std::ostream& os) { // NOLINT
HeapObject::PrintHeader(os, "ValueObject");
value()->Print(os);
@@ -761,7 +816,7 @@ void SharedFunctionInfo::SharedFunctionInfoPrint(std::ostream& os) { // NOLINT
os << "\n - length = " << length();
os << "\n - optimized_code_map = " << Brief(optimized_code_map());
os << "\n - feedback_vector = ";
- feedback_vector()->FixedArrayPrint(os);
+ feedback_vector()->TypeFeedbackVectorPrint(os);
os << "\n";
}
« no previous file with comments | « no previous file | src/type-feedback-vector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698