Search in sources :

Example 21 with AMD64MacroAssembler

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;
}
Also used : AMD64MacroAssembler(org.graalvm.compiler.asm.amd64.AMD64MacroAssembler) AMD64Address(org.graalvm.compiler.asm.amd64.AMD64Address)

Example 22 with AMD64MacroAssembler

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);
}
Also used : RegisterConfig(jdk.vm.ci.code.RegisterConfig) AMD64FrameMap(org.graalvm.compiler.lir.amd64.AMD64FrameMap) FrameMap(org.graalvm.compiler.lir.framemap.FrameMap) AMD64MacroAssembler(org.graalvm.compiler.asm.amd64.AMD64MacroAssembler) Label(org.graalvm.compiler.asm.Label)

Example 23 with AMD64MacroAssembler

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);
}
Also used : AMD64Address(org.graalvm.compiler.asm.amd64.AMD64Address)

Example 24 with AMD64MacroAssembler

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));
    }
}
Also used : AMD64Address(org.graalvm.compiler.asm.amd64.AMD64Address)

Example 25 with AMD64MacroAssembler

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));
}
Also used : AMD64Address(org.graalvm.compiler.asm.amd64.AMD64Address)

Aggregations

AMD64Address (org.graalvm.compiler.asm.amd64.AMD64Address)32 Register (jdk.vm.ci.code.Register)23 ValueUtil.asRegister (jdk.vm.ci.code.ValueUtil.asRegister)19 Label (org.graalvm.compiler.asm.Label)16 ArrayDataPointerConstant (org.graalvm.compiler.lir.asm.ArrayDataPointerConstant)7 AMD64MacroAssembler (org.graalvm.compiler.asm.amd64.AMD64MacroAssembler)6 CallingConvention (jdk.vm.ci.code.CallingConvention)4 RegisterConfig (jdk.vm.ci.code.RegisterConfig)4 TargetDescription (jdk.vm.ci.code.TargetDescription)3 AMD64Kind (jdk.vm.ci.amd64.AMD64Kind)2 DataSectionReference (jdk.vm.ci.code.site.DataSectionReference)2 AssemblerTest (org.graalvm.compiler.asm.test.AssemblerTest)2 CompilationResult (org.graalvm.compiler.code.CompilationResult)2 Data (org.graalvm.compiler.code.DataSection.Data)2 RawData (org.graalvm.compiler.code.DataSection.RawData)2 SerializableData (org.graalvm.compiler.code.DataSection.SerializableData)2 FrameMap (org.graalvm.compiler.lir.framemap.FrameMap)2 Test (org.junit.Test)2 CGlobalDataReference (com.oracle.svm.core.graal.code.CGlobalDataReference)1 SubstrateRegisterConfig (com.oracle.svm.core.graal.meta.SubstrateRegisterConfig)1