コード例 #1
0
ファイル: CorInfoBase.cs プロジェクト: nguerrera/corert
        public virtual CorInfoTypeWithMod getArgType_wrapper(IntPtr _this, out IntPtr exception, CORINFO_SIG_INFO* sig, CORINFO_ARG_LIST_STRUCT_* args, ref CORINFO_CLASS_STRUCT_* vcTypeRet)
        {
            exception = IntPtr.Zero;
            try
            {
                return getArgType(sig, args, ref vcTypeRet);

            }
            catch (Exception ex)
            {
                exception = AllocException(ex);
            }
            return (CorInfoTypeWithMod)0;
        }
コード例 #2
0
ファイル: CorInfoImpl.cs プロジェクト: smartmaster/corert
        private void getMethodSig(IntPtr _this, CORINFO_METHOD_STRUCT_* ftn, CORINFO_SIG_INFO* sig, CORINFO_CLASS_STRUCT_* memberParent)
        {
            MethodDesc method = HandleToObject(ftn);

            Get_CORINFO_SIG_INFO(method.Signature, out *sig);
        }
コード例 #3
0
ファイル: CorInfoImpl.cs プロジェクト: smartmaster/corert
 private void findSig(IntPtr _this, CORINFO_MODULE_STRUCT_* module, uint sigTOK, CORINFO_CONTEXT_STRUCT* context, CORINFO_SIG_INFO* sig)
 {
     var methodIL = (MethodIL)HandleToObject((IntPtr)module);
     Get_CORINFO_SIG_INFO((MethodSignature)methodIL.GetObject((int)sigTOK), out *sig);
 }
コード例 #4
0
ファイル: CorInfoImpl.cs プロジェクト: smartmaster/corert
 private void* getTailCallCopyArgsThunk(IntPtr _this, CORINFO_SIG_INFO* pSig, CorInfoHelperTailCallSpecialHandling flags)
 { throw new NotImplementedException("getTailCallCopyArgsThunk"); }
コード例 #5
0
ファイル: CorInfoImpl.cs プロジェクト: smartmaster/corert
        private void Get_CORINFO_SIG_INFO(MethodSignature signature, out CORINFO_SIG_INFO sig)
        {
            sig.callConv = (CorInfoCallConv)0;
            if (!signature.IsStatic) sig.callConv |= CorInfoCallConv.CORINFO_CALLCONV_HASTHIS;

            TypeDesc returnType = signature.ReturnType;

            CorInfoType corInfoRetType = asCorInfoType(signature.ReturnType, out sig.retTypeClass);
            sig._retType = (byte)corInfoRetType;
            sig.retTypeSigClass = sig.retTypeClass; // The difference between the two is not relevant for ILCompiler

            sig.flags = 0;    // used by IL stubs code

            sig.numArgs = (ushort)signature.Length;

            sig.args = (CORINFO_ARG_LIST_STRUCT_*)0; // CORINFO_ARG_LIST_STRUCT_ is argument index

            // TODO: Shared generic
            sig.sigInst.classInst = null;
            sig.sigInst.classInstCount = 0;
            sig.sigInst.methInst = null;
            sig.sigInst.methInstCount = 0;

            sig.pSig = (byte*)ObjectToHandle(signature);
            sig.cbSig = 0; // Not used by the JIT
            sig.scope = null; // Not used by the JIT
            sig.token = 0; // Not used by the JIT

            // TODO: Shared generic
            // if (ftn->RequiresInstArg())
            // {
            //     sig.callConv = (CorInfoCallConv)(sig.callConv | CORINFO_CALLCONV_PARAMTYPE);
            // }
        }
コード例 #6
0
ファイル: CorInfoImpl.cs プロジェクト: smartmaster/corert
 private void* GetCookieForPInvokeCalliSig(IntPtr _this, CORINFO_SIG_INFO* szMetaSig, ref void* ppIndirection)
 { throw new NotImplementedException("GetCookieForPInvokeCalliSig"); }
コード例 #7
0
ファイル: CorInfoImpl.cs プロジェクト: smartmaster/corert
 private IntPtr getVarArgsHandle(IntPtr _this, CORINFO_SIG_INFO* pSig, ref void* ppIndirection)
 { throw new NotImplementedException("getVarArgsHandle"); }
コード例 #8
0
ファイル: CorInfoBase.cs プロジェクト: nguerrera/corert
        public virtual void* getTailCallCopyArgsThunk_wrapper(IntPtr _this, out IntPtr exception, CORINFO_SIG_INFO* pSig, CorInfoHelperTailCallSpecialHandling flags)
        {
            exception = IntPtr.Zero;
            try
            {
                return getTailCallCopyArgsThunk(pSig, flags);

            }
            catch (Exception ex)
            {
                exception = AllocException(ex);
            }
            return (void*)0;
        }
コード例 #9
0
ファイル: CorInfoBase.cs プロジェクト: nguerrera/corert
 public virtual void recordCallSite_wrapper(IntPtr _this, out IntPtr exception, uint instrOffset, CORINFO_SIG_INFO* callSig, CORINFO_METHOD_STRUCT_* methodHandle)
 {
     exception = IntPtr.Zero;
     try
     {
         recordCallSite(instrOffset, callSig, methodHandle);
         return;
     }
     catch (Exception ex)
     {
         exception = AllocException(ex);
     }
 }
コード例 #10
0
ファイル: CorInfoBase.cs プロジェクト: nguerrera/corert
        public virtual IntPtr getVarArgsHandle_wrapper(IntPtr _this, out IntPtr exception, CORINFO_SIG_INFO* pSig, ref void* ppIndirection)
        {
            exception = IntPtr.Zero;
            try
            {
                return getVarArgsHandle(pSig, ref ppIndirection);

            }
            catch (Exception ex)
            {
                exception = AllocException(ex);
            }
            return (IntPtr)0;
        }
コード例 #11
0
ファイル: CorInfoBase.cs プロジェクト: nguerrera/corert
        [return: MarshalAs(UnmanagedType.I1)]public virtual bool canGetVarArgsHandle_wrapper(IntPtr _this, out IntPtr exception, CORINFO_SIG_INFO* pSig)
        {
            exception = IntPtr.Zero;
            try
            {
                return canGetVarArgsHandle(pSig);

            }
            catch (Exception ex)
            {
                exception = AllocException(ex);
            }
            return false;
        }
コード例 #12
0
ファイル: CorInfoBase.cs プロジェクト: nguerrera/corert
        [return: MarshalAs(UnmanagedType.I1)]public virtual bool canGetCookieForPInvokeCalliSig_wrapper(IntPtr _this, out IntPtr exception, CORINFO_SIG_INFO* szMetaSig)
        {
            exception = IntPtr.Zero;
            try
            {
                return canGetCookieForPInvokeCalliSig(szMetaSig);

            }
            catch (Exception ex)
            {
                exception = AllocException(ex);
            }
            return false;
        }
コード例 #13
0
ファイル: CorInfoBase.cs プロジェクト: nguerrera/corert
        public virtual void* GetCookieForPInvokeCalliSig_wrapper(IntPtr _this, out IntPtr exception, CORINFO_SIG_INFO* szMetaSig, ref void* ppIndirection)
        {
            exception = IntPtr.Zero;
            try
            {
                return GetCookieForPInvokeCalliSig(szMetaSig, ref ppIndirection);

            }
            catch (Exception ex)
            {
                exception = AllocException(ex);
            }
            return (void*)0;
        }
コード例 #14
0
ファイル: CorInfoBase.cs プロジェクト: nguerrera/corert
        public virtual CORINFO_CLASS_STRUCT_* getArgClass_wrapper(IntPtr _this, out IntPtr exception, CORINFO_SIG_INFO* sig, CORINFO_ARG_LIST_STRUCT_* args)
        {
            exception = IntPtr.Zero;
            try
            {
                return getArgClass(sig, args);

            }
            catch (Exception ex)
            {
                exception = AllocException(ex);
            }
            return (CORINFO_CLASS_STRUCT_*)0;
        }
コード例 #15
0
ファイル: CorInfoImpl.cs プロジェクト: smartmaster/corert
        private CorInfoTypeWithMod getArgType(IntPtr _this, CORINFO_SIG_INFO* sig, CORINFO_ARG_LIST_STRUCT_* args, ref CORINFO_CLASS_STRUCT_* vcTypeRet)
        {
            int index = (int)args;
            Object sigObj = HandleToObject((IntPtr)sig->pSig);

            MethodSignature methodSig = sigObj as MethodSignature;

            if (methodSig != null)
            {
                TypeDesc type = methodSig[index];

                CorInfoType corInfoType = asCorInfoType(type, out vcTypeRet);
                return (CorInfoTypeWithMod)corInfoType;
            }
            else
            {
                LocalVariableDefinition[] locals = (LocalVariableDefinition[])sigObj;
                TypeDesc type = locals[index].Type;

                CorInfoType corInfoType = asCorInfoType(type, out vcTypeRet);

                return (CorInfoTypeWithMod)corInfoType | (locals[index].IsPinned ? CorInfoTypeWithMod.CORINFO_TYPE_MOD_PINNED : 0);
            }
        }
コード例 #16
0
ファイル: CorInfoBase.cs プロジェクト: nguerrera/corert
 public virtual void getMethodSig_wrapper(IntPtr _this, out IntPtr exception, CORINFO_METHOD_STRUCT_* ftn, CORINFO_SIG_INFO* sig, CORINFO_CLASS_STRUCT_* memberParent)
 {
     exception = IntPtr.Zero;
     try
     {
         getMethodSig(ftn, sig, memberParent);
         return;
     }
     catch (Exception ex)
     {
         exception = AllocException(ex);
     }
 }
コード例 #17
0
ファイル: CorInfoImpl.cs プロジェクト: smartmaster/corert
        private CORINFO_CLASS_STRUCT_* getArgClass(IntPtr _this, CORINFO_SIG_INFO* sig, CORINFO_ARG_LIST_STRUCT_* args)
        {
            int index = (int)args;
            Object sigObj = HandleToObject((IntPtr)sig->pSig);

            MethodSignature methodSig = sigObj as MethodSignature;
            if (methodSig != null)
            {
                TypeDesc type = methodSig[index];
                return ObjectToHandle(type);
            }
            else
            {
                LocalVariableDefinition[] locals = (LocalVariableDefinition[])sigObj;
                TypeDesc type = locals[index].Type;
                return ObjectToHandle(type);
            }
        }
コード例 #18
0
ファイル: CorInfoBase.cs プロジェクト: nguerrera/corert
        [return: MarshalAs(UnmanagedType.Bool)]public virtual bool pInvokeMarshalingRequired_wrapper(IntPtr _this, out IntPtr exception, CORINFO_METHOD_STRUCT_* method, CORINFO_SIG_INFO* callSiteSig)
        {
            exception = IntPtr.Zero;
            try
            {
                return pInvokeMarshalingRequired(method, callSiteSig);

            }
            catch (Exception ex)
            {
                exception = AllocException(ex);
            }
            return false;
        }
コード例 #19
0
ファイル: CorInfoImpl.cs プロジェクト: smartmaster/corert
 private bool canGetCookieForPInvokeCalliSig(IntPtr _this, CORINFO_SIG_INFO* szMetaSig)
 { throw new NotImplementedException("canGetCookieForPInvokeCalliSig"); }
コード例 #20
0
ファイル: CorInfoBase.cs プロジェクト: nguerrera/corert
 public virtual void findCallSiteSig_wrapper(IntPtr _this, out IntPtr exception, CORINFO_MODULE_STRUCT_* module, uint methTOK, CORINFO_CONTEXT_STRUCT* context, CORINFO_SIG_INFO* sig)
 {
     exception = IntPtr.Zero;
     try
     {
         findCallSiteSig(module, methTOK, context, sig);
         return;
     }
     catch (Exception ex)
     {
         exception = AllocException(ex);
     }
 }
コード例 #21
0
ファイル: CorInfoImpl.cs プロジェクト: smartmaster/corert
 private bool canGetVarArgsHandle(IntPtr _this, CORINFO_SIG_INFO* pSig)
 { throw new NotImplementedException("canGetVarArgsHandle"); }
コード例 #22
0
ファイル: CorInfoImpl.cs プロジェクト: hoyMS/corert
        private void Get_CORINFO_SIG_INFO(MethodDesc method, out CORINFO_SIG_INFO sig)
        {
            Get_CORINFO_SIG_INFO(method.Signature, out sig);

            // Does the method have a hidden parameter?
            if (method.RequiresInstArg())
            {
                sig.callConv |= CorInfoCallConv.CORINFO_CALLCONV_PARAMTYPE;
            }
        }
コード例 #23
0
ファイル: CorInfoImpl.cs プロジェクト: smartmaster/corert
 private void recordCallSite(IntPtr _this, uint instrOffset, CORINFO_SIG_INFO* callSig, CORINFO_METHOD_STRUCT_* methodHandle)
 {
 }
コード例 #24
0
ファイル: CorInfoImpl.cs プロジェクト: hoyMS/corert
        private void Get_CORINFO_SIG_INFO(MethodSignature signature, out CORINFO_SIG_INFO sig)
        {
            sig.callConv = (CorInfoCallConv)(signature.Flags & MethodSignatureFlags.UnmanagedCallingConventionMask);
            if (!signature.IsStatic) sig.callConv |= CorInfoCallConv.CORINFO_CALLCONV_HASTHIS;

            TypeDesc returnType = signature.ReturnType;

            CorInfoType corInfoRetType = asCorInfoType(signature.ReturnType, out sig.retTypeClass);
            sig._retType = (byte)corInfoRetType;
            sig.retTypeSigClass = sig.retTypeClass; // The difference between the two is not relevant for ILCompiler

            sig.flags = 0;    // used by IL stubs code

            sig.numArgs = (ushort)signature.Length;

            sig.args = (CORINFO_ARG_LIST_STRUCT_*)0; // CORINFO_ARG_LIST_STRUCT_ is argument index

            sig.sigInst.classInst = null; // Not used by the JIT 
            sig.sigInst.classInstCount = 0; // Not used by the JIT 
            sig.sigInst.methInst = null; // Not used by the JIT 
            sig.sigInst.methInstCount = (uint)signature.GenericParameterCount;

            sig.pSig = (byte*)ObjectToHandle(signature);
            sig.cbSig = 0; // Not used by the JIT
            sig.scope = null; // Not used by the JIT
            sig.token = 0; // Not used by the JIT
        }
コード例 #25
0
ファイル: CorInfoImpl.cs プロジェクト: smartmaster/corert
        private void Get_CORINFO_SIG_INFO(LocalVariableDefinition[] locals, out CORINFO_SIG_INFO sig)
        {
            sig.callConv = CorInfoCallConv.CORINFO_CALLCONV_DEFAULT;
            sig._retType = (byte)CorInfoType.CORINFO_TYPE_VOID;
            sig.retTypeClass = null;
            sig.retTypeSigClass = null;
            sig.flags = (byte)CorInfoSigInfoFlags.CORINFO_SIGFLAG_IS_LOCAL_SIG;

            sig.numArgs = (ushort)locals.Length;

            sig.sigInst.classInst = null;
            sig.sigInst.classInstCount = 0;
            sig.sigInst.methInst = null;
            sig.sigInst.methInstCount = 0;

            sig.args = (CORINFO_ARG_LIST_STRUCT_*)0; // CORINFO_ARG_LIST_STRUCT_ is argument index

            sig.pSig = (byte*)ObjectToHandle(locals);
            sig.cbSig = 0; // Not used by the JIT
            sig.scope = null; // Not used by the JIT
            sig.token = 0; // Not used by the JIT
        }
コード例 #26
0
ファイル: CorInfoImpl.cs プロジェクト: hoyMS/corert
        private bool pInvokeMarshalingRequired(CORINFO_METHOD_STRUCT_* handle, CORINFO_SIG_INFO* callSiteSig)
        {
            // TODO: Support for PInvoke calli with marshalling. For now, assume there is no marshalling required.
            if (handle == null)
                return false;

            MethodDesc method = HandleToObject(handle);

            if (method.IsRawPInvoke())
                return false;

            // TODO: Ideally, we would just give back the PInvoke stub IL to the JIT and let it inline it, without
            // checking whether it is required upfront. Unfortunatelly, RyuJIT is not able to generate PInvoke
            // transitions in inlined methods today (impCheckForPInvokeCall is not called for inlinees and number of other places
            // depend on it). To get a decent code with this limitation, we mirror CoreCLR behavior: Check
            // whether PInvoke stub is required here, and disable inlining of PInvoke methods in getMethodAttribsInternal.
            return Internal.IL.Stubs.PInvokeILEmitter.IsStubRequired(method);
        }
コード例 #27
0
ファイル: CorInfoImpl.cs プロジェクト: smartmaster/corert
 private bool pInvokeMarshalingRequired(IntPtr _this, CORINFO_METHOD_STRUCT_* method, CORINFO_SIG_INFO* callSiteSig)
 { throw new NotImplementedException("pInvokeMarshalingRequired"); }
コード例 #28
0
ファイル: CorInfoImpl.cs プロジェクト: hoyMS/corert
 private void findCallSiteSig(CORINFO_MODULE_STRUCT_* module, uint methTOK, CORINFO_CONTEXT_STRUCT* context, CORINFO_SIG_INFO* sig)
 {
     var methodIL = (MethodIL)HandleToObject((IntPtr)module);
     Get_CORINFO_SIG_INFO(((MethodDesc)methodIL.GetObject((int)methTOK)), out *sig);
 }
コード例 #29
0
ファイル: CorInfoImpl.cs プロジェクト: smartmaster/corert
 private void findCallSiteSig(IntPtr _this, CORINFO_MODULE_STRUCT_* module, uint methTOK, CORINFO_CONTEXT_STRUCT* context, CORINFO_SIG_INFO* sig)
 {
     // TODO: dynamic scopes
     // TODO: verification
     var methodIL = (MethodIL)HandleToObject((IntPtr)module);
     Get_CORINFO_SIG_INFO(((MethodDesc)methodIL.GetObject((int)methTOK)).Signature, out *sig);
 }
コード例 #30
0
ファイル: CorInfoBase.cs プロジェクト: tijoytom/corert
 static void _findCallSiteSig(IntPtr thisHandle, IntPtr* ppException, CORINFO_MODULE_STRUCT_* module, uint methTOK, CORINFO_CONTEXT_STRUCT* context, CORINFO_SIG_INFO* sig)
 {
     var _this = GetThis(thisHandle);
     try
     {
         _this.findCallSiteSig(module, methTOK, context, sig);
     }
     catch (Exception ex)
     {
         *ppException = _this.AllocException(ex);
     }
 }