Mercurial > hg > truffle
changeset 19034:94ca6ce786ee
StackSlotAllocation: improve javadoc.
author | Josef Eisl <josef.eisl@jku.at> |
---|---|
date | Thu, 29 Jan 2015 10:38:01 +0100 |
parents | 74b144f7c54a |
children | 9a3bde73e05a |
files | graal/com.oracle.graal.lir/src/com/oracle/graal/lir/stackslotalloc/LSStackSlotAllocator.java |
diffstat | 1 files changed, 12 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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}. + * <p> + * <b>Remark:</b> 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<BitSet> liveInMap; final BlockMap<BitSet> liveOutMap;