< prev index next > src/hotspot/share/oops/cpCache.hpp
Print this page
// bit length |-8--|-8--|---16----|
// --------------------------------
// _indices [ b2 | b1 | index ] index = constant_pool_index
// _f1 [ entry specific ] metadata ptr (method or klass)
// _f2 [ entry specific ] vtable or res_ref index, or vfinal method ptr
! // _flags [tos|0|F=1|0|0|0|f|v|0 |0000|field_index] (for field entries)
// bit length [ 4 |1| 1 |1|1|1|1|1|1 |1 |-3-|----16-----]
// _flags [tos|0|F=0|S|A|I|f|0|vf|indy_rf|000|00000|psize] (for method entries)
// bit length [ 4 |1| 1 |1|1|1|1|1|1 |-4--|--8--|--8--]
// --------------------------------
// bit length |-8--|-8--|---16----|
// --------------------------------
// _indices [ b2 | b1 | index ] index = constant_pool_index
// _f1 [ entry specific ] metadata ptr (method or klass)
// _f2 [ entry specific ] vtable or res_ref index, or vfinal method ptr
! // _flags [tos|0|F=1|0|I|i|f|v|0 |0000|field_index] (for field entries)
// bit length [ 4 |1| 1 |1|1|1|1|1|1 |1 |-3-|----16-----]
// _flags [tos|0|F=0|S|A|I|f|0|vf|indy_rf|000|00000|psize] (for method entries)
// bit length [ 4 |1| 1 |1|1|1|1|1|1 |-4--|--8--|--8--]
// --------------------------------
// vf = virtual but final (method entries only: is_vfinal())
// indy_rf = call site specifier method resolution failed
//
// The flags after TosState have the following interpretation:
// bit 27: 0 for fields, 1 for methods
+ // I flag true if field is a null free inline type (must never be null)
+ // i flag true if field is inlined
// f flag true if field is marked final
// v flag true if field is volatile (only for fields)
// f2 flag true if f2 contains an oop (e.g., virtual final method)
// fv flag true if invokeinterface used for method in class Object
//
tos_state_shift = BitsPerInt - tos_state_bits, // see verify_tos_state_shift below
// misc. option bits; can be any bit position in [16..27]
is_field_entry_shift = 26, // (F) is it a field or a method?
has_local_signature_shift = 25, // (S) does the call site have a per-site signature (sig-poly methods)?
has_appendix_shift = 24, // (A) does the call site have an appendix argument?
+ is_null_free_inline_type_shift = 24, // (I) is the field a null free inline type (must never be null)
is_forced_virtual_shift = 23, // (I) is the interface reference forced to virtual mode?
+ is_inlined_shift = 23, // (i) is the field inlined?
is_final_shift = 22, // (f) is the field or method final?
is_volatile_shift = 21, // (v) is the field volatile?
is_vfinal_shift = 20, // (vf) did the call resolve to a final method?
indy_resolution_failed_shift= 19, // (indy_rf) did call site specifier resolution fail ?
// low order bits give field index (for FieldInfo) or method parameter size:
Klass* field_holder, // the object/klass holding the field
int orig_field_index, // the original field index in the field holder
int field_offset, // the field offset in words in the field holder
TosState field_type, // the (machine) field type
bool is_final, // the field is final
! bool is_volatile // the field is volatile
);
private:
void set_direct_or_vtable_call(
Bytecodes::Code invoke_code, // the bytecode used for invoking the method
Klass* field_holder, // the object/klass holding the field
int orig_field_index, // the original field index in the field holder
int field_offset, // the field offset in words in the field holder
TosState field_type, // the (machine) field type
bool is_final, // the field is final
! bool is_volatile, // the field is volatile
+ bool is_inlined, // the field is inlined
+ bool is_null_free_inline_type // the field is an inline type (must never be null)
);
private:
void set_direct_or_vtable_call(
Bytecodes::Code invoke_code, // the bytecode used for invoking the method
case Bytecodes::_invokehandle : // fall through
case Bytecodes::_invokedynamic : // fall through
case Bytecodes::_invokeinterface : return 1;
case Bytecodes::_putstatic : // fall through
case Bytecodes::_putfield : // fall through
+ case Bytecodes::_withfield : // fall through
case Bytecodes::_invokevirtual : return 2;
default : break;
}
return -1;
}
// cache->main_entry_index().
bool is_f1_null() const; // classifies a CPC entry as unbound
int f2_as_index() const { assert(!is_vfinal(), ""); return (int) _f2; }
Method* f2_as_vfinal_method() const { assert(is_vfinal(), ""); return (Method*)_f2; }
Method* f2_as_interface_method() const;
+ int f2_as_offset() const { assert(is_field_entry(), ""); return (int)_f2; }
intx flags_ord() const;
int field_index() const { assert(is_field_entry(), ""); return (_flags & field_index_mask); }
int parameter_size() const { assert(is_method_entry(), ""); return (_flags & parameter_size_mask); }
bool is_volatile() const { return (_flags & (1 << is_volatile_shift)) != 0; }
bool is_final() const { return (_flags & (1 << is_final_shift)) != 0; }
+ bool is_inlined() const { return (_flags & (1 << is_inlined_shift)) != 0; }
bool is_forced_virtual() const { return (_flags & (1 << is_forced_virtual_shift)) != 0; }
bool is_vfinal() const { return (_flags & (1 << is_vfinal_shift)) != 0; }
bool indy_resolution_failed() const;
bool has_appendix() const;
bool has_local_signature() const;
bool is_method_entry() const { return (_flags & (1 << is_field_entry_shift)) == 0; }
bool is_field_entry() const { return (_flags & (1 << is_field_entry_shift)) != 0; }
bool is_long() const { return flag_state() == ltos; }
bool is_double() const { return flag_state() == dtos; }
+ bool is_null_free_inline_type() const { return (_flags & (1 << is_null_free_inline_type_shift)) != 0; }
TosState flag_state() const { assert((uint)number_of_states <= (uint)tos_state_mask+1, "");
return (TosState)((_flags >> tos_state_shift) & tos_state_mask); }
void set_indy_resolution_failed();
// Code generation support
< prev index next >