/*
* 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 "gc_implementation/g1/dirtyCardQueue.hpp"
#include "gc_implementation/g1/heapRegionRemSet.hpp"
#include "runtime/atomic.hpp"
#include "runtime/mutexLocker.hpp"
#include "runtime/safepoint.hpp"
#include "runtime/thread.hpp"
#include "utilities/workgroup.hpp"
#ifdef TARGET_OS_FAMILY_linux
# include "thread_linux.inline.hpp"
#endif
#ifdef TARGET_OS_FAMILY_solaris
# include "thread_solaris.inline.hpp"
#endif
#ifdef TARGET_OS_FAMILY_windows
# include "thread_windows.inline.hpp"
#endif
#ifdef TARGET_OS_FAMILY_bsd
# include "thread_bsd.inline.hpp"
#endif
bool consume,
bool res = true;
(int) worker_i);
}
return res;
}
void** buf,
bool consume,
int worker_i) {
// Set the entry to null, so we don't do it again (via the test
// above) if we reconsider this buffer.
}
}
return true;
}
#ifdef _MSC_VER // the use of 'this' below gets a warning, make it go away
#endif // _MSC_VER
_shared_dirty_card_queue(this, true /*perm*/),
{
_all_active = true;
}
// Determines how many mutator threads can process the buffers in parallel.
return os::processor_count();
}
int max_completed_queue,
}
t->dirty_card_queue().handle_zero_index();
}
}
guarantee(b, "Should not be interrupted.");
}
worker_i);
guarantee(b, "Should not be interrupted.");
}
// Used to determine if we had already claimed a par_id
// before entering this method.
bool already_claimed = false;
// We grab the current JavaThread.
// We get the the number of any par_id that this thread
// might have already claimed.
// If worker_i is not -1 then the thread has already claimed
// a par_id. We make note of it using the already_claimed value
if (worker_i != -1) {
already_claimed = true;
} else {
// Otherwise we need to claim a par id
// And store the par_id value in the thread
}
bool b = false;
if (worker_i != -1) {
// If we had not claimed an id before entering the method
// then we must release the id.
if (!already_claimed) {
// we release the id
// and set the claimed_id in the thread to -1
}
}
return b;
}
if ((int)_n_completed_buffers <= stop_at) {
_process_completed = false;
return NULL;
}
if (_completed_buffers_head != NULL) {
if (_completed_buffers_head == NULL)
}
return nd;
}
bool DirtyCardQueueSet::
int worker_i,
BufferNode* nd) {
bool b =
true, worker_i);
if (b) {
return true; // In normal case, go on to next buffer.
} else {
return false;
}
} else {
return false;
}
}
int worker_i,
int stop_at,
bool during_pause) {
return res;
}
int stop_at,
bool during_pause) {
}
bool b =
0, _sz, false);
guarantee(b, "Should not stop early.");
}
}
// Deallocates any completed log buffers
{
while (_completed_buffers_head != NULL) {
}
_n_completed_buffers = 0;
}
while (buffers_to_delete != NULL) {
}
}
clear();
// Since abandon is done only at safepoints, we can safely manipulate
// these queues.
t->dirty_card_queue().reset();
}
shared_dirty_card_queue()->reset();
}
// Iterate over all the threads, if we find a partial log add it to
// the global list of logs. Temporarily turn off the limit on the number
// of outstanding buffers.
// We must NULL out the unused entries, then enqueue.
}
dcq.reinitialize();
}
}
if (_shared_dirty_card_queue.size() != 0) {
}
// Restore the completed buffer queue limit.
}