331 }
332
333 // Make sure this memory op is not already being used for a NullCheck
334 Node *e = mb->end();
335 if( e->is_MachNullCheck() && e->in(1) == mach )
336 continue; // Already being used as a NULL check
337
338 // Found a candidate! Pick one with least dom depth - the highest
339 // in the dom tree should be closest to the null check.
340 if (best == NULL || get_block_for_node(mach)->_dom_depth < get_block_for_node(best)->_dom_depth) {
341 best = mach;
342 bidx = vidx;
343 }
344 }
345 // No candidate!
346 if (best == NULL) {
347 return;
348 }
349
350 // ---- Found an implicit null check
351 extern int implicit_null_checks;
352 implicit_null_checks++;
353
354 if( is_decoden ) {
355 // Check if we need to hoist decodeHeapOop_not_null first.
356 Block *valb = get_block_for_node(val);
357 if( block != valb && block->_dom_depth < valb->_dom_depth ) {
358 // Hoist it up to the end of the test block.
359 valb->find_remove(val);
360 block->add_inst(val);
361 map_node_to_block(val, block);
362 // DecodeN on x86 may kill flags. Check for flag-killing projections
363 // that also need to be hoisted.
364 for (DUIterator_Fast jmax, j = val->fast_outs(jmax); j < jmax; j++) {
365 Node* n = val->fast_out(j);
366 if( n->is_MachProj() ) {
367 get_block_for_node(n)->find_remove(n);
368 block->add_inst(n);
369 map_node_to_block(n, block);
370 }
371 }
372 }
|
331 }
332
333 // Make sure this memory op is not already being used for a NullCheck
334 Node *e = mb->end();
335 if( e->is_MachNullCheck() && e->in(1) == mach )
336 continue; // Already being used as a NULL check
337
338 // Found a candidate! Pick one with least dom depth - the highest
339 // in the dom tree should be closest to the null check.
340 if (best == NULL || get_block_for_node(mach)->_dom_depth < get_block_for_node(best)->_dom_depth) {
341 best = mach;
342 bidx = vidx;
343 }
344 }
345 // No candidate!
346 if (best == NULL) {
347 return;
348 }
349
350 // ---- Found an implicit null check
351 #ifndef PRODUCT
352 extern int implicit_null_checks;
353 implicit_null_checks++;
354 #endif
355
356 if( is_decoden ) {
357 // Check if we need to hoist decodeHeapOop_not_null first.
358 Block *valb = get_block_for_node(val);
359 if( block != valb && block->_dom_depth < valb->_dom_depth ) {
360 // Hoist it up to the end of the test block.
361 valb->find_remove(val);
362 block->add_inst(val);
363 map_node_to_block(val, block);
364 // DecodeN on x86 may kill flags. Check for flag-killing projections
365 // that also need to be hoisted.
366 for (DUIterator_Fast jmax, j = val->fast_outs(jmax); j < jmax; j++) {
367 Node* n = val->fast_out(j);
368 if( n->is_MachProj() ) {
369 get_block_for_node(n)->find_remove(n);
370 block->add_inst(n);
371 map_node_to_block(n, block);
372 }
373 }
374 }
|