diff options
author | chiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3> | 2003-10-06 10:48:39 +0000 |
---|---|---|
committer | chiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3> | 2003-10-06 10:48:39 +0000 |
commit | d0add86d9763f89c88bafe7613ac5107d6bb949d (patch) | |
tree | 946e803a9c6f2876a4a550138c53fb63d6a061a9 /src/main/javassist/compiler/Javac.java | |
parent | 93e8b3bf46875fd610f961b3fa529886ba6f99aa (diff) | |
download | javassist-d0add86d9763f89c88bafe7613ac5107d6bb949d.tar.gz javassist-d0add86d9763f89c88bafe7613ac5107d6bb949d.zip |
Improved the performance of $proceed when it represents a static method.
This change does not make any difference on WindowsXP but on Solaris/SPARC.
git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@48 30ef5769-5b8d-40dd-aea6-55b5d6557bb3
Diffstat (limited to 'src/main/javassist/compiler/Javac.java')
-rw-r--r-- | src/main/javassist/compiler/Javac.java | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/main/javassist/compiler/Javac.java b/src/main/javassist/compiler/Javac.java index 12d4b208..e0bf3428 100644 --- a/src/main/javassist/compiler/Javac.java +++ b/src/main/javassist/compiler/Javac.java @@ -354,6 +354,36 @@ public class Javac { } /** + * Prepares to use $proceed() representing a static method. + * If the return type of $proceed() is void, null is pushed on the + * stack. + * + * @param targetClass the fully-qualified dot-separated name + * of the class declaring the method. + * @param method the method name. + */ + public void recordStaticProceed(String targetClass, String method) + throws CompileError + { + final String c = targetClass; + final String m = method; + + ProceedHandler h = new ProceedHandler() { + public void doit(JvstCodeGen gen, Bytecode b, ASTList args) + throws CompileError + { + Expr expr = Expr.make(TokenId.MEMBER, + new Symbol(c), new Member(m)); + expr = Expr.make(TokenId.CALL, expr, args); + expr.accept(gen); + gen.addNullIfVoid(); + } + }; + + gen.setProceedHandler(h, proceedName); + } + + /** * Prepares to use $proceed(). */ public void recordProceed(ProceedHandler h) { |