From cae4b4900575bcaa2dcecc120854598fa99e1d57 Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Wed, 16 Jul 2014 14:18:42 -0600 Subject: [PATCH] fix heapdump=true build --- makefile | 3 ++- src/builtin.cpp | 5 +++-- src/heapdump.cpp | 5 ++--- test/ci.sh | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/makefile b/makefile index 6b72328f86..e0e85411a0 100755 --- a/makefile +++ b/makefile @@ -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) diff --git a/src/builtin.cpp b/src/builtin.cpp index ecf414e392..c9423d75d2 100644 --- a/src/builtin.cpp +++ b/src/builtin.cpp @@ -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(*arguments); + GcString* outputFile + = static_cast(reinterpret_cast(*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"); diff --git a/src/heapdump.cpp b/src/heapdump.cpp index f729c10ef5..ccc2bd2568 100644 --- a/src/heapdump.cpp +++ b/src/heapdump.cpp @@ -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(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); } } diff --git a/test/ci.sh b/test/ci.sh index 5399d78e15..686879227d 100755 --- a/test/ci.sh +++ b/test/ci.sh @@ -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