RFR: 8301630: C2: 8297933 broke type speculation in some cases

Tobias Hartmann thartmann at openjdk.org
Thu Feb 2 14:10:35 UTC 2023


On Wed, 1 Feb 2023 16:55:01 GMT, Roland Westrelin <roland at openjdk.org> wrote:

> With 8297933, a TypeAryPtr is a lot more likely to have a null _klass
> and that breaks TypePtr::speculative_type().

compiler/intrinsics/unsafe/AllocateUninitializedArray.java fails with -XX:TypeProfileLevel=222 


# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/workspace/open/src/hotspot/share/opto/type.hpp:1202), pid=57805, tid=23299
#  Error: assert(k != __null || maybe_null) failed


Current CompileTask:
C2:   7286  312       4       compiler.intrinsics.unsafe.AllocateUninitializedArray$$Lambda$38/0x0000000801006c70::call (4 bytes)

Stack: [0x0000700009549000,0x0000700009649000],  sp=0x00007000096466b0,  free space=1013k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.dylib+0x1284c09]  VMError::report_and_die(int, char const*, char const*, __va_list_tag*, Thread*, unsigned char*, void*, void*, char const*, int, unsigned long)+0x739  (type.hpp:1202)
V  [libjvm.dylib+0x128526b]  VMError::report_and_die(Thread*, void*, char const*, int, char const*, char const*, __va_list_tag*)+0x3b
V  [libjvm.dylib+0x6cfcfd]  report_vm_error(char const*, int, char const*, char const*, ...)+0xdd
V  [libjvm.dylib+0x11ee54a]  TypePtr::speculative_type() const+0x14a
V  [libjvm.dylib+0x11f2d70]  TypeOopPtr::would_improve_type(ciKlass*, int) const+0x40
V  [libjvm.dylib+0x932263]  GraphKit::record_profile_for_speculation(Node*, ciKlass*, ProfilePtrKind)+0xb3
V  [libjvm.dylib+0x932d6d]  GraphKit::record_profiled_return_for_speculation()+0xed
V  [libjvm.dylib+0x78aca3]  Parse::do_call()+0x1303
V  [libjvm.dylib+0xf95d22]  Parse::do_one_bytecode()+0x232
V  [libjvm.dylib+0xf8642c]  Parse::do_one_block()+0x43c
V  [libjvm.dylib+0xf844c9]  Parse::do_all_blocks()+0x3a9
V  [libjvm.dylib+0xf8047b]  Parse::Parse(JVMState*, ciMethod*, float)+0xc1b
V  [libjvm.dylib+0x51b3fa]  ParseGenerator::generate(JVMState*)+0xaa
V  [libjvm.dylib+0x636556]  Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x15b6
V  [libjvm.dylib+0x5190e7]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x167
V  [libjvm.dylib+0x654fab]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0x63b
V  [libjvm.dylib+0x654768]  CompileBroker::compiler_thread_loop()+0x288
V  [libjvm.dylib+0xa1673f]  JavaThread::thread_main_inner()+0x1ff
V  [libjvm.dylib+0x11cd647]  Thread::call_run()+0x177
V  [libjvm.dylib+0xf4e4bf]  thread_native_entry(Thread*)+0x14f
C  [libsystem_pthread.dylib+0x6109]  _pthread_start+0x94
C  [libsystem_pthread.dylib+0x1b8b]  thread_start+0xf

-------------

PR: https://git.openjdk.org/jdk/pull/12368


More information about the hotspot-compiler-dev mailing list