Top Description Inners Fields Constructors Methods
org.aspectj.weaver.bcel

public final Class LazyMethodGen

extends Object
implements Traceable
Class Inheritance
All Implemented Interfaces
org.aspectj.weaver.tools.Traceable
Imports
java.io.ByteArrayOutputStream, .PrintStream, java.lang.reflect.Modifier, java.util.ArrayList, .HashMap, .HashSet, .Iterator, .LinkedList, .List, .ListIterator, .Map, .Set, org.aspectj.apache.bcel.Constants, org.aspectj.apache.bcel.classfile.Attribute, .ConstantPool, .Method, .Synthetic, org.aspectj.apache.bcel.classfile.annotation.AnnotationGen, org.aspectj.apache.bcel.generic.BranchHandle, .ClassGenException, .CodeExceptionGen, .Instruction, .InstructionBranch, .InstructionHandle, .InstructionList, .InstructionSelect, .InstructionTargeter, .LineNumberTag, .LocalVariableTag, .MethodGen, .ObjectType, .Tag, .TargetLostException, .Type, org.aspectj.bridge.IMessage, .ISourceLocation, org.aspectj.weaver.AjAttribute, .AjAttribute.WeaverVersionInfo, .AnnotationAJ, .BCException, .ISourceContext, .MemberImpl, .NameMangler, .ResolvedMember, .ResolvedType, .Shadow, .UnresolvedType, .WeaverMessages, .World, org.aspectj.weaver.tools.Traceable

A LazyMethodGen should be treated as a MethodGen. It's our way of abstracting over the low-level Method objects. It converts through MethodGen to create and to serialize, but that's it.

At any rate, there are two ways to create LazyMethodGens. One is from a method, which does work through MethodGen to do the correct thing. The other is the creation of a completely empty LazyMethodGen, and it is used when we're constructing code from scratch.

We stay away from targeters for rangey things like Shadows and Exceptions.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
pack-priv static class
private static class

Field Summary

Modifier and TypeField and Description
private List<ResolvedType>
private Type[]
private List<Attribute>
private InstructionList
private boolean
private String[]
public ResolvedType
private AjAttribute.EffectiveSignatureAttribute
private final LazyClassGen
pack-priv String
fromFilename

This is nonnull if this method is the result of an "inlining".

pack-priv int
private boolean
pack-priv List<BcelShadow>
private int
private BcelMethod
private int
private final String
private List<AnnotationAJ>
private AnnotationAJ[][]
private final boolean
private Type
private Method
pack-priv boolean

Constructor Summary

AccessConstructor and Description
public
LazyMethodGen(int modifiers, Type returnType, String name, Type[] paramTypes, String[] declaredExceptions, LazyClassGen enclosingClass)

public
LazyMethodGen(Method m, LazyClassGen enclosingClass)

public

Method Summary

Modifier and TypeMethod and Description
public void
public void
public void
addExceptionHandler(InstructionHandle start, InstructionHandle end, InstructionHandle handlerStart, ObjectType catchType, boolean highPriority)

private void
private void
public void
addParameterAnnotation(int parameterNumber, AnnotationAJ anno)

public int
public int
allocateLocal(int slots)

public void
assertGoodBody()

A good body is a body with the following properties:

  • For each branch instruction S in body, target T of S is in body.
  • For each branch instruction S in body, target T of S has S as a targeter.
  • For each instruction T in body, for each branch instruction S that is a targeter of T, S is in body.
  • For each non-range-handle instruction T in body, for each instruction S that is a targeter of T, S is either a branch instruction, an exception range or a tag
  • For each range-handle instruction T in body, there is exactly one targeter S that is a range.
  • For each range-handle instruction T in body, the range R targeting T is in body.
  • For each instruction T in body, for each exception range R targeting T, R is in body.
  • For each exception range R in body, let T := R.handler. T is in body, and R is one of T's targeters
  • All ranges are properly nested: For all ranges Q and R, if Q.start preceeds R.start, then R.end preceeds Q.end.
public static void
private static void
assertTargetedBy(InstructionHandle target, InstructionTargeter targeter, String from)

ih is an InstructionHandle or a BranchInstruction

private static void
private int
private Map<InstructionHandle, InstructionHandle>
private void
public void
ensureAllLineNumberSetup()

On entry to this method we have a method whose instruction stream contains a few instructions that have line numbers assigned to them (LineNumberTags).

public void
private void
public int
public int
public AnnotationAJ[]
public ResolvedType[]
public Type[]
public List<Attribute>
public InstructionList
public InstructionList
public boolean
public String
public ConstantPool
public int
public int
public String[]
public AjAttribute.EffectiveSignatureAttribute
public LazyClassGen
public String
pack-priv static int
getLineNumber(InstructionHandle ih, int prevLine)

pack-priv static LocalVariableTag
public int
public BcelMethod
public Method
public String
private InstructionHandle
private InstructionHandle
public String
private static Range
public Type
public String
public ISourceLocation
private World
private void
private void
handleBranchInstruction(BranchHandle branchHandle, Set<InstructionHandle> handlesForDeletion)

Process a branch instruction with respect to instructions that are about to be deleted.

private void
public boolean
hasAnnotation(UnresolvedType annotationType)

private boolean
hasAttribute(String attributeName)

public boolean
public boolean
private boolean
private void
pack-priv static void
public boolean
private boolean
isAbstractOrNative(int modifiers)

pack-priv boolean
pack-priv boolean
public boolean
public static boolean
public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
pack-priv boolean
private InstructionHandle
public void
public void
public void
public MethodGen
pack()

public void
packBody(MethodGen gen)

fill the newly created method gen with our body, inspired by InstructionList.copy()

private void
private static InstructionHandle
remap(InstructionHandle handle, Map<InstructionHandle, InstructionHandle> map)

This procedure should not currently be used.

public void
public void
setAccessFlags(int newFlags)

public void
setCanInline(boolean canInline)

public void
setEffectiveSignature(ResolvedMember member, Shadow.Kind kind, boolean shouldWeave)

public void
setMaxLocals(int maxLocals)

public String
public String
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public String
private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait