]> source.dussan.org Git - aspectj.git/commitdiff
Picked lowest hanging weave-time performance optimization fruit.
authorjhugunin <jhugunin>
Tue, 27 Jan 2004 19:51:08 +0000 (19:51 +0000)
committerjhugunin <jhugunin>
Tue, 27 Jan 2004 19:51:08 +0000 (19:51 +0000)
24 files changed:
weaver/src/org/aspectj/weaver/Shadow.java
weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java
weaver/src/org/aspectj/weaver/bcel/BcelShadow.java
weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java
weaver/src/org/aspectj/weaver/bcel/LazyMethodGen.java
weaver/src/org/aspectj/weaver/patterns/AndPointcut.java
weaver/src/org/aspectj/weaver/patterns/ArgsPointcut.java
weaver/src/org/aspectj/weaver/patterns/CflowPointcut.java
weaver/src/org/aspectj/weaver/patterns/ConcreteCflowPointcut.java
weaver/src/org/aspectj/weaver/patterns/FastMatchInfo.java [new file with mode: 0644]
weaver/src/org/aspectj/weaver/patterns/HandlerPointcut.java
weaver/src/org/aspectj/weaver/patterns/IfPointcut.java
weaver/src/org/aspectj/weaver/patterns/KindedPointcut.java
weaver/src/org/aspectj/weaver/patterns/NotPointcut.java
weaver/src/org/aspectj/weaver/patterns/OrPointcut.java
weaver/src/org/aspectj/weaver/patterns/PerCflow.java
weaver/src/org/aspectj/weaver/patterns/PerFromSuper.java
weaver/src/org/aspectj/weaver/patterns/PerObject.java
weaver/src/org/aspectj/weaver/patterns/PerSingleton.java
weaver/src/org/aspectj/weaver/patterns/Pointcut.java
weaver/src/org/aspectj/weaver/patterns/ReferencePointcut.java
weaver/src/org/aspectj/weaver/patterns/ThisOrTargetPointcut.java
weaver/src/org/aspectj/weaver/patterns/WithinPointcut.java
weaver/src/org/aspectj/weaver/patterns/WithincodePointcut.java

index 3fbd92ab35a4cfe5e609381610640ad129b4232b..ade65de83689f0150d336b6d42b08ce78ea30986 100644 (file)
@@ -180,6 +180,13 @@ public abstract class Shadow {
     public static final Kind AdviceExecution      = new Kind(JoinPoint.ADVICE_EXECUTION, 9,  false);
     public static final Kind Initialization       = new Kind(JoinPoint.INITIALIZATION, 10,  false);
     public static final Kind ExceptionHandler     = new Kind(JoinPoint.EXCEPTION_HANDLER, 11,  true);
+    
+    public static final int MAX_SHADOW_KIND = 11;
+    public static final Kind[] SHADOW_KINDS = new Kind[] {
+       MethodCall, ConstructorCall, MethodExecution, ConstructorExecution,
+       FieldGet, FieldSet, StaticInitialization, PreInitialization,
+       AdviceExecution, Initialization, ExceptionHandler,
+    };
 
 
     /** A type-safe enum representing the kind of shadows
index 8ef653f87fb62c95012588316414df5da64b7767..052cef1fac90d87178d6fc9c58cdbb19a7206378 100644 (file)
@@ -62,6 +62,8 @@ import org.aspectj.weaver.ResolvedMember;
 import org.aspectj.weaver.ResolvedTypeX;
 import org.aspectj.weaver.Shadow;
 import org.aspectj.weaver.ShadowMunger;
+import org.aspectj.weaver.Shadow.Kind;
+import org.aspectj.weaver.patterns.FastMatchInfo;
 
 class BcelClassWeaver implements IClassWeaver {
     
@@ -127,12 +129,48 @@ class BcelClassWeaver implements IClassWeaver {
                this.ty = clazz.getBcelObjectType();
                this.cpg = clazz.getConstantPoolGen();
                this.fact = clazz.getFactory();
+               
+               fastMatchShadowMungers(shadowMungers);
+               
                initializeSuperInitializerMap(ty.getResolvedTypeX());
        } 
     
-    // --------------------------------------------
-   
-       private void initializeSuperInitializerMap(ResolvedTypeX child) {
+    private List[] perKindShadowMungers;
+    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];
+                       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;
+                               }
+                       }
+               }
+    }
+    
+    private boolean canMatch(Shadow.Kind kind) {
+       return perKindShadowMungers[kind.getKey()] != null;
+    }
+    
+       private void fastMatchShadowMungers(List shadowMungers, ArrayList mungers, Kind kind) {
+               FastMatchInfo info = new FastMatchInfo(clazz.getType(), kind);
+               for (Iterator i = shadowMungers.iterator(); i.hasNext();) {
+                       ShadowMunger munger = (ShadowMunger) i.next();
+                       if (munger.getPointcut().fastMatch(info).maybeTrue()) mungers.add(munger);
+               }
+       }
+
+
+       private void initializeSuperInitializerMap(ResolvedTypeX child) {
                ResolvedTypeX[] superInterfaces = child.getDeclaredInterfaces();
                for (int i=0, len=superInterfaces.length; i < len; i++) {
                        if (ty.getResolvedTypeX().isTopmostImplementor(superInterfaces[i])) {
@@ -287,6 +325,7 @@ class BcelClassWeaver implements IClassWeaver {
         List methodGens = new ArrayList(clazz.getMethodGens());
         for (Iterator i = methodGens.iterator(); i.hasNext();) {
             LazyMethodGen mg = (LazyMethodGen)i.next();
+            //mg.getBody();
                        if (! mg.hasBody()) continue;
             isChanged |= match(mg);
         }
@@ -786,7 +825,7 @@ class BcelClassWeaver implements IClassWeaver {
                        } else {
                                AjAttribute.EffectiveSignatureAttribute effective = mg.getEffectiveSignature();
                                if (effective == null) {
-                                       enclosingShadow = BcelShadow.makeMethodExecution(world, mg);
+                                       enclosingShadow = BcelShadow.makeMethodExecution(world, mg, !canMatchBodyShadows);
                                } else if (effective.isWeaveBody()) {
                                        enclosingShadow =
                                                BcelShadow.makeShadowForMethod(
@@ -799,18 +838,22 @@ class BcelClassWeaver implements IClassWeaver {
                                }
                        }
 
-                       for (InstructionHandle h = mg.getBody().getStart();
-                               h != null;
-                               h = h.getNext()) {
-                               match(mg, h, enclosingShadow, shadowAccumulator);
+                       if (canMatchBodyShadows) {
+                               for (InstructionHandle h = mg.getBody().getStart();
+                                       h != null;
+                                       h = h.getNext()) {
+                                       match(mg, h, enclosingShadow, shadowAccumulator);
+                               }
+                       }
+                       if (match(enclosingShadow, shadowAccumulator)) {
+                               enclosingShadow.init();
                        }
-                       match(enclosingShadow, shadowAccumulator);
                        mg.matchedShadows = shadowAccumulator;
                        return !shadowAccumulator.isEmpty();
                }
        }
 
-       private boolean shouldWeaveBody(LazyMethodGen mg) {
+       private boolean shouldWeaveBody(LazyMethodGen mg) {     
                if (mg.isAjSynthetic()) return mg.getName().equals("<clinit>");
                AjAttribute.EffectiveSignatureAttribute a = mg.getEffectiveSignature();
                if (a != null) return a.isWeaveBody();
index 9069c915ef431780c13132f57772a28692c9f552..41a84491a476998de3cbe810a91a9ef4f0833910 100644 (file)
@@ -515,12 +515,42 @@ public class BcelShadow extends Shadow {
        }
        
        
+       public static BcelShadow makeMethodExecution(
+                       BcelWorld world,
+                       LazyMethodGen enclosingMethod,
+                       boolean lazyInit) 
+       {
+               if (!lazyInit) return makeMethodExecution(world, enclosingMethod);
+               
+               BcelShadow s =
+                       new BcelShadow(
+                               world,
+                               MethodExecution,
+                               enclosingMethod.getMemberView(),
+                               enclosingMethod,
+                               null);
+                               
+               return s;
+       }
+       
+       
+       public void init() {
+               if (range != null) return;
+               
+               final InstructionList body = enclosingMethod.getBody();
+               ShadowRange r = new ShadowRange(body);
+               r.associateWithShadow(this);
+               r.associateWithTargets(
+                       Range.genStart(body),
+                       Range.genEnd(body));
+       }
+       
     public static BcelShadow makeMethodExecution(
             BcelWorld world,
             LazyMethodGen enclosingMethod) 
     {
        return makeShadowForMethod(world, enclosingMethod, MethodExecution,
-                       world.makeMethodSignature(enclosingMethod));
+                       enclosingMethod.getMemberView()); //world.makeMethodSignature(enclosingMethod));
     }  
        
        
index 3d7611d73b4a57caeeb19c8e362e6a87e7bb0fcc..7dea8184ba9ac2139a8224eaa3034dbc8fbffaa4 100644 (file)
@@ -47,6 +47,7 @@ import org.aspectj.weaver.ResolvedTypeX;
 import org.aspectj.weaver.ShadowMunger;
 import org.aspectj.weaver.TypeX;
 import org.aspectj.weaver.patterns.DeclareParents;
+import org.aspectj.weaver.patterns.FastMatchInfo;
 
 public class BcelWeaver implements IWeaver {
     private BcelWorld world;
@@ -487,7 +488,7 @@ public class BcelWeaver implements IWeaver {
                                }
                        } catch (RuntimeException re) {
                                System.err.println("trouble in: ");
-                               clazz.print(System.err);
+                               //XXXclazz.print(System.err);
                                throw re;
                        } catch (Error re) {
                                System.err.println("trouble in: ");
@@ -552,11 +553,15 @@ public class BcelWeaver implements IWeaver {
        private List fastMatch(List list, ResolvedTypeX type) {
                if (list == null) return Collections.EMPTY_LIST;
 
+               // here we do the coarsest grained fast match with no kind constraints
+               // this will remove all obvious non-matches and see if we need to do any weaving
+               FastMatchInfo info = new FastMatchInfo(type, null);
+
                List result = new ArrayList();
                Iterator iter = list.iterator();
                while (iter.hasNext()) {
                        ShadowMunger munger = (ShadowMunger)iter.next();
-                       if (munger.getPointcut().fastMatch(type).maybeTrue()) {
+                       if (munger.getPointcut().fastMatch(info).maybeTrue()) {
                                result.add(munger);
                        }
                }
index c0b1251437c020837b61a95b48df4113ea99c525..8cb337b352e4e7cb41d0e22c085d523c5198dc3f 100644 (file)
@@ -56,6 +56,7 @@ import org.aspectj.weaver.BCException;
 import org.aspectj.weaver.ISourceContext;
 import org.aspectj.weaver.Member;
 import org.aspectj.weaver.ResolvedTypeX;
+import org.aspectj.weaver.TypeX;
 
 
 /** 
@@ -74,13 +75,13 @@ import org.aspectj.weaver.ResolvedTypeX;
 
 public final class LazyMethodGen {
     private        int             accessFlags;
-    private final Type            returnType;
+    private  Type            returnType;
     private final String          name;
-    private final Type[]          argumentTypes;
+    private  Type[]          argumentTypes;
     //private final String[]        argumentNames;
-    private final String[]        declaredExceptions;
-    private final InstructionList body; // leaving null for abstracts
-    private final Attribute[]     attributes;
+    private  String[]        declaredExceptions;
+    private  InstructionList body; // leaving null for abstracts
+    private  Attribute[]     attributes;
     /* private */ final LazyClassGen    enclosingClass;   
     private final BcelMethod      memberView;
     int highestLineNumber = 0;
@@ -116,6 +117,7 @@ public final class LazyMethodGen {
         String[] declaredExceptions,
         LazyClassGen enclosingClass) 
     {
+       //System.err.println("raw create of: " + name + ", " + enclosingClass.getName() + ", " + returnType);
                this.memberView = null; // ??? should be okay, since constructed ones aren't woven into
         this.accessFlags = accessFlags;
         this.returnType = returnType;
@@ -143,8 +145,11 @@ public final class LazyMethodGen {
         return ret;   
     }
     
-    // build from an existing method
+    private Method savedMethod = null;
+    // build from an existing method, lazy build saves most work for initialization
     public LazyMethodGen(Method m, LazyClassGen enclosingClass) {
+       savedMethod = m;
+       
         this.enclosingClass = enclosingClass;
         if (!(m.isAbstract() || m.isNative()) && m.getCode() == null) {
                throw new RuntimeException("bad non-abstract method with no code: " + m + " on " + enclosingClass);
@@ -152,25 +157,47 @@ public final class LazyMethodGen {
         if ((m.isAbstract() || m.isNative()) && m.getCode() != null) {
                throw new RuntimeException("bad abstract method with code: " + m + " on " + enclosingClass);
         }
-        MethodGen gen = new MethodGen(m, enclosingClass.getName(), enclosingClass.getConstantPoolGen());
                this.memberView = new BcelMethod(enclosingClass.getBcelObjectType(), m);
-        this.accessFlags = gen.getAccessFlags();
-        this.returnType = gen.getReturnType();
-        this.name = gen.getName();
-        this.argumentTypes = gen.getArgumentTypes();
-        //this.argumentNames = gen.getArgumentNames();
-        this.declaredExceptions = gen.getExceptions();
-        this.attributes = gen.getAttributes();
-        this.maxLocals = gen.getMaxLocals();
+        
+               this.accessFlags = m.getAccessFlags();
+               this.name = m.getName();
+    }
+    
+    private void initialize() {
+       if (returnType != null) return;
+       
+       //System.err.println("initializing: " + getName() + ", " + enclosingClass.getName() + ", " + returnType + ", " + savedMethod);
+       
+               MethodGen gen = new MethodGen(savedMethod, enclosingClass.getName(), enclosingClass.getConstantPoolGen());
+        
+               this.returnType = gen.getReturnType();
+               this.argumentTypes = gen.getArgumentTypes();
+
+               this.declaredExceptions = gen.getExceptions();
+               this.attributes = gen.getAttributes();
+               this.maxLocals = gen.getMaxLocals();
+        
+//             this.returnType = BcelWorld.makeBcelType(memberView.getReturnType());
+//             this.argumentTypes = BcelWorld.makeBcelTypes(memberView.getParameterTypes());
+//
+//             this.declaredExceptions = TypeX.getNames(memberView.getExceptions()); //gen.getExceptions();
+//             this.attributes = new Attribute[0]; //gen.getAttributes();
+//             this.maxLocals = savedMethod.getCode().getMaxLocals();
+        
+        
         if (gen.isAbstract() || gen.isNative()) {
             body = null;
         } else {
+               //body = new InstructionList(savedMethod.getCode().getCode());
             body = gen.getInstructionList();
+            
             unpackHandlers(gen);
             unpackLineNumbers(gen);
             unpackLocals(gen);
         }
         assertGoodBody();
+        
+               //System.err.println("initialized: " + this.getClassName() + "." + this.getName());
     }
     
     // XXX we're relying on the javac promise I've just made up that we won't have an early exception
@@ -293,6 +320,8 @@ public final class LazyMethodGen {
     }
 
     public Method getMethod() {
+       if (savedMethod != null) return savedMethod;  //??? this relies on gentle treatment of constant pool
+       
        try {
                        MethodGen gen = pack();
                        return gen.getMethod();
@@ -303,7 +332,11 @@ public final class LazyMethodGen {
                        this.getMemberView() == null ? null : this.getMemberView().getSourceLocation(), null);
                throw e;
        }
-        
+    }
+    
+    public void markAsChanged() {
+       initialize();
+       savedMethod = null;
     }
     
     // =============================
@@ -656,13 +689,10 @@ public final class LazyMethodGen {
     }
 
     public Type[] getArgumentTypes() {
+       initialize();
         return argumentTypes;
     }
 
-//     public String[] getArgumentNames() {
-//             return argumentNames;
-//     }
-
     public LazyClassGen getEnclosingClass() {
         return enclosingClass;
     }
@@ -676,6 +706,7 @@ public final class LazyMethodGen {
     }
 
     public Type getReturnType() {
+       initialize();
         return returnType;
     }
 
@@ -684,11 +715,14 @@ public final class LazyMethodGen {
     }
     
     public InstructionList getBody() {
+       markAsChanged();
         return body;
     }
        
-    public boolean hasBody() { return body != null; }
-
+    public boolean hasBody() {
+       if (savedMethod != null) return savedMethod.getCode() != null;
+       return body != null;
+    }
 
     public Attribute[] getAttributes() {
         return attributes;
@@ -998,8 +1032,7 @@ public final class LazyMethodGen {
 //            }            
 //        }
         l.add(0, fresh);        
-    }    
-
+    }
 
 
     public boolean isPrivate() {
@@ -1035,13 +1068,12 @@ public final class LazyMethodGen {
         */
        
        public void assertGoodBody() {
-               // XXX this is REALLY slow since we get the string first...
-               assertGoodBody(getBody(), toString());
+               if (true) return; // only enable for debugging, consider using cheaper toString()
+               assertGoodBody(getBody(), toString()); //definingType.getNameAsIdentifier() + "." + getName()); //toString());
        }
        
-       // XXX we might not want to release with any calls to this incredibly inefficient method.
        public static void assertGoodBody(InstructionList il, String from) {
-               if (true) return;
+               if (true) return;  // only to be enabled for debugging
                if (il == null) return;
                Set body = new HashSet();
                Stack ranges = new Stack();
@@ -1217,8 +1249,9 @@ public final class LazyMethodGen {
     }
     
        public String getSignature() {
-               return Member.typesToSignature(BcelWorld.fromBcel(getReturnType()), 
-                                                                               BcelWorld.fromBcel(getArgumentTypes()));
+               return memberView.getSignature();
+//             return Member.typesToSignature(BcelWorld.fromBcel(getReturnType()), 
+//                                                                             BcelWorld.fromBcel(getArgumentTypes()));
        }
 
        public BcelMethod getMemberView() {
@@ -1226,6 +1259,7 @@ public final class LazyMethodGen {
        }
 
        public void forcePublic() {
+               markAsChanged();
                accessFlags = Utility.makePublic(accessFlags);
        }
 
@@ -1236,8 +1270,4 @@ public final class LazyMethodGen {
        public void setCanInline(boolean canInline) {
                this.canInline = canInline;
        }
-       public boolean hasExceptionHandlers() {
-               return hasExceptionHandlers;
-       }
-
 }
index b3202774afcf94fa58803c163f157e77751dc6bc..aea40a3e314eb42da78690ac46019e05a18b9d5c 100644 (file)
@@ -34,7 +34,7 @@ public class AndPointcut extends Pointcut {
                setLocation(left.getSourceContext(), left.getStart(), right.getEnd());
        }
 
-       public FuzzyBoolean fastMatch(ResolvedTypeX type) {
+       public FuzzyBoolean fastMatch(FastMatchInfo type) {
                return left.fastMatch(type).and(right.fastMatch(type));
        }
 
index ce79c56084575d509ee7b2fb68139e09789e9258..382ace4add7077eca368774f9dc4830001eddb05 100644 (file)
@@ -41,7 +41,7 @@ public class ArgsPointcut extends NameBindingPointcut {
                this.arguments = arguments;
        }
        
-    public FuzzyBoolean fastMatch(ResolvedTypeX type) {
+    public FuzzyBoolean fastMatch(FastMatchInfo type) {
                return FuzzyBoolean.MAYBE;
        }
 
index 3a0a8acf20362f2029006bcb731ae7a0345ec456..6aa5f7fc3e011f6f2b2f66ad93b8b13baeea393b 100644 (file)
@@ -59,7 +59,7 @@ public class CflowPointcut extends Pointcut {
                this.freeVars = freeVars;
        }
     
-    public FuzzyBoolean fastMatch(ResolvedTypeX type) {
+    public FuzzyBoolean fastMatch(FastMatchInfo type) {
                return FuzzyBoolean.MAYBE;
        }
     
index 3354dbbbfe6289ac90f3362370ad45368d0a6891..cbb65f37e3d3a0abe0fd42459e84168fb9e8140c 100644 (file)
@@ -40,7 +40,7 @@ public class ConcreteCflowPointcut extends Pointcut {
                this.slots = slots;
        }
     
-    public FuzzyBoolean fastMatch(ResolvedTypeX type) {
+    public FuzzyBoolean fastMatch(FastMatchInfo type) {
                return FuzzyBoolean.MAYBE;
        }
     
diff --git a/weaver/src/org/aspectj/weaver/patterns/FastMatchInfo.java b/weaver/src/org/aspectj/weaver/patterns/FastMatchInfo.java
new file mode 100644 (file)
index 0000000..c2b6121
--- /dev/null
@@ -0,0 +1,43 @@
+/* *******************************************************************
+ * Copyright (c) 2004 Contributors
+ * All rights reserved. 
+ * This program and the accompanying materials are made available 
+ * under the terms of the Common Public License v1.0 
+ * which accompanies this distribution and is available at 
+ * http://www.eclipse.org/legal/cpl-v10.html 
+ *  
+ * Contributors: 
+ *     Jim Hugunin     initial implementation 
+ * ******************************************************************/
+
+
+package org.aspectj.weaver.patterns;
+
+import org.aspectj.weaver.ResolvedTypeX;
+import org.aspectj.weaver.Shadow;
+import org.aspectj.weaver.Shadow.Kind;
+
+
+public class FastMatchInfo {
+       private Kind kind;
+       private ResolvedTypeX type;
+
+       public FastMatchInfo(ResolvedTypeX type, Shadow.Kind kind) {
+               this.type = type;
+               this.kind = kind;
+       }
+       
+       /**
+        * kind can be null to indicate that all kinds should be considered.
+        * This is usually done as a first pass
+        * @return
+        */
+       public Kind getKind() {
+               return kind;
+       }
+
+       public ResolvedTypeX getType() {
+               return type;
+       }
+
+}
index 258c8ac80cf39658583a70e390faa3636264095b..aa50bd7b6925c5c8712a505fffce9ac27a4e44b4 100644 (file)
@@ -38,7 +38,7 @@ public class HandlerPointcut extends Pointcut {
                this.exceptionType = exceptionType;
        }
 
-    public FuzzyBoolean fastMatch(ResolvedTypeX type) {
+    public FuzzyBoolean fastMatch(FastMatchInfo type) {
        //??? should be able to do better by finding all referenced types in type
                return FuzzyBoolean.MAYBE;
        }
index 9fd8a73ec9145a360df4e86699b0089e2ab8898e..df4fdb6b5a2512ba488d2b900a4b4a42c831bb5f 100644 (file)
@@ -50,7 +50,7 @@ public class IfPointcut extends Pointcut {
                this.extraParameterFlags = extraParameterFlags;
        }
        
-    public FuzzyBoolean fastMatch(ResolvedTypeX type) {
+    public FuzzyBoolean fastMatch(FastMatchInfo type) {
                return FuzzyBoolean.MAYBE;
        }
     
index 1dca9d036a5735d74cd77151375f3a3bc97c90ad..43e53724b92300d11da6c2562ea1027ff74c9d0c 100644 (file)
@@ -51,9 +51,14 @@ public class KindedPointcut extends Pointcut {
         this.munger = munger;
     }
        
-    public FuzzyBoolean fastMatch(ResolvedTypeX type) {
+    public FuzzyBoolean fastMatch(FastMatchInfo info) {
+       if (info.getKind() != null) {
+                       if (info.getKind() != kind) return FuzzyBoolean.NO;
+       }
+
                return FuzzyBoolean.MAYBE;
        }       
+       
        public FuzzyBoolean match(Shadow shadow) {
                if (shadow.getKind() != kind) return FuzzyBoolean.NO;
                
@@ -61,10 +66,10 @@ public class KindedPointcut extends Pointcut {
             if(kind == Shadow.MethodCall) {
                 warnOnConfusingSig(shadow);
             }
-            return  FuzzyBoolean.NO; 
+            return FuzzyBoolean.NO; 
         }
 
-               return  FuzzyBoolean.YES;
+               return FuzzyBoolean.YES;
        }
        
        private void warnOnConfusingSig(Shadow shadow) {
index 02884b22c7a0eb7159811490770c5311322f743e..59fe2522ab475391a0a9b0062a2dcace82b852cd 100644 (file)
@@ -37,7 +37,7 @@ public class NotPointcut extends Pointcut {
        }
 
 
-       public FuzzyBoolean fastMatch(ResolvedTypeX type) {
+       public FuzzyBoolean fastMatch(FastMatchInfo type) {
                return body.fastMatch(type).not();
        }
 
index 9e4eae4fbb6dda0a7aab4195a92d402395a65ee8..1d1ce62982da6495ce1000c74fe4f21864ee56cc 100644 (file)
@@ -35,7 +35,7 @@ public class OrPointcut extends Pointcut {
        }
 
 
-       public FuzzyBoolean fastMatch(ResolvedTypeX type) {
+       public FuzzyBoolean fastMatch(FastMatchInfo type) {
                return left.fastMatch(type).or(right.fastMatch(type));
        }
 
index fe815e3ba31a8a15c719f668144006bae9ff37d2..1c511bb080c9db7489730c44d13465e2d881ef4b 100644 (file)
@@ -47,7 +47,7 @@ public class PerCflow extends PerClause {
        
        // -----
        
-       public FuzzyBoolean fastMatch(ResolvedTypeX type) {
+       public FuzzyBoolean fastMatch(FastMatchInfo type) {
                return FuzzyBoolean.MAYBE;
        }
        
index 4976d2f7fe58d38d213c0a4bd8c30ea96f98d097..dfd2253770fda563780d4b474ae74541d4605612 100644 (file)
@@ -31,7 +31,7 @@ public class PerFromSuper extends PerClause {
                this.kind = kind;
        }
        
-       public FuzzyBoolean fastMatch(ResolvedTypeX type) {
+       public FuzzyBoolean fastMatch(FastMatchInfo type) {
                throw new RuntimeException("unimplemented");
        }
        
index de70b35e2922d5ed97efd6177cee3f76ab1837a5..bed5d4e81459bb70b03a36e93938612d0e4cd01b 100644 (file)
@@ -40,7 +40,7 @@ public class PerObject extends PerClause {
        }
        
        // -----
-       public FuzzyBoolean fastMatch(ResolvedTypeX type) {
+       public FuzzyBoolean fastMatch(FastMatchInfo type) {
                return FuzzyBoolean.MAYBE;
        }
        
index 6399b643017ee93088dcca1b69db4fca71b96000..2ffeec76121426c704f3d12cd214d557995932e0 100644 (file)
@@ -30,7 +30,7 @@ public class PerSingleton extends PerClause {
        public PerSingleton() {
        }
        
-       public FuzzyBoolean fastMatch(ResolvedTypeX type) {
+       public FuzzyBoolean fastMatch(FastMatchInfo type) {
                return FuzzyBoolean.YES;
        }
        
index 126a43b84ff204e611e4917b1bb9e9fbb91d7e49..6e3cf912fe027200e2c1a5bc00444608653196b3 100644 (file)
@@ -62,7 +62,7 @@ public abstract class Pointcut extends PatternNode {
        /**
         * Could I match any shadows in the code defined within this type?
         */
-       public abstract FuzzyBoolean fastMatch(ResolvedTypeX type);
+       public abstract FuzzyBoolean fastMatch(FastMatchInfo info);
        
        /**
         * Do I really match this shadow?
@@ -202,7 +202,7 @@ public abstract class Pointcut extends PatternNode {
                        return Literal.FALSE; // can only get here if an earlier error occurred
                }
 
-               public FuzzyBoolean fastMatch(ResolvedTypeX type) {
+               public FuzzyBoolean fastMatch(FastMatchInfo type) {
                        return FuzzyBoolean.NO;
                }
                
index e73e24e822112e7d405a9f9e742bbe82fb11301a..b253b4d18a70b37cadf7a1e6615690de776c0353 100644 (file)
@@ -57,7 +57,7 @@ public class ReferencePointcut extends Pointcut {
        
 
        //??? do either of these match methods make any sense???
-       public FuzzyBoolean fastMatch(ResolvedTypeX type) {
+       public FuzzyBoolean fastMatch(FastMatchInfo type) {
                return FuzzyBoolean.MAYBE;
        }
        
index 4fd791031a896dd3ebd5440f84308a9d5ac39c75..f17a5a15c57ef6ac43f7c70852746d70428de26b 100644 (file)
@@ -50,7 +50,7 @@ public class ThisOrTargetPointcut extends NameBindingPointcut {
                this.type = type;
        }
        
-       public FuzzyBoolean fastMatch(ResolvedTypeX type) {
+       public FuzzyBoolean fastMatch(FastMatchInfo type) {
                return FuzzyBoolean.MAYBE;
        }
        
index 7881050fe31c34b6a4c6e2b8a70ed733de30c0f8..14267da073c41af836a8e9f89b3be4c36db23467 100644 (file)
@@ -42,8 +42,8 @@ public class WithinPointcut extends Pointcut {
                return FuzzyBoolean.NO;
        }
        
-       public FuzzyBoolean fastMatch(ResolvedTypeX type) {
-               return isWithinType(type);
+       public FuzzyBoolean fastMatch(FastMatchInfo info) {
+               return isWithinType(info.getType());
        }
     
        public FuzzyBoolean match(Shadow shadow) {
index 71dba0d302b980ce5365d391010287118983d068..f30329bb240f2bd7c5c3592217b9c88638a4ec75 100644 (file)
@@ -32,7 +32,7 @@ public class WithincodePointcut extends Pointcut {
                this.signature = signature;
        }
     
-       public FuzzyBoolean fastMatch(ResolvedTypeX type) {
+       public FuzzyBoolean fastMatch(FastMatchInfo type) {
                return FuzzyBoolean.MAYBE;
        }