jasco.runtime.inline
Class InlineReplaceGenerator

java.lang.Object
  extended by jasco.runtime.inline.InlineReplaceGenerator

public class InlineReplaceGenerator
extends java.lang.Object


Constructor Summary
InlineReplaceGenerator(javassist.CtClass fieldClass, java.util.Vector accessHooks, java.util.Vector replaceHooks, javassist.ClassPool pool, javassist.CtMethod joinpMethod, JascoMethod jpInfo, long id, java.lang.String args, int startForArgs)
           
 
Method Summary
 void addDummyProceed(javassist.CtClass clz)
           
protected  void addInvokeCorrectProceed(javassist.CtClass cpclz, javassist.CtMethod method, java.lang.String accessHook)
           
protected  void addInvokeNextHook(javassist.CtClass clz, javassist.CtMethod copy, java.lang.String accessNextHook, IHook nextHook)
           
protected  void convertAllMethodCalls(javassist.CtMethod copy, javassist.CtClass cpClass, java.lang.String accessHook, IHook cp)
           
protected  javassist.CtMethod convertMethodCall(javassist.CtMethod copy, javassist.CtMethod orig, java.lang.String accessHook, IHook cp)
           
protected  void convertProceed(javassist.CtMethod replaceCopy, javassist.CtMethod proceedMethod, java.lang.String accessHook, IHook cp)
           
 javassist.CtMethod copyMethodForReplace(javassist.CtMethod replMethod, java.lang.String newName, javassist.CtClass clz)
           
protected  javassist.CtMethod findReflectMethod(javassist.CtClass hook)
           
 javassist.CtMethod generateAdaptedReplaceCode(javassist.CtClass cpClz, IHook cp)
           
static java.lang.String getNewMethodName(java.lang.String name, IHook cp, long id, JascoMethod method)
           
protected static java.lang.Integer getNextId()
           
protected  void redirectFieldAccess(javassist.expr.FieldAccess access, javassist.CtMethod newMethod, java.lang.String accessHook)
           
protected  void redirectFieldAccesses(javassist.CtMethod method, java.lang.String accessHook)
           
protected  void replaceCallWithNextHook(javassist.expr.MethodCall call, javassist.CtMethod newMethod, java.lang.String descriptorOfField, java.lang.String fieldName, IHook nextHook)
           
protected  void replaceCallWithOriginal(javassist.expr.MethodCall call, javassist.CtMethod newMethod, java.lang.String descriptorOfHook, java.lang.String hookName)
           
protected  void replaceCorrectReturns(javassist.bytecode.CodeAttribute ca, javassist.CtMethod newMethod)
           
 void start()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InlineReplaceGenerator

public InlineReplaceGenerator(javassist.CtClass fieldClass,
                              java.util.Vector accessHooks,
                              java.util.Vector replaceHooks,
                              javassist.ClassPool pool,
                              javassist.CtMethod joinpMethod,
                              JascoMethod jpInfo,
                              long id,
                              java.lang.String args,
                              int startForArgs)
Method Detail

start

public void start()
           throws java.lang.Exception
Throws:
java.lang.Exception

addDummyProceed

public void addDummyProceed(javassist.CtClass clz)
                     throws java.lang.Exception
Throws:
java.lang.Exception

copyMethodForReplace

public javassist.CtMethod copyMethodForReplace(javassist.CtMethod replMethod,
                                               java.lang.String newName,
                                               javassist.CtClass clz)
                                        throws java.lang.Exception
Throws:
java.lang.Exception

redirectFieldAccesses

protected void redirectFieldAccesses(javassist.CtMethod method,
                                     java.lang.String accessHook)
                              throws java.lang.Exception
Throws:
java.lang.Exception

redirectFieldAccess

protected void redirectFieldAccess(javassist.expr.FieldAccess access,
                                   javassist.CtMethod newMethod,
                                   java.lang.String accessHook)
                            throws java.lang.Exception
Throws:
java.lang.Exception

convertProceed

protected void convertProceed(javassist.CtMethod replaceCopy,
                              javassist.CtMethod proceedMethod,
                              java.lang.String accessHook,
                              IHook cp)
                       throws java.lang.Exception
Throws:
java.lang.Exception

convertAllMethodCalls

protected void convertAllMethodCalls(javassist.CtMethod copy,
                                     javassist.CtClass cpClass,
                                     java.lang.String accessHook,
                                     IHook cp)
                              throws java.lang.Exception
Throws:
java.lang.Exception

convertMethodCall

protected javassist.CtMethod convertMethodCall(javassist.CtMethod copy,
                                               javassist.CtMethod orig,
                                               java.lang.String accessHook,
                                               IHook cp)
                                        throws java.lang.Exception
Throws:
java.lang.Exception

getNextId

protected static java.lang.Integer getNextId()

getNewMethodName

public static java.lang.String getNewMethodName(java.lang.String name,
                                                IHook cp,
                                                long id,
                                                JascoMethod method)
                                         throws java.lang.Exception
Throws:
java.lang.Exception

addInvokeCorrectProceed

protected void addInvokeCorrectProceed(javassist.CtClass cpclz,
                                       javassist.CtMethod method,
                                       java.lang.String accessHook)
                                throws java.lang.Exception
Throws:
java.lang.Exception

replaceCallWithOriginal

protected void replaceCallWithOriginal(javassist.expr.MethodCall call,
                                       javassist.CtMethod newMethod,
                                       java.lang.String descriptorOfHook,
                                       java.lang.String hookName)
                                throws java.lang.Exception
Throws:
java.lang.Exception

replaceCorrectReturns

protected void replaceCorrectReturns(javassist.bytecode.CodeAttribute ca,
                                     javassist.CtMethod newMethod)
                              throws java.lang.Exception
Throws:
java.lang.Exception

addInvokeNextHook

protected void addInvokeNextHook(javassist.CtClass clz,
                                 javassist.CtMethod copy,
                                 java.lang.String accessNextHook,
                                 IHook nextHook)
                          throws java.lang.Exception
Throws:
java.lang.Exception

findReflectMethod

protected javassist.CtMethod findReflectMethod(javassist.CtClass hook)
                                        throws java.lang.Exception
Throws:
java.lang.Exception

generateAdaptedReplaceCode

public javassist.CtMethod generateAdaptedReplaceCode(javassist.CtClass cpClz,
                                                     IHook cp)
                                              throws java.lang.Exception
Throws:
java.lang.Exception

replaceCallWithNextHook

protected void replaceCallWithNextHook(javassist.expr.MethodCall call,
                                       javassist.CtMethod newMethod,
                                       java.lang.String descriptorOfField,
                                       java.lang.String fieldName,
                                       IHook nextHook)
                                throws java.lang.Exception
Throws:
java.lang.Exception