diff options
author | aclement <aclement> | 2009-11-02 23:10:06 +0000 |
---|---|---|
committer | aclement <aclement> | 2009-11-02 23:10:06 +0000 |
commit | 9b9fcdca0c812524e3970bf698f4de47af0c29c7 (patch) | |
tree | f7e28fde09221f3a5d1f21b836c2a04d3ceda57c /weaver | |
parent | 7b82ae56fca2ef9fefe67a4bf1507f23b38689d0 (diff) | |
download | aspectj-9b9fcdca0c812524e3970bf698f4de47af0c29c7.tar.gz aspectj-9b9fcdca0c812524e3970bf698f4de47af0c29c7.zip |
timing
Diffstat (limited to 'weaver')
-rw-r--r-- | weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java | 26 |
1 files 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<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; |