2008-06-05 15:57:56 -07:00
|
|
|
/*
|
2015-04-15 16:37:57 -04:00
|
|
|
* Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
|
2008-06-05 15:57:56 -07:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
|
|
*
|
|
|
|
* This code is free software; you can redistribute it and/or modify it
|
|
|
|
* 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.
|
|
|
|
*
|
2010-05-27 19:08:38 -07:00
|
|
|
* 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.
|
2008-06-05 15:57:56 -07:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2010-11-23 13:22:55 -08:00
|
|
|
#include "precompiled.hpp"
|
2011-01-19 09:35:17 -05:00
|
|
|
#include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
|
2010-11-23 13:22:55 -08:00
|
|
|
#include "gc_implementation/g1/satbQueue.hpp"
|
2015-04-02 16:08:41 +02:00
|
|
|
#include "gc_interface/collectedHeap.hpp"
|
2010-11-23 13:22:55 -08:00
|
|
|
#include "memory/allocation.inline.hpp"
|
6964458: Reimplement class meta-data storage to use native memory
Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Co-authored-by: Tom Rodriguez <tom.rodriguez@oracle.com>
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
2012-09-01 13:25:18 -04:00
|
|
|
#include "oops/oop.inline.hpp"
|
2010-11-23 13:22:55 -08:00
|
|
|
#include "runtime/mutexLocker.hpp"
|
2015-05-01 17:38:12 -04:00
|
|
|
#include "runtime/safepoint.hpp"
|
2010-11-23 13:22:55 -08:00
|
|
|
#include "runtime/thread.hpp"
|
2011-09-22 10:57:37 -07:00
|
|
|
#include "runtime/vmThread.hpp"
|
2008-06-05 15:57:56 -07:00
|
|
|
|
2012-01-10 18:58:13 -05:00
|
|
|
void ObjPtrQueue::flush() {
|
2015-04-15 16:37:57 -04:00
|
|
|
// Filter now to possibly save work later. If filtering empties the
|
|
|
|
// buffer then flush_impl can deallocate the buffer.
|
2012-01-10 18:58:13 -05:00
|
|
|
filter();
|
2014-07-31 11:10:02 +02:00
|
|
|
flush_impl();
|
2012-01-10 18:58:13 -05:00
|
|
|
}
|
|
|
|
|
2015-04-15 16:37:57 -04:00
|
|
|
// Return true if a SATB buffer entry refers to an object that
|
|
|
|
// requires marking.
|
2011-01-19 09:35:17 -05:00
|
|
|
//
|
2015-04-15 16:37:57 -04:00
|
|
|
// The entry must point into the G1 heap. In particular, it must not
|
|
|
|
// be a NULL pointer. NULL pointers are pre-filtered and never
|
|
|
|
// inserted into a SATB buffer.
|
2011-01-19 09:35:17 -05:00
|
|
|
//
|
2015-04-15 16:37:57 -04:00
|
|
|
// An entry that is below the NTAMS pointer for the containing heap
|
|
|
|
// region requires marking. Such an entry must point to a valid object.
|
|
|
|
//
|
|
|
|
// An entry that is at least the NTAMS pointer for the containing heap
|
|
|
|
// region might be any of the following, none of which should be marked.
|
|
|
|
//
|
|
|
|
// * A reference to an object allocated since marking started.
|
|
|
|
// According to SATB, such objects are implicitly kept live and do
|
|
|
|
// not need to be dealt with via SATB buffer processing.
|
|
|
|
//
|
|
|
|
// * A reference to a young generation object. Young objects are
|
|
|
|
// handled separately and are not marked by concurrent marking.
|
|
|
|
//
|
|
|
|
// * A stale reference to a young generation object. If a young
|
|
|
|
// generation object reference is recorded and not filtered out
|
|
|
|
// before being moved by a young collection, the reference becomes
|
|
|
|
// stale.
|
|
|
|
//
|
|
|
|
// * A stale reference to an eagerly reclaimed humongous object. If a
|
|
|
|
// humongous object is recorded and then reclaimed, the reference
|
|
|
|
// becomes stale.
|
|
|
|
//
|
|
|
|
// The stale reference cases are implicitly handled by the NTAMS
|
|
|
|
// comparison. Because of the possibility of stale references, buffer
|
|
|
|
// processing must be somewhat circumspect and not assume entries
|
|
|
|
// in an unfiltered buffer refer to valid objects.
|
|
|
|
|
|
|
|
inline bool requires_marking(const void* entry, G1CollectedHeap* heap) {
|
|
|
|
// Includes rejection of NULL pointers.
|
|
|
|
assert(heap->is_in_reserved(entry),
|
|
|
|
err_msg("Non-heap pointer in SATB buffer: " PTR_FORMAT, p2i(entry)));
|
|
|
|
|
|
|
|
HeapRegion* region = heap->heap_region_containing_raw(entry);
|
|
|
|
assert(region != NULL, err_msg("No region for " PTR_FORMAT, p2i(entry)));
|
|
|
|
if (entry >= region->next_top_at_mark_start()) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
assert(((oop)entry)->is_oop(true /* ignore mark word */),
|
|
|
|
err_msg("Invalid oop in SATB buffer: " PTR_FORMAT, p2i(entry)));
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
// This method removes entries from a SATB buffer that will not be
|
|
|
|
// useful to the concurrent marking threads. Entries are retained if
|
|
|
|
// they require marking and are not already marked. Retained entries
|
|
|
|
// are compacted toward the top of the buffer.
|
2011-01-19 09:35:17 -05:00
|
|
|
|
2012-01-10 18:58:13 -05:00
|
|
|
void ObjPtrQueue::filter() {
|
2011-01-19 09:35:17 -05:00
|
|
|
G1CollectedHeap* g1h = G1CollectedHeap::heap();
|
|
|
|
void** buf = _buf;
|
|
|
|
size_t sz = _sz;
|
|
|
|
|
2012-01-10 18:58:13 -05:00
|
|
|
if (buf == NULL) {
|
|
|
|
// nothing to do
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2011-01-19 09:35:17 -05:00
|
|
|
// Used for sanity checking at the end of the loop.
|
|
|
|
debug_only(size_t entries = 0; size_t retained = 0;)
|
|
|
|
|
|
|
|
size_t i = sz;
|
|
|
|
size_t new_index = sz;
|
|
|
|
|
|
|
|
while (i > _index) {
|
|
|
|
assert(i > 0, "we should have at least one more entry to process");
|
|
|
|
i -= oopSize;
|
|
|
|
debug_only(entries += 1;)
|
2015-04-15 16:37:57 -04:00
|
|
|
void** p = &buf[byte_index_to_index((int) i)];
|
|
|
|
void* entry = *p;
|
2011-01-19 09:35:17 -05:00
|
|
|
// NULL the entry so that unused parts of the buffer contain NULLs
|
|
|
|
// at the end. If we are going to retain it we will copy it to its
|
|
|
|
// final place. If we have retained all entries we have visited so
|
|
|
|
// far, we'll just end up copying it to the same place.
|
|
|
|
*p = NULL;
|
|
|
|
|
2015-04-15 16:37:57 -04:00
|
|
|
if (requires_marking(entry, g1h) && !g1h->isMarkedNext((oop)entry)) {
|
2011-01-19 09:35:17 -05:00
|
|
|
assert(new_index > 0, "we should not have already filled up the buffer");
|
|
|
|
new_index -= oopSize;
|
|
|
|
assert(new_index >= i,
|
2013-12-10 15:11:02 +01:00
|
|
|
"new_index should never be below i, as we always compact 'up'");
|
2015-04-15 16:37:57 -04:00
|
|
|
void** new_p = &buf[byte_index_to_index((int) new_index)];
|
2011-01-19 09:35:17 -05:00
|
|
|
assert(new_p >= p, "the destination location should never be below "
|
|
|
|
"the source as we always compact 'up'");
|
|
|
|
assert(*new_p == NULL,
|
|
|
|
"we should have already cleared the destination location");
|
2015-04-15 16:37:57 -04:00
|
|
|
*new_p = entry;
|
2011-01-19 09:35:17 -05:00
|
|
|
debug_only(retained += 1;)
|
|
|
|
}
|
|
|
|
}
|
2012-01-10 18:58:13 -05:00
|
|
|
|
|
|
|
#ifdef ASSERT
|
2011-01-19 09:35:17 -05:00
|
|
|
size_t entries_calc = (sz - _index) / oopSize;
|
|
|
|
assert(entries == entries_calc, "the number of entries we counted "
|
|
|
|
"should match the number of entries we calculated");
|
|
|
|
size_t retained_calc = (sz - new_index) / oopSize;
|
|
|
|
assert(retained == retained_calc, "the number of retained entries we counted "
|
|
|
|
"should match the number of retained entries we calculated");
|
2012-01-10 18:58:13 -05:00
|
|
|
#endif // ASSERT
|
|
|
|
|
2011-01-19 09:35:17 -05:00
|
|
|
_index = new_index;
|
2012-01-10 18:58:13 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// This method will first apply the above filtering to the buffer. If
|
|
|
|
// post-filtering a large enough chunk of the buffer has been cleared
|
|
|
|
// we can re-use the buffer (instead of enqueueing it) and we can just
|
|
|
|
// allow the mutator to carry on executing using the same buffer
|
|
|
|
// instead of replacing it.
|
|
|
|
|
|
|
|
bool ObjPtrQueue::should_enqueue_buffer() {
|
|
|
|
assert(_lock == NULL || _lock->owned_by_self(),
|
|
|
|
"we should have taken the lock before calling this");
|
2011-01-19 09:35:17 -05:00
|
|
|
|
2015-05-01 17:38:12 -04:00
|
|
|
// If G1SATBBufferEnqueueingThresholdPercent == 0 we could skip filtering.
|
2012-01-10 18:58:13 -05:00
|
|
|
|
|
|
|
// This method should only be called if there is a non-NULL buffer
|
|
|
|
// that is full.
|
|
|
|
assert(_index == 0, "pre-condition");
|
|
|
|
assert(_buf != NULL, "pre-condition");
|
|
|
|
|
|
|
|
filter();
|
|
|
|
|
|
|
|
size_t sz = _sz;
|
|
|
|
size_t all_entries = sz / oopSize;
|
|
|
|
size_t retained_entries = (sz - _index) / oopSize;
|
|
|
|
size_t perc = retained_entries * 100 / all_entries;
|
|
|
|
bool should_enqueue = perc > (size_t) G1SATBBufferEnqueueingThresholdPercent;
|
2011-01-19 09:35:17 -05:00
|
|
|
return should_enqueue;
|
|
|
|
}
|
|
|
|
|
2015-05-01 17:38:12 -04:00
|
|
|
void ObjPtrQueue::apply_closure_and_empty(SATBBufferClosure* cl) {
|
|
|
|
assert(SafepointSynchronize::is_at_safepoint(),
|
|
|
|
"SATB queues must only be processed at safepoints");
|
2008-06-05 15:57:56 -07:00
|
|
|
if (_buf != NULL) {
|
2015-05-01 17:38:12 -04:00
|
|
|
assert(_index % sizeof(void*) == 0, "invariant");
|
|
|
|
assert(_sz % sizeof(void*) == 0, "invariant");
|
|
|
|
assert(_index <= _sz, "invariant");
|
|
|
|
cl->do_buffer(_buf + byte_index_to_index((int)_index),
|
|
|
|
byte_index_to_index((int)(_sz - _index)));
|
2008-06-05 15:57:56 -07:00
|
|
|
_index = _sz;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-01-10 18:58:13 -05:00
|
|
|
#ifndef PRODUCT
|
|
|
|
// Helpful for debugging
|
|
|
|
|
|
|
|
void ObjPtrQueue::print(const char* name) {
|
|
|
|
print(name, _buf, _index, _sz);
|
|
|
|
}
|
|
|
|
|
|
|
|
void ObjPtrQueue::print(const char* name,
|
|
|
|
void** buf, size_t index, size_t sz) {
|
|
|
|
gclog_or_tty->print_cr(" SATB BUFFER [%s] buf: "PTR_FORMAT" "
|
|
|
|
"index: "SIZE_FORMAT" sz: "SIZE_FORMAT,
|
2015-03-27 15:03:44 +01:00
|
|
|
name, p2i(buf), index, sz);
|
2012-01-10 18:58:13 -05:00
|
|
|
}
|
|
|
|
#endif // PRODUCT
|
|
|
|
|
2008-06-05 15:57:56 -07:00
|
|
|
#ifdef _MSC_VER // the use of 'this' below gets a warning, make it go away
|
|
|
|
#pragma warning( disable:4355 ) // 'this' : used in base member initializer list
|
|
|
|
#endif // _MSC_VER
|
|
|
|
|
|
|
|
SATBMarkQueueSet::SATBMarkQueueSet() :
|
2015-04-17 13:49:04 -04:00
|
|
|
PtrQueueSet(),
|
2012-01-10 18:58:13 -05:00
|
|
|
_shared_satb_queue(this, true /*perm*/) { }
|
2008-06-05 15:57:56 -07:00
|
|
|
|
|
|
|
void SATBMarkQueueSet::initialize(Monitor* cbl_mon, Mutex* fl_lock,
|
2009-12-16 15:12:51 -08:00
|
|
|
int process_completed_threshold,
|
2008-06-05 15:57:56 -07:00
|
|
|
Mutex* lock) {
|
2009-12-16 15:12:51 -08:00
|
|
|
PtrQueueSet::initialize(cbl_mon, fl_lock, process_completed_threshold, -1);
|
2008-06-05 15:57:56 -07:00
|
|
|
_shared_satb_queue.set_lock(lock);
|
|
|
|
}
|
|
|
|
|
|
|
|
void SATBMarkQueueSet::handle_zero_index_for_thread(JavaThread* t) {
|
|
|
|
t->satb_mark_queue().handle_zero_index();
|
|
|
|
}
|
|
|
|
|
2010-03-18 12:14:59 -04:00
|
|
|
#ifdef ASSERT
|
2014-01-10 09:54:25 +01:00
|
|
|
void SATBMarkQueueSet::dump_active_states(bool expected_active) {
|
|
|
|
gclog_or_tty->print_cr("Expected SATB active state: %s",
|
|
|
|
expected_active ? "ACTIVE" : "INACTIVE");
|
|
|
|
gclog_or_tty->print_cr("Actual SATB active states:");
|
|
|
|
gclog_or_tty->print_cr(" Queue set: %s", is_active() ? "ACTIVE" : "INACTIVE");
|
|
|
|
for (JavaThread* t = Threads::first(); t; t = t->next()) {
|
|
|
|
gclog_or_tty->print_cr(" Thread \"%s\" queue: %s", t->name(),
|
|
|
|
t->satb_mark_queue().is_active() ? "ACTIVE" : "INACTIVE");
|
2010-03-18 12:14:59 -04:00
|
|
|
}
|
2014-01-10 09:54:25 +01:00
|
|
|
gclog_or_tty->print_cr(" Shared queue: %s",
|
|
|
|
shared_satb_queue()->is_active() ? "ACTIVE" : "INACTIVE");
|
2010-03-18 12:14:59 -04:00
|
|
|
}
|
|
|
|
|
2014-01-10 09:54:25 +01:00
|
|
|
void SATBMarkQueueSet::verify_active_states(bool expected_active) {
|
|
|
|
// Verify queue set state
|
|
|
|
if (is_active() != expected_active) {
|
|
|
|
dump_active_states(expected_active);
|
|
|
|
guarantee(false, "SATB queue set has an unexpected active state");
|
|
|
|
}
|
2010-03-18 12:14:59 -04:00
|
|
|
|
2014-01-10 09:54:25 +01:00
|
|
|
// Verify thread queue states
|
|
|
|
for (JavaThread* t = Threads::first(); t; t = t->next()) {
|
|
|
|
if (t->satb_mark_queue().is_active() != expected_active) {
|
|
|
|
dump_active_states(expected_active);
|
|
|
|
guarantee(false, "Thread SATB queue has an unexpected active state");
|
|
|
|
}
|
2010-03-18 12:14:59 -04:00
|
|
|
}
|
2014-01-10 09:54:25 +01:00
|
|
|
|
|
|
|
// Verify shared queue state
|
|
|
|
if (shared_satb_queue()->is_active() != expected_active) {
|
|
|
|
dump_active_states(expected_active);
|
|
|
|
guarantee(false, "Shared SATB queue has an unexpected active state");
|
|
|
|
}
|
|
|
|
}
|
2010-03-18 12:14:59 -04:00
|
|
|
#endif // ASSERT
|
|
|
|
|
2014-01-10 09:54:25 +01:00
|
|
|
void SATBMarkQueueSet::set_active_all_threads(bool active, bool expected_active) {
|
|
|
|
assert(SafepointSynchronize::is_at_safepoint(), "Must be at safepoint.");
|
2010-03-18 12:14:59 -04:00
|
|
|
#ifdef ASSERT
|
2014-01-10 09:54:25 +01:00
|
|
|
verify_active_states(expected_active);
|
2010-03-18 12:14:59 -04:00
|
|
|
#endif // ASSERT
|
2014-01-10 09:54:25 +01:00
|
|
|
_all_active = active;
|
|
|
|
for (JavaThread* t = Threads::first(); t; t = t->next()) {
|
|
|
|
t->satb_mark_queue().set_active(active);
|
2008-06-05 15:57:56 -07:00
|
|
|
}
|
2014-01-10 09:54:25 +01:00
|
|
|
shared_satb_queue()->set_active(active);
|
2008-06-05 15:57:56 -07:00
|
|
|
}
|
|
|
|
|
2012-01-10 18:58:13 -05:00
|
|
|
void SATBMarkQueueSet::filter_thread_buffers() {
|
|
|
|
for(JavaThread* t = Threads::first(); t; t = t->next()) {
|
|
|
|
t->satb_mark_queue().filter();
|
|
|
|
}
|
|
|
|
shared_satb_queue()->filter();
|
|
|
|
}
|
|
|
|
|
2015-05-01 17:38:12 -04:00
|
|
|
bool SATBMarkQueueSet::apply_closure_to_completed_buffer(SATBBufferClosure* cl) {
|
2009-12-16 15:12:51 -08:00
|
|
|
BufferNode* nd = NULL;
|
2008-06-05 15:57:56 -07:00
|
|
|
{
|
|
|
|
MutexLockerEx x(_cbl_mon, Mutex::_no_safepoint_check_flag);
|
|
|
|
if (_completed_buffers_head != NULL) {
|
|
|
|
nd = _completed_buffers_head;
|
2009-12-16 15:12:51 -08:00
|
|
|
_completed_buffers_head = nd->next();
|
2008-06-05 15:57:56 -07:00
|
|
|
if (_completed_buffers_head == NULL) _completed_buffers_tail = NULL;
|
|
|
|
_n_completed_buffers--;
|
|
|
|
if (_n_completed_buffers == 0) _process_completed = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (nd != NULL) {
|
2009-12-16 15:12:51 -08:00
|
|
|
void **buf = BufferNode::make_buffer_from_node(nd);
|
2015-05-01 17:38:12 -04:00
|
|
|
// Skip over NULL entries at beginning (e.g. push end) of buffer.
|
|
|
|
// Filtering can result in non-full completed buffers; see
|
|
|
|
// should_enqueue_buffer.
|
|
|
|
assert(_sz % sizeof(void*) == 0, "invariant");
|
|
|
|
size_t limit = ObjPtrQueue::byte_index_to_index((int)_sz);
|
|
|
|
for (size_t i = 0; i < limit; ++i) {
|
|
|
|
if (buf[i] != NULL) {
|
|
|
|
// Found the end of the block of NULLs; process the remainder.
|
|
|
|
cl->do_buffer(buf + i, limit - i);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2009-12-16 15:12:51 -08:00
|
|
|
deallocate_buffer(buf);
|
2008-06-05 15:57:56 -07:00
|
|
|
return true;
|
|
|
|
} else {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-01-10 18:58:13 -05:00
|
|
|
#ifndef PRODUCT
|
|
|
|
// Helpful for debugging
|
|
|
|
|
|
|
|
#define SATB_PRINTER_BUFFER_SIZE 256
|
|
|
|
|
|
|
|
void SATBMarkQueueSet::print_all(const char* msg) {
|
|
|
|
char buffer[SATB_PRINTER_BUFFER_SIZE];
|
|
|
|
assert(SafepointSynchronize::is_at_safepoint(), "Must be at safepoint.");
|
|
|
|
|
|
|
|
gclog_or_tty->cr();
|
|
|
|
gclog_or_tty->print_cr("SATB BUFFERS [%s]", msg);
|
|
|
|
|
|
|
|
BufferNode* nd = _completed_buffers_head;
|
|
|
|
int i = 0;
|
|
|
|
while (nd != NULL) {
|
|
|
|
void** buf = BufferNode::make_buffer_from_node(nd);
|
|
|
|
jio_snprintf(buffer, SATB_PRINTER_BUFFER_SIZE, "Enqueued: %d", i);
|
|
|
|
ObjPtrQueue::print(buffer, buf, 0, _sz);
|
|
|
|
nd = nd->next();
|
|
|
|
i += 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (JavaThread* t = Threads::first(); t; t = t->next()) {
|
|
|
|
jio_snprintf(buffer, SATB_PRINTER_BUFFER_SIZE, "Thread: %s", t->name());
|
|
|
|
t->satb_mark_queue().print(buffer);
|
|
|
|
}
|
|
|
|
|
|
|
|
shared_satb_queue()->print("Shared");
|
|
|
|
|
|
|
|
gclog_or_tty->cr();
|
|
|
|
}
|
|
|
|
#endif // PRODUCT
|
|
|
|
|
2008-06-05 15:57:56 -07:00
|
|
|
void SATBMarkQueueSet::abandon_partial_marking() {
|
2009-12-16 15:12:51 -08:00
|
|
|
BufferNode* buffers_to_delete = NULL;
|
2008-06-05 15:57:56 -07:00
|
|
|
{
|
|
|
|
MutexLockerEx x(_cbl_mon, Mutex::_no_safepoint_check_flag);
|
|
|
|
while (_completed_buffers_head != NULL) {
|
2009-12-16 15:12:51 -08:00
|
|
|
BufferNode* nd = _completed_buffers_head;
|
|
|
|
_completed_buffers_head = nd->next();
|
|
|
|
nd->set_next(buffers_to_delete);
|
2008-06-05 15:57:56 -07:00
|
|
|
buffers_to_delete = nd;
|
|
|
|
}
|
|
|
|
_completed_buffers_tail = NULL;
|
|
|
|
_n_completed_buffers = 0;
|
2009-07-14 15:40:39 -07:00
|
|
|
DEBUG_ONLY(assert_completed_buffer_list_len_correct_locked());
|
2008-06-05 15:57:56 -07:00
|
|
|
}
|
|
|
|
while (buffers_to_delete != NULL) {
|
2009-12-16 15:12:51 -08:00
|
|
|
BufferNode* nd = buffers_to_delete;
|
|
|
|
buffers_to_delete = nd->next();
|
|
|
|
deallocate_buffer(BufferNode::make_buffer_from_node(nd));
|
2008-06-05 15:57:56 -07:00
|
|
|
}
|
|
|
|
assert(SafepointSynchronize::is_at_safepoint(), "Must be at safepoint.");
|
|
|
|
// So we can safely manipulate these queues.
|
|
|
|
for (JavaThread* t = Threads::first(); t; t = t->next()) {
|
|
|
|
t->satb_mark_queue().reset();
|
|
|
|
}
|
2012-01-10 18:58:13 -05:00
|
|
|
shared_satb_queue()->reset();
|
2008-06-05 15:57:56 -07:00
|
|
|
}
|