< prev index next >
src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/DataLayout.java
Print this page
*** 45,67 ****
public static final int callTypeDataTag = 10;
public static final int virtualCallTypeDataTag = 11;
public static final int parametersTypeDataTag = 12;
public static final int speculativeTrapDataTag = 13;
! // The _struct._flags word is formatted as [trapState:4 | flags:4].
! // The trap state breaks down further as [recompile:1 | reason:3].
// This further breakdown is defined in deoptimization.cpp.
// See Deoptimization.trapStateReason for an assert that
// trapBits is big enough to hold reasons < reasonRecordedLimit.
//
// The trapState is collected only if ProfileTraps is true.
! public static final int trapBits = 1+3; // 3: enough to distinguish [0..reasonRecordedLimit].
! public static final int trapShift = 8 - trapBits;
public static final int trapMask = Bits.rightNBits(trapBits);
- public static final int trapMaskInPlace = (trapMask << trapShift);
- public static final int flagLimit = trapShift;
- public static final int flagMask = Bits.rightNBits(flagLimit);
public static final int firstFlag = 0;
private Address data;
private int offset;
--- 45,62 ----
public static final int callTypeDataTag = 10;
public static final int virtualCallTypeDataTag = 11;
public static final int parametersTypeDataTag = 12;
public static final int speculativeTrapDataTag = 13;
! // The trap state breaks down as [recompile:1 | reason:31].
// This further breakdown is defined in deoptimization.cpp.
// See Deoptimization.trapStateReason for an assert that
// trapBits is big enough to hold reasons < reasonRecordedLimit.
//
// The trapState is collected only if ProfileTraps is true.
! public static final int trapBits = 1+31; // 31: enough to distinguish [0..reasonRecordedLimit].
public static final int trapMask = Bits.rightNBits(trapBits);
public static final int firstFlag = 0;
private Address data;
private int offset;
*** 95,114 ****
return data.getAddressAt(offset + cellOffset(index));
}
// Every data layout begins with a header. This header
// contains a tag, which is used to indicate the size/layout
! // of the data, 4 bits of flags, which can be used in any way,
! // 4 bits of trap history (none/one reason/many reasons),
// and a bci, which is used to tie this piece of data to a
// specific bci in the bytecodes.
// union {
! // intptrT _bits;
// struct {
// u1 _tag;
// u1 _flags;
// u2 _bci;
// } _struct;
// } _header;
// Some types of data layouts need a length field.
static boolean needsArrayLen(int tag) {
--- 90,110 ----
return data.getAddressAt(offset + cellOffset(index));
}
// Every data layout begins with a header. This header
// contains a tag, which is used to indicate the size/layout
! // of the data, 8 bits of flags, which can be used in any way,
! // 32 bits of trap history (none/one reason/many reasons),
// and a bci, which is used to tie this piece of data to a
// specific bci in the bytecodes.
// union {
! // u8 _bits;
// struct {
// u1 _tag;
// u1 _flags;
// u2 _bci;
+ // u4 _traps;
// } _struct;
// } _header;
// Some types of data layouts need a length field.
static boolean needsArrayLen(int tag) {
*** 117,130 ****
public static final int counterIncrement = 1;
// Size computation
static int headerSizeInBytes() {
! return MethodData.cellSize;
}
static int headerSizeInCells() {
! return 1;
}
static public int computeSizeInBytes(int cellCount) {
return headerSizeInBytes() + cellCount * MethodData.cellSize;
}
--- 113,126 ----
public static final int counterIncrement = 1;
// Size computation
static int headerSizeInBytes() {
! return MethodData.cellSize * headerSizeInCells();
}
static int headerSizeInCells() {
! return VM.getVM().isLP64() ? 1 : 2;
}
static public int computeSizeInBytes(int cellCount) {
return headerSizeInBytes() + cellCount * MethodData.cellSize;
}
*** 144,154 ****
// traps are common or not. If a BCI shows that a trap X has
// occurred, and the MDO shows N occurrences of X, we make the
// simplifying assumption that all N occurrences can be blamed
// on that BCI.
int trapState() {
! return (flags() >> trapShift) & trapMask;
}
int flags() {
return getU11(1);
}
--- 140,150 ----
// traps are common or not. If a BCI shows that a trap X has
// occurred, and the MDO shows N occurrences of X, we make the
// simplifying assumption that all N occurrences can be blamed
// on that BCI.
int trapState() {
! return data.getJIntAt(offset+4);
}
int flags() {
return getU11(1);
}
< prev index next >