# HG changeset patch # User Josef Eisl # Date 1416237287 -3600 # Node ID 758ecda76985f2a495b1740db27b97da570b22ee # Parent d11ce424f09d671d639bb699ca64d42a3410fcb1 FrameMapBuilder: remove freeSpillSlot(). diff -r d11ce424f09d -r 758ecda76985 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/DelayedFrameMapBuilder.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/DelayedFrameMapBuilder.java Tue Nov 11 18:17:17 2014 +0100 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/DelayedFrameMapBuilder.java Mon Nov 17 16:14:47 2014 +0100 @@ -55,22 +55,9 @@ this.mappables = new ArrayList<>(); } - private Set freedSlots; private final List mappables; public VirtualStackSlot allocateSpillSlot(LIRKind kind) { - if (freedSlots != null) { - for (Iterator iter = freedSlots.iterator(); iter.hasNext();) { - VirtualStackSlot s = iter.next(); - if (s.getLIRKind().equals(kind)) { - iter.remove(); - if (freedSlots.isEmpty()) { - freedSlots = null; - } - return s; - } - } - } SimpleVirtualStackSlot slot = new SimpleVirtualStackSlot(kind); stackSlots.add(slot); return slot; @@ -169,13 +156,6 @@ return codeCache; } - public void freeSpillSlot(VirtualStackSlot slot) { - if (freedSlots == null) { - freedSlots = new HashSet<>(); - } - freedSlots.add(slot); - } - public void callsMethod(CallingConvention cc) { calls.add(cc); } @@ -189,21 +169,7 @@ } // rewrite mappables.forEach(m -> m.map(mapping::get)); - // - if (freedSlots != null) { - // If the freed slots cover the complete spill area (except for the return - // address slot), then the spill size is reset to its initial value. - // Without this, frameNeedsAllocating() would never return true. - int total = 0; - for (VirtualStackSlot s : freedSlots) { - total += frameMap.getTarget().getSizeInBytes(s.getKind()); - } - if (total == frameMap.spillSize - frameMap.initialSpillSize) { - // reset spill area size - frameMap.spillSize = frameMap.initialSpillSize; - } - freedSlots = null; - } + frameMap.finish(); return frameMap; } diff -r d11ce424f09d -r 758ecda76985 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/FrameMapBuilder.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/FrameMapBuilder.java Tue Nov 11 18:17:17 2014 +0100 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/FrameMapBuilder.java Mon Nov 17 16:14:47 2014 +0100 @@ -80,12 +80,6 @@ CodeCacheProvider getCodeCache(); /** - * Frees a spill slot that was obtained via {@link #allocateSpillSlot(LIRKind)} such that it can - * be reused for the next allocation request for the same kind of slot. - */ - void freeSpillSlot(VirtualStackSlot reservedSlot); - - /** * Informs the frame map that the compiled code calls a particular method, which may need stack * space for outgoing arguments. *