/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#include "precompiled.hpp"
#include "memory/allocation.inline.hpp"
#include "oops/oop.inline.hpp"
#include "runtime/handles.inline.hpp"
#ifdef TARGET_OS_FAMILY_linux
# include "os_linux.inline.hpp"
# include "thread_linux.inline.hpp"
#endif
#ifdef TARGET_OS_FAMILY_solaris
# include "os_solaris.inline.hpp"
# include "thread_solaris.inline.hpp"
#endif
#ifdef TARGET_OS_FAMILY_windows
# include "os_windows.inline.hpp"
# include "thread_windows.inline.hpp"
#endif
#ifdef TARGET_OS_FAMILY_bsd
# include "os_bsd.inline.hpp"
# include "thread_bsd.inline.hpp"
#endif
#ifdef ASSERT
return real_allocate_handle(obj);
}
} else {
}
}
#endif
// during GC phase 3, a handle may be a forward pointer that
// is not yet valid, so loosen the assertion
// assert((*bottom)->is_oop(), "handle should point to oop");
}
return handles_visited;
}
// Used for debugging handle allocation.
// First handle the current chunk. It is filled to the high water mark.
// Then handle all previous chunks. They are completely filled.
while(k != _chunk) {
k = k->next();
}
// The thread local handle areas should not get very large
#ifdef ASSERT
warning("%d: Visited in HandleMark : %d",
#else
#endif
}
}
// Save area
// Save current top
// Link this in the thread
thread->set_last_handle_mark(this);
}
HandleMark::~HandleMark() {
// Debug code to trace the number of handles allocated per mark/
#ifdef ASSERT
if (TraceHandleAllocation) {
if (c == NULL) {
} else {
while(c != NULL) {
c = c->next();
}
}
handles /= sizeof(void *); // Adjust for size of a handle
if (handles > HandleAllocationLimit) {
// Note: _nof_handlemarks is only set in debug mode
}
}
#endif
// Delete later chunks
// reset arena size before delete chunks. Otherwise, the total
// arena size could exceed total chunk size
} else {
}
// Roll back arena to saved top markers
#ifdef ASSERT
// clear out first chunk (to detect allocation bugs)
if (ZapVMHandleArea) {
}
#endif
// Unlink this from the thread
}
#ifdef ASSERT
}
NoHandleMark::~NoHandleMark() {
}
area->_no_handle_mark_nesting = 0;
}
}
#endif