mv = cv.visitMethod(ACC_PUBLIC, "jdoMakeDirty", "(Ljava/lang/String;)V", null, null);
mv.visitInsn(RETURN);
mv.visitMaxs(0, 0);
}
private void generateJdoIsDirtyMethod() {
CodeVisitor mv;
mv = cv.visitMethod(ACC_PUBLIC, "jdoIsDirty", "()Z", null, null);
generateReturnFalseIfNotIsActive(mv);
//StateItf sa = speedoGetState();
mv.visitVarInsn(ALOAD, 0);
mv.visitMethodInsn(INVOKEVIRTUAL, classToWrite, M_SPEEDO_GET_STATE, "()" + JT_STATE);
mv.visitVarInsn(ASTORE, 1);
//if (sa == null) {
// return false;
//}
mv.visitVarInsn(ALOAD, 1);
Label l4 = new Label();
mv.visitJumpInsn(IFNONNULL, l4);
mv.visitInsn(ICONST_0);
mv.visitInsn(IRETURN);
mv.visitLabel(l4);
//byte status = sa.jdoGetStatus();
mv.visitVarInsn(ALOAD, 1);
mv.visitMethodInsn(INVOKEINTERFACE, JCN_STATE, M_SPEEDO_GET_STATUS, "()B");
mv.visitVarInsn(ISTORE, 2);
//return !LifeCycle.isTransient(status) && LifeCycle.isDirty(status);
mv.visitVarInsn(ILOAD, 2);
mv.visitMethodInsn(INVOKESTATIC, JCN_LIFE_CYCLE, "isTransient", "(B)Z");
Label l7 = new Label();
mv.visitJumpInsn(IFNE, l7);
mv.visitVarInsn(ILOAD, 2);
mv.visitMethodInsn(INVOKESTATIC, JCN_LIFE_CYCLE, "isDirty", "(B)Z");
mv.visitJumpInsn(IFEQ, l7);
mv.visitInsn(ICONST_1);
Label l8 = new Label();
mv.visitJumpInsn(GOTO, l8);
mv.visitLabel(l7);
mv.visitInsn(ICONST_0);
mv.visitLabel(l8);
mv.visitInsn(IRETURN);
mv.visitMaxs(0, 0);
}