comparison agent/src/share/classes/sun/jvm/hotspot/oops/ObjectHeap.java @ 218:a5838065ab24

6620329: jstack prints double native methods on Solaris/sparc Summary: Fixed stack walking code in sparc to start frame walk from last_java_sp. Reviewed-by: sgoldman
author swamyv
date Tue, 24 Jun 2008 21:37:10 -0700
parents ba764ed4b6f2
children 9c2ecc2ffb12
comparison
equal deleted inserted replaced
217:411c61adc994 218:a5838065ab24
314 addPermGenLiveRegions(liveRegions, heap); 314 addPermGenLiveRegions(liveRegions, heap);
315 sortLiveRegions(liveRegions); 315 sortLiveRegions(liveRegions);
316 iterateLiveRegions(liveRegions, visitor, null); 316 iterateLiveRegions(liveRegions, visitor, null);
317 } 317 }
318 318
319 public boolean isValidMethod(OopHandle handle) {
320 OopHandle klass = Oop.getKlassForOopHandle(handle);
321 if (klass != null && klass.equals(methodKlassHandle)) {
322 return true;
323 }
324 return false;
325 }
326
319 // Creates an instance from the Oop hierarchy based based on the handle 327 // Creates an instance from the Oop hierarchy based based on the handle
320 public Oop newOop(OopHandle handle) { 328 public Oop newOop(OopHandle handle) {
321 // The only known way to detect the right type of an oop is 329 // The only known way to detect the right type of an oop is
322 // traversing the class chain until a well-known klass is recognized. 330 // traversing the class chain until a well-known klass is recognized.
323 // A more direct solution would require the klasses to expose 331 // A more direct solution would require the klasses to expose
373 if (klassKlass.equals(objArrayKlassKlassHandle)) return new ObjArray(handle, this); 381 if (klassKlass.equals(objArrayKlassKlassHandle)) return new ObjArray(handle, this);
374 if (klassKlass.equals(typeArrayKlassKlassHandle)) return new TypeArray(handle, this); 382 if (klassKlass.equals(typeArrayKlassKlassHandle)) return new TypeArray(handle, this);
375 } 383 }
376 } 384 }
377 385
378 System.err.println("Unknown oop at " + handle); 386 if (DEBUG) {
379 System.err.println("Oop's klass is " + klass); 387 System.err.println("Unknown oop at " + handle);
388 System.err.println("Oop's klass is " + klass);
389 }
380 390
381 throw new UnknownOopException(); 391 throw new UnknownOopException();
382 } 392 }
383 393
384 // Print all objects in the object heap 394 // Print all objects in the object heap