1 /*
2 * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
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 *
1022
1023 // true when the task is during a concurrent phase, false when it is
1024 // in the remark phase (so, in the latter case, we do not have to
1025 // check all the things that we have to check during the concurrent
1026 // phase, i.e. SATB buffer availability...)
1027 bool _concurrent;
1028
1029 TruncatedSeq _marking_step_diffs_ms;
1030
1031 // Counting data structures. Embedding the task's marked_bytes_array
1032 // and card bitmap into the actual task saves having to go through
1033 // the ConcurrentMark object.
1034 size_t* _marked_bytes_array;
1035 BitMap* _card_bm;
1036
1037 // LOTS of statistics related with this task
1038 #if _MARKING_STATS_
1039 NumberSeq _all_clock_intervals_ms;
1040 double _interval_start_time_ms;
1041
1042 int _aborted;
1043 int _aborted_overflow;
1044 int _aborted_cm_aborted;
1045 int _aborted_yield;
1046 int _aborted_timed_out;
1047 int _aborted_satb;
1048 int _aborted_termination;
1049
1050 int _steal_attempts;
1051 int _steals;
1052
1053 int _clock_due_to_marking;
1054 int _clock_due_to_scanning;
1055
1056 int _local_pushes;
1057 int _local_pops;
1058 int _local_max_size;
1059 int _objs_scanned;
1060
1061 int _global_pushes;
1062 int _global_pops;
1063 int _global_max_size;
1064
1065 int _global_transfers_to;
1066 int _global_transfers_from;
1067
1068 int _regions_claimed;
1069 int _objs_found_on_bitmap;
1070
1071 int _satb_buffers_processed;
1072 #endif // _MARKING_STATS_
1073
1074 // it updates the local fields after this task has claimed
1075 // a new region to scan
1076 void setup_for_region(HeapRegion* hr);
1077 // it brings up-to-date the limit of the region
1078 void update_region_limit();
1079
1080 // called when either the words scanned or the refs visited limit
1081 // has been reached
1082 void reached_limit();
1083 // recalculates the words scanned and refs visited limits
1084 void recalculate_limits();
1085 // decreases the words scanned and refs visited limits when we reach
1086 // an expensive operation
1087 void decrease_limits();
1088 // it checks whether the words scanned or refs visited reached their
1089 // respective limit and calls reached_limit() if they have
1090 void check_limits() {
1091 if (_words_scanned >= _words_scanned_limit ||
|
1 /*
2 * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
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 *
1022
1023 // true when the task is during a concurrent phase, false when it is
1024 // in the remark phase (so, in the latter case, we do not have to
1025 // check all the things that we have to check during the concurrent
1026 // phase, i.e. SATB buffer availability...)
1027 bool _concurrent;
1028
1029 TruncatedSeq _marking_step_diffs_ms;
1030
1031 // Counting data structures. Embedding the task's marked_bytes_array
1032 // and card bitmap into the actual task saves having to go through
1033 // the ConcurrentMark object.
1034 size_t* _marked_bytes_array;
1035 BitMap* _card_bm;
1036
1037 // LOTS of statistics related with this task
1038 #if _MARKING_STATS_
1039 NumberSeq _all_clock_intervals_ms;
1040 double _interval_start_time_ms;
1041
1042 size_t _aborted;
1043 size_t _aborted_overflow;
1044 size_t _aborted_cm_aborted;
1045 size_t _aborted_yield;
1046 size_t _aborted_timed_out;
1047 size_t _aborted_satb;
1048 size_t _aborted_termination;
1049
1050 size_t _steal_attempts;
1051 size_t _steals;
1052
1053 size_t _clock_due_to_marking;
1054 size_t _clock_due_to_scanning;
1055
1056 size_t _local_pushes;
1057 size_t _local_pops;
1058 size_t _local_max_size;
1059 size_t _objs_scanned;
1060
1061 size_t _global_pushes;
1062 size_t _global_pops;
1063 size_t _global_max_size;
1064
1065 size_t _global_transfers_to;
1066 size_t _global_transfers_from;
1067
1068 size_t _regions_claimed;
1069 size_t _objs_found_on_bitmap;
1070
1071 size_t _satb_buffers_processed;
1072 #endif // _MARKING_STATS_
1073
1074 // it updates the local fields after this task has claimed
1075 // a new region to scan
1076 void setup_for_region(HeapRegion* hr);
1077 // it brings up-to-date the limit of the region
1078 void update_region_limit();
1079
1080 // called when either the words scanned or the refs visited limit
1081 // has been reached
1082 void reached_limit();
1083 // recalculates the words scanned and refs visited limits
1084 void recalculate_limits();
1085 // decreases the words scanned and refs visited limits when we reach
1086 // an expensive operation
1087 void decrease_limits();
1088 // it checks whether the words scanned or refs visited reached their
1089 // respective limit and calls reached_limit() if they have
1090 void check_limits() {
1091 if (_words_scanned >= _words_scanned_limit ||
|