1.1 --- a/src/share/vm/gc_implementation/g1/g1CollectorPolicy.hpp Thu Aug 11 11:36:29 2011 -0700 1.2 +++ b/src/share/vm/gc_implementation/g1/g1CollectorPolicy.hpp Fri Aug 12 11:31:06 2011 -0400 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 - * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. 1.6 + * Copyright (c) 2001, 2011, 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 @@ -585,13 +585,9 @@ 1.11 int _last_update_rs_processed_buffers; 1.12 double _last_pause_time_ms; 1.13 1.14 - size_t _bytes_in_to_space_before_gc; 1.15 - size_t _bytes_in_to_space_after_gc; 1.16 - size_t bytes_in_to_space_during_gc() { 1.17 - return 1.18 - _bytes_in_to_space_after_gc - _bytes_in_to_space_before_gc; 1.19 - } 1.20 size_t _bytes_in_collection_set_before_gc; 1.21 + size_t _bytes_copied_during_gc; 1.22 + 1.23 // Used to count used bytes in CS. 1.24 friend class CountCSClosure; 1.25 1.26 @@ -805,10 +801,6 @@ 1.27 return _bytes_in_collection_set_before_gc; 1.28 } 1.29 1.30 - size_t bytes_in_to_space() { 1.31 - return bytes_in_to_space_during_gc(); 1.32 - } 1.33 - 1.34 unsigned calc_gc_alloc_time_stamp() { 1.35 return _all_pause_times_ms->num() + 1; 1.36 } 1.37 @@ -977,9 +969,16 @@ 1.38 } 1.39 #endif 1.40 1.41 - // Record the fact that "bytes" bytes allocated in a region. 1.42 - void record_before_bytes(size_t bytes); 1.43 - void record_after_bytes(size_t bytes); 1.44 + // Record how much space we copied during a GC. This is typically 1.45 + // called when a GC alloc region is being retired. 1.46 + void record_bytes_copied_during_gc(size_t bytes) { 1.47 + _bytes_copied_during_gc += bytes; 1.48 + } 1.49 + 1.50 + // The amount of space we copied during a GC. 1.51 + size_t bytes_copied_during_gc() { 1.52 + return _bytes_copied_during_gc; 1.53 + } 1.54 1.55 // Choose a new collection set. Marks the chosen regions as being 1.56 // "in_collection_set", and links them together. The head and number of 1.57 @@ -1193,10 +1192,6 @@ 1.58 return purpose == GCAllocForSurvived; 1.59 } 1.60 1.61 - inline GCAllocPurpose alternative_purpose(int purpose) { 1.62 - return GCAllocForTenured; 1.63 - } 1.64 - 1.65 static const size_t REGIONS_UNLIMITED = ~(size_t)0; 1.66 1.67 size_t max_regions(int purpose);