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