"(" + JT_PO + "[J)" + JT_STATE);
mv.visitInsn(ARETURN);
mv.visitMaxs(0, 0);
}
private void generateSpeedoWriteIntentionMethod() {
CodeVisitor mv;
mv = cv.visitMethod(ACC_PUBLIC, "speedoWriteIntention",
"([J)" + JT_STATE, null, null);
//if (!speedoIsActive) {
mv.visitVarInsn(ALOAD, 0);
mv.visitFieldInsn(GETFIELD, classToWrite, ISACTIVE_FIELD_NAME, "Z");
Label l1 = new Label();
mv.visitJumpInsn(IFNE, l1);
{
//if (speedoReferenceState == null) {
generateGetRefState(mv, false);
Label l3 = new Label();
mv.visitJumpInsn(IFNONNULL, l3);
{
//speedoSetReferenceState(speedoCreateState());
mv.visitVarInsn(ALOAD, 0);
mv.visitVarInsn(ALOAD, 0);
mv.visitMethodInsn(INVOKEVIRTUAL, classToWrite,
M_SPEEDO_CREATE_STATE, "()" + JT_STATE);
mv.visitMethodInsn(INVOKEVIRTUAL, classToWrite,
M_SPEEDO_SET_REF_STATE, "(" + JT_STATE + ")V");
}
//if(speedoReferenceState.getDetachedStatus() == DetachedLifeCycle.DETACHED_CLEAN){
mv.visitLabel(l3);
generateGetRefState(mv, false);
mv.visitMethodInsn(INVOKEVIRTUAL, xfieldsAncestorJCN, "getDetachedStatus", "()B");
mv.visitInsn(ICONST_1);
Label l5 = new Label();
mv.visitJumpInsn(IF_ICMPNE, l5);
{
//speedoReferenceState.setDetachedStatus(DetachedLifeCycle.DETACHED_DIRTY);
generateGetRefState(mv, false);
mv.visitInsn(ICONST_2);
mv.visitMethodInsn(INVOKEVIRTUAL, xfieldsAncestorJCN, "setDetachedStatus", "(B)V");
}
//return speedoReferenceState;
mv.visitLabel(l5);
generateGetRefState(mv, false);
mv.visitInsn(ARETURN);
}
//return speedoGetHome().writeIntention(this, fields);
mv.visitLabel(l1);
mv.visitVarInsn(ALOAD, 0);
mv.visitMethodInsn(INVOKEVIRTUAL, classToWrite, M_SPEEDO_GET_HOME, "()" + JT_HOME);
mv.visitVarInsn(ALOAD, 0);
mv.visitVarInsn(ALOAD, 1);
mv.visitMethodInsn(INVOKEINTERFACE, JCN_HOME, "writeIntention",
"(" + JT_PO + "[J)" + JT_STATE);
mv.visitInsn(ARETURN);
mv.visitMaxs(0, 0);
}