Mercurial > hg > truffle
comparison src/share/vm/gc_implementation/g1/heapRegionSeq.hpp @ 2181:d25d4ca69222
Merge.
author | Thomas Wuerthinger <wuerthinger@ssw.jku.at> |
---|---|
date | Wed, 16 Feb 2011 13:47:20 +0100 |
parents | 0fa27f37d4d4 |
children | 1216415d8e35 |
comparison
equal
deleted
inserted
replaced
2108:50b45e2d9725 | 2181:d25d4ca69222 |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | 4 * |
5 * This code is free software; you can redistribute it and/or modify it | 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 | 6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
39 | 39 |
40 // The index in "_regions" at which to start the next allocation search. | 40 // The index in "_regions" at which to start the next allocation search. |
41 // (For efficiency only; private to obj_allocate after initialization.) | 41 // (For efficiency only; private to obj_allocate after initialization.) |
42 int _alloc_search_start; | 42 int _alloc_search_start; |
43 | 43 |
44 // Attempts to allocate a block of the (assumed humongous) word_size, | 44 // Finds a contiguous set of empty regions of length num, starting |
45 // starting at the region "ind". | 45 // from a given index. |
46 HeapWord* alloc_obj_from_region_index(int ind, size_t word_size); | 46 int find_contiguous_from(int from, size_t num); |
47 | 47 |
48 // Currently, we're choosing collection sets in a round-robin fashion, | 48 // Currently, we're choosing collection sets in a round-robin fashion, |
49 // starting here. | 49 // starting here. |
50 int _next_rr_candidate; | 50 int _next_rr_candidate; |
51 | 51 |
74 | 74 |
75 // Returns the number of contiguous regions at the end of the sequence | 75 // Returns the number of contiguous regions at the end of the sequence |
76 // that are available for allocation. | 76 // that are available for allocation. |
77 size_t free_suffix(); | 77 size_t free_suffix(); |
78 | 78 |
79 // Requires "word_size" to be humongous (in the technical sense). If | 79 // Finds a contiguous set of empty regions of length num. |
80 // possible, allocates a contiguous subsequence of the heap regions to | 80 int find_contiguous(size_t num); |
81 // satisfy the allocation, and returns the address of the beginning of | |
82 // that sequence, otherwise returns NULL. | |
83 HeapWord* obj_allocate(size_t word_size); | |
84 | 81 |
85 // Apply the "doHeapRegion" method of "blk" to all regions in "this", | 82 // Apply the "doHeapRegion" method of "blk" to all regions in "this", |
86 // in address order, terminating the iteration early | 83 // in address order, terminating the iteration early |
87 // if the "doHeapRegion" method returns "true". | 84 // if the "doHeapRegion" method returns "true". |
88 void iterate(HeapRegionClosure* blk); | 85 void iterate(HeapRegionClosure* blk); |
104 // "num_regions_deleted" to the number of regions deleted. | 101 // "num_regions_deleted" to the number of regions deleted. |
105 MemRegion shrink_by(size_t shrink_bytes, size_t& num_regions_deleted); | 102 MemRegion shrink_by(size_t shrink_bytes, size_t& num_regions_deleted); |
106 | 103 |
107 // If "addr" falls within a region in the sequence, return that region, | 104 // If "addr" falls within a region in the sequence, return that region, |
108 // or else NULL. | 105 // or else NULL. |
109 HeapRegion* addr_to_region(const void* addr); | 106 inline HeapRegion* addr_to_region(const void* addr); |
110 | 107 |
111 void print(); | 108 void print(); |
112 | 109 |
113 // Prints out runs of empty regions. | 110 // Prints out runs of empty regions. |
114 void print_empty_runs(); | 111 void print_empty_runs(); |