de.uka.ipd.sdq.ByCounter.parsing
Class MethodPreInstrumentationParser

java.lang.Object
  extended by org.objectweb.asm.MethodAdapter
      extended by de.uka.ipd.sdq.ByCounter.parsing.MethodPreInstrumentationParser
All Implemented Interfaces:
org.objectweb.asm.MethodVisitor

public final class MethodPreInstrumentationParser
extends org.objectweb.asm.MethodAdapter

MethodPreInstrumentationParser implements a quick method visiting pass for finding method invocations and array constructions. The knowledge obtained from this pass can be used to count method invocations more efficiently using simple int counters and 'iinc' instructions. In addition to that, array type and dimension information can be obtained.

Since:
0.1
Version:
1.2
Author:
Martin Krogmann, Michael Kuperberg

Constructor Summary
MethodPreInstrumentationParser(org.objectweb.asm.MethodVisitor mv, int access, java.lang.String owner, java.lang.String name, java.lang.String desc, MethodCountMethodAdapter methodCountMethodAdapter, InstrumentationParameters parameters, InstrumentationState state, MethodDescriptor method)
           
 
Method Summary
 AdditionalOpcodeInformation getAdditionalOpcodeInformation()
          Get the list containing all method signatures that were called in the visited method.
 void visitEnd()
          Visiting the end of the method allows to collect the needed method invocation information.
 
Methods inherited from class org.objectweb.asm.MethodAdapter
visitAnnotation, visitAnnotationDefault, visitAttribute, visitCode, visitFieldInsn, visitFrame, visitIincInsn, visitInsn, visitIntInsn, visitJumpInsn, visitLabel, visitLdcInsn, visitLineNumber, visitLocalVariable, visitLookupSwitchInsn, visitMaxs, visitMethodInsn, visitMultiANewArrayInsn, visitParameterAnnotation, visitTableSwitchInsn, visitTryCatchBlock, visitTypeInsn, visitVarInsn
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MethodPreInstrumentationParser

public MethodPreInstrumentationParser(org.objectweb.asm.MethodVisitor mv,
                                      int access,
                                      java.lang.String owner,
                                      java.lang.String name,
                                      java.lang.String desc,
                                      MethodCountMethodAdapter methodCountMethodAdapter,
                                      InstrumentationParameters parameters,
                                      InstrumentationState state,
                                      MethodDescriptor method)
Parameters:
access - As from ClassVisitor.
name - As from ClassVisitor.
desc - As from ClassVisitor.
methodCountMethodAdapter - MethodCountMethodAdapter that needs the method
parameters - Parameters for instrumentation. Also contains information that decides what is done before instrumetation. invocation information for proper instrumentation.
method - The currently analysed method.
Method Detail

getAdditionalOpcodeInformation

public AdditionalOpcodeInformation getAdditionalOpcodeInformation()
Get the list containing all method signatures that were called in the visited method.

Returns:
A map containing method signatures as keys in the form owner + "." + name + desc. Signatures are specific to the object they are invoked on. This means that a certain methods may be more than once in the array. However, their signatures differ, as the owner property differs.
See Also:
MethodDescriptor.getCanonicalMethodName()

visitEnd

public void visitEnd()
Visiting the end of the method allows to collect the needed method invocation information.

Specified by:
visitEnd in interface org.objectweb.asm.MethodVisitor
Overrides:
visitEnd in class org.objectweb.asm.MethodAdapter