public override ICompilation ToCompilation()
        {
            var interopStubManager = new CompilerGeneratedInteropStubManager(_compilationGroup, _context, new InteropStateManager(_context.GeneratedAssembly));
            WebAssemblyCodegenNodeFactory        factory = new WebAssemblyCodegenNodeFactory(_context, _compilationGroup, _metadataManager, interopStubManager, _nameMangler, _vtableSliceProvider, _dictionaryLayoutProvider);
            DependencyAnalyzerBase <NodeFactory> graph   = CreateDependencyGraph(factory, new ObjectNode.ObjectNodeComparer(new CompilerComparer()));

            return(new WebAssemblyCodegenCompilation(graph, factory, _compilationRoots, _logger, _config));
        }
Ejemplo n.º 2
0
        public override ICompilation ToCompilation()
        {
            var interopStubManager        = new CompilerGeneratedInteropStubManager(_compilationGroup, _context, new InteropStateManager(_context.GeneratedAssembly));
            CppCodegenNodeFactory factory = new CppCodegenNodeFactory(_context, _compilationGroup, _metadataManager, interopStubManager, _nameMangler, _vtableSliceProvider, _dictionaryLayoutProvider);
            DependencyAnalyzerBase <NodeFactory> graph = CreateDependencyGraph(factory);

            return(new CppCodegenCompilation(graph, factory, _compilationRoots, _ilProvider, _debugInformationProvider, _pinvokePolicy, _logger, _config));
        }
Ejemplo n.º 3
0
        public IILScanner ToILScanner()
        {
            var interopStubManager = new CompilerGeneratedInteropStubManager(_compilationGroup, _context, new InteropStateManager(_context.GeneratedAssembly));
            var nodeFactory        = new ILScanNodeFactory(_context, _compilationGroup, _metadataManager, interopStubManager, _nameMangler);
            DependencyAnalyzerBase <NodeFactory> graph = _dependencyTrackingLevel.CreateDependencyGraph(nodeFactory);

            return(new ILScanner(graph, nodeFactory, _compilationRoots, _ilProvider, new NullDebugInformationProvider(), _logger));
        }
Ejemplo n.º 4
0
        public IILScanner ToILScanner()
        {
            // TODO: we will want different metadata managers depending on whether we're doing reflection analysis
            var metadataManager    = new CompilerGeneratedMetadataManager(_compilationGroup, _context, null);
            var interopStubManager = new CompilerGeneratedInteropStubManager(_compilationGroup, _context, new InteropStateManager(_compilationGroup.GeneratedAssembly));
            var nodeFactory        = new ILScanNodeFactory(_context, _compilationGroup, metadataManager, interopStubManager, _nameMangler);
            DependencyAnalyzerBase <NodeFactory> graph = _dependencyTrackingLevel.CreateDependencyGraph(nodeFactory);

            return(new ILScanner(graph, nodeFactory, _compilationRoots, new NullDebugInformationProvider(), _logger));
        }
Ejemplo n.º 5
0
        public override ICompilation ToCompilation()
        {
            ArrayBuilder <CorJitFlag> jitFlagBuilder = new ArrayBuilder <CorJitFlag>();

            switch (_optimizationMode)
            {
            case OptimizationMode.None:
                jitFlagBuilder.Add(CorJitFlag.CORJIT_FLAG_DEBUG_CODE);
                break;

            case OptimizationMode.PreferSize:
                jitFlagBuilder.Add(CorJitFlag.CORJIT_FLAG_SIZE_OPT);
                break;

            case OptimizationMode.PreferSpeed:
                jitFlagBuilder.Add(CorJitFlag.CORJIT_FLAG_SPEED_OPT);
                break;

            default:
                // Not setting a flag results in BLENDED_CODE.
                break;
            }

            // Do not bother with debug information if the debug info provider never gives anything.
            if (!(_debugInformationProvider is NullDebugInformationProvider))
            {
                jitFlagBuilder.Add(CorJitFlag.CORJIT_FLAG_DEBUG_INFO);
            }

            if (_context.Target.MaximumSimdVectorLength != SimdVectorLength.None)
            {
                // TODO: AVX
                Debug.Assert(_context.Target.MaximumSimdVectorLength == SimdVectorLength.Vector128Bit);
                jitFlagBuilder.Add(CorJitFlag.CORJIT_FLAG_FEATURE_SIMD);
            }

            RyuJitCompilationOptions options = 0;

            if (_methodBodyFolding)
            {
                options |= RyuJitCompilationOptions.MethodBodyFolding;
            }

            var interopStubManager = new CompilerGeneratedInteropStubManager(_compilationGroup, _context, new InteropStateManager(_context.GeneratedAssembly));
            var factory            = new RyuJitNodeFactory(_context, _compilationGroup, _metadataManager, interopStubManager, _nameMangler, _vtableSliceProvider, _dictionaryLayoutProvider);

            var jitConfig = new JitConfigProvider(jitFlagBuilder.ToArray(), _ryujitOptions);
            DependencyAnalyzerBase <NodeFactory> graph = CreateDependencyGraph(factory, new ObjectNode.ObjectNodeComparer(new CompilerComparer()));

            return(new RyuJitCompilation(graph, factory, _compilationRoots, _ilProvider, _debugInformationProvider, _pinvokePolicy, _logger, _devirtualizationManager, jitConfig, options));
        }
Ejemplo n.º 6
0
        public override ICompilation ToCompilation()
        {
            ArrayBuilder <CorJitFlag> jitFlagBuilder = new ArrayBuilder <CorJitFlag>();

            switch (_optimizationMode)
            {
            case OptimizationMode.None:
                jitFlagBuilder.Add(CorJitFlag.CORJIT_FLAG_DEBUG_CODE);
                break;

            case OptimizationMode.PreferSize:
                jitFlagBuilder.Add(CorJitFlag.CORJIT_FLAG_SIZE_OPT);
                break;

            case OptimizationMode.PreferSpeed:
                jitFlagBuilder.Add(CorJitFlag.CORJIT_FLAG_SPEED_OPT);
                break;

            default:
                // Not setting a flag results in BLENDED_CODE.
                break;
            }

            if (_generateDebugInfo)
            {
                jitFlagBuilder.Add(CorJitFlag.CORJIT_FLAG_DEBUG_INFO);
            }

            if (_context.Target.MaximumSimdVectorLength != SimdVectorLength.None)
            {
                // TODO: AVX
                Debug.Assert(_context.Target.MaximumSimdVectorLength == SimdVectorLength.Vector128Bit);
                jitFlagBuilder.Add(CorJitFlag.CORJIT_FLAG_FEATURE_SIMD);
            }

            var interopStubManager = new CompilerGeneratedInteropStubManager(_compilationGroup, _context, new InteropStateManager(_compilationGroup.GeneratedAssembly));
            var factory            = new RyuJitNodeFactory(_context, _compilationGroup, _metadataManager, interopStubManager, _nameMangler, _vtableSliceProvider, _dictionaryLayoutProvider);

            var jitConfig = new JitConfigProvider(jitFlagBuilder.ToArray(), _ryujitOptions);
            DependencyAnalyzerBase <NodeFactory> graph = CreateDependencyGraph(factory);

            return(new RyuJitCompilation(graph, factory, _compilationRoots, _logger, jitConfig));
        }