use of org.jikesrvm.compilers.common.assembler.ppc.Assembler in project JikesRVM by JikesRVM.
the class Barriers method compilePutfieldBarrier.
// on entry java stack contains ...|target_ref|ref_to_store|
// T2 already contains the offset of the field on entry
static void compilePutfieldBarrier(BaselineCompilerImpl comp, int locationMetadata) {
Assembler asm = comp.asm;
asm.emitLAddrToc(S0, Entrypoints.objectFieldWriteBarrierMethod.getOffset());
asm.emitMTCTR(S0);
// object base
comp.peekAddr(T0, 1);
asm.emitNullCheck(T0);
// value to store
comp.peekAddr(T1, 0);
asm.emitLVAL(T3, locationMetadata);
// MemoryManager.putfieldWriteBarrier(T0,T1,T2,T3)
asm.emitBCCTRL();
}
use of org.jikesrvm.compilers.common.assembler.ppc.Assembler in project JikesRVM by JikesRVM.
the class Barriers method compilePutfieldBarrierFloatImm.
// on entry java stack contains ...|target_ref|value_to_store|
static void compilePutfieldBarrierFloatImm(BaselineCompilerImpl comp, Offset fieldOffset, 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);
// store offset in T1
asm.emitLVALAddr(T1, fieldOffset);
// 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);
}
use of org.jikesrvm.compilers.common.assembler.ppc.Assembler in project JikesRVM by JikesRVM.
the class Barriers method compileGetstaticBarrierImm.
// on entry java stack contains ...|
static void compileGetstaticBarrierImm(BaselineCompilerImpl comp, Offset fieldOffset, int locationMetadata) {
Assembler asm = comp.asm;
asm.emitLAddrToc(S0, Entrypoints.objectStaticReadBarrierMethod.getOffset());
asm.emitMTCTR(S0);
// offset
asm.emitLVALAddr(T0, fieldOffset);
asm.emitLVAL(T1, locationMetadata);
// MemoryManager.getstaticReadBarrier(T0,T1)
asm.emitBCCTRL();
}
use of org.jikesrvm.compilers.common.assembler.ppc.Assembler in project JikesRVM by JikesRVM.
the class OutOfLineMachineCode method generateSaveVolatilesInstructions.
// Machine code used to save volatile registers.
//
// Registers taken at runtime:
// S0 == address of Registers object
//
// Registers returned at runtime:
// none
//
// Side effects at runtime:
// S1 destroyed
//
private static CodeArray generateSaveVolatilesInstructions() {
Assembler asm = new Assembler(0);
// save volatile fprs
//
// S1 := registers.fprs[]
asm.emitLAddrOffset(S1, S0, ArchEntrypoints.registersFPRsField.getOffset());
for (int i = FIRST_VOLATILE_FPR.value(); i <= LAST_VOLATILE_FPR.value(); ++i) {
asm.emitSTFD(FPR.lookup(i), i << LOG_BYTES_IN_DOUBLE, S1);
}
// save non-volatile gprs
//
// S1 := registers.gprs[]
asm.emitLAddrOffset(S1, S0, ArchEntrypoints.registersGPRsField.getOffset());
for (int i = FIRST_VOLATILE_GPR.value(); i <= LAST_VOLATILE_GPR.value(); ++i) {
asm.emitSTAddr(GPR.lookup(i), i << LOG_BYTES_IN_ADDRESS, S1);
}
// return to caller
//
asm.emitBCLR();
return asm.getMachineCodes();
}
use of org.jikesrvm.compilers.common.assembler.ppc.Assembler in project JikesRVM by JikesRVM.
the class OutOfLineMachineCode method generateRestoreVolatilesInstructions.
/**
* Machine code used to save volatile registers.
* <pre>
* Registers taken at runtime:
* S0 == address of Registers object
*
* Registers returned at runtime:
* none
*
* Side effects at runtime:
* S1 destroyed
* </pre>
*/
private static CodeArray generateRestoreVolatilesInstructions() {
Assembler asm = new Assembler(0);
// save volatile fprs
//
// S1 := registers.fprs[]
asm.emitLAddrOffset(S1, S0, ArchEntrypoints.registersFPRsField.getOffset());
for (int i = FIRST_VOLATILE_FPR.value(); i <= LAST_VOLATILE_FPR.value(); ++i) {
asm.emitLFD(FPR.lookup(i), i << LOG_BYTES_IN_DOUBLE, S1);
}
// save non-volatile gprs
//
// S1 := registers.gprs[]
asm.emitLAddrOffset(S1, S0, ArchEntrypoints.registersGPRsField.getOffset());
for (int i = FIRST_VOLATILE_GPR.value(); i <= LAST_VOLATILE_GPR.value(); ++i) {
asm.emitLAddr(GPR.lookup(i), i << LOG_BYTES_IN_ADDRESS, S1);
}
// return to caller
//
asm.emitBCLR();
return asm.getMachineCodes();
}
Aggregations