--- old/src/hotspot/share/runtime/heapMonitoring.cpp 2017-09-22 13:33:07.101847893 -0700 +++ new/src/hotspot/share/runtime/heapMonitoring.cpp 2017-09-22 13:33:06.757849027 -0700 @@ -23,9 +23,11 @@ */ #include "precompiled.hpp" -#include "prims/forte.hpp" -#include "runtime/heapMonitoring.hpp" +#include "gc/shared/collectedHeap.hpp" +#include "memory/universe.hpp" +#include "runtime/heapMonitoring.hpp" +#include "runtime/vframe.hpp" static const int MaxStackDepth = 64; @@ -209,7 +211,8 @@ } static void reset_stack_trace_storage() { - delete internal_storage, internal_storage = NULL; + delete internal_storage; + internal_storage = NULL; } bool is_initialized() { @@ -407,8 +410,8 @@ for (int i = 0; i < len; i++) { StackTraceData &trace = _allocated_traces->at(i); oop value = trace.obj; - if ((value != NULL && Universe::heap()->is_in_reserved(value)) && - is_alive->do_object_b(value)) { + if (Universe::heap()->is_in_reserved(value) + && is_alive->do_object_b(value)) { // Update the oop to point to the new object if it is still alive. f->do_oop(&(trace.obj)); @@ -647,20 +650,6 @@ StackTraceStorage::storage()->accumulate_sample_rate(rate); } -// Called from the interpreter and C1 -void HeapMonitoring::object_alloc_unsized(oopDesc* o) { - JavaThread *thread = static_cast(Thread::current()); - object_alloc_do_sample(thread, o, o->size() << LogHeapWordSize); -} - -void HeapMonitoring::object_alloc(oopDesc* o, intx byte_size) { - JavaThread *thread = static_cast(Thread::current()); - assert(o->size() << LogHeapWordSize == static_cast(byte_size), - "Object size is incorrect."); - object_alloc_do_sample(thread, o, byte_size); -} - -// Called directly by C2 void HeapMonitoring::object_alloc_do_sample(Thread *t, oopDesc *o, intx byte_size) { #if defined(X86) || defined(PPC) JavaThread *thread = static_cast(t);