]> source.dussan.org Git - aspectj.git/commitdiff
synchronization joinpoints: code dump...
authoraclement <aclement>
Thu, 8 Jun 2006 09:28:56 +0000 (09:28 +0000)
committeraclement <aclement>
Thu, 8 Jun 2006 09:28:56 +0000 (09:28 +0000)
weaver/src/org/aspectj/weaver/Member.java
weaver/src/org/aspectj/weaver/World.java
weaver/src/org/aspectj/weaver/bcel/BcelField.java
weaver/src/org/aspectj/weaver/bcel/BcelMethod.java
weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java

index 723605816d7b822d87d4de29528245b6c1337da1..f7505f08852e5a006753cfecff235b3fe41965d2 100644 (file)
@@ -35,6 +35,8 @@ public interface Member {
                 case 5: return POINTCUT;
                 case 6: return ADVICE;
                 case 7: return HANDLER;
+                case 8: return MONITORENTER;
+                case 9: return MONITOREXIT;
             }
             throw new BCException("weird kind " + key);
         }
@@ -48,6 +50,9 @@ public interface Member {
        public static final Kind POINTCUT = new Kind("POINTCUT", 5);
        public static final Kind ADVICE = new Kind("ADVICE", 6);
        public static final Kind HANDLER = new Kind("HANDLER", 7);
+       public static final Kind MONITORENTER = new Kind("MONITORENTER", 8);
+       public static final Kind MONITOREXIT = new Kind("MONITOREXIT", 9);
+
 
        public ResolvedMember resolve(World world);
 
index 8aacc20ee9dd2b7854416ff64a8ecf82b181785e..5cb41d2b4c6ed2f6e4a771b88b7d50d14ad8b74e 100644 (file)
@@ -765,7 +765,6 @@ public abstract class World implements Dump.INode {
        public void setOptionalJoinpoints(String jps) {
                if (jps==null) return;
                if (jps.indexOf("arrayconstruction")!=-1) optionalJoinpoint_ArrayConstruction = true;
-               if (jps.indexOf("trivial")!=-1)           optionalJoinpoint_Trivial = true;
                if (jps.indexOf("synchronization")!=-1)   optionalJoinpoint_Synchronization = true;
        }
        
index eab34f54ea628bb15d7eb2b6cc7b35ed3bc1d192..efb7d1f5158c7da64af68c447ea04d90b51ad5c1 100644 (file)
@@ -64,7 +64,7 @@ final class BcelField extends ResolvedMemberImpl {
        
        private void unpackAttributes(World world) {
                Attribute[] attrs = field.getAttributes();
-        List as = BcelAttributes.readAjAttributes(getDeclaringType().getClassName(),attrs, getSourceContext(world),world.getMessageHandler(),bcelObjectType.getWeaverVersionAttribute());
+        List as = BcelAttributes.readAjAttributes(getDeclaringType().getClassName(),attrs, getSourceContext(world),world,bcelObjectType.getWeaverVersionAttribute());
         as.addAll(AtAjAttributes.readAj5FieldAttributes(field, this, world.resolve(getDeclaringType()), getSourceContext(world), world.getMessageHandler()));
 
                for (Iterator iter = as.iterator(); iter.hasNext();) {
index ad960fbdb72117fec9874d4725511247c65bf3b7..d5c604863bea7e359f8c53339624f07630c73a9b 100644 (file)
@@ -129,7 +129,7 @@ final class BcelMethod extends ResolvedMemberImpl {
 
        private void unpackAjAttributes(World world) {
                associatedShadowMunger = null;
-        List as = BcelAttributes.readAjAttributes(getDeclaringType().getClassName(),method.getAttributes(), getSourceContext(world),world.getMessageHandler(),bcelObjectType.getWeaverVersionAttribute());
+        List as = BcelAttributes.readAjAttributes(getDeclaringType().getClassName(),method.getAttributes(), getSourceContext(world),world,bcelObjectType.getWeaverVersionAttribute());
                processAttributes(world, as);
                as = AtAjAttributes.readAj5MethodAttributes(method, this, world.resolve(getDeclaringType()), preResolvedPointcut,getSourceContext(world), world.getMessageHandler());
                processAttributes(world,as);
@@ -160,7 +160,7 @@ final class BcelMethod extends ResolvedMemberImpl {
        // for testing - if we have this attribute, return it - will return null if it doesnt know anything 
        public AjAttribute[] getAttributes(String name) {
                List results = new ArrayList();
-               List l = BcelAttributes.readAjAttributes(getDeclaringType().getClassName(),method.getAttributes(), getSourceContext(world),world.getMessageHandler(),bcelObjectType.getWeaverVersionAttribute());
+               List l = BcelAttributes.readAjAttributes(getDeclaringType().getClassName(),method.getAttributes(), getSourceContext(world),world,bcelObjectType.getWeaverVersionAttribute());
                for (Iterator iter = l.iterator(); iter.hasNext();) {
                        AjAttribute element = (AjAttribute) iter.next();                
                        if (element.getNameString().equals(name)) results.add(element);
index 3e791abe0e3186a0626c92861ce525e5ff7d60d6..1257fe25ae46fcf236cda36c0994aff3748065a5 100644 (file)
@@ -299,7 +299,7 @@ public class BcelObjectType extends AbstractReferenceTypeDelegate {
                bitflag|=UNPACKED_AJATTRIBUTES;
                IMessageHandler msgHandler = getResolvedTypeX().getWorld().getMessageHandler();
                // Pass in empty list that can store things for readAj5 to process
-        List l = BcelAttributes.readAjAttributes(className,javaClass.getAttributes(), getResolvedTypeX().getSourceContext(),msgHandler,AjAttribute.WeaverVersionInfo.UNKNOWN);
+        List l = BcelAttributes.readAjAttributes(className,javaClass.getAttributes(), getResolvedTypeX().getSourceContext(),getResolvedTypeX().getWorld(),AjAttribute.WeaverVersionInfo.UNKNOWN);
                List pointcuts = new ArrayList();
                typeMungers = new ArrayList();
                declares = new ArrayList();
@@ -817,7 +817,7 @@ public class BcelObjectType extends AbstractReferenceTypeDelegate {
     // for testing - if we have this attribute, return it - will return null if it doesnt know anything 
        public AjAttribute[] getAttributes(String name) {
                List results = new ArrayList();
-               List l = BcelAttributes.readAjAttributes(javaClass.getClassName(),javaClass.getAttributes(), getResolvedTypeX().getSourceContext(),getResolvedTypeX().getWorld().getMessageHandler(),AjAttribute.WeaverVersionInfo.UNKNOWN);
+               List l = BcelAttributes.readAjAttributes(javaClass.getClassName(),javaClass.getAttributes(), getResolvedTypeX().getSourceContext(),getResolvedTypeX().getWorld(),AjAttribute.WeaverVersionInfo.UNKNOWN);
                for (Iterator iter = l.iterator(); iter.hasNext();) {
                        AjAttribute element = (AjAttribute) iter.next();                
                        if (element.getNameString().equals(name)) results.add(element);
@@ -854,4 +854,4 @@ public class BcelObjectType extends AbstractReferenceTypeDelegate {
        
 } 
     
-    
+    
\ No newline at end of file
index 23ad1bfa15e449e6549d4a8b0710c1747fb505fc..e75f79a276866f4dd837c60cb3def3043623848e 100644 (file)
@@ -39,6 +39,8 @@ import org.aspectj.apache.bcel.generic.INVOKESTATIC;
 import org.aspectj.apache.bcel.generic.Instruction;
 import org.aspectj.apache.bcel.generic.InstructionHandle;
 import org.aspectj.apache.bcel.generic.InvokeInstruction;
+import org.aspectj.apache.bcel.generic.MONITORENTER;
+import org.aspectj.apache.bcel.generic.MONITOREXIT;
 import org.aspectj.apache.bcel.generic.MULTIANEWARRAY;
 import org.aspectj.apache.bcel.generic.NEWARRAY;
 import org.aspectj.apache.bcel.generic.ObjectType;
@@ -460,6 +462,15 @@ public class BcelWorld extends World implements Repository {
         
     }
        
+       public Member makeJoinPointSignatureForMonitorEnter(LazyClassGen cg,InstructionHandle h) {
+               MONITORENTER i = (MONITORENTER)h.getInstruction();
+               return MemberImpl.monitorEnter();
+       }
+
+       public Member makeJoinPointSignatureForMonitorExit(LazyClassGen cg,InstructionHandle h) {
+               MONITOREXIT i = (MONITOREXIT)h.getInstruction();
+               return MemberImpl.monitorExit();
+       }
        
        public Member makeJoinPointSignatureForArrayConstruction(LazyClassGen cg, InstructionHandle handle) {
                Instruction i = handle.getInstruction();
@@ -709,4 +720,4 @@ public class BcelWorld extends World implements Repository {
             return true;
         }
     }
-}
+}
\ No newline at end of file