annotate agent/src/share/classes/sun/jvm/hotspot/oops/InstanceKlass.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 04ade88d9712
children bd7a7ce2e264
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
5998
49036505ab5f 7154670: The instanceKlass _implementors[] and _nof_implementors are not needed for non-interface klass.
jiangli
parents: 5967
diff changeset
2 * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 *
a61af66fc99e Initial load
duke
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
7 * published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
8 *
a61af66fc99e Initial load
duke
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
13 * accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
14 *
a61af66fc99e Initial load
duke
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
18 *
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 196
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 196
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 196
diff changeset
21 * questions.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
24
a61af66fc99e Initial load
duke
parents:
diff changeset
25 package sun.jvm.hotspot.oops;
a61af66fc99e Initial load
duke
parents:
diff changeset
26
a61af66fc99e Initial load
duke
parents:
diff changeset
27 import java.io.*;
a61af66fc99e Initial load
duke
parents:
diff changeset
28 import java.util.*;
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
29 import sun.jvm.hotspot.classfile.ClassLoaderData;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
30 import sun.jvm.hotspot.debugger.*;
a61af66fc99e Initial load
duke
parents:
diff changeset
31 import sun.jvm.hotspot.memory.*;
a61af66fc99e Initial load
duke
parents:
diff changeset
32 import sun.jvm.hotspot.runtime.*;
a61af66fc99e Initial load
duke
parents:
diff changeset
33 import sun.jvm.hotspot.types.*;
a61af66fc99e Initial load
duke
parents:
diff changeset
34 import sun.jvm.hotspot.utilities.*;
a61af66fc99e Initial load
duke
parents:
diff changeset
35
a61af66fc99e Initial load
duke
parents:
diff changeset
36 // An InstanceKlass is the VM level representation of a Java class.
a61af66fc99e Initial load
duke
parents:
diff changeset
37
a61af66fc99e Initial load
duke
parents:
diff changeset
38 public class InstanceKlass extends Klass {
a61af66fc99e Initial load
duke
parents:
diff changeset
39 static {
a61af66fc99e Initial load
duke
parents:
diff changeset
40 VM.registerVMInitializedObserver(new Observer() {
a61af66fc99e Initial load
duke
parents:
diff changeset
41 public void update(Observable o, Object data) {
a61af66fc99e Initial load
duke
parents:
diff changeset
42 initialize(VM.getVM().getTypeDataBase());
a61af66fc99e Initial load
duke
parents:
diff changeset
43 }
a61af66fc99e Initial load
duke
parents:
diff changeset
44 });
a61af66fc99e Initial load
duke
parents:
diff changeset
45 }
a61af66fc99e Initial load
duke
parents:
diff changeset
46
a61af66fc99e Initial load
duke
parents:
diff changeset
47 // field offset constants
3962
cb315dc80374 7092278: "jmap -finalizerinfo" throws "sun.jvm.hotspot.utilities.AssertionFailure: invalid cp index 0 137"
never
parents: 3944
diff changeset
48 private static int ACCESS_FLAGS_OFFSET;
cb315dc80374 7092278: "jmap -finalizerinfo" throws "sun.jvm.hotspot.utilities.AssertionFailure: invalid cp index 0 137"
never
parents: 3944
diff changeset
49 private static int NAME_INDEX_OFFSET;
cb315dc80374 7092278: "jmap -finalizerinfo" throws "sun.jvm.hotspot.utilities.AssertionFailure: invalid cp index 0 137"
never
parents: 3944
diff changeset
50 private static int SIGNATURE_INDEX_OFFSET;
cb315dc80374 7092278: "jmap -finalizerinfo" throws "sun.jvm.hotspot.utilities.AssertionFailure: invalid cp index 0 137"
never
parents: 3944
diff changeset
51 private static int INITVAL_INDEX_OFFSET;
cb315dc80374 7092278: "jmap -finalizerinfo" throws "sun.jvm.hotspot.utilities.AssertionFailure: invalid cp index 0 137"
never
parents: 3944
diff changeset
52 private static int LOW_OFFSET;
cb315dc80374 7092278: "jmap -finalizerinfo" throws "sun.jvm.hotspot.utilities.AssertionFailure: invalid cp index 0 137"
never
parents: 3944
diff changeset
53 private static int HIGH_OFFSET;
cb315dc80374 7092278: "jmap -finalizerinfo" throws "sun.jvm.hotspot.utilities.AssertionFailure: invalid cp index 0 137"
never
parents: 3944
diff changeset
54 private static int FIELD_SLOTS;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
55
a61af66fc99e Initial load
duke
parents:
diff changeset
56 // ClassState constants
a61af66fc99e Initial load
duke
parents:
diff changeset
57 private static int CLASS_STATE_ALLOCATED;
a61af66fc99e Initial load
duke
parents:
diff changeset
58 private static int CLASS_STATE_LOADED;
a61af66fc99e Initial load
duke
parents:
diff changeset
59 private static int CLASS_STATE_LINKED;
a61af66fc99e Initial load
duke
parents:
diff changeset
60 private static int CLASS_STATE_BEING_INITIALIZED;
a61af66fc99e Initial load
duke
parents:
diff changeset
61 private static int CLASS_STATE_FULLY_INITIALIZED;
a61af66fc99e Initial load
duke
parents:
diff changeset
62 private static int CLASS_STATE_INITIALIZATION_ERROR;
a61af66fc99e Initial load
duke
parents:
diff changeset
63
a61af66fc99e Initial load
duke
parents:
diff changeset
64 private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
65 Type type = db.lookupType("InstanceKlass");
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
66 arrayKlasses = new MetadataField(type.getAddressField("_array_klasses"), 0);
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
67 methods = type.getAddressField("_methods");
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
68 methodOrdering = type.getAddressField("_method_ordering");
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
69 localInterfaces = type.getAddressField("_local_interfaces");
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
70 transitiveInterfaces = type.getAddressField("_transitive_interfaces");
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
71 fields = type.getAddressField("_fields");
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
72 javaFieldsCount = new CIntField(type.getCIntegerField("_java_fields_count"), 0);
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
73 constants = new MetadataField(type.getAddressField("_constants"), 0);
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
74 classLoaderData = type.getAddressField("_class_loader_data");
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
75 protectionDomain = new OopField(type.getOopField("_protection_domain"), 0);
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
76 signers = new OopField(type.getOopField("_signers"), 0);
2177
3582bf76420e 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 1552
diff changeset
77 sourceFileName = type.getAddressField("_source_file_name");
3582bf76420e 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 1552
diff changeset
78 sourceDebugExtension = type.getAddressField("_source_debug_extension");
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
79 innerClasses = type.getAddressField("_inner_classes");
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
80 nonstaticFieldSize = new CIntField(type.getCIntegerField("_nonstatic_field_size"), 0);
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
81 staticFieldSize = new CIntField(type.getCIntegerField("_static_field_size"), 0);
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
82 staticOopFieldCount = new CIntField(type.getCIntegerField("_static_oop_field_count"), 0);
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
83 nonstaticOopMapSize = new CIntField(type.getCIntegerField("_nonstatic_oop_map_size"), 0);
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
84 isMarkedDependent = new CIntField(type.getCIntegerField("_is_marked_dependent"), 0);
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
85 initState = new CIntField(type.getCIntegerField("_init_state"), 0);
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
86 vtableLen = new CIntField(type.getCIntegerField("_vtable_len"), 0);
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
87 itableLen = new CIntField(type.getCIntegerField("_itable_len"), 0);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
88 breakpoints = type.getAddressField("_breakpoints");
2177
3582bf76420e 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 1552
diff changeset
89 genericSignature = type.getAddressField("_generic_signature");
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
90 majorVersion = new CIntField(type.getCIntegerField("_major_version"), 0);
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
91 minorVersion = new CIntField(type.getCIntegerField("_minor_version"), 0);
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
92 headerSize = Oop.alignObjectOffset(type.getSize());
0
a61af66fc99e Initial load
duke
parents:
diff changeset
93
a61af66fc99e Initial load
duke
parents:
diff changeset
94 // read field offset constants
3938
e6b1331a51d2 7086585: make Java field injection more flexible
never
parents: 2411
diff changeset
95 ACCESS_FLAGS_OFFSET = db.lookupIntConstant("FieldInfo::access_flags_offset").intValue();
e6b1331a51d2 7086585: make Java field injection more flexible
never
parents: 2411
diff changeset
96 NAME_INDEX_OFFSET = db.lookupIntConstant("FieldInfo::name_index_offset").intValue();
e6b1331a51d2 7086585: make Java field injection more flexible
never
parents: 2411
diff changeset
97 SIGNATURE_INDEX_OFFSET = db.lookupIntConstant("FieldInfo::signature_index_offset").intValue();
e6b1331a51d2 7086585: make Java field injection more flexible
never
parents: 2411
diff changeset
98 INITVAL_INDEX_OFFSET = db.lookupIntConstant("FieldInfo::initval_index_offset").intValue();
e6b1331a51d2 7086585: make Java field injection more flexible
never
parents: 2411
diff changeset
99 LOW_OFFSET = db.lookupIntConstant("FieldInfo::low_offset").intValue();
e6b1331a51d2 7086585: make Java field injection more flexible
never
parents: 2411
diff changeset
100 HIGH_OFFSET = db.lookupIntConstant("FieldInfo::high_offset").intValue();
e6b1331a51d2 7086585: make Java field injection more flexible
never
parents: 2411
diff changeset
101 FIELD_SLOTS = db.lookupIntConstant("FieldInfo::field_slots").intValue();
0
a61af66fc99e Initial load
duke
parents:
diff changeset
102 // read ClassState constants
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
103 CLASS_STATE_ALLOCATED = db.lookupIntConstant("InstanceKlass::allocated").intValue();
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
104 CLASS_STATE_LOADED = db.lookupIntConstant("InstanceKlass::loaded").intValue();
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
105 CLASS_STATE_LINKED = db.lookupIntConstant("InstanceKlass::linked").intValue();
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
106 CLASS_STATE_BEING_INITIALIZED = db.lookupIntConstant("InstanceKlass::being_initialized").intValue();
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
107 CLASS_STATE_FULLY_INITIALIZED = db.lookupIntConstant("InstanceKlass::fully_initialized").intValue();
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
108 CLASS_STATE_INITIALIZATION_ERROR = db.lookupIntConstant("InstanceKlass::initialization_error").intValue();
0
a61af66fc99e Initial load
duke
parents:
diff changeset
109
a61af66fc99e Initial load
duke
parents:
diff changeset
110 }
a61af66fc99e Initial load
duke
parents:
diff changeset
111
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
112 public InstanceKlass(Address addr) {
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
113 super(addr);
3962
cb315dc80374 7092278: "jmap -finalizerinfo" throws "sun.jvm.hotspot.utilities.AssertionFailure: invalid cp index 0 137"
never
parents: 3944
diff changeset
114 if (getJavaFieldsCount() != getAllFieldsCount()) {
cb315dc80374 7092278: "jmap -finalizerinfo" throws "sun.jvm.hotspot.utilities.AssertionFailure: invalid cp index 0 137"
never
parents: 3944
diff changeset
115 // Exercise the injected field logic
cb315dc80374 7092278: "jmap -finalizerinfo" throws "sun.jvm.hotspot.utilities.AssertionFailure: invalid cp index 0 137"
never
parents: 3944
diff changeset
116 for (int i = getJavaFieldsCount(); i < getAllFieldsCount(); i++) {
cb315dc80374 7092278: "jmap -finalizerinfo" throws "sun.jvm.hotspot.utilities.AssertionFailure: invalid cp index 0 137"
never
parents: 3944
diff changeset
117 getFieldName(i);
cb315dc80374 7092278: "jmap -finalizerinfo" throws "sun.jvm.hotspot.utilities.AssertionFailure: invalid cp index 0 137"
never
parents: 3944
diff changeset
118 getFieldSignature(i);
cb315dc80374 7092278: "jmap -finalizerinfo" throws "sun.jvm.hotspot.utilities.AssertionFailure: invalid cp index 0 137"
never
parents: 3944
diff changeset
119 }
cb315dc80374 7092278: "jmap -finalizerinfo" throws "sun.jvm.hotspot.utilities.AssertionFailure: invalid cp index 0 137"
never
parents: 3944
diff changeset
120 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
121 }
a61af66fc99e Initial load
duke
parents:
diff changeset
122
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
123 private static MetadataField arrayKlasses;
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
124 private static AddressField methods;
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
125 private static AddressField methodOrdering;
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
126 private static AddressField localInterfaces;
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
127 private static AddressField transitiveInterfaces;
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
128 private static AddressField fields;
3938
e6b1331a51d2 7086585: make Java field injection more flexible
never
parents: 2411
diff changeset
129 private static CIntField javaFieldsCount;
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
130 private static MetadataField constants;
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
131 private static AddressField classLoaderData;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
132 private static OopField protectionDomain;
a61af66fc99e Initial load
duke
parents:
diff changeset
133 private static OopField signers;
2177
3582bf76420e 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 1552
diff changeset
134 private static AddressField sourceFileName;
3582bf76420e 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 1552
diff changeset
135 private static AddressField sourceDebugExtension;
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
136 private static AddressField innerClasses;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
137 private static CIntField nonstaticFieldSize;
a61af66fc99e Initial load
duke
parents:
diff changeset
138 private static CIntField staticFieldSize;
2376
c7f3d0b4570f 7017732: move static fields into Class to prepare for perm gen removal
never
parents: 2177
diff changeset
139 private static CIntField staticOopFieldCount;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
140 private static CIntField nonstaticOopMapSize;
4772
8f8b94305aff 7129240: backout fix for 7102776 until 7128770 is resolved
dcubed
parents: 4737
diff changeset
141 private static CIntField isMarkedDependent;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
142 private static CIntField initState;
a61af66fc99e Initial load
duke
parents:
diff changeset
143 private static CIntField vtableLen;
a61af66fc99e Initial load
duke
parents:
diff changeset
144 private static CIntField itableLen;
a61af66fc99e Initial load
duke
parents:
diff changeset
145 private static AddressField breakpoints;
2177
3582bf76420e 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 1552
diff changeset
146 private static AddressField genericSignature;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
147 private static CIntField majorVersion;
a61af66fc99e Initial load
duke
parents:
diff changeset
148 private static CIntField minorVersion;
a61af66fc99e Initial load
duke
parents:
diff changeset
149
a61af66fc99e Initial load
duke
parents:
diff changeset
150 // type safe enum for ClassState from instanceKlass.hpp
a61af66fc99e Initial load
duke
parents:
diff changeset
151 public static class ClassState {
a61af66fc99e Initial load
duke
parents:
diff changeset
152 public static final ClassState ALLOCATED = new ClassState("allocated");
a61af66fc99e Initial load
duke
parents:
diff changeset
153 public static final ClassState LOADED = new ClassState("loaded");
a61af66fc99e Initial load
duke
parents:
diff changeset
154 public static final ClassState LINKED = new ClassState("linked");
a61af66fc99e Initial load
duke
parents:
diff changeset
155 public static final ClassState BEING_INITIALIZED = new ClassState("beingInitialized");
a61af66fc99e Initial load
duke
parents:
diff changeset
156 public static final ClassState FULLY_INITIALIZED = new ClassState("fullyInitialized");
a61af66fc99e Initial load
duke
parents:
diff changeset
157 public static final ClassState INITIALIZATION_ERROR = new ClassState("initializationError");
a61af66fc99e Initial load
duke
parents:
diff changeset
158
a61af66fc99e Initial load
duke
parents:
diff changeset
159 private ClassState(String value) {
a61af66fc99e Initial load
duke
parents:
diff changeset
160 this.value = value;
a61af66fc99e Initial load
duke
parents:
diff changeset
161 }
a61af66fc99e Initial load
duke
parents:
diff changeset
162
a61af66fc99e Initial load
duke
parents:
diff changeset
163 public String toString() {
a61af66fc99e Initial load
duke
parents:
diff changeset
164 return value;
a61af66fc99e Initial load
duke
parents:
diff changeset
165 }
a61af66fc99e Initial load
duke
parents:
diff changeset
166
a61af66fc99e Initial load
duke
parents:
diff changeset
167 private String value;
a61af66fc99e Initial load
duke
parents:
diff changeset
168 }
a61af66fc99e Initial load
duke
parents:
diff changeset
169
3939
f6f3bb0ee072 7088955: add C2 IR support to the SA
never
parents: 3938
diff changeset
170 public int getInitStateAsInt() { return (int) initState.getValue(this); }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
171 public ClassState getInitState() {
a61af66fc99e Initial load
duke
parents:
diff changeset
172 int state = getInitStateAsInt();
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
173 if (state == CLASS_STATE_ALLOCATED) {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
174 return ClassState.ALLOCATED;
a61af66fc99e Initial load
duke
parents:
diff changeset
175 } else if (state == CLASS_STATE_LOADED) {
a61af66fc99e Initial load
duke
parents:
diff changeset
176 return ClassState.LOADED;
a61af66fc99e Initial load
duke
parents:
diff changeset
177 } else if (state == CLASS_STATE_LINKED) {
a61af66fc99e Initial load
duke
parents:
diff changeset
178 return ClassState.LINKED;
a61af66fc99e Initial load
duke
parents:
diff changeset
179 } else if (state == CLASS_STATE_BEING_INITIALIZED) {
a61af66fc99e Initial load
duke
parents:
diff changeset
180 return ClassState.BEING_INITIALIZED;
a61af66fc99e Initial load
duke
parents:
diff changeset
181 } else if (state == CLASS_STATE_FULLY_INITIALIZED) {
a61af66fc99e Initial load
duke
parents:
diff changeset
182 return ClassState.FULLY_INITIALIZED;
a61af66fc99e Initial load
duke
parents:
diff changeset
183 } else if (state == CLASS_STATE_INITIALIZATION_ERROR) {
a61af66fc99e Initial load
duke
parents:
diff changeset
184 return ClassState.INITIALIZATION_ERROR;
a61af66fc99e Initial load
duke
parents:
diff changeset
185 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
186 throw new RuntimeException("should not reach here");
a61af66fc99e Initial load
duke
parents:
diff changeset
187 }
a61af66fc99e Initial load
duke
parents:
diff changeset
188 }
a61af66fc99e Initial load
duke
parents:
diff changeset
189
a61af66fc99e Initial load
duke
parents:
diff changeset
190 // initialization state quaries
a61af66fc99e Initial load
duke
parents:
diff changeset
191 public boolean isLoaded() {
a61af66fc99e Initial load
duke
parents:
diff changeset
192 return getInitStateAsInt() >= CLASS_STATE_LOADED;
a61af66fc99e Initial load
duke
parents:
diff changeset
193 }
a61af66fc99e Initial load
duke
parents:
diff changeset
194
a61af66fc99e Initial load
duke
parents:
diff changeset
195 public boolean isLinked() {
a61af66fc99e Initial load
duke
parents:
diff changeset
196 return getInitStateAsInt() >= CLASS_STATE_LINKED;
a61af66fc99e Initial load
duke
parents:
diff changeset
197 }
a61af66fc99e Initial load
duke
parents:
diff changeset
198
a61af66fc99e Initial load
duke
parents:
diff changeset
199 public boolean isInitialized() {
a61af66fc99e Initial load
duke
parents:
diff changeset
200 return getInitStateAsInt() == CLASS_STATE_FULLY_INITIALIZED;
a61af66fc99e Initial load
duke
parents:
diff changeset
201 }
a61af66fc99e Initial load
duke
parents:
diff changeset
202
a61af66fc99e Initial load
duke
parents:
diff changeset
203 public boolean isNotInitialized() {
a61af66fc99e Initial load
duke
parents:
diff changeset
204 return getInitStateAsInt() < CLASS_STATE_BEING_INITIALIZED;
a61af66fc99e Initial load
duke
parents:
diff changeset
205 }
a61af66fc99e Initial load
duke
parents:
diff changeset
206
a61af66fc99e Initial load
duke
parents:
diff changeset
207 public boolean isBeingInitialized() {
a61af66fc99e Initial load
duke
parents:
diff changeset
208 return getInitStateAsInt() == CLASS_STATE_BEING_INITIALIZED;
a61af66fc99e Initial load
duke
parents:
diff changeset
209 }
a61af66fc99e Initial load
duke
parents:
diff changeset
210
a61af66fc99e Initial load
duke
parents:
diff changeset
211 public boolean isInErrorState() {
a61af66fc99e Initial load
duke
parents:
diff changeset
212 return getInitStateAsInt() == CLASS_STATE_INITIALIZATION_ERROR;
a61af66fc99e Initial load
duke
parents:
diff changeset
213 }
a61af66fc99e Initial load
duke
parents:
diff changeset
214
a61af66fc99e Initial load
duke
parents:
diff changeset
215 public int getClassStatus() {
a61af66fc99e Initial load
duke
parents:
diff changeset
216 int result = 0;
a61af66fc99e Initial load
duke
parents:
diff changeset
217 if (isLinked()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
218 result |= JVMDIClassStatus.VERIFIED | JVMDIClassStatus.PREPARED;
a61af66fc99e Initial load
duke
parents:
diff changeset
219 }
a61af66fc99e Initial load
duke
parents:
diff changeset
220
a61af66fc99e Initial load
duke
parents:
diff changeset
221 if (isInitialized()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
222 if (Assert.ASSERTS_ENABLED) {
a61af66fc99e Initial load
duke
parents:
diff changeset
223 Assert.that(isLinked(), "Class status is not consistent");
a61af66fc99e Initial load
duke
parents:
diff changeset
224 }
a61af66fc99e Initial load
duke
parents:
diff changeset
225 result |= JVMDIClassStatus.INITIALIZED;
a61af66fc99e Initial load
duke
parents:
diff changeset
226 }
a61af66fc99e Initial load
duke
parents:
diff changeset
227
a61af66fc99e Initial load
duke
parents:
diff changeset
228 if (isInErrorState()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
229 result |= JVMDIClassStatus.ERROR;
a61af66fc99e Initial load
duke
parents:
diff changeset
230 }
a61af66fc99e Initial load
duke
parents:
diff changeset
231 return result;
a61af66fc99e Initial load
duke
parents:
diff changeset
232 }
a61af66fc99e Initial load
duke
parents:
diff changeset
233
a61af66fc99e Initial load
duke
parents:
diff changeset
234 // Byteside of the header
a61af66fc99e Initial load
duke
parents:
diff changeset
235 private static long headerSize;
a61af66fc99e Initial load
duke
parents:
diff changeset
236
2411
63997f575155 7031614: jmap -permstat fails with java.lang.InternalError in sun.jvm.hotspot.oops.OopField.getValue
never
parents: 2376
diff changeset
237 public long getObjectSize(Oop object) {
63997f575155 7031614: jmap -permstat fails with java.lang.InternalError in sun.jvm.hotspot.oops.OopField.getValue
never
parents: 2376
diff changeset
238 return getSizeHelper() * VM.getVM().getAddressSize();
63997f575155 7031614: jmap -permstat fails with java.lang.InternalError in sun.jvm.hotspot.oops.OopField.getValue
never
parents: 2376
diff changeset
239 }
63997f575155 7031614: jmap -permstat fails with java.lang.InternalError in sun.jvm.hotspot.oops.OopField.getValue
never
parents: 2376
diff changeset
240
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
241 public long getSize() {
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
242 return Oop.alignObjectSize(getHeaderSize() + Oop.alignObjectOffset(getVtableLen()) +
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
243 Oop.alignObjectOffset(getItableLen()) + Oop.alignObjectOffset(getNonstaticOopMapSize()));
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
244 }
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
245
0
a61af66fc99e Initial load
duke
parents:
diff changeset
246 public static long getHeaderSize() { return headerSize; }
a61af66fc99e Initial load
duke
parents:
diff changeset
247
3938
e6b1331a51d2 7086585: make Java field injection more flexible
never
parents: 2411
diff changeset
248 public short getFieldAccessFlags(int index) {
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
249 return getFields().at(index * FIELD_SLOTS + ACCESS_FLAGS_OFFSET);
3938
e6b1331a51d2 7086585: make Java field injection more flexible
never
parents: 2411
diff changeset
250 }
e6b1331a51d2 7086585: make Java field injection more flexible
never
parents: 2411
diff changeset
251
3962
cb315dc80374 7092278: "jmap -finalizerinfo" throws "sun.jvm.hotspot.utilities.AssertionFailure: invalid cp index 0 137"
never
parents: 3944
diff changeset
252 public short getFieldNameIndex(int index) {
cb315dc80374 7092278: "jmap -finalizerinfo" throws "sun.jvm.hotspot.utilities.AssertionFailure: invalid cp index 0 137"
never
parents: 3944
diff changeset
253 if (index >= getJavaFieldsCount()) throw new IndexOutOfBoundsException("not a Java field;");
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
254 return getFields().at(index * FIELD_SLOTS + NAME_INDEX_OFFSET);
3962
cb315dc80374 7092278: "jmap -finalizerinfo" throws "sun.jvm.hotspot.utilities.AssertionFailure: invalid cp index 0 137"
never
parents: 3944
diff changeset
255 }
cb315dc80374 7092278: "jmap -finalizerinfo" throws "sun.jvm.hotspot.utilities.AssertionFailure: invalid cp index 0 137"
never
parents: 3944
diff changeset
256
3938
e6b1331a51d2 7086585: make Java field injection more flexible
never
parents: 2411
diff changeset
257 public Symbol getFieldName(int index) {
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
258 int nameIndex = getFields().at(index * FIELD_SLOTS + NAME_INDEX_OFFSET);
3962
cb315dc80374 7092278: "jmap -finalizerinfo" throws "sun.jvm.hotspot.utilities.AssertionFailure: invalid cp index 0 137"
never
parents: 3944
diff changeset
259 if (index < getJavaFieldsCount()) {
cb315dc80374 7092278: "jmap -finalizerinfo" throws "sun.jvm.hotspot.utilities.AssertionFailure: invalid cp index 0 137"
never
parents: 3944
diff changeset
260 return getConstants().getSymbolAt(nameIndex);
cb315dc80374 7092278: "jmap -finalizerinfo" throws "sun.jvm.hotspot.utilities.AssertionFailure: invalid cp index 0 137"
never
parents: 3944
diff changeset
261 } else {
cb315dc80374 7092278: "jmap -finalizerinfo" throws "sun.jvm.hotspot.utilities.AssertionFailure: invalid cp index 0 137"
never
parents: 3944
diff changeset
262 return vmSymbols.symbolAt(nameIndex);
cb315dc80374 7092278: "jmap -finalizerinfo" throws "sun.jvm.hotspot.utilities.AssertionFailure: invalid cp index 0 137"
never
parents: 3944
diff changeset
263 }
cb315dc80374 7092278: "jmap -finalizerinfo" throws "sun.jvm.hotspot.utilities.AssertionFailure: invalid cp index 0 137"
never
parents: 3944
diff changeset
264 }
cb315dc80374 7092278: "jmap -finalizerinfo" throws "sun.jvm.hotspot.utilities.AssertionFailure: invalid cp index 0 137"
never
parents: 3944
diff changeset
265
cb315dc80374 7092278: "jmap -finalizerinfo" throws "sun.jvm.hotspot.utilities.AssertionFailure: invalid cp index 0 137"
never
parents: 3944
diff changeset
266 public short getFieldSignatureIndex(int index) {
cb315dc80374 7092278: "jmap -finalizerinfo" throws "sun.jvm.hotspot.utilities.AssertionFailure: invalid cp index 0 137"
never
parents: 3944
diff changeset
267 if (index >= getJavaFieldsCount()) throw new IndexOutOfBoundsException("not a Java field;");
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
268 return getFields().at(index * FIELD_SLOTS + SIGNATURE_INDEX_OFFSET);
3938
e6b1331a51d2 7086585: make Java field injection more flexible
never
parents: 2411
diff changeset
269 }
e6b1331a51d2 7086585: make Java field injection more flexible
never
parents: 2411
diff changeset
270
e6b1331a51d2 7086585: make Java field injection more flexible
never
parents: 2411
diff changeset
271 public Symbol getFieldSignature(int index) {
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
272 int signatureIndex = getFields().at(index * FIELD_SLOTS + SIGNATURE_INDEX_OFFSET);
3962
cb315dc80374 7092278: "jmap -finalizerinfo" throws "sun.jvm.hotspot.utilities.AssertionFailure: invalid cp index 0 137"
never
parents: 3944
diff changeset
273 if (index < getJavaFieldsCount()) {
cb315dc80374 7092278: "jmap -finalizerinfo" throws "sun.jvm.hotspot.utilities.AssertionFailure: invalid cp index 0 137"
never
parents: 3944
diff changeset
274 return getConstants().getSymbolAt(signatureIndex);
cb315dc80374 7092278: "jmap -finalizerinfo" throws "sun.jvm.hotspot.utilities.AssertionFailure: invalid cp index 0 137"
never
parents: 3944
diff changeset
275 } else {
cb315dc80374 7092278: "jmap -finalizerinfo" throws "sun.jvm.hotspot.utilities.AssertionFailure: invalid cp index 0 137"
never
parents: 3944
diff changeset
276 return vmSymbols.symbolAt(signatureIndex);
cb315dc80374 7092278: "jmap -finalizerinfo" throws "sun.jvm.hotspot.utilities.AssertionFailure: invalid cp index 0 137"
never
parents: 3944
diff changeset
277 }
cb315dc80374 7092278: "jmap -finalizerinfo" throws "sun.jvm.hotspot.utilities.AssertionFailure: invalid cp index 0 137"
never
parents: 3944
diff changeset
278 }
cb315dc80374 7092278: "jmap -finalizerinfo" throws "sun.jvm.hotspot.utilities.AssertionFailure: invalid cp index 0 137"
never
parents: 3944
diff changeset
279
cb315dc80374 7092278: "jmap -finalizerinfo" throws "sun.jvm.hotspot.utilities.AssertionFailure: invalid cp index 0 137"
never
parents: 3944
diff changeset
280 public short getFieldGenericSignatureIndex(int index) {
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
281 int len = getFields().length();
6100
71afdabfd05b 7168280: Eliminate the generic signature index slot from field array for field without generic signature.
jiangli
parents: 5998
diff changeset
282 int allFieldsCount = getAllFieldsCount();
71afdabfd05b 7168280: Eliminate the generic signature index slot from field array for field without generic signature.
jiangli
parents: 5998
diff changeset
283 int generic_signature_slot = allFieldsCount * FIELD_SLOTS;
71afdabfd05b 7168280: Eliminate the generic signature index slot from field array for field without generic signature.
jiangli
parents: 5998
diff changeset
284 for (int i = 0; i < allFieldsCount; i++) {
71afdabfd05b 7168280: Eliminate the generic signature index slot from field array for field without generic signature.
jiangli
parents: 5998
diff changeset
285 short flags = getFieldAccessFlags(i);
71afdabfd05b 7168280: Eliminate the generic signature index slot from field array for field without generic signature.
jiangli
parents: 5998
diff changeset
286 AccessFlags access = new AccessFlags(flags);
71afdabfd05b 7168280: Eliminate the generic signature index slot from field array for field without generic signature.
jiangli
parents: 5998
diff changeset
287 if (i == index) {
71afdabfd05b 7168280: Eliminate the generic signature index slot from field array for field without generic signature.
jiangli
parents: 5998
diff changeset
288 if (access.fieldHasGenericSignature()) {
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
289 return getFields().at(generic_signature_slot);
6100
71afdabfd05b 7168280: Eliminate the generic signature index slot from field array for field without generic signature.
jiangli
parents: 5998
diff changeset
290 } else {
71afdabfd05b 7168280: Eliminate the generic signature index slot from field array for field without generic signature.
jiangli
parents: 5998
diff changeset
291 return 0;
71afdabfd05b 7168280: Eliminate the generic signature index slot from field array for field without generic signature.
jiangli
parents: 5998
diff changeset
292 }
71afdabfd05b 7168280: Eliminate the generic signature index slot from field array for field without generic signature.
jiangli
parents: 5998
diff changeset
293 } else {
71afdabfd05b 7168280: Eliminate the generic signature index slot from field array for field without generic signature.
jiangli
parents: 5998
diff changeset
294 if (access.fieldHasGenericSignature()) {
71afdabfd05b 7168280: Eliminate the generic signature index slot from field array for field without generic signature.
jiangli
parents: 5998
diff changeset
295 generic_signature_slot ++;
71afdabfd05b 7168280: Eliminate the generic signature index slot from field array for field without generic signature.
jiangli
parents: 5998
diff changeset
296 }
71afdabfd05b 7168280: Eliminate the generic signature index slot from field array for field without generic signature.
jiangli
parents: 5998
diff changeset
297 }
71afdabfd05b 7168280: Eliminate the generic signature index slot from field array for field without generic signature.
jiangli
parents: 5998
diff changeset
298 }
71afdabfd05b 7168280: Eliminate the generic signature index slot from field array for field without generic signature.
jiangli
parents: 5998
diff changeset
299 return 0;
3938
e6b1331a51d2 7086585: make Java field injection more flexible
never
parents: 2411
diff changeset
300 }
e6b1331a51d2 7086585: make Java field injection more flexible
never
parents: 2411
diff changeset
301
e6b1331a51d2 7086585: make Java field injection more flexible
never
parents: 2411
diff changeset
302 public Symbol getFieldGenericSignature(int index) {
3962
cb315dc80374 7092278: "jmap -finalizerinfo" throws "sun.jvm.hotspot.utilities.AssertionFailure: invalid cp index 0 137"
never
parents: 3944
diff changeset
303 short genericSignatureIndex = getFieldGenericSignatureIndex(index);
3938
e6b1331a51d2 7086585: make Java field injection more flexible
never
parents: 2411
diff changeset
304 if (genericSignatureIndex != 0) {
e6b1331a51d2 7086585: make Java field injection more flexible
never
parents: 2411
diff changeset
305 return getConstants().getSymbolAt(genericSignatureIndex);
e6b1331a51d2 7086585: make Java field injection more flexible
never
parents: 2411
diff changeset
306 }
e6b1331a51d2 7086585: make Java field injection more flexible
never
parents: 2411
diff changeset
307 return null;
e6b1331a51d2 7086585: make Java field injection more flexible
never
parents: 2411
diff changeset
308 }
e6b1331a51d2 7086585: make Java field injection more flexible
never
parents: 2411
diff changeset
309
3962
cb315dc80374 7092278: "jmap -finalizerinfo" throws "sun.jvm.hotspot.utilities.AssertionFailure: invalid cp index 0 137"
never
parents: 3944
diff changeset
310 public short getFieldInitialValueIndex(int index) {
cb315dc80374 7092278: "jmap -finalizerinfo" throws "sun.jvm.hotspot.utilities.AssertionFailure: invalid cp index 0 137"
never
parents: 3944
diff changeset
311 if (index >= getJavaFieldsCount()) throw new IndexOutOfBoundsException("not a Java field;");
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
312 return getFields().at(index * FIELD_SLOTS + INITVAL_INDEX_OFFSET);
3962
cb315dc80374 7092278: "jmap -finalizerinfo" throws "sun.jvm.hotspot.utilities.AssertionFailure: invalid cp index 0 137"
never
parents: 3944
diff changeset
313 }
cb315dc80374 7092278: "jmap -finalizerinfo" throws "sun.jvm.hotspot.utilities.AssertionFailure: invalid cp index 0 137"
never
parents: 3944
diff changeset
314
3938
e6b1331a51d2 7086585: make Java field injection more flexible
never
parents: 2411
diff changeset
315 public int getFieldOffset(int index) {
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
316 U2Array fields = getFields();
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
317 return VM.getVM().buildIntFromShorts(fields.at(index * FIELD_SLOTS + LOW_OFFSET),
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
318 fields.at(index * FIELD_SLOTS + HIGH_OFFSET));
3938
e6b1331a51d2 7086585: make Java field injection more flexible
never
parents: 2411
diff changeset
319 }
e6b1331a51d2 7086585: make Java field injection more flexible
never
parents: 2411
diff changeset
320
0
a61af66fc99e Initial load
duke
parents:
diff changeset
321 // Accessors for declared fields
a61af66fc99e Initial load
duke
parents:
diff changeset
322 public Klass getArrayKlasses() { return (Klass) arrayKlasses.getValue(this); }
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
323 public MethodArray getMethods() { return new MethodArray(methods.getValue(getAddress())); }
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
324 public KlassArray getLocalInterfaces() { return new KlassArray(localInterfaces.getValue(getAddress())); }
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
325 public KlassArray getTransitiveInterfaces() { return new KlassArray(transitiveInterfaces.getValue(getAddress())); }
3938
e6b1331a51d2 7086585: make Java field injection more flexible
never
parents: 2411
diff changeset
326 public int getJavaFieldsCount() { return (int) javaFieldsCount.getValue(this); }
6100
71afdabfd05b 7168280: Eliminate the generic signature index slot from field array for field without generic signature.
jiangli
parents: 5998
diff changeset
327 public int getAllFieldsCount() {
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
328 int len = getFields().length();
6100
71afdabfd05b 7168280: Eliminate the generic signature index slot from field array for field without generic signature.
jiangli
parents: 5998
diff changeset
329 int allFieldsCount = 0;
71afdabfd05b 7168280: Eliminate the generic signature index slot from field array for field without generic signature.
jiangli
parents: 5998
diff changeset
330 for (; allFieldsCount*FIELD_SLOTS < len; allFieldsCount++) {
71afdabfd05b 7168280: Eliminate the generic signature index slot from field array for field without generic signature.
jiangli
parents: 5998
diff changeset
331 short flags = getFieldAccessFlags(allFieldsCount);
71afdabfd05b 7168280: Eliminate the generic signature index slot from field array for field without generic signature.
jiangli
parents: 5998
diff changeset
332 AccessFlags access = new AccessFlags(flags);
71afdabfd05b 7168280: Eliminate the generic signature index slot from field array for field without generic signature.
jiangli
parents: 5998
diff changeset
333 if (access.fieldHasGenericSignature()) {
71afdabfd05b 7168280: Eliminate the generic signature index slot from field array for field without generic signature.
jiangli
parents: 5998
diff changeset
334 len --;
71afdabfd05b 7168280: Eliminate the generic signature index slot from field array for field without generic signature.
jiangli
parents: 5998
diff changeset
335 }
71afdabfd05b 7168280: Eliminate the generic signature index slot from field array for field without generic signature.
jiangli
parents: 5998
diff changeset
336 }
71afdabfd05b 7168280: Eliminate the generic signature index slot from field array for field without generic signature.
jiangli
parents: 5998
diff changeset
337 return allFieldsCount;
71afdabfd05b 7168280: Eliminate the generic signature index slot from field array for field without generic signature.
jiangli
parents: 5998
diff changeset
338 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
339 public ConstantPool getConstants() { return (ConstantPool) constants.getValue(this); }
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
340 public ClassLoaderData getClassLoaderData() { return ClassLoaderData.instantiateWrapperFor(classLoaderData.getValue(getAddress())); }
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
341 public Oop getClassLoader() { return getClassLoaderData().getClassLoader(); }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
342 public Oop getProtectionDomain() { return protectionDomain.getValue(this); }
a61af66fc99e Initial load
duke
parents:
diff changeset
343 public ObjArray getSigners() { return (ObjArray) signers.getValue(this); }
2177
3582bf76420e 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 1552
diff changeset
344 public Symbol getSourceFileName() { return getSymbol(sourceFileName); }
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
345 public String getSourceDebugExtension(){ return CStringUtilities.getString(sourceDebugExtension.getValue(getAddress())); }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
346 public long getNonstaticFieldSize() { return nonstaticFieldSize.getValue(this); }
2376
c7f3d0b4570f 7017732: move static fields into Class to prepare for perm gen removal
never
parents: 2177
diff changeset
347 public long getStaticOopFieldCount() { return staticOopFieldCount.getValue(this); }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
348 public long getNonstaticOopMapSize() { return nonstaticOopMapSize.getValue(this); }
4772
8f8b94305aff 7129240: backout fix for 7102776 until 7128770 is resolved
dcubed
parents: 4737
diff changeset
349 public boolean getIsMarkedDependent() { return isMarkedDependent.getValue(this) != 0; }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
350 public long getVtableLen() { return vtableLen.getValue(this); }
a61af66fc99e Initial load
duke
parents:
diff changeset
351 public long getItableLen() { return itableLen.getValue(this); }
2177
3582bf76420e 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 1552
diff changeset
352 public Symbol getGenericSignature() { return getSymbol(genericSignature); }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
353 public long majorVersion() { return majorVersion.getValue(this); }
a61af66fc99e Initial load
duke
parents:
diff changeset
354 public long minorVersion() { return minorVersion.getValue(this); }
a61af66fc99e Initial load
duke
parents:
diff changeset
355
a61af66fc99e Initial load
duke
parents:
diff changeset
356 // "size helper" == instance size in words
a61af66fc99e Initial load
duke
parents:
diff changeset
357 public long getSizeHelper() {
a61af66fc99e Initial load
duke
parents:
diff changeset
358 int lh = getLayoutHelper();
a61af66fc99e Initial load
duke
parents:
diff changeset
359 if (Assert.ASSERTS_ENABLED) {
a61af66fc99e Initial load
duke
parents:
diff changeset
360 Assert.that(lh > 0, "layout helper initialized for instance class");
a61af66fc99e Initial load
duke
parents:
diff changeset
361 }
a61af66fc99e Initial load
duke
parents:
diff changeset
362 return lh / VM.getVM().getAddressSize();
a61af66fc99e Initial load
duke
parents:
diff changeset
363 }
a61af66fc99e Initial load
duke
parents:
diff changeset
364
a61af66fc99e Initial load
duke
parents:
diff changeset
365 // same as enum InnerClassAttributeOffset in VM code.
a61af66fc99e Initial load
duke
parents:
diff changeset
366 public static interface InnerClassAttributeOffset {
a61af66fc99e Initial load
duke
parents:
diff changeset
367 // from JVM spec. "InnerClasses" attribute
a61af66fc99e Initial load
duke
parents:
diff changeset
368 public static final int innerClassInnerClassInfoOffset = 0;
a61af66fc99e Initial load
duke
parents:
diff changeset
369 public static final int innerClassOuterClassInfoOffset = 1;
a61af66fc99e Initial load
duke
parents:
diff changeset
370 public static final int innerClassInnerNameOffset = 2;
a61af66fc99e Initial load
duke
parents:
diff changeset
371 public static final int innerClassAccessFlagsOffset = 3;
a61af66fc99e Initial load
duke
parents:
diff changeset
372 public static final int innerClassNextOffset = 4;
a61af66fc99e Initial load
duke
parents:
diff changeset
373 };
a61af66fc99e Initial load
duke
parents:
diff changeset
374
5967
f7c4174b33ba 7109878: The instanceKlass EnclosingMethhod attribute fields can be folded into the _inner_class field.
jiangli
parents: 4772
diff changeset
375 public static interface EnclosingMethodAttributeOffset {
f7c4174b33ba 7109878: The instanceKlass EnclosingMethhod attribute fields can be folded into the _inner_class field.
jiangli
parents: 4772
diff changeset
376 public static final int enclosing_method_class_index_offset = 0;
f7c4174b33ba 7109878: The instanceKlass EnclosingMethhod attribute fields can be folded into the _inner_class field.
jiangli
parents: 4772
diff changeset
377 public static final int enclosing_method_method_index_offset = 1;
f7c4174b33ba 7109878: The instanceKlass EnclosingMethhod attribute fields can be folded into the _inner_class field.
jiangli
parents: 4772
diff changeset
378 public static final int enclosing_method_attribute_size = 2;
f7c4174b33ba 7109878: The instanceKlass EnclosingMethhod attribute fields can be folded into the _inner_class field.
jiangli
parents: 4772
diff changeset
379 };
f7c4174b33ba 7109878: The instanceKlass EnclosingMethhod attribute fields can be folded into the _inner_class field.
jiangli
parents: 4772
diff changeset
380
0
a61af66fc99e Initial load
duke
parents:
diff changeset
381 // refer to compute_modifier_flags in VM code.
a61af66fc99e Initial load
duke
parents:
diff changeset
382 public long computeModifierFlags() {
a61af66fc99e Initial load
duke
parents:
diff changeset
383 long access = getAccessFlags();
a61af66fc99e Initial load
duke
parents:
diff changeset
384 // But check if it happens to be member class.
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
385 U2Array innerClassList = getInnerClasses();
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
386 int length = (innerClassList == null)? 0 : (int) innerClassList.length();
0
a61af66fc99e Initial load
duke
parents:
diff changeset
387 if (length > 0) {
a61af66fc99e Initial load
duke
parents:
diff changeset
388 if (Assert.ASSERTS_ENABLED) {
5967
f7c4174b33ba 7109878: The instanceKlass EnclosingMethhod attribute fields can be folded into the _inner_class field.
jiangli
parents: 4772
diff changeset
389 Assert.that(length % InnerClassAttributeOffset.innerClassNextOffset == 0 ||
f7c4174b33ba 7109878: The instanceKlass EnclosingMethhod attribute fields can be folded into the _inner_class field.
jiangli
parents: 4772
diff changeset
390 length % InnerClassAttributeOffset.innerClassNextOffset == EnclosingMethodAttributeOffset.enclosing_method_attribute_size,
f7c4174b33ba 7109878: The instanceKlass EnclosingMethhod attribute fields can be folded into the _inner_class field.
jiangli
parents: 4772
diff changeset
391 "just checking");
0
a61af66fc99e Initial load
duke
parents:
diff changeset
392 }
a61af66fc99e Initial load
duke
parents:
diff changeset
393 for (int i = 0; i < length; i += InnerClassAttributeOffset.innerClassNextOffset) {
5967
f7c4174b33ba 7109878: The instanceKlass EnclosingMethhod attribute fields can be folded into the _inner_class field.
jiangli
parents: 4772
diff changeset
394 if (i == length - EnclosingMethodAttributeOffset.enclosing_method_attribute_size) {
f7c4174b33ba 7109878: The instanceKlass EnclosingMethhod attribute fields can be folded into the _inner_class field.
jiangli
parents: 4772
diff changeset
395 break;
f7c4174b33ba 7109878: The instanceKlass EnclosingMethhod attribute fields can be folded into the _inner_class field.
jiangli
parents: 4772
diff changeset
396 }
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
397 int ioff = innerClassList.at(i +
0
a61af66fc99e Initial load
duke
parents:
diff changeset
398 InnerClassAttributeOffset.innerClassInnerClassInfoOffset);
a61af66fc99e Initial load
duke
parents:
diff changeset
399 // 'ioff' can be zero.
a61af66fc99e Initial load
duke
parents:
diff changeset
400 // refer to JVM spec. section 4.7.5.
a61af66fc99e Initial load
duke
parents:
diff changeset
401 if (ioff != 0) {
a61af66fc99e Initial load
duke
parents:
diff changeset
402 // only look at classes that are already loaded
a61af66fc99e Initial load
duke
parents:
diff changeset
403 // since we are looking for the flags for our self.
2177
3582bf76420e 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 1552
diff changeset
404 ConstantPool.CPSlot classInfo = getConstants().getSlotAt(ioff);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
405 Symbol name = null;
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
406 if (classInfo.isResolved()) {
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
407 name = classInfo.getKlass().getName();
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
408 } else if (classInfo.isUnresolved()) {
2177
3582bf76420e 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 1552
diff changeset
409 name = classInfo.getSymbol();
0
a61af66fc99e Initial load
duke
parents:
diff changeset
410 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
411 throw new RuntimeException("should not reach here");
a61af66fc99e Initial load
duke
parents:
diff changeset
412 }
a61af66fc99e Initial load
duke
parents:
diff changeset
413
a61af66fc99e Initial load
duke
parents:
diff changeset
414 if (name.equals(getName())) {
a61af66fc99e Initial load
duke
parents:
diff changeset
415 // This is really a member class
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
416 access = innerClassList.at(i +
0
a61af66fc99e Initial load
duke
parents:
diff changeset
417 InnerClassAttributeOffset.innerClassAccessFlagsOffset);
a61af66fc99e Initial load
duke
parents:
diff changeset
418 break;
a61af66fc99e Initial load
duke
parents:
diff changeset
419 }
a61af66fc99e Initial load
duke
parents:
diff changeset
420 }
a61af66fc99e Initial load
duke
parents:
diff changeset
421 } // for inner classes
a61af66fc99e Initial load
duke
parents:
diff changeset
422 }
a61af66fc99e Initial load
duke
parents:
diff changeset
423
a61af66fc99e Initial load
duke
parents:
diff changeset
424 // Remember to strip ACC_SUPER bit
a61af66fc99e Initial load
duke
parents:
diff changeset
425 return (access & (~JVM_ACC_SUPER)) & JVM_ACC_WRITTEN_FLAGS;
a61af66fc99e Initial load
duke
parents:
diff changeset
426 }
a61af66fc99e Initial load
duke
parents:
diff changeset
427
a61af66fc99e Initial load
duke
parents:
diff changeset
428
a61af66fc99e Initial load
duke
parents:
diff changeset
429 // whether given Symbol is name of an inner/nested Klass of this Klass?
a61af66fc99e Initial load
duke
parents:
diff changeset
430 // anonymous and local classes are excluded.
a61af66fc99e Initial load
duke
parents:
diff changeset
431 public boolean isInnerClassName(Symbol sym) {
a61af66fc99e Initial load
duke
parents:
diff changeset
432 return isInInnerClasses(sym, false);
a61af66fc99e Initial load
duke
parents:
diff changeset
433 }
a61af66fc99e Initial load
duke
parents:
diff changeset
434
a61af66fc99e Initial load
duke
parents:
diff changeset
435 // whether given Symbol is name of an inner/nested Klass of this Klass?
a61af66fc99e Initial load
duke
parents:
diff changeset
436 // anonymous classes excluded, but local classes are included.
a61af66fc99e Initial load
duke
parents:
diff changeset
437 public boolean isInnerOrLocalClassName(Symbol sym) {
a61af66fc99e Initial load
duke
parents:
diff changeset
438 return isInInnerClasses(sym, true);
a61af66fc99e Initial load
duke
parents:
diff changeset
439 }
a61af66fc99e Initial load
duke
parents:
diff changeset
440
a61af66fc99e Initial load
duke
parents:
diff changeset
441 private boolean isInInnerClasses(Symbol sym, boolean includeLocals) {
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
442 U2Array innerClassList = getInnerClasses();
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
443 int length = ( innerClassList == null)? 0 : (int) innerClassList.length();
0
a61af66fc99e Initial load
duke
parents:
diff changeset
444 if (length > 0) {
a61af66fc99e Initial load
duke
parents:
diff changeset
445 if (Assert.ASSERTS_ENABLED) {
5967
f7c4174b33ba 7109878: The instanceKlass EnclosingMethhod attribute fields can be folded into the _inner_class field.
jiangli
parents: 4772
diff changeset
446 Assert.that(length % InnerClassAttributeOffset.innerClassNextOffset == 0 ||
f7c4174b33ba 7109878: The instanceKlass EnclosingMethhod attribute fields can be folded into the _inner_class field.
jiangli
parents: 4772
diff changeset
447 length % InnerClassAttributeOffset.innerClassNextOffset == EnclosingMethodAttributeOffset.enclosing_method_attribute_size,
f7c4174b33ba 7109878: The instanceKlass EnclosingMethhod attribute fields can be folded into the _inner_class field.
jiangli
parents: 4772
diff changeset
448 "just checking");
0
a61af66fc99e Initial load
duke
parents:
diff changeset
449 }
a61af66fc99e Initial load
duke
parents:
diff changeset
450 for (int i = 0; i < length; i += InnerClassAttributeOffset.innerClassNextOffset) {
5967
f7c4174b33ba 7109878: The instanceKlass EnclosingMethhod attribute fields can be folded into the _inner_class field.
jiangli
parents: 4772
diff changeset
451 if (i == length - EnclosingMethodAttributeOffset.enclosing_method_attribute_size) {
f7c4174b33ba 7109878: The instanceKlass EnclosingMethhod attribute fields can be folded into the _inner_class field.
jiangli
parents: 4772
diff changeset
452 break;
f7c4174b33ba 7109878: The instanceKlass EnclosingMethhod attribute fields can be folded into the _inner_class field.
jiangli
parents: 4772
diff changeset
453 }
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
454 int ioff = innerClassList.at(i +
0
a61af66fc99e Initial load
duke
parents:
diff changeset
455 InnerClassAttributeOffset.innerClassInnerClassInfoOffset);
a61af66fc99e Initial load
duke
parents:
diff changeset
456 // 'ioff' can be zero.
a61af66fc99e Initial load
duke
parents:
diff changeset
457 // refer to JVM spec. section 4.7.5.
a61af66fc99e Initial load
duke
parents:
diff changeset
458 if (ioff != 0) {
2177
3582bf76420e 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 1552
diff changeset
459 ConstantPool.CPSlot iclassInfo = getConstants().getSlotAt(ioff);
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
460 Symbol innerName = getConstants().getKlassNameAt(ioff);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
461 Symbol myname = getName();
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
462 int ooff = innerClassList.at(i +
0
a61af66fc99e Initial load
duke
parents:
diff changeset
463 InnerClassAttributeOffset.innerClassOuterClassInfoOffset);
a61af66fc99e Initial load
duke
parents:
diff changeset
464 // for anonymous classes inner_name_index of InnerClasses
a61af66fc99e Initial load
duke
parents:
diff changeset
465 // attribute is zero.
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
466 int innerNameIndex = innerClassList.at(i +
0
a61af66fc99e Initial load
duke
parents:
diff changeset
467 InnerClassAttributeOffset.innerClassInnerNameOffset);
a61af66fc99e Initial load
duke
parents:
diff changeset
468 // if this is not a member (anonymous, local etc.), 'ooff' will be zero
a61af66fc99e Initial load
duke
parents:
diff changeset
469 // refer to JVM spec. section 4.7.5.
a61af66fc99e Initial load
duke
parents:
diff changeset
470 if (ooff == 0) {
a61af66fc99e Initial load
duke
parents:
diff changeset
471 if (includeLocals) {
a61af66fc99e Initial load
duke
parents:
diff changeset
472 // does it looks like my local class?
a61af66fc99e Initial load
duke
parents:
diff changeset
473 if (innerName.equals(sym) &&
a61af66fc99e Initial load
duke
parents:
diff changeset
474 innerName.asString().startsWith(myname.asString())) {
a61af66fc99e Initial load
duke
parents:
diff changeset
475 // exclude anonymous classes.
a61af66fc99e Initial load
duke
parents:
diff changeset
476 return (innerNameIndex != 0);
a61af66fc99e Initial load
duke
parents:
diff changeset
477 }
a61af66fc99e Initial load
duke
parents:
diff changeset
478 }
a61af66fc99e Initial load
duke
parents:
diff changeset
479 } else {
2177
3582bf76420e 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 1552
diff changeset
480 ConstantPool.CPSlot oclassInfo = getConstants().getSlotAt(ooff);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
481 Symbol outerName = null;
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
482 if (oclassInfo.isResolved()) {
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
483 outerName = oclassInfo.getKlass().getName();
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
484 } else if (oclassInfo.isUnresolved()) {
2177
3582bf76420e 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 1552
diff changeset
485 outerName = oclassInfo.getSymbol();
0
a61af66fc99e Initial load
duke
parents:
diff changeset
486 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
487 throw new RuntimeException("should not reach here");
a61af66fc99e Initial load
duke
parents:
diff changeset
488 }
a61af66fc99e Initial load
duke
parents:
diff changeset
489
a61af66fc99e Initial load
duke
parents:
diff changeset
490 // include only if current class is outer class.
a61af66fc99e Initial load
duke
parents:
diff changeset
491 if (outerName.equals(myname) && innerName.equals(sym)) {
a61af66fc99e Initial load
duke
parents:
diff changeset
492 return true;
a61af66fc99e Initial load
duke
parents:
diff changeset
493 }
a61af66fc99e Initial load
duke
parents:
diff changeset
494 }
a61af66fc99e Initial load
duke
parents:
diff changeset
495 }
a61af66fc99e Initial load
duke
parents:
diff changeset
496 } // for inner classes
a61af66fc99e Initial load
duke
parents:
diff changeset
497 return false;
a61af66fc99e Initial load
duke
parents:
diff changeset
498 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
499 return false;
a61af66fc99e Initial load
duke
parents:
diff changeset
500 }
a61af66fc99e Initial load
duke
parents:
diff changeset
501 }
a61af66fc99e Initial load
duke
parents:
diff changeset
502
a61af66fc99e Initial load
duke
parents:
diff changeset
503 public boolean implementsInterface(Klass k) {
a61af66fc99e Initial load
duke
parents:
diff changeset
504 if (Assert.ASSERTS_ENABLED) {
a61af66fc99e Initial load
duke
parents:
diff changeset
505 Assert.that(k.isInterface(), "should not reach here");
a61af66fc99e Initial load
duke
parents:
diff changeset
506 }
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
507 KlassArray interfaces = getTransitiveInterfaces();
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
508 final int len = interfaces.length();
0
a61af66fc99e Initial load
duke
parents:
diff changeset
509 for (int i = 0; i < len; i++) {
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
510 if (interfaces.getAt(i).equals(k)) return true;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
511 }
a61af66fc99e Initial load
duke
parents:
diff changeset
512 return false;
a61af66fc99e Initial load
duke
parents:
diff changeset
513 }
a61af66fc99e Initial load
duke
parents:
diff changeset
514
a61af66fc99e Initial load
duke
parents:
diff changeset
515 boolean computeSubtypeOf(Klass k) {
a61af66fc99e Initial load
duke
parents:
diff changeset
516 if (k.isInterface()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
517 return implementsInterface(k);
a61af66fc99e Initial load
duke
parents:
diff changeset
518 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
519 return super.computeSubtypeOf(k);
a61af66fc99e Initial load
duke
parents:
diff changeset
520 }
a61af66fc99e Initial load
duke
parents:
diff changeset
521 }
a61af66fc99e Initial load
duke
parents:
diff changeset
522
a61af66fc99e Initial load
duke
parents:
diff changeset
523 public void printValueOn(PrintStream tty) {
a61af66fc99e Initial load
duke
parents:
diff changeset
524 tty.print("InstanceKlass for " + getName().asString());
a61af66fc99e Initial load
duke
parents:
diff changeset
525 }
a61af66fc99e Initial load
duke
parents:
diff changeset
526
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
527 public void iterateFields(MetadataVisitor visitor) {
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
528 super.iterateFields(visitor);
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
529 visitor.doMetadata(arrayKlasses, true);
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
530 // visitor.doOop(methods, true);
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
531 // visitor.doOop(localInterfaces, true);
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
532 // visitor.doOop(transitiveInterfaces, true);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
533 visitor.doOop(protectionDomain, true);
a61af66fc99e Initial load
duke
parents:
diff changeset
534 visitor.doOop(signers, true);
a61af66fc99e Initial load
duke
parents:
diff changeset
535 visitor.doCInt(nonstaticFieldSize, true);
a61af66fc99e Initial load
duke
parents:
diff changeset
536 visitor.doCInt(staticFieldSize, true);
2376
c7f3d0b4570f 7017732: move static fields into Class to prepare for perm gen removal
never
parents: 2177
diff changeset
537 visitor.doCInt(staticOopFieldCount, true);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
538 visitor.doCInt(nonstaticOopMapSize, true);
4772
8f8b94305aff 7129240: backout fix for 7102776 until 7128770 is resolved
dcubed
parents: 4737
diff changeset
539 visitor.doCInt(isMarkedDependent, true);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
540 visitor.doCInt(initState, true);
a61af66fc99e Initial load
duke
parents:
diff changeset
541 visitor.doCInt(vtableLen, true);
a61af66fc99e Initial load
duke
parents:
diff changeset
542 visitor.doCInt(itableLen, true);
a61af66fc99e Initial load
duke
parents:
diff changeset
543 }
a61af66fc99e Initial load
duke
parents:
diff changeset
544
2411
63997f575155 7031614: jmap -permstat fails with java.lang.InternalError in sun.jvm.hotspot.oops.OopField.getValue
never
parents: 2376
diff changeset
545 /*
63997f575155 7031614: jmap -permstat fails with java.lang.InternalError in sun.jvm.hotspot.oops.OopField.getValue
never
parents: 2376
diff changeset
546 * Visit the static fields of this InstanceKlass with the obj of
63997f575155 7031614: jmap -permstat fails with java.lang.InternalError in sun.jvm.hotspot.oops.OopField.getValue
never
parents: 2376
diff changeset
547 * the visitor set to the oop holding the fields, which is
63997f575155 7031614: jmap -permstat fails with java.lang.InternalError in sun.jvm.hotspot.oops.OopField.getValue
never
parents: 2376
diff changeset
548 * currently the java mirror.
63997f575155 7031614: jmap -permstat fails with java.lang.InternalError in sun.jvm.hotspot.oops.OopField.getValue
never
parents: 2376
diff changeset
549 */
63997f575155 7031614: jmap -permstat fails with java.lang.InternalError in sun.jvm.hotspot.oops.OopField.getValue
never
parents: 2376
diff changeset
550 public void iterateStaticFields(OopVisitor visitor) {
63997f575155 7031614: jmap -permstat fails with java.lang.InternalError in sun.jvm.hotspot.oops.OopField.getValue
never
parents: 2376
diff changeset
551 visitor.setObj(getJavaMirror());
63997f575155 7031614: jmap -permstat fails with java.lang.InternalError in sun.jvm.hotspot.oops.OopField.getValue
never
parents: 2376
diff changeset
552 visitor.prologue();
63997f575155 7031614: jmap -permstat fails with java.lang.InternalError in sun.jvm.hotspot.oops.OopField.getValue
never
parents: 2376
diff changeset
553 iterateStaticFieldsInternal(visitor);
63997f575155 7031614: jmap -permstat fails with java.lang.InternalError in sun.jvm.hotspot.oops.OopField.getValue
never
parents: 2376
diff changeset
554 visitor.epilogue();
63997f575155 7031614: jmap -permstat fails with java.lang.InternalError in sun.jvm.hotspot.oops.OopField.getValue
never
parents: 2376
diff changeset
555
63997f575155 7031614: jmap -permstat fails with java.lang.InternalError in sun.jvm.hotspot.oops.OopField.getValue
never
parents: 2376
diff changeset
556 }
63997f575155 7031614: jmap -permstat fails with java.lang.InternalError in sun.jvm.hotspot.oops.OopField.getValue
never
parents: 2376
diff changeset
557
63997f575155 7031614: jmap -permstat fails with java.lang.InternalError in sun.jvm.hotspot.oops.OopField.getValue
never
parents: 2376
diff changeset
558 void iterateStaticFieldsInternal(OopVisitor visitor) {
3938
e6b1331a51d2 7086585: make Java field injection more flexible
never
parents: 2411
diff changeset
559 int length = getJavaFieldsCount();
3944
35c656d0b685 7090654: nightly failures after 7086585
never
parents: 3939
diff changeset
560 for (int index = 0; index < length; index++) {
35c656d0b685 7090654: nightly failures after 7086585
never
parents: 3939
diff changeset
561 short accessFlags = getFieldAccessFlags(index);
35c656d0b685 7090654: nightly failures after 7086585
never
parents: 3939
diff changeset
562 FieldType type = new FieldType(getFieldSignature(index));
0
a61af66fc99e Initial load
duke
parents:
diff changeset
563 AccessFlags access = new AccessFlags(accessFlags);
a61af66fc99e Initial load
duke
parents:
diff changeset
564 if (access.isStatic()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
565 visitField(visitor, type, index);
a61af66fc99e Initial load
duke
parents:
diff changeset
566 }
a61af66fc99e Initial load
duke
parents:
diff changeset
567 }
a61af66fc99e Initial load
duke
parents:
diff changeset
568 }
a61af66fc99e Initial load
duke
parents:
diff changeset
569
a61af66fc99e Initial load
duke
parents:
diff changeset
570 public Klass getJavaSuper() {
a61af66fc99e Initial load
duke
parents:
diff changeset
571 return getSuper();
a61af66fc99e Initial load
duke
parents:
diff changeset
572 }
a61af66fc99e Initial load
duke
parents:
diff changeset
573
3939
f6f3bb0ee072 7088955: add C2 IR support to the SA
never
parents: 3938
diff changeset
574 public static class StaticField {
f6f3bb0ee072 7088955: add C2 IR support to the SA
never
parents: 3938
diff changeset
575 public AccessFlags flags;
f6f3bb0ee072 7088955: add C2 IR support to the SA
never
parents: 3938
diff changeset
576 public Field field;
f6f3bb0ee072 7088955: add C2 IR support to the SA
never
parents: 3938
diff changeset
577
f6f3bb0ee072 7088955: add C2 IR support to the SA
never
parents: 3938
diff changeset
578 StaticField(Field field, AccessFlags flags) {
f6f3bb0ee072 7088955: add C2 IR support to the SA
never
parents: 3938
diff changeset
579 this.field = field;
f6f3bb0ee072 7088955: add C2 IR support to the SA
never
parents: 3938
diff changeset
580 this.flags = flags;
f6f3bb0ee072 7088955: add C2 IR support to the SA
never
parents: 3938
diff changeset
581 }
f6f3bb0ee072 7088955: add C2 IR support to the SA
never
parents: 3938
diff changeset
582 }
f6f3bb0ee072 7088955: add C2 IR support to the SA
never
parents: 3938
diff changeset
583
2411
63997f575155 7031614: jmap -permstat fails with java.lang.InternalError in sun.jvm.hotspot.oops.OopField.getValue
never
parents: 2376
diff changeset
584 public void iterateNonStaticFields(OopVisitor visitor, Oop obj) {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
585 if (getSuper() != null) {
2411
63997f575155 7031614: jmap -permstat fails with java.lang.InternalError in sun.jvm.hotspot.oops.OopField.getValue
never
parents: 2376
diff changeset
586 ((InstanceKlass) getSuper()).iterateNonStaticFields(visitor, obj);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
587 }
3938
e6b1331a51d2 7086585: make Java field injection more flexible
never
parents: 2411
diff changeset
588 int length = getJavaFieldsCount();
3944
35c656d0b685 7090654: nightly failures after 7086585
never
parents: 3939
diff changeset
589 for (int index = 0; index < length; index++) {
35c656d0b685 7090654: nightly failures after 7086585
never
parents: 3939
diff changeset
590 short accessFlags = getFieldAccessFlags(index);
35c656d0b685 7090654: nightly failures after 7086585
never
parents: 3939
diff changeset
591 FieldType type = new FieldType(getFieldSignature(index));
0
a61af66fc99e Initial load
duke
parents:
diff changeset
592 AccessFlags access = new AccessFlags(accessFlags);
a61af66fc99e Initial load
duke
parents:
diff changeset
593 if (!access.isStatic()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
594 visitField(visitor, type, index);
a61af66fc99e Initial load
duke
parents:
diff changeset
595 }
a61af66fc99e Initial load
duke
parents:
diff changeset
596 }
a61af66fc99e Initial load
duke
parents:
diff changeset
597 }
a61af66fc99e Initial load
duke
parents:
diff changeset
598
a61af66fc99e Initial load
duke
parents:
diff changeset
599 /** Field access by name. */
a61af66fc99e Initial load
duke
parents:
diff changeset
600 public Field findLocalField(Symbol name, Symbol sig) {
3962
cb315dc80374 7092278: "jmap -finalizerinfo" throws "sun.jvm.hotspot.utilities.AssertionFailure: invalid cp index 0 137"
never
parents: 3944
diff changeset
601 int length = getJavaFieldsCount();
3944
35c656d0b685 7090654: nightly failures after 7086585
never
parents: 3939
diff changeset
602 for (int i = 0; i < length; i++) {
35c656d0b685 7090654: nightly failures after 7086585
never
parents: 3939
diff changeset
603 Symbol f_name = getFieldName(i);
35c656d0b685 7090654: nightly failures after 7086585
never
parents: 3939
diff changeset
604 Symbol f_sig = getFieldSignature(i);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
605 if (name.equals(f_name) && sig.equals(f_sig)) {
a61af66fc99e Initial load
duke
parents:
diff changeset
606 return newField(i);
a61af66fc99e Initial load
duke
parents:
diff changeset
607 }
a61af66fc99e Initial load
duke
parents:
diff changeset
608 }
a61af66fc99e Initial load
duke
parents:
diff changeset
609
a61af66fc99e Initial load
duke
parents:
diff changeset
610 return null;
a61af66fc99e Initial load
duke
parents:
diff changeset
611 }
a61af66fc99e Initial load
duke
parents:
diff changeset
612
a61af66fc99e Initial load
duke
parents:
diff changeset
613 /** Find field in direct superinterfaces. */
a61af66fc99e Initial load
duke
parents:
diff changeset
614 public Field findInterfaceField(Symbol name, Symbol sig) {
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
615 KlassArray interfaces = getLocalInterfaces();
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
616 int n = interfaces.length();
0
a61af66fc99e Initial load
duke
parents:
diff changeset
617 for (int i = 0; i < n; i++) {
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
618 InstanceKlass intf1 = (InstanceKlass) interfaces.getAt(i);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
619 if (Assert.ASSERTS_ENABLED) {
a61af66fc99e Initial load
duke
parents:
diff changeset
620 Assert.that(intf1.isInterface(), "just checking type");
a61af66fc99e Initial load
duke
parents:
diff changeset
621 }
a61af66fc99e Initial load
duke
parents:
diff changeset
622 // search for field in current interface
a61af66fc99e Initial load
duke
parents:
diff changeset
623 Field f = intf1.findLocalField(name, sig);
a61af66fc99e Initial load
duke
parents:
diff changeset
624 if (f != null) {
a61af66fc99e Initial load
duke
parents:
diff changeset
625 if (Assert.ASSERTS_ENABLED) {
a61af66fc99e Initial load
duke
parents:
diff changeset
626 Assert.that(f.getAccessFlagsObj().isStatic(), "interface field must be static");
a61af66fc99e Initial load
duke
parents:
diff changeset
627 }
a61af66fc99e Initial load
duke
parents:
diff changeset
628 return f;
a61af66fc99e Initial load
duke
parents:
diff changeset
629 }
a61af66fc99e Initial load
duke
parents:
diff changeset
630 // search for field in direct superinterfaces
a61af66fc99e Initial load
duke
parents:
diff changeset
631 f = intf1.findInterfaceField(name, sig);
a61af66fc99e Initial load
duke
parents:
diff changeset
632 if (f != null) return f;
a61af66fc99e Initial load
duke
parents:
diff changeset
633 }
a61af66fc99e Initial load
duke
parents:
diff changeset
634 // otherwise field lookup fails
a61af66fc99e Initial load
duke
parents:
diff changeset
635 return null;
a61af66fc99e Initial load
duke
parents:
diff changeset
636 }
a61af66fc99e Initial load
duke
parents:
diff changeset
637
a61af66fc99e Initial load
duke
parents:
diff changeset
638 /** Find field according to JVM spec 5.4.3.2, returns the klass in
a61af66fc99e Initial load
duke
parents:
diff changeset
639 which the field is defined. */
a61af66fc99e Initial load
duke
parents:
diff changeset
640 public Field findField(Symbol name, Symbol sig) {
a61af66fc99e Initial load
duke
parents:
diff changeset
641 // search order according to newest JVM spec (5.4.3.2, p.167).
a61af66fc99e Initial load
duke
parents:
diff changeset
642 // 1) search for field in current klass
a61af66fc99e Initial load
duke
parents:
diff changeset
643 Field f = findLocalField(name, sig);
a61af66fc99e Initial load
duke
parents:
diff changeset
644 if (f != null) return f;
a61af66fc99e Initial load
duke
parents:
diff changeset
645
a61af66fc99e Initial load
duke
parents:
diff changeset
646 // 2) search for field recursively in direct superinterfaces
a61af66fc99e Initial load
duke
parents:
diff changeset
647 f = findInterfaceField(name, sig);
a61af66fc99e Initial load
duke
parents:
diff changeset
648 if (f != null) return f;
a61af66fc99e Initial load
duke
parents:
diff changeset
649
a61af66fc99e Initial load
duke
parents:
diff changeset
650 // 3) apply field lookup recursively if superclass exists
a61af66fc99e Initial load
duke
parents:
diff changeset
651 InstanceKlass supr = (InstanceKlass) getSuper();
a61af66fc99e Initial load
duke
parents:
diff changeset
652 if (supr != null) return supr.findField(name, sig);
a61af66fc99e Initial load
duke
parents:
diff changeset
653
a61af66fc99e Initial load
duke
parents:
diff changeset
654 // 4) otherwise field lookup fails
a61af66fc99e Initial load
duke
parents:
diff changeset
655 return null;
a61af66fc99e Initial load
duke
parents:
diff changeset
656 }
a61af66fc99e Initial load
duke
parents:
diff changeset
657
a61af66fc99e Initial load
duke
parents:
diff changeset
658 /** Find field according to JVM spec 5.4.3.2, returns the klass in
a61af66fc99e Initial load
duke
parents:
diff changeset
659 which the field is defined (convenience routine) */
a61af66fc99e Initial load
duke
parents:
diff changeset
660 public Field findField(String name, String sig) {
a61af66fc99e Initial load
duke
parents:
diff changeset
661 SymbolTable symbols = VM.getVM().getSymbolTable();
a61af66fc99e Initial load
duke
parents:
diff changeset
662 Symbol nameSym = symbols.probe(name);
a61af66fc99e Initial load
duke
parents:
diff changeset
663 Symbol sigSym = symbols.probe(sig);
a61af66fc99e Initial load
duke
parents:
diff changeset
664 if (nameSym == null || sigSym == null) {
a61af66fc99e Initial load
duke
parents:
diff changeset
665 return null;
a61af66fc99e Initial load
duke
parents:
diff changeset
666 }
a61af66fc99e Initial load
duke
parents:
diff changeset
667 return findField(nameSym, sigSym);
a61af66fc99e Initial load
duke
parents:
diff changeset
668 }
a61af66fc99e Initial load
duke
parents:
diff changeset
669
a61af66fc99e Initial load
duke
parents:
diff changeset
670 /** Find field according to JVM spec 5.4.3.2, returns the klass in
a61af66fc99e Initial load
duke
parents:
diff changeset
671 which the field is defined (retained only for backward
a61af66fc99e Initial load
duke
parents:
diff changeset
672 compatibility with jdbx) */
a61af66fc99e Initial load
duke
parents:
diff changeset
673 public Field findFieldDbg(String name, String sig) {
a61af66fc99e Initial load
duke
parents:
diff changeset
674 return findField(name, sig);
a61af66fc99e Initial load
duke
parents:
diff changeset
675 }
a61af66fc99e Initial load
duke
parents:
diff changeset
676
a61af66fc99e Initial load
duke
parents:
diff changeset
677 /** Get field by its index in the fields array. Only designed for
a61af66fc99e Initial load
duke
parents:
diff changeset
678 use in a debugging system. */
3944
35c656d0b685 7090654: nightly failures after 7086585
never
parents: 3939
diff changeset
679 public Field getFieldByIndex(int fieldIndex) {
35c656d0b685 7090654: nightly failures after 7086585
never
parents: 3939
diff changeset
680 return newField(fieldIndex);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
681 }
a61af66fc99e Initial load
duke
parents:
diff changeset
682
a61af66fc99e Initial load
duke
parents:
diff changeset
683
a61af66fc99e Initial load
duke
parents:
diff changeset
684 /** Return a List of SA Fields for the fields declared in this class.
a61af66fc99e Initial load
duke
parents:
diff changeset
685 Inherited fields are not included.
a61af66fc99e Initial load
duke
parents:
diff changeset
686 Return an empty list if there are no fields declared in this class.
a61af66fc99e Initial load
duke
parents:
diff changeset
687 Only designed for use in a debugging system. */
a61af66fc99e Initial load
duke
parents:
diff changeset
688 public List getImmediateFields() {
a61af66fc99e Initial load
duke
parents:
diff changeset
689 // A list of Fields for each field declared in this class/interface,
a61af66fc99e Initial load
duke
parents:
diff changeset
690 // not including inherited fields.
3938
e6b1331a51d2 7086585: make Java field injection more flexible
never
parents: 2411
diff changeset
691 int length = getJavaFieldsCount();
e6b1331a51d2 7086585: make Java field injection more flexible
never
parents: 2411
diff changeset
692 List immediateFields = new ArrayList(length);
3944
35c656d0b685 7090654: nightly failures after 7086585
never
parents: 3939
diff changeset
693 for (int index = 0; index < length; index++) {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
694 immediateFields.add(getFieldByIndex(index));
a61af66fc99e Initial load
duke
parents:
diff changeset
695 }
a61af66fc99e Initial load
duke
parents:
diff changeset
696
a61af66fc99e Initial load
duke
parents:
diff changeset
697 return immediateFields;
a61af66fc99e Initial load
duke
parents:
diff changeset
698 }
a61af66fc99e Initial load
duke
parents:
diff changeset
699
a61af66fc99e Initial load
duke
parents:
diff changeset
700 /** Return a List of SA Fields for all the java fields in this class,
a61af66fc99e Initial load
duke
parents:
diff changeset
701 including all inherited fields. This includes hidden
a61af66fc99e Initial load
duke
parents:
diff changeset
702 fields. Thus the returned list can contain fields with
a61af66fc99e Initial load
duke
parents:
diff changeset
703 the same name.
a61af66fc99e Initial load
duke
parents:
diff changeset
704 Return an empty list if there are no fields.
a61af66fc99e Initial load
duke
parents:
diff changeset
705 Only designed for use in a debugging system. */
a61af66fc99e Initial load
duke
parents:
diff changeset
706 public List getAllFields() {
a61af66fc99e Initial load
duke
parents:
diff changeset
707 // Contains a Field for each field in this class, including immediate
a61af66fc99e Initial load
duke
parents:
diff changeset
708 // fields and inherited fields.
a61af66fc99e Initial load
duke
parents:
diff changeset
709 List allFields = getImmediateFields();
a61af66fc99e Initial load
duke
parents:
diff changeset
710
a61af66fc99e Initial load
duke
parents:
diff changeset
711 // transitiveInterfaces contains all interfaces implemented
a61af66fc99e Initial load
duke
parents:
diff changeset
712 // by this class and its superclass chain with no duplicates.
a61af66fc99e Initial load
duke
parents:
diff changeset
713
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
714 KlassArray interfaces = getTransitiveInterfaces();
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
715 int n = interfaces.length();
0
a61af66fc99e Initial load
duke
parents:
diff changeset
716 for (int i = 0; i < n; i++) {
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
717 InstanceKlass intf1 = (InstanceKlass) interfaces.getAt(i);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
718 if (Assert.ASSERTS_ENABLED) {
a61af66fc99e Initial load
duke
parents:
diff changeset
719 Assert.that(intf1.isInterface(), "just checking type");
a61af66fc99e Initial load
duke
parents:
diff changeset
720 }
a61af66fc99e Initial load
duke
parents:
diff changeset
721 allFields.addAll(intf1.getImmediateFields());
a61af66fc99e Initial load
duke
parents:
diff changeset
722 }
a61af66fc99e Initial load
duke
parents:
diff changeset
723
a61af66fc99e Initial load
duke
parents:
diff changeset
724 // Get all fields in the superclass, recursively. But, don't
a61af66fc99e Initial load
duke
parents:
diff changeset
725 // include fields in interfaces implemented by superclasses;
a61af66fc99e Initial load
duke
parents:
diff changeset
726 // we already have all those.
a61af66fc99e Initial load
duke
parents:
diff changeset
727 if (!isInterface()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
728 InstanceKlass supr;
a61af66fc99e Initial load
duke
parents:
diff changeset
729 if ( (supr = (InstanceKlass) getSuper()) != null) {
a61af66fc99e Initial load
duke
parents:
diff changeset
730 allFields.addAll(supr.getImmediateFields());
a61af66fc99e Initial load
duke
parents:
diff changeset
731 }
a61af66fc99e Initial load
duke
parents:
diff changeset
732 }
a61af66fc99e Initial load
duke
parents:
diff changeset
733
a61af66fc99e Initial load
duke
parents:
diff changeset
734 return allFields;
a61af66fc99e Initial load
duke
parents:
diff changeset
735 }
a61af66fc99e Initial load
duke
parents:
diff changeset
736
a61af66fc99e Initial load
duke
parents:
diff changeset
737
a61af66fc99e Initial load
duke
parents:
diff changeset
738 /** Return a List of SA Methods declared directly in this class/interface.
a61af66fc99e Initial load
duke
parents:
diff changeset
739 Return an empty list if there are none, or if this isn't a class/
a61af66fc99e Initial load
duke
parents:
diff changeset
740 interface.
a61af66fc99e Initial load
duke
parents:
diff changeset
741 */
a61af66fc99e Initial load
duke
parents:
diff changeset
742 public List getImmediateMethods() {
a61af66fc99e Initial load
duke
parents:
diff changeset
743 // Contains a Method for each method declared in this class/interface
a61af66fc99e Initial load
duke
parents:
diff changeset
744 // not including inherited methods.
a61af66fc99e Initial load
duke
parents:
diff changeset
745
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
746 MethodArray methods = getMethods();
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
747 int length = methods.length();
0
a61af66fc99e Initial load
duke
parents:
diff changeset
748 Object[] tmp = new Object[length];
a61af66fc99e Initial load
duke
parents:
diff changeset
749
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
750 IntArray methodOrdering = getMethodOrdering();
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
751 if (methodOrdering.length() != length) {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
752 // no ordering info present
a61af66fc99e Initial load
duke
parents:
diff changeset
753 for (int index = 0; index < length; index++) {
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
754 tmp[index] = methods.at(index);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
755 }
a61af66fc99e Initial load
duke
parents:
diff changeset
756 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
757 for (int index = 0; index < length; index++) {
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
758 int originalIndex = methodOrdering.at(index);
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
759 tmp[originalIndex] = methods.at(index);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
760 }
a61af66fc99e Initial load
duke
parents:
diff changeset
761 }
a61af66fc99e Initial load
duke
parents:
diff changeset
762
a61af66fc99e Initial load
duke
parents:
diff changeset
763 return Arrays.asList(tmp);
a61af66fc99e Initial load
duke
parents:
diff changeset
764 }
a61af66fc99e Initial load
duke
parents:
diff changeset
765
a61af66fc99e Initial load
duke
parents:
diff changeset
766 /** Return a List containing an SA InstanceKlass for each
a61af66fc99e Initial load
duke
parents:
diff changeset
767 interface named in this class's 'implements' clause.
a61af66fc99e Initial load
duke
parents:
diff changeset
768 */
a61af66fc99e Initial load
duke
parents:
diff changeset
769 public List getDirectImplementedInterfaces() {
a61af66fc99e Initial load
duke
parents:
diff changeset
770 // Contains an InstanceKlass for each interface in this classes
a61af66fc99e Initial load
duke
parents:
diff changeset
771 // 'implements' clause.
a61af66fc99e Initial load
duke
parents:
diff changeset
772
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
773 KlassArray interfaces = getLocalInterfaces();
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
774 int length = interfaces.length();
0
a61af66fc99e Initial load
duke
parents:
diff changeset
775 List directImplementedInterfaces = new ArrayList(length);
a61af66fc99e Initial load
duke
parents:
diff changeset
776
a61af66fc99e Initial load
duke
parents:
diff changeset
777 for (int index = 0; index < length; index ++) {
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
778 directImplementedInterfaces.add(interfaces.getAt(index));
0
a61af66fc99e Initial load
duke
parents:
diff changeset
779 }
a61af66fc99e Initial load
duke
parents:
diff changeset
780
a61af66fc99e Initial load
duke
parents:
diff changeset
781 return directImplementedInterfaces;
a61af66fc99e Initial load
duke
parents:
diff changeset
782 }
a61af66fc99e Initial load
duke
parents:
diff changeset
783
a61af66fc99e Initial load
duke
parents:
diff changeset
784 public Klass arrayKlassImpl(boolean orNull, int n) {
a61af66fc99e Initial load
duke
parents:
diff changeset
785 // FIXME: in reflective system this would need to change to
a61af66fc99e Initial load
duke
parents:
diff changeset
786 // actually allocate
a61af66fc99e Initial load
duke
parents:
diff changeset
787 if (getArrayKlasses() == null) { return null; }
a61af66fc99e Initial load
duke
parents:
diff changeset
788 ObjArrayKlass oak = (ObjArrayKlass) getArrayKlasses();
a61af66fc99e Initial load
duke
parents:
diff changeset
789 if (orNull) {
a61af66fc99e Initial load
duke
parents:
diff changeset
790 return oak.arrayKlassOrNull(n);
a61af66fc99e Initial load
duke
parents:
diff changeset
791 }
a61af66fc99e Initial load
duke
parents:
diff changeset
792 return oak.arrayKlass(n);
a61af66fc99e Initial load
duke
parents:
diff changeset
793 }
a61af66fc99e Initial load
duke
parents:
diff changeset
794
a61af66fc99e Initial load
duke
parents:
diff changeset
795 public Klass arrayKlassImpl(boolean orNull) {
a61af66fc99e Initial load
duke
parents:
diff changeset
796 return arrayKlassImpl(orNull, 1);
a61af66fc99e Initial load
duke
parents:
diff changeset
797 }
a61af66fc99e Initial load
duke
parents:
diff changeset
798
a61af66fc99e Initial load
duke
parents:
diff changeset
799 public String signature() {
a61af66fc99e Initial load
duke
parents:
diff changeset
800 return "L" + super.signature() + ";";
a61af66fc99e Initial load
duke
parents:
diff changeset
801 }
a61af66fc99e Initial load
duke
parents:
diff changeset
802
a61af66fc99e Initial load
duke
parents:
diff changeset
803 /** Convenience routine taking Strings; lookup is done in
a61af66fc99e Initial load
duke
parents:
diff changeset
804 SymbolTable. */
a61af66fc99e Initial load
duke
parents:
diff changeset
805 public Method findMethod(String name, String sig) {
a61af66fc99e Initial load
duke
parents:
diff changeset
806 SymbolTable syms = VM.getVM().getSymbolTable();
a61af66fc99e Initial load
duke
parents:
diff changeset
807 Symbol nameSym = syms.probe(name);
a61af66fc99e Initial load
duke
parents:
diff changeset
808 Symbol sigSym = syms.probe(sig);
a61af66fc99e Initial load
duke
parents:
diff changeset
809 if (nameSym == null || sigSym == null) {
a61af66fc99e Initial load
duke
parents:
diff changeset
810 return null;
a61af66fc99e Initial load
duke
parents:
diff changeset
811 }
a61af66fc99e Initial load
duke
parents:
diff changeset
812 return findMethod(nameSym, sigSym);
a61af66fc99e Initial load
duke
parents:
diff changeset
813 }
a61af66fc99e Initial load
duke
parents:
diff changeset
814
a61af66fc99e Initial load
duke
parents:
diff changeset
815 /** Find method in vtable. */
a61af66fc99e Initial load
duke
parents:
diff changeset
816 public Method findMethod(Symbol name, Symbol sig) {
a61af66fc99e Initial load
duke
parents:
diff changeset
817 return findMethod(getMethods(), name, sig);
a61af66fc99e Initial load
duke
parents:
diff changeset
818 }
a61af66fc99e Initial load
duke
parents:
diff changeset
819
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
820 /** Breakpoint support (see methods on Method* for details) */
0
a61af66fc99e Initial load
duke
parents:
diff changeset
821 public BreakpointInfo getBreakpoints() {
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
822 Address addr = getAddress().getAddressAt(breakpoints.getOffset());
0
a61af66fc99e Initial load
duke
parents:
diff changeset
823 return (BreakpointInfo) VMObjectFactory.newObject(BreakpointInfo.class, addr);
a61af66fc99e Initial load
duke
parents:
diff changeset
824 }
a61af66fc99e Initial load
duke
parents:
diff changeset
825
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
826 public IntArray getMethodOrdering() {
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
827 Address addr = getAddress().getAddressAt(methodOrdering.getOffset());
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
828 return (IntArray) VMObjectFactory.newObject(IntArray.class, addr);
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
829 }
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
830
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
831 public U2Array getFields() {
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
832 Address addr = getAddress().getAddressAt(fields.getOffset());
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
833 return (U2Array) VMObjectFactory.newObject(U2Array.class, addr);
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
834 }
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
835
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
836 public U2Array getInnerClasses() {
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
837 Address addr = getAddress().getAddressAt(innerClasses.getOffset());
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
838 return (U2Array) VMObjectFactory.newObject(U2Array.class, addr);
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
839 }
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
840
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
841
0
a61af66fc99e Initial load
duke
parents:
diff changeset
842 //----------------------------------------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
843 // Internals only below this point
a61af66fc99e Initial load
duke
parents:
diff changeset
844 //
a61af66fc99e Initial load
duke
parents:
diff changeset
845
a61af66fc99e Initial load
duke
parents:
diff changeset
846 private void visitField(OopVisitor visitor, FieldType type, int index) {
a61af66fc99e Initial load
duke
parents:
diff changeset
847 Field f = newField(index);
a61af66fc99e Initial load
duke
parents:
diff changeset
848 if (type.isOop()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
849 visitor.doOop((OopField) f, false);
a61af66fc99e Initial load
duke
parents:
diff changeset
850 return;
a61af66fc99e Initial load
duke
parents:
diff changeset
851 }
a61af66fc99e Initial load
duke
parents:
diff changeset
852 if (type.isByte()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
853 visitor.doByte((ByteField) f, false);
a61af66fc99e Initial load
duke
parents:
diff changeset
854 return;
a61af66fc99e Initial load
duke
parents:
diff changeset
855 }
a61af66fc99e Initial load
duke
parents:
diff changeset
856 if (type.isChar()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
857 visitor.doChar((CharField) f, false);
a61af66fc99e Initial load
duke
parents:
diff changeset
858 return;
a61af66fc99e Initial load
duke
parents:
diff changeset
859 }
a61af66fc99e Initial load
duke
parents:
diff changeset
860 if (type.isDouble()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
861 visitor.doDouble((DoubleField) f, false);
a61af66fc99e Initial load
duke
parents:
diff changeset
862 return;
a61af66fc99e Initial load
duke
parents:
diff changeset
863 }
a61af66fc99e Initial load
duke
parents:
diff changeset
864 if (type.isFloat()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
865 visitor.doFloat((FloatField) f, false);
a61af66fc99e Initial load
duke
parents:
diff changeset
866 return;
a61af66fc99e Initial load
duke
parents:
diff changeset
867 }
a61af66fc99e Initial load
duke
parents:
diff changeset
868 if (type.isInt()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
869 visitor.doInt((IntField) f, false);
a61af66fc99e Initial load
duke
parents:
diff changeset
870 return;
a61af66fc99e Initial load
duke
parents:
diff changeset
871 }
a61af66fc99e Initial load
duke
parents:
diff changeset
872 if (type.isLong()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
873 visitor.doLong((LongField) f, false);
a61af66fc99e Initial load
duke
parents:
diff changeset
874 return;
a61af66fc99e Initial load
duke
parents:
diff changeset
875 }
a61af66fc99e Initial load
duke
parents:
diff changeset
876 if (type.isShort()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
877 visitor.doShort((ShortField) f, false);
a61af66fc99e Initial load
duke
parents:
diff changeset
878 return;
a61af66fc99e Initial load
duke
parents:
diff changeset
879 }
a61af66fc99e Initial load
duke
parents:
diff changeset
880 if (type.isBoolean()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
881 visitor.doBoolean((BooleanField) f, false);
a61af66fc99e Initial load
duke
parents:
diff changeset
882 return;
a61af66fc99e Initial load
duke
parents:
diff changeset
883 }
a61af66fc99e Initial load
duke
parents:
diff changeset
884 }
a61af66fc99e Initial load
duke
parents:
diff changeset
885
a61af66fc99e Initial load
duke
parents:
diff changeset
886 // Creates new field from index in fields TypeArray
a61af66fc99e Initial load
duke
parents:
diff changeset
887 private Field newField(int index) {
3944
35c656d0b685 7090654: nightly failures after 7086585
never
parents: 3939
diff changeset
888 FieldType type = new FieldType(getFieldSignature(index));
0
a61af66fc99e Initial load
duke
parents:
diff changeset
889 if (type.isOop()) {
113
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
890 if (VM.getVM().isCompressedOopsEnabled()) {
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
891 return new NarrowOopField(this, index);
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
892 } else {
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
893 return new OopField(this, index);
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
894 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
895 }
a61af66fc99e Initial load
duke
parents:
diff changeset
896 if (type.isByte()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
897 return new ByteField(this, index);
a61af66fc99e Initial load
duke
parents:
diff changeset
898 }
a61af66fc99e Initial load
duke
parents:
diff changeset
899 if (type.isChar()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
900 return new CharField(this, index);
a61af66fc99e Initial load
duke
parents:
diff changeset
901 }
a61af66fc99e Initial load
duke
parents:
diff changeset
902 if (type.isDouble()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
903 return new DoubleField(this, index);
a61af66fc99e Initial load
duke
parents:
diff changeset
904 }
a61af66fc99e Initial load
duke
parents:
diff changeset
905 if (type.isFloat()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
906 return new FloatField(this, index);
a61af66fc99e Initial load
duke
parents:
diff changeset
907 }
a61af66fc99e Initial load
duke
parents:
diff changeset
908 if (type.isInt()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
909 return new IntField(this, index);
a61af66fc99e Initial load
duke
parents:
diff changeset
910 }
a61af66fc99e Initial load
duke
parents:
diff changeset
911 if (type.isLong()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
912 return new LongField(this, index);
a61af66fc99e Initial load
duke
parents:
diff changeset
913 }
a61af66fc99e Initial load
duke
parents:
diff changeset
914 if (type.isShort()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
915 return new ShortField(this, index);
a61af66fc99e Initial load
duke
parents:
diff changeset
916 }
a61af66fc99e Initial load
duke
parents:
diff changeset
917 if (type.isBoolean()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
918 return new BooleanField(this, index);
a61af66fc99e Initial load
duke
parents:
diff changeset
919 }
a61af66fc99e Initial load
duke
parents:
diff changeset
920 throw new RuntimeException("Illegal field type at index " + index);
a61af66fc99e Initial load
duke
parents:
diff changeset
921 }
a61af66fc99e Initial load
duke
parents:
diff changeset
922
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
923 private static Method findMethod(MethodArray methods, Symbol name, Symbol signature) {
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
924 int len = methods.length();
0
a61af66fc99e Initial load
duke
parents:
diff changeset
925 // methods are sorted, so do binary search
a61af66fc99e Initial load
duke
parents:
diff changeset
926 int l = 0;
a61af66fc99e Initial load
duke
parents:
diff changeset
927 int h = len - 1;
a61af66fc99e Initial load
duke
parents:
diff changeset
928 while (l <= h) {
a61af66fc99e Initial load
duke
parents:
diff changeset
929 int mid = (l + h) >> 1;
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
930 Method m = methods.at(mid);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
931 int res = m.getName().fastCompare(name);
a61af66fc99e Initial load
duke
parents:
diff changeset
932 if (res == 0) {
a61af66fc99e Initial load
duke
parents:
diff changeset
933 // found matching name; do linear search to find matching signature
a61af66fc99e Initial load
duke
parents:
diff changeset
934 // first, quick check for common case
a61af66fc99e Initial load
duke
parents:
diff changeset
935 if (m.getSignature().equals(signature)) return m;
a61af66fc99e Initial load
duke
parents:
diff changeset
936 // search downwards through overloaded methods
a61af66fc99e Initial load
duke
parents:
diff changeset
937 int i;
a61af66fc99e Initial load
duke
parents:
diff changeset
938 for (i = mid - 1; i >= l; i--) {
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
939 Method m1 = methods.at(i);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
940 if (!m1.getName().equals(name)) break;
a61af66fc99e Initial load
duke
parents:
diff changeset
941 if (m1.getSignature().equals(signature)) return m1;
a61af66fc99e Initial load
duke
parents:
diff changeset
942 }
a61af66fc99e Initial load
duke
parents:
diff changeset
943 // search upwards
a61af66fc99e Initial load
duke
parents:
diff changeset
944 for (i = mid + 1; i <= h; i++) {
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
945 Method m1 = methods.at(i);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
946 if (!m1.getName().equals(name)) break;
a61af66fc99e Initial load
duke
parents:
diff changeset
947 if (m1.getSignature().equals(signature)) return m1;
a61af66fc99e Initial load
duke
parents:
diff changeset
948 }
a61af66fc99e Initial load
duke
parents:
diff changeset
949 // not found
a61af66fc99e Initial load
duke
parents:
diff changeset
950 if (Assert.ASSERTS_ENABLED) {
a61af66fc99e Initial load
duke
parents:
diff changeset
951 int index = linearSearch(methods, name, signature);
a61af66fc99e Initial load
duke
parents:
diff changeset
952 if (index != -1) {
a61af66fc99e Initial load
duke
parents:
diff changeset
953 throw new DebuggerException("binary search bug: should have found entry " + index);
a61af66fc99e Initial load
duke
parents:
diff changeset
954 }
a61af66fc99e Initial load
duke
parents:
diff changeset
955 }
a61af66fc99e Initial load
duke
parents:
diff changeset
956 return null;
a61af66fc99e Initial load
duke
parents:
diff changeset
957 } else if (res < 0) {
a61af66fc99e Initial load
duke
parents:
diff changeset
958 l = mid + 1;
a61af66fc99e Initial load
duke
parents:
diff changeset
959 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
960 h = mid - 1;
a61af66fc99e Initial load
duke
parents:
diff changeset
961 }
a61af66fc99e Initial load
duke
parents:
diff changeset
962 }
a61af66fc99e Initial load
duke
parents:
diff changeset
963 if (Assert.ASSERTS_ENABLED) {
a61af66fc99e Initial load
duke
parents:
diff changeset
964 int index = linearSearch(methods, name, signature);
a61af66fc99e Initial load
duke
parents:
diff changeset
965 if (index != -1) {
a61af66fc99e Initial load
duke
parents:
diff changeset
966 throw new DebuggerException("binary search bug: should have found entry " + index);
a61af66fc99e Initial load
duke
parents:
diff changeset
967 }
a61af66fc99e Initial load
duke
parents:
diff changeset
968 }
a61af66fc99e Initial load
duke
parents:
diff changeset
969 return null;
a61af66fc99e Initial load
duke
parents:
diff changeset
970 }
a61af66fc99e Initial load
duke
parents:
diff changeset
971
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
972 private static int linearSearch(MethodArray methods, Symbol name, Symbol signature) {
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
973 int len = (int) methods.length();
0
a61af66fc99e Initial load
duke
parents:
diff changeset
974 for (int index = 0; index < len; index++) {
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6203
diff changeset
975 Method m = methods.at(index);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
976 if (m.getSignature().equals(signature) && m.getName().equals(name)) {
a61af66fc99e Initial load
duke
parents:
diff changeset
977 return index;
a61af66fc99e Initial load
duke
parents:
diff changeset
978 }
a61af66fc99e Initial load
duke
parents:
diff changeset
979 }
a61af66fc99e Initial load
duke
parents:
diff changeset
980 return -1;
a61af66fc99e Initial load
duke
parents:
diff changeset
981 }
a61af66fc99e Initial load
duke
parents:
diff changeset
982 }