Package com.tonic.analysis.ssa.lower
Class StackScheduler
- java.lang.Object
-
- com.tonic.analysis.ssa.lower.StackScheduler
-
public class StackScheduler extends Object
A linearizer that walks the IR blocks in order and produces a flat schedule of loads, stores and executions, tracking the peak operand stack depth as it goes.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classStackScheduler.ScheduledInstructionOne entry of the schedule - an instruction paired with the role it plays.static classStackScheduler.ScheduleTypeThe role a scheduled entry plays - a synthesized local load or store, or the IR instruction itself.
-
Constructor Summary
Constructors Constructor Description StackScheduler(IRMethod method, RegisterAllocator regAlloc)Creates a scheduler over one method and its register allocation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetMaxStack()IRMethodgetMethod()RegisterAllocatorgetRegAlloc()List<StackScheduler.ScheduledInstruction>getSchedule()voidschedule()Schedules every block in order, appending to the existing schedule and updating the peak stack depth.
-
-
-
Constructor Detail
-
StackScheduler
public StackScheduler(IRMethod method, RegisterAllocator regAlloc)
Creates a scheduler over one method and its register allocation.- Parameters:
method- the method to scheduleregAlloc- allocation supplying the slot for each value that needs a load or store
-
-
Method Detail
-
getMethod
public IRMethod getMethod()
- Returns:
- the method
-
getRegAlloc
public RegisterAllocator getRegAlloc()
- Returns:
- the reg alloc
-
getSchedule
public List<StackScheduler.ScheduledInstruction> getSchedule()
- Returns:
- the schedule
-
getMaxStack
public int getMaxStack()
- Returns:
- the max stack
-
schedule
public void schedule()
Schedules every block in order, appending to the existing schedule and updating the peak stack depth.
-
-