annotate agent/test/jdi/sagdoit.java @ 20543:e7d0505c8a30

8059758: Footprint regressions with JDK-8038423 Summary: Changes in JDK-8038423 always initialize (zero out) virtual memory used for auxiliary data structures. This causes a footprint regression for G1 in startup benchmarks. This is because they do not touch that memory at all, so the operating system does not actually commit these pages. The fix is to, if the initialization value of the data structures matches the default value of just committed memory (=0), do not do anything. Reviewed-by: jwilhelm, brutisso
author tschatzl
date Fri, 10 Oct 2014 15:51:58 +0200
parents c18cbe5936b8
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
2 * Copyright (c) 2002, 2004, 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: 0
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
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: 0
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 import com.sun.jdi.*;
a61af66fc99e Initial load
duke
parents:
diff changeset
26 import java.util.*;
a61af66fc99e Initial load
duke
parents:
diff changeset
27
a61af66fc99e Initial load
duke
parents:
diff changeset
28
a61af66fc99e Initial load
duke
parents:
diff changeset
29 // This just contains a bunch of methods that call various JDI methods.
a61af66fc99e Initial load
duke
parents:
diff changeset
30 // It is called from the sagtest.java jtreg test to get this info for the standard
a61af66fc99e Initial load
duke
parents:
diff changeset
31 // JDI and from the sagclient.java test to get this info for the SA JDI.
a61af66fc99e Initial load
duke
parents:
diff changeset
32
a61af66fc99e Initial load
duke
parents:
diff changeset
33 class comparator implements Comparator {
a61af66fc99e Initial load
duke
parents:
diff changeset
34
a61af66fc99e Initial load
duke
parents:
diff changeset
35 public int compare(Object o1, Object o2) {
a61af66fc99e Initial load
duke
parents:
diff changeset
36 ReferenceType rt1 = (ReferenceType)o1;
a61af66fc99e Initial load
duke
parents:
diff changeset
37 ReferenceType rt2 = (ReferenceType)o2;
a61af66fc99e Initial load
duke
parents:
diff changeset
38 return rt1.signature().compareTo(rt2.signature());
a61af66fc99e Initial load
duke
parents:
diff changeset
39 }
a61af66fc99e Initial load
duke
parents:
diff changeset
40
a61af66fc99e Initial load
duke
parents:
diff changeset
41 public boolean equals(Object oo) {
a61af66fc99e Initial load
duke
parents:
diff changeset
42 return false;
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 public class sagdoit {
a61af66fc99e Initial load
duke
parents:
diff changeset
47
a61af66fc99e Initial load
duke
parents:
diff changeset
48 VirtualMachine myVm;
a61af66fc99e Initial load
duke
parents:
diff changeset
49 int margin = 0;
a61af66fc99e Initial load
duke
parents:
diff changeset
50 static String blanks = " ";
a61af66fc99e Initial load
duke
parents:
diff changeset
51 static int nblanks = blanks.length();
a61af66fc99e Initial load
duke
parents:
diff changeset
52
a61af66fc99e Initial load
duke
parents:
diff changeset
53 sagdoit(VirtualMachine vm) {
a61af66fc99e Initial load
duke
parents:
diff changeset
54 super();
a61af66fc99e Initial load
duke
parents:
diff changeset
55 myVm = vm;
a61af66fc99e Initial load
duke
parents:
diff changeset
56 }
a61af66fc99e Initial load
duke
parents:
diff changeset
57
a61af66fc99e Initial load
duke
parents:
diff changeset
58 void indent(int count) {
a61af66fc99e Initial load
duke
parents:
diff changeset
59 margin += count;
a61af66fc99e Initial load
duke
parents:
diff changeset
60 }
a61af66fc99e Initial load
duke
parents:
diff changeset
61
a61af66fc99e Initial load
duke
parents:
diff changeset
62 void pp(String msg) {
a61af66fc99e Initial load
duke
parents:
diff changeset
63 System.out.println(blanks.substring(nblanks - margin) + msg);
a61af66fc99e Initial load
duke
parents:
diff changeset
64 }
a61af66fc99e Initial load
duke
parents:
diff changeset
65
a61af66fc99e Initial load
duke
parents:
diff changeset
66 public void doAll() {
a61af66fc99e Initial load
duke
parents:
diff changeset
67 doThreadGroups();
a61af66fc99e Initial load
duke
parents:
diff changeset
68 //System.out.println("NOTE: dumping of class info is disabled in sagdoit.java");
a61af66fc99e Initial load
duke
parents:
diff changeset
69 //System.out.println(" just to keep the output small while working on objects");
a61af66fc99e Initial load
duke
parents:
diff changeset
70 doClasses(); //fixme jj: uncomment this to see all class info
a61af66fc99e Initial load
duke
parents:
diff changeset
71
a61af66fc99e Initial load
duke
parents:
diff changeset
72 }
a61af66fc99e Initial load
duke
parents:
diff changeset
73 public void doThreadGroups() {
a61af66fc99e Initial load
duke
parents:
diff changeset
74 doThreadGroupList(myVm.topLevelThreadGroups());
a61af66fc99e Initial load
duke
parents:
diff changeset
75 }
a61af66fc99e Initial load
duke
parents:
diff changeset
76
a61af66fc99e Initial load
duke
parents:
diff changeset
77 private void doThreadGroupList(List groups) {
a61af66fc99e Initial load
duke
parents:
diff changeset
78 // sort; need a comparator
a61af66fc99e Initial load
duke
parents:
diff changeset
79 if (groups == null) {
a61af66fc99e Initial load
duke
parents:
diff changeset
80 return;
a61af66fc99e Initial load
duke
parents:
diff changeset
81 }
a61af66fc99e Initial load
duke
parents:
diff changeset
82
a61af66fc99e Initial load
duke
parents:
diff changeset
83 Iterator myIter = groups.iterator();
a61af66fc99e Initial load
duke
parents:
diff changeset
84 while(myIter.hasNext()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
85 ThreadGroupReference aGroup = (ThreadGroupReference)myIter.next();
a61af66fc99e Initial load
duke
parents:
diff changeset
86 doOneThreadGroup(aGroup);
a61af66fc99e Initial load
duke
parents:
diff changeset
87 }
a61af66fc99e Initial load
duke
parents:
diff changeset
88
a61af66fc99e Initial load
duke
parents:
diff changeset
89 }
a61af66fc99e Initial load
duke
parents:
diff changeset
90
a61af66fc99e Initial load
duke
parents:
diff changeset
91 public void doOneThreadGroup(ThreadGroupReference xx) {
a61af66fc99e Initial load
duke
parents:
diff changeset
92 pp("threadGroup:" + xx.name());
a61af66fc99e Initial load
duke
parents:
diff changeset
93 indent(4);
a61af66fc99e Initial load
duke
parents:
diff changeset
94 pp("parent() = " + xx.parent());
a61af66fc99e Initial load
duke
parents:
diff changeset
95 pp("threads:");
a61af66fc99e Initial load
duke
parents:
diff changeset
96 indent(4);
a61af66fc99e Initial load
duke
parents:
diff changeset
97 doThreadList(xx.threads());
a61af66fc99e Initial load
duke
parents:
diff changeset
98 indent(-4);
a61af66fc99e Initial load
duke
parents:
diff changeset
99 pp("threadGroups:");
a61af66fc99e Initial load
duke
parents:
diff changeset
100 indent(4);
a61af66fc99e Initial load
duke
parents:
diff changeset
101 doThreadGroupList(xx.threadGroups());
a61af66fc99e Initial load
duke
parents:
diff changeset
102 indent(-4);
a61af66fc99e Initial load
duke
parents:
diff changeset
103 indent(-4);
a61af66fc99e Initial load
duke
parents:
diff changeset
104 }
a61af66fc99e Initial load
duke
parents:
diff changeset
105
a61af66fc99e Initial load
duke
parents:
diff changeset
106 public void doThreads() {
a61af66fc99e Initial load
duke
parents:
diff changeset
107 doThreadList(myVm.allThreads());
a61af66fc99e Initial load
duke
parents:
diff changeset
108 }
a61af66fc99e Initial load
duke
parents:
diff changeset
109
a61af66fc99e Initial load
duke
parents:
diff changeset
110 public void doThreadList(List threads) {
a61af66fc99e Initial load
duke
parents:
diff changeset
111 if (threads == null) {
a61af66fc99e Initial load
duke
parents:
diff changeset
112 return;
a61af66fc99e Initial load
duke
parents:
diff changeset
113 }
a61af66fc99e Initial load
duke
parents:
diff changeset
114 Iterator myIter = threads.iterator();
a61af66fc99e Initial load
duke
parents:
diff changeset
115 while(myIter.hasNext()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
116 ThreadReference aThread = (ThreadReference)myIter.next();
a61af66fc99e Initial load
duke
parents:
diff changeset
117 doOneThread(aThread);
a61af66fc99e Initial load
duke
parents:
diff changeset
118 }
a61af66fc99e Initial load
duke
parents:
diff changeset
119 }
a61af66fc99e Initial load
duke
parents:
diff changeset
120
a61af66fc99e Initial load
duke
parents:
diff changeset
121 public void doOneThread(ThreadReference xx) {
a61af66fc99e Initial load
duke
parents:
diff changeset
122 pp("Thread: " + xx.name());
a61af66fc99e Initial load
duke
parents:
diff changeset
123 indent(4);
a61af66fc99e Initial load
duke
parents:
diff changeset
124 pp("suspendCount() = " + xx.suspendCount());
a61af66fc99e Initial load
duke
parents:
diff changeset
125
a61af66fc99e Initial load
duke
parents:
diff changeset
126 //void stop(ObjectReference throwable) throws InvalidTypeException;
a61af66fc99e Initial load
duke
parents:
diff changeset
127 //void interrupt();
a61af66fc99e Initial load
duke
parents:
diff changeset
128 pp("status() = " + xx.status());
a61af66fc99e Initial load
duke
parents:
diff changeset
129 pp("isSuspended() = " + xx.isSuspended());
a61af66fc99e Initial load
duke
parents:
diff changeset
130 pp("isAtBreakpoint() = " + xx.isAtBreakpoint());
a61af66fc99e Initial load
duke
parents:
diff changeset
131
a61af66fc99e Initial load
duke
parents:
diff changeset
132 pp("threadGroup() = " + xx.threadGroup());
a61af66fc99e Initial load
duke
parents:
diff changeset
133 indent(-4);
a61af66fc99e Initial load
duke
parents:
diff changeset
134
a61af66fc99e Initial load
duke
parents:
diff changeset
135 indent(4);
a61af66fc99e Initial load
duke
parents:
diff changeset
136 try {
a61af66fc99e Initial load
duke
parents:
diff changeset
137 List allFrames = xx.frames();
a61af66fc99e Initial load
duke
parents:
diff changeset
138 for (int ii = 0; ii < xx.frameCount(); ii++) {
a61af66fc99e Initial load
duke
parents:
diff changeset
139 StackFrame oneFrame = xx.frame(ii);
a61af66fc99e Initial load
duke
parents:
diff changeset
140 pp("frame(" + ii + ") = " + oneFrame);
a61af66fc99e Initial load
duke
parents:
diff changeset
141 doOneFrame(oneFrame);
a61af66fc99e Initial load
duke
parents:
diff changeset
142 }
a61af66fc99e Initial load
duke
parents:
diff changeset
143 //List frames(int start, int length) throws IncompatibleThreadStateException;
a61af66fc99e Initial load
duke
parents:
diff changeset
144 // unsupported List allMonitors = xx.ownedMonitors();
a61af66fc99e Initial load
duke
parents:
diff changeset
145 // unsupported pp("currentContendedMonitor() = " + xx.currentContendedMonitor());
a61af66fc99e Initial load
duke
parents:
diff changeset
146 } catch (IncompatibleThreadStateException ee) {
a61af66fc99e Initial load
duke
parents:
diff changeset
147 pp("GOT IncompatibleThreadStateException: " + ee);
a61af66fc99e Initial load
duke
parents:
diff changeset
148 }
a61af66fc99e Initial load
duke
parents:
diff changeset
149 indent(-4);
a61af66fc99e Initial load
duke
parents:
diff changeset
150 }
a61af66fc99e Initial load
duke
parents:
diff changeset
151
a61af66fc99e Initial load
duke
parents:
diff changeset
152 public void doOneFrame(StackFrame frame) {
a61af66fc99e Initial load
duke
parents:
diff changeset
153
a61af66fc99e Initial load
duke
parents:
diff changeset
154 List localVars = null;
a61af66fc99e Initial load
duke
parents:
diff changeset
155 try {
a61af66fc99e Initial load
duke
parents:
diff changeset
156 localVars = frame.visibleVariables();
a61af66fc99e Initial load
duke
parents:
diff changeset
157 } catch (AbsentInformationException ee) {
a61af66fc99e Initial load
duke
parents:
diff changeset
158 // we compile with -g so this shouldn't happen
a61af66fc99e Initial load
duke
parents:
diff changeset
159 return;
a61af66fc99e Initial load
duke
parents:
diff changeset
160 }
a61af66fc99e Initial load
duke
parents:
diff changeset
161 indent(4);
a61af66fc99e Initial load
duke
parents:
diff changeset
162 for (Iterator it = localVars.iterator(); it.hasNext();) {
a61af66fc99e Initial load
duke
parents:
diff changeset
163 LocalVariable lv = (LocalVariable) it.next();
a61af66fc99e Initial load
duke
parents:
diff changeset
164 pp("lv name = " + lv.name() +
a61af66fc99e Initial load
duke
parents:
diff changeset
165 ", type = " + lv.typeName() +
a61af66fc99e Initial load
duke
parents:
diff changeset
166 ", sig = " + lv.signature() +
a61af66fc99e Initial load
duke
parents:
diff changeset
167 ", gsig = " + lv.genericSignature() +
a61af66fc99e Initial load
duke
parents:
diff changeset
168 ", isVis = " + lv.isVisible(frame) +
a61af66fc99e Initial load
duke
parents:
diff changeset
169 ", isArg = " + lv.isArgument());
a61af66fc99e Initial load
duke
parents:
diff changeset
170 }
a61af66fc99e Initial load
duke
parents:
diff changeset
171 indent(-4);
a61af66fc99e Initial load
duke
parents:
diff changeset
172 }
a61af66fc99e Initial load
duke
parents:
diff changeset
173
a61af66fc99e Initial load
duke
parents:
diff changeset
174 public void doClasses() {
a61af66fc99e Initial load
duke
parents:
diff changeset
175 List myClasses = myVm.allClasses();
a61af66fc99e Initial load
duke
parents:
diff changeset
176 myClasses = new ArrayList(myClasses);
a61af66fc99e Initial load
duke
parents:
diff changeset
177 Collections.sort(myClasses, new comparator());
a61af66fc99e Initial load
duke
parents:
diff changeset
178 for (int ii = 0; ii < myClasses.size(); ii++) {
a61af66fc99e Initial load
duke
parents:
diff changeset
179 // Spec says each is a ReferenceType
a61af66fc99e Initial load
duke
parents:
diff changeset
180 //System.out.println("class " + (ii + 1) + " is " + myClasses.get(ii));
a61af66fc99e Initial load
duke
parents:
diff changeset
181 ReferenceType aClass = (ReferenceType)myClasses.get(ii);
a61af66fc99e Initial load
duke
parents:
diff changeset
182 System.out.println("class " + (ii + 1) + " is " + aClass.signature());
a61af66fc99e Initial load
duke
parents:
diff changeset
183 doOneClass(aClass);
a61af66fc99e Initial load
duke
parents:
diff changeset
184 // Uncomment this to just do a few classes.
a61af66fc99e Initial load
duke
parents:
diff changeset
185 //if ( ii > 4) break;
a61af66fc99e Initial load
duke
parents:
diff changeset
186 }
a61af66fc99e Initial load
duke
parents:
diff changeset
187 }
a61af66fc99e Initial load
duke
parents:
diff changeset
188
a61af66fc99e Initial load
duke
parents:
diff changeset
189 public void doOneClass(ReferenceType xx) {
a61af66fc99e Initial load
duke
parents:
diff changeset
190 indent(5);
a61af66fc99e Initial load
duke
parents:
diff changeset
191 // inherited from Mirror
a61af66fc99e Initial load
duke
parents:
diff changeset
192 pp("toString() = " + xx.toString());
a61af66fc99e Initial load
duke
parents:
diff changeset
193 pp("virtualMachine() = " + xx.virtualMachine());
a61af66fc99e Initial load
duke
parents:
diff changeset
194
a61af66fc99e Initial load
duke
parents:
diff changeset
195 // inherited from Type
a61af66fc99e Initial load
duke
parents:
diff changeset
196 pp("name() = " + xx.name());
a61af66fc99e Initial load
duke
parents:
diff changeset
197 pp("signature() = " + xx.signature());
a61af66fc99e Initial load
duke
parents:
diff changeset
198
a61af66fc99e Initial load
duke
parents:
diff changeset
199 // ReferenceType fields
a61af66fc99e Initial load
duke
parents:
diff changeset
200 doReferenceTypeFields(xx);
a61af66fc99e Initial load
duke
parents:
diff changeset
201
a61af66fc99e Initial load
duke
parents:
diff changeset
202
a61af66fc99e Initial load
duke
parents:
diff changeset
203
a61af66fc99e Initial load
duke
parents:
diff changeset
204
a61af66fc99e Initial load
duke
parents:
diff changeset
205
a61af66fc99e Initial load
duke
parents:
diff changeset
206 String className = xx.getClass().getName();
a61af66fc99e Initial load
duke
parents:
diff changeset
207 pp("subclass = " + className);
a61af66fc99e Initial load
duke
parents:
diff changeset
208
a61af66fc99e Initial load
duke
parents:
diff changeset
209 Class referenceType = null;
a61af66fc99e Initial load
duke
parents:
diff changeset
210 Class arrayType = null;
a61af66fc99e Initial load
duke
parents:
diff changeset
211 Class classType = null;
a61af66fc99e Initial load
duke
parents:
diff changeset
212 Class interfaceType = null;
a61af66fc99e Initial load
duke
parents:
diff changeset
213
a61af66fc99e Initial load
duke
parents:
diff changeset
214 try {
a61af66fc99e Initial load
duke
parents:
diff changeset
215 referenceType = Class.forName("com.sun.jdi.ReferenceType");
a61af66fc99e Initial load
duke
parents:
diff changeset
216 arrayType = Class.forName("com.sun.jdi.ArrayType");
a61af66fc99e Initial load
duke
parents:
diff changeset
217 interfaceType = Class.forName("com.sun.jdi.InterfaceType");
a61af66fc99e Initial load
duke
parents:
diff changeset
218 classType = Class.forName("com.sun.jdi.ClassType");
a61af66fc99e Initial load
duke
parents:
diff changeset
219 } catch (ClassNotFoundException ee) {
a61af66fc99e Initial load
duke
parents:
diff changeset
220 }
a61af66fc99e Initial load
duke
parents:
diff changeset
221
a61af66fc99e Initial load
duke
parents:
diff changeset
222
a61af66fc99e Initial load
duke
parents:
diff changeset
223 if (referenceType.isInstance(xx)) {
a61af66fc99e Initial load
duke
parents:
diff changeset
224 pp("ReferenceType fields");
a61af66fc99e Initial load
duke
parents:
diff changeset
225 ReferenceType rr = (ReferenceType)xx;
a61af66fc99e Initial load
duke
parents:
diff changeset
226
a61af66fc99e Initial load
duke
parents:
diff changeset
227 if (arrayType.isInstance(xx)) {
a61af66fc99e Initial load
duke
parents:
diff changeset
228 pp("ArrayType fields");
a61af66fc99e Initial load
duke
parents:
diff changeset
229 }
a61af66fc99e Initial load
duke
parents:
diff changeset
230
a61af66fc99e Initial load
duke
parents:
diff changeset
231 if (classType.isInstance(xx)) {
a61af66fc99e Initial load
duke
parents:
diff changeset
232 pp("ClassType fields");
a61af66fc99e Initial load
duke
parents:
diff changeset
233 }
a61af66fc99e Initial load
duke
parents:
diff changeset
234
a61af66fc99e Initial load
duke
parents:
diff changeset
235 if (interfaceType.isInstance(xx)) {
a61af66fc99e Initial load
duke
parents:
diff changeset
236 pp("InterfaceType fields");
a61af66fc99e Initial load
duke
parents:
diff changeset
237 }
a61af66fc99e Initial load
duke
parents:
diff changeset
238 }
a61af66fc99e Initial load
duke
parents:
diff changeset
239 indent(-5);
a61af66fc99e Initial load
duke
parents:
diff changeset
240
a61af66fc99e Initial load
duke
parents:
diff changeset
241 }
a61af66fc99e Initial load
duke
parents:
diff changeset
242
a61af66fc99e Initial load
duke
parents:
diff changeset
243
a61af66fc99e Initial load
duke
parents:
diff changeset
244 public void doReferenceTypeFields(ReferenceType xx) {
a61af66fc99e Initial load
duke
parents:
diff changeset
245 Object zz;
a61af66fc99e Initial load
duke
parents:
diff changeset
246 pp("classLoader() = " + xx.classLoader());
a61af66fc99e Initial load
duke
parents:
diff changeset
247 try {zz =xx.sourceName();} catch(AbsentInformationException ee) { zz = ee;} pp("sourceName() = " + zz);
a61af66fc99e Initial load
duke
parents:
diff changeset
248 try {zz =xx.sourceNames("stratum");} catch(AbsentInformationException ee) { zz = ee;} pp("sourceNames() = " + zz);
a61af66fc99e Initial load
duke
parents:
diff changeset
249 try {zz =xx.sourcePaths("stratum");} catch(AbsentInformationException ee) { zz = ee;} pp("sourcePaths() = " + zz);
a61af66fc99e Initial load
duke
parents:
diff changeset
250 //try {zz =xx.sourceDebugExtension();} catch(AbsentInformationException ee) { zz = ee;} pp("sourceDebugExtension() = " + zz);
a61af66fc99e Initial load
duke
parents:
diff changeset
251 //fixme: jj; should sourceDebugExtension throw UnsupportedOperationException?
a61af66fc99e Initial load
duke
parents:
diff changeset
252 try {zz =xx.sourceDebugExtension();} catch(Exception ee) { zz = ee;} pp("sourceDebugExtension() = " + zz);
a61af66fc99e Initial load
duke
parents:
diff changeset
253 // If xx is an array, this can cause a ClassNotLoadedException on the
a61af66fc99e Initial load
duke
parents:
diff changeset
254 // component type. Is that a JDI bug?
a61af66fc99e Initial load
duke
parents:
diff changeset
255 pp("isStatic() = " + xx.isStatic());
a61af66fc99e Initial load
duke
parents:
diff changeset
256 pp("isAbstract() = " + xx.isAbstract());
a61af66fc99e Initial load
duke
parents:
diff changeset
257 pp("isFinal() = " + xx.isFinal());
a61af66fc99e Initial load
duke
parents:
diff changeset
258 pp("isPrepared() = " + xx.isPrepared());
a61af66fc99e Initial load
duke
parents:
diff changeset
259 pp("isVerified() = " + xx.isVerified());
a61af66fc99e Initial load
duke
parents:
diff changeset
260 pp("isInitialized() = " + xx.isInitialized());
a61af66fc99e Initial load
duke
parents:
diff changeset
261 pp("failedToInitialize() = " + xx.failedToInitialize());
a61af66fc99e Initial load
duke
parents:
diff changeset
262 pp("fields() = " + xx.fields());
a61af66fc99e Initial load
duke
parents:
diff changeset
263 pp("visibleFields() = " + xx.visibleFields());
a61af66fc99e Initial load
duke
parents:
diff changeset
264 pp("allFields() = " + xx.allFields());
a61af66fc99e Initial load
duke
parents:
diff changeset
265 pp("fieldByName(String fieldName) = " + xx.fieldByName("fieldName"));
a61af66fc99e Initial load
duke
parents:
diff changeset
266 pp("methods() = " + xx.methods());
a61af66fc99e Initial load
duke
parents:
diff changeset
267
a61af66fc99e Initial load
duke
parents:
diff changeset
268
a61af66fc99e Initial load
duke
parents:
diff changeset
269 List meths = xx.methods();
a61af66fc99e Initial load
duke
parents:
diff changeset
270 Iterator iter = meths.iterator();
a61af66fc99e Initial load
duke
parents:
diff changeset
271 while (iter.hasNext()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
272 Method mm = (Method)iter.next();
a61af66fc99e Initial load
duke
parents:
diff changeset
273 pp(" name/sig:" + mm.name() + "/" + mm.signature());
a61af66fc99e Initial load
duke
parents:
diff changeset
274 }
a61af66fc99e Initial load
duke
parents:
diff changeset
275
a61af66fc99e Initial load
duke
parents:
diff changeset
276 pp(" visibleMethods() = " + xx.visibleMethods());
a61af66fc99e Initial load
duke
parents:
diff changeset
277
a61af66fc99e Initial load
duke
parents:
diff changeset
278 //if (1 == 1) return;
a61af66fc99e Initial load
duke
parents:
diff changeset
279
a61af66fc99e Initial load
duke
parents:
diff changeset
280 pp("allMethods() = " + xx.allMethods());
a61af66fc99e Initial load
duke
parents:
diff changeset
281
a61af66fc99e Initial load
duke
parents:
diff changeset
282
a61af66fc99e Initial load
duke
parents:
diff changeset
283 pp("methodsByName(String name) = " + xx.methodsByName("name"));
a61af66fc99e Initial load
duke
parents:
diff changeset
284 pp("methodsByName(String name, String signature) = " + xx.methodsByName("name", "signature"));
a61af66fc99e Initial load
duke
parents:
diff changeset
285 pp("nestedTypes() = " + xx.nestedTypes());
a61af66fc99e Initial load
duke
parents:
diff changeset
286 //pp("getValue(Field field) = " + xx.getValue("field"));
a61af66fc99e Initial load
duke
parents:
diff changeset
287 pp("getValue(Field field) = " + "fixme: jjh");
a61af66fc99e Initial load
duke
parents:
diff changeset
288 //pp("getValues(List fields) = " + xx.getValues(new List[] = {"fields"}));
a61af66fc99e Initial load
duke
parents:
diff changeset
289 pp("getValues(List fields) = " + "fixme: jjh");
a61af66fc99e Initial load
duke
parents:
diff changeset
290 pp("classObject() = " + xx.classObject());
a61af66fc99e Initial load
duke
parents:
diff changeset
291 //x pp("allLineLocations() = " + xx.allLineLocations());
a61af66fc99e Initial load
duke
parents:
diff changeset
292 //x pp("allLineLocations(String stratum, String sourceName) = " + xx.allLineLocations("stratum", "sourceName"));
a61af66fc99e Initial load
duke
parents:
diff changeset
293 //x pp("locationsOfLine(int lineNumber) = " + xx.locationsOfLine(89));
a61af66fc99e Initial load
duke
parents:
diff changeset
294 //x pp("locationsOfLine(String stratum, String sourceName, int lineNumber) = " + xx.locationsOfLine("stratum", "sourceName", 89));
a61af66fc99e Initial load
duke
parents:
diff changeset
295 pp("availableStrata() = " + xx.availableStrata());
a61af66fc99e Initial load
duke
parents:
diff changeset
296 pp("defaultStratum() = " + xx.defaultStratum());
a61af66fc99e Initial load
duke
parents:
diff changeset
297 pp("equals(Object obj) = " + xx.equals(xx));
a61af66fc99e Initial load
duke
parents:
diff changeset
298 pp("hashCode() = " + xx.hashCode());
a61af66fc99e Initial load
duke
parents:
diff changeset
299 }
a61af66fc99e Initial load
duke
parents:
diff changeset
300
a61af66fc99e Initial load
duke
parents:
diff changeset
301 }
a61af66fc99e Initial load
duke
parents:
diff changeset
302
a61af66fc99e Initial load
duke
parents:
diff changeset
303 // try {
a61af66fc99e Initial load
duke
parents:
diff changeset
304 // ReferenceType rr = (ReferenceType)xx;
a61af66fc99e Initial load
duke
parents:
diff changeset
305 // pp("ReferenceType fields");
a61af66fc99e Initial load
duke
parents:
diff changeset
306
a61af66fc99e Initial load
duke
parents:
diff changeset
307 // try {
a61af66fc99e Initial load
duke
parents:
diff changeset
308 // ArrayType ff = (ArrayType)xx;
a61af66fc99e Initial load
duke
parents:
diff changeset
309 // pp("ArrayType fields");
a61af66fc99e Initial load
duke
parents:
diff changeset
310
a61af66fc99e Initial load
duke
parents:
diff changeset
311 // } catch(ClassCastException ee) {
a61af66fc99e Initial load
duke
parents:
diff changeset
312 // }
a61af66fc99e Initial load
duke
parents:
diff changeset
313
a61af66fc99e Initial load
duke
parents:
diff changeset
314 // try {
a61af66fc99e Initial load
duke
parents:
diff changeset
315 // ClassType ff = (ClassType)xx;
a61af66fc99e Initial load
duke
parents:
diff changeset
316 // pp("ClassType fields");
a61af66fc99e Initial load
duke
parents:
diff changeset
317
a61af66fc99e Initial load
duke
parents:
diff changeset
318 // } catch(ClassCastException ee) {
a61af66fc99e Initial load
duke
parents:
diff changeset
319 // }
a61af66fc99e Initial load
duke
parents:
diff changeset
320
a61af66fc99e Initial load
duke
parents:
diff changeset
321 // try {
a61af66fc99e Initial load
duke
parents:
diff changeset
322 // InterfaceType ff = (InterfaceType)xx;
a61af66fc99e Initial load
duke
parents:
diff changeset
323 // pp("InterfaceType fields");
a61af66fc99e Initial load
duke
parents:
diff changeset
324
a61af66fc99e Initial load
duke
parents:
diff changeset
325 // } catch(ClassCastException ee) {
a61af66fc99e Initial load
duke
parents:
diff changeset
326 // }
a61af66fc99e Initial load
duke
parents:
diff changeset
327
a61af66fc99e Initial load
duke
parents:
diff changeset
328 // } catch(ClassCastException ee) {
a61af66fc99e Initial load
duke
parents:
diff changeset
329 // }