1 /*
2 * Copyright (c) 2002, 2011, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
766 // unresolved klass literal
767 buf.append(instrStr);
768 }
769 } else {
770 // not a klass literal
771 buf.append(instrStr);
772 }
773 } else {
774 buf.append(instrStr);
775 }
776 buf.endTag("td");
777 buf.endTag("tr");
778 }
779
780 public void epilogue() {
781 buf.endTable();
782 }
783 });
784
785 // display exception table for this method
786 TypeArray exceptionTable = method.getExceptionTable();
787 // exception table is 4 tuple array of shorts
788 int numEntries = (int)exceptionTable.getLength() / 4;
789 if (numEntries != 0) {
790 buf.h4("Exception Table");
791 buf.beginTable(1);
792 buf.beginTag("tr");
793 buf.headerCell("start bci");
794 buf.headerCell("end bci");
795 buf.headerCell("handler bci");
796 buf.headerCell("catch type");
797 buf.endTag("tr");
798
799 for (int e = 0; e < numEntries; e += 4) {
800 buf.beginTag("tr");
801 buf.cell(Integer.toString(exceptionTable.getIntAt(e)));
802 buf.cell(Integer.toString(exceptionTable.getIntAt(e + 1)));
803 buf.cell(Integer.toString(exceptionTable.getIntAt(e + 2)));
804 short cpIndex = (short) exceptionTable.getIntAt(e + 3);
805 ConstantPool.CPSlot obj = cpIndex == 0? null : cpool.getSlotAt(cpIndex);
806 if (obj == null) {
807 buf.cell("Any");
808 } else if (obj.isMetaData()) {
809 buf.cell(obj.getSymbol().asString().replace('/', '.'));
810 } else {
811 buf.cell(genKlassLink((InstanceKlass)obj.getOop()));
812 }
813 buf.endTag("tr");
814 }
815
816 buf.endTable();
817 }
818
819 // display constant pool hyperlink
820 buf.h3("Constant Pool");
821 buf.append(genConstantPoolLink(cpool));
822 buf.genHTMLEpilogue();
823 return buf.toString();
824 } catch (Exception exp) {
825 return genHTMLErrorMessage(exp);
826 }
827 }
828
829 protected Disassembler createDisassembler(long startPc, byte[] code) {
830 return getCPUHelper().createDisassembler(startPc, code);
831 }
832
833 protected SymbolFinder createSymbolFinder() {
834 return new DummySymbolFinder();
835 }
836
837 // genHTML for a given address. Address may be a PC or
|
1 /*
2 * Copyright (c) 2002, 2012, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
766 // unresolved klass literal
767 buf.append(instrStr);
768 }
769 } else {
770 // not a klass literal
771 buf.append(instrStr);
772 }
773 } else {
774 buf.append(instrStr);
775 }
776 buf.endTag("td");
777 buf.endTag("tr");
778 }
779
780 public void epilogue() {
781 buf.endTable();
782 }
783 });
784
785 // display exception table for this method
786 boolean hasException = method.hasExceptionTable();
787 if (hasException) {
788 ExceptionTableElement[] exceptionTable = method.getExceptionTable();
789 int numEntries = exceptionTable.length;
790 if (numEntries != 0) {
791 buf.h4("Exception Table");
792 buf.beginTable(1);
793 buf.beginTag("tr");
794 buf.headerCell("start bci");
795 buf.headerCell("end bci");
796 buf.headerCell("handler bci");
797 buf.headerCell("catch type");
798 buf.endTag("tr");
799
800 for (int e = 0; e < numEntries; e ++) {
801 buf.beginTag("tr");
802 buf.cell(Integer.toString(exceptionTable[e].getStartPC()));
803 buf.cell(Integer.toString(exceptionTable[e].getEndPC()));
804 buf.cell(Integer.toString(exceptionTable[e].getHandlerPC()));
805 short cpIndex = (short) exceptionTable[e].getCatchTypeIndex();
806 ConstantPool.CPSlot obj = cpIndex == 0? null : cpool.getSlotAt(cpIndex);
807 if (obj == null) {
808 buf.cell("Any");
809 } else if (obj.isMetaData()) {
810 buf.cell(obj.getSymbol().asString().replace('/', '.'));
811 } else {
812 buf.cell(genKlassLink((InstanceKlass)obj.getOop()));
813 }
814 buf.endTag("tr");
815 }
816
817 buf.endTable();
818 }
819 }
820
821 // display constant pool hyperlink
822 buf.h3("Constant Pool");
823 buf.append(genConstantPoolLink(cpool));
824 buf.genHTMLEpilogue();
825 return buf.toString();
826 } catch (Exception exp) {
827 return genHTMLErrorMessage(exp);
828 }
829 }
830
831 protected Disassembler createDisassembler(long startPc, byte[] code) {
832 return getCPUHelper().createDisassembler(startPc, code);
833 }
834
835 protected SymbolFinder createSymbolFinder() {
836 return new DummySymbolFinder();
837 }
838
839 // genHTML for a given address. Address may be a PC or
|