8187401: Java Stack cannot be shown on HSDB

Reviewed-by: sspitsyn, jgeorge
This commit is contained in:
Yasumasa Suenaga 2017-10-07 22:42:35 +09:00
parent b4347ad825
commit b1a725dff0
3 changed files with 53 additions and 20 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -28,20 +28,23 @@ package sun.jvm.hotspot.runtime;
VM. */
public class BasicType {
public static final int tBoolean = 4;
public static final int tChar = 5;
public static final int tFloat = 6;
public static final int tDouble = 7;
public static final int tByte = 8;
public static final int tShort = 9;
public static final int tInt = 10;
public static final int tLong = 11;
public static final int tObject = 12;
public static final int tArray = 13;
public static final int tVoid = 14;
public static final int tAddress = 15;
public static final int tConflict = 16;
public static final int tIllegal = 99;
public static final int tBoolean = 4;
public static final int tChar = 5;
public static final int tFloat = 6;
public static final int tDouble = 7;
public static final int tByte = 8;
public static final int tShort = 9;
public static final int tInt = 10;
public static final int tLong = 11;
public static final int tObject = 12;
public static final int tArray = 13;
public static final int tVoid = 14;
public static final int tAddress = 15;
public static final int tNarrowOop = 16;
public static final int tMetadata = 17;
public static final int tNarrowKlass = 18;
public static final int tConflict = 19;
public static final int tIllegal = 99;
public static final BasicType T_BOOLEAN = new BasicType(tBoolean);
public static final BasicType T_CHAR = new BasicType(tChar);
@ -55,6 +58,9 @@ public class BasicType {
public static final BasicType T_ARRAY = new BasicType(tArray);
public static final BasicType T_VOID = new BasicType(tVoid);
public static final BasicType T_ADDRESS = new BasicType(tAddress);
public static final BasicType T_NARROWOOP = new BasicType(tNarrowOop);
public static final BasicType T_METADATA = new BasicType(tMetadata);
public static final BasicType T_NARROWKLASS = new BasicType(tNarrowKlass);
public static final BasicType T_CONFLICT = new BasicType(tConflict);
public static final BasicType T_ILLEGAL = new BasicType(tIllegal);
@ -106,6 +112,18 @@ public class BasicType {
return tAddress;
}
public static int getTNarrowOop() {
return tNarrowOop;
}
public static int getTMetadata() {
return tMetadata;
}
public static int getTNarrowKlass() {
return tNarrowKlass;
}
/** For stack value type with conflicting contents */
public static int getTConflict() {
return tConflict;

View File

@ -27,6 +27,7 @@ package sun.jvm.hotspot.runtime;
import java.util.*;
import sun.jvm.hotspot.debugger.*;
import sun.jvm.hotspot.types.*;
public class StackValueCollection {
private List list;
@ -48,7 +49,15 @@ public class StackValueCollection {
public int intAt(int slot) { return (int) get(slot).getInteger(); }
public long longAt(int slot) { return VM.getVM().buildLongFromIntsPD((int) get(slot).getInteger(),
(int) get(slot+1).getInteger()); }
public OopHandle oopHandleAt(int slot) { return get(slot).getObject(); }
public OopHandle oopHandleAt(int slot) {
StackValue sv = get(slot);
if (sv.getType() == BasicType.getTConflict()) {
throw new WrongTypeException("Conflict type");
}
return sv.getObject();
}
public float floatAt(int slot) { return Float.intBitsToFloat(intAt(slot)); }
public double doubleAt(int slot) { return Double.longBitsToDouble(longAt(slot)); }
}

View File

@ -34,6 +34,7 @@ import sun.jvm.hotspot.interpreter.*;
import sun.jvm.hotspot.oops.*;
import sun.jvm.hotspot.runtime.*;
import sun.jvm.hotspot.tools.jcore.*;
import sun.jvm.hotspot.types.*;
import sun.jvm.hotspot.utilities.*;
public class HTMLGenerator implements /* imports */ ClassConstants {
@ -1928,11 +1929,16 @@ public class HTMLGenerator implements /* imports */ ClassConstants {
}
if (!method.isStatic() && !method.isNative()) {
OopHandle oopHandle = vf.getLocals().oopHandleAt(0);
try {
OopHandle oopHandle = vf.getLocals().oopHandleAt(0);
if (oopHandle != null) {
buf.append(", oop = ");
buf.append(oopHandle.toString());
if (oopHandle != null) {
buf.append(", oop = ");
buf.append(oopHandle.toString());
}
} catch (WrongTypeException e) {
// Do nothing.
// It might be caused by JIT'ed inline frame.
}
}