1020 // Find MemBarAcquire.
1021 const Node *mba = NULL;
1022 for (DUIterator_Fast imax, i = load->fast_outs(imax); i < imax; i++) {
1023 const Node *out = load->fast_out(i);
1024 if (out->Opcode() == Op_MemBarAcquire) {
1025 if (out->in(0) == load) continue; // Skip control edge, membar should be found via precedence edge.
1026 mba = out;
1027 break;
1028 }
1029 }
1030 if (!mba) return false;
1031
1032 // Find following MemBar node.
1033 //
1034 // The following node must be reachable by control AND memory
1035 // edge to assure no other operations are in between the two nodes.
1036 //
1037 // So first get the Proj node, mem_proj, to use it to iterate forward.
1038 Node *mem_proj = NULL;
1039 for (DUIterator_Fast imax, i = mba->fast_outs(imax); i < imax; i++) {
1040 mem_proj = mba->fast_out(i); // Throw out-of-bounds if proj not found
1041 assert(mem_proj->is_Proj(), "only projections here");
1042 ProjNode *proj = mem_proj->as_Proj();
1043 if (proj->_con == TypeFunc::Memory &&
1044 !Compile::current()->node_arena()->contains(mem_proj)) // Unmatched old-space only
1045 break;
1046 }
1047 assert(mem_proj->as_Proj()->_con == TypeFunc::Memory, "Graph broken");
1048
1049 // Search MemBar behind Proj. If there are other memory operations
1050 // behind the Proj we lost.
1051 for (DUIterator_Fast jmax, j = mem_proj->fast_outs(jmax); j < jmax; j++) {
1052 Node *x = mem_proj->fast_out(j);
1053 // Proj might have an edge to a store or load node which precedes the membar.
1054 if (x->is_Mem()) return false;
1055
1056 // On PPC64 release and volatile are implemented by an instruction
1057 // that also has acquire semantics. I.e. there is no need for an
1058 // acquire before these.
1059 int xop = x->Opcode();
1060 if (xop == Op_MemBarRelease || xop == Op_MemBarVolatile) {
|
1020 // Find MemBarAcquire.
1021 const Node *mba = NULL;
1022 for (DUIterator_Fast imax, i = load->fast_outs(imax); i < imax; i++) {
1023 const Node *out = load->fast_out(i);
1024 if (out->Opcode() == Op_MemBarAcquire) {
1025 if (out->in(0) == load) continue; // Skip control edge, membar should be found via precedence edge.
1026 mba = out;
1027 break;
1028 }
1029 }
1030 if (!mba) return false;
1031
1032 // Find following MemBar node.
1033 //
1034 // The following node must be reachable by control AND memory
1035 // edge to assure no other operations are in between the two nodes.
1036 //
1037 // So first get the Proj node, mem_proj, to use it to iterate forward.
1038 Node *mem_proj = NULL;
1039 for (DUIterator_Fast imax, i = mba->fast_outs(imax); i < imax; i++) {
1040 mem_proj = mba->fast_out(i); // Throw out of bounds if proj not found
1041 assert(mem_proj->is_Proj(), "only projections here");
1042 ProjNode *proj = mem_proj->as_Proj();
1043 if (proj->_con == TypeFunc::Memory &&
1044 !Compile::current()->node_arena()->contains(mem_proj)) // Unmatched old-space only
1045 break;
1046 }
1047 assert(mem_proj->as_Proj()->_con == TypeFunc::Memory, "Graph broken");
1048
1049 // Search MemBar behind Proj. If there are other memory operations
1050 // behind the Proj we lost.
1051 for (DUIterator_Fast jmax, j = mem_proj->fast_outs(jmax); j < jmax; j++) {
1052 Node *x = mem_proj->fast_out(j);
1053 // Proj might have an edge to a store or load node which precedes the membar.
1054 if (x->is_Mem()) return false;
1055
1056 // On PPC64 release and volatile are implemented by an instruction
1057 // that also has acquire semantics. I.e. there is no need for an
1058 // acquire before these.
1059 int xop = x->Opcode();
1060 if (xop == Op_MemBarRelease || xop == Op_MemBarVolatile) {
|