Changeset View
Changeset View
Standalone View
Standalone View
lib/ExecutionEngine/JIT/JITEmitter.cpp
Show First 20 Lines • Show All 231 Lines • ▼ Show 20 Lines | #endif | ||||
class StubToResolverMapTy { | class StubToResolverMapTy { | ||||
/// Map a stub address to a specific instance of a JITResolver so that | /// Map a stub address to a specific instance of a JITResolver so that | ||||
/// lazily-compiled functions can find the right resolver to use. | /// lazily-compiled functions can find the right resolver to use. | ||||
/// | /// | ||||
/// Guarded by Lock. | /// Guarded by Lock. | ||||
std::map<void*, JITResolver*> Map; | std::map<void*, JITResolver*> Map; | ||||
/// Guards Map from concurrent accesses. | /// Guards Map from concurrent accesses. | ||||
mutable sys::Mutex Lock; | mutable sys::RecursiveMutex Lock; | ||||
public: | public: | ||||
/// Registers a Stub to be resolved by Resolver. | /// Registers a Stub to be resolved by Resolver. | ||||
void RegisterStubResolver(void *Stub, JITResolver *Resolver) { | void RegisterStubResolver(void *Stub, JITResolver *Resolver) { | ||||
MutexGuard guard(Lock); | MutexGuard guard(Lock); | ||||
Map.insert(std::make_pair(Stub, Resolver)); | Map.insert(std::make_pair(Stub, Resolver)); | ||||
} | } | ||||
/// Unregisters the Stub when it's invalidated. | /// Unregisters the Stub when it's invalidated. | ||||
▲ Show 20 Lines • Show All 1,015 Lines • Show Last 20 Lines |