zoukankan      html  css  js  c++  java
  • MSIL详解

    When compiling to managed code, the compiler translates your source code into Microsoft intermediate language (MSIL), which is a CPU-independent set of instructions that can be efficiently converted to native code. MSIL includes instructions for loading, storing, initializing, and calling methods on objects, as well as instructions for arithmetic and logical operations, control flow, direct memory access, exception handling, and other operations. Before code can be run, MSIL must be converted to CPU-specific code, usually by a just-in-time (JIT) compiler. Because the common language runtime supplies one or more JIT compilers for each computer architecture it supports, the same set of MSIL can be JIT-compiled and run on any supported architecture.

    When a compiler produces MSIL, it also produces metadata. Metadata describes the types in your code, including the definition of each type, the signatures of each type's members, the members that your code references, and other data that the runtime uses at execution time. The MSIL and metadata are contained in a portable executable (PE) file that is based on and extends the published Microsoft PE and common object file format (COFF) used historically for executable content. This file format, which accommodates MSIL or native code as well as metadata, enables the operating system to recognize common language runtime images. The presence of metadata in the file along with the MSIL enables your code to describe itself, which means that there is no need for type libraries or Interface Definition Language (IDL). The runtime locates and extracts the metadata from the file as needed during execution.

      MSIL的DLL内自包含类型文件,所以不需要像C++定义的DLL那样需要h头文件以描述类型以及lib来描述DLL,在C#里,只需要提供提供一个DLL,简单、清晰、干净。

  • 相关阅读:
    长沙市资讯新闻汇总
    PC端页面同比例缩放
    操作系统之进程
    开发中遇到的一些mongoose的问题
    支持字母数字下划线和中文的正则
    将redis作为windows服务安装
    express中的会话存储方式
    getServletContext()接口解析(收藏)
    在本地计算机无法启动MYSQL服务错误1067进程意外终止
    css浮动中避免包含元素高度为0的4种解决方法
  • 原文地址:https://www.cnblogs.com/tekkaman/p/2405100.html
Copyright © 2011-2022 走看看