10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 * 23 */ 24 25 #include "precompiled.hpp" 26 #include "classfile/javaClasses.hpp" 27 #include "classfile/dictionary.hpp" 28 #include "classfile/systemDictionary.hpp" 29 #include "classfile/vmSymbols.hpp" 30 #include "gc_implementation/shared/markSweep.inline.hpp" 31 #include "gc_interface/collectedHeap.inline.hpp" 32 #include "memory/heapInspection.hpp" 33 #include "memory/metadataFactory.hpp" 34 #include "memory/oopFactory.hpp" 35 #include "memory/resourceArea.hpp" 36 #include "oops/instanceKlass.hpp" 37 #include "oops/klass.inline.hpp" 38 #include "oops/oop.inline.hpp" 39 #include "runtime/atomic.inline.hpp" 40 #include "runtime/orderAccess.inline.hpp" 41 #include "trace/traceMacros.hpp" 42 #include "utilities/macros.hpp" 43 #include "utilities/stack.inline.hpp" 44 #if INCLUDE_ALL_GCS 45 #include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp" 46 #include "gc_implementation/parallelScavenge/psParallelCompact.hpp" 47 #include "gc_implementation/parallelScavenge/psPromotionManager.hpp" 48 #include "gc_implementation/parallelScavenge/psScavenge.hpp" 49 #endif // INCLUDE_ALL_GCS 50 51 void Klass::set_name(Symbol* n) { 52 _name = n; 53 if (_name != NULL) _name->increment_refcount(); 54 } 55 56 bool Klass::is_subclass_of(const Klass* k) const { 57 // Run up the super chain and check 58 if (this == k) return true; 59 60 Klass* t = const_cast<Klass*>(this)->super(); 61 62 while (t != NULL) { 63 if (t == k) return true; 64 t = t->super(); 65 } 66 return false; 67 } 68 | 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 * 23 */ 24 25 #include "precompiled.hpp" 26 #include "classfile/javaClasses.hpp" 27 #include "classfile/dictionary.hpp" 28 #include "classfile/systemDictionary.hpp" 29 #include "classfile/vmSymbols.hpp" 30 #include "gc_interface/collectedHeap.inline.hpp" 31 #include "memory/heapInspection.hpp" 32 #include "memory/metadataFactory.hpp" 33 #include "memory/oopFactory.hpp" 34 #include "memory/resourceArea.hpp" 35 #include "oops/instanceKlass.hpp" 36 #include "oops/klass.inline.hpp" 37 #include "oops/oop.inline.hpp" 38 #include "runtime/atomic.inline.hpp" 39 #include "runtime/orderAccess.inline.hpp" 40 #include "trace/traceMacros.hpp" 41 #include "utilities/macros.hpp" 42 #include "utilities/stack.inline.hpp" 43 #if INCLUDE_ALL_GCS 44 #include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp" 45 #endif // INCLUDE_ALL_GCS 46 47 void Klass::set_name(Symbol* n) { 48 _name = n; 49 if (_name != NULL) _name->increment_refcount(); 50 } 51 52 bool Klass::is_subclass_of(const Klass* k) const { 53 // Run up the super chain and check 54 if (this == k) return true; 55 56 Klass* t = const_cast<Klass*>(this)->super(); 57 58 while (t != NULL) { 59 if (t == k) return true; 60 t = t->super(); 61 } 62 return false; 63 } 64 |