handleJitCompilation(
methodHash, joinPointType, PointcutType.CALL, joinPointInfo, thisClass, m_targetClass,
thisInstance, thisInstance
);
}
JoinPoint joinPoint = joinPointInfo.joinPoint;
// if null or redefined -> create a new join point and cache it
if (joinPoint == null) {
Map joinPointMetaDataMap = s_registry.getJoinPointMetaData(m_classHash, methodHash);
JoinPointMetaData joinPointMetaData = (JoinPointMetaData)joinPointMetaDataMap.get(PointcutType.CALL);
AdviceIndexInfo[] adviceIndexes = joinPointMetaData.adviceIndexes;
List cflowExpressions = joinPointMetaData.cflowExpressions;
Pointcut cflowPointcut = joinPointMetaData.cflowPointcut;
initCflowManagement(cflowPointcut, joinPointInfo);
switch (joinPointType) {
case JoinPointType.METHOD_CALL:
// TODO: make diff between target and this instances
joinPoint = createMethodJoinPoint(
methodHash, joinPointType, thisClass, adviceIndexes,
joinPointMetaData, thisInstance, thisInstance
);
break;
case JoinPointType.CONSTRUCTOR_CALL:
// TODO: make diff between target and this instances
joinPoint = createConstructorJoinPoint(
methodHash, joinPointType, thisClass, adviceIndexes,
joinPointMetaData, thisInstance, thisInstance
);
break;
default:
throw new RuntimeException("join point type not valid");
}
// set the join point
joinPointInfo.joinPoint = joinPoint;
// update the state
if (adviceIndexes.length == 0) {
joinPointInfo.state = JoinPointState.ADVISED;
} else {
joinPointInfo.state = JoinPointState.HAS_ADVICES;
}
}
joinPoint.setTargetInstance(thisInstance);
if (parameters != null) {
((CodeRtti)joinPoint.getRtti()).setParameterValues(parameters);
}
enterCflow(joinPointInfo);
try {
return joinPoint.proceed();
} finally {
exitCflow(joinPointInfo);
}
}