< prev index next >
src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp
Print this page
rev 52634 : 8214055: GC/C2 abstraction for phaseX
*** 1622,1626 ****
--- 1622,1669 ----
default:
break;
}
return false;
}
+
+ void ZBarrierSetC2::igvn_add_users_to_worklist(PhaseIterGVN* igvn, Node* use) const {
+ // Loading the java mirror from a Klass requires two loads and the type
+ // of the mirror load depends on the type of 'n'. See LoadNode::Value().
+ // LoadBarrier?(LoadP(LoadP(AddP(foo:Klass, #java_mirror))))
+ int use_op = use->Opcode();
+ if (use_op == Op_LoadP && use->bottom_type()->isa_rawptr()) {
+ for (DUIterator_Fast i2max, i2 = use->fast_outs(i2max); i2 < i2max; i2++) {
+ Node* u = use->fast_out(i2);
+ const Type* ut = u->bottom_type();
+ if (u->Opcode() == Op_LoadP && ut->isa_instptr()) {
+ // Search for load barriers behind the load
+ for (DUIterator_Fast i3max, i3 = u->fast_outs(i3max); i3 < i3max; i3++) {
+ Node* b = u->fast_out(i3);
+ if (is_gc_barrier_node(b)) {
+ igvn->_worklist.push(b);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ void ZBarrierSetC2::ccp_analyze(PhaseCCP* ccp, Unique_Node_List& worklist, Node* use) const {
+ // Loading the java mirror from a Klass requires two loads and the type
+ // of the mirror load depends on the type of 'n'. See LoadNode::Value().
+ int use_op = use->Opcode();
+ if (use_op == Op_LoadP && use->bottom_type()->isa_rawptr()) {
+ for (DUIterator_Fast i2max, i2 = use->fast_outs(i2max); i2 < i2max; i2++) {
+ Node* u = use->fast_out(i2);
+ const Type* ut = u->bottom_type();
+ if (u->Opcode() == Op_LoadP && ut->isa_instptr() && ut != ccp->type(u)) {
+ // Search for load barriers behind the load
+ for (DUIterator_Fast i3max, i3 = u->fast_outs(i3max); i3 < i3max; i3++) {
+ Node* b = u->fast_out(i3);
+ if (is_gc_barrier_node(b)) {
+ worklist.push(b);
+ }
+ }
+ }
+ }
+ }
+ }
< prev index next >