Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Inlining code in aspectJ??

I was trying to see the inlining strategy described in the paper "Advice Weaving in AspectJ" of Eric HiIsdale and Jim Hugunin.
 
In the paper it is said that the inlining is used in the implementation of privileged aspects and around (default).
 
For the privileged aspect I didn't see this inlining in the bytecode. Is it because I am using the ajc 1.2 ?
 
Example:
 
public class A2 {
public static int compte;
public static void main(String[] args) {
setCompte(1000);
System.out.println(compte);
}
public static void setCompte(int l){
compte=l;
}}
privileged aspect AS2 {
pointcut p(): call(* *.setCompte(..)) &&! within(AS2);
before():p(){
System.out.println("hello");
}}
 
Byte Code of A2!:
 
Compiled from A2.java
public class A2 extends java.lang.Object {
    public static int compte;
    public A2();
    public static void main(java.lang.String[]);
    public static void setCompte(int);
}
 
Method A2()
   0 aload_0
   1 invokespecial #11 <Method java.lang.Object()>
   4 return
 
Method void main(java.lang.String[])
   0 sipush 1000
   3 invokestatic #46 <Method AS2 aspectOf()>
   6 invokevirtual #49 <Method void ajc$before$AS2$1$1a971()>   ===> NO INLINING!!

   9 invokestatic #22 <Method void setCompte(int)>
  12 getstatic #28 <Field java.io.PrintStream out>
  15 getstatic #30 <Field int compte>
  18 invokevirtual #35 <Method void println(int)>
  21 return
 
Method void setCompte(int)
   0 iload_0
   1 putstatic #30 <Field int compte>
   4 return

 
============================================================
Nadia Belblidia-Guerroumi,
Ph.D Candidate, ECE Department,
Concordia University, 1425 Rene Levesque
Room 420-16
email:n_guerro@xxxxxxxxxxxxxxxx
==============================================================

Back to the top