1 /*
2 * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_GC_CMS_CONCURRENTMARKSWEEPGENERATION_INLINE_HPP
26 #define SHARE_VM_GC_CMS_CONCURRENTMARKSWEEPGENERATION_INLINE_HPP
27
28 #include "gc/cms/cmsLockVerifier.hpp"
29 #include "gc/cms/compactibleFreeListSpace.hpp"
30 #include "gc/cms/concurrentMarkSweepGeneration.hpp"
31 #include "gc/cms/concurrentMarkSweepThread.hpp"
32 #include "gc/cms/parNewGeneration.hpp"
33 #include "gc/shared/gcUtil.hpp"
34 #include "gc/shared/genCollectedHeap.hpp"
35
36 inline void CMSBitMap::clear_all() {
37 assert_locked();
38 // CMS bitmaps are usually cover large memory regions
39 _bm.clear_large();
40 return;
41 }
42
43 inline size_t CMSBitMap::heapWordToOffset(HeapWord* addr) const {
44 return (pointer_delta(addr, _bmStartWord)) >> _shifter;
45 }
46
47 inline HeapWord* CMSBitMap::offsetToHeapWord(size_t offset) const {
48 return _bmStartWord + (offset << _shifter);
49 }
50
51 inline size_t CMSBitMap::heapWordDiffToOffsetDiff(size_t diff) const {
52 assert((diff & ((1 << _shifter) - 1)) == 0, "argument check");
53 return diff >> _shifter;
54 }
|
1 /*
2 * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_GC_CMS_CONCURRENTMARKSWEEPGENERATION_INLINE_HPP
26 #define SHARE_VM_GC_CMS_CONCURRENTMARKSWEEPGENERATION_INLINE_HPP
27
28 #include "gc/cms/cmsLockVerifier.hpp"
29 #include "gc/cms/compactibleFreeListSpace.hpp"
30 #include "gc/cms/concurrentMarkSweepGeneration.hpp"
31 #include "gc/cms/concurrentMarkSweepThread.hpp"
32 #include "gc/cms/parNewGeneration.hpp"
33 #include "gc/shared/gcUtil.hpp"
34 #include "gc/shared/genCollectedHeap.hpp"
35 #include "utilities/bitMap.inline.hpp"
36
37 inline void CMSBitMap::clear_all() {
38 assert_locked();
39 // CMS bitmaps are usually cover large memory regions
40 _bm.clear_large();
41 return;
42 }
43
44 inline size_t CMSBitMap::heapWordToOffset(HeapWord* addr) const {
45 return (pointer_delta(addr, _bmStartWord)) >> _shifter;
46 }
47
48 inline HeapWord* CMSBitMap::offsetToHeapWord(size_t offset) const {
49 return _bmStartWord + (offset << _shifter);
50 }
51
52 inline size_t CMSBitMap::heapWordDiffToOffsetDiff(size_t diff) const {
53 assert((diff & ((1 << _shifter) - 1)) == 0, "argument check");
54 return diff >> _shifter;
55 }
|