public static EmitLoadThis ( |
||
generator | ||
리턴 | void |
public void Visit(ASTNode_Lambda node) { var childCompiler = new ASTNodeVisitor_JITCompiler(TypeBuilder, node); if (childCompiler.MethodBuilder.IsStatic) { mILGenerator.Emit(OpCodes.Ldnull); mILGenerator.Emit(OpCodes.Ldftn, childCompiler.MethodBuilder); mILGenerator.Emit(OpCodes.Newobj, JITInterpreter_DS2.Instance().GetDelegateType(node.formalCount). GetConstructor(new Type[] { typeof(object), typeof(IntPtr) })); } else { mILGenerator.Emit(OpCodes.Newobj, childCompiler.ConstructorBuilder); foreach (var address in node.GetFreeAddresses()) { mILGenerator.Emit(OpCodes.Dup); if (address.envIndex == 1) { JITInterpreter_DS2.EmitLoadLocal(mILGenerator, (LocalBuilder)mLocalBuilders[address.index]); } else { JITInterpreter_DS2.EmitLoadThis(mILGenerator); mILGenerator.Emit(OpCodes.Ldfld, FieldBuilders[address.GetOuterAddress()]); } mILGenerator.Emit(OpCodes.Stfld, childCompiler.FieldBuilders[address]); } mILGenerator.Emit(OpCodes.Ldftn, childCompiler.MethodBuilder); mILGenerator.Emit(OpCodes.Newobj, JITInterpreter_DS2.Instance().GetDelegateType(node.formalCount) .GetConstructor(new Type[] { typeof(object), typeof(IntPtr) })); } }
private void BeginEmitPopFree(FreeAddress address) { JITInterpreter_DS2.EmitLoadThis(mILGenerator); mILGenerator.Emit(OpCodes.Ldfld, FieldBuilders[address]); }
private void EmitLoadFree(FreeAddress address) { JITInterpreter_DS2.EmitLoadThis(mILGenerator); mILGenerator.Emit(OpCodes.Ldfld, FieldBuilders[address]); mILGenerator.Emit(OpCodes.Ldfld, typeof(SharedValue).GetField("value")); }