From: aclement Date: Mon, 2 Nov 2009 23:10:06 +0000 (+0000) Subject: timing X-Git-Tag: V1_6_7~146 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=9b9fcdca0c812524e3970bf698f4de47af0c29c7;p=aspectj.git timing --- diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java b/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java index a328db94b..050bfdeab 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java @@ -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 result = new ArrayList(); - 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;