use of com.oracle.svm.core.graal.code.PatchConsumerFactory in project graal by oracle.
the class SubstrateAArch64Backend method newCompilationResultBuilder.
@Override
public CompilationResultBuilder newCompilationResultBuilder(LIRGenerationResult lirGenResult, FrameMap frameMap, CompilationResult compilationResult, CompilationResultBuilderFactory factory) {
Assembler masm = new AArch64MacroAssembler(getTarget());
PatchConsumerFactory patchConsumerFactory;
if (SubstrateUtil.HOSTED) {
patchConsumerFactory = PatchConsumerFactory.HostedPatchConsumerFactory.factory();
} else {
patchConsumerFactory = PatchConsumerFactory.NativePatchConsumerFactory.factory();
}
masm.setCodePatchingAnnotationConsumer(patchConsumerFactory.newConsumer(compilationResult));
SharedMethod method = ((SubstrateLIRGenerationResult) lirGenResult).getMethod();
Deoptimizer.StubType stubType = method.getDeoptStubType();
DataBuilder dataBuilder = new SubstrateDataBuilder();
CallingConvention callingConvention = lirGenResult.getCallingConvention();
final FrameContext frameContext;
if (stubType == Deoptimizer.StubType.EntryStub) {
frameContext = new DeoptEntryStubContext(method, callingConvention);
} else if (stubType == Deoptimizer.StubType.ExitStub) {
frameContext = new DeoptExitStubContext(method, callingConvention);
} else {
frameContext = createFrameContext(method);
}
LIR lir = lirGenResult.getLIR();
OptionValues options = lir.getOptions();
DebugContext debug = lir.getDebug();
Register uncompressedNullRegister = useLinearPointerCompression() ? ReservedRegisters.singleton().getHeapBaseRegister() : Register.None;
CompilationResultBuilder crb = factory.createBuilder(getProviders(), lirGenResult.getFrameMap(), masm, dataBuilder, frameContext, options, debug, compilationResult, uncompressedNullRegister);
crb.setTotalFrameSize(lirGenResult.getFrameMap().totalFrameSize());
return crb;
}
use of com.oracle.svm.core.graal.code.PatchConsumerFactory in project graal by oracle.
the class SubstrateAMD64Backend method newCompilationResultBuilder.
@Override
public CompilationResultBuilder newCompilationResultBuilder(LIRGenerationResult lirGenResult, FrameMap frameMap, CompilationResult compilationResult, CompilationResultBuilderFactory factory) {
LIR lir = lirGenResult.getLIR();
OptionValues options = lir.getOptions();
AMD64MacroAssembler masm = new AMD64MacroAssembler(getTarget(), options);
PatchConsumerFactory patchConsumerFactory;
if (SubstrateUtil.HOSTED) {
patchConsumerFactory = PatchConsumerFactory.HostedPatchConsumerFactory.factory();
} else {
patchConsumerFactory = PatchConsumerFactory.NativePatchConsumerFactory.factory();
}
masm.setCodePatchingAnnotationConsumer(patchConsumerFactory.newConsumer(compilationResult));
SharedMethod method = ((SubstrateLIRGenerationResult) lirGenResult).getMethod();
Deoptimizer.StubType stubType = method.getDeoptStubType();
DataBuilder dataBuilder = new SubstrateDataBuilder();
CallingConvention callingConvention = lirGenResult.getCallingConvention();
final FrameContext frameContext;
if (stubType == Deoptimizer.StubType.EntryStub) {
frameContext = new DeoptEntryStubContext(method, callingConvention);
} else if (stubType == Deoptimizer.StubType.ExitStub) {
frameContext = new DeoptExitStubContext(method, callingConvention);
} else {
frameContext = createFrameContext(method, callingConvention);
}
DebugContext debug = lir.getDebug();
Register uncompressedNullRegister = useLinearPointerCompression() ? ReservedRegisters.singleton().getHeapBaseRegister() : Register.None;
CompilationResultBuilder tasm = factory.createBuilder(getProviders(), lirGenResult.getFrameMap(), masm, dataBuilder, frameContext, options, debug, compilationResult, uncompressedNullRegister);
tasm.setTotalFrameSize(lirGenResult.getFrameMap().totalFrameSize());
return tasm;
}
Aggregations