Print type feedback info together with code objects.
authormstarzinger@chromium.org <mstarzinger@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 27 Jul 2012 12:06:26 +0000 (12:06 +0000)
committermstarzinger@chromium.org <mstarzinger@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 27 Jul 2012 12:06:26 +0000 (12:06 +0000)
R=jkummerow@chromium.org

Review URL: https://chromiumcodereview.appspot.com/10833049

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12212 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/objects-printer.cc
src/objects.cc

index 9bd7a75..da0e128 100644 (file)
@@ -596,9 +596,9 @@ void PolymorphicCodeCache::PolymorphicCodeCachePrint(FILE* out) {
 
 void TypeFeedbackInfo::TypeFeedbackInfoPrint(FILE* out) {
   HeapObject::PrintHeader(out, "TypeFeedbackInfo");
-  PrintF(out, "\n - ic_total_count: %d, ic_with_type_info_count: %d",
+  PrintF(out, " - ic_total_count: %d, ic_with_type_info_count: %d\n",
          ic_total_count(), ic_with_type_info_count());
-  PrintF(out, "\n - type_feedback_cells: ");
+  PrintF(out, " - type_feedback_cells: ");
   type_feedback_cells()->FixedArrayPrint(out);
 }
 
index 5b442ed..1482c4c 100644 (file)
@@ -8511,6 +8511,8 @@ void Code::Disassemble(const char* name, FILE* out) {
       PrintF(out, "\n");
     }
     PrintF(out, "\n");
+    // Just print if type feedback info is ever used for optimized code.
+    ASSERT(type_feedback_info()->IsUndefined());
   } else if (kind() == FUNCTION) {
     unsigned offset = stack_check_table_offset();
     // If there is no stack check table, the "table start" will at or after
@@ -8527,6 +8529,10 @@ void Code::Disassemble(const char* name, FILE* out) {
       }
       PrintF(out, "\n");
     }
+    if (!type_feedback_info()->IsUndefined()) {
+      TypeFeedbackInfo::cast(type_feedback_info())->TypeFeedbackInfoPrint(out);
+      PrintF(out, "\n");
+    }
   }
 
   PrintF("RelocInfo (size = %d)\n", relocation_size());