< prev index next >
src/share/vm/gc/g1/g1ConcurrentMarkObjArrayProcessor.cpp
Print this page
rev 12666 : imported patch 8168467-use-taskentry-as-mark-stack-elem
rev 12667 : imported patch 8168467-kim-review
*** 1,7 ****
/*
! * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
* 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.
--- 1,7 ----
/*
! * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
* 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.
*** 24,45 ****
#include "precompiled.hpp"
#include "gc/g1/g1ConcurrentMark.inline.hpp"
#include "gc/g1/g1ConcurrentMarkObjArrayProcessor.inline.hpp"
- oop G1CMObjArrayProcessor::encode_array_slice(HeapWord* addr) {
- return oop((void*)((uintptr_t)addr | ArraySliceBit));
- }
-
- HeapWord* G1CMObjArrayProcessor::decode_array_slice(oop value) {
- assert(is_array_slice(value), "Given value " PTR_FORMAT " is not an array slice", p2i(value));
- return (HeapWord*)((uintptr_t)(void*)value & ~ArraySliceBit);
- }
-
void G1CMObjArrayProcessor::push_array_slice(HeapWord* what) {
! oop obj = encode_array_slice(what);
! _task->push(obj);
}
size_t G1CMObjArrayProcessor::process_array_slice(objArrayOop obj, HeapWord* start_from, size_t remaining) {
size_t words_to_scan = MIN2(remaining, ObjArrayMarkingStride);
--- 24,35 ----
#include "precompiled.hpp"
#include "gc/g1/g1ConcurrentMark.inline.hpp"
#include "gc/g1/g1ConcurrentMarkObjArrayProcessor.inline.hpp"
void G1CMObjArrayProcessor::push_array_slice(HeapWord* what) {
! _task->push(G1TaskQueueEntry::from_slice(what));
}
size_t G1CMObjArrayProcessor::process_array_slice(objArrayOop obj, HeapWord* start_from, size_t remaining) {
size_t words_to_scan = MIN2(remaining, ObjArrayMarkingStride);
*** 56,87 ****
assert(should_be_sliced(obj), "Must be an array object %d and large " SIZE_FORMAT, obj->is_objArray(), (size_t)obj->size());
return process_array_slice(objArrayOop(obj), (HeapWord*)obj, (size_t)objArrayOop(obj)->size());
}
! size_t G1CMObjArrayProcessor::process_slice(oop obj) {
! HeapWord* const decoded_address = decode_array_slice(obj);
// Find the start address of the objArrayOop.
// Shortcut the BOT access if the given address is from a humongous object. The BOT
// slide is fast enough for "smaller" objects in non-humongous regions, but is slower
// than directly using heap region table.
G1CollectedHeap* g1h = G1CollectedHeap::heap();
! HeapRegion* r = g1h->heap_region_containing(decoded_address);
HeapWord* const start_address = r->is_humongous() ?
r->humongous_start_region()->bottom() :
! g1h->block_start(decoded_address);
assert(oop(start_address)->is_objArray(), "Address " PTR_FORMAT " does not refer to an object array ", p2i(start_address));
! assert(start_address < decoded_address,
"Object start address " PTR_FORMAT " must be smaller than decoded address " PTR_FORMAT,
p2i(start_address),
! p2i(decoded_address));
objArrayOop objArray = objArrayOop(start_address);
! size_t already_scanned = decoded_address - start_address;
size_t remaining = objArray->size() - already_scanned;
! return process_array_slice(objArray, decoded_address, remaining);
}
--- 46,76 ----
assert(should_be_sliced(obj), "Must be an array object %d and large " SIZE_FORMAT, obj->is_objArray(), (size_t)obj->size());
return process_array_slice(objArrayOop(obj), (HeapWord*)obj, (size_t)objArrayOop(obj)->size());
}
! size_t G1CMObjArrayProcessor::process_slice(HeapWord* slice) {
// Find the start address of the objArrayOop.
// Shortcut the BOT access if the given address is from a humongous object. The BOT
// slide is fast enough for "smaller" objects in non-humongous regions, but is slower
// than directly using heap region table.
G1CollectedHeap* g1h = G1CollectedHeap::heap();
! HeapRegion* r = g1h->heap_region_containing(slice);
HeapWord* const start_address = r->is_humongous() ?
r->humongous_start_region()->bottom() :
! g1h->block_start(slice);
assert(oop(start_address)->is_objArray(), "Address " PTR_FORMAT " does not refer to an object array ", p2i(start_address));
! assert(start_address < slice,
"Object start address " PTR_FORMAT " must be smaller than decoded address " PTR_FORMAT,
p2i(start_address),
! p2i(slice));
objArrayOop objArray = objArrayOop(start_address);
! size_t already_scanned = slice - start_address;
size_t remaining = objArray->size() - already_scanned;
! return process_array_slice(objArray, slice, remaining);
}
< prev index next >