[9] RFR (S): 8033626: assert(ex_map->jvms()->same_calls_as(_exceptions->jvms())) failed: all collected exceptions must come from the same place

Vladimir Ivanov vladimir.x.ivanov at oracle.com
Mon Jun 9 16:58:07 UTC 2014


For polymorphic case of Object::clone call site, call generator of the 
following shape is used:
     _if_hit: LibraryIntrinsic (LibraryCallKit::inline_native_clone)
     _if_missed: VirtualCallGenerator

The problem is that Object::clone intrinsic is generated with 
reexecute=true, while the branch with virtual dispatch has reexecute=false.

The fix is to bail out to interpreter if any exception is encountered.
There's no need to update exception state. When reexecuting the call, 
native version of Object::clone (JVM_Clone) will be invoked.

Controlling exception handling explicitly by passing 
deoptimize_on_exception parameters looks cleaner to me, than having a 
check (is_LibraryCallKit() or JVMS reexecute bit) burden in 

I fixed only Object::clone case, since I don't see other places where 
similar IR shape can be produced.

Also, I didn't touch array cloning case because I don't see any 
possibility to have a polymorphic Object::clone call site for arrays 
(it's not the case for object arrays of different types and primitive 
arrays can't be intermixed with object arrays).

Testing: regression tests, jprt, CTW, manual (instrumented JVM which 
always throws OOM from OptoRuntime::new_instance_C)


Best regards,
Vladimir Ivanov

More information about the hotspot-compiler-dev mailing list