/* * Copyright (c) 2015, 2020, 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. * * 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.
*/
inlinebool ZLiveMap::get(size_t index) const {
BitMap::idx_t segment = index_to_segment(index); return is_marked() && // Page is marked
is_segment_live(segment) && // Segment is marked
_bitmap.par_at(index, memory_order_relaxed); // Object is marked
}
inlinebool ZLiveMap::set(size_t index, bool finalizable, bool& inc_live) { if (!is_marked()) { // First object to be marked during this // cycle, reset marking information.
reset(index);
}
const BitMap::idx_t segment = index_to_segment(index); if (!is_segment_live(segment)) { // First object to be marked in this segment during // this cycle, reset segment bitmap.
reset_segment(segment);
}
// Get the size of the object before calling the closure, which // might overwrite the object in case we are relocating in-place. const size_t size = ZUtils::object_size(addr);
// Find next bit after this object const uintptr_t next_addr = align_up(addr + size, 1 << page_object_alignment_shift); const BitMap::idx_t next_index = ((next_addr - page_start) >> page_object_alignment_shift) * 2; if (next_index >= end_index) { // End of live map break;
}
index = _bitmap.get_next_one_offset(next_index, end_index);
}
}
inlinevoid ZLiveMap::iterate(ObjectClosure* cl, uintptr_t page_start, size_t page_object_alignment_shift) { if (is_marked()) { for (BitMap::idx_t segment = first_live_segment(); segment < nsegments; segment = next_live_segment(segment)) { // For each live segment
iterate_segment(cl, segment, page_start, page_object_alignment_shift);
}
}
}
#endif// SHARE_GC_Z_ZLIVEMAP_INLINE_HPP
Messung V0.5
¤ Dauer der Verarbeitung: 0.16 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.