use of org.graalvm.compiler.asm.amd64.AMD64MacroAssembler in project graal by oracle.
the class AMD64HotSpotBackend method bangStackWithOffset.
@Override
protected void bangStackWithOffset(CompilationResultBuilder crb, int bangOffset) {
AMD64MacroAssembler asm = (AMD64MacroAssembler) crb.asm;
int pos = asm.position();
asm.movl(new AMD64Address(rsp, -bangOffset), AMD64.rax);
assert asm.position() - pos >= PATCHED_VERIFIED_ENTRY_POINT_INSTRUCTION_SIZE;
}
use of org.graalvm.compiler.asm.amd64.AMD64MacroAssembler in project graal by oracle.
the class AMD64HotSpotBackend method emitCode.
@Override
public void emitCode(CompilationResultBuilder crb, LIR lir, ResolvedJavaMethod installedCodeOwner) {
AMD64MacroAssembler asm = (AMD64MacroAssembler) crb.asm;
FrameMap frameMap = crb.frameMap;
RegisterConfig regConfig = frameMap.getRegisterConfig();
Label verifiedEntry = new Label();
// Emit the prefix
emitCodePrefix(installedCodeOwner, crb, asm, regConfig, verifiedEntry);
// Emit code for the LIR
emitCodeBody(installedCodeOwner, crb, lir);
// Emit the suffix
emitCodeSuffix(installedCodeOwner, crb, asm, frameMap);
// Profile assembler instructions
profileInstructions(lir, crb);
}
use of org.graalvm.compiler.asm.amd64.AMD64MacroAssembler in project graal by oracle.
the class AMD64HotSpotCRuntimeCallEpilogueOp method emitCode.
@Override
public void emitCode(CompilationResultBuilder crb, AMD64MacroAssembler masm) {
// reset last Java frame:
masm.movslq(new AMD64Address(thread, threadLastJavaSpOffset), 0);
masm.movslq(new AMD64Address(thread, threadLastJavaFpOffset), 0);
masm.movslq(new AMD64Address(thread, threadLastJavaPcOffset), 0);
}
use of org.graalvm.compiler.asm.amd64.AMD64MacroAssembler in project graal by oracle.
the class AMD64HotSpotCounterOp method emitIncrement.
private static void emitIncrement(AMD64MacroAssembler masm, Register countersArrayReg, Value incrementValue, int displacement) {
// address for counter value
AMD64Address counterAddr = new AMD64Address(countersArrayReg, displacement);
// increment counter (in memory)
if (isJavaConstant(incrementValue)) {
int increment = asInt(asJavaConstant(incrementValue));
masm.incrementq(counterAddr, increment);
} else {
masm.addq(counterAddr, asRegister(incrementValue));
}
}
use of org.graalvm.compiler.asm.amd64.AMD64MacroAssembler in project graal by oracle.
the class AMD64HotSpotSafepointOp method emitThreadLocalPoll.
private static void emitThreadLocalPoll(CompilationResultBuilder crb, AMD64MacroAssembler asm, GraalHotSpotVMConfig config, boolean atReturn, LIRFrameState state, Register thread, Register scratch) {
assert !atReturn || state == null : "state is unneeded at return";
assert config.threadPollingPageOffset >= 0;
asm.movptr(scratch, new AMD64Address(thread, config.threadPollingPageOffset));
crb.recordMark(atReturn ? config.MARKID_POLL_RETURN_FAR : config.MARKID_POLL_FAR);
final int pos = asm.position();
if (state != null) {
crb.recordInfopoint(pos, state, InfopointReason.SAFEPOINT);
}
asm.testl(rax, new AMD64Address(scratch));
}
Aggregations