# HG changeset patch # User Josef Eisl # Date 1422524281 -3600 # Node ID 94ca6ce786ee2d90983667ed78b688dbd13bf1fa # Parent 74b144f7c54a9bc69fb515dcd5dbdbab2af2a534 StackSlotAllocation: improve javadoc. diff -r 74b144f7c54a -r 94ca6ce786ee graal/com.oracle.graal.lir/src/com/oracle/graal/lir/stackslotalloc/LSStackSlotAllocator.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/stackslotalloc/LSStackSlotAllocator.java Wed Jan 28 19:32:47 2015 +0100 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/stackslotalloc/LSStackSlotAllocator.java Thu Jan 29 10:38:01 2015 +0100 @@ -41,8 +41,15 @@ /** * Linear Scan {@link StackSlotAllocator}. + *

+ * Remark: The analysis works under the assumption that a stack slot is no longer live after + * its last usage. If an {@link LIRInstruction instruction} transfers the raw address of the stack + * slot to another location, e.g. a registers, and this location is referenced later on, the + * {@link com.oracle.graal.lir.LIRInstruction.Use usage} of the stack slot must be marked with the + * {@link OperandFlag#UNINITIALIZED}. Otherwise the stack slot might be reused and its content + * destroyed. */ -public class LSStackSlotAllocator implements StackSlotAllocator { +public final class LSStackSlotAllocator implements StackSlotAllocator { public static class Options { // @formatter:off @@ -107,7 +114,10 @@ new SlowIntervalBuilder().build(); } - private class SlowIntervalBuilder { + /** + * Calculates the stack intervals using a worklist-based backwards data-flow analysis. + */ + private final class SlowIntervalBuilder { final BlockMap liveInMap; final BlockMap liveOutMap;