231 protected Register newRegister() { |
231 protected Register newRegister() { |
232 return registers[nextRegister++]; |
232 return registers[nextRegister++]; |
233 } |
233 } |
234 |
234 |
235 protected StackSlot newStackSlot(PlatformKind kind) { |
235 protected StackSlot newStackSlot(PlatformKind kind) { |
236 curStackSlot += kind.getSizeInBytes(); |
236 growFrame(kind.getSizeInBytes()); |
|
237 return StackSlot.get(new TestValueKind(kind), -curStackSlot, true); |
|
238 } |
|
239 |
|
240 protected void growFrame(int sizeInBytes) { |
|
241 curStackSlot += sizeInBytes; |
237 if (curStackSlot > frameSize) { |
242 if (curStackSlot > frameSize) { |
238 int newFrameSize = curStackSlot; |
243 int newFrameSize = curStackSlot; |
239 if (newFrameSize % stackAlignment != 0) { |
244 if (newFrameSize % stackAlignment != 0) { |
240 newFrameSize += stackAlignment - (newFrameSize % stackAlignment); |
245 newFrameSize += stackAlignment - (newFrameSize % stackAlignment); |
241 } |
246 } |
242 emitGrowStack(newFrameSize - frameSize); |
247 emitGrowStack(newFrameSize - frameSize); |
243 frameSize = newFrameSize; |
248 frameSize = newFrameSize; |
244 } |
249 } |
245 return StackSlot.get(new TestValueKind(kind), -curStackSlot, true); |
|
246 } |
250 } |
247 |
251 |
248 protected void setDeoptRescueSlot(StackSlot deoptRescue) { |
252 protected void setDeoptRescueSlot(StackSlot deoptRescue) { |
249 this.deoptRescue = deoptRescue; |
253 this.deoptRescue = deoptRescue; |
250 } |
254 } |