Request for prereviews (S): 7047954: VM crashes with assert(is_Mem()) failed: invalid node class

Vladimir Kozlov vladimir.kozlov at oracle.com
Thu May 26 15:27:34 PDT 2011


http://cr.openjdk.java.net/~kvn/7047954/webrev

Fixed 7047954: VM crashes with assert(is_Mem()) failed: invalid node class

It was exposed by is_scavengable change. Final static array pointer was replaced 
with ConP. The main problem is a constant array pointer does not alias with 
other array pointers (see Compile::flatten_alias_type()). As result the address 
of a store has different memory slice (idx=4) than calculated memory slice 
affected by the store (idx=5):

  75     StoreI  ===  61  46  73  20  [[ 95  81 ]]  @int[int:>=0]:exact+any *, 
idx=5;  Memory: @int[int:1000000]<ciTypeArray length=1000000 
type=<ciTypeArrayKlass name=[I ident=686 PERM address=0x8482d20> ident=696 
address=0x8527328>+any *, idx=4; !jvms: ReadAfterWrite::main @ bci:16

It happened because when a store to array is created the type of affected memory 
is calculated using general array type TypeAryPtr::get_array_body_type(elem_type).

So we either should allow a constant array pointer alias with other array 
pointers or check if an array ptr is constant and use its type instead of 
general one. I used second approach and fixed all places where 
get_array_body_type() was used. But I need your opinion on this. Based on 
previous Tom's comment we should not convert array pointers to constant (can we 
have arrays in Perm?). But then there is invoke dynamic case and I am not sure 
that we will not get constant arrays from it.

Thanks,
Vladimir



More information about the hotspot-compiler-dev mailing list