Example #1
0
        private void ComputeCalleeFlagsAndFunctionPointerForReflectionInvokeThunk()
        {
            Debug.Assert(_conversionInfo.IsReflectionDynamicInvokerThunk);
            Debug.Assert(!_callerArgs.Equals(default(ArgIterator)) && !_calleeArgs.Equals(default(ArgIterator)));

            _callerArgs.GetNextOffset();     // Skip thisPtr

            {
                int ofsCaller = _callerArgs.GetNextOffset();     // methodToCall
                Debug.Assert(TransitionBlock.InvalidOffset != ofsCaller);

                void **pSrc = (void **)(_callerTransitionBlock + ofsCaller);

                IntPtr functionPointer = new IntPtr(*pSrc);

                bool forceCalleeHasParamType = UpdateCalleeFunctionPointer(functionPointer);
                _calleeArgs.SetHasParamTypeAndReset(forceCalleeHasParamType);
            }

            _callerArgs.GetNextOffset();     // Skip argSetupState

            // targetIsThisCall
            {
                int ofsCaller = _callerArgs.GetNextOffset();     // targetIsThisCall
                Debug.Assert(TransitionBlock.InvalidOffset != ofsCaller);

                bool *pSrc = (bool *)(_callerTransitionBlock + ofsCaller);

                bool targetIsThisCall = *pSrc;

                _calleeArgs.SetHasThisAndReset(targetIsThisCall);
            }

            _callerArgs.Reset();
        }