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