1.1 --- a/src/share/vm/gc_implementation/g1/heapRegionSeq.hpp Wed Apr 11 16:18:45 2012 +0200 1.2 +++ b/src/share/vm/gc_implementation/g1/heapRegionSeq.hpp Wed Apr 18 07:21:15 2012 -0400 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 - * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved. 1.6 + * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. 1.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.8 * 1.9 * This code is free software; you can redistribute it and/or modify it 1.10 @@ -29,8 +29,6 @@ 1.11 class HeapRegionClosure; 1.12 class FreeRegionList; 1.13 1.14 -#define G1_NULL_HRS_INDEX ((size_t) -1) 1.15 - 1.16 // This class keeps track of the region metadata (i.e., HeapRegion 1.17 // instances). They are kept in the _regions array in address 1.18 // order. A region's index in the array corresponds to its index in 1.19 @@ -65,7 +63,7 @@ 1.20 HeapRegion** _regions_biased; 1.21 1.22 // The number of regions committed in the heap. 1.23 - size_t _length; 1.24 + uint _length; 1.25 1.26 // The address of the first reserved word in the heap. 1.27 HeapWord* _heap_bottom; 1.28 @@ -74,32 +72,32 @@ 1.29 HeapWord* _heap_end; 1.30 1.31 // The log of the region byte size. 1.32 - size_t _region_shift; 1.33 + uint _region_shift; 1.34 1.35 // A hint for which index to start searching from for humongous 1.36 // allocations. 1.37 - size_t _next_search_index; 1.38 + uint _next_search_index; 1.39 1.40 // The number of regions for which we have allocated HeapRegions for. 1.41 - size_t _allocated_length; 1.42 + uint _allocated_length; 1.43 1.44 // The maximum number of regions in the heap. 1.45 - size_t _max_length; 1.46 + uint _max_length; 1.47 1.48 // Find a contiguous set of empty regions of length num, starting 1.49 // from the given index. 1.50 - size_t find_contiguous_from(size_t from, size_t num); 1.51 + uint find_contiguous_from(uint from, uint num); 1.52 1.53 // Map a heap address to a biased region index. Assume that the 1.54 // address is valid. 1.55 - inline size_t addr_to_index_biased(HeapWord* addr) const; 1.56 + inline uintx addr_to_index_biased(HeapWord* addr) const; 1.57 1.58 - void increment_length(size_t* length) { 1.59 + void increment_length(uint* length) { 1.60 assert(*length < _max_length, "pre-condition"); 1.61 *length += 1; 1.62 } 1.63 1.64 - void decrement_length(size_t* length) { 1.65 + void decrement_length(uint* length) { 1.66 assert(*length > 0, "pre-condition"); 1.67 *length -= 1; 1.68 } 1.69 @@ -108,11 +106,11 @@ 1.70 // Empty contructor, we'll initialize it with the initialize() method. 1.71 HeapRegionSeq() { } 1.72 1.73 - void initialize(HeapWord* bottom, HeapWord* end, size_t max_length); 1.74 + void initialize(HeapWord* bottom, HeapWord* end, uint max_length); 1.75 1.76 // Return the HeapRegion at the given index. Assume that the index 1.77 // is valid. 1.78 - inline HeapRegion* at(size_t index) const; 1.79 + inline HeapRegion* at(uint index) const; 1.80 1.81 // If addr is within the committed space return its corresponding 1.82 // HeapRegion, otherwise return NULL. 1.83 @@ -123,10 +121,10 @@ 1.84 inline HeapRegion* addr_to_region_unsafe(HeapWord* addr) const; 1.85 1.86 // Return the number of regions that have been committed in the heap. 1.87 - size_t length() const { return _length; } 1.88 + uint length() const { return _length; } 1.89 1.90 // Return the maximum number of regions in the heap. 1.91 - size_t max_length() const { return _max_length; } 1.92 + uint max_length() const { return _max_length; } 1.93 1.94 // Expand the sequence to reflect that the heap has grown from 1.95 // old_end to new_end. Either create new HeapRegions, or re-use 1.96 @@ -139,12 +137,12 @@ 1.97 1.98 // Return the number of contiguous regions at the end of the sequence 1.99 // that are available for allocation. 1.100 - size_t free_suffix(); 1.101 + uint free_suffix(); 1.102 1.103 // Find a contiguous set of empty regions of length num and return 1.104 // the index of the first region or G1_NULL_HRS_INDEX if the 1.105 // search was unsuccessful. 1.106 - size_t find_contiguous(size_t num); 1.107 + uint find_contiguous(uint num); 1.108 1.109 // Apply blk->doHeapRegion() on all committed regions in address order, 1.110 // terminating the iteration early if doHeapRegion() returns true. 1.111 @@ -159,7 +157,7 @@ 1.112 // sequence. Return a MemRegion that corresponds to the address 1.113 // range of the uncommitted regions. Assume shrink_bytes is page and 1.114 // heap region aligned. 1.115 - MemRegion shrink_by(size_t shrink_bytes, size_t* num_regions_deleted); 1.116 + MemRegion shrink_by(size_t shrink_bytes, uint* num_regions_deleted); 1.117 1.118 // Do some sanity checking. 1.119 void verify_optional() PRODUCT_RETURN;