90 inline void G1FullGCMarker::follow_array(objArrayOop array) {
91 mark_closure()->do_klass(array->klass());
92 // Don't push empty arrays to avoid unnecessary work.
93 if (array->length() > 0) {
94 push_objarray(array, 0);
95 }
96 }
97
98 void G1FullGCMarker::follow_array_chunk(objArrayOop array, int index) {
99 const int len = array->length();
100 const int beg_index = index;
101 assert(beg_index < len || len == 0, "index too large");
102
103 const int stride = MIN2(len - beg_index, (int) ObjArrayMarkingStride);
104 const int end_index = beg_index + stride;
105
106 // Push the continuation first to allow more efficient work stealing.
107 if (end_index < len) {
108 push_objarray(array, end_index);
109 }
110
111 array->oop_iterate_range(mark_closure(), beg_index, end_index);
112 }
113
114 inline void G1FullGCMarker::follow_object(oop obj) {
115 assert(_bitmap->is_marked(obj), "should be marked");
116 if (obj->is_objArray()) {
117 // Handle object arrays explicitly to allow them to
118 // be split into chunks if needed.
119 follow_array((objArrayOop)obj);
120 } else {
121 obj->oop_iterate(mark_closure());
122 }
123 }
124
125 inline void G1FullGCMarker::publish_and_drain_oop_tasks() {
126 oop obj;
127 while (_oop_stack.pop_overflow(obj)) {
128 if (!_oop_stack.try_push_to_taskqueue(obj)) {
129 assert(_bitmap->is_marked(obj), "must be marked");
130 follow_object(obj);
131 }
132 }
133 while (_oop_stack.pop_local(obj)) {
134 assert(_bitmap->is_marked(obj), "must be marked");
135 follow_object(obj);
136 }
|
90 inline void G1FullGCMarker::follow_array(objArrayOop array) {
91 mark_closure()->do_klass(array->klass());
92 // Don't push empty arrays to avoid unnecessary work.
93 if (array->length() > 0) {
94 push_objarray(array, 0);
95 }
96 }
97
98 void G1FullGCMarker::follow_array_chunk(objArrayOop array, int index) {
99 const int len = array->length();
100 const int beg_index = index;
101 assert(beg_index < len || len == 0, "index too large");
102
103 const int stride = MIN2(len - beg_index, (int) ObjArrayMarkingStride);
104 const int end_index = beg_index + stride;
105
106 // Push the continuation first to allow more efficient work stealing.
107 if (end_index < len) {
108 push_objarray(array, end_index);
109 }
110 assert(array->is_refArray(), "Must be");
111 refArrayOop(array)->oop_iterate_range(mark_closure(), beg_index, end_index);
112 }
113
114 inline void G1FullGCMarker::follow_object(oop obj) {
115 assert(_bitmap->is_marked(obj), "should be marked");
116 if (obj->is_refArray()) {
117 // Handle object arrays explicitly to allow them to
118 // be split into chunks if needed.
119 follow_array((objArrayOop)obj);
120 } else {
121 obj->oop_iterate(mark_closure());
122 }
123 }
124
125 inline void G1FullGCMarker::publish_and_drain_oop_tasks() {
126 oop obj;
127 while (_oop_stack.pop_overflow(obj)) {
128 if (!_oop_stack.try_push_to_taskqueue(obj)) {
129 assert(_bitmap->is_marked(obj), "must be marked");
130 follow_object(obj);
131 }
132 }
133 while (_oop_stack.pop_local(obj)) {
134 assert(_bitmap->is_marked(obj), "must be marked");
135 follow_object(obj);
136 }
|