final boolean isOptimizedJoinPoint,
final int joinPointIndex,
final int callerIndex,
final int calleeIndex) {
for (int i = 0; i < m_aspectInfos.length; i++) {
AspectInfo aspectInfo = m_aspectInfos[i];
if (aspectInfo.getDeploymentModel() == DeploymentModel.PER_INSTANCE) {
// gen code: aspectField = (<TYPE>)((HasInstanceLocalAspect)CALLER).aw$getAspect(className, qualifiedName, containerClassName)
loadJoinPointInstance(cv, isOptimizedJoinPoint, joinPointIndex);
if (callerIndex >= 0) {
cv.visitVarInsn(ALOAD, callerIndex);
} else {
// caller instance not available - skipping
//TODO clean up should not occur
}
cv.visitLdcInsn(aspectInfo.getAspectClassName().replace('/', '.'));
cv.visitLdcInsn(aspectInfo.getAspectQualifiedName());
cv.visitLdcInsn(aspectInfo.getAspectDefinition().getContainerClassName());
cv.visitMethodInsn(
INVOKEINTERFACE,
HAS_INSTANCE_LEVEL_ASPECT_INTERFACE_NAME,
GET_INSTANCE_LEVEL_ASPECT_METHOD_NAME,
GET_INSTANCE_LEVEL_ASPECT_METHOD_SIGNATURE
);
cv.visitTypeInsn(CHECKCAST, aspectInfo.getAspectClassName());
cv.visitFieldInsn(
PUTFIELD,
m_joinPointClassName,
aspectInfo.getAspectFieldName(),
aspectInfo.getAspectClassSignature()
);
}
}
}