/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#include "precompiled.hpp"
#include "classfile/systemDictionary.hpp"
#include "classfile/vmSymbols.hpp"
#include "gc_interface/collectedHeap.inline.hpp"
#include "memory/oopFactory.hpp"
#include "memory/resourceArea.hpp"
#include "oops/instanceKlass.hpp"
#include "oops/klass.inline.hpp"
#include "oops/klassOop.hpp"
#include "oops/oop.inline.hpp"
#include "oops/oop.inline2.hpp"
#include "runtime/atomic.hpp"
#include "trace/traceMacros.hpp"
_name = n;
}
// Run up the super chain and check
klassOop t = as_klassOop();
if (t == k) return true;
while (t != NULL) {
if (t == k) return true;
}
return false;
}
// Put some extra logic here out-of-line, before the search proper.
// This cuts down the size of the inline method.
// This is necessary, since I am never in my own secondary_super list.
if (this->as_klassOop() == k)
return true;
// Scan the array-of-objects for a match
for (int i = 0; i < cnt; i++) {
if (secondary_supers()->obj_at(i) == k) {
((Klass*)this)->set_secondary_super_cache(k);
return true;
}
}
return false;
}
// Return self, except for abstract classes with exactly 1
// implementor. Then return the 1 concrete implementation.
Klass *r = this;
while( r->is_abstract() ) { // Receiver is abstract?
if( !s || s->next_sibling() ) // Oops; wrong count; give up
return this; // Return 'this' as a no-progress flag
r = s; // Loop till find concrete class
}
return r; // Return the 1 concrete class
}
// Find LCA in class hierarchy
while( 1 ) {
}
}
}
}
}
return is_subclass_of(k);
}
#ifdef ASSERT
" Likely error: reflection method does not correctly"
" wrap return value in a mirror object.");
#endif
return NULL;
}
// allocate and initialize vtable
{ // Preinitialize supertype information.
// A later call to initialize_supers() may update these settings:
}
}
kl->set_modifier_flags(0);
kl->set_alloc_count(0);
kl->set_alloc_size(0);
return k;
}
}
}
// The vtable pointer is installed during the execution of
// constructors in the call to permanent_obj_allocate(). Delay
// the installation of the klass pointer into the new klass "k"
// until after the vtable pointer has been installed (i.e., until
// after the return of permanent_obj_allocate().
klassOop k =
size, CHECK_NULL);
return k->klass_part();
}
// Note that T_ARRAY is not allowed here.
return lh;
}
bool Klass::can_be_primary_super_slow() const {
return true;
return false;
else
return true;
}
if (FastSuperclassLimit == 0) {
// None of the other machinery matters.
set_super(k);
return;
}
if (k == NULL) {
"initialize this only once to a non-trivial value");
set_super(k);
if (!can_be_primary_super_slow())
}
if (my_depth < primary_super_limit()) {
} else {
// Overflow of the primary_supers array forces me to be secondary.
}
#ifdef ASSERT
{
juint j = super_depth();
klassOop t = as_klassOop();
}
}
while (t != NULL) {
--j;
}
}
#endif
}
if (secondary_supers() == NULL) {
// Now compute the list of secondary supertypes.
// Secondaries can occasionally be on the super chain,
// if the inline "_primary_supers" array overflows.
int extras = 0;
klassOop p;
for (p = super(); !(p == NULL || p->klass_part()->can_be_primary_super()); p = p->klass_part()->super()) {
++extras;
}
// Compute the "real" non-extra secondaries.
// Store the extra secondaries in the first array positions:
for (p = this_kh->super(); !(p == NULL || p->klass_part()->can_be_primary_super()); p = p->klass_part()->super()) {
int i; // Scan for overflow primaries being duplicates of 2nd'arys
// This happens frequently for very deeply nested arrays: the
// primary superclass chain overflows into the secondary. The
// secondary list contains the element_klass's secondaries with
// an extra array dimension added. If the element_klass's
// secondary list already contains some primary overflows, they
// (with the extra level of array-ness) will collide with the
// normal primary superclass overflows.
if( secondaries->obj_at(i) == p )
break;
if( i < secondaries->length() )
continue; // It's a dup, don't put it in
}
// See if we had some dup's, so the array has holes in it.
if( fillp > 0 ) {
// Pack the array. Drop the old secondaries array on the floor
// and let GC reclaim it.
}
#ifdef ASSERT
// We must not copy any NULL placeholders left over from bootstrap.
for (int j = 0; j < secondaries->length(); j++) {
}
}
#endif
}
}
return Universe::the_empty_system_obj_array();
}
}
}
}
}
}
// add ourselves to superklass' subklass list
"an interface can only be a subklass of Object");
if (prev_first_subklass != NULL) {
// set our sibling to be the superklass' previous first subklass
}
// make ourselves the superklass' first subklass
}
// remove receiver from sibling list
// first subklass
} else {
while (sib->next_sibling() != this) {
};
}
}
// We update the subklass link and the subklass' sibling links here.
// Our own sibling link will be updated by our superclass (which must be alive
// since we are).
if (ClassUnloading) {
// first subklass not alive, find first one alive
do {
#ifndef PRODUCT
if (TraceClassUnloading && WizardMode) {
}
#endif
}
// now update the subklass' sibling list
// first sibling not alive, find first one alive
do {
#ifndef PRODUCT
if (TraceClassUnloading && WizardMode) {
}
#endif
}
}
} else {
// Always follow subklass and sibling link. This will prevent any klasses from
// being unloaded (all classes are transitively linked from java.lang.Object).
}
}
if (oop_is_instance()) {
ik->unlink_class();
}
}
// Clear the Java vtable if the oop has one.
// The vtable isn't shareable because it's in the wrong order wrt the methods
// once the method names get moved and resorted.
vt->clear_vtable();
}
}
}
// No exception can be thrown by array_klass_impl when called with or_null == true.
// (In anycase, the execption mark will fail if it do so)
}
// No exception can be thrown by array_klass_impl when called with or_null == true.
// (In anycase, the execption mark will fail if it do so)
return array_klass_impl(true, THREAD);
}
fatal("array_klass should be dispatched to instanceKlass, objArrayKlass or typeArrayKlass");
return NULL;
}
fatal("array_klass should be dispatched to instanceKlass, objArrayKlass or typeArrayKlass");
return NULL;
}
f(as_klassOop());
}
if (oop_is_instance()) {
if (ik->is_anonymous()) {
return result;
}
}
return name()->as_klass_external_name();
}
return name()->as_C_string();
}
// Unless overridden, modifier_flags is 0.
return 0;
}
}
// Unless overridden, jvmti_class_status has no flags set.
return 0;
}
// Printing
// print title
if (WizardMode) {
// print header
}
// print class
}
// print title
}
// Verification
}
#ifndef PRODUCT
if (oop_is_instance()) {
assert(i>=0 && i<((instanceKlass*)this)->vtable_length()/vtableEntry::size(), "index out of bounds");
} else {
}
}
#endif