Path: blob/main/contrib/llvm-project/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp
35266 views
//===-- MCJIT.cpp - MC-based Just-in-Time Compiler ------------------------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#include "MCJIT.h"9#include "llvm/ADT/STLExtras.h"10#include "llvm/ExecutionEngine/GenericValue.h"11#include "llvm/ExecutionEngine/JITEventListener.h"12#include "llvm/ExecutionEngine/MCJIT.h"13#include "llvm/ExecutionEngine/ObjectCache.h"14#include "llvm/ExecutionEngine/SectionMemoryManager.h"15#include "llvm/IR/DataLayout.h"16#include "llvm/IR/DerivedTypes.h"17#include "llvm/IR/Function.h"18#include "llvm/IR/LegacyPassManager.h"19#include "llvm/IR/Mangler.h"20#include "llvm/IR/Module.h"21#include "llvm/MC/MCContext.h"22#include "llvm/Object/Archive.h"23#include "llvm/Object/ObjectFile.h"24#include "llvm/Support/DynamicLibrary.h"25#include "llvm/Support/ErrorHandling.h"26#include "llvm/Support/MemoryBuffer.h"27#include "llvm/Support/SmallVectorMemoryBuffer.h"28#include <mutex>2930using namespace llvm;3132namespace {3334static struct RegisterJIT {35RegisterJIT() { MCJIT::Register(); }36} JITRegistrator;3738}3940extern "C" void LLVMLinkInMCJIT() {41}4243ExecutionEngine *44MCJIT::createJIT(std::unique_ptr<Module> M, std::string *ErrorStr,45std::shared_ptr<MCJITMemoryManager> MemMgr,46std::shared_ptr<LegacyJITSymbolResolver> Resolver,47std::unique_ptr<TargetMachine> TM) {48// Try to register the program as a source of symbols to resolve against.49//50// FIXME: Don't do this here.51sys::DynamicLibrary::LoadLibraryPermanently(nullptr, nullptr);5253if (!MemMgr || !Resolver) {54auto RTDyldMM = std::make_shared<SectionMemoryManager>();55if (!MemMgr)56MemMgr = RTDyldMM;57if (!Resolver)58Resolver = RTDyldMM;59}6061return new MCJIT(std::move(M), std::move(TM), std::move(MemMgr),62std::move(Resolver));63}6465MCJIT::MCJIT(std::unique_ptr<Module> M, std::unique_ptr<TargetMachine> TM,66std::shared_ptr<MCJITMemoryManager> MemMgr,67std::shared_ptr<LegacyJITSymbolResolver> Resolver)68: ExecutionEngine(TM->createDataLayout(), std::move(M)), TM(std::move(TM)),69Ctx(nullptr), MemMgr(std::move(MemMgr)),70Resolver(*this, std::move(Resolver)), Dyld(*this->MemMgr, this->Resolver),71ObjCache(nullptr) {72// FIXME: We are managing our modules, so we do not want the base class73// ExecutionEngine to manage them as well. To avoid double destruction74// of the first (and only) module added in ExecutionEngine constructor75// we remove it from EE and will destruct it ourselves.76//77// It may make sense to move our module manager (based on SmallStPtr) back78// into EE if the JIT and Interpreter can live with it.79// If so, additional functions: addModule, removeModule, FindFunctionNamed,80// runStaticConstructorsDestructors could be moved back to EE as well.81//82std::unique_ptr<Module> First = std::move(Modules[0]);83Modules.clear();8485if (First->getDataLayout().isDefault())86First->setDataLayout(getDataLayout());8788OwnedModules.addModule(std::move(First));89RegisterJITEventListener(JITEventListener::createGDBRegistrationListener());90}9192MCJIT::~MCJIT() {93std::lock_guard<sys::Mutex> locked(lock);9495Dyld.deregisterEHFrames();9697for (auto &Obj : LoadedObjects)98if (Obj)99notifyFreeingObject(*Obj);100101Archives.clear();102}103104void MCJIT::addModule(std::unique_ptr<Module> M) {105std::lock_guard<sys::Mutex> locked(lock);106107if (M->getDataLayout().isDefault())108M->setDataLayout(getDataLayout());109110OwnedModules.addModule(std::move(M));111}112113bool MCJIT::removeModule(Module *M) {114std::lock_guard<sys::Mutex> locked(lock);115return OwnedModules.removeModule(M);116}117118void MCJIT::addObjectFile(std::unique_ptr<object::ObjectFile> Obj) {119std::unique_ptr<RuntimeDyld::LoadedObjectInfo> L = Dyld.loadObject(*Obj);120if (Dyld.hasError())121report_fatal_error(Dyld.getErrorString());122123notifyObjectLoaded(*Obj, *L);124125LoadedObjects.push_back(std::move(Obj));126}127128void MCJIT::addObjectFile(object::OwningBinary<object::ObjectFile> Obj) {129std::unique_ptr<object::ObjectFile> ObjFile;130std::unique_ptr<MemoryBuffer> MemBuf;131std::tie(ObjFile, MemBuf) = Obj.takeBinary();132addObjectFile(std::move(ObjFile));133Buffers.push_back(std::move(MemBuf));134}135136void MCJIT::addArchive(object::OwningBinary<object::Archive> A) {137Archives.push_back(std::move(A));138}139140void MCJIT::setObjectCache(ObjectCache* NewCache) {141std::lock_guard<sys::Mutex> locked(lock);142ObjCache = NewCache;143}144145std::unique_ptr<MemoryBuffer> MCJIT::emitObject(Module *M) {146assert(M && "Can not emit a null module");147148std::lock_guard<sys::Mutex> locked(lock);149150// Materialize all globals in the module if they have not been151// materialized already.152cantFail(M->materializeAll());153154// This must be a module which has already been added but not loaded to this155// MCJIT instance, since these conditions are tested by our caller,156// generateCodeForModule.157158legacy::PassManager PM;159160// The RuntimeDyld will take ownership of this shortly161SmallVector<char, 4096> ObjBufferSV;162raw_svector_ostream ObjStream(ObjBufferSV);163164// Turn the machine code intermediate representation into bytes in memory165// that may be executed.166if (TM->addPassesToEmitMC(PM, Ctx, ObjStream, !getVerifyModules()))167report_fatal_error("Target does not support MC emission!");168169// Initialize passes.170PM.run(*M);171// Flush the output buffer to get the generated code into memory172173auto CompiledObjBuffer = std::make_unique<SmallVectorMemoryBuffer>(174std::move(ObjBufferSV), /*RequiresNullTerminator=*/false);175176// If we have an object cache, tell it about the new object.177// Note that we're using the compiled image, not the loaded image (as below).178if (ObjCache) {179// MemoryBuffer is a thin wrapper around the actual memory, so it's OK180// to create a temporary object here and delete it after the call.181MemoryBufferRef MB = CompiledObjBuffer->getMemBufferRef();182ObjCache->notifyObjectCompiled(M, MB);183}184185return CompiledObjBuffer;186}187188void MCJIT::generateCodeForModule(Module *M) {189// Get a thread lock to make sure we aren't trying to load multiple times190std::lock_guard<sys::Mutex> locked(lock);191192// This must be a module which has already been added to this MCJIT instance.193assert(OwnedModules.ownsModule(M) &&194"MCJIT::generateCodeForModule: Unknown module.");195196// Re-compilation is not supported197if (OwnedModules.hasModuleBeenLoaded(M))198return;199200std::unique_ptr<MemoryBuffer> ObjectToLoad;201// Try to load the pre-compiled object from cache if possible202if (ObjCache)203ObjectToLoad = ObjCache->getObject(M);204205assert(M->getDataLayout() == getDataLayout() && "DataLayout Mismatch");206207// If the cache did not contain a suitable object, compile the object208if (!ObjectToLoad) {209ObjectToLoad = emitObject(M);210assert(ObjectToLoad && "Compilation did not produce an object.");211}212213// Load the object into the dynamic linker.214// MCJIT now owns the ObjectImage pointer (via its LoadedObjects list).215Expected<std::unique_ptr<object::ObjectFile>> LoadedObject =216object::ObjectFile::createObjectFile(ObjectToLoad->getMemBufferRef());217if (!LoadedObject) {218std::string Buf;219raw_string_ostream OS(Buf);220logAllUnhandledErrors(LoadedObject.takeError(), OS);221report_fatal_error(Twine(OS.str()));222}223std::unique_ptr<RuntimeDyld::LoadedObjectInfo> L =224Dyld.loadObject(*LoadedObject.get());225226if (Dyld.hasError())227report_fatal_error(Dyld.getErrorString());228229notifyObjectLoaded(*LoadedObject.get(), *L);230231Buffers.push_back(std::move(ObjectToLoad));232LoadedObjects.push_back(std::move(*LoadedObject));233234OwnedModules.markModuleAsLoaded(M);235}236237void MCJIT::finalizeLoadedModules() {238std::lock_guard<sys::Mutex> locked(lock);239240// Resolve any outstanding relocations.241Dyld.resolveRelocations();242243// Check for Dyld error.244if (Dyld.hasError())245ErrMsg = Dyld.getErrorString().str();246247OwnedModules.markAllLoadedModulesAsFinalized();248249// Register EH frame data for any module we own which has been loaded250Dyld.registerEHFrames();251252// Set page permissions.253MemMgr->finalizeMemory();254}255256// FIXME: Rename this.257void MCJIT::finalizeObject() {258std::lock_guard<sys::Mutex> locked(lock);259260// Generate code for module is going to move objects out of the 'added' list,261// so we need to copy that out before using it:262SmallVector<Module*, 16> ModsToAdd;263for (auto *M : OwnedModules.added())264ModsToAdd.push_back(M);265266for (auto *M : ModsToAdd)267generateCodeForModule(M);268269finalizeLoadedModules();270}271272void MCJIT::finalizeModule(Module *M) {273std::lock_guard<sys::Mutex> locked(lock);274275// This must be a module which has already been added to this MCJIT instance.276assert(OwnedModules.ownsModule(M) && "MCJIT::finalizeModule: Unknown module.");277278// If the module hasn't been compiled, just do that.279if (!OwnedModules.hasModuleBeenLoaded(M))280generateCodeForModule(M);281282finalizeLoadedModules();283}284285JITSymbol MCJIT::findExistingSymbol(const std::string &Name) {286if (void *Addr = getPointerToGlobalIfAvailable(Name))287return JITSymbol(static_cast<uint64_t>(288reinterpret_cast<uintptr_t>(Addr)),289JITSymbolFlags::Exported);290291return Dyld.getSymbol(Name);292}293294Module *MCJIT::findModuleForSymbol(const std::string &Name,295bool CheckFunctionsOnly) {296StringRef DemangledName = Name;297if (DemangledName[0] == getDataLayout().getGlobalPrefix())298DemangledName = DemangledName.substr(1);299300std::lock_guard<sys::Mutex> locked(lock);301302// If it hasn't already been generated, see if it's in one of our modules.303for (ModulePtrSet::iterator I = OwnedModules.begin_added(),304E = OwnedModules.end_added();305I != E; ++I) {306Module *M = *I;307Function *F = M->getFunction(DemangledName);308if (F && !F->isDeclaration())309return M;310if (!CheckFunctionsOnly) {311GlobalVariable *G = M->getGlobalVariable(DemangledName);312if (G && !G->isDeclaration())313return M;314// FIXME: Do we need to worry about global aliases?315}316}317// We didn't find the symbol in any of our modules.318return nullptr;319}320321uint64_t MCJIT::getSymbolAddress(const std::string &Name,322bool CheckFunctionsOnly) {323std::string MangledName;324{325raw_string_ostream MangledNameStream(MangledName);326Mangler::getNameWithPrefix(MangledNameStream, Name, getDataLayout());327}328if (auto Sym = findSymbol(MangledName, CheckFunctionsOnly)) {329if (auto AddrOrErr = Sym.getAddress())330return *AddrOrErr;331else332report_fatal_error(AddrOrErr.takeError());333} else if (auto Err = Sym.takeError())334report_fatal_error(Sym.takeError());335return 0;336}337338JITSymbol MCJIT::findSymbol(const std::string &Name,339bool CheckFunctionsOnly) {340std::lock_guard<sys::Mutex> locked(lock);341342// First, check to see if we already have this symbol.343if (auto Sym = findExistingSymbol(Name))344return Sym;345346for (object::OwningBinary<object::Archive> &OB : Archives) {347object::Archive *A = OB.getBinary();348// Look for our symbols in each Archive349auto OptionalChildOrErr = A->findSym(Name);350if (!OptionalChildOrErr)351report_fatal_error(OptionalChildOrErr.takeError());352auto &OptionalChild = *OptionalChildOrErr;353if (OptionalChild) {354// FIXME: Support nested archives?355Expected<std::unique_ptr<object::Binary>> ChildBinOrErr =356OptionalChild->getAsBinary();357if (!ChildBinOrErr) {358// TODO: Actually report errors helpfully.359consumeError(ChildBinOrErr.takeError());360continue;361}362std::unique_ptr<object::Binary> &ChildBin = ChildBinOrErr.get();363if (ChildBin->isObject()) {364std::unique_ptr<object::ObjectFile> OF(365static_cast<object::ObjectFile *>(ChildBin.release()));366// This causes the object file to be loaded.367addObjectFile(std::move(OF));368// The address should be here now.369if (auto Sym = findExistingSymbol(Name))370return Sym;371}372}373}374375// If it hasn't already been generated, see if it's in one of our modules.376Module *M = findModuleForSymbol(Name, CheckFunctionsOnly);377if (M) {378generateCodeForModule(M);379380// Check the RuntimeDyld table again, it should be there now.381return findExistingSymbol(Name);382}383384// If a LazyFunctionCreator is installed, use it to get/create the function.385// FIXME: Should we instead have a LazySymbolCreator callback?386if (LazyFunctionCreator) {387auto Addr = static_cast<uint64_t>(388reinterpret_cast<uintptr_t>(LazyFunctionCreator(Name)));389return JITSymbol(Addr, JITSymbolFlags::Exported);390}391392return nullptr;393}394395uint64_t MCJIT::getGlobalValueAddress(const std::string &Name) {396std::lock_guard<sys::Mutex> locked(lock);397uint64_t Result = getSymbolAddress(Name, false);398if (Result != 0)399finalizeLoadedModules();400return Result;401}402403uint64_t MCJIT::getFunctionAddress(const std::string &Name) {404std::lock_guard<sys::Mutex> locked(lock);405uint64_t Result = getSymbolAddress(Name, true);406if (Result != 0)407finalizeLoadedModules();408return Result;409}410411// Deprecated. Use getFunctionAddress instead.412void *MCJIT::getPointerToFunction(Function *F) {413std::lock_guard<sys::Mutex> locked(lock);414415Mangler Mang;416SmallString<128> Name;417TM->getNameWithPrefix(Name, F, Mang);418419if (F->isDeclaration() || F->hasAvailableExternallyLinkage()) {420bool AbortOnFailure = !F->hasExternalWeakLinkage();421void *Addr = getPointerToNamedFunction(Name, AbortOnFailure);422updateGlobalMapping(F, Addr);423return Addr;424}425426Module *M = F->getParent();427bool HasBeenAddedButNotLoaded = OwnedModules.hasModuleBeenAddedButNotLoaded(M);428429// Make sure the relevant module has been compiled and loaded.430if (HasBeenAddedButNotLoaded)431generateCodeForModule(M);432else if (!OwnedModules.hasModuleBeenLoaded(M)) {433// If this function doesn't belong to one of our modules, we're done.434// FIXME: Asking for the pointer to a function that hasn't been registered,435// and isn't a declaration (which is handled above) should probably436// be an assertion.437return nullptr;438}439440// FIXME: Should the Dyld be retaining module information? Probably not.441//442// This is the accessor for the target address, so make sure to check the443// load address of the symbol, not the local address.444return (void*)Dyld.getSymbol(Name).getAddress();445}446447void MCJIT::runStaticConstructorsDestructorsInModulePtrSet(448bool isDtors, ModulePtrSet::iterator I, ModulePtrSet::iterator E) {449for (; I != E; ++I) {450ExecutionEngine::runStaticConstructorsDestructors(**I, isDtors);451}452}453454void MCJIT::runStaticConstructorsDestructors(bool isDtors) {455// Execute global ctors/dtors for each module in the program.456runStaticConstructorsDestructorsInModulePtrSet(457isDtors, OwnedModules.begin_added(), OwnedModules.end_added());458runStaticConstructorsDestructorsInModulePtrSet(459isDtors, OwnedModules.begin_loaded(), OwnedModules.end_loaded());460runStaticConstructorsDestructorsInModulePtrSet(461isDtors, OwnedModules.begin_finalized(), OwnedModules.end_finalized());462}463464Function *MCJIT::FindFunctionNamedInModulePtrSet(StringRef FnName,465ModulePtrSet::iterator I,466ModulePtrSet::iterator E) {467for (; I != E; ++I) {468Function *F = (*I)->getFunction(FnName);469if (F && !F->isDeclaration())470return F;471}472return nullptr;473}474475GlobalVariable *MCJIT::FindGlobalVariableNamedInModulePtrSet(StringRef Name,476bool AllowInternal,477ModulePtrSet::iterator I,478ModulePtrSet::iterator E) {479for (; I != E; ++I) {480GlobalVariable *GV = (*I)->getGlobalVariable(Name, AllowInternal);481if (GV && !GV->isDeclaration())482return GV;483}484return nullptr;485}486487488Function *MCJIT::FindFunctionNamed(StringRef FnName) {489Function *F = FindFunctionNamedInModulePtrSet(490FnName, OwnedModules.begin_added(), OwnedModules.end_added());491if (!F)492F = FindFunctionNamedInModulePtrSet(FnName, OwnedModules.begin_loaded(),493OwnedModules.end_loaded());494if (!F)495F = FindFunctionNamedInModulePtrSet(FnName, OwnedModules.begin_finalized(),496OwnedModules.end_finalized());497return F;498}499500GlobalVariable *MCJIT::FindGlobalVariableNamed(StringRef Name, bool AllowInternal) {501GlobalVariable *GV = FindGlobalVariableNamedInModulePtrSet(502Name, AllowInternal, OwnedModules.begin_added(), OwnedModules.end_added());503if (!GV)504GV = FindGlobalVariableNamedInModulePtrSet(Name, AllowInternal, OwnedModules.begin_loaded(),505OwnedModules.end_loaded());506if (!GV)507GV = FindGlobalVariableNamedInModulePtrSet(Name, AllowInternal, OwnedModules.begin_finalized(),508OwnedModules.end_finalized());509return GV;510}511512GenericValue MCJIT::runFunction(Function *F, ArrayRef<GenericValue> ArgValues) {513assert(F && "Function *F was null at entry to run()");514515void *FPtr = getPointerToFunction(F);516finalizeModule(F->getParent());517assert(FPtr && "Pointer to fn's code was null after getPointerToFunction");518FunctionType *FTy = F->getFunctionType();519Type *RetTy = FTy->getReturnType();520521assert((FTy->getNumParams() == ArgValues.size() ||522(FTy->isVarArg() && FTy->getNumParams() <= ArgValues.size())) &&523"Wrong number of arguments passed into function!");524assert(FTy->getNumParams() == ArgValues.size() &&525"This doesn't support passing arguments through varargs (yet)!");526527// Handle some common cases first. These cases correspond to common `main'528// prototypes.529if (RetTy->isIntegerTy(32) || RetTy->isVoidTy()) {530switch (ArgValues.size()) {531case 3:532if (FTy->getParamType(0)->isIntegerTy(32) &&533FTy->getParamType(1)->isPointerTy() &&534FTy->getParamType(2)->isPointerTy()) {535int (*PF)(int, char **, const char **) =536(int(*)(int, char **, const char **))(intptr_t)FPtr;537538// Call the function.539GenericValue rv;540rv.IntVal = APInt(32, PF(ArgValues[0].IntVal.getZExtValue(),541(char **)GVTOP(ArgValues[1]),542(const char **)GVTOP(ArgValues[2])));543return rv;544}545break;546case 2:547if (FTy->getParamType(0)->isIntegerTy(32) &&548FTy->getParamType(1)->isPointerTy()) {549int (*PF)(int, char **) = (int(*)(int, char **))(intptr_t)FPtr;550551// Call the function.552GenericValue rv;553rv.IntVal = APInt(32, PF(ArgValues[0].IntVal.getZExtValue(),554(char **)GVTOP(ArgValues[1])));555return rv;556}557break;558case 1:559if (FTy->getNumParams() == 1 &&560FTy->getParamType(0)->isIntegerTy(32)) {561GenericValue rv;562int (*PF)(int) = (int(*)(int))(intptr_t)FPtr;563rv.IntVal = APInt(32, PF(ArgValues[0].IntVal.getZExtValue()));564return rv;565}566break;567}568}569570// Handle cases where no arguments are passed first.571if (ArgValues.empty()) {572GenericValue rv;573switch (RetTy->getTypeID()) {574default: llvm_unreachable("Unknown return type for function call!");575case Type::IntegerTyID: {576unsigned BitWidth = cast<IntegerType>(RetTy)->getBitWidth();577if (BitWidth == 1)578rv.IntVal = APInt(BitWidth, ((bool(*)())(intptr_t)FPtr)());579else if (BitWidth <= 8)580rv.IntVal = APInt(BitWidth, ((char(*)())(intptr_t)FPtr)());581else if (BitWidth <= 16)582rv.IntVal = APInt(BitWidth, ((short(*)())(intptr_t)FPtr)());583else if (BitWidth <= 32)584rv.IntVal = APInt(BitWidth, ((int(*)())(intptr_t)FPtr)());585else if (BitWidth <= 64)586rv.IntVal = APInt(BitWidth, ((int64_t(*)())(intptr_t)FPtr)());587else588llvm_unreachable("Integer types > 64 bits not supported");589return rv;590}591case Type::VoidTyID:592rv.IntVal = APInt(32, ((int(*)())(intptr_t)FPtr)());593return rv;594case Type::FloatTyID:595rv.FloatVal = ((float(*)())(intptr_t)FPtr)();596return rv;597case Type::DoubleTyID:598rv.DoubleVal = ((double(*)())(intptr_t)FPtr)();599return rv;600case Type::X86_FP80TyID:601case Type::FP128TyID:602case Type::PPC_FP128TyID:603llvm_unreachable("long double not supported yet");604case Type::PointerTyID:605return PTOGV(((void*(*)())(intptr_t)FPtr)());606}607}608609report_fatal_error("MCJIT::runFunction does not support full-featured "610"argument passing. Please use "611"ExecutionEngine::getFunctionAddress and cast the result "612"to the desired function pointer type.");613}614615void *MCJIT::getPointerToNamedFunction(StringRef Name, bool AbortOnFailure) {616if (!isSymbolSearchingDisabled()) {617if (auto Sym = Resolver.findSymbol(std::string(Name))) {618if (auto AddrOrErr = Sym.getAddress())619return reinterpret_cast<void*>(620static_cast<uintptr_t>(*AddrOrErr));621} else if (auto Err = Sym.takeError())622report_fatal_error(std::move(Err));623}624625/// If a LazyFunctionCreator is installed, use it to get/create the function.626if (LazyFunctionCreator)627if (void *RP = LazyFunctionCreator(std::string(Name)))628return RP;629630if (AbortOnFailure) {631report_fatal_error("Program used external function '"+Name+632"' which could not be resolved!");633}634return nullptr;635}636637void MCJIT::RegisterJITEventListener(JITEventListener *L) {638if (!L)639return;640std::lock_guard<sys::Mutex> locked(lock);641EventListeners.push_back(L);642}643644void MCJIT::UnregisterJITEventListener(JITEventListener *L) {645if (!L)646return;647std::lock_guard<sys::Mutex> locked(lock);648auto I = find(reverse(EventListeners), L);649if (I != EventListeners.rend()) {650std::swap(*I, EventListeners.back());651EventListeners.pop_back();652}653}654655void MCJIT::notifyObjectLoaded(const object::ObjectFile &Obj,656const RuntimeDyld::LoadedObjectInfo &L) {657uint64_t Key =658static_cast<uint64_t>(reinterpret_cast<uintptr_t>(Obj.getData().data()));659std::lock_guard<sys::Mutex> locked(lock);660MemMgr->notifyObjectLoaded(this, Obj);661for (JITEventListener *EL : EventListeners)662EL->notifyObjectLoaded(Key, Obj, L);663}664665void MCJIT::notifyFreeingObject(const object::ObjectFile &Obj) {666uint64_t Key =667static_cast<uint64_t>(reinterpret_cast<uintptr_t>(Obj.getData().data()));668std::lock_guard<sys::Mutex> locked(lock);669for (JITEventListener *L : EventListeners)670L->notifyFreeingObject(Key);671}672673JITSymbol674LinkingSymbolResolver::findSymbol(const std::string &Name) {675auto Result = ParentEngine.findSymbol(Name, false);676if (Result)677return Result;678if (ParentEngine.isSymbolSearchingDisabled())679return nullptr;680return ClientResolver->findSymbol(Name);681}682683void LinkingSymbolResolver::anchor() {}684685686