1 /*
2 * Copyright (c) 2001, 2006, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
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 // The following OopClosure types get specialized versions of
26 // "oop_oop_iterate" that invoke the closures' do_oop methods
27 // non-virtually, using a mechanism defined in this file. Extend these
28 // macros in the obvious way to add specializations for new closures.
29
30 // Forward declarations.
31 class OopClosure;
32 class OopsInGenClosure;
33 // DefNew
34 class ScanClosure;
35 class FastScanClosure;
36 class FilteringClosure;
37 // ParNew
38 class ParScanWithBarrierClosure;
39 class ParScanWithoutBarrierClosure;
40 // CMS
41 class MarkRefsIntoAndScanClosure;
42 class Par_MarkRefsIntoAndScanClosure;
43 class PushAndMarkClosure;
44 class Par_PushAndMarkClosure;
234 inline void SpecializationStats::record_do_oop_call_v(Kind k) {
235 Atomic::inc(&_numDoOopCallsTotal[k]);
236 }
237 inline void SpecializationStats::record_do_oop_call_nv(Kind k) {
238 Atomic::inc(&_numDoOopCallsTotal[k]);
239 Atomic::inc(&_numDoOopCalls_nv[k]);
240 }
241
242 #else // !ENABLE_SPECIALIZATION_STATS
243
244 inline void SpecializationStats::record_call() {}
245 inline void SpecializationStats::record_iterate_call_v(Kind k) {}
246 inline void SpecializationStats::record_iterate_call_nv(Kind k) {}
247 inline void SpecializationStats::record_do_oop_call_v(Kind k) {}
248 inline void SpecializationStats::record_do_oop_call_nv(Kind k) {}
249 inline void SpecializationStats::clear() {}
250 inline void SpecializationStats::print() {}
251
252 #endif // ENABLE_SPECIALIZATION_STATS
253 #endif // !PRODUCT
|
1 /*
2 * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
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 #ifndef SHARE_VM_MEMORY_SPECIALIZED_OOP_CLOSURES_HPP
26 #define SHARE_VM_MEMORY_SPECIALIZED_OOP_CLOSURES_HPP
27
28 #include "runtime/atomic.hpp"
29 #ifndef SERIALGC
30 #include "gc_implementation/g1/g1_specialized_oop_closures.hpp"
31 #endif
32
33 // The following OopClosure types get specialized versions of
34 // "oop_oop_iterate" that invoke the closures' do_oop methods
35 // non-virtually, using a mechanism defined in this file. Extend these
36 // macros in the obvious way to add specializations for new closures.
37
38 // Forward declarations.
39 class OopClosure;
40 class OopsInGenClosure;
41 // DefNew
42 class ScanClosure;
43 class FastScanClosure;
44 class FilteringClosure;
45 // ParNew
46 class ParScanWithBarrierClosure;
47 class ParScanWithoutBarrierClosure;
48 // CMS
49 class MarkRefsIntoAndScanClosure;
50 class Par_MarkRefsIntoAndScanClosure;
51 class PushAndMarkClosure;
52 class Par_PushAndMarkClosure;
242 inline void SpecializationStats::record_do_oop_call_v(Kind k) {
243 Atomic::inc(&_numDoOopCallsTotal[k]);
244 }
245 inline void SpecializationStats::record_do_oop_call_nv(Kind k) {
246 Atomic::inc(&_numDoOopCallsTotal[k]);
247 Atomic::inc(&_numDoOopCalls_nv[k]);
248 }
249
250 #else // !ENABLE_SPECIALIZATION_STATS
251
252 inline void SpecializationStats::record_call() {}
253 inline void SpecializationStats::record_iterate_call_v(Kind k) {}
254 inline void SpecializationStats::record_iterate_call_nv(Kind k) {}
255 inline void SpecializationStats::record_do_oop_call_v(Kind k) {}
256 inline void SpecializationStats::record_do_oop_call_nv(Kind k) {}
257 inline void SpecializationStats::clear() {}
258 inline void SpecializationStats::print() {}
259
260 #endif // ENABLE_SPECIALIZATION_STATS
261 #endif // !PRODUCT
262
263 #endif // SHARE_VM_MEMORY_SPECIALIZED_OOP_CLOSURES_HPP
|