318 return phi; |
318 return phi; |
319 } |
319 } |
320 |
320 |
321 // Search the last value stored into the object's field. |
321 // Search the last value stored into the object's field. |
322 Node *PhaseMacroExpand::value_from_mem(Node *sfpt_mem, BasicType ft, const Type *ftype, const TypeOopPtr *adr_t, Node *alloc) { |
322 Node *PhaseMacroExpand::value_from_mem(Node *sfpt_mem, BasicType ft, const Type *ftype, const TypeOopPtr *adr_t, Node *alloc) { |
323 assert(adr_t->is_instance_field(), "instance required"); |
323 assert(adr_t->is_known_instance_field(), "instance required"); |
324 uint instance_id = adr_t->instance_id(); |
324 int instance_id = adr_t->instance_id(); |
325 assert(instance_id == alloc->_idx, "wrong allocation"); |
325 assert((uint)instance_id == alloc->_idx, "wrong allocation"); |
326 |
326 |
327 int alias_idx = C->get_alias_index(adr_t); |
327 int alias_idx = C->get_alias_index(adr_t); |
328 int offset = adr_t->offset(); |
328 int offset = adr_t->offset(); |
329 Node *start_mem = C->start()->proj_out(TypeFunc::Memory); |
329 Node *start_mem = C->start()->proj_out(TypeFunc::Memory); |
330 Node *alloc_ctrl = alloc->in(TypeFunc::Control); |
330 Node *alloc_ctrl = alloc->in(TypeFunc::Control); |
352 } |
352 } |
353 } else if (mem->is_Store()) { |
353 } else if (mem->is_Store()) { |
354 const TypeOopPtr* atype = mem->as_Store()->adr_type()->isa_oopptr(); |
354 const TypeOopPtr* atype = mem->as_Store()->adr_type()->isa_oopptr(); |
355 assert(atype != NULL, "address type must be oopptr"); |
355 assert(atype != NULL, "address type must be oopptr"); |
356 assert(C->get_alias_index(atype) == alias_idx && |
356 assert(C->get_alias_index(atype) == alias_idx && |
357 atype->is_instance_field() && atype->offset() == offset && |
357 atype->is_known_instance_field() && atype->offset() == offset && |
358 atype->instance_id() == instance_id, "store is correct memory slice"); |
358 atype->instance_id() == instance_id, "store is correct memory slice"); |
359 done = true; |
359 done = true; |
360 } else if (mem->is_Phi()) { |
360 } else if (mem->is_Phi()) { |
361 // try to find a phi's unique input |
361 // try to find a phi's unique input |
362 Node *unique_input = NULL; |
362 Node *unique_input = NULL; |