public void EmitPutstatic(short f, Field field) { EmitOp(OpCodeValue.putstatic); if (!alive) return; EmitShort(f); state.Pop(field.ReturnType); }
public short AddConstantFieldref(Field field) { if (field == null) return 0; short classIndex = AddConstantClass(field.DeclaringType); short nameAndTypeIndex = AddConstantNameAndType(field.Name, field); CompileConstantFieldref fieldConst = ConstantPool.OfType<CompileConstantFieldref>().FirstOrDefault( x => x.ClassIndex == classIndex && x.NameAndTypeIndex == nameAndTypeIndex); if (fieldConst == null) { fieldConst = new CompileConstantFieldref { PoolIndex = nextConstantIndex++, ClassIndex = classIndex, NameAndTypeIndex = nameAndTypeIndex }; ConstantPool.Add(fieldConst); } return fieldConst.PoolIndex; }
public void EmitPutfield(short f, Field field) { EmitOp(OpCodeValue.putfield); if (!alive) return; EmitShort(f); state.Pop(field.ReturnType); state.Pop(1); // object ref }