Mercurial > hg > graal-jvmci-8
comparison src/share/vm/runtime/reflectionUtils.cpp @ 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 | d2a62e0f25eb |
children | e522a00b91aa ac9cb1d5a202 |
comparison
equal
deleted
inserted
replaced
6724:36d1d483d5d6 | 6725:da91efe96a93 |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 1999, 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. |
28 #include "runtime/reflectionUtils.hpp" | 28 #include "runtime/reflectionUtils.hpp" |
29 | 29 |
30 KlassStream::KlassStream(instanceKlassHandle klass, bool local_only, bool classes_only) { | 30 KlassStream::KlassStream(instanceKlassHandle klass, bool local_only, bool classes_only) { |
31 _klass = klass; | 31 _klass = klass; |
32 if (classes_only) { | 32 if (classes_only) { |
33 _interfaces = Universe::the_empty_system_obj_array(); | 33 _interfaces = Universe::the_empty_klass_array(); |
34 } else { | 34 } else { |
35 _interfaces = klass->transitive_interfaces(); | 35 _interfaces = klass->transitive_interfaces(); |
36 } | 36 } |
37 _interface_index = _interfaces->length(); | 37 _interface_index = _interfaces->length(); |
38 _local_only = local_only; | 38 _local_only = local_only; |
45 if (!_klass->is_interface() && _klass->super() != NULL) { | 45 if (!_klass->is_interface() && _klass->super() != NULL) { |
46 // go up superclass chain (not for interfaces) | 46 // go up superclass chain (not for interfaces) |
47 _klass = _klass->super(); | 47 _klass = _klass->super(); |
48 } else { | 48 } else { |
49 if (_interface_index > 0) { | 49 if (_interface_index > 0) { |
50 _klass = klassOop(_interfaces->obj_at(--_interface_index)); | 50 _klass = _interfaces->at(--_interface_index); |
51 } else { | 51 } else { |
52 return true; | 52 return true; |
53 } | 53 } |
54 } | 54 } |
55 _index = length(); | 55 _index = length(); |
68 _filtered_fields->append(new FilteredField(SystemDictionary::Throwable_klass(), offset)); | 68 _filtered_fields->append(new FilteredField(SystemDictionary::Throwable_klass(), offset)); |
69 // The latest version of vm may be used with old jdk. | 69 // The latest version of vm may be used with old jdk. |
70 if (JDK_Version::is_gte_jdk16x_version()) { | 70 if (JDK_Version::is_gte_jdk16x_version()) { |
71 // The following class fields do not exist in | 71 // The following class fields do not exist in |
72 // previous version of jdk. | 72 // previous version of jdk. |
73 offset = sun_reflect_ConstantPool::cp_oop_offset(); | 73 offset = sun_reflect_ConstantPool::oop_offset(); |
74 _filtered_fields->append(new FilteredField(SystemDictionary::reflect_ConstantPool_klass(), offset)); | 74 _filtered_fields->append(new FilteredField(SystemDictionary::reflect_ConstantPool_klass(), offset)); |
75 offset = sun_reflect_UnsafeStaticFieldAccessorImpl::base_offset(); | 75 offset = sun_reflect_UnsafeStaticFieldAccessorImpl::base_offset(); |
76 _filtered_fields->append(new FilteredField(SystemDictionary::reflect_UnsafeStaticFieldAccessorImpl_klass(), offset)); | 76 _filtered_fields->append(new FilteredField(SystemDictionary::reflect_UnsafeStaticFieldAccessorImpl_klass(), offset)); |
77 } | 77 } |
78 } | 78 } |