MCPcopy Create free account
hub / github.com/WasmEdge/WasmEdge / load

Method load

lib/llvm/jit.cpp:66–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64}
65
66Expect<std::shared_ptr<Executable>> JIT::load(Data D) noexcept {
67 OrcLLJIT J;
68 if (auto Res = OrcLLJIT::create(); !Res) {
69 spdlog::error("{}"sv, Res.error().message().string_view());
70 return Unexpect(ErrCode::Value::HostFuncError);
71 } else {
72 J = std::move(*Res);
73 }
74
75 auto &LLModule = D.extract().LLModule;
76 auto TSContext = D.extract().getTSContext();
77
78 if (Conf.getCompilerConfigure().isDumpIR()) {
79 if (auto ErrorMessage = LLModule.printModuleToFile("wasm-jit.ll")) {
80 spdlog::error("printModuleToFile failed"sv);
81 }
82 }
83
84 auto MainJD = J.getMainJITDylib();
85 if (auto Err = J.addLLVMIRModule(
86 MainJD, OrcThreadSafeModule(LLModule.release(), TSContext))) {
87 spdlog::error("{}"sv, Err.message().string_view());
88 return Unexpect(ErrCode::Value::HostFuncError);
89 }
90
91 return std::make_shared<JITLibrary>(std::move(J));
92}
93} // namespace WasmEdge::LLVM

Callers 15

atomicNotifyAllMethod · 0.45
unsafeInstantiateMethod · 0.45
runMethod · 0.45
fromPretrainedMethod · 0.45
fromPretrainedMethod · 0.45
CompilerConfigureMethod · 0.45
getOptimizationLevelMethod · 0.45
getOutputFormatMethod · 0.45
isDumpIRMethod · 0.45
isGenericBinaryMethod · 0.45
isInterruptibleMethod · 0.45
RuntimeConfigureMethod · 0.45

Calls 12

UnexpectFunction · 0.85
OrcThreadSafeModuleClass · 0.85
getTSContextMethod · 0.80
isDumpIRMethod · 0.80
printModuleToFileMethod · 0.80
getMainJITDylibMethod · 0.80
addLLVMIRModuleMethod · 0.80
createFunction · 0.50
errorFunction · 0.50
string_viewMethod · 0.45
messageMethod · 0.45
releaseMethod · 0.45

Tested by 1

runMethod · 0.36