Пример #1
0
 /**
  * Set the local stack frame. This method is used when creating a Closure to support delayed
  * evaluation of expressions. The "stack frame" is actually on the Java heap, which means it can
  * survive function returns and the like.
  */
 public void setStackFrame(SlotManager map, ValueRepresentation[] variables) {
   stackFrame = new StackFrame(map, variables);
   if (map != null && variables.length != map.getNumberOfVariables()) {
     stackFrame.slots = new ValueRepresentation[map.getNumberOfVariables()];
     System.arraycopy(variables, 0, stackFrame.slots, 0, variables.length);
   }
 }
Пример #2
0
 /**
  * Create a new stack frame for local variables, using the supplied SlotManager to define the
  * allocation of slots to individual variables
  *
  * @param map the SlotManager for the new stack frame
  */
 public void openStackFrame(SlotManager map) {
   stackFrame = new StackFrame(map, new ValueRepresentation[map.getNumberOfVariables()]);
 }