1095 // an expensive operation
1096 void decrease_limits();
1097 // it checks whether the words scanned or refs visited reached their
1098 // respective limit and calls reached_limit() if they have
1099 void check_limits() {
1100 if (_words_scanned >= _words_scanned_limit ||
1101 _refs_reached >= _refs_reached_limit) {
1102 reached_limit();
1103 }
1104 }
1105 // this is supposed to be called regularly during a marking step as
1106 // it checks a bunch of conditions that might cause the marking step
1107 // to abort
1108 void regular_clock_call();
1109 bool concurrent() { return _concurrent; }
1110
1111 // Test whether objAddr might have already been passed over by the
1112 // mark bitmap scan, and so needs to be pushed onto the mark stack.
1113 bool is_below_finger(HeapWord* objAddr, HeapWord* global_finger) const;
1114
1115 public:
1116 // It resets the task; it should be called right at the beginning of
1117 // a marking phase.
1118 void reset(CMBitMap* _nextMarkBitMap);
1119 // it clears all the fields that correspond to a claimed region.
1120 void clear_region_fields();
1121
1122 void set_concurrent(bool concurrent) { _concurrent = concurrent; }
1123
1124 // The main method of this class which performs a marking step
1125 // trying not to exceed the given duration. However, it might exit
1126 // prematurely, according to some conditions (i.e. SATB buffers are
1127 // available for processing).
1128 void do_marking_step(double target_ms,
1129 bool do_termination,
1130 bool is_serial);
1131
1132 // These two calls start and stop the timer
1133 void record_start_time() {
1134 _elapsed_time_ms = os::elapsedTime() * 1000.0;
1147 // Resets the local region fields after a task has finished scanning a
1148 // region; or when they have become stale as a result of the region
1149 // being evacuated.
1150 void giveup_current_region();
1151
1152 HeapWord* finger() { return _finger; }
1153
1154 bool has_aborted() { return _has_aborted; }
1155 void set_has_aborted() { _has_aborted = true; }
1156 void clear_has_aborted() { _has_aborted = false; }
1157 bool has_timed_out() { return _has_timed_out; }
1158 bool claimed() { return _claimed; }
1159
1160 void set_cm_oop_closure(G1CMOopClosure* cm_oop_closure);
1161
1162 // It grays the object by marking it and, if necessary, pushing it
1163 // on the local queue
1164 inline void deal_with_reference(oop obj);
1165
1166 // It scans an object and visits its children.
1167 void scan_object(oop obj);
1168
1169 // It pushes an object on the local queue.
1170 inline void push(oop obj);
1171
1172 // These two move entries to/from the global stack.
1173 void move_entries_to_global_stack();
1174 void get_entries_from_global_stack();
1175
1176 // It pops and scans objects from the local queue. If partially is
1177 // true, then it stops when the queue size is of a given limit. If
1178 // partially is false, then it stops when the queue is empty.
1179 void drain_local_queue(bool partially);
1180 // It moves entries from the global stack to the local queue and
1181 // drains the local queue. If partially is true, then it stops when
1182 // both the global stack and the local queue reach a given size. If
1183 // partially if false, it tries to empty them totally.
1184 void drain_global_stack(bool partially);
1185 // It keeps picking SATB buffers and processing them until no SATB
1186 // buffers are available.
1187 void drain_satb_buffers();
|
1095 // an expensive operation
1096 void decrease_limits();
1097 // it checks whether the words scanned or refs visited reached their
1098 // respective limit and calls reached_limit() if they have
1099 void check_limits() {
1100 if (_words_scanned >= _words_scanned_limit ||
1101 _refs_reached >= _refs_reached_limit) {
1102 reached_limit();
1103 }
1104 }
1105 // this is supposed to be called regularly during a marking step as
1106 // it checks a bunch of conditions that might cause the marking step
1107 // to abort
1108 void regular_clock_call();
1109 bool concurrent() { return _concurrent; }
1110
1111 // Test whether objAddr might have already been passed over by the
1112 // mark bitmap scan, and so needs to be pushed onto the mark stack.
1113 bool is_below_finger(HeapWord* objAddr, HeapWord* global_finger) const;
1114
1115 template<bool scan> void process_grey_object(oop obj);
1116
1117 public:
1118 // It resets the task; it should be called right at the beginning of
1119 // a marking phase.
1120 void reset(CMBitMap* _nextMarkBitMap);
1121 // it clears all the fields that correspond to a claimed region.
1122 void clear_region_fields();
1123
1124 void set_concurrent(bool concurrent) { _concurrent = concurrent; }
1125
1126 // The main method of this class which performs a marking step
1127 // trying not to exceed the given duration. However, it might exit
1128 // prematurely, according to some conditions (i.e. SATB buffers are
1129 // available for processing).
1130 void do_marking_step(double target_ms,
1131 bool do_termination,
1132 bool is_serial);
1133
1134 // These two calls start and stop the timer
1135 void record_start_time() {
1136 _elapsed_time_ms = os::elapsedTime() * 1000.0;
1149 // Resets the local region fields after a task has finished scanning a
1150 // region; or when they have become stale as a result of the region
1151 // being evacuated.
1152 void giveup_current_region();
1153
1154 HeapWord* finger() { return _finger; }
1155
1156 bool has_aborted() { return _has_aborted; }
1157 void set_has_aborted() { _has_aborted = true; }
1158 void clear_has_aborted() { _has_aborted = false; }
1159 bool has_timed_out() { return _has_timed_out; }
1160 bool claimed() { return _claimed; }
1161
1162 void set_cm_oop_closure(G1CMOopClosure* cm_oop_closure);
1163
1164 // It grays the object by marking it and, if necessary, pushing it
1165 // on the local queue
1166 inline void deal_with_reference(oop obj);
1167
1168 // It scans an object and visits its children.
1169 void scan_object(oop obj) { process_grey_object<true>(obj); }
1170
1171 // It pushes an object on the local queue.
1172 inline void push(oop obj);
1173
1174 // These two move entries to/from the global stack.
1175 void move_entries_to_global_stack();
1176 void get_entries_from_global_stack();
1177
1178 // It pops and scans objects from the local queue. If partially is
1179 // true, then it stops when the queue size is of a given limit. If
1180 // partially is false, then it stops when the queue is empty.
1181 void drain_local_queue(bool partially);
1182 // It moves entries from the global stack to the local queue and
1183 // drains the local queue. If partially is true, then it stops when
1184 // both the global stack and the local queue reach a given size. If
1185 // partially if false, it tries to empty them totally.
1186 void drain_global_stack(bool partially);
1187 // It keeps picking SATB buffers and processing them until no SATB
1188 // buffers are available.
1189 void drain_satb_buffers();
|