| OLD | NEW |
| 1 //===-- JIT.cpp - LLVM Just in Time Compiler ------------------------------===// | 1 //===-- JIT.cpp - LLVM Just in Time Compiler ------------------------------===// |
| 2 // | 2 // |
| 3 // The LLVM Compiler Infrastructure | 3 // The LLVM Compiler Infrastructure |
| 4 // | 4 // |
| 5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
| 6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
| 7 // | 7 // |
| 8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
| 9 // | 9 // |
| 10 // This tool implements a just-in-time compiler for LLVM, allowing direct | 10 // This tool implements a just-in-time compiler for LLVM, allowing direct |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 } | 227 } |
| 228 | 228 |
| 229 JIT::JIT(ModuleProvider *MP, TargetMachine &tm, TargetJITInfo &tji, | 229 JIT::JIT(ModuleProvider *MP, TargetMachine &tm, TargetJITInfo &tji, |
| 230 JITMemoryManager *JMM, CodeGenOpt::Level OptLevel, bool GVsWithCode) | 230 JITMemoryManager *JMM, CodeGenOpt::Level OptLevel, bool GVsWithCode) |
| 231 : ExecutionEngine(MP), TM(tm), TJI(tji), AllocateGVsWithCode(GVsWithCode) { | 231 : ExecutionEngine(MP), TM(tm), TJI(tji), AllocateGVsWithCode(GVsWithCode) { |
| 232 setTargetData(TM.getTargetData()); | 232 setTargetData(TM.getTargetData()); |
| 233 | 233 |
| 234 jitstate = new JITState(MP); | 234 jitstate = new JITState(MP); |
| 235 | 235 |
| 236 // Initialize JCE | 236 // Initialize JCE |
| 237 JCE = createEmitter(*this, JMM); | 237 JCE = createEmitter(*this, JMM, TM); |
| 238 | 238 |
| 239 // Add target data | 239 // Add target data |
| 240 MutexGuard locked(lock); | 240 MutexGuard locked(lock); |
| 241 FunctionPassManager &PM = jitstate->getPM(locked); | 241 FunctionPassManager &PM = jitstate->getPM(locked); |
| 242 PM.add(new TargetData(*TM.getTargetData())); | 242 PM.add(new TargetData(*TM.getTargetData())); |
| 243 | 243 |
| 244 // Turn the machine code intermediate representation into bytes in memory that | 244 // Turn the machine code intermediate representation into bytes in memory that |
| 245 // may be executed. | 245 // may be executed. |
| 246 if (TM.addPassesToEmitMachineCode(PM, *JCE, OptLevel)) { | 246 if (TM.addPassesToEmitMachineCode(PM, *JCE, OptLevel)) { |
| 247 llvm_report_error("Target does not support machine code emission!"); | 247 llvm_report_error("Target does not support machine code emission!"); |
| (...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 772 return Ptr; | 772 return Ptr; |
| 773 } | 773 } |
| 774 | 774 |
| 775 void JIT::addPendingFunction(Function *F) { | 775 void JIT::addPendingFunction(Function *F) { |
| 776 MutexGuard locked(lock); | 776 MutexGuard locked(lock); |
| 777 jitstate->getPendingFunctions(locked).push_back(F); | 777 jitstate->getPendingFunctions(locked).push_back(F); |
| 778 } | 778 } |
| 779 | 779 |
| 780 | 780 |
| 781 JITEventListener::~JITEventListener() {} | 781 JITEventListener::~JITEventListener() {} |
| OLD | NEW |