JIT.h (193323) | JIT.h (195098) |
---|---|
1//===-- JIT.h - Class definition for the JIT --------------------*- C++ -*-===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// --- 6 unchanged lines hidden (view full) --- 15#define JIT_H 16 17#include "llvm/ExecutionEngine/ExecutionEngine.h" 18#include "llvm/PassManager.h" 19 20namespace llvm { 21 22class Function; | 1//===-- JIT.h - Class definition for the JIT --------------------*- C++ -*-===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// --- 6 unchanged lines hidden (view full) --- 15#define JIT_H 16 17#include "llvm/ExecutionEngine/ExecutionEngine.h" 18#include "llvm/PassManager.h" 19 20namespace llvm { 21 22class Function; |
23class TargetMachine; 24class TargetJITInfo; | 23class JITEvent_EmittedFunctionDetails; |
25class MachineCodeEmitter; 26class MachineCodeInfo; | 24class MachineCodeEmitter; 25class MachineCodeInfo; |
26class TargetJITInfo; 27class TargetMachine; |
|
27 28class JITState { 29private: 30 FunctionPassManager PM; // Passes to compile a function 31 ModuleProvider *MP; // ModuleProvider used to create the PM 32 33 /// PendingFunctions - Functions which have not been code generated yet, but 34 /// were called from a function being code generated. --- 12 unchanged lines hidden (view full) --- 47 } 48}; 49 50 51class JIT : public ExecutionEngine { 52 TargetMachine &TM; // The current target we are compiling to 53 TargetJITInfo &TJI; // The JITInfo for the target we are compiling to 54 JITCodeEmitter *JCE; // JCE object | 28 29class JITState { 30private: 31 FunctionPassManager PM; // Passes to compile a function 32 ModuleProvider *MP; // ModuleProvider used to create the PM 33 34 /// PendingFunctions - Functions which have not been code generated yet, but 35 /// were called from a function being code generated. --- 12 unchanged lines hidden (view full) --- 48 } 49}; 50 51 52class JIT : public ExecutionEngine { 53 TargetMachine &TM; // The current target we are compiling to 54 TargetJITInfo &TJI; // The JITInfo for the target we are compiling to 55 JITCodeEmitter *JCE; // JCE object |
56 std::vector<JITEventListener*> EventListeners; |
|
55 56 JITState *jitstate; 57 58 JIT(ModuleProvider *MP, TargetMachine &tm, TargetJITInfo &tji, 59 JITMemoryManager *JMM, CodeGenOpt::Level OptLevel); 60public: 61 ~JIT(); 62 --- 89 unchanged lines hidden (view full) --- 152 static ExecutionEngine *createJIT(ModuleProvider *MP, std::string *Err, 153 JITMemoryManager *JMM, 154 CodeGenOpt::Level OptLevel); 155 156 157 // Run the JIT on F and return information about the generated code 158 void runJITOnFunction(Function *F, MachineCodeInfo *MCI = 0); 159 | 57 58 JITState *jitstate; 59 60 JIT(ModuleProvider *MP, TargetMachine &tm, TargetJITInfo &tji, 61 JITMemoryManager *JMM, CodeGenOpt::Level OptLevel); 62public: 63 ~JIT(); 64 --- 89 unchanged lines hidden (view full) --- 154 static ExecutionEngine *createJIT(ModuleProvider *MP, std::string *Err, 155 JITMemoryManager *JMM, 156 CodeGenOpt::Level OptLevel); 157 158 159 // Run the JIT on F and return information about the generated code 160 void runJITOnFunction(Function *F, MachineCodeInfo *MCI = 0); 161 |
162 virtual void RegisterJITEventListener(JITEventListener *L); 163 virtual void UnregisterJITEventListener(JITEventListener *L); 164 /// These functions correspond to the methods on JITEventListener. They 165 /// iterate over the registered listeners and call the corresponding method on 166 /// each. 167 void NotifyFunctionEmitted( 168 const Function &F, void *Code, size_t Size, 169 const JITEvent_EmittedFunctionDetails &Details); 170 void NotifyFreeingMachineCode(const Function &F, void *OldPtr); 171 |
|
160private: 161 static JITCodeEmitter *createEmitter(JIT &J, JITMemoryManager *JMM); | 172private: 173 static JITCodeEmitter *createEmitter(JIT &J, JITMemoryManager *JMM); |
162 void registerMachineCodeInfo(MachineCodeInfo *MCI); | |
163 void runJITOnFunctionUnlocked(Function *F, const MutexGuard &locked); 164 void updateFunctionStub(Function *F); 165 void updateDlsymStubTable(); 166 167protected: 168 169 /// getMemoryforGV - Allocate memory for a global variable. 170 virtual char* getMemoryForGV(const GlobalVariable* GV); 171 172}; 173 174} // End llvm namespace 175 176#endif | 174 void runJITOnFunctionUnlocked(Function *F, const MutexGuard &locked); 175 void updateFunctionStub(Function *F); 176 void updateDlsymStubTable(); 177 178protected: 179 180 /// getMemoryforGV - Allocate memory for a global variable. 181 virtual char* getMemoryForGV(const GlobalVariable* GV); 182 183}; 184 185} // End llvm namespace 186 187#endif |