Lines Matching refs:JIT
1 //===-- JIT.cpp - LLVM Just in Time Compiler ------------------------------===//
15 #include "JIT.h"
61 RegisterJIT() { JIT::Register(); }
82 // function here so that code generated by the JIT cooperates with the unwinding
203 /// createJIT - This is the factory method for creating a JIT for the current
206 ExecutionEngine *JIT::createJIT(Module *M,
217 // If the target supports JIT code generation, create the JIT.
219 return new JIT(M, *TM, *TJ, JMM, OptLevel, GVsWithCode);
222 *ErrorStr = "target does not support JIT code generation";
231 SmallPtrSet<JIT*, 1> JITs; // Optimize for process containing just 1 JIT.
234 void Add(JIT *jit) {
236 JITs.insert(jit);
238 void Remove(JIT *jit) {
240 JITs.erase(jit);
244 assert(JITs.size() != 0 && "No Jit registered");
245 //search function in every instance of JIT
246 for (SmallPtrSet<JIT*, 1>::const_iterator Jit = JITs.begin(),
248 Jit != end; ++Jit) {
249 if (Function *F = (*Jit)->FindFunctionNamed(Name))
250 return (*Jit)->getPointerToFunction(F);
261 // JIT::getPointerToNamedFunction for the purpose of resolving symbols when
262 // bugpoint is debugging the JIT. In that scenario, we are loading an .so and
270 JIT::JIT(Module *M, TargetMachine &tm, TargetJITInfo &tji,
319 JIT::~JIT() {
320 // Unregister all exception tables registered by this JIT.
329 /// addModule - Add a new Module to the JIT. If we previously removed the last
331 void JIT::addModule(Module *M) {
357 bool JIT::removeModule(Module *M) {
387 GenericValue JIT::runFunction(Function *F,
553 void JIT::RegisterJITEventListener(JITEventListener *L) {
559 void JIT::UnregisterJITEventListener(JITEventListener *L) {
570 void JIT::NotifyFunctionEmitted(
580 void JIT::NotifyFreeingMachineCode(void *OldPtr) {
591 void JIT::runJITOnFunction(Function *F, MachineCodeInfo *MCI) {
615 void JIT::runJITOnFunctionUnlocked(Function *F, const MutexGuard &locked) {
637 void JIT::jitTheFunction(Function *F, const MutexGuard &locked) {
649 void *JIT::getPointerToFunction(Function *F) {
682 void JIT::addPointerToBasicBlock(const BasicBlock *BB, void *Addr) {
694 void JIT::clearPointerToBasicBlock(const BasicBlock *BB) {
699 void *JIT::getPointerToBasicBlock(BasicBlock *BB) {
700 // make sure it's function is compiled by JIT
711 assert(0 && "JIT does not have BB address for address-of-label, was"
720 void *JIT::getOrEmitGlobalVariable(const GlobalVariable *GV) {
752 /// just like JIT::getPointerToFunction().
754 void *JIT::recompileAndRelinkFunction(Function *F) {
774 /// variable so that the JIT can allocate thread local variables depending
777 char* JIT::getMemoryForGV(const GlobalVariable* GV) {
815 void JIT::addPendingFunction(Function *F) {