Tue, 23 Nov 2010 13:22:55 -0800
6989984: Use standard include model for Hospot
Summary: Replaced MakeDeps and the includeDB files with more standardized solutions.
Reviewed-by: coleenp, kvn, kamg
ysr@777 | 1 | /* |
stefank@2314 | 2 | * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. |
ysr@777 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
ysr@777 | 4 | * |
ysr@777 | 5 | * This code is free software; you can redistribute it and/or modify it |
ysr@777 | 6 | * under the terms of the GNU General Public License version 2 only, as |
ysr@777 | 7 | * published by the Free Software Foundation. |
ysr@777 | 8 | * |
ysr@777 | 9 | * This code is distributed in the hope that it will be useful, but WITHOUT |
ysr@777 | 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
ysr@777 | 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
ysr@777 | 12 | * version 2 for more details (a copy is included in the LICENSE file that |
ysr@777 | 13 | * accompanied this code). |
ysr@777 | 14 | * |
ysr@777 | 15 | * You should have received a copy of the GNU General Public License version |
ysr@777 | 16 | * 2 along with this work; if not, write to the Free Software Foundation, |
ysr@777 | 17 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
ysr@777 | 18 | * |
trims@1907 | 19 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
trims@1907 | 20 | * or visit www.oracle.com if you need additional information or have any |
trims@1907 | 21 | * questions. |
ysr@777 | 22 | * |
ysr@777 | 23 | */ |
ysr@777 | 24 | |
stefank@2314 | 25 | #ifndef SHARE_VM_GC_IMPLEMENTATION_G1_G1COLLECTEDHEAP_INLINE_HPP |
stefank@2314 | 26 | #define SHARE_VM_GC_IMPLEMENTATION_G1_G1COLLECTEDHEAP_INLINE_HPP |
stefank@2314 | 27 | |
stefank@2314 | 28 | #include "gc_implementation/g1/concurrentMark.hpp" |
stefank@2314 | 29 | #include "gc_implementation/g1/g1CollectedHeap.hpp" |
stefank@2314 | 30 | #include "gc_implementation/g1/heapRegionSeq.hpp" |
stefank@2314 | 31 | #include "utilities/taskqueue.hpp" |
stefank@2314 | 32 | |
ysr@777 | 33 | // Inline functions for G1CollectedHeap |
ysr@777 | 34 | |
ysr@777 | 35 | inline HeapRegion* |
ysr@777 | 36 | G1CollectedHeap::heap_region_containing(const void* addr) const { |
ysr@777 | 37 | HeapRegion* hr = _hrs->addr_to_region(addr); |
ysr@777 | 38 | // hr can be null if addr in perm_gen |
ysr@777 | 39 | if (hr != NULL && hr->continuesHumongous()) { |
ysr@777 | 40 | hr = hr->humongous_start_region(); |
ysr@777 | 41 | } |
ysr@777 | 42 | return hr; |
ysr@777 | 43 | } |
ysr@777 | 44 | |
ysr@777 | 45 | inline HeapRegion* |
ysr@777 | 46 | G1CollectedHeap::heap_region_containing_raw(const void* addr) const { |
tonyp@961 | 47 | assert(_g1_reserved.contains(addr), "invariant"); |
johnc@1187 | 48 | size_t index = pointer_delta(addr, _g1_reserved.start(), 1) |
johnc@1187 | 49 | >> HeapRegion::LogOfHRGrainBytes; |
johnc@1187 | 50 | |
tonyp@961 | 51 | HeapRegion* res = _hrs->at(index); |
tonyp@961 | 52 | assert(res == _hrs->addr_to_region(addr), "sanity"); |
ysr@777 | 53 | return res; |
ysr@777 | 54 | } |
ysr@777 | 55 | |
ysr@777 | 56 | inline bool G1CollectedHeap::obj_in_cs(oop obj) { |
ysr@777 | 57 | HeapRegion* r = _hrs->addr_to_region(obj); |
ysr@777 | 58 | return r != NULL && r->in_collection_set(); |
ysr@777 | 59 | } |
ysr@777 | 60 | |
ysr@777 | 61 | inline HeapWord* G1CollectedHeap::attempt_allocation(size_t word_size, |
ysr@777 | 62 | bool permit_collection_pause) { |
ysr@777 | 63 | HeapWord* res = NULL; |
ysr@777 | 64 | |
ysr@777 | 65 | assert( SafepointSynchronize::is_at_safepoint() || |
ysr@777 | 66 | Heap_lock->owned_by_self(), "pre-condition of the call" ); |
ysr@777 | 67 | |
tonyp@2073 | 68 | // All humongous allocation requests should go through the slow path in |
tonyp@2073 | 69 | // attempt_allocation_slow(). |
tonyp@2073 | 70 | if (!isHumongous(word_size) && _cur_alloc_region != NULL) { |
ysr@777 | 71 | // If this allocation causes a region to become non empty, |
ysr@777 | 72 | // then we need to update our free_regions count. |
ysr@777 | 73 | |
ysr@777 | 74 | if (_cur_alloc_region->is_empty()) { |
ysr@777 | 75 | res = _cur_alloc_region->allocate(word_size); |
ysr@777 | 76 | if (res != NULL) |
ysr@777 | 77 | _free_regions--; |
ysr@777 | 78 | } else { |
ysr@777 | 79 | res = _cur_alloc_region->allocate(word_size); |
ysr@777 | 80 | } |
tonyp@2073 | 81 | |
tonyp@2073 | 82 | if (res != NULL) { |
tonyp@2073 | 83 | if (!SafepointSynchronize::is_at_safepoint()) { |
tonyp@2073 | 84 | assert( Heap_lock->owned_by_self(), "invariant" ); |
tonyp@2073 | 85 | Heap_lock->unlock(); |
tonyp@2073 | 86 | } |
tonyp@2073 | 87 | return res; |
ysr@777 | 88 | } |
ysr@777 | 89 | } |
ysr@777 | 90 | // attempt_allocation_slow will also unlock the heap lock when appropriate. |
ysr@777 | 91 | return attempt_allocation_slow(word_size, permit_collection_pause); |
ysr@777 | 92 | } |
ysr@777 | 93 | |
jcoomes@2064 | 94 | inline RefToScanQueue* G1CollectedHeap::task_queue(int i) const { |
ysr@777 | 95 | return _task_queues->queue(i); |
ysr@777 | 96 | } |
ysr@777 | 97 | |
ysr@777 | 98 | inline bool G1CollectedHeap::isMarkedPrev(oop obj) const { |
ysr@777 | 99 | return _cm->prevMarkBitMap()->isMarked((HeapWord *)obj); |
ysr@777 | 100 | } |
ysr@777 | 101 | |
ysr@777 | 102 | inline bool G1CollectedHeap::isMarkedNext(oop obj) const { |
ysr@777 | 103 | return _cm->nextMarkBitMap()->isMarked((HeapWord *)obj); |
ysr@777 | 104 | } |
stefank@2314 | 105 | |
stefank@2314 | 106 | #endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1COLLECTEDHEAP_INLINE_HPP |