From 9b9fcdca0c812524e3970bf698f4de47af0c29c7 Mon Sep 17 00:00:00 2001 From: aclement Date: Mon, 2 Nov 2009 23:10:06 +0000 Subject: [PATCH] timing --- .../org/aspectj/weaver/bcel/BcelWeaver.java | 26 ++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) 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; -- 2.39.5