@@ -986,6 +986,7 @@ JuliaOJIT::JuliaOJIT()
986
986
#endif
987
987
GlobalJD (ES.createBareJITDylib(" JuliaGlobals" )),
988
988
JD(ES.createBareJITDylib(" JuliaOJIT" )),
989
+ LCTM(cantFail(orc::createLocalLazyCallThroughManager(TM->getTargetTriple (), ES, 0))),
989
990
ContextPool([](){ return orc::ThreadSafeContext (std::make_unique<LLVMContext>()); }),
990
991
#ifdef JL_USE_JITLINK
991
992
// TODO: Port our memory management optimisations to JITLink instead of using the
@@ -1011,7 +1012,8 @@ JuliaOJIT::JuliaOJIT()
1011
1012
std::make_unique<PipelineT>(ObjectLayer, *TM, 2 ),
1012
1013
std::make_unique<PipelineT>(ObjectLayer, *TM, 3 ),
1013
1014
},
1014
- OptSelLayer (Pipelines)
1015
+ OptSelLayer (Pipelines),
1016
+ CODLayer(ES, OptSelLayer, *LCTM, orc::createLocalIndirectStubsManagerBuilder(TM->getTargetTriple ()))
1015
1017
{
1016
1018
#ifdef JL_USE_JITLINK
1017
1019
# if defined(_OS_DARWIN_) && defined(LLVM_SHLIB)
@@ -1034,6 +1036,8 @@ JuliaOJIT::JuliaOJIT()
1034
1036
});
1035
1037
#endif
1036
1038
1039
+ CODLayer.setPartitionFunction (CODLayerT::compileWholeModule);
1040
+
1037
1041
// Make sure SectionMemoryManager::getSymbolAddressInProcess can resolve
1038
1042
// symbols in the program as well. The nullptr argument to the function
1039
1043
// tells DynamicLibrary to load the program, not a library.
@@ -1112,11 +1116,11 @@ void JuliaOJIT::addModule(orc::ThreadSafeModule TSM)
1112
1116
#endif
1113
1117
});
1114
1118
// TODO: what is the performance characteristics of this?
1115
- cantFail (OptSelLayer .add (JD, std::move (TSM)));
1116
- // force eager compilation (for now), due to memory management specifics
1117
- // (can't handle compilation recursion)
1118
- for (auto Name : NewExports)
1119
- cantFail (ES.lookup ({&JD}, Name));
1119
+ cantFail (CODLayer .add (JD, std::move (TSM)));
1120
+ // // force eager compilation (for now), due to memory management specifics
1121
+ // // (can't handle compilation recursion)
1122
+ // for (auto Name : NewExports)
1123
+ // cantFail(ES.lookup({&JD}, Name));
1120
1124
1121
1125
}
1122
1126
0 commit comments