Mercurial > hg > graal-compiler
diff src/share/vm/gc_implementation/g1/g1CollectorPolicy.hpp @ 3830:f44782f04dd4
7039627: G1: avoid BOT updates for survivor allocations and dirty survivor regions incrementally
Summary: Refactor the allocation code during GC to use the G1AllocRegion abstraction. Use separate subclasses of G1AllocRegion for survivor and old regions. Avoid BOT updates and dirty survivor cards incrementally for the former.
Reviewed-by: brutisso, johnc, ysr
author | tonyp |
---|---|
date | Fri, 12 Aug 2011 11:31:06 -0400 |
parents | 14a2fd14c0db |
children | ff53346271fe |
line wrap: on
line diff
--- a/src/share/vm/gc_implementation/g1/g1CollectorPolicy.hpp Thu Aug 11 11:36:29 2011 -0700 +++ b/src/share/vm/gc_implementation/g1/g1CollectorPolicy.hpp Fri Aug 12 11:31:06 2011 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -585,13 +585,9 @@ int _last_update_rs_processed_buffers; double _last_pause_time_ms; - size_t _bytes_in_to_space_before_gc; - size_t _bytes_in_to_space_after_gc; - size_t bytes_in_to_space_during_gc() { - return - _bytes_in_to_space_after_gc - _bytes_in_to_space_before_gc; - } size_t _bytes_in_collection_set_before_gc; + size_t _bytes_copied_during_gc; + // Used to count used bytes in CS. friend class CountCSClosure; @@ -805,10 +801,6 @@ return _bytes_in_collection_set_before_gc; } - size_t bytes_in_to_space() { - return bytes_in_to_space_during_gc(); - } - unsigned calc_gc_alloc_time_stamp() { return _all_pause_times_ms->num() + 1; } @@ -977,9 +969,16 @@ } #endif - // Record the fact that "bytes" bytes allocated in a region. - void record_before_bytes(size_t bytes); - void record_after_bytes(size_t bytes); + // Record how much space we copied during a GC. This is typically + // called when a GC alloc region is being retired. + void record_bytes_copied_during_gc(size_t bytes) { + _bytes_copied_during_gc += bytes; + } + + // The amount of space we copied during a GC. + size_t bytes_copied_during_gc() { + return _bytes_copied_during_gc; + } // Choose a new collection set. Marks the chosen regions as being // "in_collection_set", and links them together. The head and number of @@ -1193,10 +1192,6 @@ return purpose == GCAllocForSurvived; } - inline GCAllocPurpose alternative_purpose(int purpose) { - return GCAllocForTenured; - } - static const size_t REGIONS_UNLIMITED = ~(size_t)0; size_t max_regions(int purpose);