Search in sources :

Example 11 with Assembler

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

the class Barriers method putfieldUnboxedStoreBarrierHelper.

// on entry java stack contains ...|target_ref|value_to_store|
private static void putfieldUnboxedStoreBarrierHelper(BaselineCompilerImpl comp, Offset fieldOffset, int locationMetadata, NormalMethod barrier) {
    Assembler asm = comp.asm;
    asm.emitLAddrToc(S0, barrier.getOffset());
    asm.emitMTCTR(S0);
    // store target_ref in T0
    comp.peekAddr(T0, 1);
    asm.emitNullCheck(T0);
    // offset
    asm.emitLVALAddr(T2, fieldOffset);
    // value to store
    comp.peekUnboxed(T1, 0);
    asm.emitLVAL(T3, locationMetadata);
    asm.emitBCCTRL();
    // clean up stack
    comp.discardSlots(2);
}
Also used : Assembler(org.jikesrvm.compilers.common.assembler.ppc.Assembler)

Example 12 with Assembler

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

the class Barriers method compilePutfieldBarrierLong.

// on entry java stack contains ...|target_ref|value_to_store|
// T2 already contains the offset of the field on entry
static void compilePutfieldBarrierLong(BaselineCompilerImpl comp, 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);
        // offset is fine in T2
        // 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
        // copy offset into T3
        asm.emitMR(T3, T2);
        // peek Long into T1 and T2
        comp.peekLong(T1, T2, 0);
        // 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 13 with Assembler

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

the class Barriers method compileGetfieldBarrierImm.

// on entry java stack contains ...|source_ref|
static void compileGetfieldBarrierImm(BaselineCompilerImpl comp, Offset fieldOffset, int locationMetadata) {
    Assembler asm = comp.asm;
    asm.emitLAddrToc(S0, Entrypoints.objectFieldReadBarrierMethod.getOffset());
    asm.emitMTCTR(S0);
    // object base
    comp.peekAddr(T0, 0);
    asm.emitNullCheck(T0);
    // offset
    asm.emitLVALAddr(T1, fieldOffset);
    asm.emitLVAL(T2, locationMetadata);
    // MemoryManager.getfieldReadBarrier(T0,T1,T2)
    asm.emitBCCTRL();
}
Also used : Assembler(org.jikesrvm.compilers.common.assembler.ppc.Assembler)

Example 14 with Assembler

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

the class Barriers method compilePutfieldBarrierDouble.

// on entry java stack contains ...|target_ref|value_to_store|
// T2 already contains the offset of the field on entry
static void compilePutfieldBarrierDouble(BaselineCompilerImpl comp, int locationMetadata) {
    Assembler asm = comp.asm;
    asm.emitLAddrToc(S0, Entrypoints.doubleFieldWriteBarrierMethod.getOffset());
    asm.emitMTCTR(S0);
    // store target_ref in T0
    comp.peekAddr(T0, 2);
    asm.emitNullCheck(T0);
    // store value_to_store in F0
    comp.peekDouble(F0, 0);
    // move 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(3);
}
Also used : Assembler(org.jikesrvm.compilers.common.assembler.ppc.Assembler)

Example 15 with Assembler

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

the class Barriers method compileArrayLoadBarrier.

// on entry T0, T1 already contain the appropriate values
static void compileArrayLoadBarrier(BaselineCompilerImpl comp) {
    Assembler asm = comp.asm;
    asm.emitLAddrToc(S0, Entrypoints.objectArrayReadBarrierMethod.getOffset());
    asm.emitMTCTR(S0);
    // MemoryManager.arrayLoadReadBarrier(T0,T1)
    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