From 4a6ccf0f0d8b8320f665dbdfe3f06c4ac4d242e2 Mon Sep 17 00:00:00 2001 From: aclement Date: Mon, 31 Jul 2006 12:42:31 +0000 Subject: [PATCH] trace! --- weaver/src/org/aspectj/weaver/World.java | 6 +++++- weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java | 6 ++++++ weaver/src/org/aspectj/weaver/bcel/LazyMethodGen.java | 7 ++++++- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/weaver/src/org/aspectj/weaver/World.java b/weaver/src/org/aspectj/weaver/World.java index 9070a470f..88a96a41b 100644 --- a/weaver/src/org/aspectj/weaver/World.java +++ b/weaver/src/org/aspectj/weaver/World.java @@ -1195,6 +1195,10 @@ public abstract class World implements Dump.INode { public void setIncrementalCompileCouldFollow(boolean b) {incrementalCompileCouldFollow = b;} public boolean couldIncrementalCompileFollow() {return incrementalCompileCouldFollow;} - public void setSynchronizationPointcutsInUse() {synchronizationPointcutsInUse =true;} + public void setSynchronizationPointcutsInUse() { + if (trace.isTraceEnabled()) trace.enter("setSynchronizationPointcutsInUse", this); + synchronizationPointcutsInUse =true; + if (trace.isTraceEnabled()) trace.exit("setSynchronizationPointcutsInUse"); + } public boolean areSynchronizationPointcutsInUse() {return synchronizationPointcutsInUse;} } diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java b/weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java index 9425ce0b4..a7cece45e 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java @@ -99,8 +99,12 @@ import org.aspectj.weaver.WeaverStateInfo; import org.aspectj.weaver.World; import org.aspectj.weaver.patterns.DeclareAnnotation; import org.aspectj.weaver.patterns.ExactTypePattern; +import org.aspectj.weaver.tools.Trace; +import org.aspectj.weaver.tools.TraceFactory; class BcelClassWeaver implements IClassWeaver { + + private static Trace trace = TraceFactory.getTraceFactory().getTrace(BcelClassWeaver.class); /** * This is called from {@link BcelWeaver} to perform the per-class weaving process. @@ -1453,6 +1457,7 @@ class BcelClassWeaver implements IClassWeaver { * tidying up - there is some duplication that can be removed. */ public static void transformSynchronizedMethod(LazyMethodGen synchronizedMethod) { + if (trace.isTraceEnabled()) trace.enter("transformSynchronizedMethod",synchronizedMethod); // System.err.println("DEBUG: Transforming synchronized method: "+synchronizedMethod.getName()); final InstructionFactory fact = synchronizedMethod.getEnclosingClass().getFactory(); InstructionList body = synchronizedMethod.getBody(); @@ -1862,6 +1867,7 @@ class BcelClassWeaver implements IClassWeaver { // gonna have to go through and change all aload_0s to load the var from a variable, // going to add a new variable for the this var + if (trace.isTraceEnabled()) trace.exit("transformSynchronizedMethod"); } diff --git a/weaver/src/org/aspectj/weaver/bcel/LazyMethodGen.java b/weaver/src/org/aspectj/weaver/bcel/LazyMethodGen.java index d377cf509..9e678df76 100644 --- a/weaver/src/org/aspectj/weaver/bcel/LazyMethodGen.java +++ b/weaver/src/org/aspectj/weaver/bcel/LazyMethodGen.java @@ -70,6 +70,7 @@ import org.aspectj.weaver.Shadow; import org.aspectj.weaver.UnresolvedType; import org.aspectj.weaver.WeaverMessages; import org.aspectj.weaver.AjAttribute.WeaverVersionInfo; +import org.aspectj.weaver.tools.Traceable; /** @@ -86,7 +87,7 @@ import org.aspectj.weaver.AjAttribute.WeaverVersionInfo; *

We stay away from targeters for rangey things like Shadows and Exceptions. */ -public final class LazyMethodGen { +public final class LazyMethodGen implements Traceable { private static final int ACC_SYNTHETIC = 0x1000; private int accessFlags; @@ -1558,4 +1559,8 @@ public final class LazyMethodGen { attributes = newAttributes; } + public String toTraceString() { + return toShortString(); + } + } -- 2.39.5