RFR(M) 7199175: JSR 292: C1 needs patching when invokedynamic/invokehandle call site is not linked

Christian Thalinger christian.thalinger at oracle.com
Tue May 28 10:32:31 PDT 2013


On May 28, 2013, at 8:23 AM, Roland Westrelin <roland.westrelin at oracle.com> wrote:

> C1 bails out when compiling an invokedynamic/invokehandle that cannot be linked because it cannot determine whether there's an appendix argument and if there is one, what it is. C1 should use patching instead: prepare the instructions to load an unknown appendix, call the runtime, do the call resolution, backpatch the runtime call with the instructions that load the correct appendix.
> 
> http://cr.openjdk.java.net/~roland/7199175/webrev.00/

src/cpu/x86/vm/c1_CodeStubs_x86.cpp:

Don't we also need something like this on x86 as on SPARC?

+  } else if (_id == load_mirror_id || _id == load_appendix_id) {

src/share/vm/c1/c1_GraphBuilder.cpp:

+  Values* args = state()->pop_arguments(target->arg_size_no_receiver() + extra_arg);

Could you rename extra_arg to maybe unlinked_appendix_arg or patching_appendix_arg?

src/share/vm/c1/c1_LIRAssembler.cpp:

+PatchingStub::PatchID LIR_Assembler::jobject2reg_patching_id(CodeEmitInfo* info) {

I don't think that's a good method name.  It does not produce any to-register moves; it only returns an id.

src/share/vm/c1/c1_Runtime1.cpp:

+      default: Unimplemented();

A fatal would be better; there is nothing to be implemented here.  In general, we should not add new ShouldNotReachHere or Unimplemented calls.  Adding fatals with a useful message is the preferred way.

src/share/vm/c1/c1_globals.hpp:

+  develop(bool, C1PatchInvokeDynamic, true,                                 \

Do we really want to turn if off?  During development I'm sure it was helpful but after that?

src/share/vm/ci/ciEnv.cpp:

+ciInstance* ciEnv::unloaded_ciinstance() {
+  GUARDED_VM_ENTRY(return _factory->get_unloaded_object_constant();)
+}

Can we rename that method to unloaded_object_constant?

src/share/vm/c1/c1_LIR.hpp:

-      is_invokedynamic()  // An invokedynamic is always a MethodHandle call site.

Why did you remove this?  Did it cause problems?

-- Chris

> 
> Roland.



More information about the hotspot-compiler-dev mailing list