src/share/vm/gc_implementation/parNew/asParNewGeneration.hpp

Wed, 28 May 2008 21:06:24 -0700

author
coleenp
date
Wed, 28 May 2008 21:06:24 -0700
changeset 602
feeb96a45707
parent 435
a61af66fc99e
child 1907
c18cbe5936b8
permissions
-rw-r--r--

6696264: assert("narrow oop can never be zero") for GCBasher & ParNewGC
Summary: decouple set_klass() with zeroing the gap when compressed.
Reviewed-by: kvn, ysr, jrose

duke@435 1 /*
duke@435 2 * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
duke@435 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@435 4 *
duke@435 5 * This code is free software; you can redistribute it and/or modify it
duke@435 6 * under the terms of the GNU General Public License version 2 only, as
duke@435 7 * published by the Free Software Foundation.
duke@435 8 *
duke@435 9 * This code is distributed in the hope that it will be useful, but WITHOUT
duke@435 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@435 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@435 12 * version 2 for more details (a copy is included in the LICENSE file that
duke@435 13 * accompanied this code).
duke@435 14 *
duke@435 15 * You should have received a copy of the GNU General Public License version
duke@435 16 * 2 along with this work; if not, write to the Free Software Foundation,
duke@435 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@435 18 *
duke@435 19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
duke@435 20 * CA 95054 USA or visit www.sun.com if you need additional information or
duke@435 21 * have any questions.
duke@435 22 *
duke@435 23 */
duke@435 24
duke@435 25 // A Generation that does parallel young-gen collection extended
duke@435 26 // for adaptive size policy.
duke@435 27
duke@435 28 // Division of generation into spaces
duke@435 29 // done by DefNewGeneration::compute_space_boundaries()
duke@435 30 // +---------------+
duke@435 31 // | uncommitted |
duke@435 32 // |---------------|
duke@435 33 // | ss0 |
duke@435 34 // |---------------|
duke@435 35 // | ss1 |
duke@435 36 // |---------------|
duke@435 37 // | |
duke@435 38 // | eden |
duke@435 39 // | |
duke@435 40 // +---------------+ <-- low end of VirtualSpace
duke@435 41 //
duke@435 42 class ASParNewGeneration: public ParNewGeneration {
duke@435 43
duke@435 44 size_t _min_gen_size;
duke@435 45
duke@435 46 // Resize the generation based on the desired sizes of
duke@435 47 // the constituent spaces.
duke@435 48 bool resize_generation(size_t eden_size, size_t survivor_size);
duke@435 49 // Resize the spaces based on their desired sizes but
duke@435 50 // respecting the maximum size of the generation.
duke@435 51 void resize_spaces(size_t eden_size, size_t survivor_size);
duke@435 52 // Return the byte size remaining to the minimum generation size.
duke@435 53 size_t available_to_min_gen();
duke@435 54 // Return the byte size remaining to the live data in the generation.
duke@435 55 size_t available_to_live() const;
duke@435 56 // Return the byte size that the generation is allowed to shrink.
duke@435 57 size_t limit_gen_shrink(size_t bytes);
duke@435 58 // Reset the size of the spaces after a shrink of the generation.
duke@435 59 void reset_survivors_after_shrink();
duke@435 60
duke@435 61 // Accessor
duke@435 62 VirtualSpace* virtual_space() { return &_virtual_space; }
duke@435 63
duke@435 64 virtual void adjust_desired_tenuring_threshold();
duke@435 65
duke@435 66 public:
duke@435 67
duke@435 68 ASParNewGeneration(ReservedSpace rs,
duke@435 69 size_t initial_byte_size,
duke@435 70 size_t min_byte_size,
duke@435 71 int level);
duke@435 72
duke@435 73 virtual const char* short_name() const { return "ASParNew"; }
duke@435 74 virtual const char* name() const;
duke@435 75 virtual Generation::Name kind() { return ASParNew; }
duke@435 76
duke@435 77 // Change the sizes of eden and the survivor spaces in
duke@435 78 // the generation. The parameters are desired sizes
duke@435 79 // and are not guaranteed to be met. For example, if
duke@435 80 // the total is larger than the generation.
duke@435 81 void resize(size_t eden_size, size_t survivor_size);
duke@435 82
duke@435 83 virtual void compute_new_size();
duke@435 84
duke@435 85 size_t max_gen_size() { return _reserved.byte_size(); }
duke@435 86 size_t min_gen_size() const { return _min_gen_size; }
duke@435 87
duke@435 88 // Space boundary invariant checker
duke@435 89 void space_invariants() PRODUCT_RETURN;
duke@435 90 };

mercurial