United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6934494 JSR 292 MethodHandles adapters should be generated into their own CodeBlob
JDK-6934494 : JSR 292 MethodHandles adapters should be generated into their own CodeBlob

Details
Type:
Bug
Submit Date:
2010-03-12
Status:
Resolved
Updated Date:
2010-09-24
Project Name:
JDK
Resolved Date:
2010-03-24
Component:
hotspot
OS:
generic
Sub-Component:
compiler
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
hs18
Fixed Versions:
hs18 (b01)

Related Reports
Backport:
Backport:
Backport:
Backport:
Relates:

Sub Tasks

Description
Passing a null pointer to an InvokeDynamic function call, like:

  MethodHandle mh = null;
  InvokeDynamic.<void>funcall(mh);

should lead to a NullPointerException.  But with current HotSpot we hit a guarantee:

  #  Internal Error (sharedRuntime.cpp:586), pid=4116, tid=3072834448
  #  Error: guarantee(cb->is_adapter_blob(),"exception happened outside interpreter, nmethods and vtable stubs (1)")

                                    

Comments
EVALUATION

The reason for this is that the MethodHandles adapters are generated into the same CodeBlob as other code stubs which do not throw exceptions.  The only blob that can throw exceptions is the C2I/I2C adapter blob, and this what the guarantee says.
                                     
2010-03-12
SUGGESTED FIX

Generate MethodHandles adapters into their own CodeBlob and add a check into the guarantee for that blob.
                                     
2010-03-12
EVALUATION

ChangeSet=http://hg.openjdk.java.net/jdk7/hotspot-comp/hotspot/rev/9eba43136cb5,ChangeRequest=6934494
                                     
2010-03-16



Hardware and Software, Engineered to Work Together