304 } |
304 } |
305 |
305 |
306 /** |
306 /** |
307 * Gets a copy of this frame state. |
307 * Gets a copy of this frame state. |
308 */ |
308 */ |
309 public FrameState duplicate(int newBci) { |
|
310 return graph().add(new FrameState(outerFrameState(), code, newBci, values, localsSize, stackSize, rethrowException, duringCall, monitorIds, virtualObjectMappings)); |
|
311 } |
|
312 |
|
313 /** |
|
314 * Gets a copy of this frame state. |
|
315 */ |
|
316 public FrameState duplicate() { |
309 public FrameState duplicate() { |
317 return duplicate(bci); |
310 return graph().add(new FrameState(outerFrameState(), code, bci, values, localsSize, stackSize, rethrowException, duringCall, monitorIds, virtualObjectMappings)); |
318 } |
311 } |
319 |
312 |
320 /** |
313 /** |
321 * Duplicates a FrameState, along with a deep copy of all connected VirtualState (outer |
314 * Duplicates a FrameState, along with a deep copy of all connected VirtualState (outer |
322 * FrameStates, VirtualObjectStates, ...). |
315 * FrameStates, VirtualObjectStates, ...). |
345 return duplicateModified(graph(), newBci, rethrowException, true, popKind, null, null); |
338 return duplicateModified(graph(), newBci, rethrowException, true, popKind, null, null); |
346 } |
339 } |
347 |
340 |
348 public FrameState duplicateModifiedBeforeCall(int newBci, JavaKind popKind, JavaKind[] pushedSlotKinds, ValueNode[] pushedValues) { |
341 public FrameState duplicateModifiedBeforeCall(int newBci, JavaKind popKind, JavaKind[] pushedSlotKinds, ValueNode[] pushedValues) { |
349 return duplicateModified(graph(), newBci, rethrowException, false, popKind, pushedSlotKinds, pushedValues); |
342 return duplicateModified(graph(), newBci, rethrowException, false, popKind, pushedSlotKinds, pushedValues); |
350 } |
|
351 |
|
352 /** |
|
353 * Creates a copy of this frame state with one stack element of type {@code popKind} popped from |
|
354 * the stack and the values in {@code pushedValues} pushed on the stack. The |
|
355 * {@code pushedValues} will be formatted correctly in slot encoding: a long or double will be |
|
356 * followed by a null slot. |
|
357 */ |
|
358 public FrameState duplicateModified(int newBci, boolean newRethrowException, JavaKind popKind, JavaKind[] pushedSlotKinds, ValueNode[] pushedValues) { |
|
359 return duplicateModified(graph(), newBci, newRethrowException, duringCall, popKind, pushedSlotKinds, pushedValues); |
|
360 } |
|
361 |
|
362 public FrameState duplicateModified(int newBci, boolean newRethrowException, boolean newDuringCall, JavaKind popKind, JavaKind[] pushedSlotKinds, ValueNode[] pushedValues) { |
|
363 return duplicateModified(graph(), newBci, newRethrowException, newDuringCall, popKind, pushedSlotKinds, pushedValues); |
|
364 } |
343 } |
365 |
344 |
366 /** |
345 /** |
367 * Creates a copy of this frame state with the top of stack replaced with with |
346 * Creates a copy of this frame state with the top of stack replaced with with |
368 * {@code pushedValue} which must be of type {@code popKind}. |
347 * {@code pushedValue} which must be of type {@code popKind}. |