Search in sources :

Example 1 with BlockEndOp

use of org.graalvm.compiler.lir.StandardOp.BlockEndOp in project graal by oracle.

the class MoveProfiler method doBlock.

private void doBlock(AbstractBlockBase<?> block) {
    ArrayList<LIRInstruction> instructions = lir.getLIRforBlock(block);
    assert instructions.size() >= 2 : "Malformed block: " + block + ", " + instructions;
    assert instructions.get(instructions.size() - 1) instanceof BlockEndOp : "Not a BlockEndOp: " + instructions.get(instructions.size() - 1);
    assert !(instructions.get(instructions.size() - 2) instanceof BlockEndOp) : "Is a BlockEndOp: " + instructions.get(instructions.size() - 2);
    assert instructions.get(0) instanceof LabelOp : "Not a LabelOp: " + instructions.get(0);
    assert !(instructions.get(1) instanceof LabelOp) : "Is a LabelOp: " + instructions.get(1);
    MoveStatistics stats = null;
    // analysis phase
    for (LIRInstruction inst : instructions) {
        if (MoveOp.isMoveOp(inst)) {
            if (stats == null) {
                stats = new MoveStatistics();
                blockMap.put(block, stats);
            }
            stats.add(MoveType.get(inst));
        }
    }
}
Also used : BlockEndOp(org.graalvm.compiler.lir.StandardOp.BlockEndOp) LabelOp(org.graalvm.compiler.lir.StandardOp.LabelOp) LIRInstruction(org.graalvm.compiler.lir.LIRInstruction)

Aggregations

LIRInstruction (org.graalvm.compiler.lir.LIRInstruction)1 BlockEndOp (org.graalvm.compiler.lir.StandardOp.BlockEndOp)1 LabelOp (org.graalvm.compiler.lir.StandardOp.LabelOp)1