|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.objectweb.asm.tree.MemberNode org.objectweb.asm.tree.MethodNode org.apache.commons.nabla.algorithmic.forward.analysis.MethodDifferentiator
public class MethodDifferentiator
Class transforming a method computing a value to a method computing both a value and its differential.
Field Summary | |
---|---|
static String |
DP_DESCRIPTOR
Descriptor for the DifferentialPair class. |
static String |
DP_NAME
Name for the DifferentialPair class. |
static String |
DP_RETURN_DP_DESCRIPTOR
Descriptor for the derivative class f method. |
Fields inherited from class org.objectweb.asm.tree.MethodNode |
---|
access, annotationDefault, desc, exceptions, instructions, invisibleParameterAnnotations, localVariables, maxLocals, maxStack, name, signature, tryCatchBlocks, visibleParameterAnnotations |
Fields inherited from class org.objectweb.asm.tree.MemberNode |
---|
attrs, invisibleAnnotations, visibleAnnotations |
Constructor Summary | |
---|---|
MethodDifferentiator(int access,
String name,
String desc,
String signature,
String[] exceptions,
org.objectweb.asm.MethodVisitor generator,
String primitiveName,
Set<String> mathClasses,
ErrorReporter errorReporter)
Build a differentiator for a method. |
Method Summary | |
---|---|
org.objectweb.asm.tree.AbstractInsnNode |
clone(org.objectweb.asm.tree.AbstractInsnNode insn)
Clone an instruction. |
int |
getTmp(int number)
Get index of a size 2 temporary variable. |
boolean |
isMathImplementationClass(String name)
Test if a class is a math implementation class. |
void |
shiftVariable(org.objectweb.asm.tree.VarInsnNode insn)
Shifted the index of a variable instruction. |
void |
useLocal(int index,
int size)
Set a local variable as used by the modified code. |
void |
visitEnd()
|
Methods inherited from class org.objectweb.asm.tree.MethodNode |
---|
accept, accept, getLabelNode, visitAnnotationDefault, visitCode, visitFieldInsn, visitFrame, visitIincInsn, visitInsn, visitIntInsn, visitJumpInsn, visitLabel, visitLdcInsn, visitLineNumber, visitLocalVariable, visitLookupSwitchInsn, visitMaxs, visitMethodInsn, visitMultiANewArrayInsn, visitParameterAnnotation, visitTableSwitchInsn, visitTryCatchBlock, visitTypeInsn, visitVarInsn |
Methods inherited from class org.objectweb.asm.tree.MemberNode |
---|
visitAnnotation, visitAttribute |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.objectweb.asm.MethodVisitor |
---|
visitAnnotation, visitAttribute |
Field Detail |
---|
public static final String DP_NAME
public static final String DP_DESCRIPTOR
public static final String DP_RETURN_DP_DESCRIPTOR
Constructor Detail |
---|
public MethodDifferentiator(int access, String name, String desc, String signature, String[] exceptions, org.objectweb.asm.MethodVisitor generator, String primitiveName, Set<String> mathClasses, ErrorReporter errorReporter)
access
- access flags of the methodname
- name of the methoddesc
- descriptor of the methodsignature
- signature of the methodexceptions
- exceptions thrown by the methodgenerator
- bytecode generator to use for the transformed methodprimitiveName
- primitive class namemathClasses
- math implementation classeserrorReporter
- reporter used for delaying exceptionsMethod Detail |
---|
public void visitEnd()
visitEnd
in interface org.objectweb.asm.MethodVisitor
visitEnd
in class org.objectweb.asm.tree.MemberNode
public boolean isMathImplementationClass(String name)
name
- name of the class to test
public void useLocal(int index, int size) throws DifferentiationException
index
- index of the variablesize
- size of the variable (1 or 2 for standard variables,
4 for special expanded differential pairs)
DifferentiationException
- if the number of the
temporary variable lies outside of the allowed rangepublic int getTmp(int number) throws DifferentiationException
Temporary variables can be used for very short duration storage of size 2 values (i.e one double, or one long or two integers). These variables are reused in many replacement instructions sequences, so their content may be overridden at any time: they should be considered to have a scope limited to one replacement sequence only. This means that one should not store a value in a variable in one replacement sequence and retrieve it later in another replacement sequence as it may have been overridden in between.
At most 5 temporary variables may be used.
number
- number of the temporary variable (must be
between 1 and the maximal number of available temporary
variables)
DifferentiationException
- if the number of the
temporary variable lies outside of the allowed rangepublic void shiftVariable(org.objectweb.asm.tree.VarInsnNode insn)
insn
- variable instructionpublic org.objectweb.asm.tree.AbstractInsnNode clone(org.objectweb.asm.tree.AbstractInsnNode insn)
insn
- instruction to clone
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |