fix heapdump=true build

This commit is contained in:
Joel Dice 2014-07-16 14:18:42 -06:00
parent 00340cdc6b
commit cae4b49005
4 changed files with 8 additions and 7 deletions

View File

@ -1869,7 +1869,8 @@ executable-objects = $(vm-objects) $(classpath-objects) $(driver-object) \
$(javahome-object) $(boot-javahome-object) $(lzma-decode-objects)
unittest-executable-objects = $(unittest-objects) $(vm-objects) \
$(build)/util/arg-parser.o $(stub-objects) $(lzma-decode-objects)
$(vm-heapwalk-objects) $(build)/util/arg-parser.o $(stub-objects) \
$(lzma-decode-objects)
ifeq ($(process),interpret)
unittest-executable-objects += $(all-codegen-target-objects)

View File

@ -286,9 +286,10 @@ extern "C" AVIAN_EXPORT int64_t JNICALL
extern "C" AVIAN_EXPORT void JNICALL
Avian_avian_Machine_dumpHeap(Thread* t, object, uintptr_t* arguments)
{
object outputFile = reinterpret_cast<object>(*arguments);
GcString* outputFile
= static_cast<GcString*>(reinterpret_cast<object>(*arguments));
unsigned length = stringLength(t, outputFile);
unsigned length = outputFile->length(t);
THREAD_RUNTIME_ARRAY(t, char, n, length + 1);
stringChars(t, outputFile, RUNTIME_ARRAY_BODY(n));
FILE* out = vm::fopen(RUNTIME_ARRAY_BODY(n), "wb");

View File

@ -74,11 +74,10 @@ void dumpHeap(Thread* t, FILE* out)
local::write4(out, local::objectSize(t, p));
if (objectClass(t, p) == type(t, GcClass::Type)) {
object name = className(t, p);
GcByteArray* name = static_cast<GcClass*>(p)->name();
if (name) {
local::write1(out, local::ClassName);
local::writeString(
out, &byteArrayBody(t, name, 0), byteArrayLength(t, name) - 1);
local::writeString(out, name->body().begin(), name->length() - 1);
}
}

View File

@ -30,5 +30,5 @@ if [ -z "${openjdk}" ]; then
run make openjdk=$JAVA_HOME ${flags} ${test_target}
fi
fi
run make ${flags} tails=true continuations=true ${test_target}
run make ${flags} tails=true continuations=true heapdump=true ${test_target}
run make ${flags} codegen-targets=all