Mercurial > hg > truffle
diff graal/com.oracle.graal.lir/src/com/oracle/graal/lir/ForwardingFrameMapBuilder.java @ 18427:9bf59aa9d8c6
Move allocateStackSlots logic from FrameMap to ForwardingFrameMapBuilder.
author | Josef Eisl <josef.eisl@jku.at> |
---|---|
date | Thu, 23 Oct 2014 18:07:31 +0200 |
parents | b2b37b36a254 |
children | 0826409daa24 |
line wrap: on
line diff
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/ForwardingFrameMapBuilder.java Thu Oct 23 17:48:46 2014 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/ForwardingFrameMapBuilder.java Thu Oct 23 18:07:31 2014 +0200 @@ -71,7 +71,37 @@ } public StackSlot allocateStackSlots(int slots, BitSet objects, List<StackSlot> outObjectStackSlots) { - return frameMap.allocateStackSlots(slots, objects, outObjectStackSlots); + if (slots == 0) { + return null; + } + frameMap.spillSize += (slots * frameMap.getTarget().wordSize); + + if (!objects.isEmpty()) { + assert objects.length() <= slots; + StackSlot result = null; + for (int slotIndex = 0; slotIndex < slots; slotIndex++) { + StackSlot objectSlot = null; + if (objects.get(slotIndex)) { + objectSlot = frameMap.allocateNewSpillSlot(LIRKind.reference(Kind.Object), slotIndex * frameMap.getTarget().wordSize); + frameMap.addObjectStackSlot(objectSlot); + if (outObjectStackSlots != null) { + outObjectStackSlots.add(objectSlot); + } + } + if (slotIndex == 0) { + if (objectSlot != null) { + result = objectSlot; + } else { + result = frameMap.allocateNewSpillSlot(LIRKind.value(frameMap.getTarget().wordKind), 0); + } + } + } + assert result != null; + return result; + + } else { + return frameMap.allocateNewSpillSlot(LIRKind.value(frameMap.getTarget().wordKind), 0); + } } public RegisterConfig getRegisterConfig() {