예제 #1
0
 /**
  * Merges this frame with the given frame.
  *
  * @param frame a frame.
  * @param interpreter the interpreter used to merge values.
  * @return <tt>true</tt> if this frame has been changed as a result of the merge operation, or
  *     <tt>false</tt> otherwise.
  * @throws AnalyzerException if the frames have incompatible sizes.
  */
 public boolean merge(final Frame frame, final Interpreter interpreter) throws AnalyzerException {
   if (top != frame.top) {
     throw new AnalyzerException(null, "Incompatible stack heights");
   }
   boolean changes = false;
   for (int i = 0; i < locals + top; ++i) {
     Value v = interpreter.merge(values[i], frame.values[i]);
     if (v != values[i]) {
       values[i] = v;
       changes |= true;
     }
   }
   return changes;
 }