klass.cpp revision 4432
1472N/A * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. 342N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 342N/A * This code is free software; you can redistribute it and/or modify it 342N/A * under the terms of the GNU General Public License version 2 only, as 342N/A * published by the Free Software Foundation. 342N/A * This code is distributed in the hope that it will be useful, but WITHOUT 342N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 342N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 342N/A * version 2 for more details (a copy is included in the LICENSE file that 342N/A * accompanied this code). 342N/A * You should have received a copy of the GNU General Public License version 342N/A * 2 along with this work; if not, write to the Free Software Foundation, 342N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1472N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 342N/A // Run up the super chain and check 342N/A if (t == k)
return true;
342N/A if (t == k)
return true;
342N/A // Put some extra logic here out-of-line, before the search proper. 342N/A // This cuts down the size of the inline method. 342N/A // This is necessary, since I am never in my own secondary_super list. 342N/A // Scan the array-of-objects for a match 342N/A// Return self, except for abstract classes with exactly 1 342N/A// implementor. Then return the 1 concrete implementation. 342N/A return this;
// Return 'this' as a no-progress flag 342N/A r = s;
// Loop till find concrete class 1753N/A return r;
// Return the 1 concrete class 342N/A// Find LCA in class hierarchy 342N/A " Likely error: reflection method does not correctly" 342N/A " wrap return value in a mirror object.");
342N/A // allocate and initialize vtable 342N/A {
// Preinitialize supertype information. 342N/A // A later call to initialize_supers() may update these settings: 342N/A // The vtable pointer is installed during the execution of 1359N/A // constructors in the call to permanent_obj_allocate(). Delay 1359N/A // the installation of the klass pointer into the new klass "k" 342N/A // until after the vtable pointer has been installed (i.e., until 342N/A // after the return of permanent_obj_allocate(). 1394N/A // Note that T_ARRAY is not allowed here. 942N/A // None of the other machinery matters. 1391N/A "initialize this only once to a non-trivial value");
342N/A // Overflow of the primary_supers array forces me to be secondary. 342N/A // Now compute the list of secondary supertypes. 342N/A // Secondaries can occasionally be on the super chain, 342N/A // if the inline "_primary_supers" array overflows. 1530N/A // Compute the "real" non-extra secondaries. 1530N/A // Store the extra secondaries in the first array positions: 1530N/A int i;
// Scan for overflow primaries being duplicates of 2nd'arys 1530N/A // This happens frequently for very deeply nested arrays: the 1530N/A // primary superclass chain overflows into the secondary. The 1530N/A // secondary list contains the element_klass's secondaries with 1530N/A // an extra array dimension added. If the element_klass's 1530N/A // secondary list already contains some primary overflows, they 1530N/A // (with the extra level of array-ness) will collide with the 1530N/A // normal primary superclass overflows. 1530N/A continue;
// It's a dup, don't put it in 1530N/A // See if we had some dup's, so the array has holes in it. 1530N/A // Pack the array. Drop the old secondaries array on the floor 1530N/A // We must not copy any NULL placeholders left over from bootstrap. 342N/A // add ourselves to superklass' subklass list 342N/A "an interface can only be a subklass of Object");
547N/A // set our sibling to be the superklass' previous first subklass 342N/A // make ourselves the superklass' first subklass 1285N/A // remove receiver from sibling list 1285N/A // We update the subklass link and the subklass' sibling links here. 1285N/A // Our own sibling link will be updated by our superclass (which must be alive 342N/A // first subklass not alive, find first one alive 1285N/A // now update the subklass' sibling list 342N/A // first sibling not alive, find first one alive 1394N/A // Always follow subklass and sibling link. This will prevent any klasses from 342N/A // being unloaded (all classes are transitively linked from java.lang.Object). 342N/A // Clear the Java vtable if the oop has one. 342N/A // The vtable isn't shareable because it's in the wrong order wrt the methods 342N/A // once the method names get moved and resorted. 342N/A // No exception can be thrown by array_klass_impl when called with or_null == true. 342N/A // (In anycase, the execption mark will fail if it do so) 342N/A // No exception can be thrown by array_klass_impl when called with or_null == true. 342N/A // (In anycase, the execption mark will fail if it do so) 342N/A fatal(
"array_klass should be dispatched to instanceKlass, objArrayKlass or typeArrayKlass");
342N/A fatal(
"array_klass should be dispatched to instanceKlass, objArrayKlass or typeArrayKlass");
1394N/A// Unless overridden, modifier_flags is 0. 1394N/A// Unless overridden, jvmti_class_status has no flags set.