26 import org.graalvm.compiler.lir.alloc.lsra.ssa.SSALinearScan;
27 import org.graalvm.compiler.lir.gen.LIRGenerationResult;
28 import org.graalvm.compiler.lir.gen.LIRGeneratorTool.MoveFactory;
29 import org.graalvm.compiler.lir.phases.AllocationPhase;
30
31 import jdk.vm.ci.code.TargetDescription;
32
33 public final class LinearScanPhase extends AllocationPhase {
34
35 private boolean neverSpillConstants;
36
37 public void setNeverSpillConstants(boolean neverSpillConstants) {
38 this.neverSpillConstants = neverSpillConstants;
39 }
40
41 @Override
42 protected void run(TargetDescription target, LIRGenerationResult lirGenRes, AllocationContext context) {
43 MoveFactory spillMoveFactory = context.spillMoveFactory;
44 RegisterAllocationConfig registerAllocationConfig = context.registerAllocationConfig;
45 final LinearScan allocator = new SSALinearScan(target, lirGenRes, spillMoveFactory, registerAllocationConfig, lirGenRes.getLIR().linearScanOrder(), neverSpillConstants);
46 allocator.allocate(target, lirGenRes, spillMoveFactory, registerAllocationConfig);
47 }
48 }
|
26 import org.graalvm.compiler.lir.alloc.lsra.ssa.SSALinearScan;
27 import org.graalvm.compiler.lir.gen.LIRGenerationResult;
28 import org.graalvm.compiler.lir.gen.LIRGeneratorTool.MoveFactory;
29 import org.graalvm.compiler.lir.phases.AllocationPhase;
30
31 import jdk.vm.ci.code.TargetDescription;
32
33 public final class LinearScanPhase extends AllocationPhase {
34
35 private boolean neverSpillConstants;
36
37 public void setNeverSpillConstants(boolean neverSpillConstants) {
38 this.neverSpillConstants = neverSpillConstants;
39 }
40
41 @Override
42 protected void run(TargetDescription target, LIRGenerationResult lirGenRes, AllocationContext context) {
43 MoveFactory spillMoveFactory = context.spillMoveFactory;
44 RegisterAllocationConfig registerAllocationConfig = context.registerAllocationConfig;
45 final LinearScan allocator = new SSALinearScan(target, lirGenRes, spillMoveFactory, registerAllocationConfig, lirGenRes.getLIR().linearScanOrder(), neverSpillConstants);
46 allocator.allocate(target, lirGenRes, context);
47 }
48 }
|