Mercurial > hg > truffle
diff src/share/vm/oops/instanceRefKlass.hpp @ 6725:da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
Summary: Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
Contributed-by: jmasa <jon.masamitsu@oracle.com>, stefank <stefan.karlsson@oracle.com>, mgerdin <mikael.gerdin@oracle.com>, never <tom.rodriguez@oracle.com>
author | coleenp |
---|---|
date | Sat, 01 Sep 2012 13:25:18 -0400 |
parents | 7cf1a74771e8 |
children | aed758eda82a |
line wrap: on
line diff
--- a/src/share/vm/oops/instanceRefKlass.hpp Fri Aug 31 16:39:35 2012 -0700 +++ b/src/share/vm/oops/instanceRefKlass.hpp Sat Sep 01 13:25:18 2012 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -27,7 +27,7 @@ #include "oops/instanceKlass.hpp" -// An instanceRefKlass is a specialized instanceKlass for Java +// An instanceRefKlass is a specialized InstanceKlass for Java // classes that are subclasses of java/lang/ref/Reference. // // These classes are used to implement soft/weak/final/phantom @@ -44,20 +44,24 @@ // and the pending list lock object in the same class is notified. -class instanceRefKlass: public instanceKlass { +class instanceRefKlass: public InstanceKlass { + friend class InstanceKlass; + + // Constructor + instanceRefKlass(int vtable_len, int itable_len, int static_field_size, int nonstatic_oop_map_size, ReferenceType rt, AccessFlags access_flags, bool is_anonymous) + : InstanceKlass(vtable_len, itable_len, static_field_size, nonstatic_oop_map_size, rt, access_flags, is_anonymous) {} + public: + instanceRefKlass() { assert(DumpSharedSpaces || UseSharedSpaces, "only for CDS"); } // Type testing bool oop_is_instanceRef() const { return true; } - // Casting from klassOop - static instanceRefKlass* cast(klassOop k) { - assert(k->klass_part()->oop_is_instanceRef(), "cast to instanceRefKlass"); - return (instanceRefKlass*) k->klass_part(); + // Casting from Klass* + static instanceRefKlass* cast(Klass* k) { + assert(k->oop_is_instanceRef(), "cast to instanceRefKlass"); + return (instanceRefKlass*) k; } - // allocation - DEFINE_ALLOCATE_PERMANENT(instanceRefKlass); - // Garbage collection int oop_adjust_pointers(oop obj); void oop_follow_contents(oop obj); @@ -65,10 +69,10 @@ // Parallel Scavenge and Parallel Old PARALLEL_GC_DECLS - int oop_oop_iterate(oop obj, OopClosure* blk) { + int oop_oop_iterate(oop obj, ExtendedOopClosure* blk) { return oop_oop_iterate_v(obj, blk); } - int oop_oop_iterate_m(oop obj, OopClosure* blk, MemRegion mr) { + int oop_oop_iterate_m(oop obj, ExtendedOopClosure* blk, MemRegion mr) { return oop_oop_iterate_v_m(obj, blk, mr); } @@ -93,7 +97,7 @@ // Update non-static oop maps so 'referent', 'nextPending' and // 'discovered' will look like non-oops - static void update_nonstatic_oop_maps(klassOop k); + static void update_nonstatic_oop_maps(Klass* k); public: // Verification