示例#1
0
        public LLVMTypeResolver(JITContext context)
        {
            Context = context;

            _mapping = new Dictionary <string, Func <LLVMTypeRef> >
            {
                { TypeReferenceName.Boolean, LLVM.Int8Type },
                { TypeReferenceName.SByte, LLVM.Int8Type },
                { TypeReferenceName.Int8, LLVM.Int8Type },
                { TypeReferenceName.Int16, LLVM.Int16Type },
                { TypeReferenceName.Int32, LLVM.Int32Type },
                { TypeReferenceName.Int64, LLVM.Int64Type },
                { TypeReferenceName.Byte, LLVM.Int8Type },
                { TypeReferenceName.UInt8, LLVM.Int8Type },
                { TypeReferenceName.UInt16, LLVM.Int16Type },
                { TypeReferenceName.UInt32, LLVM.Int32Type },
                { TypeReferenceName.UInt64, LLVM.Int64Type },
                { TypeReferenceName.Float, LLVM.FloatType },
                { TypeReferenceName.Double, LLVM.DoubleType },
                //TODO, on second thought... let's forget about .Net Decimal
                { TypeReferenceName.Decimal, LLVM.FP128Type },
                { TypeReferenceName.Char, LLVM.Int8Type }
            };
        }
示例#2
0
        public PearlCLR(string file, string target = null)
        {
            assembly = AssemblyDefinition.ReadAssembly(file);
            LLVM.InitializeX86TargetMC();
            LLVM.InitializeX86Target();
            LLVM.InitializeX86TargetInfo();
            LLVM.InitializeX86AsmParser();
            LLVM.InitializeX86AsmPrinter();

            _context = new JITContext
            {
                CLR       = this,
                ModuleRef = LLVM.ModuleCreateWithName("PearlCLRModule"),
                CLRLogger = LogManager.GetCurrentClassLogger()
            };
            _context.ContextRef   = LLVM.GetModuleContext(_context.ModuleRef);
            _context.TypeResolver = new LLVMTypeResolver(_context);
            _options = new JITCompilerOptions
            {
                MetadataFixedLength            = 32, CLRStringMode = StringMode.CString,
                MetadataTypeHandlingModeOption = MetadataTypeHandlingMode.Full_Fixed
            };
            _context.Options = _options;
        }
示例#3
0
 protected OpcodeHandlerModule(JITContext context)
 {
     Context = context;
 }
示例#4
0
 public LocalVariableOpcodeModule(JITContext context) : base(context)
 {
 }
 public ComparsionOpcodeModule(JITContext context) : base(context)
 {
 }
示例#6
0
 public ConstantOpcodeModule(JITContext context) : base(context)
 {
 }
 public ArithmeticOpcodeModule(JITContext context) : base(context)
 {
 }
示例#8
0
 public ParameterOpcodeModule(JITContext context) : base(context)
 {
 }
示例#9
0
 public MetaOpcodeModule(JITContext context) : base(context)
 {
 }