classLoadingService.cpp revision 2842
0N/A * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 0N/A * published by the Free Software Foundation. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 2362N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 0N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 0N/A// Only bother with this argument setup if dtrace is available 0N/A#
else // ndef DTRACE_ENABLED 0N/A// counters for classes loaded from class files 0N/A// counters for classes loaded from shared archive // These counters are for java.lang.management API support. // They are created even if -XX:-UsePerfData is set and in // that case, they will be allocated on C heap. // Classes that can be unloaded must be non-shared // Compute method size & subtract from running total. // We are called during phase 1 of mark sweep, so it's // still ok to iterate through methodOops here. // lifted from ClassStatistics.do_class(klassOop k) // We do not have to count implementors, since we only store one! // verbose will be set to the previous value // Caller to this function must own Management_lock // For consistency of the loaded classes, grab the SystemDictionary lock // Set _loaded_classes and _current_thread and begin enumerating all classes. // Only one thread will do the enumeration at a time. // These static variables are needed and they are used by the static method // add_loaded_class called from classes_do(). // FIXME: Exclude array klasses for now // Universe::basic_type_classes_do(&add_loaded_class);