• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            CLR系列--探索SSCLI【1】

            Fusion is one of the most importants features among ones in the runtime implementation of CLI.

            In the fusion, or any other components or modules, how to retrieve the execution engine instance and how to generate such engine?

            UtilExecutionEngine, implemented as COM object, support Queryinterface/AddRef/Release, and exposed via interface IExecutionEngine.

            With SELF_NO_HOST defined,
            BYTE g_ExecutionEngineInstance[sizeof(UtilExecutionEngine)];
            g_ExecutionEngineInstance would be the singleton instance of current execution engine,

            otherwise, without SELF_NO_HOST, the 'sscoree' dll would be loaded and try to get the exported function, which is named 'IEE' from such dll. Here, it is the well-known shim, in .net CLR, such module is named 'mscoree'. Further, if 'IEE' could not be found in such dll, system would try to locate another exported function, named 'LoadLibraryShim', and use such function to load the 'mscorwks' module, and try to locate the 'IEE' exportd functionin it.

            It's very obvious that Rotor has implemented its own execution engine, but it also gives or make space for implementation of execution engine from 3rd party. Here, .net CLR is a good candidate definitely, Rotor might load the mscorwks.dll module for its usage.

            PAL, PALAPI, for example, HeapAlloc, one famous WIN32 API, has been implemented as one PALAPI (defined in Heap.c), to make it possible that the CLI/Rotor be ported smoothly to other OS, such freebsd/mac os.

            CRT routines are also reimplemented, such as memcpy, it has been implemented as GCSafeMemCpy

            There're many macros in fuctions, such as SCAN_IGNORE_FAULT/STATIC_CONTRACT_NOTHROW/STATIC_CONTRACT_NOTRIGGER, they are for static analysis tool to scan, analyse and figour out the potential issues in code.

            From view point of the execution model by CLI, the act of compiling (including JIT) high-level type descriptions would be separated from the act of turning these type descriptions into processor-specific code and memory structures.

            And such executino model, in other word, the well-known 'managed execution', would defer the loading, verification and compilation of components until runtime really needs; At the same time, the type-loading is the key trigger that causes CLI's tool chain to be engaged at runtime. Deferred compilation(lead to JIT)/linking/loading would get better portability to different target platform and be ready for version change; The whole deferred process would driven by well-defined metadata and policy, and it would be very robust for building a virtual execution environment;

            At the top of such CLI tool chain, fusion is reponsible for not only finding and binding related assemblies, which are via assembly reference defined in assembly, fusion also takes another important role, loader, and its part of functionality is implemented in PEAssembly, ClassLoader classes. For example, ClassLoader::LoadTypeHandleForTypeKey.

            For types in virtual execution environment of CLI, rotor defines four kinds of elements for internal conducting,
            ELEMENT_TYPE_CLASS for ordinary classes and generic instantiations(including value types);
            ELEMENT_TYPE_ARRAY AND ELEMENT_TYPE_SZARRAY for array types
            ELEMENT_TYPE_PRT and ELEMENT_TYPE_BYREF for pointer types
            ELEMENT_TYPE_FNPTR for function pointer types

            every type would be assigned unique ulong-typed token, and such token would be used to look up in m_TypeDefToMethodTableMap (Linear mapping from TypeDef token to MethodTable *)which is maintained by current module; If there it is, the pointer to method table of such type would be retrieved, or it would look up in the loader module, where the method table should exist in while it's JIT loaded, not launched from NGEN image;

            And all the unresolved typed would be maintained in a hash table, PendingTypeLoadTable; Types and only those types that are needed, such as dependencies, including parent types, are loaded in runtime, such type is fully loaded and ready for further execution, and other unresolved types would be kept in the previous hash table.

            posted on 2010-12-13 09:02 flagman 閱讀(1649) 評(píng)論(0)  編輯 收藏 引用 所屬分類: 設(shè)計(jì) DesignC++.net/CLRC#

            <2025年6月>
            25262728293031
            1234567
            891011121314
            15161718192021
            22232425262728
            293012345

            導(dǎo)航

            統(tǒng)計(jì)

            常用鏈接

            留言簿(1)

            隨筆分類

            隨筆檔案

            搜索

            最新評(píng)論

            閱讀排行榜

            評(píng)論排行榜

            久久香蕉国产线看观看99| 久久国产精品偷99| 久久综合国产乱子伦精品免费| 久久人人妻人人爽人人爽| 国产99久久精品一区二区| 精品乱码久久久久久夜夜嗨| 久久久久亚洲精品日久生情| 国产精品18久久久久久vr| 久久青青草原亚洲av无码 | 99久久免费国产精品热| 久久精品亚洲欧美日韩久久| 亚洲国产精品无码久久SM| 久久久久国产视频电影| 久久亚洲精精品中文字幕| 少妇被又大又粗又爽毛片久久黑人| 男女久久久国产一区二区三区| 久久九九久精品国产| 久久精品国产亚洲麻豆| 一本色道久久综合亚洲精品| 久久久久一级精品亚洲国产成人综合AV区| 久久亚洲AV成人无码软件| 久久夜色撩人精品国产| 999久久久无码国产精品| 中文字幕人妻色偷偷久久 | 人妻无码αv中文字幕久久琪琪布| 久久精品国产精品亜洲毛片| 国产精品一久久香蕉产线看| 亚洲国产精品高清久久久| 久久国产亚洲精品| 亚洲Av无码国产情品久久| 久久天天躁狠狠躁夜夜不卡| 99久久免费只有精品国产| a高清免费毛片久久| 国产午夜精品理论片久久影视| 色偷偷久久一区二区三区| 无码国内精品久久人妻| 一本一本久久A久久综合精品| 国产成人精品综合久久久| 亚洲AV日韩AV永久无码久久| 国产精品99久久久精品无码| 97久久婷婷五月综合色d啪蜜芽 |