/** * Frees all variables held in this stack frame, and sets all the stack slots to <tt>null</tt>. Note that as the * stack slots are <tt>null</tt> the {@link #getStorageCell(StackVariable)} method will not return valid storage * cells any more. This method should therefore only be used to clean up the stack frame when it is no longer * needed. */ public void free() { for (int i = 0; i < bindings.length; i++) { if (bindings[i] != null) { bindings[i].free(); bindings[i] = null; } } } }
/** Removes and frees all bound variables added to this local view. */ public void undo() { // Restore the variable bindings stack to where it was before this states operator was applied. while (numBindingsAdded > 0) { Variable variable = bindings.poll(); if (variable != null) { variable.free(); if (TRACE) { /*trace.fine(indenter.generateTraceIndent() + "Backtracking, unbind " + variable.toString(interner, true, true));*/ } numBindingsAdded--; } } } }