use of org.graalvm.compiler.lir.asm.CompilationResultBuilder in project graal by oracle.
the class AArch64HotSpotBackend method newCompilationResultBuilder.
@Override
public CompilationResultBuilder newCompilationResultBuilder(LIRGenerationResult lirGenRen, FrameMap frameMap, CompilationResult compilationResult, CompilationResultBuilderFactory factory) {
HotSpotLIRGenerationResult gen = (HotSpotLIRGenerationResult) lirGenRen;
LIR lir = gen.getLIR();
assert gen.getDeoptimizationRescueSlot() == null || frameMap.frameNeedsAllocating() : "method that can deoptimize must have a frame";
Stub stub = gen.getStub();
Assembler masm = createAssembler(frameMap);
HotSpotFrameContext frameContext = new HotSpotFrameContext(stub != null);
DataBuilder dataBuilder = new HotSpotDataBuilder(getCodeCache().getTarget());
CompilationResultBuilder crb = factory.createBuilder(getCodeCache(), getForeignCalls(), frameMap, masm, dataBuilder, frameContext, lir.getOptions(), lir.getDebug(), compilationResult);
crb.setTotalFrameSize(frameMap.totalFrameSize());
crb.setMaxInterpreterFrameSize(gen.getMaxInterpreterFrameSize());
StackSlot deoptimizationRescueSlot = gen.getDeoptimizationRescueSlot();
if (deoptimizationRescueSlot != null && stub == null) {
crb.compilationResult.setCustomStackAreaOffset(deoptimizationRescueSlot);
}
if (stub != null) {
EconomicSet<Register> destroyedCallerRegisters = gatherDestroyedCallerRegisters(lir);
updateStub(stub, destroyedCallerRegisters, gen.getCalleeSaveInfo(), frameMap);
}
return crb;
}
use of org.graalvm.compiler.lir.asm.CompilationResultBuilder in project graal by oracle.
the class TruffleCompilationResultBuilderFactory method createBuilder.
@Override
public CompilationResultBuilder createBuilder(CodeCacheProvider codeCache, ForeignCallsProvider foreignCalls, FrameMap frameMap, Assembler asm, DataBuilder dataBuilder, FrameContext frameContext, OptionValues options, DebugContext debug, CompilationResult compilationResult) {
return new CompilationResultBuilder(codeCache, foreignCalls, frameMap, asm, dataBuilder, frameContext, options, debug, compilationResult) {
@Override
protected void closeCompilationResult() {
CompilationResult result = this.compilationResult;
result.setMethods(graph.method(), graph.getMethods());
result.setBytecodeSize(graph.getBytecodeSize());
Set<Assumption> newAssumptions = new HashSet<>();
for (Assumption assumption : graph.getAssumptions()) {
TruffleCompilationResultBuilderFactory.processAssumption(newAssumptions, assumption, validAssumptions);
}
if (result.getAssumptions() != null) {
for (Assumption assumption : result.getAssumptions()) {
TruffleCompilationResultBuilderFactory.processAssumption(newAssumptions, assumption, validAssumptions);
}
}
result.setAssumptions(newAssumptions.toArray(new Assumption[newAssumptions.size()]));
super.closeCompilationResult();
}
};
}
Aggregations