8146987: Improve Parallel GC Full GC by caching results of live_words_in_range()

A large part of time in the parallel scavenge collector is spent finding out the amount of live words within memory ranges to find out where to move an object to. Try to incrementally calculate this value.

Reviewed-by: tschatzl, mgerdin, jmasa
This commit is contained in:
Ray Alex 2016-01-28 13:30:12 +01:00 committed by Thomas Schatzl
parent ce491c9057
commit 4f42f17d9e
17 changed files with 180 additions and 81 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* 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
@ -42,13 +42,13 @@ inline bool PSParallelCompact::mark_obj(oop obj) {
}
template <class T>
inline void PSParallelCompact::adjust_pointer(T* p) {
inline void PSParallelCompact::adjust_pointer(T* p, ParCompactionManager* cm) {
T heap_oop = oopDesc::load_heap_oop(p);
if (!oopDesc::is_null(heap_oop)) {
oop obj = oopDesc::decode_heap_oop_not_null(heap_oop);
assert(ParallelScavengeHeap::heap()->is_in(obj), "should be in heap");
oop new_obj = (oop)summary_data().calc_new_pointer(obj);
oop new_obj = (oop)summary_data().calc_new_pointer(obj, cm);
assert(new_obj != NULL, // is forwarding ptr?
"should be forwarded");
// Just always do the update unconditionally?
@ -62,7 +62,7 @@ inline void PSParallelCompact::adjust_pointer(T* p) {
template <typename T>
void PSParallelCompact::AdjustPointerClosure::do_oop_nv(T* p) {
adjust_pointer(p);
adjust_pointer(p, _cm);
}
inline void PSParallelCompact::AdjustPointerClosure::do_oop(oop* p) { do_oop_nv(p); }