comparison src/share/vm/opto/lcm.cpp @ 332:c792b641b8bd

6746907: Improve implicit null check generation Summary: add missing implicit null check cases. Reviewed-by: never
author kvn
date Wed, 10 Sep 2008 20:44:47 -0700
parents b0fe4deeb9fb
children 5f44674206d3
comparison
equal deleted inserted replaced
331:cecd8eb4e0ca 332:c792b641b8bd
55 not_null_block = _succs[1]; 55 not_null_block = _succs[1];
56 } else { 56 } else {
57 assert(_nodes[_nodes.size()-2] == proj, "proj is one or the other"); 57 assert(_nodes[_nodes.size()-2] == proj, "proj is one or the other");
58 not_null_block = _succs[0]; 58 not_null_block = _succs[0];
59 null_block = _succs[1]; 59 null_block = _succs[1];
60 }
61 while (null_block->is_Empty() == Block::empty_with_goto) {
62 null_block = null_block->_succs[0];
60 } 63 }
61 64
62 // Search the exception block for an uncommon trap. 65 // Search the exception block for an uncommon trap.
63 // (See Parse::do_if and Parse::do_ifnull for the reason 66 // (See Parse::do_if and Parse::do_ifnull for the reason
64 // we need an uncommon trap. Briefly, we need a way to 67 // we need an uncommon trap. Briefly, we need a way to
147 { 150 {
148 intptr_t offset = 0; 151 intptr_t offset = 0;
149 const TypePtr *adr_type = NULL; // Do not need this return value here 152 const TypePtr *adr_type = NULL; // Do not need this return value here
150 const Node* base = mach->get_base_and_disp(offset, adr_type); 153 const Node* base = mach->get_base_and_disp(offset, adr_type);
151 if (base == NULL || base == NodeSentinel) { 154 if (base == NULL || base == NodeSentinel) {
155 // Narrow oop address doesn't have base, only index
156 if( val->bottom_type()->isa_narrowoop() &&
157 MacroAssembler::needs_explicit_null_check(offset) )
158 continue; // Give up if offset is beyond page size
152 // cannot reason about it; is probably not implicit null exception 159 // cannot reason about it; is probably not implicit null exception
153 } else { 160 } else {
154 const TypePtr* tptr = base->bottom_type()->is_ptr(); 161 const TypePtr* tptr = base->bottom_type()->is_ptr();
155 // Give up if offset is not a compile-time constant 162 // Give up if offset is not a compile-time constant
156 if( offset == Type::OffsetBot || tptr->_offset == Type::OffsetBot ) 163 if( offset == Type::OffsetBot || tptr->_offset == Type::OffsetBot )