private void mapOldFramesToNew(int isolateId){
  ArrayList<DStackContext> previousFrames=null;
  ArrayList<DStackContext> frames=null;
  Map<Long,DValue> previousValues=null;
  previousFrames=getIsolateState(isolateId).m_previousFrames;
  frames=getIsolateState(isolateId).m_frames;
  previousValues=getIsolateState(isolateId).m_previousValues;
  int oldSize=previousFrames.size();
  int newSize=frames.size();
  DValue[] oldFrames=new DValue[oldSize];
  for (int depth=0; depth < oldSize; depth++) {
    oldFrames[depth]=(DValue)previousValues.remove(Value.BASE_ID - depth);
  }
  int oldDepth=oldSize - 1;
  int newDepth=newSize - 1;
  while (oldDepth >= 0 && newDepth >= 0) {
    DStackContext oldFrame=previousFrames.get(oldDepth);
    DStackContext newFrame=frames.get(newDepth);
    if (oldFrame != null && newFrame != null) {
      if (stringsEqual(oldFrame.getCallSignature(),newFrame.getCallSignature())) {
        DValue frame=oldFrames[oldDepth];
        if (frame != null)         previousValues.put(Value.BASE_ID - newDepth,frame);
      }
    }
    oldDepth--;
    newDepth--;
  }
}

private void mapOldFramesToNew ( int isolateId ) { ArrayList < DStackContext > previousFrames = null ; ArrayList < DStackContext > frames = null ; Map < Long , DValue > previousValues = null ; previousFrames = getIsolateState ( isolateId ) . m_previousFrames ; frames = getIsolateState ( isolateId ) . m_frames ; previousValues = getIsolateState ( isolateId ) . m_previousValues ; int oldSize = previousFrames . size ( ) ; int newSize = frames . size ( ) ; DValue [ ] oldFrames = new DValue [ oldSize ] ; for ( int depth = 0 ; depth < oldSize ; depth ++ ) { oldFrames [ depth ] = ( DValue ) previousValues . remove ( Value . BASE_ID - depth ) ; } int oldDepth = oldSize - 1 ; int newDepth = newSize - 1 ; while ( oldDepth >= 0 && newDepth >= 0 ) { DStackContext oldFrame = previousFrames . get ( oldDepth ) ; DStackContext newFrame = frames . get ( newDepth ) ; if ( oldFrame != null && newFrame != null ) { if ( stringsEqual ( oldFrame . getCallSignature ( ) , newFrame . getCallSignature ( ) ) ) { DValue frame = oldFrames [ oldDepth ] ; if ( frame != null ) previousValues . put ( Value . BASE_ID - newDepth , frame ) ; } } oldDepth -- ; newDepth -- ; } }
correlates the old list of stack frames , from the last time the player was suspended , with the new list of stack frames , attempting to guess which frames correspond to each other . this is done so that variable . hasvaluechanged ( ) can work correctly for local variables .
