RFR: 8289743: AArch64: Clean up patching logic

David Holmes dholmes at openjdk.org
Fri Jul 8 09:56:45 UTC 2022


On Wed, 6 Jul 2022 13:28:06 GMT, Andrew Haley <aph at openjdk.org> wrote:

> The current logic for patching is a mess of if-then-elses. By rearranging the logic and using a switch we can make it both easier to understand and faster.

A lot of failures around one assertion AFAICS:


#  Internal Error (/opt/mach5/mesos/work_dir/slaves/0c72054a-24ab-4dbb-944f-97f9341a1b96-S10227/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/bfa54a47-3090-417b-b4b7-6433109e172e/runs/91d70c18-da15-420e-99f5-35e9f1ce15cb/workspace/open/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp:204), pid=844793, tid=844815
#  assert(target_addr_for_insn(insn_addr) == target) failed: should be
#
# JRE version: Java(TM) SE Runtime Environment (20.0) (fastdebug build 20-internal-2022-07-08-0655086.david.holmes.jdk-dev3.git)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 20-internal-2022-07-08-0655086.david.holmes.jdk-dev3.git, mixed mode, compressed class ptrs, z gc, linux-aarch64)
# Problematic frame:
# V  [libjvm.so+0x13fda54]  MacroAssembler::pd_patch_instruction_size(unsigned char*, unsigned char*)+0x114
#
---------------  T H R E A D  ---------------

Current thread (0x0000fffd502e3bc0):  JavaThread "C2 CompilerThread0" daemon [_thread_in_vm, id=844815, stack(0x0000fffd31c00000,0x0000fffd31e00000)]


Current CompileTask:
C2:    383   95    b        compiler.unsafe.UnsafeGetConstantField::checkGetAddress (10 bytes)

Stack: [0x0000fffd31c00000,0x0000fffd31e00000],  sp=0x0000fffd31dfa120,  free space=2024k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x13fda54]  MacroAssembler::pd_patch_instruction_size(unsigned char*, unsigned char*)+0x114
V  [libjvm.so+0x16febd0]  Relocation::pd_set_data_value(unsigned char*, long, bool)+0x40
V  [libjvm.so+0x16f8f5c]  external_word_Relocation::fix_relocation_after_move(CodeBuffer const*, CodeBuffer*)+0x8c
V  [libjvm.so+0xa3d444]  CodeBuffer::relocate_code_to(CodeBuffer*) const+0x480
V  [libjvm.so+0xa405c4]  CodeBuffer::copy_code_to(CodeBlob*)+0x90
V  [libjvm.so+0x155600c]  nmethod::nmethod(Method*, CompilerType, int, int, int, CodeOffsets*, int, DebugInformationRecorder*, Dependencies*, CodeBuffer*, int, OopMapSet*, ExceptionHandlerTable*, ImplicitExceptionTable*, AbstractCompiler*, int, char*, int, int)+0x3ec
V  [libjvm.so+0x1556640]  nmethod::new_nmethod(methodHandle const&, int, int, CodeOffsets*, int, DebugInformationRecorder*, Dependencies*, CodeBuffer*, int, OopMapSet*, ExceptionHandlerTable*, ImplicitExceptionTable*, AbstractCompiler*, int, char*, int, int, char const*, FailedSpeculation**)+0x270
V  [libjvm.so+0x94c144]  ciEnv::register_method(ciMethod*, int, CodeOffsets*, int, CodeBuffer*, int, OopMapSet*, ExceptionHandlerTable*, ImplicitExceptionTable*, AbstractCompiler*, bool, bool, bool, int, RTMState)+0x314
V  [libjvm.so+0x15fa92c]  PhaseOutput::install_code(ciMethod*, int, AbstractCompiler*, bool, bool, RTMState)+0x148
V  [libjvm.so+0xa8caac]  Compile::Code_Gen()+0x3fc
V  [libjvm.so+0xa9104c]  Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x112c
V  [libjvm.so+0x8c0918]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x1c4
V  [libjvm.so+0xa9f094]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0x874
V  [libjvm.so+0xa9ff6c]  CompileBroker::compiler_thread_loop()+0x6ac
V  [libjvm.so+0xfb7dc4]  JavaThread::thread_main_inner()+0x250
V  [libjvm.so+0x18cfaa8]  Thread::call_run()+0xf8
V  [libjvm.so+0x15da2d4]  thread_native_entry(Thread*)+0x104
C  [libpthread.so.0+0x78f8]  start_thread+0x188


Different stacktraces.

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

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


More information about the hotspot-dev mailing list