Search in sources :

Example 16 with Assembler

use of org.jikesrvm.compilers.common.assembler.ppc.Assembler in project JikesRVM by JikesRVM.

the class Barriers method compilePutfieldBarrierLongImm.

// on entry java stack contains ...|target_ref|value_to_store|
static void compilePutfieldBarrierLongImm(BaselineCompilerImpl comp, Offset fieldOffset, int locationMetadata) {
    Assembler asm = comp.asm;
    asm.emitLAddrToc(S0, Entrypoints.longFieldWriteBarrierMethod.getOffset());
    asm.emitMTCTR(S0);
    // store target_ref in T0
    comp.peekAddr(T0, 2);
    asm.emitNullCheck(T0);
    if (VM.BuildFor64Addr) {
        // 64 bit store of value into T1
        comp.peekLong(T1, T1, 0);
        // store offset in T2
        asm.emitLVALAddr(T2, fieldOffset);
        // store locationMetaData in T3
        asm.emitLVAL(T3, locationMetadata);
        // call barrier with parameters in (T0,T1,T2,T3)
        asm.emitBCCTRL();
    } else {
        // GPR's are only 32 bits wide
        // peek Long into T1 and T2
        comp.peekLong(T1, T2, 0);
        // store offset in T3
        asm.emitLVALAddr(T3, fieldOffset);
        // store locationMetaData in T4
        asm.emitLVAL(T4, locationMetadata);
        // call barrier with parameters in (T0,{T1,T2},T3,T4)
        asm.emitBCCTRL();
    }
    // clean up stack
    comp.discardSlots(3);
}
Also used : Assembler(org.jikesrvm.compilers.common.assembler.ppc.Assembler)

Example 17 with Assembler

use of org.jikesrvm.compilers.common.assembler.ppc.Assembler in project JikesRVM by JikesRVM.

the class Barriers method compilePutfieldBarrierFloat.

// on entry java stack contains ...|target_ref|value_to_store|
// T2 already contains the offset of the field on entry
static void compilePutfieldBarrierFloat(BaselineCompilerImpl comp, int locationMetadata) {
    Assembler asm = comp.asm;
    asm.emitLAddrToc(S0, Entrypoints.floatFieldWriteBarrierMethod.getOffset());
    asm.emitMTCTR(S0);
    // store target_ref in T0
    comp.peekAddr(T0, 1);
    asm.emitNullCheck(T0);
    // store value_to_store in F0
    comp.peekFloat(F0, 0);
    // copy offset in T2 to T1
    asm.emitMR(T1, T2);
    // store locationMetaData in T2
    asm.emitLVAL(T2, locationMetadata);
    // call barrier with parameters in (T0,F0,T1,T2)
    asm.emitBCCTRL();
    // clean up stack
    comp.discardSlots(2);
}
Also used : Assembler(org.jikesrvm.compilers.common.assembler.ppc.Assembler)

Example 18 with Assembler

use of org.jikesrvm.compilers.common.assembler.ppc.Assembler in project JikesRVM by JikesRVM.

the class Barriers method putfieldStoreBarrierHelper.

// on entry java stack contains ...|target_ref|value_to_store|
private static void putfieldStoreBarrierHelper(BaselineCompilerImpl comp, Offset fieldOffset, int locationMetadata, NormalMethod barrier) {
    // value_to_store is an Int or smaller and takes up 1 stack slot
    Assembler asm = comp.asm;
    asm.emitLAddrToc(S0, barrier.getOffset());
    asm.emitMTCTR(S0);
    // store target_ref in T0
    comp.peekAddr(T0, 1);
    asm.emitNullCheck(T0);
    // store value_to_store in T1
    comp.peekInt(T1, 0);
    // store locationMetaData in T3
    asm.emitLVAL(T3, locationMetadata);
    // store offset in T2
    asm.emitLVALAddr(T2, fieldOffset);
    // call barrier with parameters in (T0,T1,T2,T3)
    asm.emitBCCTRL();
    // clean up stack
    comp.discardSlots(2);
}
Also used : Assembler(org.jikesrvm.compilers.common.assembler.ppc.Assembler)

Example 19 with Assembler

use of org.jikesrvm.compilers.common.assembler.ppc.Assembler in project JikesRVM by JikesRVM.

the class Barriers method compilePutstaticBarrier.

// on entry java stack contains ...|ref_to_store|
// T1 already contains the offset of the field on entry
static void compilePutstaticBarrier(BaselineCompilerImpl comp, int locationMetadata) {
    Assembler asm = comp.asm;
    asm.emitLAddrToc(S0, Entrypoints.objectStaticWriteBarrierMethod.getOffset());
    asm.emitMTCTR(S0);
    // value to store
    comp.peekAddr(T0, 0);
    asm.emitLVAL(T2, locationMetadata);
    // MemoryManager.putstaticWriteBarrier(T0,T1,T2)
    asm.emitBCCTRL();
}
Also used : Assembler(org.jikesrvm.compilers.common.assembler.ppc.Assembler)

Example 20 with Assembler

use of org.jikesrvm.compilers.common.assembler.ppc.Assembler in project JikesRVM by JikesRVM.

the class Barriers method compilePutstaticBarrierImm.

// on entry java stack contains ...|ref_to_store|
static void compilePutstaticBarrierImm(BaselineCompilerImpl comp, Offset fieldOffset, int locationMetadata) {
    Assembler asm = comp.asm;
    asm.emitLAddrToc(S0, Entrypoints.objectStaticWriteBarrierMethod.getOffset());
    asm.emitMTCTR(S0);
    // offset
    asm.emitLVALAddr(T1, fieldOffset);
    // value to store
    comp.peekAddr(T0, 0);
    asm.emitLVAL(T2, locationMetadata);
    // MemoryManager.putstaticWriteBarrier(T0,T1,T2)
    asm.emitBCCTRL();
}
Also used : Assembler(org.jikesrvm.compilers.common.assembler.ppc.Assembler)

Aggregations

Assembler (org.jikesrvm.compilers.common.assembler.ppc.Assembler)30 Entrypoint (org.vmmagic.pragma.Entrypoint)6 ForwardReference (org.jikesrvm.compilers.common.assembler.ForwardReference)4 Address (org.vmmagic.unboxed.Address)2 Offset (org.vmmagic.unboxed.Offset)2 RVMClass (org.jikesrvm.classloader.RVMClass)1 TypeReference (org.jikesrvm.classloader.TypeReference)1 ArchBaselineCompiledMethod (org.jikesrvm.compilers.baseline.ppc.ArchBaselineCompiledMethod)1 CodeArray (org.jikesrvm.compilers.common.CodeArray)1 CompiledMethod (org.jikesrvm.compilers.common.CompiledMethod)1 OptCompiledMethod (org.jikesrvm.compilers.opt.runtimesupport.OptCompiledMethod)1 JNICompiledMethod (org.jikesrvm.jni.JNICompiledMethod)1 FIRST_NONVOLATILE_GPR (org.jikesrvm.ppc.RegisterConstants.FIRST_NONVOLATILE_GPR)1 FIRST_OS_PARAMETER_FPR (org.jikesrvm.ppc.RegisterConstants.FIRST_OS_PARAMETER_FPR)1 FIRST_OS_PARAMETER_GPR (org.jikesrvm.ppc.RegisterConstants.FIRST_OS_PARAMETER_GPR)1 FIRST_RVM_RESERVED_NV_GPR (org.jikesrvm.ppc.RegisterConstants.FIRST_RVM_RESERVED_NV_GPR)1 FIRST_SCRATCH_FPR (org.jikesrvm.ppc.RegisterConstants.FIRST_SCRATCH_FPR)1 FIRST_VOLATILE_FPR (org.jikesrvm.ppc.RegisterConstants.FIRST_VOLATILE_FPR)1 FIRST_VOLATILE_GPR (org.jikesrvm.ppc.RegisterConstants.FIRST_VOLATILE_GPR)1 FPR (org.jikesrvm.ppc.RegisterConstants.FPR)1