use of org.graalvm.compiler.asm.amd64.AMD64Address 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.AMD64Address 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.AMD64Address 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.AMD64Address 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));
}
use of org.graalvm.compiler.asm.amd64.AMD64Address in project graal by oracle.
the class AMD64HotSpotSafepointOp method emitGlobalPoll.
private static void emitGlobalPoll(CompilationResultBuilder crb, AMD64MacroAssembler asm, GraalHotSpotVMConfig config, boolean atReturn, LIRFrameState state, Register scratch) {
assert !atReturn || state == null : "state is unneeded at return";
if (ImmutableCode.getValue(crb.getOptions())) {
JavaKind hostWordKind = JavaKind.Long;
int alignment = hostWordKind.getBitCount() / Byte.SIZE;
JavaConstant pollingPageAddress = JavaConstant.forIntegerKind(hostWordKind, config.safepointPollingAddress);
// co-located with the immutable code.
if (GeneratePIC.getValue(crb.getOptions())) {
asm.movq(scratch, asm.getPlaceholder(-1));
} else {
asm.movq(scratch, (AMD64Address) crb.recordDataReferenceInCode(pollingPageAddress, alignment));
}
final int pos = asm.position();
crb.recordMark(atReturn ? config.MARKID_POLL_RETURN_FAR : config.MARKID_POLL_FAR);
if (state != null) {
crb.recordInfopoint(pos, state, InfopointReason.SAFEPOINT);
}
asm.testl(rax, new AMD64Address(scratch));
} else if (isPollingPageFar(config)) {
asm.movq(scratch, config.safepointPollingAddress);
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));
} else {
crb.recordMark(atReturn ? config.MARKID_POLL_RETURN_NEAR : config.MARKID_POLL_NEAR);
final int pos = asm.position();
if (state != null) {
crb.recordInfopoint(pos, state, InfopointReason.SAFEPOINT);
}
// The C++ code transforms the polling page offset into an RIP displacement
// to the real address at that offset in the polling page.
asm.testl(rax, new AMD64Address(rip, 0));
}
}
Aggregations