74 int numSlots = numPrimitiveSlots + numReferenceSlots; |
74 int numSlots = numPrimitiveSlots + numReferenceSlots; |
75 List<AllocatableValue> slotList = new ArrayList<>(numSlots); |
75 List<AllocatableValue> slotList = new ArrayList<>(numSlots); |
76 // Place reference slots at top and bottom of virtual frame |
76 // Place reference slots at top and bottom of virtual frame |
77 // with primitive slots in the middle. This tests that slot |
77 // with primitive slots in the middle. This tests that slot |
78 // partitioning works. |
78 // partitioning works. |
|
79 AllocatableValue srcObject = gen.emitLoadConstant(objectLirKind, objectConstant); |
79 for (int i = 0; i < numReferenceSlots / 2; i++) { |
80 for (int i = 0; i < numReferenceSlots / 2; i++) { |
80 AllocatableValue src = gen.emitLoadConstant(objectLirKind, objectConstant); |
|
81 VirtualStackSlot slot = frameMapBuilder.allocateSpillSlot(objectLirKind); |
81 VirtualStackSlot slot = frameMapBuilder.allocateSpillSlot(objectLirKind); |
82 slotList.add(slot); |
82 slotList.add(slot); |
83 gen.emitMove(slot, src); |
83 gen.emitMove(slot, srcObject); |
84 } |
84 } |
|
85 AllocatableValue srcPrimitive = gen.emitLoadConstant(objectLirKind, primitiveConstant); |
85 for (int i = 0; i < numPrimitiveSlots; i++) { |
86 for (int i = 0; i < numPrimitiveSlots; i++) { |
86 AllocatableValue src = gen.emitLoadConstant(objectLirKind, primitiveConstant); |
|
87 VirtualStackSlot slot = frameMapBuilder.allocateSpillSlot(primitiveLirKind); |
87 VirtualStackSlot slot = frameMapBuilder.allocateSpillSlot(primitiveLirKind); |
88 slotList.add(slot); |
88 slotList.add(slot); |
89 gen.emitMove(slot, src); |
89 gen.emitMove(slot, srcPrimitive); |
90 } |
90 } |
91 for (int i = numReferenceSlots / 2; i < numReferenceSlots; i++) { |
91 for (int i = numReferenceSlots / 2; i < numReferenceSlots; i++) { |
92 AllocatableValue src = gen.emitLoadConstant(objectLirKind, objectConstant); |
|
93 VirtualStackSlot slot = frameMapBuilder.allocateSpillSlot(objectLirKind); |
92 VirtualStackSlot slot = frameMapBuilder.allocateSpillSlot(objectLirKind); |
94 slotList.add(slot); |
93 slotList.add(slot); |
95 gen.emitMove(slot, src); |
94 gen.emitMove(slot, srcObject); |
96 } |
95 } |
97 slots = slotList.toArray(new AllocatableValue[slotList.size()]); |
96 slots = slotList.toArray(new AllocatableValue[slotList.size()]); |
98 } |
97 } |
99 } |
98 } |
100 |
99 |