public void processReference(int objref) {
if (objref == MJIEnv.NULL) {
buf.add(MJIEnv.NULL);
-
} else {
ElementInfo ei = heap.get(objref);
int sid = ei.getSid();
buf.add(sid);
}
}
-
+
+
+ boolean istop;
@Override
protected void serializeStackFrames() {
ThreadList tl = ks.getThreadList();
-
+ istop = true;
for (Iterator<ThreadInfo> it = tl.canonicalLiveIterator(); it.hasNext(); ) {
serializeStackFrames(it.next());
+ istop = false;
}
}
@Override
protected void serializeFrame(StackFrame frame){
- buf.add(frame.getMethodInfo().getGlobalId());
-
+ FramePolicy fp = getFramePolicy(frame.getMethodInfo());
Instruction pc = frame.getPC();
- buf.add( pc != null ? pc.getInstructionIndex() : -1);
-
int len = frame.getTopPos()+1;
- buf.add(len);
-
- // unfortunately we can't do this as a block operation because that
- // would use concrete reference values as hash data, i.e. break heap symmetry
- int[] slots = frame.getSlots();
- for (int i = 0; i < len; i++) {
- if (frame.isReferenceSlot(i)) {
- processReference(slots[i]);
- } else {
- buf.add(slots[i]);
+
+ if (fp == null || fp.includePC || istop) {
+ buf.add(frame.getMethodInfo().getGlobalId());
+ buf.add( pc != null ? pc.getInstructionIndex() : -1);
+ }
+
+ if (fp == null || fp.includeLocals || istop) {
+ buf.add(len);
+
+ // unfortunately we can't do this as a block operation because that
+ // would use concrete reference values as hash data, i.e. break heap symmetry
+ int[] slots = frame.getSlots();
+ for (int i = 0; i < len; i++) {
+ if (frame.isReferenceSlot(i)) {
+ processReference(slots[i]);
+ } else {
+ buf.add(slots[i]);
+ }
}
}
}
implements FieldAmmendment, FrameAmmendment {
boolean ignoreClass(ClassInfo ci) {
- String pName = ci.getPackageName();
- if (pName.startsWith("org.codehaus.groovy")) {
- // System.out.println("Ignoring "+pName);
+ String pName = ci.getName();
+ if (pName.startsWith("org")) {
+ if (pName.startsWith("org.codehaus.groovy")) {
+ // System.out.println("Ignoring "+pName);
+ return true;
+ }
+ if (pName.startsWith("org.apache.groovy")) {
+ // System.out.println("Ignoring "+pName);
+ return true;
+ }
+ } else if (pName.startsWith("java")) {
+ if (pName.startsWith("java.lang")) {
+ if (pName.startsWith("java.lang.reflect")) {
+ return true;
+ }
+ if (pName.startsWith("java.lang.ref")) {
+ return true;
+ }
+ if (pName.startsWith("java.lang.ClassLoader")) {
+ return true;
+ }
+ if (pName.startsWith("java.lang.Thread$State")) {
+ return true;
+ }
+ if (pName.startsWith("java.lang.Class"))
+ return true;
+ if (pName.startsWith("java.lang.Package"))
+ return true;
+ } else {
+ if (pName.startsWith("java.util.concurrent")) {
+ // System.out.println("Ignoring "+pName);
+ return true;
+ }
+ if (pName.startsWith("java.util.logging")) {
+ // System.out.println("Ignoring "+pName);
+ return true;
+ }
+ if (pName.startsWith("java.beans")) {
+ return true;
+ }
+ if (pName.startsWith("java.io.OutputStreamWriter"))
+ return true;
+ if (pName.startsWith("java.io.PrintStream"))
+ return true;
+ if (pName.startsWith("java.io.BufferedWriter"))
+ return true;
+ }
+ if (pName.startsWith("java.nio.charset"))
+ return true;
+
+ } else if (pName.startsWith("groovy")) {
+ if (pName.startsWith("groovy.lang")) {
+ // System.out.println("Ignoring "+pName);
+ return true;
+ }
+ if (pName.startsWith("groovyjarjarasm.asm")) {
+ // System.out.println("Ignoring "+pName);
+ return true;
+ }
+ }
+ if (pName.startsWith("com.sun.beans")) {
return true;
}
- if (pName.startsWith("groovy.lang")) {
- // System.out.println("Ignoring "+pName);
+ if (pName.startsWith("sun.reflect")) {
return true;
}
+ if (pName.startsWith("sun.misc.SharedSecrets"))
+ return true;
+ if (pName.startsWith("sun.util.logging"))
+ return true;
+ if (pName.startsWith("sun.net.www"))
+ return true;
+
return false;
}
ClassInfo ci = fi.getClassInfo();
if (ignoreClass(ci))
return POLICY_IGNORE;
-
+ ClassInfo civ = fi.getTypeClassInfo();
+ if (ignoreClass(civ))
+ return POLICY_IGNORE;
return sofar;
}
sofar.includeLocals = false;
sofar.includeOps = false;
sofar.includePC = false;
+ } else {
+ // System.out.println("Including M: " +mi);
}
return sofar;