RFR: 8261731: shallow copy the internal buffer of a scalar-replaced java.lang.String object
Tobias Hartmann
thartmann at openjdk.java.net
Thu Mar 4 10:56:43 UTC 2021
On Thu, 4 Mar 2021 10:02:31 GMT, Tobias Hartmann <thartmann at openjdk.org> wrote:
>> I didn't look at the code yet but run this through some quick testing. The following tests fail with `-ea -esa -XX:CompileThreshold=100:`
>> - compiler/codecache/stress/RandomAllocationTest.java
>> - compiler/codecache/stress/UnexpectedDeoptimizationTest.java
>> # Internal Error (open/src/hotspot/share/opto/node.hpp:825), pid=27269, tid=27288
>> # assert(is_AllocateArray()) failed: invalid node class: IfTrue
>>
>> Current CompileTask:
>> C2: 12403 2987 4 java.lang.Class::descriptorString (160 bytes)
>>
>> Stack: [0x00007fc080bfc000,0x00007fc080cfd000], sp=0x00007fc080cf8340, free space=1008k
>> Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
>> V [libjvm.so+0x1302c8c] PhaseMacroExpand::scalar_replacement(AllocateNode*, GrowableArray<SafePointNode*>&)+0x88c
>> V [libjvm.so+0x1303e5e] PhaseMacroExpand::eliminate_allocate_node(AllocateNode*) [clone .part.0]+0x50e
>> V [libjvm.so+0x130447c] PhaseMacroExpand::eliminate_macro_nodes()+0x57c
>> V [libjvm.so+0xa0fbb5] Compile::Optimize()+0x1235
>> V [libjvm.so+0xa11c85] Compile::Compile(ciEnv*, ciMethod*, int, bool, bool, bool, bool, DirectiveSet*)+0x1905
>> V [libjvm.so+0x83d69a] C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x1ea
>> V [libjvm.so+0xa21aa1] CompileBroker::invoke_compiler_on_method(CompileTask*)+0xf21
>> V [libjvm.so+0xa22748] CompileBroker::compiler_thread_loop()+0x5a8
>> V [libjvm.so+0x18488e1] JavaThread::thread_main_inner()+0x271
>> V [libjvm.so+0x1850b30] Thread::call_run()+0x100
>> V [libjvm.so+0x153b086] thread_native_entry(Thread*)+0x116
>
> java/lang/String/Split.java and java/lang/management/MemoryMXBean/LowMemoryTest2.sh fail with:
> # Internal Error (open/src/hotspot/share/opto/macro.cpp:1378), pid=5320, tid=5499
> # assert(n->Opcode() == Op_LoadUB || n->Opcode() == Op_LoadB) failed: unknow code shape
>
> Current CompileTask:
> C2: 11623 994 ! 4 Split::main (651 bytes)
>
> Stack: [0x00007ff1869fe000,0x00007ff186aff000], sp=0x00007ff186afa2d0, free space=1008k
> Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
> V [libjvm.so+0x12f8a5f] PhaseMacroExpand::process_users_of_string_allocation(AllocateArrayNode*, ArrayCopyNode*)+0x83f
> V [libjvm.so+0x1303e0e] PhaseMacroExpand::eliminate_allocate_node(AllocateNode*) [clone .part.0]+0x4be
> V [libjvm.so+0x130447c] PhaseMacroExpand::eliminate_macro_nodes()+0x57c
> V [libjvm.so+0xa0fbb5] Compile::Optimize()+0x1235
> V [libjvm.so+0xa11c85] Compile::Compile(ciEnv*, ciMethod*, int, bool, bool, bool, bool, DirectiveSet*)+0x1905
> V [libjvm.so+0x83d69a] C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x1ea
> V [libjvm.so+0xa21aa1] CompileBroker::invoke_compiler_on_method(CompileTask*)+0xf21
> V [libjvm.so+0xa22748] CompileBroker::compiler_thread_loop()+0x5a8
> V [libjvm.so+0x18488e1] JavaThread::thread_main_inner()+0x271
> V [libjvm.so+0x1850b30] Thread::call_run()+0x100
> V [libjvm.so+0x153b086] thread_native_entry(Thread*)+0x116
>
>
> And I see some internal testing failing with SIGSEGV in `PhaseMacroExpand::eliminate_allocate_node`
Yes, I've used the latest version for testing.
-------------
PR: https://git.openjdk.java.net/jdk/pull/2570
More information about the hotspot-compiler-dev
mailing list