Mercurial > hg > truffle
comparison agent/src/share/classes/sun/jvm/hotspot/utilities/PointerLocation.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 | 3e8fbc61cee8 |
children |
comparison
equal
deleted
inserted
replaced
6724:36d1d483d5d6 | 6725:da91efe96a93 |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 2000, 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. |
45 | 45 |
46 Address addr; | 46 Address addr; |
47 | 47 |
48 CollectedHeap heap; | 48 CollectedHeap heap; |
49 Generation gen; | 49 Generation gen; |
50 Generation permGen; | |
51 | 50 |
52 // If UseTLAB was enabled and the pointer was found in a | 51 // If UseTLAB was enabled and the pointer was found in a |
53 // currently-active TLAB, these will be set | 52 // currently-active TLAB, these will be set |
54 boolean inTLAB; | 53 boolean inTLAB; |
55 JavaThread tlabThread; | 54 JavaThread tlabThread; |
79 public PointerLocation(Address addr) { | 78 public PointerLocation(Address addr) { |
80 this.addr = addr; | 79 this.addr = addr; |
81 } | 80 } |
82 | 81 |
83 public boolean isInHeap() { | 82 public boolean isInHeap() { |
84 return (heap != null || (gen != null) || (permGen != null)); | 83 return (heap != null || (gen != null)); |
85 } | 84 } |
86 | 85 |
87 public boolean isInNewGen() { | 86 public boolean isInNewGen() { |
88 return ((gen != null) && (gen.level() == 0)); | 87 return ((gen != null) && (gen.level() == 0)); |
89 } | 88 } |
90 | 89 |
91 public boolean isInOldGen() { | 90 public boolean isInOldGen() { |
92 return ((gen != null) && (gen.level() == 1)); | 91 return ((gen != null) && (gen.level() == 1)); |
93 } | 92 } |
94 | 93 |
95 public boolean isInPermGen() { | |
96 return (permGen != null); | |
97 } | |
98 | |
99 public boolean inOtherGen() { | 94 public boolean inOtherGen() { |
100 return (!isInNewGen() && !isInOldGen() && !isInPermGen()); | 95 return (!isInNewGen() && !isInOldGen()); |
101 } | 96 } |
102 | 97 |
103 /** Only valid if isInHeap() */ | 98 /** Only valid if isInHeap() */ |
104 public Generation getGeneration() { | 99 public Generation getGeneration() { |
105 if (gen != null) { | |
106 return gen; | 100 return gen; |
107 } else { | |
108 return permGen; | |
109 } | |
110 } | 101 } |
111 | 102 |
112 /** This may be true if isInNewGen is also true */ | 103 /** This may be true if isInNewGen is also true */ |
113 public boolean isInTLAB() { | 104 public boolean isInTLAB() { |
114 return inTLAB; | 105 return inTLAB; |
214 } else { | 205 } else { |
215 if (isInNewGen()) { | 206 if (isInNewGen()) { |
216 tty.print("In new generation "); | 207 tty.print("In new generation "); |
217 } else if (isInOldGen()) { | 208 } else if (isInOldGen()) { |
218 tty.print("In old generation "); | 209 tty.print("In old generation "); |
219 } else if (isInPermGen()) { | |
220 tty.print("In perm generation "); | |
221 } else if (gen != null) { | 210 } else if (gen != null) { |
222 tty.print("In Generation " + getGeneration().level()); | 211 tty.print("In Generation " + getGeneration().level()); |
223 } else { | 212 } else { |
224 tty.print("In unknown section of Java heap"); | 213 tty.print("In unknown section of Java heap"); |
225 } | 214 } |