Request for reviews (L): 6939203: JSR 292 needs method handle constants

Christian Thalinger Christian.Thalinger at Sun.COM
Tue Apr 6 08:07:05 PDT 2010


On Tue, 2010-03-30 at 04:24 -0700, John Rose wrote:
> 6939203: JSR 292 needs method handle constants
> Summary: Add new CP types CONSTANT_MethodHandle, CONSTANT_MethodType; extend 'ldc' bytecode.
>   http://cr.openjdk.java.net/~jrose/6939203/hs-webrev.00

src/share/vm/interpreter/bytecode.hpp:

404   inline friend Bytecode_loadconstant* Bytecode_loadconstant_at(address bcp, methodHandle method);
405   inline friend Bytecode_loadconstant* Bytecode_loadconstant_at(methodHandle method, int bci);

Why are the arguments swapped?  int and address should be different
types.

src/share/vm/interpreter/rewriter.cpp:

142   Bytecodes::Code fastc = Bytecodes::_nop;
143   if (tag.is_method_handle() || tag.is_method_type()) {
144     fastc = (is_wide
145              ? Bytecodes::_fast_aldc_w
146              : Bytecodes::_fast_aldc);
147   }
148   if (fastc != Bytecodes::_nop) {

Why do you have a second if here?

src/share/vm/prims/jvm.h:

+    JVM_CONSTANT_MethodHandle           = 15,  // JSR 292
+    JVM_CONSTANT_MethodType             = 16   // JSR 292

Is there a particular reason I don't see why this is 15 and 16?

> Please review this small JDK change along with it:
>   http://cr.openjdk.java.net/~jrose/6939203/jdk-webrev.00

Looks good.

-- Christian



More information about the hotspot-compiler-dev mailing list