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

public Class BcelAccessForInlineMunger

extends BcelTypeMunger
Class Inheritance
Imports
java.lang.reflect.Modifier, java.util.ArrayList, .HashMap, .HashSet, .List, .Map, .Set, org.aspectj.apache.bcel.Constants, org.aspectj.apache.bcel.classfile.ConstantPool, org.aspectj.apache.bcel.generic.FieldInstruction, .Instruction, .InstructionConstants, .InstructionFactory, .InstructionHandle, .InstructionList, .InvokeDynamic, .InvokeInstruction, .Type, org.aspectj.weaver.AjAttribute, .AjcMemberMaker, .Member, .NameMangler, .ResolvedMember, .ResolvedType, .Shadow, .UnresolvedType

Looks for all access to method or field that are not public within the body of the around advices and replace the invocations to a wrapper call so that the around advice can further be inlined.

This munger is used for @AJ aspects for which inlining wrapper is not done at compile time.

Specific state and logic is kept in the munger ala ITD so that call/get/set pointcuts can still be matched on the wrapped member thanks to the EffectiveSignature attribute.

Authors
Alexandre Vasseur, Andy Clement

Field Summary

Modifier and TypeField and Description
private LazyClassGen
private Set<LazyMethodGen>
inlineAccessorMethodGens

The wrapper methods representing any created inlineAccessors

private Map<String, ResolvedMember>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private ResolvedMember
createOrGetInlineAccessorForFieldGet(ResolvedMember resolvedMember)

Add an inline wrapper for a non public field get

private ResolvedMember
createOrGetInlineAccessorForFieldSet(ResolvedMember resolvedMember)

Add an inline wrapper for a non public field set

private ResolvedMember
createOrGetInlineAccessorForMethod(ResolvedMember resolvedMember)

Find (or add if not yet created) an inline wrapper for a non public method call

private ResolvedMember
createOrGetInlineAccessorForSuperDispatch(ResolvedMember resolvedMember)

Add an inline wrapper for a non public super.method call

public ResolvedMember
getMatchingSyntheticMember(Member member)

Overrides org.aspectj.weaver.ConcreteTypeMunger.getMatchingSyntheticMember.

Looks in the wrapper we have added so that we can find their effective signature if needed
public ResolvedMember
public boolean
matches(ResolvedType onType)

Overrides org.aspectj.weaver.ConcreteTypeMunger.matches.

Match only the aspect for which we act
public boolean
private void
openAroundAdvice(LazyMethodGen aroundAdvice)

Prepare the around advice, flag it as cannot be inlined if it can't be

Inherited from org.aspectj.weaver.bcel.BcelTypeMunger:
attemptToModifySuperCallsequalserrorgetTypeVariableAliaseshashCodemakeFieldGenmakeMethodGenparameterizedForparameterizeWithshouldOverwritetoString

Field Detail

aspectGenback to summary
private LazyClassGen aspectGen
inlineAccessorMethodGensback to summary
private Set<LazyMethodGen> inlineAccessorMethodGens

The wrapper methods representing any created inlineAccessors

inlineAccessorsback to summary
private Map<String, ResolvedMember> inlineAccessors

Constructor Detail

BcelAccessForInlineMungerback to summary
public BcelAccessForInlineMunger(ResolvedType aspectType)

Method Detail

createOrGetInlineAccessorForFieldGetback to summary
private ResolvedMember createOrGetInlineAccessorForFieldGet(ResolvedMember resolvedMember)

Add an inline wrapper for a non public field get

createOrGetInlineAccessorForFieldSetback to summary
private ResolvedMember createOrGetInlineAccessorForFieldSet(ResolvedMember resolvedMember)

Add an inline wrapper for a non public field set

createOrGetInlineAccessorForMethodback to summary
private ResolvedMember createOrGetInlineAccessorForMethod(ResolvedMember resolvedMember)

Find (or add if not yet created) an inline wrapper for a non public method call

createOrGetInlineAccessorForSuperDispatchback to summary
private ResolvedMember createOrGetInlineAccessorForSuperDispatch(ResolvedMember resolvedMember)

Add an inline wrapper for a non public super.method call

getMatchingSyntheticMemberback to summary
public ResolvedMember getMatchingSyntheticMember(Member member)

Overrides org.aspectj.weaver.ConcreteTypeMunger.getMatchingSyntheticMember.

Looks in the wrapper we have added so that we can find their effective signature if needed

Annotations
@Override
getSignatureback to summary
public ResolvedMember getSignature()

Overrides org.aspectj.weaver.ConcreteTypeMunger.getSignature.

Annotations
@Override
matchesback to summary
public boolean matches(ResolvedType onType)

Overrides org.aspectj.weaver.ConcreteTypeMunger.matches.

Match only the aspect for which we act

Annotations
@Override
mungeback to summary
public boolean munge(BcelClassWeaver weaver)

Overrides org.aspectj.weaver.bcel.BcelTypeMunger.munge.

Annotations
@Override
openAroundAdviceback to summary
private void openAroundAdvice(LazyMethodGen aroundAdvice)

Prepare the around advice, flag it as cannot be inlined if it can't be