diff options
40 files changed, 278 insertions, 334 deletions
diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java b/weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java index a5752e5ed..e7b6b93c2 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java @@ -114,8 +114,6 @@ class BcelClassWeaver implements IClassWeaver { private BcelShadow clinitShadow = null; - - /** * This holds the initialization and pre-initialization shadows for this class * that were actually matched by mungers (if no match, then we don't even create the @@ -148,22 +146,35 @@ class BcelClassWeaver implements IClassWeaver { private boolean canMatchBodyShadows = false; private boolean canMatchInitialization = false; private void fastMatchShadowMungers(List shadowMungers) { - perKindShadowMungers = new List[Shadow.MAX_SHADOW_KIND+1]; - for (int i = 0; i < Shadow.SHADOW_KINDS.length; i++) { - Shadow.Kind kind = Shadow.SHADOW_KINDS[i]; + // beware the annoying property that SHADOW_KINDS[i].getKey == (i+1) ! + + perKindShadowMungers = new List[Shadow.MAX_SHADOW_KIND + 1]; + for (int i = 0; i < perKindShadowMungers.length; i++) { ArrayList mungers = new ArrayList(0); - perKindShadowMungers[kind.getKey()] = mungers; - fastMatchShadowMungers(shadowMungers, mungers, kind); - if (mungers.isEmpty()) { - perKindShadowMungers[kind.getKey()] = null; - } else { - if (kind == Shadow.Initialization) { - canMatchInitialization = true; - } else if (!kind.isEnclosingKind()) { - canMatchBodyShadows = true; - } + perKindShadowMungers[i] = new ArrayList(0); + } + for (Iterator iter = shadowMungers.iterator(); iter.hasNext();) { + ShadowMunger munger = (ShadowMunger) iter.next(); + Set couldMatchKinds = munger.getPointcut().couldMatchKinds(); + for (Iterator kindIterator = couldMatchKinds.iterator(); + kindIterator.hasNext();) { + Shadow.Kind aKind = (Shadow.Kind) kindIterator.next(); + perKindShadowMungers[aKind.getKey()].add(munger); } } + + if (!perKindShadowMungers[Shadow.Initialization.getKey()].isEmpty()) + canMatchInitialization = true; + + for (int i = 0; i < Shadow.SHADOW_KINDS.length; i++) { + Shadow.Kind kind = Shadow.SHADOW_KINDS[i]; + if (!kind.isEnclosingKind() && !perKindShadowMungers[i+1].isEmpty()) { + canMatchBodyShadows = true; + } + if (perKindShadowMungers[i+1].isEmpty()) { + perKindShadowMungers[i+1] = null; + } + } } private boolean canMatch(Shadow.Kind kind) { @@ -827,8 +838,10 @@ class BcelClassWeaver implements IClassWeaver { match(mg, h, enclosingShadow, shadowAccumulator); } } - if (match(enclosingShadow, shadowAccumulator)) { - enclosingShadow.init(); + if (canMatch(enclosingShadow.getKind())) { + if (match(enclosingShadow, shadowAccumulator)) { + enclosingShadow.init(); + } } mg.matchedShadows = shadowAccumulator; return !shadowAccumulator.isEmpty(); @@ -859,7 +872,8 @@ class BcelClassWeaver implements IClassWeaver { match(mg, h, beforeSuperOrThisCall ? null : enclosingShadow, shadowAccumulator); } } - match(enclosingShadow, shadowAccumulator); + if (canMatch(Shadow.ConstructorExecution)) + match(enclosingShadow, shadowAccumulator); } // XXX we don't do pre-inits of interfaces @@ -943,7 +957,9 @@ class BcelClassWeaver implements IClassWeaver { List shadowAccumulator) { Instruction i = ih.getInstruction(); - if (i instanceof FieldInstruction) { + if ((i instanceof FieldInstruction) && + (canMatch(Shadow.FieldGet) || canMatch(Shadow.FieldSet)) + ) { FieldInstruction fi = (FieldInstruction) i; if (fi instanceof PUTFIELD || fi instanceof PUTSTATIC) { @@ -962,20 +978,24 @@ class BcelClassWeaver implements IClassWeaver { // it's final, so it's the set of a final constant, so it's // not a join point according to 1.0.6 and 1.1. } else { - matchSetInstruction(mg, ih, enclosingShadow, shadowAccumulator); + if (canMatch(Shadow.FieldSet)) + matchSetInstruction(mg, ih, enclosingShadow, shadowAccumulator); } } else { - matchSetInstruction(mg, ih, enclosingShadow, shadowAccumulator); + if (canMatch(Shadow.FieldSet)) + matchSetInstruction(mg, ih, enclosingShadow, shadowAccumulator); } } else { - matchGetInstruction(mg, ih, enclosingShadow, shadowAccumulator); + if (canMatch(Shadow.FieldGet)) + matchGetInstruction(mg, ih, enclosingShadow, shadowAccumulator); } } else if (i instanceof InvokeInstruction) { InvokeInstruction ii = (InvokeInstruction) i; if (ii.getMethodName(clazz.getConstantPoolGen()).equals("<init>")) { - match( - BcelShadow.makeConstructorCall(world, mg, ih, enclosingShadow), - shadowAccumulator); + if (canMatch(Shadow.ConstructorCall)) + match( + BcelShadow.makeConstructorCall(world, mg, ih, enclosingShadow), + shadowAccumulator); } else if (ii instanceof INVOKESPECIAL) { String onTypeName = ii.getClassName(cpg); if (onTypeName.equals(mg.getEnclosingClass().getName())) { @@ -991,6 +1011,7 @@ class BcelClassWeaver implements IClassWeaver { // performance optimization... we only actually care about ASTORE instructions, // since that's what every javac type thing ever uses to start a handler, but for // now we'll do this for everybody. + if (!canMatch(Shadow.ExceptionHandler)) return; if (Range.isRangeHandle(ih)) return; InstructionTargeter[] targeters = ih.getTargeters(); if (targeters != null) { @@ -1099,23 +1120,26 @@ class BcelClassWeaver implements IClassWeaver { kind = Shadow.FieldGet; } - match(BcelShadow.makeShadowForMethodCall(world, mg, ih, enclosingShadow, - kind, declaredSig), - shadowAccumulator); + if (canMatch(Shadow.FieldGet) || canMatch(Shadow.FieldSet)) + match(BcelShadow.makeShadowForMethodCall(world, mg, ih, enclosingShadow, + kind, declaredSig), + shadowAccumulator); } else { AjAttribute.EffectiveSignatureAttribute effectiveSig = declaredSig.getEffectiveSignature(); if (effectiveSig == null) return; //System.err.println("call to inter-type member: " + effectiveSig); if (effectiveSig.isWeaveBody()) return; - match(BcelShadow.makeShadowForMethodCall(world, mg, ih, enclosingShadow, - effectiveSig.getShadowKind(), effectiveSig.getEffectiveSignature()), - shadowAccumulator); + if (canMatch(effectiveSig.getShadowKind())) + match(BcelShadow.makeShadowForMethodCall(world, mg, ih, enclosingShadow, + effectiveSig.getShadowKind(), effectiveSig.getEffectiveSignature()), + shadowAccumulator); } } else { - match( - BcelShadow.makeMethodCall(world, mg, ih, enclosingShadow), - shadowAccumulator); + if (canMatch(Shadow.MethodCall)) + match( + BcelShadow.makeMethodCall(world, mg, ih, enclosingShadow), + shadowAccumulator); } } diff --git a/weaver/src/org/aspectj/weaver/bcel/LazyMethodGen.java b/weaver/src/org/aspectj/weaver/bcel/LazyMethodGen.java index da83af2af..ae0fc6852 100644 --- a/weaver/src/org/aspectj/weaver/bcel/LazyMethodGen.java +++ b/weaver/src/org/aspectj/weaver/bcel/LazyMethodGen.java @@ -102,6 +102,7 @@ public final class LazyMethodGen { * only used by {@link BcelClassWeaver} */ List /*ShadowMungers*/ matchedShadows; + List /*Test*/ matchedShadowTests; // Used for interface introduction // this is the type of the interface the method is technically on diff --git a/weaver/testdata/AddNotResidueDynamicHelloWorld.txt b/weaver/testdata/AddNotResidueDynamicHelloWorld.txt index 674db3af5..ee151b164 100644 --- a/weaver/testdata/AddNotResidueDynamicHelloWorld.txt +++ b/weaver/testdata/AddNotResidueDynamicHelloWorld.txt @@ -12,13 +12,9 @@ public class DynamicHelloWorld extends java.lang.Object implements java.io.Seria | catch java.lang.UnsupportedOperationException -> E0 | | NEW DynamicHelloWorld (line 12) | | DUP - | | constructor-call(void DynamicHelloWorld.<init>()) - | | | INVOKESPECIAL DynamicHelloWorld.<init> ()V - | | constructor-call(void DynamicHelloWorld.<init>()) + | | INVOKESPECIAL DynamicHelloWorld.<init> ()V | | LDC "hello" - | | field-get(java.util.List java.util.Collections.EMPTY_LIST) - | | | GETSTATIC java.util.Collections.EMPTY_LIST Ljava/util/List; - | | field-get(java.util.List java.util.Collections.EMPTY_LIST) + | | GETSTATIC java.util.Collections.EMPTY_LIST Ljava/util/List; | | method-call(java.lang.String DynamicHelloWorld.doit(java.lang.String, java.util.List)) | | | INVOKEVIRTUAL DynamicHelloWorld.doit (Ljava/lang/String;Ljava/util/List;)Ljava/lang/String; | | method-call(java.lang.String DynamicHelloWorld.doit(java.lang.String, java.util.List)) @@ -26,15 +22,11 @@ public class DynamicHelloWorld extends java.lang.Object implements java.io.Seria | | GOTO L0 | catch java.lang.UnsupportedOperationException -> E0 | E0: ASTORE_1 (line 13) - | field-get(java.io.PrintStream java.lang.System.out) - | | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 14) - | field-get(java.io.PrintStream java.lang.System.out) + | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 14) | NEW java.lang.StringBuffer | DUP | LDC "expected and caught: " - | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String)) - | | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V - | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String)) + | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V | ALOAD_1 // java.lang.UnsupportedOperationException t | method-call(java.lang.StringBuffer java.lang.StringBuffer.append(java.lang.Object)) | | INVOKEVIRTUAL java.lang.StringBuffer.append (Ljava/lang/Object;)Ljava/lang/StringBuffer; @@ -49,9 +41,7 @@ public class DynamicHelloWorld extends java.lang.Object implements java.io.Seria | L0: NEW java.lang.RuntimeException (line 17) | DUP | LDC "should have caught exception" - | constructor-call(void java.lang.RuntimeException.<init>(java.lang.String)) - | | INVOKESPECIAL java.lang.RuntimeException.<init> (Ljava/lang/String;)V - | constructor-call(void java.lang.RuntimeException.<init>(java.lang.String)) + | INVOKESPECIAL java.lang.RuntimeException.<init> (Ljava/lang/String;)V | ATHROW method-execution(void DynamicHelloWorld.main(java.lang.String[])) end public static void main(String[]) diff --git a/weaver/testdata/AddResidueDynamicHelloWorld.txt b/weaver/testdata/AddResidueDynamicHelloWorld.txt index a990db62b..0a8caefcf 100644 --- a/weaver/testdata/AddResidueDynamicHelloWorld.txt +++ b/weaver/testdata/AddResidueDynamicHelloWorld.txt @@ -12,13 +12,9 @@ public class DynamicHelloWorld extends java.lang.Object implements java.io.Seria | catch java.lang.UnsupportedOperationException -> E0 | | NEW DynamicHelloWorld (line 12) | | DUP - | | constructor-call(void DynamicHelloWorld.<init>()) - | | | INVOKESPECIAL DynamicHelloWorld.<init> ()V - | | constructor-call(void DynamicHelloWorld.<init>()) + | | INVOKESPECIAL DynamicHelloWorld.<init> ()V | | LDC "hello" - | | field-get(java.util.List java.util.Collections.EMPTY_LIST) - | | | GETSTATIC java.util.Collections.EMPTY_LIST Ljava/util/List; - | | field-get(java.util.List java.util.Collections.EMPTY_LIST) + | | GETSTATIC java.util.Collections.EMPTY_LIST Ljava/util/List; | | method-call(java.lang.String DynamicHelloWorld.doit(java.lang.String, java.util.List)) | | | INVOKEVIRTUAL DynamicHelloWorld.doit (Ljava/lang/String;Ljava/util/List;)Ljava/lang/String; | | method-call(java.lang.String DynamicHelloWorld.doit(java.lang.String, java.util.List)) @@ -26,15 +22,11 @@ public class DynamicHelloWorld extends java.lang.Object implements java.io.Seria | | GOTO L0 | catch java.lang.UnsupportedOperationException -> E0 | E0: ASTORE_1 (line 13) - | field-get(java.io.PrintStream java.lang.System.out) - | | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 14) - | field-get(java.io.PrintStream java.lang.System.out) + | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 14) | NEW java.lang.StringBuffer | DUP | LDC "expected and caught: " - | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String)) - | | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V - | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String)) + | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V | ALOAD_1 // java.lang.UnsupportedOperationException t | method-call(java.lang.StringBuffer java.lang.StringBuffer.append(java.lang.Object)) | | INVOKEVIRTUAL java.lang.StringBuffer.append (Ljava/lang/Object;)Ljava/lang/StringBuffer; @@ -49,9 +41,7 @@ public class DynamicHelloWorld extends java.lang.Object implements java.io.Seria | L0: NEW java.lang.RuntimeException (line 17) | DUP | LDC "should have caught exception" - | constructor-call(void java.lang.RuntimeException.<init>(java.lang.String)) - | | INVOKESPECIAL java.lang.RuntimeException.<init> (Ljava/lang/String;)V - | constructor-call(void java.lang.RuntimeException.<init>(java.lang.String)) + | INVOKESPECIAL java.lang.RuntimeException.<init> (Ljava/lang/String;)V | ATHROW method-execution(void DynamicHelloWorld.main(java.lang.String[])) end public static void main(String[]) diff --git a/weaver/testdata/AddStateResidueDynamicHelloWorld.txt b/weaver/testdata/AddStateResidueDynamicHelloWorld.txt index 8a3862c4b..6bc8e2154 100644 --- a/weaver/testdata/AddStateResidueDynamicHelloWorld.txt +++ b/weaver/testdata/AddStateResidueDynamicHelloWorld.txt @@ -12,13 +12,9 @@ public class DynamicHelloWorld extends java.lang.Object implements java.io.Seria | catch java.lang.UnsupportedOperationException -> E0 | | NEW DynamicHelloWorld (line 12) | | DUP - | | constructor-call(void DynamicHelloWorld.<init>()) - | | | INVOKESPECIAL DynamicHelloWorld.<init> ()V - | | constructor-call(void DynamicHelloWorld.<init>()) + | | INVOKESPECIAL DynamicHelloWorld.<init> ()V | | LDC "hello" - | | field-get(java.util.List java.util.Collections.EMPTY_LIST) - | | | GETSTATIC java.util.Collections.EMPTY_LIST Ljava/util/List; - | | field-get(java.util.List java.util.Collections.EMPTY_LIST) + | | GETSTATIC java.util.Collections.EMPTY_LIST Ljava/util/List; | | method-call(java.lang.String DynamicHelloWorld.doit(java.lang.String, java.util.List)) | | | INVOKEVIRTUAL DynamicHelloWorld.doit (Ljava/lang/String;Ljava/util/List;)Ljava/lang/String; | | method-call(java.lang.String DynamicHelloWorld.doit(java.lang.String, java.util.List)) @@ -26,15 +22,11 @@ public class DynamicHelloWorld extends java.lang.Object implements java.io.Seria | | GOTO L0 | catch java.lang.UnsupportedOperationException -> E0 | E0: ASTORE_1 (line 13) - | field-get(java.io.PrintStream java.lang.System.out) - | | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 14) - | field-get(java.io.PrintStream java.lang.System.out) + | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 14) | NEW java.lang.StringBuffer | DUP | LDC "expected and caught: " - | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String)) - | | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V - | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String)) + | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V | ALOAD_1 // java.lang.UnsupportedOperationException t | method-call(java.lang.StringBuffer java.lang.StringBuffer.append(java.lang.Object)) | | INVOKEVIRTUAL java.lang.StringBuffer.append (Ljava/lang/Object;)Ljava/lang/StringBuffer; @@ -49,9 +41,7 @@ public class DynamicHelloWorld extends java.lang.Object implements java.io.Seria | L0: NEW java.lang.RuntimeException (line 17) | DUP | LDC "should have caught exception" - | constructor-call(void java.lang.RuntimeException.<init>(java.lang.String)) - | | INVOKESPECIAL java.lang.RuntimeException.<init> (Ljava/lang/String;)V - | constructor-call(void java.lang.RuntimeException.<init>(java.lang.String)) + | INVOKESPECIAL java.lang.RuntimeException.<init> (Ljava/lang/String;)V | ATHROW method-execution(void DynamicHelloWorld.main(java.lang.String[])) end public static void main(String[]) diff --git a/weaver/testdata/AfterReturningCheckcastParamFancyHelloWorld.txt b/weaver/testdata/AfterReturningCheckcastParamFancyHelloWorld.txt index 868a63429..f45b4e78e 100644 --- a/weaver/testdata/AfterReturningCheckcastParamFancyHelloWorld.txt +++ b/weaver/testdata/AfterReturningCheckcastParamFancyHelloWorld.txt @@ -26,17 +26,13 @@ public abstract class FancyHelloWorld extends java.lang.Object: | | catch java.lang.Exception -> E0 | | | ALOAD_1 // java.io.PrintStream out (line 11) | | | LDC "bye" - | | | method-call(void java.io.PrintStream.println(java.lang.String)) - | | | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V - | | | method-call(void java.io.PrintStream.println(java.lang.String)) + | | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V | | | GOTO L1 | | catch java.lang.Exception -> E0 | | E0: ASTORE_2 (line 12) | | ALOAD_1 // java.io.PrintStream out (line 13) | | ALOAD_2 // java.lang.Exception e - | | method-call(void java.io.PrintStream.println(java.lang.Object)) - | | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/Object;)V - | | method-call(void java.io.PrintStream.println(java.lang.Object)) + | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/Object;)V | finally -> E1 | GOTO L1 | E1: ASTORE 4 (line 14) @@ -48,9 +44,7 @@ public abstract class FancyHelloWorld extends java.lang.Object: | L2: ASTORE_3 | ALOAD_1 // java.io.PrintStream out (line 15) | LDC "finally" - | method-call(void java.io.PrintStream.println(java.lang.String)) - | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V - | method-call(void java.io.PrintStream.println(java.lang.String)) + | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V | RET 3 (line 10) | L3: RETURN (line 17) method-execution(void FancyHelloWorld.main(java.lang.String[])) @@ -62,25 +56,18 @@ public abstract class FancyHelloWorld extends java.lang.Object: | ISTORE_0 | ILOAD_0 // int x (line 21) | LDC "name" - | method-call(int java.lang.String.hashCode()) - | | INVOKEVIRTUAL java.lang.String.hashCode ()I - | method-call(int java.lang.String.hashCode()) + | INVOKEVIRTUAL java.lang.String.hashCode ()I | IADD | ISTORE_0 // int x | NEW java.lang.StringBuffer (line 22) | DUP | LDC "name" - | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String)) - | | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V - | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String)) + | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V | ILOAD_0 // int x - | method-call(java.lang.StringBuffer java.lang.StringBuffer.append(int)) - | | INVOKEVIRTUAL java.lang.StringBuffer.append (I)Ljava/lang/StringBuffer; - | method-call(java.lang.StringBuffer java.lang.StringBuffer.append(int)) - | method-call(java.lang.String java.lang.StringBuffer.toString()) - | | INVOKEVIRTUAL java.lang.StringBuffer.toString ()Ljava/lang/String; - | method-call(java.lang.String java.lang.StringBuffer.toString()) + | INVOKEVIRTUAL java.lang.StringBuffer.append (I)Ljava/lang/StringBuffer; + | INVOKEVIRTUAL java.lang.StringBuffer.toString ()Ljava/lang/String; | ARETURN method-execution(java.lang.String FancyHelloWorld.getName()) end public static String getName() + end public abstract class FancyHelloWorld diff --git a/weaver/testdata/AfterReturningCheckcastParamHelloWorld.txt b/weaver/testdata/AfterReturningCheckcastParamHelloWorld.txt index 0aa498026..c7f6f9522 100644 --- a/weaver/testdata/AfterReturningCheckcastParamHelloWorld.txt +++ b/weaver/testdata/AfterReturningCheckcastParamHelloWorld.txt @@ -22,10 +22,9 @@ public class HelloWorld extends java.lang.Object: | | L0: NOP | field-get(java.io.PrintStream java.lang.System.out) | LDC "hello world" (line 9) - | method-call(void java.io.PrintStream.println(java.lang.String)) - | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V - | method-call(void java.io.PrintStream.println(java.lang.String)) + | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V | RETURN (line 11) method-execution(void HelloWorld.main(java.lang.String[])) end public static void main(String[]) + end public class HelloWorld diff --git a/weaver/testdata/AfterReturningConversionParam.txt b/weaver/testdata/AfterReturningConversionParam.txt index 7920b30d2..7c22dd71b 100644 --- a/weaver/testdata/AfterReturningConversionParam.txt +++ b/weaver/testdata/AfterReturningConversionParam.txt @@ -9,9 +9,7 @@ public abstract class FancyHelloWorld extends java.lang.Object: public static void main(String[]): method-execution(void FancyHelloWorld.main(java.lang.String[])) - | field-get(java.io.PrintStream java.lang.System.out) - | | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 9) - | field-get(java.io.PrintStream java.lang.System.out) + | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 9) | ASTORE_1 | finally -> E1 | | catch java.lang.Exception -> E0 @@ -67,9 +65,7 @@ public abstract class FancyHelloWorld extends java.lang.Object: | NEW java.lang.StringBuffer (line 22) | DUP | LDC "name" - | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String)) - | | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V - | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String)) + | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V | ILOAD_0 // int x | method-call(java.lang.StringBuffer java.lang.StringBuffer.append(int)) | | INVOKEVIRTUAL java.lang.StringBuffer.append (I)Ljava/lang/StringBuffer; @@ -80,4 +76,5 @@ public abstract class FancyHelloWorld extends java.lang.Object: | ARETURN method-execution(java.lang.String FancyHelloWorld.getName()) end public static String getName() + end public abstract class FancyHelloWorld diff --git a/weaver/testdata/AfterReturningParamFancyHelloWorld.txt b/weaver/testdata/AfterReturningParamFancyHelloWorld.txt index 959862843..c84a28fac 100644 --- a/weaver/testdata/AfterReturningParamFancyHelloWorld.txt +++ b/weaver/testdata/AfterReturningParamFancyHelloWorld.txt @@ -22,17 +22,13 @@ public abstract class FancyHelloWorld extends java.lang.Object: | | catch java.lang.Exception -> E0 | | | ALOAD_1 // java.io.PrintStream out (line 11) | | | LDC "bye" - | | | method-call(void java.io.PrintStream.println(java.lang.String)) - | | | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V - | | | method-call(void java.io.PrintStream.println(java.lang.String)) + | | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V | | | GOTO L0 | | catch java.lang.Exception -> E0 | | E0: ASTORE_2 (line 12) | | ALOAD_1 // java.io.PrintStream out (line 13) | | ALOAD_2 // java.lang.Exception e - | | method-call(void java.io.PrintStream.println(java.lang.Object)) - | | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/Object;)V - | | method-call(void java.io.PrintStream.println(java.lang.Object)) + | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/Object;)V | finally -> E1 | GOTO L0 | E1: ASTORE 4 (line 14) @@ -44,9 +40,7 @@ public abstract class FancyHelloWorld extends java.lang.Object: | L1: ASTORE_3 | ALOAD_1 // java.io.PrintStream out (line 15) | LDC "finally" - | method-call(void java.io.PrintStream.println(java.lang.String)) - | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V - | method-call(void java.io.PrintStream.println(java.lang.String)) + | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V | RET 3 (line 10) | L2: RETURN (line 17) method-execution(void FancyHelloWorld.main(java.lang.String[])) @@ -58,25 +52,18 @@ public abstract class FancyHelloWorld extends java.lang.Object: | ISTORE_0 | ILOAD_0 // int x (line 21) | LDC "name" - | method-call(int java.lang.String.hashCode()) - | | INVOKEVIRTUAL java.lang.String.hashCode ()I - | method-call(int java.lang.String.hashCode()) + | INVOKEVIRTUAL java.lang.String.hashCode ()I | IADD | ISTORE_0 // int x | NEW java.lang.StringBuffer (line 22) | DUP | LDC "name" - | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String)) - | | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V - | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String)) + | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V | ILOAD_0 // int x - | method-call(java.lang.StringBuffer java.lang.StringBuffer.append(int)) - | | INVOKEVIRTUAL java.lang.StringBuffer.append (I)Ljava/lang/StringBuffer; - | method-call(java.lang.StringBuffer java.lang.StringBuffer.append(int)) - | method-call(java.lang.String java.lang.StringBuffer.toString()) - | | INVOKEVIRTUAL java.lang.StringBuffer.toString ()Ljava/lang/String; - | method-call(java.lang.String java.lang.StringBuffer.toString()) + | INVOKEVIRTUAL java.lang.StringBuffer.append (I)Ljava/lang/StringBuffer; + | INVOKEVIRTUAL java.lang.StringBuffer.toString ()Ljava/lang/String; | ARETURN method-execution(java.lang.String FancyHelloWorld.getName()) end public static String getName() + end public abstract class FancyHelloWorld diff --git a/weaver/testdata/AfterReturningParamHelloWorld.txt b/weaver/testdata/AfterReturningParamHelloWorld.txt index 6da75a8f8..effaba7bd 100644 --- a/weaver/testdata/AfterReturningParamHelloWorld.txt +++ b/weaver/testdata/AfterReturningParamHelloWorld.txt @@ -18,10 +18,9 @@ public class HelloWorld extends java.lang.Object: | | NOP | field-get(java.io.PrintStream java.lang.System.out) | LDC "hello world" (line 9) - | method-call(void java.io.PrintStream.println(java.lang.String)) - | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V - | method-call(void java.io.PrintStream.println(java.lang.String)) + | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V | RETURN (line 11) method-execution(void HelloWorld.main(java.lang.String[])) end public static void main(String[]) + end public class HelloWorld diff --git a/weaver/testdata/AfterThrowingParamFancyHelloWorld.txt b/weaver/testdata/AfterThrowingParamFancyHelloWorld.txt index 0e995aaff..ecc17dcbd 100644 --- a/weaver/testdata/AfterThrowingParamFancyHelloWorld.txt +++ b/weaver/testdata/AfterThrowingParamFancyHelloWorld.txt @@ -26,17 +26,13 @@ public abstract class FancyHelloWorld extends java.lang.Object: | | catch java.lang.Exception -> E0 | | | ALOAD_1 // java.io.PrintStream out (line 11) | | | LDC "bye" - | | | method-call(void java.io.PrintStream.println(java.lang.String)) - | | | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V - | | | method-call(void java.io.PrintStream.println(java.lang.String)) + | | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V | | | GOTO L1 | | catch java.lang.Exception -> E0 | | E0: ASTORE_2 (line 12) | | ALOAD_1 // java.io.PrintStream out (line 13) | | ALOAD_2 // java.lang.Exception e - | | method-call(void java.io.PrintStream.println(java.lang.Object)) - | | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/Object;)V - | | method-call(void java.io.PrintStream.println(java.lang.Object)) + | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/Object;)V | finally -> E1 | GOTO L1 | E1: ASTORE 4 (line 14) @@ -48,9 +44,7 @@ public abstract class FancyHelloWorld extends java.lang.Object: | L2: ASTORE_3 | ALOAD_1 // java.io.PrintStream out (line 15) | LDC "finally" - | method-call(void java.io.PrintStream.println(java.lang.String)) - | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V - | method-call(void java.io.PrintStream.println(java.lang.String)) + | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V | RET 3 (line 10) | L3: RETURN (line 17) method-execution(void FancyHelloWorld.main(java.lang.String[])) @@ -62,24 +56,16 @@ public abstract class FancyHelloWorld extends java.lang.Object: | ISTORE_0 | ILOAD_0 // int x (line 21) | LDC "name" - | method-call(int java.lang.String.hashCode()) - | | INVOKEVIRTUAL java.lang.String.hashCode ()I - | method-call(int java.lang.String.hashCode()) + | INVOKEVIRTUAL java.lang.String.hashCode ()I | IADD | ISTORE_0 // int x | NEW java.lang.StringBuffer (line 22) | DUP | LDC "name" - | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String)) - | | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V - | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String)) + | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V | ILOAD_0 // int x - | method-call(java.lang.StringBuffer java.lang.StringBuffer.append(int)) - | | INVOKEVIRTUAL java.lang.StringBuffer.append (I)Ljava/lang/StringBuffer; - | method-call(java.lang.StringBuffer java.lang.StringBuffer.append(int)) - | method-call(java.lang.String java.lang.StringBuffer.toString()) - | | INVOKEVIRTUAL java.lang.StringBuffer.toString ()Ljava/lang/String; - | method-call(java.lang.String java.lang.StringBuffer.toString()) + | INVOKEVIRTUAL java.lang.StringBuffer.append (I)Ljava/lang/StringBuffer; + | INVOKEVIRTUAL java.lang.StringBuffer.toString ()Ljava/lang/String; | ARETURN method-execution(java.lang.String FancyHelloWorld.getName()) end public static String getName() diff --git a/weaver/testdata/AfterThrowingParamHelloWorld.txt b/weaver/testdata/AfterThrowingParamHelloWorld.txt index c94486d22..26d625457 100644 --- a/weaver/testdata/AfterThrowingParamHelloWorld.txt +++ b/weaver/testdata/AfterThrowingParamHelloWorld.txt @@ -22,10 +22,9 @@ public class HelloWorld extends java.lang.Object: | | L0: NOP | field-get(java.io.PrintStream java.lang.System.out) | LDC "hello world" (line 9) - | method-call(void java.io.PrintStream.println(java.lang.String)) - | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V - | method-call(void java.io.PrintStream.println(java.lang.String)) + | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V | RETURN (line 11) method-execution(void HelloWorld.main(java.lang.String[])) end public static void main(String[]) + end public class HelloWorld diff --git a/weaver/testdata/ArgsAfterReturningFancyHelloWorld.txt b/weaver/testdata/ArgsAfterReturningFancyHelloWorld.txt index 1aa2a4f09..0323a017f 100644 --- a/weaver/testdata/ArgsAfterReturningFancyHelloWorld.txt +++ b/weaver/testdata/ArgsAfterReturningFancyHelloWorld.txt @@ -11,9 +11,7 @@ public abstract class FancyHelloWorld extends java.lang.Object: ALOAD_0 ASTORE 8 method-execution(void FancyHelloWorld.main(java.lang.String[])) - | field-get(java.io.PrintStream java.lang.System.out) - | | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 9) - | field-get(java.io.PrintStream java.lang.System.out) + | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 9) | ASTORE_1 | finally -> E1 | | catch java.lang.Exception -> E0 @@ -105,4 +103,5 @@ public abstract class FancyHelloWorld extends java.lang.Object: | ARETURN method-execution(java.lang.String FancyHelloWorld.getName()) end public static String getName() + end public abstract class FancyHelloWorld diff --git a/weaver/testdata/ArgsAfterReturningHelloWorld.txt b/weaver/testdata/ArgsAfterReturningHelloWorld.txt index 1b3c0e0e7..f9c790f82 100644 --- a/weaver/testdata/ArgsAfterReturningHelloWorld.txt +++ b/weaver/testdata/ArgsAfterReturningHelloWorld.txt @@ -11,9 +11,7 @@ public class HelloWorld extends java.lang.Object: ALOAD_0 ASTORE_2 method-execution(void HelloWorld.main(java.lang.String[])) - | field-get(java.io.PrintStream java.lang.System.out) - | | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 8) - | field-get(java.io.PrintStream java.lang.System.out) + | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 8) | LDC "hello world" (line 9) | ASTORE_1 | method-call(void java.io.PrintStream.println(java.lang.String)) @@ -29,4 +27,5 @@ public class HelloWorld extends java.lang.Object: | RETURN method-execution(void HelloWorld.main(java.lang.String[])) end public static void main(String[]) + end public class HelloWorld diff --git a/weaver/testdata/ArgsAfterThrowingHelloWorld.txt b/weaver/testdata/ArgsAfterThrowingHelloWorld.txt index e71e5a4f1..59a1abd99 100644 --- a/weaver/testdata/ArgsAfterThrowingHelloWorld.txt +++ b/weaver/testdata/ArgsAfterThrowingHelloWorld.txt @@ -12,9 +12,7 @@ public class HelloWorld extends java.lang.Object: ASTORE_3 method-execution(void HelloWorld.main(java.lang.String[])) | catch java.lang.Throwable -> E1 - | | field-get(java.io.PrintStream java.lang.System.out) - | | | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 8) - | | field-get(java.io.PrintStream java.lang.System.out) + | | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 8) | | LDC "hello world" (line 9) | | ASTORE_1 | | method-call(void java.io.PrintStream.println(java.lang.String)) @@ -39,4 +37,5 @@ public class HelloWorld extends java.lang.Object: | ATHROW method-execution(void HelloWorld.main(java.lang.String[])) end public static void main(String[]) + end public class HelloWorld diff --git a/weaver/testdata/ArgsBeforeAfterHelloWorld.txt b/weaver/testdata/ArgsBeforeAfterHelloWorld.txt index cddac2323..5977df7f2 100644 --- a/weaver/testdata/ArgsBeforeAfterHelloWorld.txt +++ b/weaver/testdata/ArgsBeforeAfterHelloWorld.txt @@ -14,9 +14,7 @@ public class HelloWorld extends java.lang.Object: | catch java.lang.Throwable -> E1 | | ALOAD_3 | | INVOKESTATIC Aspect.ajc_before_method_execution (Ljava/lang/Object;)V - | | field-get(java.io.PrintStream java.lang.System.out) - | | | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 8) - | | field-get(java.io.PrintStream java.lang.System.out) + | | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 8) | | LDC "hello world" (line 9) | | ASTORE_1 | | method-call(void java.io.PrintStream.println(java.lang.String)) @@ -49,4 +47,5 @@ public class HelloWorld extends java.lang.Object: | RETURN method-execution(void HelloWorld.main(java.lang.String[])) end public static void main(String[]) + end public class HelloWorld diff --git a/weaver/testdata/AroundAndOthersFancyHelloWorld.txt b/weaver/testdata/AroundAndOthersFancyHelloWorld.txt index a8a2bd44e..b12b45120 100644 --- a/weaver/testdata/AroundAndOthersFancyHelloWorld.txt +++ b/weaver/testdata/AroundAndOthersFancyHelloWorld.txt @@ -9,9 +9,7 @@ public abstract class FancyHelloWorld extends java.lang.Object: public static void main(String[]): method-execution(void FancyHelloWorld.main(java.lang.String[])) - | field-get(java.io.PrintStream java.lang.System.out) - | | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 9) - | field-get(java.io.PrintStream java.lang.System.out) + | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 9) | ASTORE_1 | finally -> E1 | | catch java.lang.Exception -> E0 @@ -118,9 +116,7 @@ public abstract class FancyHelloWorld extends java.lang.Object: | NEW java.lang.StringBuffer (line 22) | DUP | LDC "name" - | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String)) - | | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V - | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String)) + | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V | ILOAD_0 // int x | method-call(java.lang.StringBuffer java.lang.StringBuffer.append(int)) | | INVOKEVIRTUAL java.lang.StringBuffer.append (I)Ljava/lang/StringBuffer; diff --git a/weaver/testdata/AroundAndOthersHelloWorld.txt b/weaver/testdata/AroundAndOthersHelloWorld.txt index 66240b877..ba9460b69 100644 --- a/weaver/testdata/AroundAndOthersHelloWorld.txt +++ b/weaver/testdata/AroundAndOthersHelloWorld.txt @@ -9,9 +9,7 @@ public class HelloWorld extends java.lang.Object: public static void main(String[]): method-execution(void HelloWorld.main(java.lang.String[])) - | field-get(java.io.PrintStream java.lang.System.out) - | | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 8) - | field-get(java.io.PrintStream java.lang.System.out) + | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 8) | LDC "hello world" (line 9) | ASTORE_1 | ASTORE_2 diff --git a/weaver/testdata/AroundArgsDynamicHelloWorld.txt b/weaver/testdata/AroundArgsDynamicHelloWorld.txt index 56ef15d8b..0ca60f059 100644 --- a/weaver/testdata/AroundArgsDynamicHelloWorld.txt +++ b/weaver/testdata/AroundArgsDynamicHelloWorld.txt @@ -12,13 +12,9 @@ public class DynamicHelloWorld extends java.lang.Object implements java.io.Seria | catch java.lang.UnsupportedOperationException -> E0 | | NEW DynamicHelloWorld (line 12) | | DUP - | | constructor-call(void DynamicHelloWorld.<init>()) - | | | INVOKESPECIAL DynamicHelloWorld.<init> ()V - | | constructor-call(void DynamicHelloWorld.<init>()) + | | INVOKESPECIAL DynamicHelloWorld.<init> ()V | | LDC "hello" - | | field-get(java.util.List java.util.Collections.EMPTY_LIST) - | | | GETSTATIC java.util.Collections.EMPTY_LIST Ljava/util/List; - | | field-get(java.util.List java.util.Collections.EMPTY_LIST) + | | GETSTATIC java.util.Collections.EMPTY_LIST Ljava/util/List; | | method-call(java.lang.String DynamicHelloWorld.doit(java.lang.String, java.util.List)) | | | INVOKEVIRTUAL DynamicHelloWorld.doit (Ljava/lang/String;Ljava/util/List;)Ljava/lang/String; | | method-call(java.lang.String DynamicHelloWorld.doit(java.lang.String, java.util.List)) @@ -26,15 +22,11 @@ public class DynamicHelloWorld extends java.lang.Object implements java.io.Seria | | GOTO L0 | catch java.lang.UnsupportedOperationException -> E0 | E0: ASTORE_1 (line 13) - | field-get(java.io.PrintStream java.lang.System.out) - | | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 14) - | field-get(java.io.PrintStream java.lang.System.out) + | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 14) | NEW java.lang.StringBuffer | DUP | LDC "expected and caught: " - | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String)) - | | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V - | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String)) + | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V | ALOAD_1 // java.lang.UnsupportedOperationException t | method-call(java.lang.StringBuffer java.lang.StringBuffer.append(java.lang.Object)) | | INVOKEVIRTUAL java.lang.StringBuffer.append (Ljava/lang/Object;)Ljava/lang/StringBuffer; @@ -49,9 +41,7 @@ public class DynamicHelloWorld extends java.lang.Object implements java.io.Seria | L0: NEW java.lang.RuntimeException (line 17) | DUP | LDC "should have caught exception" - | constructor-call(void java.lang.RuntimeException.<init>(java.lang.String)) - | | INVOKESPECIAL java.lang.RuntimeException.<init> (Ljava/lang/String;)V - | constructor-call(void java.lang.RuntimeException.<init>(java.lang.String)) + | INVOKESPECIAL java.lang.RuntimeException.<init> (Ljava/lang/String;)V | ATHROW method-execution(void DynamicHelloWorld.main(java.lang.String[])) end public static void main(String[]) diff --git a/weaver/testdata/AroundFancyHelloWorld.txt b/weaver/testdata/AroundFancyHelloWorld.txt index f558cb548..e37bf0223 100644 --- a/weaver/testdata/AroundFancyHelloWorld.txt +++ b/weaver/testdata/AroundFancyHelloWorld.txt @@ -9,9 +9,7 @@ public abstract class FancyHelloWorld extends java.lang.Object: public static void main(String[]): method-execution(void FancyHelloWorld.main(java.lang.String[])) - | field-get(java.io.PrintStream java.lang.System.out) - | | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 9) - | field-get(java.io.PrintStream java.lang.System.out) + | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 9) | ASTORE_1 | finally -> E1 | | catch java.lang.Exception -> E0 @@ -115,9 +113,7 @@ public abstract class FancyHelloWorld extends java.lang.Object: | NEW java.lang.StringBuffer (line 22) | DUP | LDC "name" - | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String)) - | | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V - | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String)) + | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V | ILOAD_0 // int x | method-call(java.lang.StringBuffer java.lang.StringBuffer.append(int)) | | INVOKEVIRTUAL java.lang.StringBuffer.append (I)Ljava/lang/StringBuffer; diff --git a/weaver/testdata/AroundHelloWorld.txt b/weaver/testdata/AroundHelloWorld.txt index dcddb75fa..919f74b9a 100644 --- a/weaver/testdata/AroundHelloWorld.txt +++ b/weaver/testdata/AroundHelloWorld.txt @@ -9,9 +9,7 @@ public class HelloWorld extends java.lang.Object: public static void main(String[]): method-execution(void HelloWorld.main(java.lang.String[])) - | field-get(java.io.PrintStream java.lang.System.out) - | | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 8) - | field-get(java.io.PrintStream java.lang.System.out) + | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 8) | LDC "hello world" (line 9) | ASTORE_1 | ASTORE_2 diff --git a/weaver/testdata/CflowNonStaticBeforeFancyHelloWorld.txt b/weaver/testdata/CflowNonStaticBeforeFancyHelloWorld.txt index 722fe93c2..c00923e08 100644 --- a/weaver/testdata/CflowNonStaticBeforeFancyHelloWorld.txt +++ b/weaver/testdata/CflowNonStaticBeforeFancyHelloWorld.txt @@ -23,17 +23,13 @@ public abstract class FancyHelloWorld extends java.lang.Object: | | | catch java.lang.Exception -> E0 | | | | ALOAD_1 // java.io.PrintStream out (line 11) | | | | LDC "bye" - | | | | method-call(void java.io.PrintStream.println(java.lang.String)) - | | | | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V - | | | | method-call(void java.io.PrintStream.println(java.lang.String)) + | | | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V | | | | GOTO L1 | | | catch java.lang.Exception -> E0 | | | E0: ASTORE_2 (line 12) | | | ALOAD_1 // java.io.PrintStream out (line 13) | | | ALOAD_2 // java.lang.Exception e - | | | method-call(void java.io.PrintStream.println(java.lang.Object)) - | | | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/Object;)V - | | | method-call(void java.io.PrintStream.println(java.lang.Object)) + | | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/Object;)V | | finally -> E1 | | GOTO L1 | | E1: ASTORE 4 (line 14) @@ -45,9 +41,7 @@ public abstract class FancyHelloWorld extends java.lang.Object: | | L2: ASTORE_3 | | ALOAD_1 // java.io.PrintStream out (line 15) | | LDC "finally" - | | method-call(void java.io.PrintStream.println(java.lang.String)) - | | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V - | | method-call(void java.io.PrintStream.println(java.lang.String)) + | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V | | RET 3 (line 10) | | L3: GOTO L4 (line 17) | catch java.lang.Throwable -> E2 @@ -68,24 +62,16 @@ public abstract class FancyHelloWorld extends java.lang.Object: | ISTORE_0 | ILOAD_0 // int x (line 21) | LDC "name" - | method-call(int java.lang.String.hashCode()) - | | INVOKEVIRTUAL java.lang.String.hashCode ()I - | method-call(int java.lang.String.hashCode()) + | INVOKEVIRTUAL java.lang.String.hashCode ()I | IADD | ISTORE_0 // int x | NEW java.lang.StringBuffer (line 22) | DUP | LDC "name" - | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String)) - | | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V - | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String)) + | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V | ILOAD_0 // int x - | method-call(java.lang.StringBuffer java.lang.StringBuffer.append(int)) - | | INVOKEVIRTUAL java.lang.StringBuffer.append (I)Ljava/lang/StringBuffer; - | method-call(java.lang.StringBuffer java.lang.StringBuffer.append(int)) - | method-call(java.lang.String java.lang.StringBuffer.toString()) - | | INVOKEVIRTUAL java.lang.StringBuffer.toString ()Ljava/lang/String; - | method-call(java.lang.String java.lang.StringBuffer.toString()) + | INVOKEVIRTUAL java.lang.StringBuffer.append (I)Ljava/lang/StringBuffer; + | INVOKEVIRTUAL java.lang.StringBuffer.toString ()Ljava/lang/String; | ARETURN method-execution(java.lang.String FancyHelloWorld.getName()) end public static String getName() diff --git a/weaver/testdata/CflowNonStaticBeforeHelloWorld.txt b/weaver/testdata/CflowNonStaticBeforeHelloWorld.txt index 206a668aa..6a249e205 100644 --- a/weaver/testdata/CflowNonStaticBeforeHelloWorld.txt +++ b/weaver/testdata/CflowNonStaticBeforeHelloWorld.txt @@ -19,9 +19,7 @@ public class HelloWorld extends java.lang.Object: | | | L0: GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 8) | | field-get(java.io.PrintStream java.lang.System.out) | | LDC "hello world" (line 9) - | | method-call(void java.io.PrintStream.println(java.lang.String)) - | | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V - | | method-call(void java.io.PrintStream.println(java.lang.String)) + | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V | | GOTO L1 (line 11) | catch java.lang.Throwable -> E0 | E0: ASTORE_2 diff --git a/weaver/testdata/CflowStateResidueDynamicHelloWorld.txt b/weaver/testdata/CflowStateResidueDynamicHelloWorld.txt index 6f3061d6b..4745c2af0 100644 --- a/weaver/testdata/CflowStateResidueDynamicHelloWorld.txt +++ b/weaver/testdata/CflowStateResidueDynamicHelloWorld.txt @@ -20,13 +20,9 @@ public class DynamicHelloWorld extends java.lang.Object implements java.io.Seria | catch java.lang.UnsupportedOperationException -> E0 | | L0: NEW DynamicHelloWorld (line 12) | | DUP - | | constructor-call(void DynamicHelloWorld.<init>()) - | | | INVOKESPECIAL DynamicHelloWorld.<init> ()V - | | constructor-call(void DynamicHelloWorld.<init>()) + | | INVOKESPECIAL DynamicHelloWorld.<init> ()V | | LDC "hello" - | | field-get(java.util.List java.util.Collections.EMPTY_LIST) - | | | GETSTATIC java.util.Collections.EMPTY_LIST Ljava/util/List; - | | field-get(java.util.List java.util.Collections.EMPTY_LIST) + | | GETSTATIC java.util.Collections.EMPTY_LIST Ljava/util/List; | | method-call(java.lang.String DynamicHelloWorld.doit(java.lang.String, java.util.List)) | | | INVOKEVIRTUAL DynamicHelloWorld.doit (Ljava/lang/String;Ljava/util/List;)Ljava/lang/String; | | method-call(java.lang.String DynamicHelloWorld.doit(java.lang.String, java.util.List)) @@ -34,15 +30,11 @@ public class DynamicHelloWorld extends java.lang.Object implements java.io.Seria | | GOTO L1 | catch java.lang.UnsupportedOperationException -> E0 | E0: ASTORE_1 (line 13) - | field-get(java.io.PrintStream java.lang.System.out) - | | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 14) - | field-get(java.io.PrintStream java.lang.System.out) + | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 14) | NEW java.lang.StringBuffer | DUP | LDC "expected and caught: " - | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String)) - | | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V - | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String)) + | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V | ALOAD_1 // java.lang.UnsupportedOperationException t | method-call(java.lang.StringBuffer java.lang.StringBuffer.append(java.lang.Object)) | | INVOKEVIRTUAL java.lang.StringBuffer.append (Ljava/lang/Object;)Ljava/lang/StringBuffer; @@ -57,9 +49,7 @@ public class DynamicHelloWorld extends java.lang.Object implements java.io.Seria | L1: NEW java.lang.RuntimeException (line 17) | DUP | LDC "should have caught exception" - | constructor-call(void java.lang.RuntimeException.<init>(java.lang.String)) - | | INVOKESPECIAL java.lang.RuntimeException.<init> (Ljava/lang/String;)V - | constructor-call(void java.lang.RuntimeException.<init>(java.lang.String)) + | INVOKESPECIAL java.lang.RuntimeException.<init> (Ljava/lang/String;)V | ATHROW method-execution(void DynamicHelloWorld.main(java.lang.String[])) end public static void main(String[]) diff --git a/weaver/testdata/FieldSet.txt b/weaver/testdata/FieldSet.txt index c89c7e7bc..a32fad0f7 100644 --- a/weaver/testdata/FieldSet.txt +++ b/weaver/testdata/FieldSet.txt @@ -3,9 +3,7 @@ public class FieldyHelloWorld extends java.lang.Object: static void <clinit>(): staticinitialization(void FieldyHelloWorld.<clinit>()) | LDC "Hello" (line 3) - | field-set(java.lang.String FieldyHelloWorld.str) - | | PUTSTATIC FieldyHelloWorld.str Ljava/lang/String; - | field-set(java.lang.String FieldyHelloWorld.str) + | PUTSTATIC FieldyHelloWorld.str Ljava/lang/String; | RETURN (line 1) staticinitialization(void FieldyHelloWorld.<clinit>()) end static void <clinit>() @@ -47,9 +45,7 @@ public class FieldyHelloWorld extends java.lang.Object: | | INVOKESTATIC Aspect.ajc_before_method_call ()V | | INVOKEVIRTUAL java.lang.StringBuffer.toString ()Ljava/lang/String; | method-call(java.lang.String java.lang.StringBuffer.toString()) - | field-set(java.lang.String FieldyHelloWorld.str) - | | PUTSTATIC FieldyHelloWorld.str Ljava/lang/String; - | field-set(java.lang.String FieldyHelloWorld.str) + | PUTSTATIC FieldyHelloWorld.str Ljava/lang/String; | field-get(java.io.PrintStream java.lang.System.out) | | INVOKESTATIC Aspect.ajc_before_field_get ()V | | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 8) diff --git a/weaver/testdata/Id2FancyHelloWorld.txt b/weaver/testdata/Id2FancyHelloWorld.txt new file mode 100644 index 000000000..00c30d75f --- /dev/null +++ b/weaver/testdata/Id2FancyHelloWorld.txt @@ -0,0 +1,78 @@ +public abstract class FancyHelloWorld extends java.lang.Object: + public void <init>(): + ALOAD_0 // FancyHelloWorld this (line 7) + INVOKESPECIAL java.lang.Object.<init> ()V + constructor-execution(void FancyHelloWorld.<init>()) + | RETURN + constructor-execution(void FancyHelloWorld.<init>()) + end public void <init>() + + public static void main(String[]): + method-execution(void FancyHelloWorld.main(java.lang.String[])) + | field-get(java.io.PrintStream java.lang.System.out) + | | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 9) + | field-get(java.io.PrintStream java.lang.System.out) + | ASTORE_1 + | finally -> E1 + | | catch java.lang.Exception -> E0 + | | | ALOAD_1 // java.io.PrintStream out (line 11) + | | | LDC "bye" + | | | method-call(void java.io.PrintStream.println(java.lang.String)) + | | | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V + | | | method-call(void java.io.PrintStream.println(java.lang.String)) + | | | GOTO L0 + | | catch java.lang.Exception -> E0 + | | E0: ASTORE_2 (line 12) + | | ALOAD_1 // java.io.PrintStream out (line 13) + | | ALOAD_2 // java.lang.Exception e + | | method-call(void java.io.PrintStream.println(java.lang.Object)) + | | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/Object;)V + | | method-call(void java.io.PrintStream.println(java.lang.Object)) + | finally -> E1 + | GOTO L0 + | E1: ASTORE 4 (line 14) + | JSR L1 + | ALOAD 4 + | ATHROW + | L0: JSR L1 + | GOTO L2 + | L1: ASTORE_3 + | ALOAD_1 // java.io.PrintStream out (line 15) + | LDC "finally" + | method-call(void java.io.PrintStream.println(java.lang.String)) + | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V + | method-call(void java.io.PrintStream.println(java.lang.String)) + | RET 3 (line 10) + | L2: RETURN (line 17) + method-execution(void FancyHelloWorld.main(java.lang.String[])) + end public static void main(String[]) + + public static String getName(): + method-execution(java.lang.String FancyHelloWorld.getName()) + | ICONST_0 (line 20) + | ISTORE_0 + | ILOAD_0 // int x (line 21) + | LDC "name" + | method-call(int java.lang.String.hashCode()) + | | INVOKEVIRTUAL java.lang.String.hashCode ()I + | method-call(int java.lang.String.hashCode()) + | IADD + | ISTORE_0 // int x + | NEW java.lang.StringBuffer (line 22) + | DUP + | LDC "name" + | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String)) + | | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V + | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String)) + | ILOAD_0 // int x + | method-call(java.lang.StringBuffer java.lang.StringBuffer.append(int)) + | | INVOKEVIRTUAL java.lang.StringBuffer.append (I)Ljava/lang/StringBuffer; + | method-call(java.lang.StringBuffer java.lang.StringBuffer.append(int)) + | method-call(java.lang.String java.lang.StringBuffer.toString()) + | | INVOKEVIRTUAL java.lang.StringBuffer.toString ()Ljava/lang/String; + | method-call(java.lang.String java.lang.StringBuffer.toString()) + | ARETURN + method-execution(java.lang.String FancyHelloWorld.getName()) + end public static String getName() + +end public abstract class FancyHelloWorld diff --git a/weaver/testdata/Id2HelloWorld.txt b/weaver/testdata/Id2HelloWorld.txt new file mode 100644 index 000000000..121366ef7 --- /dev/null +++ b/weaver/testdata/Id2HelloWorld.txt @@ -0,0 +1,23 @@ +public class HelloWorld extends java.lang.Object: + public void <init>(): + ALOAD_0 // HelloWorld this (line 5) + INVOKESPECIAL java.lang.Object.<init> ()V + constructor-execution(void HelloWorld.<init>()) + | RETURN + constructor-execution(void HelloWorld.<init>()) + end public void <init>() + + public static void main(String[]): + method-execution(void HelloWorld.main(java.lang.String[])) + | field-get(java.io.PrintStream java.lang.System.out) + | | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 8) + | field-get(java.io.PrintStream java.lang.System.out) + | LDC "hello world" (line 9) + | method-call(void java.io.PrintStream.println(java.lang.String)) + | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V + | method-call(void java.io.PrintStream.println(java.lang.String)) + | RETURN (line 11) + method-execution(void HelloWorld.main(java.lang.String[])) + end public static void main(String[]) + +end public class HelloWorld diff --git a/weaver/testdata/IdFancyHelloWorld.txt b/weaver/testdata/IdFancyHelloWorld.txt index 86d44a554..354fbf551 100644 --- a/weaver/testdata/IdFancyHelloWorld.txt +++ b/weaver/testdata/IdFancyHelloWorld.txt @@ -9,9 +9,7 @@ public abstract class FancyHelloWorld extends java.lang.Object: public static void main(String[]): method-execution(void FancyHelloWorld.main(java.lang.String[])) - | field-get(java.io.PrintStream java.lang.System.out) - | | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 9) - | field-get(java.io.PrintStream java.lang.System.out) + | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 9) | ASTORE_1 | finally -> E1 | | catch java.lang.Exception -> E0 @@ -61,9 +59,7 @@ public abstract class FancyHelloWorld extends java.lang.Object: | NEW java.lang.StringBuffer (line 22) | DUP | LDC "name" - | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String)) - | | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V - | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String)) + | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V | ILOAD_0 // int x | method-call(java.lang.StringBuffer java.lang.StringBuffer.append(int)) | | INVOKEVIRTUAL java.lang.StringBuffer.append (I)Ljava/lang/StringBuffer; @@ -74,4 +70,5 @@ public abstract class FancyHelloWorld extends java.lang.Object: | ARETURN method-execution(java.lang.String FancyHelloWorld.getName()) end public static String getName() + end public abstract class FancyHelloWorld diff --git a/weaver/testdata/IdHelloWorld.txt b/weaver/testdata/IdHelloWorld.txt index dfd6deff9..bbe9a3ac4 100644 --- a/weaver/testdata/IdHelloWorld.txt +++ b/weaver/testdata/IdHelloWorld.txt @@ -9,9 +9,7 @@ public class HelloWorld extends java.lang.Object: public static void main(String[]): method-execution(void HelloWorld.main(java.lang.String[])) - | field-get(java.io.PrintStream java.lang.System.out) - | | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 8) - | field-get(java.io.PrintStream java.lang.System.out) + | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 8) | LDC "hello world" (line 9) | method-call(void java.io.PrintStream.println(java.lang.String)) | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V @@ -19,4 +17,5 @@ public class HelloWorld extends java.lang.Object: | RETURN (line 11) method-execution(void HelloWorld.main(java.lang.String[])) end public static void main(String[]) + end public class HelloWorld diff --git a/weaver/testdata/NoResidueDynamicHelloWorld.txt b/weaver/testdata/NoResidueDynamicHelloWorld.txt index 9fb9172e9..b81c0801d 100644 --- a/weaver/testdata/NoResidueDynamicHelloWorld.txt +++ b/weaver/testdata/NoResidueDynamicHelloWorld.txt @@ -12,13 +12,9 @@ public class DynamicHelloWorld extends java.lang.Object implements java.io.Seria | catch java.lang.UnsupportedOperationException -> E0 | | NEW DynamicHelloWorld (line 12) | | DUP - | | constructor-call(void DynamicHelloWorld.<init>()) - | | | INVOKESPECIAL DynamicHelloWorld.<init> ()V - | | constructor-call(void DynamicHelloWorld.<init>()) + | | INVOKESPECIAL DynamicHelloWorld.<init> ()V | | LDC "hello" - | | field-get(java.util.List java.util.Collections.EMPTY_LIST) - | | | GETSTATIC java.util.Collections.EMPTY_LIST Ljava/util/List; - | | field-get(java.util.List java.util.Collections.EMPTY_LIST) + | | GETSTATIC java.util.Collections.EMPTY_LIST Ljava/util/List; | | method-call(java.lang.String DynamicHelloWorld.doit(java.lang.String, java.util.List)) | | | INVOKEVIRTUAL DynamicHelloWorld.doit (Ljava/lang/String;Ljava/util/List;)Ljava/lang/String; | | method-call(java.lang.String DynamicHelloWorld.doit(java.lang.String, java.util.List)) @@ -26,15 +22,11 @@ public class DynamicHelloWorld extends java.lang.Object implements java.io.Seria | | GOTO L0 | catch java.lang.UnsupportedOperationException -> E0 | E0: ASTORE_1 (line 13) - | field-get(java.io.PrintStream java.lang.System.out) - | | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 14) - | field-get(java.io.PrintStream java.lang.System.out) + | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 14) | NEW java.lang.StringBuffer | DUP | LDC "expected and caught: " - | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String)) - | | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V - | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String)) + | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V | ALOAD_1 // java.lang.UnsupportedOperationException t | method-call(java.lang.StringBuffer java.lang.StringBuffer.append(java.lang.Object)) | | INVOKEVIRTUAL java.lang.StringBuffer.append (Ljava/lang/Object;)Ljava/lang/StringBuffer; @@ -49,9 +41,7 @@ public class DynamicHelloWorld extends java.lang.Object implements java.io.Seria | L0: NEW java.lang.RuntimeException (line 17) | DUP | LDC "should have caught exception" - | constructor-call(void java.lang.RuntimeException.<init>(java.lang.String)) - | | INVOKESPECIAL java.lang.RuntimeException.<init> (Ljava/lang/String;)V - | constructor-call(void java.lang.RuntimeException.<init>(java.lang.String)) + | INVOKESPECIAL java.lang.RuntimeException.<init> (Ljava/lang/String;)V | ATHROW method-execution(void DynamicHelloWorld.main(java.lang.String[])) end public static void main(String[]) diff --git a/weaver/testdata/NonStaticBeforeFancyHelloWorld.txt b/weaver/testdata/NonStaticBeforeFancyHelloWorld.txt index 9fc369039..849118370 100644 --- a/weaver/testdata/NonStaticBeforeFancyHelloWorld.txt +++ b/weaver/testdata/NonStaticBeforeFancyHelloWorld.txt @@ -19,17 +19,13 @@ public abstract class FancyHelloWorld extends java.lang.Object: | | catch java.lang.Exception -> E0 | | | ALOAD_1 // java.io.PrintStream out (line 11) | | | LDC "bye" - | | | method-call(void java.io.PrintStream.println(java.lang.String)) - | | | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V - | | | method-call(void java.io.PrintStream.println(java.lang.String)) + | | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V | | | GOTO L0 | | catch java.lang.Exception -> E0 | | E0: ASTORE_2 (line 12) | | ALOAD_1 // java.io.PrintStream out (line 13) | | ALOAD_2 // java.lang.Exception e - | | method-call(void java.io.PrintStream.println(java.lang.Object)) - | | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/Object;)V - | | method-call(void java.io.PrintStream.println(java.lang.Object)) + | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/Object;)V | finally -> E1 | GOTO L0 | E1: ASTORE 4 (line 14) @@ -41,9 +37,7 @@ public abstract class FancyHelloWorld extends java.lang.Object: | L1: ASTORE_3 | ALOAD_1 // java.io.PrintStream out (line 15) | LDC "finally" - | method-call(void java.io.PrintStream.println(java.lang.String)) - | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V - | method-call(void java.io.PrintStream.println(java.lang.String)) + | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V | RET 3 (line 10) | L2: RETURN (line 17) method-execution(void FancyHelloWorld.main(java.lang.String[])) @@ -55,24 +49,16 @@ public abstract class FancyHelloWorld extends java.lang.Object: | ISTORE_0 | ILOAD_0 // int x (line 21) | LDC "name" - | method-call(int java.lang.String.hashCode()) - | | INVOKEVIRTUAL java.lang.String.hashCode ()I - | method-call(int java.lang.String.hashCode()) + | INVOKEVIRTUAL java.lang.String.hashCode ()I | IADD | ISTORE_0 // int x | NEW java.lang.StringBuffer (line 22) | DUP | LDC "name" - | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String)) - | | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V - | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String)) + | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V | ILOAD_0 // int x - | method-call(java.lang.StringBuffer java.lang.StringBuffer.append(int)) - | | INVOKEVIRTUAL java.lang.StringBuffer.append (I)Ljava/lang/StringBuffer; - | method-call(java.lang.StringBuffer java.lang.StringBuffer.append(int)) - | method-call(java.lang.String java.lang.StringBuffer.toString()) - | | INVOKEVIRTUAL java.lang.StringBuffer.toString ()Ljava/lang/String; - | method-call(java.lang.String java.lang.StringBuffer.toString()) + | INVOKEVIRTUAL java.lang.StringBuffer.append (I)Ljava/lang/StringBuffer; + | INVOKEVIRTUAL java.lang.StringBuffer.toString ()Ljava/lang/String; | ARETURN method-execution(java.lang.String FancyHelloWorld.getName()) end public static String getName() diff --git a/weaver/testdata/NonStaticBeforeHelloWorld.txt b/weaver/testdata/NonStaticBeforeHelloWorld.txt index b8b7fb001..c0a623943 100644 --- a/weaver/testdata/NonStaticBeforeHelloWorld.txt +++ b/weaver/testdata/NonStaticBeforeHelloWorld.txt @@ -15,9 +15,7 @@ public class HelloWorld extends java.lang.Object: | | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 8) | field-get(java.io.PrintStream java.lang.System.out) | LDC "hello world" (line 9) - | method-call(void java.io.PrintStream.println(java.lang.String)) - | | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V - | method-call(void java.io.PrintStream.println(java.lang.String)) + | INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V | RETURN (line 11) method-execution(void HelloWorld.main(java.lang.String[])) end public static void main(String[]) diff --git a/weaver/testdata/PerThisNonStaticBeforeFancyHelloWorld.txt b/weaver/testdata/PerThisNonStaticBeforeFancyHelloWorld.txt index c4ad70f94..e0f04013a 100644 --- a/weaver/testdata/PerThisNonStaticBeforeFancyHelloWorld.txt +++ b/weaver/testdata/PerThisNonStaticBeforeFancyHelloWorld.txt @@ -9,9 +9,7 @@ public abstract class FancyHelloWorld extends java.lang.Object: public static void main(String[]): method-execution(void FancyHelloWorld.main(java.lang.String[])) - | field-get(java.io.PrintStream java.lang.System.out) - | | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 9) - | field-get(java.io.PrintStream java.lang.System.out) + | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 9) | ASTORE_1 | finally -> E1 | | catch java.lang.Exception -> E0 @@ -97,9 +95,7 @@ public abstract class FancyHelloWorld extends java.lang.Object: | NEW java.lang.StringBuffer (line 22) | DUP | LDC "name" - | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String)) - | | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V - | constructor-call(void java.lang.StringBuffer.<init>(java.lang.String)) + | INVOKESPECIAL java.lang.StringBuffer.<init> (Ljava/lang/String;)V | ILOAD_0 // int x | method-call(java.lang.StringBuffer java.lang.StringBuffer.append(int)) | | INVOKEVIRTUAL java.lang.StringBuffer.append (I)Ljava/lang/StringBuffer; diff --git a/weaver/testdata/PerThisNonStaticBeforeHelloWorld.txt b/weaver/testdata/PerThisNonStaticBeforeHelloWorld.txt index 1b62d4c68..c1a49d704 100644 --- a/weaver/testdata/PerThisNonStaticBeforeHelloWorld.txt +++ b/weaver/testdata/PerThisNonStaticBeforeHelloWorld.txt @@ -9,9 +9,7 @@ public class HelloWorld extends java.lang.Object: public static void main(String[]): method-execution(void HelloWorld.main(java.lang.String[])) - | field-get(java.io.PrintStream java.lang.System.out) - | | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 8) - | field-get(java.io.PrintStream java.lang.System.out) + | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 8) | LDC "hello world" (line 9) | ASTORE_1 | ASTORE_2 diff --git a/weaver/testdata/StateResidueMultiArgHelloWorld.txt b/weaver/testdata/StateResidueMultiArgHelloWorld.txt index b5e01bee0..8e7f5481c 100644 --- a/weaver/testdata/StateResidueMultiArgHelloWorld.txt +++ b/weaver/testdata/StateResidueMultiArgHelloWorld.txt @@ -30,14 +30,10 @@ public class MultiArgHelloWorld extends java.lang.Object: static void foo(Object, Object): method-execution(void MultiArgHelloWorld.foo(java.lang.Object, java.lang.Object)) - | field-get(java.io.PrintStream java.lang.System.out) - | | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 10) - | field-get(java.io.PrintStream java.lang.System.out) + | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 10) | NEW java.lang.StringBuffer | DUP - | constructor-call(void java.lang.StringBuffer.<init>()) - | | INVOKESPECIAL java.lang.StringBuffer.<init> ()V - | constructor-call(void java.lang.StringBuffer.<init>()) + | INVOKESPECIAL java.lang.StringBuffer.<init> ()V | ALOAD_0 // java.lang.Object s | method-call(java.lang.StringBuffer java.lang.StringBuffer.append(java.lang.Object)) | | INVOKEVIRTUAL java.lang.StringBuffer.append (Ljava/lang/Object;)Ljava/lang/StringBuffer; @@ -46,7 +42,7 @@ public class MultiArgHelloWorld extends java.lang.Object: | method-call(java.lang.StringBuffer java.lang.StringBuffer.append(java.lang.String)) | | INVOKEVIRTUAL java.lang.StringBuffer.append (Ljava/lang/String;)Ljava/lang/StringBuffer; | method-call(java.lang.StringBuffer java.lang.StringBuffer.append(java.lang.String)) - | ALOAD_1 // java.lang.Object arg1 + | ALOAD_1 // java.lang.Object t | method-call(java.lang.StringBuffer java.lang.StringBuffer.append(java.lang.Object)) | | INVOKEVIRTUAL java.lang.StringBuffer.append (Ljava/lang/Object;)Ljava/lang/StringBuffer; | method-call(java.lang.StringBuffer java.lang.StringBuffer.append(java.lang.Object)) diff --git a/weaver/testdata/StringResidue1MultiArgHelloWorld.txt b/weaver/testdata/StringResidue1MultiArgHelloWorld.txt index e3bacfd97..a07e2539c 100644 --- a/weaver/testdata/StringResidue1MultiArgHelloWorld.txt +++ b/weaver/testdata/StringResidue1MultiArgHelloWorld.txt @@ -31,14 +31,10 @@ public class MultiArgHelloWorld extends java.lang.Object: static void foo(Object, Object): method-execution(void MultiArgHelloWorld.foo(java.lang.Object, java.lang.Object)) - | field-get(java.io.PrintStream java.lang.System.out) - | | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 10) - | field-get(java.io.PrintStream java.lang.System.out) + | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 10) | NEW java.lang.StringBuffer | DUP - | constructor-call(void java.lang.StringBuffer.<init>()) - | | INVOKESPECIAL java.lang.StringBuffer.<init> ()V - | constructor-call(void java.lang.StringBuffer.<init>()) + | INVOKESPECIAL java.lang.StringBuffer.<init> ()V | ALOAD_0 // java.lang.Object s | method-call(java.lang.StringBuffer java.lang.StringBuffer.append(java.lang.Object)) | | INVOKEVIRTUAL java.lang.StringBuffer.append (Ljava/lang/Object;)Ljava/lang/StringBuffer; @@ -47,7 +43,7 @@ public class MultiArgHelloWorld extends java.lang.Object: | method-call(java.lang.StringBuffer java.lang.StringBuffer.append(java.lang.String)) | | INVOKEVIRTUAL java.lang.StringBuffer.append (Ljava/lang/String;)Ljava/lang/StringBuffer; | method-call(java.lang.StringBuffer java.lang.StringBuffer.append(java.lang.String)) - | ALOAD_1 // java.lang.Object arg1 + | ALOAD_1 // java.lang.Object t | method-call(java.lang.StringBuffer java.lang.StringBuffer.append(java.lang.Object)) | | INVOKEVIRTUAL java.lang.StringBuffer.append (Ljava/lang/Object;)Ljava/lang/StringBuffer; | method-call(java.lang.StringBuffer java.lang.StringBuffer.append(java.lang.Object)) diff --git a/weaver/testdata/StringResidue2MultiArgHelloWorld.txt b/weaver/testdata/StringResidue2MultiArgHelloWorld.txt index 61e882ea5..db000a60e 100644 --- a/weaver/testdata/StringResidue2MultiArgHelloWorld.txt +++ b/weaver/testdata/StringResidue2MultiArgHelloWorld.txt @@ -28,14 +28,10 @@ public class MultiArgHelloWorld extends java.lang.Object: static void foo(Object, Object): method-execution(void MultiArgHelloWorld.foo(java.lang.Object, java.lang.Object)) - | field-get(java.io.PrintStream java.lang.System.out) - | | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 10) - | field-get(java.io.PrintStream java.lang.System.out) + | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 10) | NEW java.lang.StringBuffer | DUP - | constructor-call(void java.lang.StringBuffer.<init>()) - | | INVOKESPECIAL java.lang.StringBuffer.<init> ()V - | constructor-call(void java.lang.StringBuffer.<init>()) + | INVOKESPECIAL java.lang.StringBuffer.<init> ()V | ALOAD_0 // java.lang.Object s | method-call(java.lang.StringBuffer java.lang.StringBuffer.append(java.lang.Object)) | | INVOKEVIRTUAL java.lang.StringBuffer.append (Ljava/lang/Object;)Ljava/lang/StringBuffer; @@ -44,7 +40,7 @@ public class MultiArgHelloWorld extends java.lang.Object: | method-call(java.lang.StringBuffer java.lang.StringBuffer.append(java.lang.String)) | | INVOKEVIRTUAL java.lang.StringBuffer.append (Ljava/lang/String;)Ljava/lang/StringBuffer; | method-call(java.lang.StringBuffer java.lang.StringBuffer.append(java.lang.String)) - | ALOAD_1 // java.lang.Object arg1 + | ALOAD_1 // java.lang.Object t | method-call(java.lang.StringBuffer java.lang.StringBuffer.append(java.lang.Object)) | | INVOKEVIRTUAL java.lang.StringBuffer.append (Ljava/lang/Object;)Ljava/lang/StringBuffer; | method-call(java.lang.StringBuffer java.lang.StringBuffer.append(java.lang.Object)) diff --git a/weaver/testdata/StringResidue3MultiArgHelloWorld.txt b/weaver/testdata/StringResidue3MultiArgHelloWorld.txt index db3b1504c..f59804e69 100644 --- a/weaver/testdata/StringResidue3MultiArgHelloWorld.txt +++ b/weaver/testdata/StringResidue3MultiArgHelloWorld.txt @@ -28,14 +28,10 @@ public class MultiArgHelloWorld extends java.lang.Object: static void foo(Object, Object): method-execution(void MultiArgHelloWorld.foo(java.lang.Object, java.lang.Object)) - | field-get(java.io.PrintStream java.lang.System.out) - | | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 10) - | field-get(java.io.PrintStream java.lang.System.out) + | GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 10) | NEW java.lang.StringBuffer | DUP - | constructor-call(void java.lang.StringBuffer.<init>()) - | | INVOKESPECIAL java.lang.StringBuffer.<init> ()V - | constructor-call(void java.lang.StringBuffer.<init>()) + | INVOKESPECIAL java.lang.StringBuffer.<init> ()V | ALOAD_0 // java.lang.Object s | method-call(java.lang.StringBuffer java.lang.StringBuffer.append(java.lang.Object)) | | INVOKEVIRTUAL java.lang.StringBuffer.append (Ljava/lang/Object;)Ljava/lang/StringBuffer; @@ -44,7 +40,7 @@ public class MultiArgHelloWorld extends java.lang.Object: | method-call(java.lang.StringBuffer java.lang.StringBuffer.append(java.lang.String)) | | INVOKEVIRTUAL java.lang.StringBuffer.append (Ljava/lang/String;)Ljava/lang/StringBuffer; | method-call(java.lang.StringBuffer java.lang.StringBuffer.append(java.lang.String)) - | ALOAD_1 // java.lang.Object arg1 + | ALOAD_1 // java.lang.Object t | method-call(java.lang.StringBuffer java.lang.StringBuffer.append(java.lang.Object)) | | INVOKEVIRTUAL java.lang.StringBuffer.append (Ljava/lang/Object;)Ljava/lang/StringBuffer; | method-call(java.lang.StringBuffer java.lang.StringBuffer.append(java.lang.Object)) diff --git a/weaver/testsrc/org/aspectj/weaver/bcel/IdWeaveTestCase.java b/weaver/testsrc/org/aspectj/weaver/bcel/IdWeaveTestCase.java index c17c49569..075ad8c20 100644 --- a/weaver/testsrc/org/aspectj/weaver/bcel/IdWeaveTestCase.java +++ b/weaver/testsrc/org/aspectj/weaver/bcel/IdWeaveTestCase.java @@ -40,7 +40,7 @@ public class IdWeaveTestCase extends WeaveTestCase { return false; } }; - weaveTest(new String[] {"FancyHelloWorld"}, "Id", p); + weaveTest(new String[] {"FancyHelloWorld"}, "Id2", p); checkShadowSet(l, new String[] { "method-call(void java.io.PrintStream.println(java.lang.Object))", @@ -57,6 +57,7 @@ public class IdWeaveTestCase extends WeaveTestCase { }); } + public void testId() throws IOException { final List l = new ArrayList(); BcelAdvice p = new BcelAdvice(null, makePointcutAll(), null, 0, -1, -1, null, null) { @@ -64,7 +65,7 @@ public class IdWeaveTestCase extends WeaveTestCase { l.add(shadow); } }; - weaveTest(new String[] {"HelloWorld"}, "Id", p); + weaveTest(new String[] {"HelloWorld"}, "Id2", p); checkShadowSet(l, new String[] { "method-execution(void HelloWorld.main(java.lang.String[]))", diff --git a/weaver/testsrc/org/aspectj/weaver/bcel/WeaveTestCase.java b/weaver/testsrc/org/aspectj/weaver/bcel/WeaveTestCase.java index 9a7a4e7b0..d14176891 100644 --- a/weaver/testsrc/org/aspectj/weaver/bcel/WeaveTestCase.java +++ b/weaver/testsrc/org/aspectj/weaver/bcel/WeaveTestCase.java @@ -104,6 +104,7 @@ public abstract class WeaveTestCase extends TestCase { TestUtil.runMain(makeClassPath(outDirPath), name); } } catch (Error e) { + System.err.println("Comparing to " + outName + ".txt"); gen.print(System.err); throw e; } catch (RuntimeException e) { |