comparison src/share/vm/opto/matcher.cpp @ 729:04fa5affa478

6709742: find_base_for_derived's use of Ideal NULL is unsafe causing crashes during register allocation Summary: Create a mach node corresponding to ideal node ConP #NULL specifically for derived pointers. Reviewed-by: never
author kvn
date Wed, 22 Apr 2009 17:03:18 -0700
parents fbde8ec322d0
children 14367225a853
comparison
equal deleted inserted replaced
728:85656c8fa13f 729:04fa5affa478
273 find_shared( C->root() ); 273 find_shared( C->root() );
274 find_shared( C->top() ); 274 find_shared( C->top() );
275 275
276 C->print_method("Before Matching"); 276 C->print_method("Before Matching");
277 277
278 // Create new ideal node ConP #NULL even if it does exist in old space
279 // to avoid false sharing if the corresponding mach node is not used.
280 // The corresponding mach node is only used in rare cases for derived
281 // pointers.
282 Node* new_ideal_null = ConNode::make(C, TypePtr::NULL_PTR);
283
278 // Swap out to old-space; emptying new-space 284 // Swap out to old-space; emptying new-space
279 Arena *old = C->node_arena()->move_contents(C->old_arena()); 285 Arena *old = C->node_arena()->move_contents(C->old_arena());
280 286
281 // Save debug and profile information for nodes in old space: 287 // Save debug and profile information for nodes in old space:
282 _old_node_note_array = C->node_note_array(); 288 _old_node_note_array = C->node_note_array();
314 --j; 320 --j;
315 --jmax; 321 --jmax;
316 } 322 }
317 } 323 }
318 324
325 // Generate new mach node for ConP #NULL
326 assert(new_ideal_null != NULL, "sanity");
327 _mach_null = match_tree(new_ideal_null);
328 // Don't set control, it will confuse GCM since there are no uses.
329 // The control will be set when this node is used first time
330 // in find_base_for_derived().
331 assert(_mach_null != NULL, "");
332
319 C->set_root(xroot->is_Root() ? xroot->as_Root() : NULL); 333 C->set_root(xroot->is_Root() ? xroot->as_Root() : NULL);
334
320 #ifdef ASSERT 335 #ifdef ASSERT
321 verify_new_nodes_only(xroot); 336 verify_new_nodes_only(xroot);
322 #endif 337 #endif
323 } 338 }
324 } 339 }