use of org.graalvm.compiler.lir.gen.DiagnosticLIRGeneratorTool.ZapStackArgumentSpaceBeforeInstruction in project graal by oracle.
the class HotSpotZapRegistersPhase method processBlock.
@SuppressWarnings("try")
private static void processBlock(DiagnosticLIRGeneratorTool diagnosticLirGenTool, HotSpotLIRGenerationResult res, LIR lir, LIRInsertionBuffer buffer, AbstractBlockBase<?> block, boolean zapRegisters, boolean zapStack) {
DebugContext debug = lir.getDebug();
try (Indent indent = debug.logAndIndent("Process block %s", block)) {
ArrayList<LIRInstruction> instructions = lir.getLIRforBlock(block);
buffer.init(instructions);
for (int index = 0; index < instructions.size(); index++) {
LIRInstruction inst = instructions.get(index);
if (zapStack && inst instanceof ZapStackArgumentSpaceBeforeInstruction) {
LIRInstruction zap = diagnosticLirGenTool.zapArgumentSpace();
if (zap != null) {
buffer.append(index, zap);
}
}
if (zapRegisters && inst instanceof ZapRegistersAfterInstruction) {
LIRFrameState state = getLIRState(inst);
if (state != null) {
SaveRegistersOp zap = diagnosticLirGenTool.createZapRegisters();
SaveRegistersOp old = res.getCalleeSaveInfo().put(state, zap);
assert old == null : "Already another SaveRegisterOp registered! " + old;
buffer.append(index + 1, (LIRInstruction) zap);
debug.log("Insert ZapRegister after %s", inst);
}
}
}
buffer.finish();
}
}
Aggregations