< prev index next >

src/share/vm/opto/ifnode.cpp

Print this page




1087     for (; i < n->outcnt(); i++) {
1088       Node* use = n->raw_out(i);
1089       if (stack.size() == 1) {
1090         if (use->Opcode() == Op_ConvI2L) {
1091           const TypeLong* bounds = use->as_Type()->type()->is_long();
1092           if (bounds->_lo <= array_size->_lo && bounds->_hi >= array_size->_hi &&
1093               (bounds->_lo != array_size->_lo || bounds->_hi != array_size->_hi)) {
1094             stack.set_index(i+1);
1095             stack.push(use, 0);
1096             break;
1097           }
1098         }
1099       } else if (use->is_Mem()) {
1100         Node* ctrl = use->in(0);
1101         for (int i = 0; i < 10 && ctrl != NULL && ctrl != fail; i++) {
1102           ctrl = up_one_dom(ctrl);
1103         }
1104         if (ctrl == fail) {
1105           Node* init_n = stack.node_at(1);
1106           assert(init_n->Opcode() == Op_ConvI2L, "unexpected first node");
1107           Node* new_n = igvn->C->conv_I2X_index(igvn, l, array_size);

1108 
1109           // The type of the ConvI2L may be widen and so the new
1110           // ConvI2L may not be better than an existing ConvI2L
1111           if (new_n != init_n) {
1112             for (uint j = 2; j < stack.size(); j++) {
1113               Node* n = stack.node_at(j);
1114               Node* clone = n->clone();
1115               int rep = clone->replace_edge(init_n, new_n);
1116               assert(rep > 0, "can't find expected node?");
1117               clone = igvn->transform(clone);
1118               init_n = n;
1119               new_n = clone;
1120             }
1121             igvn->hash_delete(use);
1122             int rep = use->replace_edge(init_n, new_n);
1123             assert(rep > 0, "can't find expected node?");
1124             igvn->transform(use);
1125             if (init_n->outcnt() == 0) {
1126               igvn->_worklist.push(init_n);
1127             }




1087     for (; i < n->outcnt(); i++) {
1088       Node* use = n->raw_out(i);
1089       if (stack.size() == 1) {
1090         if (use->Opcode() == Op_ConvI2L) {
1091           const TypeLong* bounds = use->as_Type()->type()->is_long();
1092           if (bounds->_lo <= array_size->_lo && bounds->_hi >= array_size->_hi &&
1093               (bounds->_lo != array_size->_lo || bounds->_hi != array_size->_hi)) {
1094             stack.set_index(i+1);
1095             stack.push(use, 0);
1096             break;
1097           }
1098         }
1099       } else if (use->is_Mem()) {
1100         Node* ctrl = use->in(0);
1101         for (int i = 0; i < 10 && ctrl != NULL && ctrl != fail; i++) {
1102           ctrl = up_one_dom(ctrl);
1103         }
1104         if (ctrl == fail) {
1105           Node* init_n = stack.node_at(1);
1106           assert(init_n->Opcode() == Op_ConvI2L, "unexpected first node");
1107           // Create a new narrow ConvI2L node that is dependent on the range check
1108           Node* new_n = igvn->C->conv_I2X_index(igvn, l, array_size, fail);
1109 
1110           // The type of the ConvI2L may be widen and so the new
1111           // ConvI2L may not be better than an existing ConvI2L
1112           if (new_n != init_n) {
1113             for (uint j = 2; j < stack.size(); j++) {
1114               Node* n = stack.node_at(j);
1115               Node* clone = n->clone();
1116               int rep = clone->replace_edge(init_n, new_n);
1117               assert(rep > 0, "can't find expected node?");
1118               clone = igvn->transform(clone);
1119               init_n = n;
1120               new_n = clone;
1121             }
1122             igvn->hash_delete(use);
1123             int rep = use->replace_edge(init_n, new_n);
1124             assert(rep > 0, "can't find expected node?");
1125             igvn->transform(use);
1126             if (init_n->outcnt() == 0) {
1127               igvn->_worklist.push(init_n);
1128             }


< prev index next >