Mercurial > hg > truffle
comparison src/share/vm/services/serviceUtil.hpp @ 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 | f95d63e2154a |
children | 070d523b96a7 |
comparison
equal
deleted
inserted
replaced
6724:36d1d483d5d6 | 6725:da91efe96a93 |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2003, 2010, 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. |
41 // the sentinel for deleted handles isn't visible | 41 // the sentinel for deleted handles isn't visible |
42 if (o == JNIHandles::deleted_handle()) { | 42 if (o == JNIHandles::deleted_handle()) { |
43 return false; | 43 return false; |
44 } | 44 } |
45 | 45 |
46 // ignore KlassKlass | |
47 if (o->is_klass()) { | |
48 return false; | |
49 } | |
50 | |
51 // instance | 46 // instance |
52 if (o->is_instance()) { | 47 if (o->is_instance()) { |
53 // instance objects are visible | 48 // instance objects are visible |
54 if (o->klass() != SystemDictionary::Class_klass()) { | 49 if (o->klass() != SystemDictionary::Class_klass()) { |
55 return true; | 50 return true; |
56 } | 51 } |
57 if (java_lang_Class::is_primitive(o)) { | 52 if (java_lang_Class::is_primitive(o)) { |
58 return true; | 53 return true; |
59 } | 54 } |
60 // java.lang.Classes are visible | 55 // java.lang.Classes are visible |
61 o = java_lang_Class::as_klassOop(o); | 56 Klass* k = java_lang_Class::as_Klass(o); |
62 if (o->is_klass()) { | 57 if (k->is_klass()) { |
63 // if it's a class for an object, an object array, or | 58 // if it's a class for an object, an object array, or |
64 // primitive (type) array then it's visible. | 59 // primitive (type) array then it's visible. |
65 klassOop klass = (klassOop)o; | 60 Klass* klass = k; |
66 if (Klass::cast(klass)->oop_is_instance()) { | 61 if (Klass::cast(klass)->oop_is_instance()) { |
67 return true; | 62 return true; |
68 } | 63 } |
69 if (Klass::cast(klass)->oop_is_objArray()) { | 64 if (Klass::cast(klass)->oop_is_objArray()) { |
70 return true; | 65 return true; |
75 } | 70 } |
76 return false; | 71 return false; |
77 } | 72 } |
78 // object arrays are visible if they aren't system object arrays | 73 // object arrays are visible if they aren't system object arrays |
79 if (o->is_objArray()) { | 74 if (o->is_objArray()) { |
80 objArrayOop array = (objArrayOop)o; | |
81 if (array->klass() != Universe::systemObjArrayKlassObj()) { | |
82 return true; | 75 return true; |
83 } else { | |
84 return false; | |
85 } | |
86 } | 76 } |
87 // type arrays are visible | 77 // type arrays are visible |
88 if (o->is_typeArray()) { | 78 if (o->is_typeArray()) { |
89 return true; | 79 return true; |
90 } | 80 } |
91 // everything else (methodOops, ...) aren't visible | 81 // everything else (Method*s, ...) aren't visible |
92 return false; | 82 return false; |
93 }; // end of visible_oop() | 83 }; // end of visible_oop() |
94 | 84 |
95 }; | 85 }; |
96 | 86 |