Exemple #1
0
        private void allocUnwindInfo(IntPtr _this, byte* pHotCode, byte* pColdCode, uint startOffset, uint endOffset, uint unwindSize, byte* pUnwindBlock, CorJitFuncKind funcKind)
        {
            FrameInfo frameInfo = new FrameInfo();
            frameInfo.StartOffset = (int)startOffset;
            frameInfo.EndOffset = (int)endOffset;
            frameInfo.BlobData = new byte[unwindSize];
            for (uint i = 0; i < unwindSize; i++)
            {
                frameInfo.BlobData[i] = pUnwindBlock[i];
            }

            Debug.Assert(_usedFrameInfos < _frameInfos.Length);
            _frameInfos[_usedFrameInfos++] = frameInfo;
        }
Exemple #2
0
        private void allocUnwindInfo(byte* pHotCode, byte* pColdCode, uint startOffset, uint endOffset, uint unwindSize, byte* pUnwindBlock, CorJitFuncKind funcKind)
        {
            // The unwind info blob are followed by byte that identifies the type of the funclet
            // and other optional data that follows
            const int extraBlobData = 1;

            byte[] blobData = new byte[unwindSize + extraBlobData];

            for (uint i = 0; i < unwindSize; i++)
            {
                blobData[i] = pUnwindBlock[i];
            }

            // Capture the type of the funclet in unwind info blob
            blobData[unwindSize] = (byte)funcKind;
            _frameInfos[_usedFrameInfos++] = new FrameInfo((int)startOffset, (int)endOffset, blobData);
        }
Exemple #3
0
 static void _allocUnwindInfo(IntPtr thisHandle, IntPtr* ppException, byte* pHotCode, byte* pColdCode, uint startOffset, uint endOffset, uint unwindSize, byte* pUnwindBlock, CorJitFuncKind funcKind)
 {
     var _this = GetThis(thisHandle);
     try
     {
         _this.allocUnwindInfo(pHotCode, pColdCode, startOffset, endOffset, unwindSize, pUnwindBlock, funcKind);
     }
     catch (Exception ex)
     {
         *ppException = _this.AllocException(ex);
     }
 }
Exemple #4
0
 public virtual void allocUnwindInfo_wrapper(IntPtr _this, out IntPtr exception, byte* pHotCode, byte* pColdCode, uint startOffset, uint endOffset, uint unwindSize, byte* pUnwindBlock, CorJitFuncKind funcKind)
 {
     exception = IntPtr.Zero;
     try
     {
         allocUnwindInfo(pHotCode, pColdCode, startOffset, endOffset, unwindSize, pUnwindBlock, funcKind);
         return;
     }
     catch (Exception ex)
     {
         exception = AllocException(ex);
     }
 }
Exemple #5
0
        private void allocUnwindInfo(byte* pHotCode, byte* pColdCode, uint startOffset, uint endOffset, uint unwindSize, byte* pUnwindBlock, CorJitFuncKind funcKind)
        {
            Debug.Assert(FrameInfoFlags.Filter == (FrameInfoFlags)CorJitFuncKind.CORJIT_FUNC_FILTER);
            Debug.Assert(FrameInfoFlags.Handler == (FrameInfoFlags)CorJitFuncKind.CORJIT_FUNC_HANDLER);

            FrameInfoFlags flags = (FrameInfoFlags)funcKind;

            if (funcKind == CorJitFuncKind.CORJIT_FUNC_ROOT)
            {
                if (this.MethodBeingCompiled.IsNativeCallable)
                    flags |= FrameInfoFlags.ReversePInvoke;
            }

            byte[] blobData = new byte[unwindSize];

            for (uint i = 0; i < unwindSize; i++)
            {
                blobData[i] = pUnwindBlock[i];
            }

            _frameInfos[_usedFrameInfos++] = new FrameInfo(flags, (int)startOffset, (int)endOffset, blobData);
        }