Class MethodGenerator

java.lang.Object
org.apache.bcel.classfile.AccessFlags
org.apache.bcel.generic.FieldGenOrMethodGen
org.apache.bcel.generic.MethodGen
org.apache.xalan.xsltc.compiler.util.MethodGenerator
All Implemented Interfaces:
Cloneable, org.apache.bcel.generic.InstructionConstants, org.apache.bcel.generic.NamedAndTyped, Constants
Direct Known Subclasses:
AttributeSetMethodGenerator, CompareGenerator, MatchGenerator, NamedMethodGenerator, RtMethodGenerator, TestGenerator

public class MethodGenerator extends org.apache.bcel.generic.MethodGen implements Constants
Author:
Jacek Ambroziak, Santiago Pericas-Geertsen
  • Constructor Details

    • MethodGenerator

      public MethodGenerator(int access_flags, org.apache.bcel.generic.Type return_type, org.apache.bcel.generic.Type[] arg_types, String[] arg_names, String method_name, String class_name, org.apache.bcel.generic.InstructionList il, org.apache.bcel.generic.ConstantPoolGen cpg)
  • Method Details

    • addLocalVariable

      public org.apache.bcel.generic.LocalVariableGen addLocalVariable(String name, org.apache.bcel.generic.Type type, org.apache.bcel.generic.InstructionHandle start, org.apache.bcel.generic.InstructionHandle end)
      Allocates a local variable. If the slot allocator has already been initialized, then call addLocalVariable2() so that the new variable is known to the allocator. Failing to do this may cause the allocator to return a slot that is already in use.
      Overrides:
      addLocalVariable in class org.apache.bcel.generic.MethodGen
    • addLocalVariable2

      public org.apache.bcel.generic.LocalVariableGen addLocalVariable2(String name, org.apache.bcel.generic.Type type, org.apache.bcel.generic.InstructionHandle start)
    • removeLocalVariable

      public void removeLocalVariable(org.apache.bcel.generic.LocalVariableGen lvg)
      Overrides:
      removeLocalVariable in class org.apache.bcel.generic.MethodGen
    • loadDOM

      public org.apache.bcel.generic.Instruction loadDOM()
    • storeDOM

      public org.apache.bcel.generic.Instruction storeDOM()
    • storeHandler

      public org.apache.bcel.generic.Instruction storeHandler()
    • loadHandler

      public org.apache.bcel.generic.Instruction loadHandler()
    • storeIterator

      public org.apache.bcel.generic.Instruction storeIterator()
    • loadIterator

      public org.apache.bcel.generic.Instruction loadIterator()
    • setStartNode

      public final org.apache.bcel.generic.Instruction setStartNode()
    • reset

      public final org.apache.bcel.generic.Instruction reset()
    • nextNode

      public final org.apache.bcel.generic.Instruction nextNode()
    • startElement

      public final org.apache.bcel.generic.Instruction startElement()
    • endElement

      public final org.apache.bcel.generic.Instruction endElement()
    • startDocument

      public final org.apache.bcel.generic.Instruction startDocument()
    • endDocument

      public final org.apache.bcel.generic.Instruction endDocument()
    • attribute

      public final org.apache.bcel.generic.Instruction attribute()
    • uniqueAttribute

      public final org.apache.bcel.generic.Instruction uniqueAttribute()
    • namespace

      public final org.apache.bcel.generic.Instruction namespace()
    • loadCurrentNode

      public org.apache.bcel.generic.Instruction loadCurrentNode()
    • storeCurrentNode

      public org.apache.bcel.generic.Instruction storeCurrentNode()
    • loadContextNode

      public org.apache.bcel.generic.Instruction loadContextNode()
      by default context node is the same as current node. MK437
    • storeContextNode

      public org.apache.bcel.generic.Instruction storeContextNode()
    • getLocalIndex

      public int getLocalIndex(String name)
    • getLocalVariable

      public org.apache.bcel.generic.LocalVariableGen getLocalVariable(String name)
    • setMaxLocals

      public void setMaxLocals()
      Overrides:
      setMaxLocals in class org.apache.bcel.generic.MethodGen
    • addInstructionList

      public void addInstructionList(Pattern pattern, org.apache.bcel.generic.InstructionList ilist)
      Add a pre-compiled pattern to this mode.
    • getInstructionList

      public org.apache.bcel.generic.InstructionList getInstructionList(Pattern pattern)
      Get the instruction list for a pre-compiled pattern. Used by test sequences to avoid compiling patterns more than once.
    • outlineChunks

      public org.apache.bcel.classfile.Method[] outlineChunks(ClassGenerator classGen, int originalMethodSize)
      Breaks up the IL for this MethodGenerator into separate outlined methods so that no method exceeds the 64KB limit on the length of the byte code associated with a method.
      Parameters:
      classGen - The ClassGen with which the generated methods will be associated
      originalMethodSize - The number of bytes of bytecode represented by the InstructionList of this method
      Returns:
      an array of the outlined Methods and the original method itself
    • markChunkStart

      public void markChunkStart()
      Mark the end of the method's InstructionList as the start of an outlineable chunk of code. The outlineable chunk begins after the InstructionHandle that is at the end of the method's InstructionList, or at the start of the method if the InstructionList is empty. See OutlineableChunkStart for more information.
    • markChunkEnd

      public void markChunkEnd()
      Mark the end of an outlineable chunk of code. See OutlineableChunkStart for more information.