RFR(M): 8206141: [lworld] Improve accessing a flattened value type array passed as Object[]

Tobias Hartmann tobias.hartmann at oracle.com
Sun Sep 16 18:08:29 UTC 2018

Hi Roland,

please factor out the multiple calls to _gvn.type(ary) in Parse::array_load(), Parse::array_store()
and Parse::array_store_check().

The comment in parseHelper.cpp:167 is misleading now because 'obj' is not constant NULL. Actually,
the 'gen_value_type_array_guard' code always deoptimizes if the array is flattened or if 'obj' is
null and the array is a value type array. Isn't that too strong now that we have a runtime call for
the flattened case? I think we should only check for storing NULL to a value type array there.

I've submitted some testing and I'm hitting "assert(_base == AryPtr) failed: Not an array pointer"
with vmTestbase/vm/mlvm/indy/stress/java/loopsAndThreads/TestDescription.java and
-XX:+EnableValhalla (see stack trace below).


Current CompileTask:
C2:   6228 1020
java.lang.invoke.StringConcatFactory$MethodHandleInlineCopyStrategy::generate (602 bytes)

Stack: [0x00007f3edbeff000,0x00007f3edc000000],  sp=0x00007f3edbffa750,  free space=1005k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native
V  [libjvm.so+0x19445f3]  VMError::report_and_die(int, char const*, char const*, __va_list_tag*,
Thread*, unsigned char*, void*, void*, char const*, int, unsigned long)+0x2c3
V  [libjvm.so+0x19453bf]  VMError::report_and_die(Thread*, void*, char const*, int, char const*,
char const*, __va_list_tag*)+0x2f
V  [libjvm.so+0xb837a0]  report_vm_error(char const*, int, char const*, char const*, ...)+0x100
V  [libjvm.so+0x654c6b]  ArrayCopyNode::get_address_type(PhaseGVN*, Node*)+0xfb
V  [libjvm.so+0x65a584]  ArrayCopyNode::Ideal(PhaseGVN*, bool)+0xba4
V  [libjvm.so+0x15dfed1]  PhaseIterGVN::transform_old(Node*)+0xb1
V  [libjvm.so+0x15d9ed4]  PhaseIterGVN::optimize()+0x44
V  [libjvm.so+0xa9bbb4]  Compile::Optimize()+0x6c4
V  [libjvm.so+0xa9d17e]  Compile::Compile(ciEnv*, C2Compiler*, ciMethod*, int, bool, bool, bool,
V  [libjvm.so+0x886281]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, DirectiveSet*)+0xd1
V  [libjvm.so+0xaaa6d9]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0x409
V  [libjvm.so+0xaab6f7]  CompileBroker::compiler_thread_loop()+0x367
V  [libjvm.so+0x1858e07]  JavaThread::thread_main_inner()+0x2c7
V  [libjvm.so+0x185913a]  JavaThread::run()+0x22a
V  [libjvm.so+0x1535940]  thread_native_entry(Thread*)+0x100

More information about the valhalla-dev mailing list