loadManagedInstance(code, false);
code.aload().setParam(0);
code.invokevirtual().setMethod(getType(_meta),
PRE + "WriteUnmanaged", void.class, outargs);
JumpInstruction go2 = null;
if (detachedState) {
// if (sm != null)
// if (sm.writeDetached (out))
// return;
loadManagedInstance(code, false);
code.getfield().setField(SM, SMTYPE);
IfInstruction ifnull = code.ifnull();
loadManagedInstance(code, false);
code.getfield().setField(SM, SMTYPE);
code.aload().setParam(0);
code.invokeinterface().setMethod(SMTYPE, "writeDetached",
boolean.class, outargs);
go2 = code.ifeq();
code.vreturn();
// else
// out.writeObject (pcGetDetachedState ());
Class[] objargs = new Class[]{ Object.class };
ifnull.setTarget(code.aload().setParam(0));
loadManagedInstance(code, false);
code.invokevirtual().setMethod(PRE + "GetDetachedState",
Object.class, null);
code.invokeinterface().setMethod(ObjectOutput.class,
"writeObject", void.class, objargs);
// out.writeObject (null) // StateManager
code.aload().setParam(0);
code.constant().setValue((Object) null);
code.invokeinterface().setMethod(ObjectOutput.class,
"writeObject", void.class, objargs);
}
if (go2 != null)
go2.setTarget(code.nop());
// write managed fields
FieldMetaData[] fmds = _meta.getFields();
for (int i = 0; i < fmds.length; i++)
if (!fmds[i].isTransient())