36 |
36 |
37 // Although we never intentionally push references outside of the collection |
37 // Although we never intentionally push references outside of the collection |
38 // set, due to (benign) races in the claim mechanism during RSet scanning more |
38 // set, due to (benign) races in the claim mechanism during RSet scanning more |
39 // than one thread might claim the same card. So the same card may be |
39 // than one thread might claim the same card. So the same card may be |
40 // processed multiple times. So redo this check. |
40 // processed multiple times. So redo this check. |
41 G1CollectedHeap::in_cset_state_t in_cset_state = _g1h->in_cset_state(obj); |
41 const InCSetState in_cset_state = _g1h->in_cset_state(obj); |
42 if (in_cset_state == G1CollectedHeap::InCSet) { |
42 if (in_cset_state.is_in_cset()) { |
43 oop forwardee; |
43 oop forwardee; |
44 markOop m = obj->mark(); |
44 markOop m = obj->mark(); |
45 if (m->is_marked()) { |
45 if (m->is_marked()) { |
46 forwardee = (oop) m->decode_pointer(); |
46 forwardee = (oop) m->decode_pointer(); |
47 } else { |
47 } else { |
48 forwardee = copy_to_survivor_space(obj, m); |
48 forwardee = copy_to_survivor_space(in_cset_state, obj, m); |
49 } |
49 } |
50 oopDesc::encode_store_heap_oop(p, forwardee); |
50 oopDesc::encode_store_heap_oop(p, forwardee); |
51 } else if (in_cset_state == G1CollectedHeap::IsHumongous) { |
51 } else if (in_cset_state.is_humongous()) { |
52 _g1h->set_humongous_is_live(obj); |
52 _g1h->set_humongous_is_live(obj); |
53 } else { |
53 } else { |
54 assert(in_cset_state == G1CollectedHeap::InNeither, |
54 assert(!in_cset_state.is_in_cset_or_humongous(), |
55 err_msg("In_cset_state must be InNeither here, but is %d", in_cset_state)); |
55 err_msg("In_cset_state must be NotInCSet here, but is " CSETSTATE_FORMAT, in_cset_state.value())); |
56 } |
56 } |
57 |
57 |
58 assert(obj != NULL, "Must be"); |
58 assert(obj != NULL, "Must be"); |
59 update_rs(from, p, queue_num()); |
59 update_rs(from, p, queue_num()); |
60 } |
60 } |