Merge pull request #431 from joshuawarner32/all-heapdump

Always include heapdump code
This commit is contained in:
Joel Dice 2015-05-04 08:01:03 -06:00
commit 3b9089e265
5 changed files with 6 additions and 26 deletions

View File

@ -91,7 +91,6 @@ certain flags described below, all of which are optional.
mode={debug,debug-fast,fast,small} \ mode={debug,debug-fast,fast,small} \
lzma=<lzma source directory> \ lzma=<lzma source directory> \
bootimage={true,false} \ bootimage={true,false} \
heapdump={true,false} \
tails={true,false} \ tails={true,false} \
continuations={true,false} \ continuations={true,false} \
use-clang={true,false} \ use-clang={true,false} \
@ -132,12 +131,6 @@ specify both build-arch=x86_64 and arch=x86_64 on 64-bit systems
where "uname -m" prints "i386". where "uname -m" prints "i386".
* _default:_ false * _default:_ false
* `heapdump` - if true, implement avian.Machine.dumpHeap(String),
which, when called, will generate a snapshot of the heap in a
simple, ad-hoc format for memory profiling purposes. See
heapdump.cpp for details.
* _default:_ false
* `tails` - if true, optimize each tail call by replacing the caller's * `tails` - if true, optimize each tail call by replacing the caller's
stack frame with the callee's. This convention ensures proper stack frame with the callee's. This convention ensures proper
tail recursion, suitable for languages such as Scheme. This tail recursion, suitable for languages such as Scheme. This

View File

@ -42,9 +42,6 @@ endif
ifeq ($(bootimage),true) ifeq ($(bootimage),true)
options := $(options)-bootimage options := $(options)-bootimage
endif endif
ifeq ($(heapdump),true)
options := $(options)-heapdump
endif
ifeq ($(tails),true) ifeq ($(tails),true)
options := $(options)-tails options := $(options)-tails
endif endif
@ -1240,7 +1237,8 @@ vm-sources = \
$(src)/classpath-$(classpath).cpp \ $(src)/classpath-$(classpath).cpp \
$(src)/builtin.cpp \ $(src)/builtin.cpp \
$(src)/jnienv.cpp \ $(src)/jnienv.cpp \
$(src)/process.cpp $(src)/process.cpp \
$(src)/heapdump.cpp
vm-asm-sources = $(src)/$(arch).$(asm-format) vm-asm-sources = $(src)/$(arch).$(asm-format)
@ -1310,11 +1308,7 @@ heapwalk-objects = \
unittest-objects = $(call cpp-objects,$(unittest-sources),$(unittest),$(build)/unittest) unittest-objects = $(call cpp-objects,$(unittest-sources),$(unittest),$(build)/unittest)
ifeq ($(heapdump),true) vm-heapwalk-objects = $(heapwalk-objects)
vm-sources += $(src)/heapdump.cpp
vm-heapwalk-objects = $(heapwalk-objects)
cflags += -DAVIAN_HEAPDUMP
endif
ifeq ($(tails),true) ifeq ($(tails),true)
cflags += -DAVIAN_TAILS cflags += -DAVIAN_TAILS

View File

@ -2551,7 +2551,6 @@ inline void NO_RETURN throw_(Thread* t, GcThrowable* e)
t->exception = e; t->exception = e;
if (objectClass(t, e) == type(t, GcOutOfMemoryError::Type)) { if (objectClass(t, e) == type(t, GcOutOfMemoryError::Type)) {
#ifdef AVIAN_HEAPDUMP
if (not t->m->dumpedHeapOnOOM) { if (not t->m->dumpedHeapOnOOM) {
t->m->dumpedHeapOnOOM = true; t->m->dumpedHeapOnOOM = true;
const char* path = findProperty(t, "avian.heap.dump"); const char* path = findProperty(t, "avian.heap.dump");
@ -2563,7 +2562,6 @@ inline void NO_RETURN throw_(Thread* t, GcThrowable* e)
} }
} }
} }
#endif // AVIAN_HEAPDUMP
if (AbortOnOutOfMemoryError) { if (AbortOnOutOfMemoryError) {
fprintf(stderr, "OutOfMemoryError\n"); fprintf(stderr, "OutOfMemoryError\n");

View File

@ -300,8 +300,6 @@ extern "C" AVIAN_EXPORT int64_t JNICALL
} }
} }
#ifdef AVIAN_HEAPDUMP
extern "C" AVIAN_EXPORT void JNICALL extern "C" AVIAN_EXPORT void JNICALL
Avian_avian_Machine_dumpHeap(Thread* t, object, uintptr_t* arguments) Avian_avian_Machine_dumpHeap(Thread* t, object, uintptr_t* arguments)
{ {
@ -326,8 +324,6 @@ extern "C" AVIAN_EXPORT void JNICALL
} }
} }
#endif // AVIAN_HEAPDUMP
extern "C" AVIAN_EXPORT int64_t JNICALL extern "C" AVIAN_EXPORT int64_t JNICALL
Avian_avian_Machine_tryNative(Thread* t, object, uintptr_t* arguments) Avian_avian_Machine_tryNative(Thread* t, object, uintptr_t* arguments)
{ {

View File

@ -3338,12 +3338,11 @@ void boot(Thread* t)
= makeMethod(t, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, bootCode); = makeMethod(t, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, bootCode);
PROTECT(t, bootMethod); PROTECT(t, bootMethod);
#include "type-java-initializations.cpp" # include "type-java-initializations.cpp"
# include "type-name-initializations.cpp"
//#ifdef AVIAN_HEAPDUMP
#include "type-name-initializations.cpp"
//#endif
} }
} }
class HeapClient : public Heap::Client { class HeapClient : public Heap::Client {