pub fn compile(
        config: &ic_config::embedders::Config,
        wasm_src: Vec<u8>,
    ) -> HypervisorResult<Self> {
        let wasm = BinaryEncodedWasm::new(wasm_src);
        let log = ic_logger::replica_logger::no_op_logger();
        // TODO(EXC-756): Cache WasmtimeEmbedder instance.
        let embedder = Arc::new(WasmtimeEmbedder::new(config.clone(), log));
        let instrumentation_output = validate_wasm_binary(&wasm, config)
            .map_err(HypervisorError::from)
            .and_then(|_| {
                instrument(&wasm, &InstructionCostTable::new()).map_err(HypervisorError::from)
            })?;
        let compilate =
            embedder.compile(PersistenceType::Sigsegv, &instrumentation_output.binary)?;
        let compilate = Arc::new(compilate);

        Ok(Self {
            embedder,
            compilate,
        })
    }
/// Validates and compiles the given Wasm binary.
Validates and compiles the given Wasm binary.
Validates and compiles the given Wasm binary .
pub fn compile(
        config: &ic_config::embedders::Config,
        wasm_src: Vec<u8>,
    ) -> HypervisorResult<Self> {
        let wasm = BinaryEncodedWasm::new(wasm_src);
        let log = ic_logger::replica_logger::no_op_logger();
        // TODO(EXC-756): Cache WasmtimeEmbedder instance.
        let embedder = Arc::new(WasmtimeEmbedder::new(config.clone(), log));
        let instrumentation_output = validate_wasm_binary(&wasm, config)
            .map_err(HypervisorError::from)
            .and_then(|_| {
                instrument(&wasm, &InstructionCostTable::new()).map_err(HypervisorError::from)
            })?;
        let compilate =
            embedder.compile(PersistenceType::Sigsegv, &instrumentation_output.binary)?;
        let compilate = Arc::new(compilate);
        Ok(Self {
            embedder,
            compilate,
        })
    }
pub fn compile ( config : & ic_config :: embedders :: Config , wasm_src : Vec < u8 > , ) -> HypervisorResult < Self > { let wasm = BinaryEncodedWasm :: new ( wasm_src ) ; let log = ic_logger :: replica_logger :: no_op_logger ( ) ; // TODO(EXC-756): Cache WasmtimeEmbedder instance. let embedder = Arc :: new ( WasmtimeEmbedder :: new ( config . clone ( ) , log ) ) ; let instrumentation_output = validate_wasm_binary ( & wasm , config ) . map_err ( HypervisorError :: from ) . and_then ( | _ | { instrument ( & wasm , & InstructionCostTable :: new ( ) ) . map_err ( HypervisorError :: from ) } ) ? ; let compilate = embedder . compile ( PersistenceType :: Sigsegv , & instrumentation_output . binary ) ? ; let compilate = Arc :: new ( compilate ) ; Ok ( Self { embedder , compilate , } ) }
Validates and compiles the given Wasm binary.
Validates and compiles the given Wasm binary .
config
&ic_config::embedders::Config
wasm_src
Vec<u8>
config
&ic_config::embedders::Config
wasm_src
Vec<u8>