RFR(S): 8185443: [MVT] VectorTest fails with -Xcomp "can not load classes with compiler thread"

Tobias Hartmann tobias.hartmann at oracle.com
Thu Jul 27 15:16:17 UTC 2017


Hi,

please review the following patch:
https://bugs.openjdk.java.net/browse/JDK-8185443
http://cr.openjdk.java.net/~thartmann/valhalla/vt_prototype/webrev.35/
http://cr.openjdk.java.net/~thartmann/valhalla/vt_prototype/webrev.35.jdk/

This change removes -Xint from all jdk mvt tests and fixes a problem that shows up when running the VectorTest with -Xcomp.

We fail during compilation with "assert(__the_thread__->can_call_java()) failed: can not load classes with compiler thread: class=java/lang/__Value, classloader=null". The problem is that method handle intrinsics with a __Value argument may be created during compilation [1]:
 lookup_polymorphic_method iid=_invokeBasic java.lang.invoke.MethodHandle.invokeBasic(IQjava/lang/__Value;ILjava/lang/Object;)I
 lookup_polymorphic_method invokeBasic (IQjava/lang/__Value;ILjava/lang/Object;)I => basic (IQjava/lang/__Value;ILjava/lang/Object;)I
 make_method_handle_intrinsic MH.invokeBasic(IQjava/lang/__Value;ILjava/lang/Object;)I

We should only do a system dictionary lookup when creating adapters if the argument name is not __Value, to avoid lookups from the compiler thread. I also refactored SignatureStream::as_symbol() in the same way I did for SignatureStream::as_symbol_or_null() with this change:
http://hg.openjdk.java.net/valhalla/valhalla/hotspot/rev/d5c9d8e0fbc0#l4.7

I verified that all tests pass with JPRT and locally with -Xcomp.

Thanks,
Tobias

[1]
V [libjvm.so+0xb3420d] report_vm_error(char const*, int, char const*, char const*, ...)+0xdd 
V [libjvm.so+0x164a4e3] SystemDictionary::resolve_or_null(Symbol*, Handle, Handle, Thread*)+0x343 
V [libjvm.so+0x1569cce] AdapterHandlerLibrary::get_adapter0(methodHandle const&)+0x3de 
V [libjvm.so+0x156aa9c] AdapterHandlerLibrary::get_adapter(methodHandle const&)+0x1c 
V [libjvm.so+0x12ec698] Method::make_adapters(methodHandle, Thread*)+0x18 
V [libjvm.so+0x12ed97b] Method::link_method(methodHandle const&, Thread*)+0x1db 
V [libjvm.so+0x12ef3c3] Method::make_method_handle_intrinsic(vmIntrinsics::ID, Symbol*, Thread*)+0x963 
V [libjvm.so+0x164e390] SystemDictionary::find_method_handle_intrinsic(vmIntrinsics::ID, Symbol*, Thread*)+0x280 
V [libjvm.so+0x11637bf] LinkResolver::lookup_polymorphic_method(LinkInfo const&, Handle*, Handle*, Thread*)+0x58f 
V [libjvm.so+0x1164f80] LinkResolver::resolve_method(LinkInfo const&, Bytecodes::Code, Thread*)+0x2e0 
V [libjvm.so+0x1167a63] LinkResolver::linktime_resolve_virtual_method(LinkInfo const&, Thread*)+0x43 
V [libjvm.so+0x1169830] LinkResolver::linktime_resolve_virtual_method_or_null(LinkInfo const&)+0x40 
V [libjvm.so+0x8f6492] ciEnv::lookup_method(ciInstanceKlass*, ciKlass*, Symbol*, Symbol*, Bytecodes::Code, constantTag)+0x252 
V [libjvm.so+0x8f87cf] ciEnv::get_method_by_index_impl(constantPoolHandle const&, int, Bytecodes::Code, ciInstanceKlass*)+0x1bf 
V [libjvm.so+0x8f91f6] ciEnv::get_method_by_index(constantPoolHandle const&, int, Bytecodes::Code, ciInstanceKlass*)+0x276 
V [libjvm.so+0x970495] ciBytecodeStream::get_method(bool&, ciSignature**)+0x335 
V [libjvm.so+0x97d672] ciTypeFlow::StateVector::do_invoke(ciBytecodeStream*, bool)+0x32 
V [libjvm.so+0x97deb0] ciTypeFlow::StateVector::apply_one_bytecode(ciBytecodeStream*)+0x360 
V [libjvm.so+0x9844d8] ciTypeFlow::flow_block(ciTypeFlow::Block*, ciTypeFlow::StateVector*, ciTypeFlow::JsrSet*)+0x2d8 
V [libjvm.so+0x985b29] ciTypeFlow::df_flow_types(ciTypeFlow::Block*, bool, ciTypeFlow::StateVector*, ciTypeFlow::JsrSet*)+0x559 
V [libjvm.so+0x985f79] ciTypeFlow::flow_types()+0x1b9 
V [libjvm.so+0x986296] ciTypeFlow::do_flow()+0x26 
V [libjvm.so+0x923781] ciMethod::get_flow_analysis()+0xf1 
V [libjvm.so+0x74fa19] InlineTree::check_can_parse(ciMethod*)+0x79 
V [libjvm.so+0x89b0d8] CallGenerator::for_inline(ciMethod*, float)+0x18 
V [libjvm.so+0xa9c274] Compile::Compile(ciEnv*, C2Compiler*, ciMethod*, int, bool, bool, bool, DirectiveSet*)+0xf54 


More information about the valhalla-dev mailing list