agent/src/share/classes/sun/jvm/hotspot/code/CodeCache.java
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File sadis Sdiff agent/src/share/classes/sun/jvm/hotspot/code

agent/src/share/classes/sun/jvm/hotspot/code/CodeCache.java

Print this page




 150         message = message + " or ";
 151       }
 152       message = message + "SafepointBlob";
 153       if (VM.getVM().isServerCompiler()) {
 154         message = message + ", DeoptimizationBlob, or ExceptionBlob";
 155       }
 156       message = message + ")";
 157       throw new RuntimeException(message);
 158     }
 159   }
 160 
 161   public void iterate(CodeCacheVisitor visitor) {
 162     CodeHeap heap = getHeap();
 163     Address ptr = heap.begin();
 164     Address end = heap.end();
 165 
 166     visitor.prologue(ptr, end);
 167     CodeBlob lastBlob = null;
 168     while (ptr != null && ptr.lessThan(end)) {
 169       try {
 170         CodeBlob blob = findBlobUnsafe(ptr);
 171         if (blob != null) {
 172           visitor.visit(blob);
 173           if (blob == lastBlob) {
 174             throw new InternalError("saw same blob twice");
 175           }
 176           lastBlob = blob;
 177         }
 178       } catch (RuntimeException e) {
 179         e.printStackTrace();
 180       }
 181       Address next = heap.nextBlock(ptr);
 182       if (next != null && next.lessThan(ptr)) {
 183         throw new InternalError("pointer moved backwards");
 184       }
 185       ptr = next;
 186     }
 187     visitor.epilogue();
 188   }
 189 
 190   //--------------------------------------------------------------------------------


 150         message = message + " or ";
 151       }
 152       message = message + "SafepointBlob";
 153       if (VM.getVM().isServerCompiler()) {
 154         message = message + ", DeoptimizationBlob, or ExceptionBlob";
 155       }
 156       message = message + ")";
 157       throw new RuntimeException(message);
 158     }
 159   }
 160 
 161   public void iterate(CodeCacheVisitor visitor) {
 162     CodeHeap heap = getHeap();
 163     Address ptr = heap.begin();
 164     Address end = heap.end();
 165 
 166     visitor.prologue(ptr, end);
 167     CodeBlob lastBlob = null;
 168     while (ptr != null && ptr.lessThan(end)) {
 169       try {
 170         CodeBlob blob = findBlobUnsafe(heap.findStart(ptr));
 171         if (blob != null) {
 172           visitor.visit(blob);
 173           if (blob == lastBlob) {
 174             throw new InternalError("saw same blob twice");
 175           }
 176           lastBlob = blob;
 177         }
 178       } catch (RuntimeException e) {
 179         e.printStackTrace();
 180       }
 181       Address next = heap.nextBlock(ptr);
 182       if (next != null && next.lessThan(ptr)) {
 183         throw new InternalError("pointer moved backwards");
 184       }
 185       ptr = next;
 186     }
 187     visitor.epilogue();
 188   }
 189 
 190   //--------------------------------------------------------------------------------
agent/src/share/classes/sun/jvm/hotspot/code/CodeCache.java
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File