mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 11:04:34 +02:00
6964458: Reimplement class meta-data storage to use native memory
Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com> Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com> Co-authored-by: Tom Rodriguez <tom.rodriguez@oracle.com> Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
This commit is contained in:
parent
36eee7c8c8
commit
5c58d27aac
853 changed files with 26124 additions and 82956 deletions
|
@ -841,7 +841,7 @@ uint LoadNode::cmp( const Node &n ) const
|
|||
{ return !Type::cmp( _type, ((LoadNode&)n)._type ); }
|
||||
const Type *LoadNode::bottom_type() const { return _type; }
|
||||
uint LoadNode::ideal_reg() const {
|
||||
return Matcher::base2reg[_type->base()];
|
||||
return _type->ideal_reg();
|
||||
}
|
||||
|
||||
#ifndef PRODUCT
|
||||
|
@ -1660,7 +1660,7 @@ const Type *LoadNode::Value( PhaseTransform *phase ) const {
|
|||
return TypeInt::make(klass->super_check_offset());
|
||||
}
|
||||
// Compute index into primary_supers array
|
||||
juint depth = (tkls->offset() - in_bytes(Klass::primary_supers_offset())) / sizeof(klassOop);
|
||||
juint depth = (tkls->offset() - in_bytes(Klass::primary_supers_offset())) / sizeof(Klass*);
|
||||
// Check for overflowing; use unsigned compare to handle the negative case.
|
||||
if( depth < ciKlass::primary_super_limit() ) {
|
||||
// The field is an element of Klass::_primary_supers. Return its (constant) value.
|
||||
|
@ -1690,13 +1690,13 @@ const Type *LoadNode::Value( PhaseTransform *phase ) const {
|
|||
// shallow enough depth. Even though the klass is not exact, entries less
|
||||
// than or equal to its super depth are correct.
|
||||
if (klass->is_loaded() ) {
|
||||
ciType *inner = klass->klass();
|
||||
ciType *inner = klass;
|
||||
while( inner->is_obj_array_klass() )
|
||||
inner = inner->as_obj_array_klass()->base_element_type();
|
||||
if( inner->is_instance_klass() &&
|
||||
!inner->as_instance_klass()->flags().is_interface() ) {
|
||||
// Compute index into primary_supers array
|
||||
juint depth = (tkls->offset() - in_bytes(Klass::primary_supers_offset())) / sizeof(klassOop);
|
||||
juint depth = (tkls->offset() - in_bytes(Klass::primary_supers_offset())) / sizeof(Klass*);
|
||||
// Check for overflowing; use unsigned compare to handle the negative case.
|
||||
if( depth < ciKlass::primary_super_limit() &&
|
||||
depth <= klass->super_depth() ) { // allow self-depth checks to handle self-check case
|
||||
|
@ -1891,10 +1891,11 @@ Node *LoadKlassNode::make( PhaseGVN& gvn, Node *mem, Node *adr, const TypePtr* a
|
|||
Compile* C = gvn.C;
|
||||
Node *ctl = NULL;
|
||||
// sanity check the alias category against the created node type
|
||||
const TypeOopPtr *adr_type = adr->bottom_type()->isa_oopptr();
|
||||
assert(adr_type != NULL, "expecting TypeOopPtr");
|
||||
const TypePtr *adr_type = adr->bottom_type()->isa_ptr();
|
||||
assert(adr_type != NULL, "expecting TypeKlassPtr");
|
||||
#ifdef _LP64
|
||||
if (adr_type->is_ptr_to_narrowoop()) {
|
||||
assert(UseCompressedKlassPointers, "no compressed klasses");
|
||||
Node* load_klass = gvn.transform(new (C, 3) LoadNKlassNode(ctl, mem, adr, at, tk->make_narrowoop()));
|
||||
return new (C, 2) DecodeNNode(load_klass, load_klass->bottom_type()->make_ptr());
|
||||
}
|
||||
|
@ -2065,7 +2066,7 @@ Node* LoadNode::klass_identity_common(PhaseTransform *phase ) {
|
|||
}
|
||||
}
|
||||
|
||||
// Simplify k.java_mirror.as_klass to plain k, where k is a klassOop.
|
||||
// Simplify k.java_mirror.as_klass to plain k, where k is a Klass*.
|
||||
// Simplify ak.component_mirror.array_klass to plain ak, ak an arrayKlass.
|
||||
// See inline_native_Class_query for occurrences of these patterns.
|
||||
// Java Example: x.getClass().isAssignableFrom(y)
|
||||
|
@ -2074,7 +2075,7 @@ Node* LoadNode::klass_identity_common(PhaseTransform *phase ) {
|
|||
// This improves reflective code, often making the Class
|
||||
// mirror go completely dead. (Current exception: Class
|
||||
// mirrors may appear in debug info, but we could clean them out by
|
||||
// introducing a new debug info operator for klassOop.java_mirror).
|
||||
// introducing a new debug info operator for Klass*.java_mirror).
|
||||
if (toop->isa_instptr() && toop->klass() == phase->C->env()->Class_klass()
|
||||
&& (offset == java_lang_Class::klass_offset_in_bytes() ||
|
||||
offset == java_lang_Class::array_klass_offset_in_bytes())) {
|
||||
|
@ -2223,11 +2224,12 @@ StoreNode* StoreNode::make( PhaseGVN& gvn, Node* ctl, Node* mem, Node* adr, cons
|
|||
case T_LONG: return new (C, 4) StoreLNode(ctl, mem, adr, adr_type, val);
|
||||
case T_FLOAT: return new (C, 4) StoreFNode(ctl, mem, adr, adr_type, val);
|
||||
case T_DOUBLE: return new (C, 4) StoreDNode(ctl, mem, adr, adr_type, val);
|
||||
case T_METADATA:
|
||||
case T_ADDRESS:
|
||||
case T_OBJECT:
|
||||
#ifdef _LP64
|
||||
if (adr->bottom_type()->is_ptr_to_narrowoop() ||
|
||||
(UseCompressedOops && val->bottom_type()->isa_klassptr() &&
|
||||
(UseCompressedKlassPointers && val->bottom_type()->isa_klassptr() &&
|
||||
adr->bottom_type()->isa_rawptr())) {
|
||||
val = gvn.transform(new (C, 2) EncodePNode(val, val->bottom_type()->make_narrowoop()));
|
||||
return new (C, 4) StoreNNode(ctl, mem, adr, adr_type, val);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue