review request (S): 7090976 Eclipse/CDT causes a JVM crash while indexing C++ code

Tom Rodriguez tom.rodriguez at oracle.com
Mon Jan 30 11:28:41 PST 2012


On Jan 30, 2012, at 9:08 AM, Roland Westrelin wrote:

> http://cr.openjdk.java.net/~roland/7090976/webrev.00/
> 
> The crash occurs at a getfield in a callee that is inlined at an invokeinterface. The LoadField node in the callee is replaced by a previous LoadField in the caller by local value numbering but the previous LoadField doesn't load a value of the same type. The inlining at the invokeinterface is done with an extra checkcast because the inlining code optimistically assumes the receiver is of some particular class. The LoadField in the callee uses the receiver which can be erroneous because we are not sure the receiver is of the class that was used to perform the inlining. See the test case for the interface hierarchy needed for this to happen. The extra check on decl_interface prevents unecessary and potentially dangerous inlining. Passing the result of the checkcast as receiver is another way of preventing the problem. It's not required (the check on decl_interface is sufficient) but may help performance by improving type information in the inline.

Because of invokedynamic I think your test for the existence of a receiver is in adequate.  I know I suggested passing the receiver all the time before but it might be simpler to only pass the receiver for this specific case.  That makes the tests more straightforward I think.  Otherwise it looks good.

tom

> 
> Roland.



More information about the hotspot-compiler-dev mailing list