hotspot/agent/src/share/classes/sun/jvm/hotspot/HSDB.java

Print this page
rev 611 : Merge
   1 /*
   2  * Copyright 2000-2006 Sun Microsystems, Inc.  All Rights Reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
  20  * CA 95054 USA or visit www.sun.com if you need additional information or
  21  * have any questions.
  22  *  


 994               }
 995               String methodAnno = "Interpreter frame methodOop";
 996               if (interpreterFrameMethod == null) {
 997                 methodAnno += " (BAD OOP)";
 998               }
 999               Address a = curFrame.addressOfInterpreterFrameMethod();
1000               annoPanel.addAnnotation(new Annotation(a, a.addOffsetTo(addressSize), methodAnno));
1001               a = curFrame.addressOfInterpreterFrameCPCache();
1002               annoPanel.addAnnotation(new Annotation(a, a.addOffsetTo(addressSize), "Interpreter constant pool cache"));
1003             }
1004 
1005             RegisterMap rm = (RegisterMap) vf.getRegisterMap().clone();
1006             if (!shouldSkipOopMaps) {
1007               try {
1008                 curFrame.oopsDo(new AddressVisitor() {
1009                     public void visitAddress(Address addr) {
1010                       if (Assert.ASSERTS_ENABLED) {
1011                         Assert.that(addr.andWithMask(VM.getVM().getAddressSize() - 1) == null,
1012                                     "Address " + addr + "should have been aligned");
1013                       }
1014                       // Check contents
1015                       OopHandle handle = addr.getOopHandleAt(0);














1016                       String anno = "null oop";
1017                       if (handle != null) {
1018                         // Find location
1019                         CollectedHeap collHeap = VM.getVM().getUniverse().heap();
1020                         boolean bad = true;
1021                         anno = "BAD OOP";
1022                         if (collHeap instanceof GenCollectedHeap) { 
1023                           GenCollectedHeap heap = (GenCollectedHeap) collHeap;
1024                           for (int i = 0; i < heap.nGens(); i++) {
1025                             if (heap.getGen(i).isIn(handle)) {
1026                               if (i == 0) {
1027                                 anno = "NewGen ";
1028                               } else if (i == 1) {
1029                                 anno = "OldGen ";
1030                               } else {
1031                                 anno = "Gen " + i + " ";
1032                               }
1033                               bad = false;
1034                               break;
1035                             }


   1 /*
   2  * Copyright 2000-2008 Sun Microsystems, Inc.  All Rights Reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
  20  * CA 95054 USA or visit www.sun.com if you need additional information or
  21  * have any questions.
  22  *  


 994               }
 995               String methodAnno = "Interpreter frame methodOop";
 996               if (interpreterFrameMethod == null) {
 997                 methodAnno += " (BAD OOP)";
 998               }
 999               Address a = curFrame.addressOfInterpreterFrameMethod();
1000               annoPanel.addAnnotation(new Annotation(a, a.addOffsetTo(addressSize), methodAnno));
1001               a = curFrame.addressOfInterpreterFrameCPCache();
1002               annoPanel.addAnnotation(new Annotation(a, a.addOffsetTo(addressSize), "Interpreter constant pool cache"));
1003             }
1004 
1005             RegisterMap rm = (RegisterMap) vf.getRegisterMap().clone();
1006             if (!shouldSkipOopMaps) {
1007               try {
1008                 curFrame.oopsDo(new AddressVisitor() {
1009                     public void visitAddress(Address addr) {
1010                       if (Assert.ASSERTS_ENABLED) {
1011                         Assert.that(addr.andWithMask(VM.getVM().getAddressSize() - 1) == null,
1012                                     "Address " + addr + "should have been aligned");
1013                       }

1014                       OopHandle handle = addr.getOopHandleAt(0);
1015                       addAnnotation(addr, handle);
1016                     }
1017 
1018                     public void visitCompOopAddress(Address addr) {
1019                       if (Assert.ASSERTS_ENABLED) {
1020                         Assert.that(addr.andWithMask(VM.getVM().getAddressSize() - 1) == null,
1021                                     "Address " + addr + "should have been aligned");
1022                       }
1023                       OopHandle handle = addr.getCompOopHandleAt(0);
1024                       addAnnotation(addr, handle);
1025                     }
1026 
1027                     public void addAnnotation(Address addr, OopHandle handle) {
1028                       // Check contents
1029                       String anno = "null oop";
1030                       if (handle != null) {
1031                         // Find location
1032                         CollectedHeap collHeap = VM.getVM().getUniverse().heap();
1033                         boolean bad = true;
1034                         anno = "BAD OOP";
1035                         if (collHeap instanceof GenCollectedHeap) { 
1036                           GenCollectedHeap heap = (GenCollectedHeap) collHeap;
1037                           for (int i = 0; i < heap.nGens(); i++) {
1038                             if (heap.getGen(i).isIn(handle)) {
1039                               if (i == 0) {
1040                                 anno = "NewGen ";
1041                               } else if (i == 1) {
1042                                 anno = "OldGen ";
1043                               } else {
1044                                 anno = "Gen " + i + " ";
1045                               }
1046                               bad = false;
1047                               break;
1048                             }