All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jruby.ir.passes.DeadCodeElimination Maven / Gradle / Ivy

package org.jruby.ir.passes;

import org.jruby.ir.IRScope;
import org.jruby.ir.dataflow.analyses.LiveVariablesProblem;

import java.util.Arrays;
import java.util.List;

public class DeadCodeElimination extends CompilerPass {
    public static List> DEPENDENCIES = Arrays.>asList(LiveVariableAnalysis.class);

    public String getLabel() {
        return "Dead Code Elimination";
    }

    @Override
    public String getShortLabel() {
        return "DCE";
    }

    @Override
    public List> getDependencies() {
        return DEPENDENCIES;
    }

    @Override
    public Object execute(IRScope scope, Object... data) {
        ((LiveVariablesProblem) data[0]).markDeadInstructions();

        return true;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy