cv.visitLabel(switchCaseLabels[0]);
// add invocations to the before advices
for (int i = 0; i < beforeAdvices.length; i++) {
IndexTuple beforeAdvice = beforeAdvices[i];
Aspect aspect = system.getAspectManager().getAspect(beforeAdvice.getAspectIndex());
Method adviceMethod = aspect.___AW_getAdvice(beforeAdvice.getMethodIndex());
String aspectClassName = aspect.getClass().getName().replace('.', '/');
String aspectFieldName = BEFORE_ADVICE_FIELD_PREFIX + i;
String aspectClassSignature = L + aspectClassName + SEMICOLON;
cv.visitVarInsn(Constants.ALOAD, 0);
cv.visitFieldInsn(Constants.GETFIELD, className, aspectFieldName, aspectClassSignature);
cv.visitVarInsn(Constants.ALOAD, 0);
cv.visitMethodInsn(
Constants.INVOKEVIRTUAL, aspectClassName, adviceMethod.getName(),
BEFORE_ADVICE_METHOD_SIGNATURE
);
}
// add invocation to this.proceed
cv.visitVarInsn(Constants.ALOAD, 0);
cv.visitMethodInsn(Constants.INVOKEVIRTUAL, className, PROCEED_METHOD_NAME, PROCEED_METHOD_SIGNATURE);
cv.visitVarInsn(Constants.ASTORE, 1);
// add invocations to the after advices
for (int i = afterAdvices.length - 1; i >= 0; i--) {
IndexTuple afterAdvice = afterAdvices[i];
Aspect aspect = system.getAspectManager().getAspect(afterAdvice.getAspectIndex());
Method adviceMethod = aspect.___AW_getAdvice(afterAdvice.getMethodIndex());
String aspectClassName = aspect.getClass().getName().replace('.', '/');
String aspectFieldName = AFTER_ADVICE_FIELD_PREFIX + i;
String aspectClassSignature = L + aspectClassName + SEMICOLON;
cv.visitVarInsn(Constants.ALOAD, 0);