< prev index next > src/hotspot/share/oops/fieldInfo.hpp
Print this page
public:
// fields
// Field info extracted from the class file and stored
// as an array of 6 shorts.
! #define FIELDINFO_TAG_SIZE 2
#define FIELDINFO_TAG_OFFSET 1 << 0
#define FIELDINFO_TAG_CONTENDED 1 << 1
// Packed field has the tag, and can be either of:
// hi bits <--------------------------- lo bits
// |---------high---------|---------low---------|
// ..........................................CO
// ..........................................00 - non-contended field
! // [--contention_group--]....................10 - contended field with contention group
! // [------------------offset----------------]01 - real field offset
// Bit O indicates if the packed field contains an offset (O=1) or not (O=0)
// Bit C indicates if the field is contended (C=1) or not (C=0)
// (if it is contended, the high packed field contains the contention group)
enum FieldOffset {
access_flags_offset = 0,
name_index_offset = 1,
signature_index_offset = 2,
public:
// fields
// Field info extracted from the class file and stored
// as an array of 6 shorts.
! #define FIELDINFO_TAG_SIZE 3
#define FIELDINFO_TAG_OFFSET 1 << 0
#define FIELDINFO_TAG_CONTENDED 1 << 1
+ #define FIELDINFO_TAG_INLINED 1 << 2
// Packed field has the tag, and can be either of:
// hi bits <--------------------------- lo bits
// |---------high---------|---------low---------|
// ..........................................CO
// ..........................................00 - non-contended field
! // [--contention_group--]...................I10 - contended field with contention group
! // [------------------offset---------------]I01 - real field offset
// Bit O indicates if the packed field contains an offset (O=1) or not (O=0)
// Bit C indicates if the field is contended (C=1) or not (C=0)
// (if it is contended, the high packed field contains the contention group)
+ // Bit I indicates if the field has been inlined (I=1) or not (I=0)
enum FieldOffset {
access_flags_offset = 0,
name_index_offset = 1,
signature_index_offset = 2,
}
void set_access_flags(u2 val) { _shorts[access_flags_offset] = val; }
void set_offset(u4 val) {
val = val << FIELDINFO_TAG_SIZE; // make room for tag
+ bool inlined = is_inlined();
_shorts[low_packed_offset] = extract_low_short_from_int(val) | FIELDINFO_TAG_OFFSET;
+ if (inlined) set_inlined(true);
_shorts[high_packed_offset] = extract_high_short_from_int(val);
+ assert(is_inlined() || !inlined, "just checking");
+ }
+
+ void set_inlined(bool b) {
+ if (b) {
+ _shorts[low_packed_offset] |= FIELDINFO_TAG_INLINED;
+ } else {
+ _shorts[low_packed_offset] &= ~FIELDINFO_TAG_INLINED;
+ }
+ }
+
+ bool is_inlined() {
+ return (_shorts[low_packed_offset] & FIELDINFO_TAG_INLINED) != 0;
}
void set_contended_group(u2 val) {
assert((_shorts[low_packed_offset] & FIELDINFO_TAG_OFFSET) == 0, "Offset must not have been set");
assert((_shorts[low_packed_offset] & FIELDINFO_TAG_CONTENDED) == 0, "Overwritting contended group");
< prev index next >