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_GC_SHENANDOAH_SHENANDOAHHEURISTICS_HPP
26 #define SHARE_GC_SHENANDOAH_SHENANDOAHHEURISTICS_HPP
27
28 #include "gc/shenandoah/shenandoahHeap.hpp"
29 #include "gc/shenandoah/shenandoahPhaseTimings.hpp"
30 #include "gc/shenandoah/shenandoahSharedVariables.hpp"
31 #include "memory/allocation.hpp"
32 #include "runtime/globals_extension.hpp"
33
34 #define SHENANDOAH_ERGO_DISABLE_FLAG(name) \
35 do { \
36 if (FLAG_IS_DEFAULT(name) && (name)) { \
37 log_info(gc)("Heuristics ergonomically sets -XX:-" #name); \
38 FLAG_SET_DEFAULT(name, false); \
39 } \
40 } while (0)
41
42 #define SHENANDOAH_ERGO_ENABLE_FLAG(name) \
43 do { \
44 if (FLAG_IS_DEFAULT(name) && !(name)) { \
45 log_info(gc)("Heuristics ergonomically sets -XX:+" #name); \
46 FLAG_SET_DEFAULT(name, true); \
118
119 virtual void record_requested_gc();
120
121 virtual void choose_collection_set(ShenandoahCollectionSet* collection_set);
122
123 virtual bool can_process_references();
124 virtual bool should_process_references();
125
126 virtual bool can_unload_classes();
127 virtual bool can_unload_classes_normal();
128 virtual bool should_unload_classes();
129
130 virtual const char* name() = 0;
131 virtual bool is_diagnostic() = 0;
132 virtual bool is_experimental() = 0;
133 virtual void initialize();
134
135 double time_since_last_gc() const;
136 };
137
138 #endif // SHARE_GC_SHENANDOAH_SHENANDOAHHEURISTICS_HPP
|
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_GC_SHENANDOAH_HEURISTICS_SHENANDOAHHEURISTICS_HPP
26 #define SHARE_GC_SHENANDOAH_HEURISTICS_SHENANDOAHHEURISTICS_HPP
27
28 #include "gc/shenandoah/shenandoahHeap.hpp"
29 #include "gc/shenandoah/shenandoahPhaseTimings.hpp"
30 #include "gc/shenandoah/shenandoahSharedVariables.hpp"
31 #include "memory/allocation.hpp"
32 #include "runtime/globals_extension.hpp"
33
34 #define SHENANDOAH_ERGO_DISABLE_FLAG(name) \
35 do { \
36 if (FLAG_IS_DEFAULT(name) && (name)) { \
37 log_info(gc)("Heuristics ergonomically sets -XX:-" #name); \
38 FLAG_SET_DEFAULT(name, false); \
39 } \
40 } while (0)
41
42 #define SHENANDOAH_ERGO_ENABLE_FLAG(name) \
43 do { \
44 if (FLAG_IS_DEFAULT(name) && !(name)) { \
45 log_info(gc)("Heuristics ergonomically sets -XX:+" #name); \
46 FLAG_SET_DEFAULT(name, true); \
118
119 virtual void record_requested_gc();
120
121 virtual void choose_collection_set(ShenandoahCollectionSet* collection_set);
122
123 virtual bool can_process_references();
124 virtual bool should_process_references();
125
126 virtual bool can_unload_classes();
127 virtual bool can_unload_classes_normal();
128 virtual bool should_unload_classes();
129
130 virtual const char* name() = 0;
131 virtual bool is_diagnostic() = 0;
132 virtual bool is_experimental() = 0;
133 virtual void initialize();
134
135 double time_since_last_gc() const;
136 };
137
138 #endif // SHARE_GC_SHENANDOAH_HEURISTICS_SHENANDOAHHEURISTICS_HPP
|