fix name-clash regression in heapdump.cpp

This commit is contained in:
Joel Dice 2009-09-01 13:09:53 -06:00
parent 27f35bf239
commit 49005f0746

View File

@ -15,6 +15,8 @@ using namespace vm;
namespace { namespace {
namespace local {
enum { enum {
Root, Root,
Size, Size,
@ -49,6 +51,8 @@ objectSize(Thread* t, object o)
return extendedSize(t, o, baseSize(t, o, objectClass(t, o))); return extendedSize(t, o, baseSize(t, o, objectClass(t, o)));
} }
} // namespace local
} // namespace } // namespace
namespace vm { namespace vm {
@ -61,24 +65,24 @@ dumpHeap(Thread* t, FILE* out)
Visitor(Thread* t, FILE* out): t(t), out(out), nextNumber(1) { } Visitor(Thread* t, FILE* out): t(t), out(out), nextNumber(1) { }
virtual void root() { virtual void root() {
write1(out, Root); write1(out, local::Root);
} }
virtual unsigned visitNew(object p) { virtual unsigned visitNew(object p) {
if (p) { if (p) {
unsigned number = nextNumber++; unsigned number = nextNumber++;
write4(out, number); local::write4(out, number);
write1(out, Size); local::write1(out, local::Size);
write4(out, objectSize(t, p)); local::write4(out, local::objectSize(t, p));
if (objectClass(t, p) == arrayBody(t, t->m->types, Machine::ClassType)) if (objectClass(t, p) == arrayBody(t, t->m->types, Machine::ClassType))
{ {
object name = className(t, p); object name = className(t, p);
if (name) { if (name) {
write1(out, ClassName); local::write1(out, local::ClassName);
writeString(out, &byteArrayBody(t, name, 0), local::writeString(out, &byteArrayBody(t, name, 0),
byteArrayLength(t, name) - 1); byteArrayLength(t, name) - 1);
} }
} }
@ -89,15 +93,15 @@ dumpHeap(Thread* t, FILE* out)
} }
virtual void visitOld(object, unsigned number) { virtual void visitOld(object, unsigned number) {
write4(out, number); local::write4(out, number);
} }
virtual void push(object, unsigned, unsigned) { virtual void push(object, unsigned, unsigned) {
write1(out, Push); local::write1(out, local::Push);
} }
virtual void pop() { virtual void pop() {
write1(out, Pop); local::write1(out, local::Pop);
} }
Thread* t; Thread* t;