Mercurial > hg > graal-jvmci-8
comparison src/share/vm/runtime/sweeper.hpp @ 13400:86e6d691f2e1
8028128: Add a type safe alternative for working with counter based data
Reviewed-by: dholmes, egahlin
author | mgronlun |
---|---|
date | Sat, 23 Nov 2013 12:25:13 +0100 |
parents | 78da3894b86f |
children | 49a31fd8b93d |
comparison
equal
deleted
inserted
replaced
13399:260ac69dc096 | 13400:86e6d691f2e1 |
---|---|
23 */ | 23 */ |
24 | 24 |
25 #ifndef SHARE_VM_RUNTIME_SWEEPER_HPP | 25 #ifndef SHARE_VM_RUNTIME_SWEEPER_HPP |
26 #define SHARE_VM_RUNTIME_SWEEPER_HPP | 26 #define SHARE_VM_RUNTIME_SWEEPER_HPP |
27 | 27 |
28 #include "utilities/ticks.hpp" | |
28 // An NmethodSweeper is an incremental cleaner for: | 29 // An NmethodSweeper is an incremental cleaner for: |
29 // - cleanup inline caches | 30 // - cleanup inline caches |
30 // - reclamation of nmethods | 31 // - reclamation of nmethods |
31 // Removing nmethods from the code cache includes two operations | 32 // Removing nmethods from the code cache includes two operations |
32 // 1) mark active nmethods | 33 // 1) mark active nmethods |
69 // 1) alive -> not_entrant | 70 // 1) alive -> not_entrant |
70 // 2) not_entrant -> zombie | 71 // 2) not_entrant -> zombie |
71 // 3) zombie -> marked_for_reclamation | 72 // 3) zombie -> marked_for_reclamation |
72 // Stat counters | 73 // Stat counters |
73 static int _total_nof_methods_reclaimed; // Accumulated nof methods flushed | 74 static int _total_nof_methods_reclaimed; // Accumulated nof methods flushed |
74 static jlong _total_time_sweeping; // Accumulated time sweeping | 75 static Tickspan _total_time_sweeping; // Accumulated time sweeping |
75 static jlong _total_time_this_sweep; // Total time this sweep | 76 static Tickspan _total_time_this_sweep; // Total time this sweep |
76 static jlong _peak_sweep_time; // Peak time for a full sweep | 77 static Tickspan _peak_sweep_time; // Peak time for a full sweep |
77 static jlong _peak_sweep_fraction_time; // Peak time sweeping one fraction | 78 static Tickspan _peak_sweep_fraction_time; // Peak time sweeping one fraction |
78 | 79 |
79 static int process_nmethod(nmethod *nm); | 80 static int process_nmethod(nmethod *nm); |
80 static void release_nmethod(nmethod* nm); | 81 static void release_nmethod(nmethod* nm); |
81 | 82 |
82 static bool sweep_in_progress(); | 83 static bool sweep_in_progress(); |
85 static int _hotness_counter_reset_val; | 86 static int _hotness_counter_reset_val; |
86 | 87 |
87 public: | 88 public: |
88 static long traversal_count() { return _traversals; } | 89 static long traversal_count() { return _traversals; } |
89 static int total_nof_methods_reclaimed() { return _total_nof_methods_reclaimed; } | 90 static int total_nof_methods_reclaimed() { return _total_nof_methods_reclaimed; } |
90 static jlong total_time_sweeping() { return _total_time_sweeping; } | 91 static const Tickspan total_time_sweeping() { return _total_time_sweeping; } |
91 static jlong peak_sweep_time() { return _peak_sweep_time; } | 92 static const Tickspan peak_sweep_time() { return _peak_sweep_time; } |
92 static jlong peak_sweep_fraction_time() { return _peak_sweep_fraction_time; } | 93 static const Tickspan peak_sweep_fraction_time() { return _peak_sweep_fraction_time; } |
93 static void log_sweep(const char* msg, const char* format = NULL, ...); | 94 static void log_sweep(const char* msg, const char* format = NULL, ...); |
94 | 95 |
95 | 96 |
96 #ifdef ASSERT | 97 #ifdef ASSERT |
97 static bool is_sweeping(nmethod* which) { return _current == which; } | 98 static bool is_sweeping(nmethod* which) { return _current == which; } |