@Override public void writeSet(MethodWriter writer, IValue instance, IValue value, int lineNumber) throws BytecodeException { if (this.refType != null) { ReferenceType.writeGetRef(writer, value, this.index); IDataMember f = this.refType.getTheClass().getBody().getField(0); f.writeSet(writer, null, null, lineNumber); return; } if (value != null) { value.writeExpression(writer); } writer.writeVarInsn(this.type.getStoreOpcode(), this.index); }
@Override public void writeGet(MethodWriter writer, IValue instance, int lineNumber) throws BytecodeException { if (this.refType != null) { writer.writeVarInsn(Opcodes.ALOAD, this.index); IClass c = this.refType.getTheClass(); IDataMember f = c.getBody().getField(0); f.writeGet(writer, null, lineNumber); if (c == Types.OBJECT_REF_CLASS) { c = this.type.getTheClass(); if (c != Types.OBJECT_CLASS) { writer.writeTypeInsn(Opcodes.CHECKCAST, c.getInternalName()); } } return; } writer.writeVarInsn(this.type.getLoadOpcode(), this.index); }