Commit 2952a77d authored by olivf@chromium.org's avatar olivf@chromium.org

trace compare_nil_ic state in --trace-ic output

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
parent 2a28f53b
...@@ -434,6 +434,23 @@ void CompareNilICStub::Record(Handle<Object> object) { ...@@ -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) { void CompareNilICStub::PrintName(StringStream* stream) {
stream->Add("CompareNilICStub_"); stream->Add("CompareNilICStub_");
types_.Print(stream); types_.Print(stream);
...@@ -578,17 +595,19 @@ void ToBooleanStub::Types::Print(StringStream* stream) const { ...@@ -578,17 +595,19 @@ void ToBooleanStub::Types::Print(StringStream* stream) const {
void ToBooleanStub::Types::TraceTransition(Types to) const { void ToBooleanStub::Types::TraceTransition(Types to) const {
#ifdef DEBUG
if (!FLAG_trace_ic) return; if (!FLAG_trace_ic) return;
char buffer[100]; char buffer[100];
NoAllocationStringAllocator allocator(buffer, NoAllocationStringAllocator allocator(buffer,
static_cast<unsigned>(sizeof(buffer))); static_cast<unsigned>(sizeof(buffer)));
StringStream stream(&allocator); StringStream stream(&allocator);
stream.Add("[ToBooleanIC ("); stream.Add("[ToBooleanIC : ");
Print(&stream); Print(&stream);
stream.Add("->"); stream.Add("=>");
to.Print(&stream); to.Print(&stream);
stream.Add(")]\n"); stream.Add("]\n");
stream.OutputToStdOut(); stream.OutputToStdOut();
#endif
} }
......
...@@ -1084,6 +1084,7 @@ class CompareNilICStub : public HydrogenCodeStub { ...@@ -1084,6 +1084,7 @@ class CompareNilICStub : public HydrogenCodeStub {
} }
void Print(StringStream* stream) const; void Print(StringStream* stream) const;
void TraceTransition(Types to) const;
}; };
// At most 6 different types can be distinguished, because the Code object // At most 6 different types can be distinguished, because the Code object
......
...@@ -2928,7 +2928,9 @@ MaybeObject* CompareNilIC::CompareNil(Handle<Object> object) { ...@@ -2928,7 +2928,9 @@ MaybeObject* CompareNilIC::CompareNil(Handle<Object> object) {
// types must be supported as a result of the miss. // types must be supported as a result of the miss.
bool already_monomorphic = stub.IsMonomorphic(); bool already_monomorphic = stub.IsMonomorphic();
CompareNilICStub::Types old_types = stub.GetTypes();
stub.Record(object); stub.Record(object);
old_types.TraceTransition(stub.GetTypes());
EqualityKind kind = stub.GetKind(); EqualityKind kind = stub.GetKind();
NilValue nil = stub.GetNilValue(); NilValue nil = stub.GetNilValue();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment