Mercurial > hg > truffle
comparison agent/src/share/classes/sun/jvm/hotspot/gc_implementation/parallelScavenge/ParallelScavengeHeap.java @ 6725:da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
Summary: Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
Contributed-by: jmasa <jon.masamitsu@oracle.com>, stefank <stefan.karlsson@oracle.com>, mgerdin <mikael.gerdin@oracle.com>, never <tom.rodriguez@oracle.com>
author | coleenp |
---|---|
date | Sat, 01 Sep 2012 13:25:18 -0400 |
parents | c18cbe5936b8 |
children |
comparison
equal
deleted
inserted
replaced
6724:36d1d483d5d6 | 6725:da91efe96a93 |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 2003, 2012, 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. |
43 | 43 |
44 private static synchronized void initialize(TypeDataBase db) { | 44 private static synchronized void initialize(TypeDataBase db) { |
45 Type type = db.lookupType("ParallelScavengeHeap"); | 45 Type type = db.lookupType("ParallelScavengeHeap"); |
46 youngGenField = type.getAddressField("_young_gen"); | 46 youngGenField = type.getAddressField("_young_gen"); |
47 oldGenField = type.getAddressField("_old_gen"); | 47 oldGenField = type.getAddressField("_old_gen"); |
48 permGenField = type.getAddressField("_perm_gen"); | |
49 } | 48 } |
50 | 49 |
51 public ParallelScavengeHeap(Address addr) { | 50 public ParallelScavengeHeap(Address addr) { |
52 super(addr); | 51 super(addr); |
53 } | 52 } |
54 | 53 |
55 // Fields | 54 // Fields |
56 private static AddressField youngGenField; | 55 private static AddressField youngGenField; |
57 private static AddressField oldGenField; | 56 private static AddressField oldGenField; |
58 private static AddressField permGenField; | |
59 | 57 |
60 // Accessors | 58 // Accessors |
61 public PSYoungGen youngGen() { | 59 public PSYoungGen youngGen() { |
62 return (PSYoungGen) VMObjectFactory.newObject(PSYoungGen.class, youngGenField.getValue()); | 60 return (PSYoungGen) VMObjectFactory.newObject(PSYoungGen.class, youngGenField.getValue()); |
63 } | 61 } |
64 | 62 |
65 public PSOldGen oldGen() { | 63 public PSOldGen oldGen() { |
66 return (PSOldGen) VMObjectFactory.newObject(PSOldGen.class, oldGenField.getValue()); | 64 return (PSOldGen) VMObjectFactory.newObject(PSOldGen.class, oldGenField.getValue()); |
67 } | |
68 | |
69 public PSPermGen permGen() { | |
70 return (PSPermGen) VMObjectFactory.newObject(PSPermGen.class, permGenField.getValue()); | |
71 } | 65 } |
72 | 66 |
73 public long capacity() { | 67 public long capacity() { |
74 return youngGen().capacity() + oldGen().capacity(); | 68 return youngGen().capacity() + oldGen().capacity(); |
75 } | 69 } |
85 | 79 |
86 if (oldGen().isIn(a)) { | 80 if (oldGen().isIn(a)) { |
87 return true; | 81 return true; |
88 } | 82 } |
89 | 83 |
90 if (permGen().isIn(a)) { | |
91 return true; | |
92 } | |
93 | |
94 return false; | 84 return false; |
95 } | 85 } |
96 | 86 |
97 public CollectedHeapName kind() { | 87 public CollectedHeapName kind() { |
98 return CollectedHeapName.PARALLEL_SCAVENGE_HEAP; | 88 return CollectedHeapName.PARALLEL_SCAVENGE_HEAP; |
100 | 90 |
101 public void printOn(PrintStream tty) { | 91 public void printOn(PrintStream tty) { |
102 tty.print("ParallelScavengeHeap [ "); | 92 tty.print("ParallelScavengeHeap [ "); |
103 youngGen().printOn(tty); | 93 youngGen().printOn(tty); |
104 oldGen().printOn(tty); | 94 oldGen().printOn(tty); |
105 permGen().printOn(tty); | |
106 tty.print(" ] "); | 95 tty.print(" ] "); |
107 } | 96 } |
108 } | 97 } |