]> source.dussan.org Git - aspectj.git/commitdiff
timing
authoraclement <aclement>
Mon, 2 Nov 2009 23:10:06 +0000 (23:10 +0000)
committeraclement <aclement>
Mon, 2 Nov 2009 23:10:06 +0000 (23:10 +0000)
weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java

index a328db94b75b7a42574dabe657bc9da2624e819d..050bfdeaba93cf6695789661b5cc6684f4224850 100644 (file)
@@ -1935,14 +1935,28 @@ public class BcelWeaver {
                // 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);
+               FastMatchInfo info = new FastMatchInfo(type, null, world);
 
                List<ShadowMunger> result = new ArrayList<ShadowMunger>();
-               for (ShadowMunger munger : list) {
-                       Pointcut pointcut = munger.getPointcut();
-                       FuzzyBoolean fb = pointcut.fastMatch(info);
-                       if (fb.maybeTrue()) {
-                               result.add(munger);
+
+               if (world.areInfoMessagesEnabled() && world.isTimingEnabled()) {
+                       for (ShadowMunger munger : list) {
+                               Pointcut pointcut = munger.getPointcut();
+                               long starttime = System.nanoTime();
+                               FuzzyBoolean fb = pointcut.fastMatch(info);
+                               long endtime = System.nanoTime();
+                               world.recordFastMatch(pointcut, endtime - starttime);
+                               if (fb.maybeTrue()) {
+                                       result.add(munger);
+                               }
+                       }
+               } else {
+                       for (ShadowMunger munger : list) {
+                               Pointcut pointcut = munger.getPointcut();
+                               FuzzyBoolean fb = pointcut.fastMatch(info);
+                               if (fb.maybeTrue()) {
+                                       result.add(munger);
+                               }
                        }
                }
                return result;