< prev index next >

src/share/vm/gc/parallel/parMarkBitMap.hpp

Print this page
rev 9846 : [mq]: par-scav-patch
rev 9847 : 8146987: Improve Parallel GC Full GC by caching results of live_words_in_range()
Summary: 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
Contributed-by: ray alex <sky1young@gmail.com>

*** 1,7 **** /* ! * Copyright (c) 2005, 2015, 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) 2005, 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.
*** 29,38 **** --- 29,39 ---- #include "oops/oop.hpp" #include "utilities/bitMap.hpp" class ParMarkBitMapClosure; class PSVirtualSpace; + class ParCompactionManager; class ParMarkBitMap: public CHeapObj<mtGC> { public: typedef BitMap::idx_t idx_t;
*** 122,132 **** // the caller must detect and account for any live words due to that object. // If a live object extends beyond the end of the range, only the words within // the range are included in the result. The end of the range must be a live object, // which is the case when updating pointers. This allows a branch to be removed // from inside the loop. ! size_t live_words_in_range(HeapWord* beg_addr, oop end_obj) const; inline HeapWord* region_start() const; inline HeapWord* region_end() const; inline size_t region_size() const; inline size_t size() const; --- 123,133 ---- // the caller must detect and account for any live words due to that object. // If a live object extends beyond the end of the range, only the words within // the range are included in the result. The end of the range must be a live object, // which is the case when updating pointers. This allows a branch to be removed // from inside the loop. ! size_t live_words_in_range(ParCompactionManager* cm, HeapWord* beg_addr, oop end_obj) const; inline HeapWord* region_start() const; inline HeapWord* region_end() const; inline size_t region_size() const; inline size_t size() const;
*** 165,174 **** --- 166,181 ---- inline void verify_bit(idx_t bit) const; inline void verify_addr(HeapWord* addr) const; #endif // #ifdef ASSERT private: + size_t live_words_in_range_helper(HeapWord* beg_addr, oop end_obj) const; + + bool is_live_words_in_range_in_cache(ParCompactionManager* cm, HeapWord* beg_addr) const; + size_t live_words_in_range_use_cache(ParCompactionManager* cm, HeapWord* beg_addr, oop end_obj) const; + void update_live_words_in_range_cache(ParCompactionManager* cm, HeapWord* beg_addr, oop end_obj, size_t result) const; + // Each bit in the bitmap represents one unit of 'object granularity.' Objects // are double-word aligned in 32-bit VMs, but not in 64-bit VMs, so the 32-bit // granularity is 2, 64-bit is 1. static inline size_t obj_granularity() { return size_t(MinObjAlignment); } static inline int obj_granularity_shift() { return LogMinObjAlignment; }
< prev index next >