use of org.graalvm.compiler.asm.sparc.SPARCAddress in project graal by oracle.
the class SPARCHotSpotBackend method bangStackWithOffset.
@Override
protected void bangStackWithOffset(CompilationResultBuilder crb, int bangOffset) {
// Use SPARCAddress to get the final displacement including the stack bias.
SPARCMacroAssembler masm = (SPARCMacroAssembler) crb.asm;
SPARCAddress address = new SPARCAddress(sp, -bangOffset);
if (SPARCAssembler.isSimm13(address.getDisplacement())) {
masm.stx(g0, address);
} else {
try (ScratchRegister sc = masm.getScratchRegister()) {
Register scratch = sc.getRegister();
assert isGlobalRegister(scratch) : "Only global (g1-g7) registers are allowed if the frame was not initialized here. Got register " + scratch;
masm.setx(address.getDisplacement(), scratch, false);
masm.stx(g0, new SPARCAddress(sp, scratch));
}
}
}
use of org.graalvm.compiler.asm.sparc.SPARCAddress in project graal by oracle.
the class SPARCHotSpotCRuntimeCallEpilogueOp method emitCode.
@Override
public void emitCode(CompilationResultBuilder crb, SPARCMacroAssembler masm) {
// Restore the thread register when coming back from the runtime.
SPARCMove.move(crb, masm, thread.asValue(LIRKind.value(XWORD)), threadTemp, SPARCDelayedControlTransfer.DUMMY);
// Reset last Java frame, last Java PC and flags.
masm.stx(g0, new SPARCAddress(thread, threadLastJavaSpOffset));
masm.stx(g0, new SPARCAddress(thread, threadLastJavaPcOffset));
masm.stw(g0, new SPARCAddress(thread, threadJavaFrameAnchorFlagsOffset));
}
use of org.graalvm.compiler.asm.sparc.SPARCAddress in project graal by oracle.
the class SPARCHotSpotCRuntimeCallPrologueOp method emitCode.
@Override
public void emitCode(CompilationResultBuilder crb, SPARCMacroAssembler masm) {
// Save last Java frame.
Register scratchRegister = asRegister(spScratch);
masm.add(stackPointer, STACK_BIAS, scratchRegister);
masm.stx(scratchRegister, new SPARCAddress(thread, threadLastJavaSpOffset));
// Save the thread register when calling out to the runtime.
SPARCMove.move(crb, masm, threadTemp, thread.asValue(LIRKind.value(XWORD)), getDelayedControlTransfer());
}
use of org.graalvm.compiler.asm.sparc.SPARCAddress in project graal by oracle.
the class SPARCHotSpotCounterOp method emitCode.
@Override
public void emitCode(CompilationResultBuilder crb) {
SPARCMacroAssembler masm = (SPARCMacroAssembler) crb.asm;
TargetDescription target = crb.target;
// address for counters array
SPARCAddress countersArrayAddr = new SPARCAddress(thread, config.jvmciCountersThreadOffset);
try (ScratchRegister scratch = masm.getScratchRegister()) {
Register countersArrayReg = scratch.getRegister();
// load counters array
masm.ldx(countersArrayAddr, countersArrayReg);
IncrementEmitter emitter = new IncrementEmitter(countersArrayReg, masm);
forEachCounter(emitter, target);
}
}
use of org.graalvm.compiler.asm.sparc.SPARCAddress in project graal by oracle.
the class SPARCHotSpotJumpToExceptionHandlerInCallerOp method emitCode.
@Override
public void emitCode(CompilationResultBuilder crb, SPARCMacroAssembler masm) {
// Restore SP from L7 if the exception PC is a method handle call site.
SPARCAddress dst = new SPARCAddress(thread, isMethodHandleReturnOffset);
try (ScratchRegister scratch = masm.getScratchRegister()) {
Register scratchReg = scratch.getRegister();
masm.lduw(dst, scratchReg);
masm.cmp(scratchReg, scratchReg);
masm.movcc(ConditionFlag.NotZero, CC.Icc, l7, sp);
}
masm.jmpl(asRegister(handlerInCallerPc), 0, g0);
// Delay slot
leaveFrame(crb);
}
Aggregations