1879N/A * Copyright (c) 2001, 2010, 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, 0N/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 0N/A// The following OopClosure types get specialized versions of 0N/A// "oop_oop_iterate" that invoke the closures' do_oop methods 0N/A// non-virtually, using a mechanism defined in this file. Extend these 0N/A// macros in the obvious way to add specializations for new closures. 0N/A// Forward declarations. 0N/A// This macro applies an argument macro to all OopClosures for which we 0N/A// want specialized bodies of "oop_oop_iterate". The arguments to "f" are: 0N/A// "f(closureType, non_virtual)" 0N/A// where "closureType" is the name of the particular subclass of OopClosure, 0N/A// and "non_virtual" will be the string "_nv" if the closure type should 0N/A// have its "do_oop" method invoked non-virtually, or else the 0N/A// string "_v". ("OopClosure" itself will be the only class in the latter 0N/A// This is split into several because of a Visual C++ 6.0 compiler bug 0N/A// where very long macros cause the compiler to crash 342N/A// Some other heap might define further specialized closures. 0N/A// We separate these out, because sometime the general one has 0N/A// a different definition from the specialized ones, and sometimes it 0N/A// This macro applies an argument macro to all OopClosures for which we 0N/A// want specialized bodies of a family of methods related to 0N/A// "par_oop_iterate". The arguments to f are the same as above. 0N/A// The "root_class" is the most general class to define; this may be 0N/A// "OopClosure" in some applications and "OopsInGenClosure" in others. 0N/A// This macro applies an argument macro to all OopClosures for which we 0N/A// want specialized bodies of a family of methods related to 0N/A// "oops_since_save_marks_do". The arguments to f are the same as above. 0N/A// The "root_class" is the most general class to define; this may be 0N/A// "OopClosure" in some applications and "OopsInGenClosure" in others. 342N/A// Some other heap might define further specialized closures. 0N/A// We separate these out, because sometime the general one has 0N/A// a different definition from the specialized ones, and sometimes it 0N/A// NOTE: One of the valid criticisms of this 0N/A// specialize-oop_oop_iterate-for-specific-closures idiom is that it is 0N/A// easy to have a silent performance bug: if you fail to de-virtualize, 0N/A// things still work, just slower. The "SpecializationStats" mode is 0N/A// intended to at least make such a failure easy to detect. 0N/A// *Not* using the ALL_SINCE_SAVE_MARKS_CLOSURES(f) macro defined 0N/A// below means that *only* closures for which oop_oop_iterate specializations 0N/A// exist above may be applied to "oops_since_save_marks". That is, 0N/A// this form of the performance bug is caught statically. When you add 0N/A// a definition for the general type, this property goes away. 0N/A// Make sure you test with SpecializationStats to find such bugs 0N/A// when introducing a new closure where you don't want virtual dispatch. 0N/A// For keeping stats on effectiveness. 0N/A#
else // !ENABLE_SPECIALIZATION_STATS 0N/A#
endif // ENABLE_SPECIALIZATION_STATS 1879N/A#
endif // SHARE_VM_MEMORY_SPECIALIZED_OOP_CLOSURES_HPP