trace compare_nil_ic state in --trace-ic output
authorolivf@chromium.org <olivf@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 24 May 2013 15:20:48 +0000 (15:20 +0000)
committerolivf@chromium.org <olivf@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 24 May 2013 15:20:48 +0000 (15:20 +0000)
BUG=
R=svenpanne@chromium.org

Review URL: https://codereview.chromium.org/15735020

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

src/code-stubs.cc
src/code-stubs.h
src/ic.cc

index 30478da..2b96dbf 100644 (file)
@@ -434,6 +434,23 @@ void CompareNilICStub::Record(Handle<Object> object) {
 }
 
 
+void CompareNilICStub::Types::TraceTransition(Types to) const {
+  #ifdef DEBUG
+  if (!FLAG_trace_ic) return;
+  char buffer[100];
+  NoAllocationStringAllocator allocator(buffer,
+                                        static_cast<unsigned>(sizeof(buffer)));
+  StringStream stream(&allocator);
+  stream.Add("[CompareNilIC : ");
+  Print(&stream);
+  stream.Add("=>");
+  to.Print(&stream);
+  stream.Add("]\n");
+  stream.OutputToStdOut();
+  #endif
+}
+
+
 void CompareNilICStub::PrintName(StringStream* stream) {
   stream->Add("CompareNilICStub_");
   types_.Print(stream);
@@ -578,17 +595,19 @@ void ToBooleanStub::Types::Print(StringStream* stream) const {
 
 
 void ToBooleanStub::Types::TraceTransition(Types to) const {
+  #ifdef DEBUG
   if (!FLAG_trace_ic) return;
   char buffer[100];
   NoAllocationStringAllocator allocator(buffer,
                                         static_cast<unsigned>(sizeof(buffer)));
   StringStream stream(&allocator);
-  stream.Add("[ToBooleanIC (");
+  stream.Add("[ToBooleanIC ");
   Print(&stream);
-  stream.Add("->");
+  stream.Add("=>");
   to.Print(&stream);
-  stream.Add(")]\n");
+  stream.Add("]\n");
   stream.OutputToStdOut();
+  #endif
 }
 
 
index f66db94..08ccafd 100644 (file)
@@ -1084,6 +1084,7 @@ class CompareNilICStub : public HydrogenCodeStub  {
     }
 
     void Print(StringStream* stream) const;
+    void TraceTransition(Types to) const;
   };
 
   // At most 6 different types can be distinguished, because the Code object
index 91e1c76..e81ea10 100644 (file)
--- a/src/ic.cc
+++ b/src/ic.cc
@@ -2928,7 +2928,9 @@ MaybeObject* CompareNilIC::CompareNil(Handle<Object> object) {
   // types must be supported as a result of the miss.
   bool already_monomorphic = stub.IsMonomorphic();
 
+  CompareNilICStub::Types old_types = stub.GetTypes();
   stub.Record(object);
+  old_types.TraceTransition(stub.GetTypes());
 
   EqualityKind kind = stub.GetKind();
   NilValue nil = stub.GetNilValue();