use of com.oracle.svm.core.graal.llvm.util.LLVMObjectFileReader.LLVMTextSectionInfo in project graal by oracle.
the class LLVMNativeImageCodeCache method linkCompiledBatches.
private void linkCompiledBatches(BatchExecutor executor, DebugContext debug, int numBatches) {
List<String> compiledBatches = IntStream.range(0, numBatches).mapToObj(this::getBatchCompiledFilename).collect(Collectors.toList());
nativeLink(debug, getLinkedFilename(), compiledBatches);
LLVMTextSectionInfo textSectionInfo = objectFileReader.parseCode(getLinkedPath());
executor.forEach(compilations.entrySet(), entry -> (debugContext) -> {
HostedMethod method = entry.getKey();
int offset = textSectionInfo.getOffset(SubstrateUtil.uniqueShortName(method));
int nextFunctionStartOffset = textSectionInfo.getNextOffset(offset);
int functionSize = nextFunctionStartOffset - offset;
CompilationResult compilation = entry.getValue();
compilation.setTargetCode(null, functionSize);
method.setCodeAddressOffset(offset);
});
compilations.forEach((method, compilation) -> compilationsByStart.put(method.getCodeAddressOffset(), compilation));
stackMapDumper.dumpOffsets(textSectionInfo);
stackMapDumper.close();
HostedMethod firstMethod = (HostedMethod) getFirstCompilation().getMethods()[0];
buildRuntimeMetadata(new MethodPointer(firstMethod), WordFactory.signed(textSectionInfo.getCodeSize()));
}
Aggregations