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