diff --git a/src/code-stubs.cc b/src/code-stubs.cc index 30478da79e..2b96dbf19e 100644 --- a/src/code-stubs.cc +++ b/src/code-stubs.cc @@ -434,6 +434,23 @@ void CompareNilICStub::Record(Handle object) { } +void CompareNilICStub::Types::TraceTransition(Types to) const { + #ifdef DEBUG + if (!FLAG_trace_ic) return; + char buffer[100]; + NoAllocationStringAllocator allocator(buffer, + static_cast(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(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 } diff --git a/src/code-stubs.h b/src/code-stubs.h index f66db94595..08ccafdb0e 100644 --- a/src/code-stubs.h +++ b/src/code-stubs.h @@ -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 diff --git a/src/ic.cc b/src/ic.cc index 91e1c763da..e81ea10d93 100644 --- a/src/ic.cc +++ b/src/ic.cc @@ -2928,7 +2928,9 @@ MaybeObject* CompareNilIC::CompareNil(Handle 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();