Exemplo n.º 1
0
        private static DirectMethodHandle MakeAllocator(MemberName ctor)
        {
            assert(ctor.Constructor && ctor.Name.Equals("<init>"));
            Class instanceClass = ctor.DeclaringClass;

            ctor = ctor.AsConstructor();
            assert(ctor.Constructor && ctor.ReferenceKind == REF_newInvokeSpecial) : ctor;
            MethodType mtype = ctor.MethodType.ChangeReturnType(instanceClass);
            LambdaForm lform = PreparedLambdaForm(ctor);
            MemberName init  = ctor.AsSpecial();

            assert(init.MethodType.ReturnType() == typeof(void));
            return(new Constructor(mtype, lform, ctor, init, instanceClass));
        }