diff --git a/LoongArch64-support.patch b/LoongArch64-support.patch index 03840e251187f51876b13e139efc63db5c015a80..6be43aca669dbb53b47d3d2b8021669afbd05995 100644 --- a/LoongArch64-support.patch +++ b/LoongArch64-support.patch @@ -1,7 +1,662 @@ -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/common/autoconf/build-aux/autoconf-config.guess b/common/autoconf/build-aux/autoconf-config.guess ---- a/common/autoconf/build-aux/autoconf-config.guess 2024-01-11 09:53:23.000000000 +0800 -+++ b/common/autoconf/build-aux/autoconf-config.guess 2023-12-20 09:23:19.571483804 +0800 -@@ -977,6 +977,9 @@ +From f762ff2634a7140bc295b98676f1db9602b15dcd Mon Sep 17 00:00:00 2001 +From: songliyang +Date: Mon, 20 May 2024 09:51:57 +0800 +Subject: [PATCH] add loongarch support + +--- + .../autoconf/build-aux/autoconf-config.guess | 3 + + common/autoconf/build-aux/autoconf-config.sub | 1 + + common/autoconf/build-aux/config.guess | 11 + + common/autoconf/configure.ac | 7 + + common/autoconf/generated-configure.sh | 95 +- + common/autoconf/jdk-options.m4 | 12 + + common/autoconf/platform.m4 | 65 + + common/autoconf/spec.gmk.in | 23 + + hotspot/agent/make/saenv.sh | 14 + + .../agent/src/os/linux/LinuxDebuggerLocal.c | 72 +- + hotspot/agent/src/os/linux/Makefile | 10 +- + hotspot/agent/src/os/linux/libproc.h | 15 +- + hotspot/agent/src/os/linux/ps_proc.c | 8 +- + .../classes/sun/jvm/hotspot/HotSpotAgent.java | 12 + + .../sun/jvm/hotspot/asm/Disassembler.java | 6 + + .../MachineDescriptionLOONGARCH64.java | 41 + + .../debugger/MachineDescriptionMIPS64.java | 41 + + .../debugger/linux/LinuxCDebugger.java | 18 + + .../linux/LinuxThreadContextFactory.java | 6 + + .../loongarch64/LinuxLOONGARCH64CFrame.java | 80 + + .../LinuxLOONGARCH64ThreadContext.java | 47 + + .../linux/mips64/LinuxMIPS64CFrame.java | 80 + + .../mips64/LinuxMIPS64ThreadContext.java | 47 + + .../loongarch64/LOONGARCH64ThreadContext.java | 123 + + .../debugger/mips64/MIPS64ThreadContext.java | 123 + + .../hotspot/debugger/posix/elf/ELFHeader.java | 2 + + .../debugger/proc/ProcDebuggerLocal.java | 12 + + .../loongarch64/ProcLOONGARCH64Thread.java | 92 + + .../ProcLOONGARCH64ThreadContext.java | 47 + + .../ProcLOONGARCH64ThreadFactory.java | 45 + + .../proc/mips64/ProcMIPS64Thread.java | 92 + + .../proc/mips64/ProcMIPS64ThreadContext.java | 47 + + .../proc/mips64/ProcMIPS64ThreadFactory.java | 45 + + .../debugger/remote/RemoteDebuggerClient.java | 12 + + .../loongarch64/RemoteLOONGARCH64Thread.java | 54 + + .../RemoteLOONGARCH64ThreadContext.java | 51 + + .../RemoteLOONGARCH64ThreadFactory.java | 45 + + .../remote/mips64/RemoteMIPS64Thread.java | 54 + + .../mips64/RemoteMIPS64ThreadContext.java | 51 + + .../mips64/RemoteMIPS64ThreadFactory.java | 45 + + .../sun/jvm/hotspot/runtime/Threads.java | 6 + + .../LinuxLOONGARCH64JavaThreadPDAccess.java | 133 + + .../LinuxMIPS64JavaThreadPDAccess.java | 132 + + .../LOONGARCH64CurrentFrameGuess.java | 217 + + .../runtime/loongarch64/LOONGARCH64Frame.java | 534 + + .../LOONGARCH64JavaCallWrapper.java | 57 + + .../loongarch64/LOONGARCH64RegisterMap.java | 52 + + .../mips64/MIPS64CurrentFrameGuess.java | 217 + + .../hotspot/runtime/mips64/MIPS64Frame.java | 547 + + .../runtime/mips64/MIPS64JavaCallWrapper.java | 57 + + .../runtime/mips64/MIPS64RegisterMap.java | 52 + + .../jvm/hotspot/utilities/PlatformInfo.java | 11 + + hotspot/make/defs.make | 37 +- + hotspot/make/linux/Makefile | 4 + + hotspot/make/linux/makefiles/defs.make | 56 + + hotspot/make/linux/makefiles/gcc.make | 11 +- + hotspot/make/linux/makefiles/loongarch64.make | 43 + + hotspot/make/linux/makefiles/mips64.make | 43 + + hotspot/make/linux/makefiles/sa.make | 8 + + hotspot/make/linux/makefiles/saproc.make | 12 + + hotspot/make/linux/makefiles/sparcWorks.make | 7 + + hotspot/make/linux/makefiles/vm.make | 28 + + hotspot/make/linux/platform_loongarch64 | 17 + + hotspot/make/linux/platform_mips64 | 17 + + hotspot/make/sa.files | 16 + + .../aarch64/vm/c1_LIRAssembler_aarch64.cpp | 17 +- + .../aarch64/vm/c1_LIRGenerator_aarch64.cpp | 19 +- + .../cpu/loongarch/vm/assembler_loongarch.cpp | 855 + + .../cpu/loongarch/vm/assembler_loongarch.hpp | 2810 ++++ + .../vm/assembler_loongarch.inline.hpp | 33 + + .../vm/bytecodeInterpreter_loongarch.hpp | 110 + + .../bytecodeInterpreter_loongarch.inline.hpp | 286 + + .../cpu/loongarch/vm/bytecodes_loongarch.cpp | 38 + + .../cpu/loongarch/vm/bytecodes_loongarch.hpp | 31 + + .../src/cpu/loongarch/vm/bytes_loongarch.hpp | 75 + + .../vm/c1_CodeStubs_loongarch_64.cpp | 387 + + .../cpu/loongarch/vm/c1_Defs_loongarch.hpp | 79 + + .../loongarch/vm/c1_FpuStackSim_loongarch.hpp | 32 + + .../vm/c1_FpuStackSim_loongarch_64.cpp | 31 + + .../loongarch/vm/c1_FrameMap_loongarch.hpp | 143 + + .../loongarch/vm/c1_FrameMap_loongarch_64.cpp | 362 + + .../vm/c1_LIRAssembler_loongarch.hpp | 83 + + .../vm/c1_LIRAssembler_loongarch_64.cpp | 3377 ++++ + .../vm/c1_LIRGenerator_loongarch_64.cpp | 1442 ++ + .../loongarch/vm/c1_LinearScan_loongarch.hpp | 70 + + .../vm/c1_LinearScan_loongarch_64.cpp | 33 + + .../vm/c1_MacroAssembler_loongarch.hpp | 112 + + .../vm/c1_MacroAssembler_loongarch_64.cpp | 346 + + .../loongarch/vm/c1_Runtime1_loongarch_64.cpp | 1252 ++ + .../cpu/loongarch/vm/c1_globals_loongarch.hpp | 69 + + .../cpu/loongarch/vm/c2_globals_loongarch.hpp | 87 + + .../cpu/loongarch/vm/c2_init_loongarch.cpp | 34 + + .../cpu/loongarch/vm/codeBuffer_loongarch.hpp | 35 + + .../cpu/loongarch/vm/compiledIC_loongarch.cpp | 167 + + .../src/cpu/loongarch/vm/copy_loongarch.hpp | 90 + + .../vm/cppInterpreterGenerator_loongarch.hpp | 53 + + .../loongarch/vm/cppInterpreter_loongarch.cpp | 215 + + .../src/cpu/loongarch/vm/debug_loongarch.cpp | 51 + + .../cpu/loongarch/vm/depChecker_loongarch.cpp | 30 + + .../cpu/loongarch/vm/depChecker_loongarch.hpp | 31 + + .../loongarch/vm/disassembler_loongarch.hpp | 37 + + .../src/cpu/loongarch/vm/frame_loongarch.cpp | 711 + + .../src/cpu/loongarch/vm/frame_loongarch.hpp | 229 + + .../loongarch/vm/frame_loongarch.inline.hpp | 312 + + .../vm/globalDefinitions_loongarch.hpp | 41 + + .../cpu/loongarch/vm/globals_loongarch.hpp | 103 + + .../cpu/loongarch/vm/icBuffer_loongarch.cpp | 101 + + .../src/cpu/loongarch/vm/icache_loongarch.cpp | 42 + + .../src/cpu/loongarch/vm/icache_loongarch.hpp | 41 + + .../loongarch/vm/interp_masm_loongarch_64.cpp | 1960 +++ + .../loongarch/vm/interp_masm_loongarch_64.hpp | 269 + + .../vm/interpreterGenerator_loongarch.hpp | 51 + + .../loongarch/vm/interpreterRT_loongarch.hpp | 66 + + .../vm/interpreterRT_loongarch_64.cpp | 274 + + .../loongarch/vm/interpreter_loongarch.hpp | 50 + + .../loongarch/vm/interpreter_loongarch_64.cpp | 277 + + .../vm/javaFrameAnchor_loongarch.hpp | 87 + + .../vm/jniFastGetField_loongarch_64.cpp | 169 + + .../cpu/loongarch/vm/jniTypes_loongarch.hpp | 144 + + hotspot/src/cpu/loongarch/vm/jni_loongarch.h | 51 + + hotspot/src/cpu/loongarch/vm/loongarch.ad | 24 + + hotspot/src/cpu/loongarch/vm/loongarch_64.ad | 12861 ++++++++++++++ + .../loongarch/vm/macroAssembler_loongarch.cpp | 3895 +++++ + .../loongarch/vm/macroAssembler_loongarch.hpp | 771 + + .../vm/macroAssembler_loongarch.inline.hpp | 34 + + .../vm/metaspaceShared_loongarch_64.cpp | 120 + + .../loongarch/vm/methodHandles_loongarch.cpp | 566 + + .../loongarch/vm/methodHandles_loongarch.hpp | 62 + + .../cpu/loongarch/vm/nativeInst_loongarch.cpp | 485 + + .../cpu/loongarch/vm/nativeInst_loongarch.hpp | 513 + + .../loongarch/vm/registerMap_loongarch.hpp | 45 + + .../vm/register_definitions_loongarch.cpp | 103 + + .../cpu/loongarch/vm/register_loongarch.cpp | 59 + + .../cpu/loongarch/vm/register_loongarch.hpp | 436 + + .../cpu/loongarch/vm/relocInfo_loongarch.cpp | 130 + + .../cpu/loongarch/vm/relocInfo_loongarch.hpp | 40 + + .../cpu/loongarch/vm/runtime_loongarch_64.cpp | 199 + + .../vm/sharedRuntime_loongarch_64.cpp | 3453 ++++ + .../vm/stubGenerator_loongarch_64.cpp | 3445 ++++ + .../vm/stubRoutines_loongarch_64.cpp | 264 + + .../vm/stubRoutines_loongarch_64.hpp | 60 + + ...templateInterpreterGenerator_loongarch.hpp | 35 + + .../vm/templateInterpreter_loongarch.hpp | 41 + + .../vm/templateInterpreter_loongarch_64.cpp | 2335 +++ + .../vm/templateTable_loongarch_64.cpp | 4024 +++++ + .../vm/templateTable_loongarch_64.hpp | 44 + + .../cpu/loongarch/vm/vmStructs_loongarch.hpp | 68 + + .../loongarch/vm/vm_version_ext_loongarch.cpp | 84 + + .../loongarch/vm/vm_version_ext_loongarch.hpp | 54 + + .../cpu/loongarch/vm/vm_version_loongarch.cpp | 443 + + .../cpu/loongarch/vm/vm_version_loongarch.hpp | 299 + + .../src/cpu/loongarch/vm/vmreg_loongarch.cpp | 51 + + .../src/cpu/loongarch/vm/vmreg_loongarch.hpp | 35 + + .../loongarch/vm/vmreg_loongarch.inline.hpp | 66 + + .../loongarch/vm/vtableStubs_loongarch_64.cpp | 300 + + hotspot/src/cpu/mips/vm/assembler_mips.cpp | 774 + + hotspot/src/cpu/mips/vm/assembler_mips.hpp | 1789 ++ + .../src/cpu/mips/vm/assembler_mips.inline.hpp | 33 + + .../cpu/mips/vm/bytecodeInterpreter_mips.cpp | 53 + + .../cpu/mips/vm/bytecodeInterpreter_mips.hpp | 110 + + .../vm/bytecodeInterpreter_mips.inline.hpp | 286 + + hotspot/src/cpu/mips/vm/bytecodes_mips.cpp | 38 + + hotspot/src/cpu/mips/vm/bytecodes_mips.hpp | 31 + + hotspot/src/cpu/mips/vm/bytes_mips.hpp | 193 + + hotspot/src/cpu/mips/vm/c2_globals_mips.hpp | 100 + + hotspot/src/cpu/mips/vm/c2_init_mips.cpp | 34 + + hotspot/src/cpu/mips/vm/codeBuffer_mips.hpp | 35 + + hotspot/src/cpu/mips/vm/compiledIC_mips.cpp | 173 + + hotspot/src/cpu/mips/vm/copy_mips.hpp | 90 + + .../mips/vm/cppInterpreterGenerator_mips.hpp | 53 + + .../src/cpu/mips/vm/cppInterpreter_mips.cpp | 215 + + .../src/cpu/mips/vm/cppInterpreter_mips.hpp | 40 + + hotspot/src/cpu/mips/vm/debug_mips.cpp | 51 + + hotspot/src/cpu/mips/vm/depChecker_mips.cpp | 30 + + hotspot/src/cpu/mips/vm/depChecker_mips.hpp | 31 + + hotspot/src/cpu/mips/vm/disassembler_mips.hpp | 37 + + hotspot/src/cpu/mips/vm/frame_mips.cpp | 711 + + hotspot/src/cpu/mips/vm/frame_mips.hpp | 229 + + hotspot/src/cpu/mips/vm/frame_mips.inline.hpp | 312 + + .../cpu/mips/vm/globalDefinitions_mips.hpp | 41 + + hotspot/src/cpu/mips/vm/globals_mips.hpp | 124 + + hotspot/src/cpu/mips/vm/icBuffer_mips.cpp | 97 + + hotspot/src/cpu/mips/vm/icache_mips.cpp | 41 + + hotspot/src/cpu/mips/vm/icache_mips.hpp | 41 + + .../src/cpu/mips/vm/interp_masm_mips_64.cpp | 2084 +++ + .../src/cpu/mips/vm/interp_masm_mips_64.hpp | 269 + + .../cpu/mips/vm/interpreterGenerator_mips.hpp | 49 + + .../src/cpu/mips/vm/interpreterRT_mips.hpp | 61 + + .../src/cpu/mips/vm/interpreterRT_mips_64.cpp | 259 + + hotspot/src/cpu/mips/vm/interpreter_mips.hpp | 50 + + .../src/cpu/mips/vm/interpreter_mips_64.cpp | 286 + + .../src/cpu/mips/vm/javaFrameAnchor_mips.hpp | 87 + + .../cpu/mips/vm/jniFastGetField_mips_64.cpp | 172 + + hotspot/src/cpu/mips/vm/jniTypes_mips.hpp | 144 + + hotspot/src/cpu/mips/vm/jni_mips.h | 51 + + .../src/cpu/mips/vm/macroAssembler_mips.cpp | 4332 +++++ + .../src/cpu/mips/vm/macroAssembler_mips.hpp | 701 + + .../mips/vm/macroAssembler_mips.inline.hpp | 34 + + .../cpu/mips/vm/metaspaceShared_mips_64.cpp | 123 + + .../src/cpu/mips/vm/methodHandles_mips.cpp | 576 + + .../src/cpu/mips/vm/methodHandles_mips.hpp | 62 + + hotspot/src/cpu/mips/vm/mips.ad | 25 + + hotspot/src/cpu/mips/vm/mips_64.ad | 14036 ++++++++++++++++ + hotspot/src/cpu/mips/vm/nativeInst_mips.cpp | 1829 ++ + hotspot/src/cpu/mips/vm/nativeInst_mips.hpp | 735 + + hotspot/src/cpu/mips/vm/registerMap_mips.hpp | 47 + + .../cpu/mips/vm/register_definitions_mips.cpp | 103 + + hotspot/src/cpu/mips/vm/register_mips.cpp | 52 + + hotspot/src/cpu/mips/vm/register_mips.hpp | 346 + + hotspot/src/cpu/mips/vm/relocInfo_mips.cpp | 156 + + hotspot/src/cpu/mips/vm/relocInfo_mips.hpp | 40 + + hotspot/src/cpu/mips/vm/runtime_mips_64.cpp | 206 + + .../src/cpu/mips/vm/sharedRuntime_mips_64.cpp | 3816 +++++ + .../src/cpu/mips/vm/stubGenerator_mips_64.cpp | 2147 +++ + .../src/cpu/mips/vm/stubRoutines_mips_64.cpp | 35 + + .../src/cpu/mips/vm/stubRoutines_mips_64.hpp | 59 + + .../vm/templateInterpreterGenerator_mips.hpp | 35 + + .../cpu/mips/vm/templateInterpreter_mips.hpp | 41 + + .../mips/vm/templateInterpreter_mips_64.cpp | 2306 +++ + .../src/cpu/mips/vm/templateTable_mips.hpp | 34 + + .../src/cpu/mips/vm/templateTable_mips_64.cpp | 4623 +++++ + .../src/cpu/mips/vm/templateTable_mips_64.hpp | 44 + + hotspot/src/cpu/mips/vm/vmStructs_mips.hpp | 68 + + .../src/cpu/mips/vm/vm_version_ext_mips.cpp | 89 + + .../src/cpu/mips/vm/vm_version_ext_mips.hpp | 54 + + hotspot/src/cpu/mips/vm/vm_version_mips.cpp | 510 + + hotspot/src/cpu/mips/vm/vm_version_mips.hpp | 221 + + hotspot/src/cpu/mips/vm/vmreg_mips.cpp | 51 + + hotspot/src/cpu/mips/vm/vmreg_mips.hpp | 35 + + hotspot/src/cpu/mips/vm/vmreg_mips.inline.hpp | 68 + + .../src/cpu/mips/vm/vtableStubs_mips_64.cpp | 301 + + .../src/cpu/x86/vm/c1_LIRAssembler_x86.cpp | 10 + + .../src/cpu/x86/vm/c1_LIRGenerator_x86.cpp | 21 +- + hotspot/src/os/linux/vm/os_linux.cpp | 27 +- + hotspot/src/os/linux/vm/os_perf_linux.cpp | 6 + + .../vm/assembler_linux_loongarch.cpp | 92 + + .../vm/atomic_linux_loongarch.inline.hpp | 206 + + .../vm/bytes_linux_loongarch.inline.hpp | 37 + + .../vm/copy_linux_loongarch.inline.hpp | 125 + + .../vm/globals_linux_loongarch.hpp | 43 + + .../vm/orderAccess_linux_loongarch.inline.hpp | 115 + + .../linux_loongarch/vm/os_linux_loongarch.cpp | 750 + + .../linux_loongarch/vm/os_linux_loongarch.hpp | 39 + + .../vm/prefetch_linux_loongarch.inline.hpp | 56 + + .../vm/threadLS_linux_loongarch.cpp | 84 + + .../vm/threadLS_linux_loongarch.hpp | 61 + + .../vm/thread_linux_loongarch.cpp | 99 + + .../vm/thread_linux_loongarch.hpp | 75 + + .../vm/vmStructs_linux_loongarch.hpp | 55 + + .../vm/vm_version_linux_loongarch.cpp | 29 + + .../linux_mips/vm/assembler_linux_mips.cpp | 111 + + .../vm/atomic_linux_mips.inline.hpp | 258 + + .../linux_mips/vm/bytes_linux_mips.inline.hpp | 37 + + .../linux_mips/vm/copy_linux_mips.inline.hpp | 125 + + .../linux_mips/vm/globals_linux_mips.hpp | 51 + + .../src/os_cpu/linux_mips/vm/linux_mips.ad | 153 + + hotspot/src/os_cpu/linux_mips/vm/linux_mips.s | 25 + + .../src/os_cpu/linux_mips/vm/linux_mips_64.ad | 50 + + .../vm/orderAccess_linux_mips.inline.hpp | 115 + + .../os_cpu/linux_mips/vm/os_linux_mips.cpp | 1015 ++ + .../os_cpu/linux_mips/vm/os_linux_mips.hpp | 39 + + .../vm/prefetch_linux_mips.inline.hpp | 58 + + .../linux_mips/vm/threadLS_linux_mips.cpp | 84 + + .../linux_mips/vm/threadLS_linux_mips.hpp | 61 + + .../linux_mips/vm/thread_linux_mips.cpp | 99 + + .../linux_mips/vm/thread_linux_mips.hpp | 75 + + .../linux_mips/vm/vmStructs_linux_mips.hpp | 55 + + .../linux_mips/vm/vm_version_linux_mips.cpp | 28 + + hotspot/src/share/tools/hsdis/Makefile | 13 + + hotspot/src/share/tools/hsdis/hsdis.c | 10 + + hotspot/src/share/vm/adlc/main.cpp | 14 + + hotspot/src/share/vm/asm/assembler.hpp | 20 + + hotspot/src/share/vm/asm/assembler.inline.hpp | 12 + + hotspot/src/share/vm/asm/codeBuffer.cpp | 7 + + hotspot/src/share/vm/asm/codeBuffer.hpp | 12 + + hotspot/src/share/vm/asm/macroAssembler.hpp | 13 +- + .../share/vm/asm/macroAssembler.inline.hpp | 12 + + hotspot/src/share/vm/asm/register.hpp | 12 + + hotspot/src/share/vm/c1/c1_Defs.hpp | 12 + + hotspot/src/share/vm/c1/c1_FpuStackSim.hpp | 9 + + hotspot/src/share/vm/c1/c1_FrameMap.cpp | 9 + + hotspot/src/share/vm/c1/c1_FrameMap.hpp | 9 + + hotspot/src/share/vm/c1/c1_LIR.cpp | 220 +- + hotspot/src/share/vm/c1/c1_LIR.hpp | 199 +- + hotspot/src/share/vm/c1/c1_LIRAssembler.cpp | 22 + + hotspot/src/share/vm/c1/c1_LIRAssembler.hpp | 12 + + hotspot/src/share/vm/c1/c1_LIRGenerator.cpp | 114 +- + hotspot/src/share/vm/c1/c1_LIRGenerator.hpp | 17 +- + hotspot/src/share/vm/c1/c1_LinearScan.cpp | 81 +- + hotspot/src/share/vm/c1/c1_LinearScan.hpp | 9 + + hotspot/src/share/vm/c1/c1_MacroAssembler.hpp | 9 + + hotspot/src/share/vm/c1/c1_Runtime1.cpp | 48 + + hotspot/src/share/vm/c1/c1_globals.hpp | 9 + + .../share/vm/classfile/bytecodeAssembler.cpp | 12 + + .../share/vm/classfile/classFileStream.hpp | 12 + + .../src/share/vm/classfile/stackMapTable.hpp | 12 + + hotspot/src/share/vm/classfile/verifier.cpp | 12 + + hotspot/src/share/vm/code/codeBlob.cpp | 12 + + hotspot/src/share/vm/code/compiledIC.hpp | 12 + + hotspot/src/share/vm/code/relocInfo.hpp | 45 +- + hotspot/src/share/vm/code/vmreg.hpp | 18 + + .../src/share/vm/compiler/disassembler.cpp | 12 + + .../src/share/vm/compiler/disassembler.hpp | 12 + + .../parallelScavenge/cardTableExtension.hpp | 3 + + .../parallelScavenge/parMarkBitMap.cpp | 3 + + .../psCompactionManager.inline.hpp | 6 + + .../parallelScavenge/psParallelCompact.cpp | 9 + + .../parallelScavenge/psParallelCompact.hpp | 6 + + .../psPromotionManager.inline.hpp | 24 +- + .../parallelScavenge/psScavenge.inline.hpp | 21 +- + .../vm/interpreter/abstractInterpreter.hpp | 10 + + hotspot/src/share/vm/interpreter/bytecode.hpp | 12 + + .../vm/interpreter/bytecodeInterpreter.hpp | 15 + + .../bytecodeInterpreter.inline.hpp | 12 + + .../share/vm/interpreter/bytecodeStream.hpp | 12 + + .../src/share/vm/interpreter/bytecodes.cpp | 12 + + .../src/share/vm/interpreter/bytecodes.hpp | 12 + + .../share/vm/interpreter/cppInterpreter.hpp | 12 + + .../interpreter/cppInterpreterGenerator.hpp | 12 + + .../src/share/vm/interpreter/interpreter.hpp | 12 + + .../vm/interpreter/interpreterGenerator.hpp | 12 + + .../vm/interpreter/interpreterRuntime.cpp | 14 +- + .../vm/interpreter/interpreterRuntime.hpp | 14 +- + .../vm/interpreter/templateInterpreter.hpp | 12 + + .../templateInterpreterGenerator.hpp | 12 + + .../share/vm/interpreter/templateTable.hpp | 14 + + .../share/vm/jfr/utilities/jfrBigEndian.hpp | 2 +- + .../src/share/vm/jfr/writers/jfrEncoders.hpp | 12 + + hotspot/src/share/vm/memory/barrierSet.hpp | 25 +- + .../src/share/vm/memory/cardTableModRefBS.hpp | 12 +- + hotspot/src/share/vm/memory/cardTableRS.cpp | 10 +- + hotspot/src/share/vm/memory/cardTableRS.hpp | 9 +- + hotspot/src/share/vm/memory/metaspace.cpp | 13 +- + hotspot/src/share/vm/oops/constantPool.hpp | 13 + + hotspot/src/share/vm/oops/klass.hpp | 17 +- + hotspot/src/share/vm/oops/oop.hpp | 8 +- + hotspot/src/share/vm/oops/oop.inline.hpp | 12 + + hotspot/src/share/vm/oops/oop.pcgc.inline.hpp | 8 +- + hotspot/src/share/vm/opto/buildOopMap.cpp | 12 + + hotspot/src/share/vm/opto/bytecodeInfo.cpp | 11 + + hotspot/src/share/vm/opto/c2_globals.hpp | 12 + + hotspot/src/share/vm/opto/c2compiler.cpp | 10 + + hotspot/src/share/vm/opto/chaitin.hpp | 14 + + hotspot/src/share/vm/opto/compile.cpp | 10 + + hotspot/src/share/vm/opto/compile.hpp | 2 +- + hotspot/src/share/vm/opto/gcm.cpp | 10 + + hotspot/src/share/vm/opto/lcm.cpp | 10 + + hotspot/src/share/vm/opto/locknode.hpp | 10 + + hotspot/src/share/vm/opto/matcher.cpp | 10 + + hotspot/src/share/vm/opto/output.cpp | 43 + + hotspot/src/share/vm/opto/output.hpp | 10 + + hotspot/src/share/vm/opto/regmask.cpp | 10 + + hotspot/src/share/vm/opto/regmask.hpp | 10 + + hotspot/src/share/vm/opto/runtime.cpp | 10 + + hotspot/src/share/vm/opto/type.cpp | 16 + + hotspot/src/share/vm/prims/jniCheck.cpp | 12 + + hotspot/src/share/vm/prims/jni_md.h | 12 + + .../vm/prims/jvmtiClassFileReconstituter.cpp | 12 + + hotspot/src/share/vm/prims/methodHandles.hpp | 13 + + .../src/share/vm/runtime/atomic.inline.hpp | 12 + + .../src/share/vm/runtime/deoptimization.cpp | 18 + + hotspot/src/share/vm/runtime/dtraceJSDT.hpp | 12 + + hotspot/src/share/vm/runtime/frame.cpp | 13 + + hotspot/src/share/vm/runtime/frame.hpp | 16 + + hotspot/src/share/vm/runtime/frame.inline.hpp | 18 + + hotspot/src/share/vm/runtime/globals.hpp | 26 +- + hotspot/src/share/vm/runtime/icache.hpp | 13 +- + hotspot/src/share/vm/runtime/java.cpp | 12 + + hotspot/src/share/vm/runtime/javaCalls.hpp | 12 + + .../src/share/vm/runtime/javaFrameAnchor.hpp | 12 + + hotspot/src/share/vm/runtime/os.cpp | 3 +- + hotspot/src/share/vm/runtime/os.hpp | 12 + + .../src/share/vm/runtime/prefetch.inline.hpp | 6 + + hotspot/src/share/vm/runtime/registerMap.hpp | 18 + + hotspot/src/share/vm/runtime/relocator.hpp | 12 + + hotspot/src/share/vm/runtime/safepoint.cpp | 14 + + .../src/share/vm/runtime/sharedRuntime.cpp | 16 +- + .../share/vm/runtime/sharedRuntimeTrig.cpp | 15 + + .../share/vm/runtime/stackValueCollection.cpp | 12 + + hotspot/src/share/vm/runtime/statSampler.cpp | 12 + + hotspot/src/share/vm/runtime/stubRoutines.hpp | 16 + + hotspot/src/share/vm/runtime/thread.cpp | 6 + + hotspot/src/share/vm/runtime/thread.hpp | 12 + + .../share/vm/runtime/threadLocalStorage.hpp | 12 + + hotspot/src/share/vm/runtime/virtualspace.cpp | 16 + + hotspot/src/share/vm/runtime/vmStructs.cpp | 22 + + hotspot/src/share/vm/runtime/vm_version.cpp | 20 + + hotspot/src/share/vm/utilities/copy.hpp | 13 + + hotspot/src/share/vm/utilities/debug.cpp | 1 + + .../share/vm/utilities/globalDefinitions.hpp | 12 + + hotspot/src/share/vm/utilities/macros.hpp | 30 + + hotspot/src/share/vm/utilities/taskqueue.hpp | 74 +- + hotspot/src/share/vm/utilities/vmError.cpp | 14 +- + .../argumentcorruption/Test8167409.sh | 18 + + .../testcases/GenericTestCaseForOtherCPU.java | 5 +- + .../sha/predicate/IntrinsicPredicates.java | 10 +- + hotspot/test/runtime/6929067/Test6929067.sh | 4 + + hotspot/test/runtime/Unsafe/RangeCheck.java | 3 + + hotspot/test/test_env.sh | 23 + + .../com/oracle/java/testlibrary/Platform.java | 8 + + ...stMutuallyExclusivePlatformPredicates.java | 2 +- + jdk/make/Images.gmk | 20 + + jdk/make/gensrc/GensrcMisc.gmk | 13 + + jdk/make/lib/SoundLibraries.gmk | 14 + + .../classes/sun/misc/Version.java.template | 22 +- + jdk/src/solaris/bin/loongarch64/jvm.cfg | 36 + + jdk/src/solaris/bin/mips64/jvm.cfg | 36 + + .../jdk/jfr/event/os/TestCPUInformation.java | 4 +- + .../bootstrap/linux-loongarch64/launcher | 0 + .../bootstrap/linux-mips64el/launcher | 0 + jdk/test/sun/security/pkcs11/PKCS11Test.java | 8 + + 411 files changed, 111201 insertions(+), 216 deletions(-) + create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionLOONGARCH64.java + create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionMIPS64.java + create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/loongarch64/LinuxLOONGARCH64CFrame.java + create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/loongarch64/LinuxLOONGARCH64ThreadContext.java + create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/mips64/LinuxMIPS64CFrame.java + create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/mips64/LinuxMIPS64ThreadContext.java + create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/loongarch64/LOONGARCH64ThreadContext.java + create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/mips64/MIPS64ThreadContext.java + create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/loongarch64/ProcLOONGARCH64Thread.java + create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/loongarch64/ProcLOONGARCH64ThreadContext.java + create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/loongarch64/ProcLOONGARCH64ThreadFactory.java + create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/mips64/ProcMIPS64Thread.java + create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/mips64/ProcMIPS64ThreadContext.java + create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/mips64/ProcMIPS64ThreadFactory.java + create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/loongarch64/RemoteLOONGARCH64Thread.java + create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/loongarch64/RemoteLOONGARCH64ThreadContext.java + create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/loongarch64/RemoteLOONGARCH64ThreadFactory.java + create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/mips64/RemoteMIPS64Thread.java + create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/mips64/RemoteMIPS64ThreadContext.java + create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/mips64/RemoteMIPS64ThreadFactory.java + create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_loongarch64/LinuxLOONGARCH64JavaThreadPDAccess.java + create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_mips64/LinuxMIPS64JavaThreadPDAccess.java + create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64CurrentFrameGuess.java + create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64Frame.java + create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64JavaCallWrapper.java + create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64RegisterMap.java + create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64CurrentFrameGuess.java + create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64Frame.java + create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64JavaCallWrapper.java + create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64RegisterMap.java + create mode 100644 hotspot/make/linux/makefiles/loongarch64.make + create mode 100644 hotspot/make/linux/makefiles/mips64.make + create mode 100644 hotspot/make/linux/platform_loongarch64 + create mode 100644 hotspot/make/linux/platform_mips64 + create mode 100644 hotspot/src/cpu/loongarch/vm/assembler_loongarch.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/assembler_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/assembler_loongarch.inline.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/bytecodeInterpreter_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/bytecodeInterpreter_loongarch.inline.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/bytecodes_loongarch.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/bytecodes_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/bytes_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/c1_CodeStubs_loongarch_64.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/c1_Defs_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/c1_FpuStackSim_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/c1_FpuStackSim_loongarch_64.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/c1_FrameMap_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/c1_FrameMap_loongarch_64.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/c1_LIRAssembler_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/c1_LIRAssembler_loongarch_64.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/c1_LIRGenerator_loongarch_64.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/c1_LinearScan_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/c1_LinearScan_loongarch_64.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/c1_MacroAssembler_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/c1_MacroAssembler_loongarch_64.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/c1_Runtime1_loongarch_64.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/c1_globals_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/c2_globals_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/c2_init_loongarch.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/codeBuffer_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/compiledIC_loongarch.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/copy_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/cppInterpreterGenerator_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/cppInterpreter_loongarch.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/debug_loongarch.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/depChecker_loongarch.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/depChecker_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/disassembler_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/frame_loongarch.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/frame_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/frame_loongarch.inline.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/globalDefinitions_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/globals_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/icBuffer_loongarch.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/icache_loongarch.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/icache_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/interp_masm_loongarch_64.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/interp_masm_loongarch_64.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/interpreterGenerator_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/interpreterRT_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/interpreterRT_loongarch_64.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/interpreter_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/interpreter_loongarch_64.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/javaFrameAnchor_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/jniFastGetField_loongarch_64.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/jniTypes_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/jni_loongarch.h + create mode 100644 hotspot/src/cpu/loongarch/vm/loongarch.ad + create mode 100644 hotspot/src/cpu/loongarch/vm/loongarch_64.ad + create mode 100644 hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.inline.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/metaspaceShared_loongarch_64.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/methodHandles_loongarch.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/methodHandles_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/nativeInst_loongarch.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/nativeInst_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/registerMap_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/register_definitions_loongarch.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/register_loongarch.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/register_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/relocInfo_loongarch.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/relocInfo_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/runtime_loongarch_64.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/sharedRuntime_loongarch_64.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/stubGenerator_loongarch_64.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/stubRoutines_loongarch_64.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/stubRoutines_loongarch_64.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/templateInterpreterGenerator_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/templateInterpreter_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/templateInterpreter_loongarch_64.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/templateTable_loongarch_64.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/templateTable_loongarch_64.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/vmStructs_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/vm_version_ext_loongarch.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/vm_version_ext_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/vm_version_loongarch.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/vm_version_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/vmreg_loongarch.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/vmreg_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/vmreg_loongarch.inline.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/vtableStubs_loongarch_64.cpp + create mode 100644 hotspot/src/cpu/mips/vm/assembler_mips.cpp + create mode 100644 hotspot/src/cpu/mips/vm/assembler_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/assembler_mips.inline.hpp + create mode 100644 hotspot/src/cpu/mips/vm/bytecodeInterpreter_mips.cpp + create mode 100644 hotspot/src/cpu/mips/vm/bytecodeInterpreter_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/bytecodeInterpreter_mips.inline.hpp + create mode 100644 hotspot/src/cpu/mips/vm/bytecodes_mips.cpp + create mode 100644 hotspot/src/cpu/mips/vm/bytecodes_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/bytes_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/c2_globals_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/c2_init_mips.cpp + create mode 100644 hotspot/src/cpu/mips/vm/codeBuffer_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/compiledIC_mips.cpp + create mode 100644 hotspot/src/cpu/mips/vm/copy_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/cppInterpreterGenerator_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/cppInterpreter_mips.cpp + create mode 100644 hotspot/src/cpu/mips/vm/cppInterpreter_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/debug_mips.cpp + create mode 100644 hotspot/src/cpu/mips/vm/depChecker_mips.cpp + create mode 100644 hotspot/src/cpu/mips/vm/depChecker_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/disassembler_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/frame_mips.cpp + create mode 100644 hotspot/src/cpu/mips/vm/frame_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/frame_mips.inline.hpp + create mode 100644 hotspot/src/cpu/mips/vm/globalDefinitions_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/globals_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/icBuffer_mips.cpp + create mode 100644 hotspot/src/cpu/mips/vm/icache_mips.cpp + create mode 100644 hotspot/src/cpu/mips/vm/icache_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/interp_masm_mips_64.cpp + create mode 100644 hotspot/src/cpu/mips/vm/interp_masm_mips_64.hpp + create mode 100644 hotspot/src/cpu/mips/vm/interpreterGenerator_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/interpreterRT_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/interpreterRT_mips_64.cpp + create mode 100644 hotspot/src/cpu/mips/vm/interpreter_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/interpreter_mips_64.cpp + create mode 100644 hotspot/src/cpu/mips/vm/javaFrameAnchor_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/jniFastGetField_mips_64.cpp + create mode 100644 hotspot/src/cpu/mips/vm/jniTypes_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/jni_mips.h + create mode 100644 hotspot/src/cpu/mips/vm/macroAssembler_mips.cpp + create mode 100644 hotspot/src/cpu/mips/vm/macroAssembler_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/macroAssembler_mips.inline.hpp + create mode 100644 hotspot/src/cpu/mips/vm/metaspaceShared_mips_64.cpp + create mode 100644 hotspot/src/cpu/mips/vm/methodHandles_mips.cpp + create mode 100644 hotspot/src/cpu/mips/vm/methodHandles_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/mips.ad + create mode 100644 hotspot/src/cpu/mips/vm/mips_64.ad + create mode 100644 hotspot/src/cpu/mips/vm/nativeInst_mips.cpp + create mode 100644 hotspot/src/cpu/mips/vm/nativeInst_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/registerMap_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/register_definitions_mips.cpp + create mode 100644 hotspot/src/cpu/mips/vm/register_mips.cpp + create mode 100644 hotspot/src/cpu/mips/vm/register_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/relocInfo_mips.cpp + create mode 100644 hotspot/src/cpu/mips/vm/relocInfo_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/runtime_mips_64.cpp + create mode 100644 hotspot/src/cpu/mips/vm/sharedRuntime_mips_64.cpp + create mode 100644 hotspot/src/cpu/mips/vm/stubGenerator_mips_64.cpp + create mode 100644 hotspot/src/cpu/mips/vm/stubRoutines_mips_64.cpp + create mode 100644 hotspot/src/cpu/mips/vm/stubRoutines_mips_64.hpp + create mode 100644 hotspot/src/cpu/mips/vm/templateInterpreterGenerator_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/templateInterpreter_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/templateInterpreter_mips_64.cpp + create mode 100644 hotspot/src/cpu/mips/vm/templateTable_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/templateTable_mips_64.cpp + create mode 100644 hotspot/src/cpu/mips/vm/templateTable_mips_64.hpp + create mode 100644 hotspot/src/cpu/mips/vm/vmStructs_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/vm_version_ext_mips.cpp + create mode 100644 hotspot/src/cpu/mips/vm/vm_version_ext_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/vm_version_mips.cpp + create mode 100644 hotspot/src/cpu/mips/vm/vm_version_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/vmreg_mips.cpp + create mode 100644 hotspot/src/cpu/mips/vm/vmreg_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/vmreg_mips.inline.hpp + create mode 100644 hotspot/src/cpu/mips/vm/vtableStubs_mips_64.cpp + create mode 100644 hotspot/src/os_cpu/linux_loongarch/vm/assembler_linux_loongarch.cpp + create mode 100644 hotspot/src/os_cpu/linux_loongarch/vm/atomic_linux_loongarch.inline.hpp + create mode 100644 hotspot/src/os_cpu/linux_loongarch/vm/bytes_linux_loongarch.inline.hpp + create mode 100644 hotspot/src/os_cpu/linux_loongarch/vm/copy_linux_loongarch.inline.hpp + create mode 100644 hotspot/src/os_cpu/linux_loongarch/vm/globals_linux_loongarch.hpp + create mode 100644 hotspot/src/os_cpu/linux_loongarch/vm/orderAccess_linux_loongarch.inline.hpp + create mode 100644 hotspot/src/os_cpu/linux_loongarch/vm/os_linux_loongarch.cpp + create mode 100644 hotspot/src/os_cpu/linux_loongarch/vm/os_linux_loongarch.hpp + create mode 100644 hotspot/src/os_cpu/linux_loongarch/vm/prefetch_linux_loongarch.inline.hpp + create mode 100644 hotspot/src/os_cpu/linux_loongarch/vm/threadLS_linux_loongarch.cpp + create mode 100644 hotspot/src/os_cpu/linux_loongarch/vm/threadLS_linux_loongarch.hpp + create mode 100644 hotspot/src/os_cpu/linux_loongarch/vm/thread_linux_loongarch.cpp + create mode 100644 hotspot/src/os_cpu/linux_loongarch/vm/thread_linux_loongarch.hpp + create mode 100644 hotspot/src/os_cpu/linux_loongarch/vm/vmStructs_linux_loongarch.hpp + create mode 100644 hotspot/src/os_cpu/linux_loongarch/vm/vm_version_linux_loongarch.cpp + create mode 100644 hotspot/src/os_cpu/linux_mips/vm/assembler_linux_mips.cpp + create mode 100644 hotspot/src/os_cpu/linux_mips/vm/atomic_linux_mips.inline.hpp + create mode 100644 hotspot/src/os_cpu/linux_mips/vm/bytes_linux_mips.inline.hpp + create mode 100644 hotspot/src/os_cpu/linux_mips/vm/copy_linux_mips.inline.hpp + create mode 100644 hotspot/src/os_cpu/linux_mips/vm/globals_linux_mips.hpp + create mode 100644 hotspot/src/os_cpu/linux_mips/vm/linux_mips.ad + create mode 100644 hotspot/src/os_cpu/linux_mips/vm/linux_mips.s + create mode 100644 hotspot/src/os_cpu/linux_mips/vm/linux_mips_64.ad + create mode 100644 hotspot/src/os_cpu/linux_mips/vm/orderAccess_linux_mips.inline.hpp + create mode 100644 hotspot/src/os_cpu/linux_mips/vm/os_linux_mips.cpp + create mode 100644 hotspot/src/os_cpu/linux_mips/vm/os_linux_mips.hpp + create mode 100644 hotspot/src/os_cpu/linux_mips/vm/prefetch_linux_mips.inline.hpp + create mode 100644 hotspot/src/os_cpu/linux_mips/vm/threadLS_linux_mips.cpp + create mode 100644 hotspot/src/os_cpu/linux_mips/vm/threadLS_linux_mips.hpp + create mode 100644 hotspot/src/os_cpu/linux_mips/vm/thread_linux_mips.cpp + create mode 100644 hotspot/src/os_cpu/linux_mips/vm/thread_linux_mips.hpp + create mode 100644 hotspot/src/os_cpu/linux_mips/vm/vmStructs_linux_mips.hpp + create mode 100644 hotspot/src/os_cpu/linux_mips/vm/vm_version_linux_mips.cpp + create mode 100644 jdk/src/solaris/bin/loongarch64/jvm.cfg + create mode 100644 jdk/src/solaris/bin/mips64/jvm.cfg + create mode 100644 jdk/test/sun/management/jmxremote/bootstrap/linux-loongarch64/launcher + create mode 100644 jdk/test/sun/management/jmxremote/bootstrap/linux-mips64el/launcher + +diff --git a/common/autoconf/build-aux/autoconf-config.guess b/common/autoconf/build-aux/autoconf-config.guess +index 15ee4389..3d7555b5 100644 +--- a/common/autoconf/build-aux/autoconf-config.guess ++++ b/common/autoconf/build-aux/autoconf-config.guess +@@ -977,6 +977,9 @@ EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; @@ -11,10 +666,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/commo or32:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/common/autoconf/build-aux/autoconf-config.sub b/common/autoconf/build-aux/autoconf-config.sub ---- a/common/autoconf/build-aux/autoconf-config.sub 2024-01-11 09:53:23.000000000 +0800 -+++ b/common/autoconf/build-aux/autoconf-config.sub 2023-12-20 09:23:19.574817100 +0800 -@@ -275,6 +275,7 @@ +diff --git a/common/autoconf/build-aux/autoconf-config.sub b/common/autoconf/build-aux/autoconf-config.sub +index 1aab2b30..bd910bdd 100644 +--- a/common/autoconf/build-aux/autoconf-config.sub ++++ b/common/autoconf/build-aux/autoconf-config.sub +@@ -275,6 +275,7 @@ case $basic_machine in | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ @@ -22,10 +678,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/commo | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep \ | mips | mipsbe | mipseb | mipsel | mipsle \ -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/common/autoconf/build-aux/config.guess b/common/autoconf/build-aux/config.guess ---- a/common/autoconf/build-aux/config.guess 2024-01-11 09:53:23.000000000 +0800 -+++ b/common/autoconf/build-aux/config.guess 2023-12-20 09:23:19.574817100 +0800 -@@ -86,4 +86,15 @@ +diff --git a/common/autoconf/build-aux/config.guess b/common/autoconf/build-aux/config.guess +index 288edb6e..ca6d5871 100644 +--- a/common/autoconf/build-aux/config.guess ++++ b/common/autoconf/build-aux/config.guess +@@ -95,4 +95,15 @@ if [ "x$OUT" = x ]; then fi fi @@ -41,9 +698,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/commo +fi + echo $OUT -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/common/autoconf/configure.ac b/common/autoconf/configure.ac ---- a/common/autoconf/configure.ac 2024-01-11 09:53:23.000000000 +0800 -+++ b/common/autoconf/configure.ac 2023-12-20 09:23:19.574817100 +0800 +diff --git a/common/autoconf/configure.ac b/common/autoconf/configure.ac +index 151e5a10..5072409d 100644 +--- a/common/autoconf/configure.ac ++++ b/common/autoconf/configure.ac @@ -23,6 +23,12 @@ # questions. # @@ -57,7 +715,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/commo ############################################################################### # # Includes and boilerplate -@@ -186,6 +192,7 @@ +@@ -186,6 +192,7 @@ FLAGS_SETUP_INIT_FLAGS # Now we can test some aspects on the target using configure macros. PLATFORM_SETUP_OPENJDK_TARGET_BITS PLATFORM_SETUP_OPENJDK_TARGET_ENDIANNESS @@ -65,10 +723,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/commo # Configure flags for the tools FLAGS_SETUP_COMPILER_FLAGS_FOR_LIBS -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh ---- a/common/autoconf/generated-configure.sh 2024-01-11 09:53:23.000000000 +0800 -+++ b/common/autoconf/generated-configure.sh 2024-01-30 13:54:24.742709461 +0800 -@@ -716,6 +716,9 @@ +diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh +index 85eb8a16..cf57b89f 100644 +--- a/common/autoconf/generated-configure.sh ++++ b/common/autoconf/generated-configure.sh +@@ -716,6 +716,9 @@ SET_EXECUTABLE_ORIGIN SHARED_LIBRARY_FLAGS CXX_FLAG_REORDER C_FLAG_REORDER @@ -78,7 +737,23 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/commo SYSROOT_LDFLAGS SYSROOT_CFLAGS RC_FLAGS -@@ -4095,6 +4098,12 @@ +@@ -1069,6 +1072,7 @@ with_milestone + with_update_version + with_user_release_suffix + with_build_number ++with_company_name + with_vendor_name + with_vendor_url + with_vendor_bug_url +@@ -1922,6 +1926,7 @@ Optional Packages: + Add a custom string to the version string if build + number isn't set.[username_builddateb00] + --with-build-number Set build number value for build [b00] ++ --with-company-name Set company name. + --with-vendor-name Set vendor name. Among others, used to set the + 'java.vendor' and 'java.vm.vendor' system + properties. [not specified] +@@ -4081,6 +4086,12 @@ fi # questions. # @@ -91,7 +766,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/commo # Support macro for PLATFORM_EXTRACT_TARGET_AND_BUILD. # Converts autoconf style CPU name to OpenJDK style, into # VAR_CPU, VAR_CPU_ARCH, VAR_CPU_BITS and VAR_CPU_ENDIAN. -@@ -13944,6 +13953,12 @@ +@@ -13930,6 +13941,12 @@ test -n "$target_alias" && VAR_CPU_BITS=64 VAR_CPU_ENDIAN=big ;; @@ -104,7 +779,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/commo loongarch64) VAR_CPU=loongarch64 VAR_CPU_ARCH=loongarch -@@ -14088,6 +14103,12 @@ +@@ -14074,6 +14091,12 @@ $as_echo "$OPENJDK_BUILD_OS-$OPENJDK_BUILD_CPU" >&6; } VAR_CPU_BITS=64 VAR_CPU_ENDIAN=big ;; @@ -117,7 +792,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/commo loongarch64) VAR_CPU=loongarch64 VAR_CPU_ARCH=loongarch -@@ -14216,6 +14237,8 @@ +@@ -14202,6 +14225,8 @@ $as_echo "$COMPILE_TYPE" >&6; } OPENJDK_TARGET_CPU_LEGACY_LIB="i386" elif test "x$OPENJDK_TARGET_CPU" = xx86_64; then OPENJDK_TARGET_CPU_LEGACY_LIB="amd64" @@ -126,7 +801,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/commo fi -@@ -14249,6 +14272,9 @@ +@@ -14235,6 +14260,9 @@ $as_echo "$COMPILE_TYPE" >&6; } elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then # On all platforms except macosx, we replace x86_64 with amd64. OPENJDK_TARGET_CPU_OSARCH="amd64" @@ -136,7 +811,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/commo fi -@@ -14258,6 +14284,8 @@ +@@ -14244,6 +14272,8 @@ $as_echo "$COMPILE_TYPE" >&6; } elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then # On all platforms except macosx, we replace x86_64 with amd64. OPENJDK_TARGET_CPU_JLI="amd64" @@ -145,7 +820,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/commo fi # Now setup the -D flags for building libjli. OPENJDK_TARGET_CPU_JLI_CFLAGS="-DLIBARCHNAME='\"$OPENJDK_TARGET_CPU_JLI\"'" -@@ -14270,6 +14298,9 @@ +@@ -14256,6 +14286,9 @@ $as_echo "$COMPILE_TYPE" >&6; } elif test "x$OPENJDK_TARGET_OS" = xmacosx && test "x$TOOLCHAIN_TYPE" = xclang ; then OPENJDK_TARGET_CPU_JLI_CFLAGS="$OPENJDK_TARGET_CPU_JLI_CFLAGS -stdlib=libc++ -mmacosx-version-min=\$(MACOSX_VERSION_MIN)" fi @@ -155,7 +830,38 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/commo # Setup OPENJDK_TARGET_OS_API_DIR, used in source paths. -@@ -42939,6 +42970,47 @@ +@@ -20409,18 +20442,21 @@ fi + + # Now set the JDK version, milestone, build number etc. + ++ # The company name, if any + ++# Check whether --with-company-name was given. ++if test "${with_company_name+set}" = set; then : ++ withval=$with_company_name; ++fi + + +- +- +- +- +- +- +- +- +- ++ if test "x$with_company_name" = xyes; then ++ as_fn_error $? "--with-company-name must have a value" "$LINENO" 5 ++ elif ! [[ $with_company_name =~ ^[[:print:]]*$ ]] ; then ++ as_fn_error $? "--with-company-name contains non-printing characters: $with_company_name" "$LINENO" 5 ++ elif test "x$with_company_name" != x; then ++ COMPANY_NAME="$with_company_name" ++ fi + + # The vendor name, if any + +@@ -42436,6 +42472,47 @@ $as_echo "$ac_cv_c_bigendian" >&6; } fi @@ -203,9 +909,33 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/commo # Configure flags for the tools ############################################################################### -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/common/autoconf/platform.m4 b/common/autoconf/platform.m4 ---- a/common/autoconf/platform.m4 2024-01-11 09:53:23.000000000 +0800 -+++ b/common/autoconf/platform.m4 2023-12-20 09:23:19.581483690 +0800 +diff --git a/common/autoconf/jdk-options.m4 b/common/autoconf/jdk-options.m4 +index 18ba5852..42aeb7bd 100644 +--- a/common/autoconf/jdk-options.m4 ++++ b/common/autoconf/jdk-options.m4 +@@ -539,6 +539,18 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_VERSION_NUMBERS], + AC_SUBST(MACOSX_BUNDLE_NAME_BASE) + AC_SUBST(MACOSX_BUNDLE_ID_BASE) + ++ # The company name, if any ++ AC_ARG_WITH(company-name, [AS_HELP_STRING([--with-company-name], ++ [Set company name.])]) ++ if test "x$with_company_name" = xyes; then ++ AC_MSG_ERROR([--with-company-name must have a value]) ++ elif [ ! [[ $with_company_name =~ ^[[:print:]]*$ ]] ]; then ++ AC_MSG_ERROR([--with-company-name contains non-printing characters: $with_company_name]) ++ elif test "x$with_company_name" != x; then ++ COMPANY_NAME="$with_company_name" ++ fi ++ AC_SUBST(COMPANY_NAME) ++ + # The vendor name, if any + AC_ARG_WITH(vendor-name, [AS_HELP_STRING([--with-vendor-name], + [Set vendor name. Among others, used to set the 'java.vendor' +diff --git a/common/autoconf/platform.m4 b/common/autoconf/platform.m4 +index f54942ac..51cc28c3 100644 +--- a/common/autoconf/platform.m4 ++++ b/common/autoconf/platform.m4 @@ -23,6 +23,12 @@ # questions. # @@ -219,7 +949,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/commo # Support macro for PLATFORM_EXTRACT_TARGET_AND_BUILD. # Converts autoconf style CPU name to OpenJDK style, into # VAR_CPU, VAR_CPU_ARCH, VAR_CPU_BITS and VAR_CPU_ENDIAN. -@@ -96,6 +102,12 @@ +@@ -96,6 +102,12 @@ AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_CPU], VAR_CPU_BITS=64 VAR_CPU_ENDIAN=big ;; @@ -232,7 +962,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/commo loongarch64) VAR_CPU=loongarch64 VAR_CPU_ARCH=loongarch -@@ -289,6 +301,8 @@ +@@ -289,6 +301,8 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS], OPENJDK_TARGET_CPU_LEGACY_LIB="i386" elif test "x$OPENJDK_TARGET_CPU" = xx86_64; then OPENJDK_TARGET_CPU_LEGACY_LIB="amd64" @@ -241,7 +971,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/commo fi AC_SUBST(OPENJDK_TARGET_CPU_LEGACY_LIB) -@@ -322,6 +336,9 @@ +@@ -322,6 +336,9 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS], elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then # On all platforms except macosx, we replace x86_64 with amd64. OPENJDK_TARGET_CPU_OSARCH="amd64" @@ -251,7 +981,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/commo fi AC_SUBST(OPENJDK_TARGET_CPU_OSARCH) -@@ -331,6 +348,8 @@ +@@ -331,6 +348,8 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS], elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then # On all platforms except macosx, we replace x86_64 with amd64. OPENJDK_TARGET_CPU_JLI="amd64" @@ -260,7 +990,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/commo fi # Now setup the -D flags for building libjli. OPENJDK_TARGET_CPU_JLI_CFLAGS="-DLIBARCHNAME='\"$OPENJDK_TARGET_CPU_JLI\"'" -@@ -343,6 +362,9 @@ +@@ -343,6 +362,9 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS], elif test "x$OPENJDK_TARGET_OS" = xmacosx && test "x$TOOLCHAIN_TYPE" = xclang ; then OPENJDK_TARGET_CPU_JLI_CFLAGS="$OPENJDK_TARGET_CPU_JLI_CFLAGS -stdlib=libc++ -mmacosx-version-min=\$(MACOSX_VERSION_MIN)" fi @@ -270,7 +1000,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/commo AC_SUBST(OPENJDK_TARGET_CPU_JLI_CFLAGS) # Setup OPENJDK_TARGET_OS_API_DIR, used in source paths. -@@ -556,3 +578,46 @@ +@@ -556,3 +578,46 @@ AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_TARGET_ENDIANNESS], AC_MSG_ERROR([The tested endian in the target ($ENDIAN) differs from the endian expected to be found in the target ($OPENJDK_TARGET_CPU_ENDIAN)]) fi ]) @@ -317,9 +1047,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/commo +AC_SUBST(BUILDER_NAME) +AC_SUBST(HOST_NAME) +]) -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/common/autoconf/spec.gmk.in b/common/autoconf/spec.gmk.in ---- a/common/autoconf/spec.gmk.in 2024-01-11 09:53:23.000000000 +0800 -+++ b/common/autoconf/spec.gmk.in 2024-01-30 13:54:24.742709461 +0800 +diff --git a/common/autoconf/spec.gmk.in b/common/autoconf/spec.gmk.in +index 9573bb2c..1b034770 100644 +--- a/common/autoconf/spec.gmk.in ++++ b/common/autoconf/spec.gmk.in @@ -23,6 +23,12 @@ # questions. # @@ -333,7 +1064,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/commo # Configured @DATE_WHEN_CONFIGURED@ to build # for target system @OPENJDK_TARGET_OS@-@OPENJDK_TARGET_CPU@ # (called @OPENJDK_TARGET_AUTOCONF_NAME@ by autoconf) -@@ -219,6 +225,23 @@ +@@ -219,6 +225,23 @@ else endif JRE_RELEASE_VERSION:=$(FULL_VERSION) @@ -357,9 +1088,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/commo # How to compile the code: release, fastdebug or slowdebug DEBUG_LEVEL:=@DEBUG_LEVEL@ -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/make/saenv.sh b/hotspot/agent/make/saenv.sh ---- a/hotspot/agent/make/saenv.sh 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/agent/make/saenv.sh 2023-12-20 09:23:19.681482545 +0800 +diff --git a/hotspot/agent/make/saenv.sh b/hotspot/agent/make/saenv.sh +index ab9a0a43..a2de3fc3 100644 +--- a/hotspot/agent/make/saenv.sh ++++ b/hotspot/agent/make/saenv.sh @@ -23,6 +23,12 @@ # # @@ -373,7 +1105,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp # This file sets common environment variables for all SA scripts OS=`uname` -@@ -42,6 +48,14 @@ +@@ -42,6 +48,14 @@ if [ "$OS" = "Linux" ]; then SA_LIBPATH=$STARTDIR/../src/os/linux/amd64:$STARTDIR/linux/amd64 OPTIONS="-Dsa.library.path=$SA_LIBPATH" CPU=amd64 @@ -388,48 +1120,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp else SA_LIBPATH=$STARTDIR/../src/os/linux/i386:$STARTDIR/linux/i386 OPTIONS="-Dsa.library.path=$SA_LIBPATH" -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/os/linux/libproc.h b/hotspot/agent/src/os/linux/libproc.h ---- a/hotspot/agent/src/os/linux/libproc.h 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/agent/src/os/linux/libproc.h 2023-12-20 09:23:19.684815841 +0800 -@@ -22,6 +22,12 @@ - * - */ - -+/* -+ * This file has been modified by Loongson Technology in 2022. These -+ * modifications are Copyright (c) 2015, 2022, Loongson Technology, and are made -+ * available on the same license terms set forth above. -+ */ -+ - #ifndef _LIBPROC_H_ - #define _LIBPROC_H_ - -@@ -36,7 +42,7 @@ - #include - #include - --#if defined(aarch64) -+#if defined(aarch64) || defined(loongarch64) - #include "asm/ptrace.h" - #endif - -@@ -45,7 +51,12 @@ - #include - #define user_regs_struct pt_regs - #endif --#if defined(aarch64) -+ -+#if defined(mips) || defined(mipsel) || defined(mips64) || defined(mips64el) -+#include -+#define user_regs_struct pt_regs -+#endif -+#if defined(aarch64) || defined(loongarch64) - #define user_regs_struct user_pt_regs - #endif - -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/os/linux/LinuxDebuggerLocal.c b/hotspot/agent/src/os/linux/LinuxDebuggerLocal.c ---- a/hotspot/agent/src/os/linux/LinuxDebuggerLocal.c 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/agent/src/os/linux/LinuxDebuggerLocal.c 2023-12-20 09:23:19.684815841 +0800 +diff --git a/hotspot/agent/src/os/linux/LinuxDebuggerLocal.c b/hotspot/agent/src/os/linux/LinuxDebuggerLocal.c +index d6a0c7d9..b3b1380b 100644 +--- a/hotspot/agent/src/os/linux/LinuxDebuggerLocal.c ++++ b/hotspot/agent/src/os/linux/LinuxDebuggerLocal.c @@ -22,6 +22,13 @@ * */ @@ -443,8 +1137,8 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + #include #include "libproc.h" - #include "proc_service.h" -@@ -50,10 +57,18 @@ + +@@ -49,10 +56,18 @@ #include "sun_jvm_hotspot_debugger_sparc_SPARCThreadContext.h" #endif @@ -463,7 +1157,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp static jfieldID p_ps_prochandle_ID = 0; static jfieldID threadList_ID = 0; static jfieldID loadObjectList_ID = 0; -@@ -338,7 +353,7 @@ +@@ -337,7 +352,7 @@ JNIEXPORT jbyteArray JNICALL Java_sun_jvm_hotspot_debugger_linux_LinuxDebuggerLo return (err == PS_OK)? array : 0; } @@ -472,20 +1166,20 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp JNIEXPORT jlongArray JNICALL Java_sun_jvm_hotspot_debugger_linux_LinuxDebuggerLocal_getThreadIntegerRegisterSet0 (JNIEnv *env, jobject this_obj, jint lwp_id) { -@@ -366,6 +381,12 @@ +@@ -364,6 +379,12 @@ JNIEXPORT jlongArray JNICALL Java_sun_jvm_hotspot_debugger_linux_LinuxDebuggerLo + #endif #if defined(sparc) || defined(sparcv9) #define NPRGREG sun_jvm_hotspot_debugger_sparc_SPARCThreadContext_NPRGREG - #endif ++#endif +#ifdef loongarch64 +#define NPRGREG sun_jvm_hotspot_debugger_loongarch64_LOONGARCH64ThreadContext_NPRGREG +#endif +#if defined(mips64) || defined(mips64el) +#define NPRGREG sun_jvm_hotspot_debugger_mips64_MIPS64ThreadContext_NPRGREG -+#endif + #endif array = (*env)->NewLongArray(env, NPRGREG); - CHECK_EXCEPTION_(0); -@@ -471,6 +492,55 @@ +@@ -470,6 +491,55 @@ JNIEXPORT jlongArray JNICALL Java_sun_jvm_hotspot_debugger_linux_LinuxDebuggerLo } #endif /* aarch64 */ @@ -541,9 +1235,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp (*env)->ReleaseLongArrayElements(env, array, regs, JNI_COMMIT); return array; -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/os/linux/Makefile b/hotspot/agent/src/os/linux/Makefile ---- a/hotspot/agent/src/os/linux/Makefile 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/agent/src/os/linux/Makefile 2023-12-20 09:23:19.684815841 +0800 +diff --git a/hotspot/agent/src/os/linux/Makefile b/hotspot/agent/src/os/linux/Makefile +index c0b5c869..2cc50b6f 100644 +--- a/hotspot/agent/src/os/linux/Makefile ++++ b/hotspot/agent/src/os/linux/Makefile @@ -22,7 +22,13 @@ # # @@ -559,7 +1254,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp GCC = gcc JAVAH = ${JAVA_HOME}/bin/javah -@@ -53,6 +59,8 @@ +@@ -53,6 +59,8 @@ $(ARCH)/LinuxDebuggerLocal.o: LinuxDebuggerLocal.c $(JAVAH) -jni -classpath ../../../build/classes -d $(ARCH) \ sun.jvm.hotspot.debugger.x86.X86ThreadContext \ sun.jvm.hotspot.debugger.sparc.SPARCThreadContext \ @@ -568,9 +1263,50 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp sun.jvm.hotspot.debugger.amd64.AMD64ThreadContext \ sun.jvm.hotspot.debugger.aarch64.AARCH64ThreadContext $(GCC) $(CFLAGS) $< -o $@ -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/os/linux/ps_proc.c b/hotspot/agent/src/os/linux/ps_proc.c ---- a/hotspot/agent/src/os/linux/ps_proc.c 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/agent/src/os/linux/ps_proc.c 2023-12-20 09:23:19.684815841 +0800 +diff --git a/hotspot/agent/src/os/linux/libproc.h b/hotspot/agent/src/os/linux/libproc.h +index 6b6e41ca..5eb8211a 100644 +--- a/hotspot/agent/src/os/linux/libproc.h ++++ b/hotspot/agent/src/os/linux/libproc.h +@@ -22,6 +22,12 @@ + * + */ + ++/* ++ * This file has been modified by Loongson Technology in 2022. These ++ * modifications are Copyright (c) 2015, 2022, Loongson Technology, and are made ++ * available on the same license terms set forth above. ++ */ ++ + #ifndef _LIBPROC_H_ + #define _LIBPROC_H_ + +@@ -36,7 +42,7 @@ + + #include + +-#if defined(aarch64) ++#if defined(aarch64) || defined(loongarch64) + #include "asm/ptrace.h" + #endif + +@@ -76,7 +82,12 @@ combination of ptrace and /proc calls. + #include + #define user_regs_struct pt_regs + #endif +-#if defined(aarch64) ++ ++#if defined(mips) || defined(mipsel) || defined(mips64) || defined(mips64el) ++#include ++#define user_regs_struct pt_regs ++#endif ++#if defined(aarch64) || defined(loongarch64) + #define user_regs_struct user_pt_regs + #endif + +diff --git a/hotspot/agent/src/os/linux/ps_proc.c b/hotspot/agent/src/os/linux/ps_proc.c +index c4d6a9ec..7000e927 100644 +--- a/hotspot/agent/src/os/linux/ps_proc.c ++++ b/hotspot/agent/src/os/linux/ps_proc.c @@ -22,6 +22,12 @@ * */ @@ -584,7 +1320,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #include #include #include -@@ -141,7 +147,7 @@ +@@ -141,7 +147,7 @@ static bool process_get_lwp_regs(struct ps_prochandle* ph, pid_t pid, struct use #define PTRACE_GETREGS_REQ PT_GETREGS #endif @@ -593,10 +1329,48 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp if (ptrace_getregs(PTRACE_GETREGS_REQ, pid, user, NULL) < 0) { print_debug("ptrace(PTRACE_GETREGS, ...) failed for lwp %d\n", pid); return false; -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/Disassembler.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/Disassembler.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/Disassembler.java 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/Disassembler.java 2023-12-20 09:23:19.691482431 +0800 -@@ -94,6 +94,12 @@ +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/HotSpotAgent.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/HotSpotAgent.java +index c9633505..20e6f35b 100644 +--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/HotSpotAgent.java ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/HotSpotAgent.java +@@ -22,6 +22,12 @@ + * + */ + ++/* ++ * This file has been modified by Loongson Technology in 2020. These ++ * modifications are Copyright (c) 2018, 2020, Loongson Technology, and are made ++ * available on the same license terms set forth above. ++ * ++ */ + package sun.jvm.hotspot; + + import java.rmi.RemoteException; +@@ -37,6 +43,8 @@ import sun.jvm.hotspot.debugger.MachineDescriptionIA64; + import sun.jvm.hotspot.debugger.MachineDescriptionIntelX86; + import sun.jvm.hotspot.debugger.MachineDescriptionSPARC32Bit; + import sun.jvm.hotspot.debugger.MachineDescriptionSPARC64Bit; ++import sun.jvm.hotspot.debugger.MachineDescriptionMIPS64; ++import sun.jvm.hotspot.debugger.MachineDescriptionLOONGARCH64; + import sun.jvm.hotspot.debugger.NoSuchSymbolException; + import sun.jvm.hotspot.debugger.bsd.BsdDebuggerLocal; + import sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal; +@@ -594,6 +602,10 @@ public class HotSpotAgent { + } else { + machDesc = new MachineDescriptionSPARC32Bit(); + } ++ } else if (cpu.equals("mips64")) { ++ machDesc = new MachineDescriptionMIPS64(); ++ } else if (cpu.equals("loongarch64")) { ++ machDesc = new MachineDescriptionLOONGARCH64(); + } else { + try { + machDesc = (MachineDescription) +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/Disassembler.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/Disassembler.java +index 993bf7bb..1e075aa5 100644 +--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/Disassembler.java ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/Disassembler.java +@@ -94,6 +94,12 @@ public class Disassembler { } else if (arch.equals("amd64") || arch.equals("x86_64")) { path.append(sep + "lib" + sep + "amd64" + sep); libname += "-amd64.so"; @@ -609,10 +1383,105 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp } else { path.append(sep + "lib" + sep + arch + sep); libname += "-" + arch + ".so"; -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxCDebugger.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxCDebugger.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxCDebugger.java 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxCDebugger.java 2023-12-20 09:23:19.704815613 +0800 -@@ -32,11 +32,15 @@ +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionLOONGARCH64.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionLOONGARCH64.java +new file mode 100644 +index 00000000..0531427d +--- /dev/null ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionLOONGARCH64.java +@@ -0,0 +1,41 @@ ++/* ++ * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2018, 2020, Loongson Technology. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ */ ++ ++package sun.jvm.hotspot.debugger; ++ ++public class MachineDescriptionLOONGARCH64 extends MachineDescriptionTwosComplement implements MachineDescription { ++ public long getAddressSize() { ++ return 8; ++ } ++ ++ ++ public boolean isBigEndian() { ++ return false; ++ } ++ ++ public boolean isLP64() { ++ return true; ++ } ++} +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionMIPS64.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionMIPS64.java +new file mode 100644 +index 00000000..1b49efd2 +--- /dev/null ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionMIPS64.java +@@ -0,0 +1,41 @@ ++/* ++ * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2018, Loongson Technology. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ */ ++ ++package sun.jvm.hotspot.debugger; ++ ++public class MachineDescriptionMIPS64 extends MachineDescriptionTwosComplement implements MachineDescription { ++ public long getAddressSize() { ++ return 8; ++ } ++ ++ ++ public boolean isBigEndian() { ++ return "big".equals(System.getProperty("sun.cpu.endian")); ++ } ++ ++ public boolean isLP64() { ++ return true; ++ } ++} +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxCDebugger.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxCDebugger.java +index f178d6a6..019e794b 100644 +--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxCDebugger.java ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxCDebugger.java +@@ -32,11 +32,15 @@ import sun.jvm.hotspot.debugger.cdbg.*; import sun.jvm.hotspot.debugger.x86.*; import sun.jvm.hotspot.debugger.amd64.*; import sun.jvm.hotspot.debugger.sparc.*; @@ -628,7 +1497,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp import sun.jvm.hotspot.utilities.*; class LinuxCDebugger implements CDebugger { -@@ -106,6 +110,20 @@ +@@ -106,6 +110,20 @@ class LinuxCDebugger implements CDebugger { Address pc = context.getRegisterAsAddress(AARCH64ThreadContext.PC); if (pc == null) return null; return new LinuxAARCH64CFrame(dbg, fp, pc); @@ -649,10 +1518,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp } else { // Runtime exception thrown by LinuxThreadContextFactory if unknown cpu ThreadContext context = (ThreadContext) thread.getContext(); -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxThreadContextFactory.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxThreadContextFactory.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxThreadContextFactory.java 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxThreadContextFactory.java 2023-12-20 09:23:19.704815613 +0800 -@@ -30,6 +30,8 @@ +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxThreadContextFactory.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxThreadContextFactory.java +index 44c2265d..3b6747ac 100644 +--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxThreadContextFactory.java ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxThreadContextFactory.java +@@ -30,6 +30,8 @@ import sun.jvm.hotspot.debugger.linux.amd64.*; import sun.jvm.hotspot.debugger.linux.ia64.*; import sun.jvm.hotspot.debugger.linux.x86.*; import sun.jvm.hotspot.debugger.linux.sparc.*; @@ -661,7 +1531,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp class LinuxThreadContextFactory { static ThreadContext createThreadContext(LinuxDebugger dbg) { -@@ -42,6 +44,10 @@ +@@ -42,6 +44,10 @@ class LinuxThreadContextFactory { return new LinuxIA64ThreadContext(dbg); } else if (cpu.equals("sparc")) { return new LinuxSPARCThreadContext(dbg); @@ -672,9 +1542,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp } else { try { Class tcc = Class.forName("sun.jvm.hotspot.debugger.linux." + -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/loongarch64/LinuxLOONGARCH64CFrame.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/loongarch64/LinuxLOONGARCH64CFrame.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/loongarch64/LinuxLOONGARCH64CFrame.java 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/loongarch64/LinuxLOONGARCH64CFrame.java 2023-12-20 09:23:19.704815613 +0800 +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/loongarch64/LinuxLOONGARCH64CFrame.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/loongarch64/LinuxLOONGARCH64CFrame.java +new file mode 100644 +index 00000000..3b20dbbd +--- /dev/null ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/loongarch64/LinuxLOONGARCH64CFrame.java @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. @@ -756,9 +1628,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + private Address fp; + private LinuxDebugger dbg; +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/loongarch64/LinuxLOONGARCH64ThreadContext.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/loongarch64/LinuxLOONGARCH64ThreadContext.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/loongarch64/LinuxLOONGARCH64ThreadContext.java 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/loongarch64/LinuxLOONGARCH64ThreadContext.java 2023-12-20 09:23:19.704815613 +0800 +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/loongarch64/LinuxLOONGARCH64ThreadContext.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/loongarch64/LinuxLOONGARCH64ThreadContext.java +new file mode 100644 +index 00000000..9f22133e +--- /dev/null ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/loongarch64/LinuxLOONGARCH64ThreadContext.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. @@ -807,9 +1681,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + return debugger.newAddress(getRegister(index)); + } +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/mips64/LinuxMIPS64CFrame.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/mips64/LinuxMIPS64CFrame.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/mips64/LinuxMIPS64CFrame.java 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/mips64/LinuxMIPS64CFrame.java 2023-12-20 09:23:19.704815613 +0800 +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/mips64/LinuxMIPS64CFrame.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/mips64/LinuxMIPS64CFrame.java +new file mode 100644 +index 00000000..2e3eb564 +--- /dev/null ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/mips64/LinuxMIPS64CFrame.java @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. @@ -891,9 +1767,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + private Address ebp; + private LinuxDebugger dbg; +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/mips64/LinuxMIPS64ThreadContext.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/mips64/LinuxMIPS64ThreadContext.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/mips64/LinuxMIPS64ThreadContext.java 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/mips64/LinuxMIPS64ThreadContext.java 2023-12-20 09:23:19.704815613 +0800 +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/mips64/LinuxMIPS64ThreadContext.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/mips64/LinuxMIPS64ThreadContext.java +new file mode 100644 +index 00000000..98e0f3f0 +--- /dev/null ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/mips64/LinuxMIPS64ThreadContext.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. @@ -942,9 +1820,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + return debugger.newAddress(getRegister(index)); + } +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/loongarch64/LOONGARCH64ThreadContext.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/loongarch64/LOONGARCH64ThreadContext.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/loongarch64/LOONGARCH64ThreadContext.java 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/loongarch64/LOONGARCH64ThreadContext.java 2023-12-20 09:23:19.704815613 +0800 +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/loongarch64/LOONGARCH64ThreadContext.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/loongarch64/LOONGARCH64ThreadContext.java +new file mode 100644 +index 00000000..90b0cf97 +--- /dev/null ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/loongarch64/LOONGARCH64ThreadContext.java @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. @@ -1069,99 +1949,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + tie the implementation to, for example, the debugging system */ + public abstract Address getRegisterAsAddress(int index); +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionLOONGARCH64.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionLOONGARCH64.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionLOONGARCH64.java 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionLOONGARCH64.java 2023-12-20 09:23:19.698149022 +0800 -@@ -0,0 +1,41 @@ -+/* -+ * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2018, 2020, Loongson Technology. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ * -+ */ -+ -+package sun.jvm.hotspot.debugger; -+ -+public class MachineDescriptionLOONGARCH64 extends MachineDescriptionTwosComplement implements MachineDescription { -+ public long getAddressSize() { -+ return 8; -+ } -+ -+ -+ public boolean isBigEndian() { -+ return false; -+ } -+ -+ public boolean isLP64() { -+ return true; -+ } -+} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionMIPS64.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionMIPS64.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionMIPS64.java 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionMIPS64.java 2023-12-20 09:23:19.698149022 +0800 -@@ -0,0 +1,41 @@ -+/* -+ * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2018, Loongson Technology. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ * -+ */ -+ -+package sun.jvm.hotspot.debugger; -+ -+public class MachineDescriptionMIPS64 extends MachineDescriptionTwosComplement implements MachineDescription { -+ public long getAddressSize() { -+ return 8; -+ } -+ -+ -+ public boolean isBigEndian() { -+ return "big".equals(System.getProperty("sun.cpu.endian")); -+ } -+ -+ public boolean isLP64() { -+ return true; -+ } -+} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/mips64/MIPS64ThreadContext.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/mips64/MIPS64ThreadContext.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/mips64/MIPS64ThreadContext.java 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/mips64/MIPS64ThreadContext.java 2023-12-20 09:23:19.704815613 +0800 +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/mips64/MIPS64ThreadContext.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/mips64/MIPS64ThreadContext.java +new file mode 100644 +index 00000000..c57ee9df +--- /dev/null ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/mips64/MIPS64ThreadContext.java @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. @@ -1286,10 +2078,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + tie the implementation to, for example, the debugging system */ + public abstract Address getRegisterAsAddress(int index); +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFHeader.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFHeader.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFHeader.java 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFHeader.java 2023-12-20 09:23:19.704815613 +0800 -@@ -63,6 +63,8 @@ +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFHeader.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFHeader.java +index 7113a3a4..24273888 100644 +--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFHeader.java ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFHeader.java +@@ -63,6 +63,8 @@ public interface ELFHeader { public static final int ARCH_i860 = 7; /** MIPS architecture type. */ public static final int ARCH_MIPS = 8; @@ -1298,9 +2091,143 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp /** Returns a file type which is defined by the file type constants. */ public short getFileType(); -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/loongarch64/ProcLOONGARCH64ThreadContext.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/loongarch64/ProcLOONGARCH64ThreadContext.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/loongarch64/ProcLOONGARCH64ThreadContext.java 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/loongarch64/ProcLOONGARCH64ThreadContext.java 2023-12-20 09:23:19.708148906 +0800 +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebuggerLocal.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebuggerLocal.java +index ca1a2575..2afa6c55 100644 +--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebuggerLocal.java ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebuggerLocal.java +@@ -34,10 +34,14 @@ import sun.jvm.hotspot.debugger.proc.amd64.*; + import sun.jvm.hotspot.debugger.proc.aarch64.*; + import sun.jvm.hotspot.debugger.proc.sparc.*; + import sun.jvm.hotspot.debugger.proc.x86.*; ++import sun.jvm.hotspot.debugger.proc.mips64.*; ++import sun.jvm.hotspot.debugger.proc.loongarch64.*; + import sun.jvm.hotspot.debugger.amd64.*; + import sun.jvm.hotspot.debugger.aarch64.*; + import sun.jvm.hotspot.debugger.sparc.*; + import sun.jvm.hotspot.debugger.x86.*; ++import sun.jvm.hotspot.debugger.mips64.*; ++import sun.jvm.hotspot.debugger.loongarch64.*; + import sun.jvm.hotspot.utilities.*; + + /**

An implementation of the JVMDebugger interface which sits on +@@ -92,6 +96,14 @@ public class ProcDebuggerLocal extends DebuggerBase implements ProcDebugger { + threadFactory = new ProcAARCH64ThreadFactory(this); + pcRegIndex = AARCH64ThreadContext.PC; + fpRegIndex = AARCH64ThreadContext.FP; ++ } else if (cpu.equals("mips64") || cpu.equals("mips64el")) { ++ threadFactory = new ProcMIPS64ThreadFactory(this); ++ pcRegIndex = MIPS64ThreadContext.PC; ++ fpRegIndex = MIPS64ThreadContext.FP; ++ } else if (cpu.equals("loongarch64")) { ++ threadFactory = new ProcLOONGARCH64ThreadFactory(this); ++ pcRegIndex = LOONGARCH64ThreadContext.PC; ++ fpRegIndex = LOONGARCH64ThreadContext.FP; + } else { + try { + Class tfc = Class.forName("sun.jvm.hotspot.debugger.proc." + +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/loongarch64/ProcLOONGARCH64Thread.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/loongarch64/ProcLOONGARCH64Thread.java +new file mode 100644 +index 00000000..42a31e34 +--- /dev/null ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/loongarch64/ProcLOONGARCH64Thread.java +@@ -0,0 +1,92 @@ ++/* ++ * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2015, 2020, Loongson Technology. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ */ ++ ++package sun.jvm.hotspot.debugger.proc.loongarch64; ++ ++import sun.jvm.hotspot.debugger.*; ++import sun.jvm.hotspot.debugger.loongarch64.*; ++import sun.jvm.hotspot.debugger.proc.*; ++import sun.jvm.hotspot.utilities.*; ++ ++public class ProcLOONGARCH64Thread implements ThreadProxy { ++ private ProcDebugger debugger; ++ private int id; ++ ++ public ProcLOONGARCH64Thread(ProcDebugger debugger, Address addr) { ++ this.debugger = debugger; ++ ++ // FIXME: the size here should be configurable. However, making it ++ // so would produce a dependency on the "types" package from the ++ // debugger package, which is not desired. ++ this.id = (int) addr.getCIntegerAt(0, 4, true); ++ } ++ ++ public ProcLOONGARCH64Thread(ProcDebugger debugger, long id) { ++ this.debugger = debugger; ++ this.id = (int) id; ++ } ++ ++ public ThreadContext getContext() throws IllegalThreadStateException { ++ ProcLOONGARCH64ThreadContext context = new ProcLOONGARCH64ThreadContext(debugger); ++ long[] regs = debugger.getThreadIntegerRegisterSet(id); ++ /* ++ _NGREG in reg.h is defined to be 19. Because we have included ++ debug registers LOONGARCH64ThreadContext.NPRGREG is 25. ++ */ ++ ++ if (Assert.ASSERTS_ENABLED) { ++ Assert.that(regs.length <= LOONGARCH64ThreadContext.NPRGREG, "size of register set is greater than " + LOONGARCH64ThreadContext.NPRGREG); ++ } ++ for (int i = 0; i < regs.length; i++) { ++ context.setRegister(i, regs[i]); ++ } ++ return context; ++ } ++ ++ public boolean canSetContext() throws DebuggerException { ++ return false; ++ } ++ ++ public void setContext(ThreadContext context) ++ throws IllegalThreadStateException, DebuggerException { ++ throw new DebuggerException("Unimplemented"); ++ } ++ ++ public String toString() { ++ return "t@" + id; ++ } ++ ++ public boolean equals(Object obj) { ++ if ((obj == null) || !(obj instanceof ProcLOONGARCH64Thread)) { ++ return false; ++ } ++ ++ return (((ProcLOONGARCH64Thread) obj).id == id); ++ } ++ ++ public int hashCode() { ++ return id; ++ } ++} +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/loongarch64/ProcLOONGARCH64ThreadContext.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/loongarch64/ProcLOONGARCH64ThreadContext.java +new file mode 100644 +index 00000000..9054f165 +--- /dev/null ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/loongarch64/ProcLOONGARCH64ThreadContext.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. @@ -1349,9 +2276,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + return debugger.newAddress(getRegister(index)); + } +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/loongarch64/ProcLOONGARCH64ThreadFactory.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/loongarch64/ProcLOONGARCH64ThreadFactory.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/loongarch64/ProcLOONGARCH64ThreadFactory.java 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/loongarch64/ProcLOONGARCH64ThreadFactory.java 2023-12-20 09:23:19.708148906 +0800 +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/loongarch64/ProcLOONGARCH64ThreadFactory.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/loongarch64/ProcLOONGARCH64ThreadFactory.java +new file mode 100644 +index 00000000..bc643351 +--- /dev/null ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/loongarch64/ProcLOONGARCH64ThreadFactory.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. @@ -1398,13 +2327,15 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + return new ProcLOONGARCH64Thread(debugger, id); + } +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/loongarch64/ProcLOONGARCH64Thread.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/loongarch64/ProcLOONGARCH64Thread.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/loongarch64/ProcLOONGARCH64Thread.java 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/loongarch64/ProcLOONGARCH64Thread.java 2023-12-20 09:23:19.708148906 +0800 +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/mips64/ProcMIPS64Thread.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/mips64/ProcMIPS64Thread.java +new file mode 100644 +index 00000000..5c1e0be8 +--- /dev/null ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/mips64/ProcMIPS64Thread.java @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2020, Loongson Technology. All rights reserved. ++ * Copyright (c) 2015, 2018, Loongson Technology. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it @@ -1427,18 +2358,18 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + * + */ + -+package sun.jvm.hotspot.debugger.proc.loongarch64; ++package sun.jvm.hotspot.debugger.proc.mips64; + +import sun.jvm.hotspot.debugger.*; -+import sun.jvm.hotspot.debugger.loongarch64.*; ++import sun.jvm.hotspot.debugger.mips64.*; +import sun.jvm.hotspot.debugger.proc.*; +import sun.jvm.hotspot.utilities.*; + -+public class ProcLOONGARCH64Thread implements ThreadProxy { ++public class ProcMIPS64Thread implements ThreadProxy { + private ProcDebugger debugger; + private int id; + -+ public ProcLOONGARCH64Thread(ProcDebugger debugger, Address addr) { ++ public ProcMIPS64Thread(ProcDebugger debugger, Address addr) { + this.debugger = debugger; + + // FIXME: the size here should be configurable. However, making it @@ -1447,21 +2378,21 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + this.id = (int) addr.getCIntegerAt(0, 4, true); + } + -+ public ProcLOONGARCH64Thread(ProcDebugger debugger, long id) { ++ public ProcMIPS64Thread(ProcDebugger debugger, long id) { + this.debugger = debugger; + this.id = (int) id; + } + + public ThreadContext getContext() throws IllegalThreadStateException { -+ ProcLOONGARCH64ThreadContext context = new ProcLOONGARCH64ThreadContext(debugger); ++ ProcMIPS64ThreadContext context = new ProcMIPS64ThreadContext(debugger); + long[] regs = debugger.getThreadIntegerRegisterSet(id); + /* + _NGREG in reg.h is defined to be 19. Because we have included -+ debug registers LOONGARCH64ThreadContext.NPRGREG is 25. ++ debug registers MIPS64ThreadContext.NPRGREG is 25. + */ + + if (Assert.ASSERTS_ENABLED) { -+ Assert.that(regs.length <= LOONGARCH64ThreadContext.NPRGREG, "size of register set is greater than " + LOONGARCH64ThreadContext.NPRGREG); ++ Assert.that(regs.length <= MIPS64ThreadContext.NPRGREG, "size of register set is greater than " + MIPS64ThreadContext.NPRGREG); + } + for (int i = 0; i < regs.length; i++) { + context.setRegister(i, regs[i]); @@ -1483,20 +2414,22 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + } + + public boolean equals(Object obj) { -+ if ((obj == null) || !(obj instanceof ProcLOONGARCH64Thread)) { ++ if ((obj == null) || !(obj instanceof ProcMIPS64Thread)) { + return false; + } + -+ return (((ProcLOONGARCH64Thread) obj).id == id); ++ return (((ProcMIPS64Thread) obj).id == id); + } + + public int hashCode() { + return id; + } +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/mips64/ProcMIPS64ThreadContext.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/mips64/ProcMIPS64ThreadContext.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/mips64/ProcMIPS64ThreadContext.java 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/mips64/ProcMIPS64ThreadContext.java 2023-12-20 09:23:19.708148906 +0800 +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/mips64/ProcMIPS64ThreadContext.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/mips64/ProcMIPS64ThreadContext.java +new file mode 100644 +index 00000000..d44223d7 +--- /dev/null ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/mips64/ProcMIPS64ThreadContext.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. @@ -1545,9 +2478,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + return debugger.newAddress(getRegister(index)); + } +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/mips64/ProcMIPS64ThreadFactory.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/mips64/ProcMIPS64ThreadFactory.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/mips64/ProcMIPS64ThreadFactory.java 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/mips64/ProcMIPS64ThreadFactory.java 2023-12-20 09:23:19.708148906 +0800 +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/mips64/ProcMIPS64ThreadFactory.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/mips64/ProcMIPS64ThreadFactory.java +new file mode 100644 +index 00000000..bad478fc +--- /dev/null ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/mips64/ProcMIPS64ThreadFactory.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. @@ -1594,13 +2529,45 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + return new ProcMIPS64Thread(debugger, id); + } +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/mips64/ProcMIPS64Thread.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/mips64/ProcMIPS64Thread.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/mips64/ProcMIPS64Thread.java 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/mips64/ProcMIPS64Thread.java 2023-12-20 09:23:19.708148906 +0800 -@@ -0,0 +1,92 @@ +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java +index ffa61b54..9cf3ee2d 100644 +--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java +@@ -33,6 +33,8 @@ import sun.jvm.hotspot.debugger.cdbg.*; + import sun.jvm.hotspot.debugger.remote.sparc.*; + import sun.jvm.hotspot.debugger.remote.x86.*; + import sun.jvm.hotspot.debugger.remote.amd64.*; ++import sun.jvm.hotspot.debugger.remote.mips64.*; ++import sun.jvm.hotspot.debugger.remote.loongarch64.*; + + /** An implementation of Debugger which wraps a + RemoteDebugger, providing remote debugging via RMI. +@@ -70,6 +72,16 @@ public class RemoteDebuggerClient extends DebuggerBase implements JVMDebugger { + cachePageSize = 4096; + cacheNumPages = parseCacheNumPagesProperty(cacheSize / cachePageSize); + unalignedAccessesOkay = true; ++ } else if (cpu.equals("mips64") || cpu.equals("mips64el")) { ++ threadFactory = new RemoteMIPS64ThreadFactory(this); ++ cachePageSize = 4096; ++ cacheNumPages = parseCacheNumPagesProperty(cacheSize / cachePageSize); ++ unalignedAccessesOkay = true; ++ } else if (cpu.equals("loongarch64")) { ++ threadFactory = new RemoteLOONGARCH64ThreadFactory(this); ++ cachePageSize = 4096; ++ cacheNumPages = parseCacheNumPagesProperty(cacheSize / cachePageSize); ++ unalignedAccessesOkay = true; + } else { + try { + Class tf = Class.forName("sun.jvm.hotspot.debugger.remote." + +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/loongarch64/RemoteLOONGARCH64Thread.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/loongarch64/RemoteLOONGARCH64Thread.java +new file mode 100644 +index 00000000..01e3f895 +--- /dev/null ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/loongarch64/RemoteLOONGARCH64Thread.java +@@ -0,0 +1,54 @@ +/* -+ * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2018, Loongson Technology. All rights reserved. ++ * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2015, 2020, Loongson Technology. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it @@ -1623,109 +2590,40 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + * + */ + -+package sun.jvm.hotspot.debugger.proc.mips64; ++package sun.jvm.hotspot.debugger.remote.loongarch64; + +import sun.jvm.hotspot.debugger.*; -+import sun.jvm.hotspot.debugger.mips64.*; -+import sun.jvm.hotspot.debugger.proc.*; ++import sun.jvm.hotspot.debugger.loongarch64.*; ++import sun.jvm.hotspot.debugger.remote.*; +import sun.jvm.hotspot.utilities.*; + -+public class ProcMIPS64Thread implements ThreadProxy { -+ private ProcDebugger debugger; -+ private int id; -+ -+ public ProcMIPS64Thread(ProcDebugger debugger, Address addr) { -+ this.debugger = debugger; -+ -+ // FIXME: the size here should be configurable. However, making it -+ // so would produce a dependency on the "types" package from the -+ // debugger package, which is not desired. -+ this.id = (int) addr.getCIntegerAt(0, 4, true); ++public class RemoteLOONGARCH64Thread extends RemoteThread { ++ public RemoteLOONGARCH64Thread(RemoteDebuggerClient debugger, Address addr) { ++ super(debugger, addr); + } + -+ public ProcMIPS64Thread(ProcDebugger debugger, long id) { -+ this.debugger = debugger; -+ this.id = (int) id; ++ public RemoteLOONGARCH64Thread(RemoteDebuggerClient debugger, long id) { ++ super(debugger, id); + } + + public ThreadContext getContext() throws IllegalThreadStateException { -+ ProcMIPS64ThreadContext context = new ProcMIPS64ThreadContext(debugger); -+ long[] regs = debugger.getThreadIntegerRegisterSet(id); -+ /* -+ _NGREG in reg.h is defined to be 19. Because we have included -+ debug registers MIPS64ThreadContext.NPRGREG is 25. -+ */ -+ ++ RemoteLOONGARCH64ThreadContext context = new RemoteLOONGARCH64ThreadContext(debugger); ++ long[] regs = (addr != null)? debugger.getThreadIntegerRegisterSet(addr) : ++ debugger.getThreadIntegerRegisterSet(id); + if (Assert.ASSERTS_ENABLED) { -+ Assert.that(regs.length <= MIPS64ThreadContext.NPRGREG, "size of register set is greater than " + MIPS64ThreadContext.NPRGREG); ++ Assert.that(regs.length == LOONGARCH64ThreadContext.NPRGREG, "size of register set must match"); + } + for (int i = 0; i < regs.length; i++) { + context.setRegister(i, regs[i]); + } + return context; + } -+ -+ public boolean canSetContext() throws DebuggerException { -+ return false; -+ } -+ -+ public void setContext(ThreadContext context) -+ throws IllegalThreadStateException, DebuggerException { -+ throw new DebuggerException("Unimplemented"); -+ } -+ -+ public String toString() { -+ return "t@" + id; -+ } -+ -+ public boolean equals(Object obj) { -+ if ((obj == null) || !(obj instanceof ProcMIPS64Thread)) { -+ return false; -+ } -+ -+ return (((ProcMIPS64Thread) obj).id == id); -+ } -+ -+ public int hashCode() { -+ return id; -+ } +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebuggerLocal.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebuggerLocal.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebuggerLocal.java 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebuggerLocal.java 2023-12-20 09:23:19.708148906 +0800 -@@ -34,10 +34,14 @@ - import sun.jvm.hotspot.debugger.proc.aarch64.*; - import sun.jvm.hotspot.debugger.proc.sparc.*; - import sun.jvm.hotspot.debugger.proc.x86.*; -+import sun.jvm.hotspot.debugger.proc.mips64.*; -+import sun.jvm.hotspot.debugger.proc.loongarch64.*; - import sun.jvm.hotspot.debugger.amd64.*; - import sun.jvm.hotspot.debugger.aarch64.*; - import sun.jvm.hotspot.debugger.sparc.*; - import sun.jvm.hotspot.debugger.x86.*; -+import sun.jvm.hotspot.debugger.mips64.*; -+import sun.jvm.hotspot.debugger.loongarch64.*; - import sun.jvm.hotspot.utilities.*; - - /**

An implementation of the JVMDebugger interface which sits on -@@ -92,6 +96,14 @@ - threadFactory = new ProcAARCH64ThreadFactory(this); - pcRegIndex = AARCH64ThreadContext.PC; - fpRegIndex = AARCH64ThreadContext.FP; -+ } else if (cpu.equals("mips64") || cpu.equals("mips64el")) { -+ threadFactory = new ProcMIPS64ThreadFactory(this); -+ pcRegIndex = MIPS64ThreadContext.PC; -+ fpRegIndex = MIPS64ThreadContext.FP; -+ } else if (cpu.equals("loongarch64")) { -+ threadFactory = new ProcLOONGARCH64ThreadFactory(this); -+ pcRegIndex = LOONGARCH64ThreadContext.PC; -+ fpRegIndex = LOONGARCH64ThreadContext.FP; - } else { - try { - Class tfc = Class.forName("sun.jvm.hotspot.debugger.proc." + -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/loongarch64/RemoteLOONGARCH64ThreadContext.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/loongarch64/RemoteLOONGARCH64ThreadContext.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/loongarch64/RemoteLOONGARCH64ThreadContext.java 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/loongarch64/RemoteLOONGARCH64ThreadContext.java 2023-12-20 09:23:19.708148906 +0800 +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/loongarch64/RemoteLOONGARCH64ThreadContext.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/loongarch64/RemoteLOONGARCH64ThreadContext.java +new file mode 100644 +index 00000000..ad25bccc +--- /dev/null ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/loongarch64/RemoteLOONGARCH64ThreadContext.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. @@ -1778,9 +2676,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + return debugger.newAddress(getRegister(index)); + } +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/loongarch64/RemoteLOONGARCH64ThreadFactory.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/loongarch64/RemoteLOONGARCH64ThreadFactory.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/loongarch64/RemoteLOONGARCH64ThreadFactory.java 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/loongarch64/RemoteLOONGARCH64ThreadFactory.java 2023-12-20 09:23:19.708148906 +0800 +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/loongarch64/RemoteLOONGARCH64ThreadFactory.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/loongarch64/RemoteLOONGARCH64ThreadFactory.java +new file mode 100644 +index 00000000..d8bf50ea +--- /dev/null ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/loongarch64/RemoteLOONGARCH64ThreadFactory.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. @@ -1827,13 +2727,15 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + return new RemoteLOONGARCH64Thread(debugger, id); + } +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/loongarch64/RemoteLOONGARCH64Thread.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/loongarch64/RemoteLOONGARCH64Thread.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/loongarch64/RemoteLOONGARCH64Thread.java 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/loongarch64/RemoteLOONGARCH64Thread.java 2023-12-20 09:23:19.708148906 +0800 +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/mips64/RemoteMIPS64Thread.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/mips64/RemoteMIPS64Thread.java +new file mode 100644 +index 00000000..a9285a3b +--- /dev/null ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/mips64/RemoteMIPS64Thread.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2020, Loongson Technology. All rights reserved. ++ * Copyright (c) 2015, 2018, Loongson Technology. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it @@ -1856,28 +2758,28 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + * + */ + -+package sun.jvm.hotspot.debugger.remote.loongarch64; ++package sun.jvm.hotspot.debugger.remote.mips64; + +import sun.jvm.hotspot.debugger.*; -+import sun.jvm.hotspot.debugger.loongarch64.*; ++import sun.jvm.hotspot.debugger.mips64.*; +import sun.jvm.hotspot.debugger.remote.*; +import sun.jvm.hotspot.utilities.*; + -+public class RemoteLOONGARCH64Thread extends RemoteThread { -+ public RemoteLOONGARCH64Thread(RemoteDebuggerClient debugger, Address addr) { ++public class RemoteMIPS64Thread extends RemoteThread { ++ public RemoteMIPS64Thread(RemoteDebuggerClient debugger, Address addr) { + super(debugger, addr); + } + -+ public RemoteLOONGARCH64Thread(RemoteDebuggerClient debugger, long id) { ++ public RemoteMIPS64Thread(RemoteDebuggerClient debugger, long id) { + super(debugger, id); + } + + public ThreadContext getContext() throws IllegalThreadStateException { -+ RemoteLOONGARCH64ThreadContext context = new RemoteLOONGARCH64ThreadContext(debugger); ++ RemoteMIPS64ThreadContext context = new RemoteMIPS64ThreadContext(debugger); + long[] regs = (addr != null)? debugger.getThreadIntegerRegisterSet(addr) : + debugger.getThreadIntegerRegisterSet(id); + if (Assert.ASSERTS_ENABLED) { -+ Assert.that(regs.length == LOONGARCH64ThreadContext.NPRGREG, "size of register set must match"); ++ Assert.that(regs.length == MIPS64ThreadContext.NPRGREG, "size of register set must match"); + } + for (int i = 0; i < regs.length; i++) { + context.setRegister(i, regs[i]); @@ -1885,9 +2787,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + return context; + } +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/mips64/RemoteMIPS64ThreadContext.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/mips64/RemoteMIPS64ThreadContext.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/mips64/RemoteMIPS64ThreadContext.java 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/mips64/RemoteMIPS64ThreadContext.java 2023-12-20 09:23:19.708148906 +0800 +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/mips64/RemoteMIPS64ThreadContext.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/mips64/RemoteMIPS64ThreadContext.java +new file mode 100644 +index 00000000..4d711f9b +--- /dev/null ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/mips64/RemoteMIPS64ThreadContext.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. @@ -1940,9 +2844,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + return debugger.newAddress(getRegister(index)); + } +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/mips64/RemoteMIPS64ThreadFactory.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/mips64/RemoteMIPS64ThreadFactory.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/mips64/RemoteMIPS64ThreadFactory.java 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/mips64/RemoteMIPS64ThreadFactory.java 2023-12-20 09:23:19.708148906 +0800 +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/mips64/RemoteMIPS64ThreadFactory.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/mips64/RemoteMIPS64ThreadFactory.java +new file mode 100644 +index 00000000..020a2f1f +--- /dev/null ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/mips64/RemoteMIPS64ThreadFactory.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. @@ -1989,132 +2895,35 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + return new RemoteMIPS64Thread(debugger, id); + } +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/mips64/RemoteMIPS64Thread.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/mips64/RemoteMIPS64Thread.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/mips64/RemoteMIPS64Thread.java 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/mips64/RemoteMIPS64Thread.java 2023-12-20 09:23:19.708148906 +0800 -@@ -0,0 +1,54 @@ -+/* -+ * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2018, Loongson Technology. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ * -+ */ -+ -+package sun.jvm.hotspot.debugger.remote.mips64; -+ -+import sun.jvm.hotspot.debugger.*; -+import sun.jvm.hotspot.debugger.mips64.*; -+import sun.jvm.hotspot.debugger.remote.*; -+import sun.jvm.hotspot.utilities.*; -+ -+public class RemoteMIPS64Thread extends RemoteThread { -+ public RemoteMIPS64Thread(RemoteDebuggerClient debugger, Address addr) { -+ super(debugger, addr); -+ } -+ -+ public RemoteMIPS64Thread(RemoteDebuggerClient debugger, long id) { -+ super(debugger, id); -+ } -+ -+ public ThreadContext getContext() throws IllegalThreadStateException { -+ RemoteMIPS64ThreadContext context = new RemoteMIPS64ThreadContext(debugger); -+ long[] regs = (addr != null)? debugger.getThreadIntegerRegisterSet(addr) : -+ debugger.getThreadIntegerRegisterSet(id); -+ if (Assert.ASSERTS_ENABLED) { -+ Assert.that(regs.length == MIPS64ThreadContext.NPRGREG, "size of register set must match"); -+ } -+ for (int i = 0; i < regs.length; i++) { -+ context.setRegister(i, regs[i]); -+ } -+ return context; -+ } -+} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java 2023-12-20 09:23:19.708148906 +0800 -@@ -33,6 +33,8 @@ - import sun.jvm.hotspot.debugger.remote.sparc.*; - import sun.jvm.hotspot.debugger.remote.x86.*; - import sun.jvm.hotspot.debugger.remote.amd64.*; -+import sun.jvm.hotspot.debugger.remote.mips64.*; -+import sun.jvm.hotspot.debugger.remote.loongarch64.*; - - /** An implementation of Debugger which wraps a - RemoteDebugger, providing remote debugging via RMI. -@@ -70,6 +72,16 @@ - cachePageSize = 4096; - cacheNumPages = parseCacheNumPagesProperty(cacheSize / cachePageSize); - unalignedAccessesOkay = true; -+ } else if (cpu.equals("mips64") || cpu.equals("mips64el")) { -+ threadFactory = new RemoteMIPS64ThreadFactory(this); -+ cachePageSize = 4096; -+ cacheNumPages = parseCacheNumPagesProperty(cacheSize / cachePageSize); -+ unalignedAccessesOkay = true; -+ } else if (cpu.equals("loongarch64")) { -+ threadFactory = new RemoteLOONGARCH64ThreadFactory(this); -+ cachePageSize = 4096; -+ cacheNumPages = parseCacheNumPagesProperty(cacheSize / cachePageSize); -+ unalignedAccessesOkay = true; - } else { - try { - Class tf = Class.forName("sun.jvm.hotspot.debugger.remote." + -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/HotSpotAgent.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/HotSpotAgent.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/HotSpotAgent.java 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/HotSpotAgent.java 2023-12-20 09:23:19.691482431 +0800 -@@ -22,6 +22,12 @@ - * - */ - -+/* -+ * This file has been modified by Loongson Technology in 2020. These -+ * modifications are Copyright (c) 2018, 2020, Loongson Technology, and are made -+ * available on the same license terms set forth above. -+ * -+ */ - package sun.jvm.hotspot; - - import java.rmi.RemoteException; -@@ -37,6 +43,8 @@ - import sun.jvm.hotspot.debugger.MachineDescriptionIntelX86; - import sun.jvm.hotspot.debugger.MachineDescriptionSPARC32Bit; - import sun.jvm.hotspot.debugger.MachineDescriptionSPARC64Bit; -+import sun.jvm.hotspot.debugger.MachineDescriptionMIPS64; -+import sun.jvm.hotspot.debugger.MachineDescriptionLOONGARCH64; - import sun.jvm.hotspot.debugger.NoSuchSymbolException; - import sun.jvm.hotspot.debugger.bsd.BsdDebuggerLocal; - import sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal; -@@ -594,6 +602,10 @@ +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Threads.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Threads.java +index 842a3b35..81efdd02 100644 +--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Threads.java ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Threads.java +@@ -34,6 +34,8 @@ import sun.jvm.hotspot.runtime.win32_amd64.Win32AMD64JavaThreadPDAccess; + import sun.jvm.hotspot.runtime.win32_x86.Win32X86JavaThreadPDAccess; + import sun.jvm.hotspot.runtime.linux_x86.LinuxX86JavaThreadPDAccess; + import sun.jvm.hotspot.runtime.linux_amd64.LinuxAMD64JavaThreadPDAccess; ++import sun.jvm.hotspot.runtime.linux_mips64.LinuxMIPS64JavaThreadPDAccess; ++import sun.jvm.hotspot.runtime.linux_loongarch64.LinuxLOONGARCH64JavaThreadPDAccess; + import sun.jvm.hotspot.runtime.linux_sparc.LinuxSPARCJavaThreadPDAccess; + import sun.jvm.hotspot.runtime.linux_aarch64.LinuxAARCH64JavaThreadPDAccess; + import sun.jvm.hotspot.runtime.bsd_x86.BsdX86JavaThreadPDAccess; +@@ -90,6 +92,10 @@ public class Threads { + access = new LinuxSPARCJavaThreadPDAccess(); + } else if (cpu.equals("aarch64")) { + access = new LinuxAARCH64JavaThreadPDAccess(); ++ } else if (cpu.equals("mips64")) { ++ access = new LinuxMIPS64JavaThreadPDAccess(); ++ } else if (cpu.equals("loongarch64")) { ++ access = new LinuxLOONGARCH64JavaThreadPDAccess(); } else { - machDesc = new MachineDescriptionSPARC32Bit(); - } -+ } else if (cpu.equals("mips64")) { -+ machDesc = new MachineDescriptionMIPS64(); -+ } else if (cpu.equals("loongarch64")) { -+ machDesc = new MachineDescriptionLOONGARCH64(); - } else { - try { - machDesc = (MachineDescription) -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_loongarch64/LinuxLOONGARCH64JavaThreadPDAccess.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_loongarch64/LinuxLOONGARCH64JavaThreadPDAccess.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_loongarch64/LinuxLOONGARCH64JavaThreadPDAccess.java 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_loongarch64/LinuxLOONGARCH64JavaThreadPDAccess.java 2023-12-20 09:23:19.738148563 +0800 + try { + access = (JavaThreadPDAccess) +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_loongarch64/LinuxLOONGARCH64JavaThreadPDAccess.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_loongarch64/LinuxLOONGARCH64JavaThreadPDAccess.java +new file mode 100644 +index 00000000..77c45c2e +--- /dev/null ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_loongarch64/LinuxLOONGARCH64JavaThreadPDAccess.java @@ -0,0 +1,133 @@ +/* + * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. @@ -2249,9 +3058,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + return debugger.getThreadForIdentifierAddress(threadIdAddr); + } +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_mips64/LinuxMIPS64JavaThreadPDAccess.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_mips64/LinuxMIPS64JavaThreadPDAccess.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_mips64/LinuxMIPS64JavaThreadPDAccess.java 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_mips64/LinuxMIPS64JavaThreadPDAccess.java 2023-12-20 09:23:19.738148563 +0800 +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_mips64/LinuxMIPS64JavaThreadPDAccess.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_mips64/LinuxMIPS64JavaThreadPDAccess.java +new file mode 100644 +index 00000000..a0fd73fa +--- /dev/null ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_mips64/LinuxMIPS64JavaThreadPDAccess.java @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. @@ -2385,9 +3196,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + return debugger.getThreadForIdentifierAddress(threadIdAddr); + } +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64CurrentFrameGuess.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64CurrentFrameGuess.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64CurrentFrameGuess.java 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64CurrentFrameGuess.java 2023-12-20 09:23:19.738148563 +0800 +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64CurrentFrameGuess.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64CurrentFrameGuess.java +new file mode 100644 +index 00000000..0208e6e2 +--- /dev/null ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64CurrentFrameGuess.java @@ -0,0 +1,217 @@ +/* + * Copyright (c) 2001, 2006, Oracle and/or its affiliates. All rights reserved. @@ -2606,9 +3419,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + pcFound = pc; + } +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64Frame.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64Frame.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64Frame.java 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64Frame.java 2023-12-20 09:23:19.738148563 +0800 +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64Frame.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64Frame.java +new file mode 100644 +index 00000000..fdf0c79c +--- /dev/null ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64Frame.java @@ -0,0 +1,534 @@ +/* + * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. @@ -3144,9 +3959,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + } + } +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64JavaCallWrapper.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64JavaCallWrapper.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64JavaCallWrapper.java 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64JavaCallWrapper.java 2023-12-20 09:23:19.738148563 +0800 +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64JavaCallWrapper.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64JavaCallWrapper.java +new file mode 100644 +index 00000000..f7dbbcaa +--- /dev/null ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64JavaCallWrapper.java @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved. @@ -3205,9 +4022,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + return lastJavaFPField.getValue(addr.addOffsetTo(anchorField.getOffset())); + } +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64RegisterMap.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64RegisterMap.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64RegisterMap.java 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64RegisterMap.java 2023-12-20 09:23:19.738148563 +0800 +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64RegisterMap.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64RegisterMap.java +new file mode 100644 +index 00000000..021ef523 +--- /dev/null ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64RegisterMap.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. @@ -3261,9 +4080,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + protected void initializeFromPD(RegisterMap map) {} + protected Address getLocationPD(VMReg reg) { return null; } +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64CurrentFrameGuess.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64CurrentFrameGuess.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64CurrentFrameGuess.java 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64CurrentFrameGuess.java 2023-12-20 09:23:19.738148563 +0800 +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64CurrentFrameGuess.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64CurrentFrameGuess.java +new file mode 100644 +index 00000000..21259a4d +--- /dev/null ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64CurrentFrameGuess.java @@ -0,0 +1,217 @@ +/* + * Copyright (c) 2001, 2006, Oracle and/or its affiliates. All rights reserved. @@ -3482,9 +4303,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + pcFound = pc; + } +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64Frame.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64Frame.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64Frame.java 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64Frame.java 2023-12-20 09:23:19.738148563 +0800 +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64Frame.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64Frame.java +new file mode 100644 +index 00000000..0cc5cf4e +--- /dev/null ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64Frame.java @@ -0,0 +1,547 @@ +/* + * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. @@ -4033,9 +4856,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + } + } +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64JavaCallWrapper.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64JavaCallWrapper.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64JavaCallWrapper.java 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64JavaCallWrapper.java 2023-12-20 09:23:19.738148563 +0800 +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64JavaCallWrapper.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64JavaCallWrapper.java +new file mode 100644 +index 00000000..81fcb5b5 +--- /dev/null ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64JavaCallWrapper.java @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved. @@ -4094,9 +4919,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + return lastJavaFPField.getValue(addr.addOffsetTo(anchorField.getOffset())); + } +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64RegisterMap.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64RegisterMap.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64RegisterMap.java 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64RegisterMap.java 2023-12-20 09:23:19.738148563 +0800 +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64RegisterMap.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64RegisterMap.java +new file mode 100644 +index 00000000..64850379 +--- /dev/null ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64RegisterMap.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. @@ -4150,32 +4977,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + protected void initializeFromPD(RegisterMap map) {} + protected Address getLocationPD(VMReg reg) { return null; } +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Threads.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Threads.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Threads.java 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Threads.java 2023-12-20 09:23:19.734815268 +0800 -@@ -34,6 +34,8 @@ - import sun.jvm.hotspot.runtime.win32_x86.Win32X86JavaThreadPDAccess; - import sun.jvm.hotspot.runtime.linux_x86.LinuxX86JavaThreadPDAccess; - import sun.jvm.hotspot.runtime.linux_amd64.LinuxAMD64JavaThreadPDAccess; -+import sun.jvm.hotspot.runtime.linux_mips64.LinuxMIPS64JavaThreadPDAccess; -+import sun.jvm.hotspot.runtime.linux_loongarch64.LinuxLOONGARCH64JavaThreadPDAccess; - import sun.jvm.hotspot.runtime.linux_sparc.LinuxSPARCJavaThreadPDAccess; - import sun.jvm.hotspot.runtime.linux_aarch64.LinuxAARCH64JavaThreadPDAccess; - import sun.jvm.hotspot.runtime.bsd_x86.BsdX86JavaThreadPDAccess; -@@ -90,6 +92,10 @@ - access = new LinuxSPARCJavaThreadPDAccess(); - } else if (cpu.equals("aarch64")) { - access = new LinuxAARCH64JavaThreadPDAccess(); -+ } else if (cpu.equals("mips64")) { -+ access = new LinuxMIPS64JavaThreadPDAccess(); -+ } else if (cpu.equals("loongarch64")) { -+ access = new LinuxLOONGARCH64JavaThreadPDAccess(); - } else { - try { - access = (JavaThreadPDAccess) -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/PlatformInfo.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/PlatformInfo.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/PlatformInfo.java 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/PlatformInfo.java 2023-12-20 09:23:19.748148449 +0800 +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/PlatformInfo.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/PlatformInfo.java +index aa692578..9c97d09b 100644 +--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/PlatformInfo.java ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/PlatformInfo.java @@ -22,6 +22,13 @@ * */ @@ -4190,7 +4995,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp package sun.jvm.hotspot.utilities; /** Provides canonicalized OS and CPU information for the rest of the -@@ -65,6 +72,10 @@ +@@ -65,6 +72,10 @@ public class PlatformInfo { return cpu; } else if (cpu.equals("aarch64")) { return cpu; @@ -4201,9 +5006,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp } else { try { Class pic = Class.forName("sun.jvm.hotspot.utilities.PlatformInfoClosed"); -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/make/defs.make b/hotspot/make/defs.make ---- a/hotspot/make/defs.make 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/make/defs.make 2023-12-20 09:23:19.761481629 +0800 +diff --git a/hotspot/make/defs.make b/hotspot/make/defs.make +index a3573da5..6e93182c 100644 +--- a/hotspot/make/defs.make ++++ b/hotspot/make/defs.make @@ -22,6 +22,12 @@ # # @@ -4217,7 +5023,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp # The common definitions for hotspot builds. # Optionally include SPEC file generated by configure. -@@ -285,7 +291,7 @@ +@@ -285,7 +291,7 @@ ifneq ($(OSNAME),windows) # Use uname output for SRCARCH, but deal with platform differences. If ARCH # is not explicitly listed below, it is treated as x86. @@ -4226,7 +5032,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp ARCH/ = x86 ARCH/sparc = sparc ARCH/sparc64= sparc -@@ -295,6 +301,10 @@ +@@ -295,6 +301,10 @@ ifneq ($(OSNAME),windows) ARCH/ppc64 = ppc ARCH/ppc64le= ppc ARCH/ppc = ppc @@ -4237,7 +5043,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp ARCH/zero = zero ARCH/aarch64 = aarch64 -@@ -317,6 +327,20 @@ +@@ -317,6 +327,20 @@ ifneq ($(OSNAME),windows) BUILDARCH = ppc64 endif endif @@ -4258,7 +5064,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp # LIBARCH is 1:1 mapping from BUILDARCH, except for ARCH=ppc64le ifeq ($(ARCH),ppc64le) -@@ -332,9 +356,18 @@ +@@ -332,9 +356,18 @@ ifneq ($(OSNAME),windows) LIBARCH/sparcv9 = sparcv9 LIBARCH/ia64 = ia64 LIBARCH/ppc64 = ppc64 @@ -4278,10 +5084,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp endif # Required make macro settings for all platforms -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/make/linux/Makefile b/hotspot/make/linux/Makefile ---- a/hotspot/make/linux/Makefile 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/make/linux/Makefile 2023-12-20 09:23:19.761481629 +0800 -@@ -74,6 +74,10 @@ +diff --git a/hotspot/make/linux/Makefile b/hotspot/make/linux/Makefile +index e8f20104..5aff01e8 100644 +--- a/hotspot/make/linux/Makefile ++++ b/hotspot/make/linux/Makefile +@@ -74,6 +74,10 @@ ifneq (,$(findstring $(ARCH), ppc ppc64)) FORCE_TIERED=0 endif endif @@ -4292,9 +5099,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp ifdef LP64 ifeq ("$(filter $(LP64_ARCH),$(BUILDARCH))","") -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/make/linux/makefiles/defs.make b/hotspot/make/linux/makefiles/defs.make ---- a/hotspot/make/linux/makefiles/defs.make 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/make/linux/makefiles/defs.make 2023-12-20 09:23:19.761481629 +0800 +diff --git a/hotspot/make/linux/makefiles/defs.make b/hotspot/make/linux/makefiles/defs.make +index ec414639..9ade73ab 100644 +--- a/hotspot/make/linux/makefiles/defs.make ++++ b/hotspot/make/linux/makefiles/defs.make @@ -22,6 +22,12 @@ # # @@ -4308,7 +5116,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp # The common definitions for hotspot linux builds. # Include the top level defs.make under make directory instead of this one. # This file is included into make/defs.make. -@@ -39,6 +45,18 @@ +@@ -39,6 +45,18 @@ ifndef ARCH ARCH := ppc64 endif endif @@ -4327,7 +5135,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp PATH_SEP ?= : -@@ -83,6 +101,36 @@ +@@ -83,6 +101,36 @@ ifneq (,$(findstring $(ARCH), sparc)) HS_ARCH = sparc endif @@ -4364,7 +5172,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp # i686/i586 and amd64/x86_64 ifneq (,$(findstring $(ARCH), amd64 x86_64 i686 i586)) ifeq ($(ARCH_DATA_MODEL), 64) -@@ -311,16 +359,24 @@ +@@ -311,16 +359,24 @@ ADD_SA_BINARIES/sparc = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) \ $(EXPORT_LIB_DIR)/sa-jdi.jar ADD_SA_BINARIES/aarch64 = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) \ $(EXPORT_LIB_DIR)/sa-jdi.jar @@ -4389,9 +5197,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp endif endif endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/make/linux/makefiles/gcc.make b/hotspot/make/linux/makefiles/gcc.make ---- a/hotspot/make/linux/makefiles/gcc.make 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/make/linux/makefiles/gcc.make 2023-12-20 09:23:19.761481629 +0800 +diff --git a/hotspot/make/linux/makefiles/gcc.make b/hotspot/make/linux/makefiles/gcc.make +index 7dde7f09..94c6d1d0 100644 +--- a/hotspot/make/linux/makefiles/gcc.make ++++ b/hotspot/make/linux/makefiles/gcc.make @@ -22,6 +22,12 @@ # # @@ -4405,7 +5214,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #------------------------------------------------------------------------ # CC, CXX & AS -@@ -177,6 +183,9 @@ +@@ -177,6 +183,9 @@ ARCHFLAG/aarch64 = ARCHFLAG/ia64 = ARCHFLAG/sparc = -m32 -mcpu=v9 ARCHFLAG/sparcv9 = -m64 -mcpu=v9 @@ -4415,7 +5224,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp ARCHFLAG/zero = $(ZERO_ARCHFLAG) ARCHFLAG/ppc64 = -m64 -@@ -202,7 +211,7 @@ +@@ -202,7 +211,7 @@ else endif # Compiler warnings are treated as errors @@ -4424,9 +5233,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp ifeq ($(USE_CLANG), true) # However we need to clean the code up before we can unrestrictedly enable this option with Clang -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/make/linux/makefiles/loongarch64.make b/hotspot/make/linux/makefiles/loongarch64.make ---- a/hotspot/make/linux/makefiles/loongarch64.make 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/make/linux/makefiles/loongarch64.make 2023-12-20 09:23:19.761481629 +0800 +diff --git a/hotspot/make/linux/makefiles/loongarch64.make b/hotspot/make/linux/makefiles/loongarch64.make +new file mode 100644 +index 00000000..9e3cdb6f +--- /dev/null ++++ b/hotspot/make/linux/makefiles/loongarch64.make @@ -0,0 +1,43 @@ +# +# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. @@ -4471,9 +5282,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +CFLAGS += -fno-omit-frame-pointer + +OPT_CFLAGS/compactingPermGenGen.o = -O1 -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/make/linux/makefiles/mips64.make b/hotspot/make/linux/makefiles/mips64.make ---- a/hotspot/make/linux/makefiles/mips64.make 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/make/linux/makefiles/mips64.make 2023-12-20 09:23:19.761481629 +0800 +diff --git a/hotspot/make/linux/makefiles/mips64.make b/hotspot/make/linux/makefiles/mips64.make +new file mode 100644 +index 00000000..d9af3b13 +--- /dev/null ++++ b/hotspot/make/linux/makefiles/mips64.make @@ -0,0 +1,43 @@ +# +# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. @@ -4518,9 +5331,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +CFLAGS += -fno-omit-frame-pointer + +OPT_CFLAGS/compactingPermGenGen.o = -O1 -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/make/linux/makefiles/sa.make b/hotspot/make/linux/makefiles/sa.make ---- a/hotspot/make/linux/makefiles/sa.make 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/make/linux/makefiles/sa.make 2023-12-20 09:23:19.761481629 +0800 +diff --git a/hotspot/make/linux/makefiles/sa.make b/hotspot/make/linux/makefiles/sa.make +index cdcb16a1..34c71bd6 100644 +--- a/hotspot/make/linux/makefiles/sa.make ++++ b/hotspot/make/linux/makefiles/sa.make @@ -22,6 +22,12 @@ # # @@ -4534,7 +5348,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp # This makefile (sa.make) is included from the sa.make in the # build directories. -@@ -109,6 +115,8 @@ +@@ -109,6 +115,8 @@ $(GENERATED)/sa-jdi.jar:: $(AGENT_FILES) $(QUIETLY) $(REMOTE) $(RUN.JAVAH) -classpath $(SA_CLASSDIR) -d $(GENERATED) -jni sun.jvm.hotspot.debugger.x86.X86ThreadContext $(QUIETLY) $(REMOTE) $(RUN.JAVAH) -classpath $(SA_CLASSDIR) -d $(GENERATED) -jni sun.jvm.hotspot.debugger.amd64.AMD64ThreadContext $(QUIETLY) $(REMOTE) $(RUN.JAVAH) -classpath $(SA_CLASSDIR) -d $(GENERATED) -jni sun.jvm.hotspot.debugger.aarch64.AARCH64ThreadContext @@ -4543,9 +5357,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp $(QUIETLY) $(REMOTE) $(RUN.JAVAH) -classpath $(SA_CLASSDIR) -d $(GENERATED) -jni sun.jvm.hotspot.debugger.sparc.SPARCThreadContext $(QUIETLY) $(REMOTE) $(RUN.JAVAH) -classpath $(SA_CLASSDIR) -d $(GENERATED) -jni sun.jvm.hotspot.asm.Disassembler -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/make/linux/makefiles/saproc.make b/hotspot/make/linux/makefiles/saproc.make ---- a/hotspot/make/linux/makefiles/saproc.make 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/make/linux/makefiles/saproc.make 2023-12-20 09:23:19.761481629 +0800 +diff --git a/hotspot/make/linux/makefiles/saproc.make b/hotspot/make/linux/makefiles/saproc.make +index ffc0ec5c..c04a6765 100644 +--- a/hotspot/make/linux/makefiles/saproc.make ++++ b/hotspot/make/linux/makefiles/saproc.make @@ -21,6 +21,13 @@ # questions. # @@ -4560,7 +5375,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp include $(GAMMADIR)/make/defs.make include $(GAMMADIR)/make/altsrc.make -@@ -81,7 +88,12 @@ +@@ -81,7 +88,12 @@ endif SA_LFLAGS = $(MAPFLAG:FILENAME=$(SAMAPFILE)) $(LDFLAGS_HASH_STYLE) \ $(LDFLAGS_NO_EXEC_STACK) $(EXTRA_LDFLAGS) @@ -4573,9 +5388,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp $(LIBSAPROC): $(SASRCFILES) $(SAMAPFILE) $(QUIETLY) if [ "$(BOOT_JAVA_HOME)" = "" ]; then \ -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/make/linux/makefiles/sparcWorks.make b/hotspot/make/linux/makefiles/sparcWorks.make ---- a/hotspot/make/linux/makefiles/sparcWorks.make 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/make/linux/makefiles/sparcWorks.make 2023-12-20 09:23:19.761481629 +0800 +diff --git a/hotspot/make/linux/makefiles/sparcWorks.make b/hotspot/make/linux/makefiles/sparcWorks.make +index e3911602..dbc2ace8 100644 +--- a/hotspot/make/linux/makefiles/sparcWorks.make ++++ b/hotspot/make/linux/makefiles/sparcWorks.make @@ -22,6 +22,12 @@ # # @@ -4589,7 +5405,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #------------------------------------------------------------------------ # CC, CXX & AS -@@ -38,6 +44,7 @@ +@@ -38,6 +44,7 @@ endif ARCHFLAG = $(ARCHFLAG/$(BUILDARCH)) ARCHFLAG/i486 = -m32 ARCHFLAG/amd64 = -m64 @@ -4597,9 +5413,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp CFLAGS += $(ARCHFLAG) AOUT_FLAGS += $(ARCHFLAG) -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/make/linux/makefiles/vm.make b/hotspot/make/linux/makefiles/vm.make ---- a/hotspot/make/linux/makefiles/vm.make 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/make/linux/makefiles/vm.make 2023-12-20 09:23:19.761481629 +0800 +diff --git a/hotspot/make/linux/makefiles/vm.make b/hotspot/make/linux/makefiles/vm.make +index 04b7c202..5e428538 100644 +--- a/hotspot/make/linux/makefiles/vm.make ++++ b/hotspot/make/linux/makefiles/vm.make @@ -22,6 +22,12 @@ # # @@ -4613,7 +5430,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp # Rules to build JVM and related libraries, included from vm.make in the build # directory. -@@ -99,9 +105,22 @@ +@@ -99,9 +105,22 @@ CXXFLAGS = \ ${HS_LIB_ARCH} \ ${VM_DISTRO} @@ -4636,7 +5453,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp CXXFLAGS/vm_version.o += ${JRE_VERSION} ${VERSION_CFLAGS} CXXFLAGS/arguments.o += ${VERSION_CFLAGS} -@@ -211,6 +230,15 @@ +@@ -211,6 +230,15 @@ endif ifeq ($(Platform_arch_model), x86_64) Src_Files_EXCLUDE += \*x86_32\* endif @@ -4652,9 +5469,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp # Alternate vm.make # This has to be included here to allow changes to the source -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/make/linux/platform_loongarch64 b/hotspot/make/linux/platform_loongarch64 ---- a/hotspot/make/linux/platform_loongarch64 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/make/linux/platform_loongarch64 2023-12-20 09:23:19.761481629 +0800 +diff --git a/hotspot/make/linux/platform_loongarch64 b/hotspot/make/linux/platform_loongarch64 +new file mode 100644 +index 00000000..d704cf38 +--- /dev/null ++++ b/hotspot/make/linux/platform_loongarch64 @@ -0,0 +1,17 @@ +os_family = linux + @@ -4673,9 +5492,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +gnu_dis_arch = loongarch64 + +sysdefs = -DLINUX -D_GNU_SOURCE -DLOONGARCH64 -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/make/linux/platform_mips64 b/hotspot/make/linux/platform_mips64 ---- a/hotspot/make/linux/platform_mips64 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/make/linux/platform_mips64 2023-12-20 09:23:19.761481629 +0800 +diff --git a/hotspot/make/linux/platform_mips64 b/hotspot/make/linux/platform_mips64 +new file mode 100644 +index 00000000..c283671f +--- /dev/null ++++ b/hotspot/make/linux/platform_mips64 @@ -0,0 +1,17 @@ +os_family = linux + @@ -4694,9 +5515,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +gnu_dis_arch = mips64 + +sysdefs = -DLINUX -D_GNU_SOURCE -DMIPS64 -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/make/sa.files b/hotspot/make/sa.files ---- a/hotspot/make/sa.files 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/make/sa.files 2023-12-20 09:23:19.761481629 +0800 +diff --git a/hotspot/make/sa.files b/hotspot/make/sa.files +index d6e728a9..43b08e3a 100644 +--- a/hotspot/make/sa.files ++++ b/hotspot/make/sa.files @@ -22,6 +22,12 @@ # # @@ -4710,7 +5532,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp # This filelist macro is included in platform specific sa.make # included all packages/*.java. package list can be generated by # $(GAMMADIR)/agent/make/build-pkglist. -@@ -52,14 +58,20 @@ +@@ -52,14 +58,20 @@ $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/cdbg/basic/*.java \ $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/dummy/*.java \ $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/linux/*.java \ $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/linux/amd64/*.java \ @@ -4731,7 +5553,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/proc/sparc/*.java \ $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/proc/x86/*.java \ $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/remote/*.java \ -@@ -94,8 +106,12 @@ +@@ -94,8 +106,12 @@ $(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/bsd_x86/*.java \ $(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/linux/*.java \ $(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/linux_amd64/*.java \ $(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/linux_aarch64/*.java \ @@ -4744,10 +5566,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp $(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/posix/*.java \ $(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/solaris_amd64/*.java \ $(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/solaris_sparc/*.java \ -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp ---- a/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp 2023-12-20 09:23:19.774814810 +0800 -@@ -1177,7 +1177,9 @@ +diff --git a/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp +index 35d34a08..3b8cf4a1 100644 +--- a/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp ++++ b/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp +@@ -1177,7 +1177,9 @@ void LIR_Assembler::emit_opBranch(LIR_OpBranch* op) { } } @@ -4758,7 +5581,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp void LIR_Assembler::emit_opConvert(LIR_OpConvert* op) { LIR_Opr src = op->in_opr(); -@@ -1242,7 +1244,7 @@ +@@ -1242,7 +1244,7 @@ void LIR_Assembler::emit_opConvert(LIR_OpConvert* op) { } case Bytecodes::_d2l: { @@ -4767,7 +5590,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp __ clear_fpsr(); __ fcvtzd(dest->as_register_lo(), src->as_double_reg()); __ get_fpsr(tmp); -@@ -1253,7 +1255,7 @@ +@@ -1253,7 +1255,7 @@ void LIR_Assembler::emit_opConvert(LIR_OpConvert* op) { } case Bytecodes::_f2i: { @@ -4776,7 +5599,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp __ clear_fpsr(); __ fcvtzsw(dest->as_register(), src->as_float_reg()); __ get_fpsr(tmp); -@@ -1264,7 +1266,7 @@ +@@ -1264,7 +1266,7 @@ void LIR_Assembler::emit_opConvert(LIR_OpConvert* op) { } case Bytecodes::_f2l: { @@ -4785,7 +5608,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp __ clear_fpsr(); __ fcvtzs(dest->as_register_lo(), src->as_float_reg()); __ get_fpsr(tmp); -@@ -1275,7 +1277,7 @@ +@@ -1275,7 +1277,7 @@ void LIR_Assembler::emit_opConvert(LIR_OpConvert* op) { } case Bytecodes::_d2i: { @@ -4794,7 +5617,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp __ clear_fpsr(); __ fcvtzdw(dest->as_register(), src->as_double_reg()); __ get_fpsr(tmp); -@@ -1731,6 +1733,11 @@ +@@ -1731,6 +1733,11 @@ void LIR_Assembler::cmove(LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, L __ csel(result->as_register(), opr1->as_register(), opr2->as_register(), acond); } @@ -4806,10 +5629,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp void LIR_Assembler::arith_op(LIR_Code code, LIR_Opr left, LIR_Opr right, LIR_Opr dest, CodeEmitInfo* info, bool pop_fpu_stack) { assert(info == NULL, "should never be used, idiv/irem and ldiv/lrem not handled by this method"); -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/aarch64/vm/c1_LIRGenerator_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/c1_LIRGenerator_aarch64.cpp ---- a/hotspot/src/cpu/aarch64/vm/c1_LIRGenerator_aarch64.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/cpu/aarch64/vm/c1_LIRGenerator_aarch64.cpp 2023-12-20 09:23:19.774814810 +0800 -@@ -277,18 +277,29 @@ +diff --git a/hotspot/src/cpu/aarch64/vm/c1_LIRGenerator_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/c1_LIRGenerator_aarch64.cpp +index 4f694b17..c0520983 100644 +--- a/hotspot/src/cpu/aarch64/vm/c1_LIRGenerator_aarch64.cpp ++++ b/hotspot/src/cpu/aarch64/vm/c1_LIRGenerator_aarch64.cpp +@@ -279,18 +279,29 @@ void LIRGenerator::increment_counter(LIR_Address* addr, int step) { __ store(reg, addr); } @@ -4843,9 +5667,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp bool LIRGenerator::strength_reduce_multiply(LIR_Opr left, int c, LIR_Opr result, LIR_Opr tmp) { -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/assembler_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/assembler_loongarch.cpp ---- a/hotspot/src/cpu/loongarch/vm/assembler_loongarch.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/assembler_loongarch.cpp 2023-12-20 09:23:19.784814696 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/assembler_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/assembler_loongarch.cpp +new file mode 100644 +index 00000000..2996ef7a +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/assembler_loongarch.cpp @@ -0,0 +1,855 @@ +/* + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. @@ -5702,9 +6528,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + } + } +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/assembler_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/assembler_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/assembler_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/assembler_loongarch.hpp 2023-12-20 09:23:19.784814696 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/assembler_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/assembler_loongarch.hpp +new file mode 100644 +index 00000000..46b57cfe +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/assembler_loongarch.hpp @@ -0,0 +1,2810 @@ +/* + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. @@ -8516,9 +9344,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +}; + +#endif // CPU_LOONGARCH_VM_ASSEMBLER_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/assembler_loongarch.inline.hpp b/hotspot/src/cpu/loongarch/vm/assembler_loongarch.inline.hpp ---- a/hotspot/src/cpu/loongarch/vm/assembler_loongarch.inline.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/assembler_loongarch.inline.hpp 2023-12-20 09:23:19.784814696 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/assembler_loongarch.inline.hpp b/hotspot/src/cpu/loongarch/vm/assembler_loongarch.inline.hpp +new file mode 100644 +index 00000000..601f4afe +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/assembler_loongarch.inline.hpp @@ -0,0 +1,33 @@ +/* + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. @@ -8553,9 +9383,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +#include "code/codeCache.hpp" + +#endif // CPU_LOONGARCH_VM_ASSEMBLER_LOONGARCH_INLINE_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/bytecodeInterpreter_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/bytecodeInterpreter_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/bytecodeInterpreter_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/bytecodeInterpreter_loongarch.hpp 2023-12-20 09:23:19.784814696 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/bytecodeInterpreter_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/bytecodeInterpreter_loongarch.hpp +new file mode 100644 +index 00000000..32775e9b +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/bytecodeInterpreter_loongarch.hpp @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. @@ -8667,9 +9499,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + ((VMJavaVal64*)(addr))->l) + +#endif // CPU_LOONGARCH_VM_BYTECODEINTERPRETER_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/bytecodeInterpreter_loongarch.inline.hpp b/hotspot/src/cpu/loongarch/vm/bytecodeInterpreter_loongarch.inline.hpp ---- a/hotspot/src/cpu/loongarch/vm/bytecodeInterpreter_loongarch.inline.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/bytecodeInterpreter_loongarch.inline.hpp 2023-12-20 09:23:19.784814696 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/bytecodeInterpreter_loongarch.inline.hpp b/hotspot/src/cpu/loongarch/vm/bytecodeInterpreter_loongarch.inline.hpp +new file mode 100644 +index 00000000..07df527e +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/bytecodeInterpreter_loongarch.inline.hpp @@ -0,0 +1,286 @@ +/* + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. @@ -8957,9 +9791,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +} + +#endif // CPU_LOONGARCH_VM_BYTECODEINTERPRETER_LOONGARCH_INLINE_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/bytecodes_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/bytecodes_loongarch.cpp ---- a/hotspot/src/cpu/loongarch/vm/bytecodes_loongarch.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/bytecodes_loongarch.cpp 2023-12-20 09:23:19.784814696 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/bytecodes_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/bytecodes_loongarch.cpp +new file mode 100644 +index 00000000..86410905 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/bytecodes_loongarch.cpp @@ -0,0 +1,38 @@ +/* + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. @@ -8999,9 +9835,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + // No LoongArch specific bytecodes + return code; +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/bytecodes_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/bytecodes_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/bytecodes_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/bytecodes_loongarch.hpp 2023-12-20 09:23:19.784814696 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/bytecodes_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/bytecodes_loongarch.hpp +new file mode 100644 +index 00000000..fbdf5319 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/bytecodes_loongarch.hpp @@ -0,0 +1,31 @@ +/* + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. @@ -9034,9 +9872,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +// No Loongson specific bytecodes + +#endif // CPU_LOONGARCH_VM_BYTECODES_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/bytes_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/bytes_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/bytes_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/bytes_loongarch.hpp 2023-12-20 09:23:19.784814696 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/bytes_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/bytes_loongarch.hpp +new file mode 100644 +index 00000000..8f766a61 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/bytes_loongarch.hpp @@ -0,0 +1,75 @@ +/* + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. @@ -9113,9 +9953,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +#endif + +#endif // CPU_LOONGARCH_VM_BYTES_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/c1_CodeStubs_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/c1_CodeStubs_loongarch_64.cpp ---- a/hotspot/src/cpu/loongarch/vm/c1_CodeStubs_loongarch_64.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/c1_CodeStubs_loongarch_64.cpp 2023-12-20 09:23:19.784814696 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/c1_CodeStubs_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/c1_CodeStubs_loongarch_64.cpp +new file mode 100644 +index 00000000..5166acfa +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/c1_CodeStubs_loongarch_64.cpp @@ -0,0 +1,387 @@ +/* + * Copyright (c) 1999, 2021, Oracle and/or its affiliates. All rights reserved. @@ -9504,9 +10346,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +///////////////////////////////////////////////////////////////////////////// + +#undef __ -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/c1_Defs_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/c1_Defs_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/c1_Defs_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/c1_Defs_loongarch.hpp 2023-12-20 09:23:19.784814696 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/c1_Defs_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/c1_Defs_loongarch.hpp +new file mode 100644 +index 00000000..1140e444 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/c1_Defs_loongarch.hpp @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved. @@ -9587,9 +10431,49 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +}; + +#endif // CPU_LOONGARCH_C1_DEFS_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/c1_FpuStackSim_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/c1_FpuStackSim_loongarch_64.cpp ---- a/hotspot/src/cpu/loongarch/vm/c1_FpuStackSim_loongarch_64.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/c1_FpuStackSim_loongarch_64.cpp 2023-12-20 09:23:19.784814696 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/c1_FpuStackSim_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/c1_FpuStackSim_loongarch.hpp +new file mode 100644 +index 00000000..bd8578c7 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/c1_FpuStackSim_loongarch.hpp +@@ -0,0 +1,32 @@ ++/* ++ * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2021, 2022, Loongson Technology. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ */ ++ ++#ifndef CPU_LOONGARCH_C1_FPUSTACKSIM_LOONGARCH_HPP ++#define CPU_LOONGARCH_C1_FPUSTACKSIM_LOONGARCH_HPP ++ ++// No FPU stack on LoongArch ++class FpuStackSim; ++ ++#endif // CPU_LOONGARCH_C1_FPUSTACKSIM_LOONGARCH_HPP +diff --git a/hotspot/src/cpu/loongarch/vm/c1_FpuStackSim_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/c1_FpuStackSim_loongarch_64.cpp +new file mode 100644 +index 00000000..1a89c437 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/c1_FpuStackSim_loongarch_64.cpp @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved. @@ -9622,13 +10506,15 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + +// No FPU stack on LoongArch64 +#include "precompiled.hpp" -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/c1_FpuStackSim_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/c1_FpuStackSim_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/c1_FpuStackSim_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/c1_FpuStackSim_loongarch.hpp 2023-12-20 09:23:19.784814696 +0800 -@@ -0,0 +1,32 @@ +diff --git a/hotspot/src/cpu/loongarch/vm/c1_FrameMap_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/c1_FrameMap_loongarch.hpp +new file mode 100644 +index 00000000..4f0cf053 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/c1_FrameMap_loongarch.hpp +@@ -0,0 +1,143 @@ +/* -+ * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2021, 2022, Loongson Technology. All rights reserved. ++ * Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2021, Loongson Technology. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it @@ -9651,16 +10537,129 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + * + */ + -+#ifndef CPU_LOONGARCH_C1_FPUSTACKSIM_LOONGARCH_HPP -+#define CPU_LOONGARCH_C1_FPUSTACKSIM_LOONGARCH_HPP ++#ifndef CPU_LOONGARCH_C1_FRAMEMAP_LOONGARCH_HPP ++#define CPU_LOONGARCH_C1_FRAMEMAP_LOONGARCH_HPP + -+// No FPU stack on LoongArch -+class FpuStackSim; ++// On LoongArch64 the frame looks as follows: ++// ++// +-----------------------------+---------+----------------------------------------+----------------+----------- ++// | size_arguments-nof_reg_args | 2 words | size_locals-size_arguments+numreg_args | _size_monitors | spilling . ++// +-----------------------------+---------+----------------------------------------+----------------+----------- + -+#endif // CPU_LOONGARCH_C1_FPUSTACKSIM_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/c1_FrameMap_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/c1_FrameMap_loongarch_64.cpp ---- a/hotspot/src/cpu/loongarch/vm/c1_FrameMap_loongarch_64.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/c1_FrameMap_loongarch_64.cpp 2023-12-20 09:23:19.784814696 +0800 ++ public: ++ static const int pd_c_runtime_reserved_arg_size; ++ ++ enum { ++ first_available_sp_in_frame = 0, ++ frame_pad_in_bytes = 16, ++ nof_reg_args = 8 ++ }; ++ ++ public: ++ static LIR_Opr receiver_opr; ++ ++ static LIR_Opr r0_opr; ++ static LIR_Opr ra_opr; ++ static LIR_Opr tp_opr; ++ static LIR_Opr sp_opr; ++ static LIR_Opr a0_opr; ++ static LIR_Opr a1_opr; ++ static LIR_Opr a2_opr; ++ static LIR_Opr a3_opr; ++ static LIR_Opr a4_opr; ++ static LIR_Opr a5_opr; ++ static LIR_Opr a6_opr; ++ static LIR_Opr a7_opr; ++ static LIR_Opr t0_opr; ++ static LIR_Opr t1_opr; ++ static LIR_Opr t2_opr; ++ static LIR_Opr t3_opr; ++ static LIR_Opr t4_opr; ++ static LIR_Opr t5_opr; ++ static LIR_Opr t6_opr; ++ static LIR_Opr t7_opr; ++ static LIR_Opr t8_opr; ++ static LIR_Opr rx_opr; ++ static LIR_Opr fp_opr; ++ static LIR_Opr s0_opr; ++ static LIR_Opr s1_opr; ++ static LIR_Opr s2_opr; ++ static LIR_Opr s3_opr; ++ static LIR_Opr s4_opr; ++ static LIR_Opr s5_opr; ++ static LIR_Opr s6_opr; ++ static LIR_Opr s7_opr; ++ static LIR_Opr s8_opr; ++ ++ static LIR_Opr ra_oop_opr; ++ static LIR_Opr a0_oop_opr; ++ static LIR_Opr a1_oop_opr; ++ static LIR_Opr a2_oop_opr; ++ static LIR_Opr a3_oop_opr; ++ static LIR_Opr a4_oop_opr; ++ static LIR_Opr a5_oop_opr; ++ static LIR_Opr a6_oop_opr; ++ static LIR_Opr a7_oop_opr; ++ static LIR_Opr t0_oop_opr; ++ static LIR_Opr t1_oop_opr; ++ static LIR_Opr t2_oop_opr; ++ static LIR_Opr t3_oop_opr; ++ static LIR_Opr t4_oop_opr; ++ static LIR_Opr t5_oop_opr; ++ static LIR_Opr t6_oop_opr; ++ static LIR_Opr t7_oop_opr; ++ static LIR_Opr t8_oop_opr; ++ static LIR_Opr fp_oop_opr; ++ static LIR_Opr s0_oop_opr; ++ static LIR_Opr s1_oop_opr; ++ static LIR_Opr s2_oop_opr; ++ static LIR_Opr s3_oop_opr; ++ static LIR_Opr s4_oop_opr; ++ static LIR_Opr s5_oop_opr; ++ static LIR_Opr s6_oop_opr; ++ static LIR_Opr s7_oop_opr; ++ static LIR_Opr s8_oop_opr; ++ ++ static LIR_Opr scr1_opr; ++ static LIR_Opr scr2_opr; ++ static LIR_Opr scr1_long_opr; ++ static LIR_Opr scr2_long_opr; ++ ++ static LIR_Opr a0_metadata_opr; ++ static LIR_Opr a1_metadata_opr; ++ static LIR_Opr a2_metadata_opr; ++ static LIR_Opr a3_metadata_opr; ++ static LIR_Opr a4_metadata_opr; ++ static LIR_Opr a5_metadata_opr; ++ ++ static LIR_Opr long0_opr; ++ static LIR_Opr long1_opr; ++ static LIR_Opr fpu0_float_opr; ++ static LIR_Opr fpu0_double_opr; ++ ++ static LIR_Opr as_long_opr(Register r) { ++ return LIR_OprFact::double_cpu(cpu_reg2rnr(r), cpu_reg2rnr(r)); ++ } ++ static LIR_Opr as_pointer_opr(Register r) { ++ return LIR_OprFact::double_cpu(cpu_reg2rnr(r), cpu_reg2rnr(r)); ++ } ++ ++ // VMReg name for spilled physical FPU stack slot n ++ static VMReg fpu_regname (int n); ++ ++ static bool is_caller_save_register(LIR_Opr opr) { return true; } ++ static bool is_caller_save_register(Register r) { return true; } ++ ++ static int nof_caller_save_cpu_regs() { return pd_nof_caller_save_cpu_regs_frame_map; } ++ static int last_cpu_reg() { return pd_last_cpu_reg; } ++ static int last_byte_reg() { return pd_last_byte_reg; } ++ ++#endif // CPU_LOONGARCH_C1_FRAMEMAP_LOONGARCH_HPP +diff --git a/hotspot/src/cpu/loongarch/vm/c1_FrameMap_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/c1_FrameMap_loongarch_64.cpp +new file mode 100644 +index 00000000..25c90bcf +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/c1_FrameMap_loongarch_64.cpp @@ -0,0 +1,362 @@ +/* + * Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved. @@ -10024,157 +11023,12 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +bool FrameMap::validate_frame() { + return true; +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/c1_FrameMap_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/c1_FrameMap_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/c1_FrameMap_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/c1_FrameMap_loongarch.hpp 2023-12-20 09:23:19.784814696 +0800 -@@ -0,0 +1,143 @@ -+/* -+ * Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2021, Loongson Technology. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ * -+ */ -+ -+#ifndef CPU_LOONGARCH_C1_FRAMEMAP_LOONGARCH_HPP -+#define CPU_LOONGARCH_C1_FRAMEMAP_LOONGARCH_HPP -+ -+// On LoongArch64 the frame looks as follows: -+// -+// +-----------------------------+---------+----------------------------------------+----------------+----------- -+// | size_arguments-nof_reg_args | 2 words | size_locals-size_arguments+numreg_args | _size_monitors | spilling . -+// +-----------------------------+---------+----------------------------------------+----------------+----------- -+ -+ public: -+ static const int pd_c_runtime_reserved_arg_size; -+ -+ enum { -+ first_available_sp_in_frame = 0, -+ frame_pad_in_bytes = 16, -+ nof_reg_args = 8 -+ }; -+ -+ public: -+ static LIR_Opr receiver_opr; -+ -+ static LIR_Opr r0_opr; -+ static LIR_Opr ra_opr; -+ static LIR_Opr tp_opr; -+ static LIR_Opr sp_opr; -+ static LIR_Opr a0_opr; -+ static LIR_Opr a1_opr; -+ static LIR_Opr a2_opr; -+ static LIR_Opr a3_opr; -+ static LIR_Opr a4_opr; -+ static LIR_Opr a5_opr; -+ static LIR_Opr a6_opr; -+ static LIR_Opr a7_opr; -+ static LIR_Opr t0_opr; -+ static LIR_Opr t1_opr; -+ static LIR_Opr t2_opr; -+ static LIR_Opr t3_opr; -+ static LIR_Opr t4_opr; -+ static LIR_Opr t5_opr; -+ static LIR_Opr t6_opr; -+ static LIR_Opr t7_opr; -+ static LIR_Opr t8_opr; -+ static LIR_Opr rx_opr; -+ static LIR_Opr fp_opr; -+ static LIR_Opr s0_opr; -+ static LIR_Opr s1_opr; -+ static LIR_Opr s2_opr; -+ static LIR_Opr s3_opr; -+ static LIR_Opr s4_opr; -+ static LIR_Opr s5_opr; -+ static LIR_Opr s6_opr; -+ static LIR_Opr s7_opr; -+ static LIR_Opr s8_opr; -+ -+ static LIR_Opr ra_oop_opr; -+ static LIR_Opr a0_oop_opr; -+ static LIR_Opr a1_oop_opr; -+ static LIR_Opr a2_oop_opr; -+ static LIR_Opr a3_oop_opr; -+ static LIR_Opr a4_oop_opr; -+ static LIR_Opr a5_oop_opr; -+ static LIR_Opr a6_oop_opr; -+ static LIR_Opr a7_oop_opr; -+ static LIR_Opr t0_oop_opr; -+ static LIR_Opr t1_oop_opr; -+ static LIR_Opr t2_oop_opr; -+ static LIR_Opr t3_oop_opr; -+ static LIR_Opr t4_oop_opr; -+ static LIR_Opr t5_oop_opr; -+ static LIR_Opr t6_oop_opr; -+ static LIR_Opr t7_oop_opr; -+ static LIR_Opr t8_oop_opr; -+ static LIR_Opr fp_oop_opr; -+ static LIR_Opr s0_oop_opr; -+ static LIR_Opr s1_oop_opr; -+ static LIR_Opr s2_oop_opr; -+ static LIR_Opr s3_oop_opr; -+ static LIR_Opr s4_oop_opr; -+ static LIR_Opr s5_oop_opr; -+ static LIR_Opr s6_oop_opr; -+ static LIR_Opr s7_oop_opr; -+ static LIR_Opr s8_oop_opr; -+ -+ static LIR_Opr scr1_opr; -+ static LIR_Opr scr2_opr; -+ static LIR_Opr scr1_long_opr; -+ static LIR_Opr scr2_long_opr; -+ -+ static LIR_Opr a0_metadata_opr; -+ static LIR_Opr a1_metadata_opr; -+ static LIR_Opr a2_metadata_opr; -+ static LIR_Opr a3_metadata_opr; -+ static LIR_Opr a4_metadata_opr; -+ static LIR_Opr a5_metadata_opr; -+ -+ static LIR_Opr long0_opr; -+ static LIR_Opr long1_opr; -+ static LIR_Opr fpu0_float_opr; -+ static LIR_Opr fpu0_double_opr; -+ -+ static LIR_Opr as_long_opr(Register r) { -+ return LIR_OprFact::double_cpu(cpu_reg2rnr(r), cpu_reg2rnr(r)); -+ } -+ static LIR_Opr as_pointer_opr(Register r) { -+ return LIR_OprFact::double_cpu(cpu_reg2rnr(r), cpu_reg2rnr(r)); -+ } -+ -+ // VMReg name for spilled physical FPU stack slot n -+ static VMReg fpu_regname (int n); -+ -+ static bool is_caller_save_register(LIR_Opr opr) { return true; } -+ static bool is_caller_save_register(Register r) { return true; } -+ -+ static int nof_caller_save_cpu_regs() { return pd_nof_caller_save_cpu_regs_frame_map; } -+ static int last_cpu_reg() { return pd_last_cpu_reg; } -+ static int last_byte_reg() { return pd_last_byte_reg; } -+ -+#endif // CPU_LOONGARCH_C1_FRAMEMAP_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/c1_globals_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/c1_globals_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/c1_globals_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/c1_globals_loongarch.hpp 2023-12-20 09:23:19.788147991 +0800 -@@ -0,0 +1,69 @@ +diff --git a/hotspot/src/cpu/loongarch/vm/c1_LIRAssembler_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/c1_LIRAssembler_loongarch.hpp +new file mode 100644 +index 00000000..38b0daa0 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/c1_LIRAssembler_loongarch.hpp +@@ -0,0 +1,83 @@ +/* + * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, Loongson Technology. All rights reserved. @@ -10200,164 +11054,69 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + * + */ + -+#ifndef CPU_LOONGARCH_C1_GLOBALS_LOONGARCH_HPP -+#define CPU_LOONGARCH_C1_GLOBALS_LOONGARCH_HPP -+ -+#include "utilities/globalDefinitions.hpp" -+#include "utilities/macros.hpp" ++#ifndef CPU_LOONGARCH_C1_LIRASSEMBLER_LOONGARCH_HPP ++#define CPU_LOONGARCH_C1_LIRASSEMBLER_LOONGARCH_HPP + -+// Sets the default values for platform dependent flags used by the client compiler. -+// (see c1_globals.hpp) ++// ArrayCopyStub needs access to bailout ++friend class ArrayCopyStub; + -+#ifndef COMPILER2 -+define_pd_global(bool, BackgroundCompilation, true ); -+define_pd_global(bool, InlineIntrinsics, true ); -+define_pd_global(bool, PreferInterpreterNativeStubs, false); -+define_pd_global(bool, ProfileTraps, false); -+define_pd_global(bool, UseOnStackReplacement, true ); -+define_pd_global(bool, TieredCompilation, false); -+define_pd_global(intx, CompileThreshold, 1500 ); ++ private: ++ int array_element_size(BasicType type) const; + -+define_pd_global(intx, OnStackReplacePercentage, 933 ); -+define_pd_global(intx, NewSizeThreadIncrease, 4*K ); -+define_pd_global(intx, InitialCodeCacheSize, 160*K); -+define_pd_global(intx, ReservedCodeCacheSize, 32*M ); -+define_pd_global(intx, NonProfiledCodeHeapSize, 13*M ); -+define_pd_global(intx, ProfiledCodeHeapSize, 14*M ); -+define_pd_global(intx, NonNMethodCodeHeapSize, 5*M ); -+define_pd_global(bool, ProfileInterpreter, false); -+define_pd_global(intx, CodeCacheExpansionSize, 32*K ); -+define_pd_global(uintx, CodeCacheMinBlockLength, 1); -+define_pd_global(uintx, CodeCacheMinimumUseSpace, 400*K); -+define_pd_global(bool, NeverActAsServerClassMachine, true ); -+define_pd_global(uint64_t,MaxRAM, 1ULL*G); -+define_pd_global(bool, CICompileOSR, true ); -+#endif // !COMPILER2 -+define_pd_global(bool, UseTypeProfile, false); -+define_pd_global(bool, RoundFPResults, true ); ++ void arith_fpu_implementation(LIR_Code code, int left_index, int right_index, ++ int dest_index, bool pop_fpu_stack); + -+define_pd_global(bool, LIRFillDelaySlots, false); -+define_pd_global(bool, OptimizeSinglePrecision, true ); -+define_pd_global(bool, CSEArrayLength, false); -+define_pd_global(bool, TwoOperandLIRForm, false ); ++ // helper functions which checks for overflow and sets bailout if it ++ // occurs. Always returns a valid embeddable pointer but in the ++ // bailout case the pointer won't be to unique storage. ++ address float_constant(float f); ++ address double_constant(double d); + -+define_pd_global(intx, SafepointPollOffset, 0 ); ++ address int_constant(jlong n); + -+#endif // CPU_LOONGARCH_C1_GLOBALS_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/c1_LinearScan_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/c1_LinearScan_loongarch_64.cpp ---- a/hotspot/src/cpu/loongarch/vm/c1_LinearScan_loongarch_64.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/c1_LinearScan_loongarch_64.cpp 2023-12-20 09:23:19.784814696 +0800 -@@ -0,0 +1,33 @@ -+/* -+ * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. All rights reserved. -+ * Copyright (c) 2021, Loongson Technology. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ * -+ */ ++ bool is_literal_address(LIR_Address* addr); + -+#include "precompiled.hpp" -+#include "c1/c1_Instruction.hpp" -+#include "c1/c1_LinearScan.hpp" -+#include "utilities/bitMap.inline.hpp" ++ // Ensure we have a valid Address (base+offset) to a stack-slot. ++ Address stack_slot_address(int index, uint shift, int adjust = 0); + -+void LinearScan::allocate_fpu_stack() { -+ // No FPU stack on LoongArch64 -+} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/c1_LinearScan_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/c1_LinearScan_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/c1_LinearScan_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/c1_LinearScan_loongarch.hpp 2023-12-20 09:23:19.784814696 +0800 -@@ -0,0 +1,70 @@ -+/* -+ * Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2021, Loongson Technology. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ * -+ */ ++ // Record the type of the receiver in ReceiverTypeData ++ void type_profile_helper(Register mdo, ciMethodData *md, ciProfileData *data, ++ Register recv, Label* update_done); ++ void add_debug_info_for_branch(address adr, CodeEmitInfo* info); + -+#ifndef CPU_LOONGARCH_C1_LINEARSCAN_LOONGARCH_HPP -+#define CPU_LOONGARCH_C1_LINEARSCAN_LOONGARCH_HPP ++ void casw(Register addr, Register newval, Register cmpval, bool sign); ++ void casl(Register addr, Register newval, Register cmpval); + -+inline bool LinearScan::is_processed_reg_num(int reg_num) { -+ return reg_num <= FrameMap::last_cpu_reg() || reg_num >= pd_nof_cpu_regs_frame_map; -+} ++ void poll_for_safepoint(relocInfo::relocType rtype, CodeEmitInfo* info = NULL); + -+inline int LinearScan::num_physical_regs(BasicType type) { -+ return 1; -+} ++ static const int max_tableswitches = 20; ++ struct tableswitch switches[max_tableswitches]; ++ int tableswitch_count; + -+inline bool LinearScan::requires_adjacent_regs(BasicType type) { -+ return false; -+} ++ void init() { tableswitch_count = 0; } + -+inline bool LinearScan::is_caller_save(int assigned_reg) { -+ assert(assigned_reg >= 0 && assigned_reg < nof_regs, "should call this only for registers"); -+ if (assigned_reg < pd_first_callee_saved_reg) -+ return true; -+ if (assigned_reg > pd_last_callee_saved_reg && assigned_reg < pd_first_callee_saved_fpu_reg) -+ return true; -+ if (assigned_reg > pd_last_callee_saved_fpu_reg && assigned_reg < pd_last_fpu_reg) -+ return true; -+ return false; -+} ++ void deoptimize_trap(CodeEmitInfo *info); + -+inline void LinearScan::pd_add_temps(LIR_Op* op) {} ++public: ++ void store_parameter(Register r, int offset_from_sp_in_words); ++ void store_parameter(jint c, int offset_from_sp_in_words); ++ void store_parameter(jobject c, int offset_from_sp_in_words); + -+// Implementation of LinearScanWalker -+inline bool LinearScanWalker::pd_init_regs_for_alloc(Interval* cur) { -+ if (allocator()->gen()->is_vreg_flag_set(cur->reg_num(), LIRGenerator::callee_saved)) { -+ assert(cur->type() != T_FLOAT && cur->type() != T_DOUBLE, "cpu regs only"); -+ _first_reg = pd_first_callee_saved_reg; -+ _last_reg = pd_last_callee_saved_reg; -+ return true; -+ } else if (cur->type() == T_INT || cur->type() == T_LONG || cur->type() == T_OBJECT || -+ cur->type() == T_ADDRESS || cur->type() == T_METADATA) { -+ _first_reg = pd_first_cpu_reg; -+ _last_reg = pd_last_allocatable_cpu_reg; -+ return true; -+ } -+ return false; -+} ++ enum { ++ // call stub: CompiledStaticCall::to_interp_stub_size() + ++ // NativeInstruction::nop_instruction_size + ++ // NativeCallTrampolineStub::instruction_size ++ call_stub_size = 13 * NativeInstruction::nop_instruction_size, ++ exception_handler_size = DEBUG_ONLY(1*K) NOT_DEBUG(175), ++ deopt_handler_size = 7 * NativeInstruction::nop_instruction_size ++ }; + -+#endif // CPU_LOONGARCH_C1_LINEARSCAN_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/c1_LIRAssembler_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/c1_LIRAssembler_loongarch_64.cpp ---- a/hotspot/src/cpu/loongarch/vm/c1_LIRAssembler_loongarch_64.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/c1_LIRAssembler_loongarch_64.cpp 2023-12-20 09:23:19.784814696 +0800 ++#endif // CPU_LOONGARCH_C1_LIRASSEMBLER_LOONGARCH_HPP +diff --git a/hotspot/src/cpu/loongarch/vm/c1_LIRAssembler_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/c1_LIRAssembler_loongarch_64.cpp +new file mode 100644 +index 00000000..ee48326b +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/c1_LIRAssembler_loongarch_64.cpp @@ -0,0 +1,3377 @@ +/* + * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved. @@ -13736,96 +14495,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +} + +#undef __ -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/c1_LIRAssembler_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/c1_LIRAssembler_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/c1_LIRAssembler_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/c1_LIRAssembler_loongarch.hpp 2023-12-20 09:23:19.784814696 +0800 -@@ -0,0 +1,83 @@ -+/* -+ * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2021, Loongson Technology. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ * -+ */ -+ -+#ifndef CPU_LOONGARCH_C1_LIRASSEMBLER_LOONGARCH_HPP -+#define CPU_LOONGARCH_C1_LIRASSEMBLER_LOONGARCH_HPP -+ -+// ArrayCopyStub needs access to bailout -+friend class ArrayCopyStub; -+ -+ private: -+ int array_element_size(BasicType type) const; -+ -+ void arith_fpu_implementation(LIR_Code code, int left_index, int right_index, -+ int dest_index, bool pop_fpu_stack); -+ -+ // helper functions which checks for overflow and sets bailout if it -+ // occurs. Always returns a valid embeddable pointer but in the -+ // bailout case the pointer won't be to unique storage. -+ address float_constant(float f); -+ address double_constant(double d); -+ -+ address int_constant(jlong n); -+ -+ bool is_literal_address(LIR_Address* addr); -+ -+ // Ensure we have a valid Address (base+offset) to a stack-slot. -+ Address stack_slot_address(int index, uint shift, int adjust = 0); -+ -+ // Record the type of the receiver in ReceiverTypeData -+ void type_profile_helper(Register mdo, ciMethodData *md, ciProfileData *data, -+ Register recv, Label* update_done); -+ void add_debug_info_for_branch(address adr, CodeEmitInfo* info); -+ -+ void casw(Register addr, Register newval, Register cmpval, bool sign); -+ void casl(Register addr, Register newval, Register cmpval); -+ -+ void poll_for_safepoint(relocInfo::relocType rtype, CodeEmitInfo* info = NULL); -+ -+ static const int max_tableswitches = 20; -+ struct tableswitch switches[max_tableswitches]; -+ int tableswitch_count; -+ -+ void init() { tableswitch_count = 0; } -+ -+ void deoptimize_trap(CodeEmitInfo *info); -+ -+public: -+ void store_parameter(Register r, int offset_from_sp_in_words); -+ void store_parameter(jint c, int offset_from_sp_in_words); -+ void store_parameter(jobject c, int offset_from_sp_in_words); -+ -+ enum { -+ // call stub: CompiledStaticCall::to_interp_stub_size() + -+ // NativeInstruction::nop_instruction_size + -+ // NativeCallTrampolineStub::instruction_size -+ call_stub_size = 13 * NativeInstruction::nop_instruction_size, -+ exception_handler_size = DEBUG_ONLY(1*K) NOT_DEBUG(175), -+ deopt_handler_size = 7 * NativeInstruction::nop_instruction_size -+ }; -+ -+#endif // CPU_LOONGARCH_C1_LIRASSEMBLER_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/c1_LIRGenerator_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/c1_LIRGenerator_loongarch_64.cpp ---- a/hotspot/src/cpu/loongarch/vm/c1_LIRGenerator_loongarch_64.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/c1_LIRGenerator_loongarch_64.cpp 2023-12-20 09:23:19.784814696 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/c1_LIRGenerator_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/c1_LIRGenerator_loongarch_64.cpp +new file mode 100644 +index 00000000..7cb15f68 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/c1_LIRGenerator_loongarch_64.cpp @@ -0,0 +1,1442 @@ +/* + * Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved. @@ -15269,9 +15943,244 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + } + } +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/c1_MacroAssembler_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/c1_MacroAssembler_loongarch_64.cpp ---- a/hotspot/src/cpu/loongarch/vm/c1_MacroAssembler_loongarch_64.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/c1_MacroAssembler_loongarch_64.cpp 2023-12-20 09:23:19.784814696 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/c1_LinearScan_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/c1_LinearScan_loongarch.hpp +new file mode 100644 +index 00000000..f15dacaf +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/c1_LinearScan_loongarch.hpp +@@ -0,0 +1,70 @@ ++/* ++ * Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2021, Loongson Technology. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ */ ++ ++#ifndef CPU_LOONGARCH_C1_LINEARSCAN_LOONGARCH_HPP ++#define CPU_LOONGARCH_C1_LINEARSCAN_LOONGARCH_HPP ++ ++inline bool LinearScan::is_processed_reg_num(int reg_num) { ++ return reg_num <= FrameMap::last_cpu_reg() || reg_num >= pd_nof_cpu_regs_frame_map; ++} ++ ++inline int LinearScan::num_physical_regs(BasicType type) { ++ return 1; ++} ++ ++inline bool LinearScan::requires_adjacent_regs(BasicType type) { ++ return false; ++} ++ ++inline bool LinearScan::is_caller_save(int assigned_reg) { ++ assert(assigned_reg >= 0 && assigned_reg < nof_regs, "should call this only for registers"); ++ if (assigned_reg < pd_first_callee_saved_reg) ++ return true; ++ if (assigned_reg > pd_last_callee_saved_reg && assigned_reg < pd_first_callee_saved_fpu_reg) ++ return true; ++ if (assigned_reg > pd_last_callee_saved_fpu_reg && assigned_reg < pd_last_fpu_reg) ++ return true; ++ return false; ++} ++ ++inline void LinearScan::pd_add_temps(LIR_Op* op) {} ++ ++// Implementation of LinearScanWalker ++inline bool LinearScanWalker::pd_init_regs_for_alloc(Interval* cur) { ++ if (allocator()->gen()->is_vreg_flag_set(cur->reg_num(), LIRGenerator::callee_saved)) { ++ assert(cur->type() != T_FLOAT && cur->type() != T_DOUBLE, "cpu regs only"); ++ _first_reg = pd_first_callee_saved_reg; ++ _last_reg = pd_last_callee_saved_reg; ++ return true; ++ } else if (cur->type() == T_INT || cur->type() == T_LONG || cur->type() == T_OBJECT || ++ cur->type() == T_ADDRESS || cur->type() == T_METADATA) { ++ _first_reg = pd_first_cpu_reg; ++ _last_reg = pd_last_allocatable_cpu_reg; ++ return true; ++ } ++ return false; ++} ++ ++#endif // CPU_LOONGARCH_C1_LINEARSCAN_LOONGARCH_HPP +diff --git a/hotspot/src/cpu/loongarch/vm/c1_LinearScan_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/c1_LinearScan_loongarch_64.cpp +new file mode 100644 +index 00000000..219b2e36 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/c1_LinearScan_loongarch_64.cpp +@@ -0,0 +1,33 @@ ++/* ++ * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. All rights reserved. ++ * Copyright (c) 2021, Loongson Technology. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ */ ++ ++#include "precompiled.hpp" ++#include "c1/c1_Instruction.hpp" ++#include "c1/c1_LinearScan.hpp" ++#include "utilities/bitMap.inline.hpp" ++ ++void LinearScan::allocate_fpu_stack() { ++ // No FPU stack on LoongArch64 ++} +diff --git a/hotspot/src/cpu/loongarch/vm/c1_MacroAssembler_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/c1_MacroAssembler_loongarch.hpp +new file mode 100644 +index 00000000..38ff4c58 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/c1_MacroAssembler_loongarch.hpp +@@ -0,0 +1,112 @@ ++/* ++ * Copyright (c) 1999, 2021, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2021, Loongson Technology. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ */ ++ ++#ifndef CPU_LOONGARCH_C1_MACROASSEMBLER_LOONGARCH_HPP ++#define CPU_LOONGARCH_C1_MACROASSEMBLER_LOONGARCH_HPP ++ ++using MacroAssembler::build_frame; ++using MacroAssembler::null_check; ++ ++// C1_MacroAssembler contains high-level macros for C1 ++ ++ private: ++ int _rsp_offset; // track rsp changes ++ // initialization ++ void pd_init() { _rsp_offset = 0; } ++ ++ public: ++ void try_allocate( ++ Register obj, // result: pointer to object after successful allocation ++ Register var_size_in_bytes, // object size in bytes if unknown at compile time; invalid otherwise ++ int con_size_in_bytes, // object size in bytes if known at compile time ++ Register t1, // temp register ++ Register t2, // temp register ++ Label& slow_case // continuation point if fast allocation fails ++ ); ++ ++ void initialize_header(Register obj, Register klass, Register len, Register t1, Register t2); ++ void initialize_body(Register obj, Register len_in_bytes, int hdr_size_in_bytes, Register t1, Register t2); ++ ++ // locking ++ // hdr : must be A0, contents destroyed ++ // obj : must point to the object to lock, contents preserved ++ // disp_hdr: must point to the displaced header location, contents preserved ++ // scratch : scratch register, contents destroyed ++ // returns code offset at which to add null check debug information ++ int lock_object (Register swap, Register obj, Register disp_hdr, Register scratch, Label& slow_case); ++ ++ // unlocking ++ // hdr : contents destroyed ++ // obj : must point to the object to lock, contents preserved ++ // disp_hdr: must be A0 & must point to the displaced header location, contents destroyed ++ void unlock_object(Register swap, Register obj, Register lock, Label& slow_case); ++ ++ void initialize_object( ++ Register obj, // result: pointer to object after successful allocation ++ Register klass, // object klass ++ Register var_size_in_bytes, // object size in bytes if unknown at compile time; invalid otherwise ++ int con_size_in_bytes, // object size in bytes if known at compile time ++ Register t1, // temp register ++ Register t2, // temp register ++ bool is_tlab_allocated // the object was allocated in a TLAB; relevant for the implementation of ZeroTLAB ++ ); ++ ++ // allocation of fixed-size objects ++ // (can also be used to allocate fixed-size arrays, by setting ++ // hdr_size correctly and storing the array length afterwards) ++ // obj : will contain pointer to allocated object ++ // t1, t2 : scratch registers - contents destroyed ++ // header_size: size of object header in words ++ // object_size: total size of object in words ++ // slow_case : exit to slow case implementation if fast allocation fails ++ void allocate_object(Register obj, Register t1, Register t2, int header_size, ++ int object_size, Register klass, Label& slow_case); ++ ++ enum { ++ max_array_allocation_length = 0x00FFFFFF ++ }; ++ ++ // allocation of arrays ++ // obj : will contain pointer to allocated object ++ // len : array length in number of elements ++ // t : scratch register - contents destroyed ++ // header_size: size of object header in words ++ // f : element scale factor ++ // slow_case : exit to slow case implementation if fast allocation fails ++ void allocate_array(Register obj, Register len, Register t, Register t2, int header_size, ++ int f, Register klass, Label& slow_case); ++ ++ int rsp_offset() const { return _rsp_offset; } ++ void set_rsp_offset(int n) { _rsp_offset = n; } ++ ++ void invalidate_registers(bool inv_a0, bool inv_s0, bool inv_a2, bool inv_a3, ++ bool inv_a4, bool inv_a5) PRODUCT_RETURN; ++ ++ // This platform only uses signal-based null checks. The Label is not needed. ++ void null_check(Register r, Label *Lnull = NULL) { MacroAssembler::null_check(r); } ++ ++ void load_parameter(int offset_in_words, Register reg); ++ ++#endif // CPU_LOONGARCH_C1_MACROASSEMBLER_LOONGARCH_HPP +diff --git a/hotspot/src/cpu/loongarch/vm/c1_MacroAssembler_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/c1_MacroAssembler_loongarch_64.cpp +new file mode 100644 +index 00000000..b75126fb +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/c1_MacroAssembler_loongarch_64.cpp @@ -0,0 +1,346 @@ +/* + * Copyright (c) 1999, 2021, Oracle and/or its affiliates. All rights reserved. @@ -15619,125 +16528,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +#endif +} +#endif // ifndef PRODUCT -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/c1_MacroAssembler_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/c1_MacroAssembler_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/c1_MacroAssembler_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/c1_MacroAssembler_loongarch.hpp 2023-12-20 09:23:19.784814696 +0800 -@@ -0,0 +1,112 @@ -+/* -+ * Copyright (c) 1999, 2021, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2021, Loongson Technology. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ * -+ */ -+ -+#ifndef CPU_LOONGARCH_C1_MACROASSEMBLER_LOONGARCH_HPP -+#define CPU_LOONGARCH_C1_MACROASSEMBLER_LOONGARCH_HPP -+ -+using MacroAssembler::build_frame; -+using MacroAssembler::null_check; -+ -+// C1_MacroAssembler contains high-level macros for C1 -+ -+ private: -+ int _rsp_offset; // track rsp changes -+ // initialization -+ void pd_init() { _rsp_offset = 0; } -+ -+ public: -+ void try_allocate( -+ Register obj, // result: pointer to object after successful allocation -+ Register var_size_in_bytes, // object size in bytes if unknown at compile time; invalid otherwise -+ int con_size_in_bytes, // object size in bytes if known at compile time -+ Register t1, // temp register -+ Register t2, // temp register -+ Label& slow_case // continuation point if fast allocation fails -+ ); -+ -+ void initialize_header(Register obj, Register klass, Register len, Register t1, Register t2); -+ void initialize_body(Register obj, Register len_in_bytes, int hdr_size_in_bytes, Register t1, Register t2); -+ -+ // locking -+ // hdr : must be A0, contents destroyed -+ // obj : must point to the object to lock, contents preserved -+ // disp_hdr: must point to the displaced header location, contents preserved -+ // scratch : scratch register, contents destroyed -+ // returns code offset at which to add null check debug information -+ int lock_object (Register swap, Register obj, Register disp_hdr, Register scratch, Label& slow_case); -+ -+ // unlocking -+ // hdr : contents destroyed -+ // obj : must point to the object to lock, contents preserved -+ // disp_hdr: must be A0 & must point to the displaced header location, contents destroyed -+ void unlock_object(Register swap, Register obj, Register lock, Label& slow_case); -+ -+ void initialize_object( -+ Register obj, // result: pointer to object after successful allocation -+ Register klass, // object klass -+ Register var_size_in_bytes, // object size in bytes if unknown at compile time; invalid otherwise -+ int con_size_in_bytes, // object size in bytes if known at compile time -+ Register t1, // temp register -+ Register t2, // temp register -+ bool is_tlab_allocated // the object was allocated in a TLAB; relevant for the implementation of ZeroTLAB -+ ); -+ -+ // allocation of fixed-size objects -+ // (can also be used to allocate fixed-size arrays, by setting -+ // hdr_size correctly and storing the array length afterwards) -+ // obj : will contain pointer to allocated object -+ // t1, t2 : scratch registers - contents destroyed -+ // header_size: size of object header in words -+ // object_size: total size of object in words -+ // slow_case : exit to slow case implementation if fast allocation fails -+ void allocate_object(Register obj, Register t1, Register t2, int header_size, -+ int object_size, Register klass, Label& slow_case); -+ -+ enum { -+ max_array_allocation_length = 0x00FFFFFF -+ }; -+ -+ // allocation of arrays -+ // obj : will contain pointer to allocated object -+ // len : array length in number of elements -+ // t : scratch register - contents destroyed -+ // header_size: size of object header in words -+ // f : element scale factor -+ // slow_case : exit to slow case implementation if fast allocation fails -+ void allocate_array(Register obj, Register len, Register t, Register t2, int header_size, -+ int f, Register klass, Label& slow_case); -+ -+ int rsp_offset() const { return _rsp_offset; } -+ void set_rsp_offset(int n) { _rsp_offset = n; } -+ -+ void invalidate_registers(bool inv_a0, bool inv_s0, bool inv_a2, bool inv_a3, -+ bool inv_a4, bool inv_a5) PRODUCT_RETURN; -+ -+ // This platform only uses signal-based null checks. The Label is not needed. -+ void null_check(Register r, Label *Lnull = NULL) { MacroAssembler::null_check(r); } -+ -+ void load_parameter(int offset_in_words, Register reg); -+ -+#endif // CPU_LOONGARCH_C1_MACROASSEMBLER_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/c1_Runtime1_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/c1_Runtime1_loongarch_64.cpp ---- a/hotspot/src/cpu/loongarch/vm/c1_Runtime1_loongarch_64.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/c1_Runtime1_loongarch_64.cpp 2023-12-20 09:23:19.784814696 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/c1_Runtime1_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/c1_Runtime1_loongarch_64.cpp +new file mode 100644 +index 00000000..a750dca3 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/c1_Runtime1_loongarch_64.cpp @@ -0,0 +1,1252 @@ +/* + * Copyright (c) 1999, 2021, Oracle and/or its affiliates. All rights reserved. @@ -16991,9 +17786,86 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + Unimplemented(); + return 0; +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/c2_globals_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/c2_globals_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/c2_globals_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/c2_globals_loongarch.hpp 2023-12-20 09:23:19.788147991 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/c1_globals_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/c1_globals_loongarch.hpp +new file mode 100644 +index 00000000..df052a05 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/c1_globals_loongarch.hpp +@@ -0,0 +1,69 @@ ++/* ++ * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2021, Loongson Technology. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ */ ++ ++#ifndef CPU_LOONGARCH_C1_GLOBALS_LOONGARCH_HPP ++#define CPU_LOONGARCH_C1_GLOBALS_LOONGARCH_HPP ++ ++#include "utilities/globalDefinitions.hpp" ++#include "utilities/macros.hpp" ++ ++// Sets the default values for platform dependent flags used by the client compiler. ++// (see c1_globals.hpp) ++ ++#ifndef COMPILER2 ++define_pd_global(bool, BackgroundCompilation, true ); ++define_pd_global(bool, InlineIntrinsics, true ); ++define_pd_global(bool, PreferInterpreterNativeStubs, false); ++define_pd_global(bool, ProfileTraps, false); ++define_pd_global(bool, UseOnStackReplacement, true ); ++define_pd_global(bool, TieredCompilation, false); ++define_pd_global(intx, CompileThreshold, 1500 ); ++ ++define_pd_global(intx, OnStackReplacePercentage, 933 ); ++define_pd_global(intx, NewSizeThreadIncrease, 4*K ); ++define_pd_global(intx, InitialCodeCacheSize, 160*K); ++define_pd_global(intx, ReservedCodeCacheSize, 32*M ); ++define_pd_global(intx, NonProfiledCodeHeapSize, 13*M ); ++define_pd_global(intx, ProfiledCodeHeapSize, 14*M ); ++define_pd_global(intx, NonNMethodCodeHeapSize, 5*M ); ++define_pd_global(bool, ProfileInterpreter, false); ++define_pd_global(intx, CodeCacheExpansionSize, 32*K ); ++define_pd_global(uintx, CodeCacheMinBlockLength, 1); ++define_pd_global(uintx, CodeCacheMinimumUseSpace, 400*K); ++define_pd_global(bool, NeverActAsServerClassMachine, true ); ++define_pd_global(uint64_t,MaxRAM, 1ULL*G); ++define_pd_global(bool, CICompileOSR, true ); ++#endif // !COMPILER2 ++define_pd_global(bool, UseTypeProfile, false); ++define_pd_global(bool, RoundFPResults, true ); ++ ++define_pd_global(bool, LIRFillDelaySlots, false); ++define_pd_global(bool, OptimizeSinglePrecision, true ); ++define_pd_global(bool, CSEArrayLength, false); ++define_pd_global(bool, TwoOperandLIRForm, false ); ++ ++define_pd_global(intx, SafepointPollOffset, 0 ); ++ ++#endif // CPU_LOONGARCH_C1_GLOBALS_LOONGARCH_HPP +diff --git a/hotspot/src/cpu/loongarch/vm/c2_globals_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/c2_globals_loongarch.hpp +new file mode 100644 +index 00000000..044b0d25 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/c2_globals_loongarch.hpp @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. @@ -17082,9 +17954,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +define_pd_global(bool, NeverActAsServerClassMachine, false); + +#endif // CPU_LOONGARCH_VM_C2_GLOBALS_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/c2_init_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/c2_init_loongarch.cpp ---- a/hotspot/src/cpu/loongarch/vm/c2_init_loongarch.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/c2_init_loongarch.cpp 2023-12-20 09:23:19.788147991 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/c2_init_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/c2_init_loongarch.cpp +new file mode 100644 +index 00000000..c7bf590b +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/c2_init_loongarch.cpp @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. @@ -17120,9 +17994,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +void Compile::pd_compiler2_init() { + guarantee(CodeEntryAlignment >= InteriorEntryAlignment, "" ); +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/codeBuffer_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/codeBuffer_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/codeBuffer_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/codeBuffer_loongarch.hpp 2023-12-20 09:23:19.788147991 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/codeBuffer_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/codeBuffer_loongarch.hpp +new file mode 100644 +index 00000000..652f6c10 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/codeBuffer_loongarch.hpp @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. @@ -17159,9 +18035,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + void flush_bundle(bool start_new_bundle) {} + +#endif // CPU_LOONGARCH_VM_CODEBUFFER_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/compiledIC_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/compiledIC_loongarch.cpp ---- a/hotspot/src/cpu/loongarch/vm/compiledIC_loongarch.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/compiledIC_loongarch.cpp 2023-12-20 09:23:19.788147991 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/compiledIC_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/compiledIC_loongarch.cpp +new file mode 100644 +index 00000000..70a47fc7 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/compiledIC_loongarch.cpp @@ -0,0 +1,167 @@ +/* + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. @@ -17330,9 +18208,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +} + +#endif // !PRODUCT -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/copy_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/copy_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/copy_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/copy_loongarch.hpp 2024-01-30 13:54:24.776042456 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/copy_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/copy_loongarch.hpp +new file mode 100644 +index 00000000..cb655401 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/copy_loongarch.hpp @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. @@ -17424,9 +18304,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +} + +#endif //CPU_LOONGARCH_VM_COPY_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/cppInterpreterGenerator_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/cppInterpreterGenerator_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/cppInterpreterGenerator_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/cppInterpreterGenerator_loongarch.hpp 2023-12-20 09:23:19.788147991 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/cppInterpreterGenerator_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/cppInterpreterGenerator_loongarch.hpp +new file mode 100644 +index 00000000..45d86f5b +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/cppInterpreterGenerator_loongarch.hpp @@ -0,0 +1,53 @@ +/* + * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. @@ -17481,9 +18363,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + bool native); // C++ interpreter only + +#endif // CPU_LOONGARCH_VM_CPPINTERPRETERGENERATOR_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/cppInterpreter_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/cppInterpreter_loongarch.cpp ---- a/hotspot/src/cpu/loongarch/vm/cppInterpreter_loongarch.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/cppInterpreter_loongarch.cpp 2023-12-20 09:23:19.788147991 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/cppInterpreter_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/cppInterpreter_loongarch.cpp +new file mode 100644 +index 00000000..d6c0df3b +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/cppInterpreter_loongarch.cpp @@ -0,0 +1,215 @@ +/* + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. @@ -17700,9 +18584,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +} + +#endif // CC_INTERP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/debug_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/debug_loongarch.cpp ---- a/hotspot/src/cpu/loongarch/vm/debug_loongarch.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/debug_loongarch.cpp 2023-12-20 09:23:19.788147991 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/debug_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/debug_loongarch.cpp +new file mode 100644 +index 00000000..50de0365 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/debug_loongarch.cpp @@ -0,0 +1,51 @@ +/* + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. @@ -17755,9 +18641,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +void pd_obfuscate_location(char *buf,int buflen) {} + +#endif // PRODUCT -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/depChecker_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/depChecker_loongarch.cpp ---- a/hotspot/src/cpu/loongarch/vm/depChecker_loongarch.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/depChecker_loongarch.cpp 2023-12-20 09:23:19.788147991 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/depChecker_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/depChecker_loongarch.cpp +new file mode 100644 +index 00000000..62478be3 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/depChecker_loongarch.cpp @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. @@ -17789,9 +18677,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +#include "depChecker_loongarch.hpp" + +// Nothing to do on LoongArch -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/depChecker_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/depChecker_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/depChecker_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/depChecker_loongarch.hpp 2023-12-20 09:23:19.788147991 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/depChecker_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/depChecker_loongarch.hpp +new file mode 100644 +index 00000000..598be0ee +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/depChecker_loongarch.hpp @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. @@ -17824,9 +18714,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +// Nothing to do on LoongArch + +#endif // CPU_LOONGARCH_VM_DEPCHECKER_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/disassembler_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/disassembler_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/disassembler_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/disassembler_loongarch.hpp 2023-12-20 09:23:19.788147991 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/disassembler_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/disassembler_loongarch.hpp +new file mode 100644 +index 00000000..ccd89e8d +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/disassembler_loongarch.hpp @@ -0,0 +1,37 @@ +/* + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. @@ -17865,9 +18757,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + } + +#endif // CPU_LOONGARCH_VM_DISASSEMBLER_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/frame_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/frame_loongarch.cpp ---- a/hotspot/src/cpu/loongarch/vm/frame_loongarch.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/frame_loongarch.cpp 2023-12-20 09:23:19.788147991 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/frame_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/frame_loongarch.cpp +new file mode 100644 +index 00000000..0f50a571 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/frame_loongarch.cpp @@ -0,0 +1,711 @@ +/* + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. @@ -18580,9 +19474,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + init((intptr_t*)sp, (intptr_t*)fp, (address)pc); +} +#endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/frame_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/frame_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/frame_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/frame_loongarch.hpp 2023-12-20 09:23:19.788147991 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/frame_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/frame_loongarch.hpp +new file mode 100644 +index 00000000..964026e6 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/frame_loongarch.hpp @@ -0,0 +1,229 @@ +/* + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. @@ -18813,9 +19709,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +#endif // CC_INTERP + +#endif // CPU_LOONGARCH_VM_FRAME_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/frame_loongarch.inline.hpp b/hotspot/src/cpu/loongarch/vm/frame_loongarch.inline.hpp ---- a/hotspot/src/cpu/loongarch/vm/frame_loongarch.inline.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/frame_loongarch.inline.hpp 2023-12-20 09:23:19.788147991 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/frame_loongarch.inline.hpp b/hotspot/src/cpu/loongarch/vm/frame_loongarch.inline.hpp +new file mode 100644 +index 00000000..3d22339a +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/frame_loongarch.inline.hpp @@ -0,0 +1,312 @@ +/* + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. @@ -19129,9 +20027,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +} + +#endif // CPU_LOONGARCH_VM_FRAME_LOONGARCH_INLINE_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/globalDefinitions_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/globalDefinitions_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/globalDefinitions_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/globalDefinitions_loongarch.hpp 2023-12-20 09:23:19.788147991 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/globalDefinitions_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/globalDefinitions_loongarch.hpp +new file mode 100644 +index 00000000..f9f93b9e +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/globalDefinitions_loongarch.hpp @@ -0,0 +1,41 @@ +/* + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. @@ -19174,9 +20074,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +#define SUPPORTS_NATIVE_CX8 + +#endif // CPU_LOONGARCH_VM_GLOBALDEFINITIONS_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/globals_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/globals_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/globals_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/globals_loongarch.hpp 2023-12-20 09:23:19.788147991 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/globals_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/globals_loongarch.hpp +new file mode 100644 +index 00000000..182be608 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/globals_loongarch.hpp @@ -0,0 +1,103 @@ +/* + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. @@ -19281,12 +20183,14 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + "Eliminate barriers for single active cpu") + +#endif // CPU_LOONGARCH_VM_GLOBALS_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/icache_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/icache_loongarch.cpp ---- a/hotspot/src/cpu/loongarch/vm/icache_loongarch.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/icache_loongarch.cpp 2023-12-20 09:23:19.788147991 +0800 -@@ -0,0 +1,42 @@ +diff --git a/hotspot/src/cpu/loongarch/vm/icBuffer_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/icBuffer_loongarch.cpp +new file mode 100644 +index 00000000..8c782253 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/icBuffer_loongarch.cpp +@@ -0,0 +1,101 @@ +/* -+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2021, Loongson Technology. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * @@ -19312,25 +20216,86 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + +#include "precompiled.hpp" +#include "asm/macroAssembler.hpp" -+#include "runtime/icache.hpp" ++#include "asm/macroAssembler.inline.hpp" ++#include "code/icBuffer.hpp" ++#include "gc_interface/collectedHeap.inline.hpp" ++#include "interpreter/bytecodes.hpp" ++#include "memory/resourceArea.hpp" ++#include "nativeInst_loongarch.hpp" ++#include "oops/oop.inline.hpp" ++#include "oops/oop.inline2.hpp" + -+void ICacheStubGenerator::generate_icache_flush(ICache::flush_icache_stub_t* flush_icache_stub) -+{ -+#define __ _masm-> -+ StubCodeMark mark(this, "ICache", "flush_icache_stub"); -+ address start = __ pc(); ++#define A0 RA0 ++#define A1 RA1 ++#define A2 RA2 ++#define A3 RA3 ++#define A4 RA4 ++#define A5 RA5 ++#define A6 RA6 ++#define A7 RA7 ++#define T0 RT0 ++#define T1 RT1 ++#define T2 RT2 ++#define T3 RT3 ++#define T4 RT4 ++#define T5 RT5 ++#define T6 RT6 ++#define T7 RT7 ++#define T8 RT8 + -+ __ ibar(0); -+ __ ori(V0, RA2, 0); -+ __ jr(RA); ++int InlineCacheBuffer::ic_stub_code_size() { ++ return NativeMovConstReg::instruction_size + ++ NativeGeneralJump::instruction_size + ++ 1; ++ // so that code_end can be set in CodeBuffer ++ // 64bit 15 = 6 + 8 bytes + 1 byte ++ // 32bit 7 = 2 + 4 bytes + 1 byte ++} + -+ *flush_icache_stub = (ICache::flush_icache_stub_t)start; ++ ++// we use T1 as cached oop(klass) now. this is the target of virtual call, ++// when reach here, the receiver in T0 ++// refer to shareRuntime_loongarch.cpp,gen_i2c2i_adapters ++void InlineCacheBuffer::assemble_ic_buffer_code(address code_begin, void* cached_value, ++ address entry_point) { ++ ResourceMark rm; ++ CodeBuffer code(code_begin, ic_stub_code_size()); ++ MacroAssembler* masm = new MacroAssembler(&code); ++ // note: even though the code contains an embedded oop, we do not need reloc info ++ // because ++ // (1) the oop is old (i.e., doesn't matter for scavenges) ++ // (2) these ICStubs are removed *before* a GC happens, so the roots disappear ++ // assert(cached_oop == NULL || cached_oop->is_perm(), "must be perm oop"); ++#define __ masm-> ++ __ patchable_li52(T1, (long)cached_value); ++ // TODO: confirm reloc ++ __ jmp(entry_point, relocInfo::runtime_call_type); ++ __ flush(); +#undef __ +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/icache_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/icache_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/icache_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/icache_loongarch.hpp 2023-12-20 09:23:19.788147991 +0800 -@@ -0,0 +1,41 @@ ++ ++ ++address InlineCacheBuffer::ic_buffer_entry_point(address code_begin) { ++ NativeMovConstReg* move = nativeMovConstReg_at(code_begin); // creation also verifies the object ++ NativeGeneralJump* jump = nativeGeneralJump_at(move->next_instruction_address()); ++ return jump->jump_destination(); ++} ++ ++ ++void* InlineCacheBuffer::ic_buffer_cached_value(address code_begin) { ++ // creation also verifies the object ++ NativeMovConstReg* move = nativeMovConstReg_at(code_begin); ++ // Verifies the jump ++ NativeGeneralJump* jump = nativeGeneralJump_at(move->next_instruction_address()); ++ void* o= (void*)move->data(); ++ return o; ++} +diff --git a/hotspot/src/cpu/loongarch/vm/icache_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/icache_loongarch.cpp +new file mode 100644 +index 00000000..d577e41f +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/icache_loongarch.cpp +@@ -0,0 +1,42 @@ +/* + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2021, Loongson Technology. All rights reserved. @@ -19356,28 +20321,31 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + * + */ + -+#ifndef CPU_LOONGARCH_VM_ICACHE_LOONGARCH_HPP -+#define CPU_LOONGARCH_VM_ICACHE_LOONGARCH_HPP ++#include "precompiled.hpp" ++#include "asm/macroAssembler.hpp" ++#include "runtime/icache.hpp" + -+// Interface for updating the instruction cache. Whenever the VM modifies -+// code, part of the processor instruction cache potentially has to be flushed. ++void ICacheStubGenerator::generate_icache_flush(ICache::flush_icache_stub_t* flush_icache_stub) ++{ ++#define __ _masm-> ++ StubCodeMark mark(this, "ICache", "flush_icache_stub"); ++ address start = __ pc(); + -+class ICache : public AbstractICache { -+ public: -+ enum { -+ stub_size = 3 * BytesPerInstWord, // Size of the icache flush stub in bytes -+ line_size = 32, // flush instruction affects a dword -+ log2_line_size = 5 // log2(line_size) -+ }; -+}; ++ __ ibar(0); ++ __ ori(V0, RA2, 0); ++ __ jr(RA); + -+#endif // CPU_LOONGARCH_VM_ICACHE_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/icBuffer_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/icBuffer_loongarch.cpp ---- a/hotspot/src/cpu/loongarch/vm/icBuffer_loongarch.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/icBuffer_loongarch.cpp 2023-12-20 09:23:19.788147991 +0800 -@@ -0,0 +1,101 @@ ++ *flush_icache_stub = (ICache::flush_icache_stub_t)start; ++#undef __ ++} +diff --git a/hotspot/src/cpu/loongarch/vm/icache_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/icache_loongarch.hpp +new file mode 100644 +index 00000000..15e45cb3 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/icache_loongarch.hpp +@@ -0,0 +1,41 @@ +/* -+ * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2021, Loongson Technology. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * @@ -19401,85 +20369,27 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + * + */ + -+#include "precompiled.hpp" -+#include "asm/macroAssembler.hpp" -+#include "asm/macroAssembler.inline.hpp" -+#include "code/icBuffer.hpp" -+#include "gc_interface/collectedHeap.inline.hpp" -+#include "interpreter/bytecodes.hpp" -+#include "memory/resourceArea.hpp" -+#include "nativeInst_loongarch.hpp" -+#include "oops/oop.inline.hpp" -+#include "oops/oop.inline2.hpp" -+ -+#define A0 RA0 -+#define A1 RA1 -+#define A2 RA2 -+#define A3 RA3 -+#define A4 RA4 -+#define A5 RA5 -+#define A6 RA6 -+#define A7 RA7 -+#define T0 RT0 -+#define T1 RT1 -+#define T2 RT2 -+#define T3 RT3 -+#define T4 RT4 -+#define T5 RT5 -+#define T6 RT6 -+#define T7 RT7 -+#define T8 RT8 -+ -+int InlineCacheBuffer::ic_stub_code_size() { -+ return NativeMovConstReg::instruction_size + -+ NativeGeneralJump::instruction_size + -+ 1; -+ // so that code_end can be set in CodeBuffer -+ // 64bit 15 = 6 + 8 bytes + 1 byte -+ // 32bit 7 = 2 + 4 bytes + 1 byte -+} -+ -+ -+// we use T1 as cached oop(klass) now. this is the target of virtual call, -+// when reach here, the receiver in T0 -+// refer to shareRuntime_loongarch.cpp,gen_i2c2i_adapters -+void InlineCacheBuffer::assemble_ic_buffer_code(address code_begin, void* cached_value, -+ address entry_point) { -+ ResourceMark rm; -+ CodeBuffer code(code_begin, ic_stub_code_size()); -+ MacroAssembler* masm = new MacroAssembler(&code); -+ // note: even though the code contains an embedded oop, we do not need reloc info -+ // because -+ // (1) the oop is old (i.e., doesn't matter for scavenges) -+ // (2) these ICStubs are removed *before* a GC happens, so the roots disappear -+ // assert(cached_oop == NULL || cached_oop->is_perm(), "must be perm oop"); -+#define __ masm-> -+ __ patchable_li52(T1, (long)cached_value); -+ // TODO: confirm reloc -+ __ jmp(entry_point, relocInfo::runtime_call_type); -+ __ flush(); -+#undef __ -+} -+ ++#ifndef CPU_LOONGARCH_VM_ICACHE_LOONGARCH_HPP ++#define CPU_LOONGARCH_VM_ICACHE_LOONGARCH_HPP + -+address InlineCacheBuffer::ic_buffer_entry_point(address code_begin) { -+ NativeMovConstReg* move = nativeMovConstReg_at(code_begin); // creation also verifies the object -+ NativeGeneralJump* jump = nativeGeneralJump_at(move->next_instruction_address()); -+ return jump->jump_destination(); -+} ++// Interface for updating the instruction cache. Whenever the VM modifies ++// code, part of the processor instruction cache potentially has to be flushed. + ++class ICache : public AbstractICache { ++ public: ++ enum { ++ stub_size = 3 * BytesPerInstWord, // Size of the icache flush stub in bytes ++ line_size = 32, // flush instruction affects a dword ++ log2_line_size = 5 // log2(line_size) ++ }; ++}; + -+void* InlineCacheBuffer::ic_buffer_cached_value(address code_begin) { -+ // creation also verifies the object -+ NativeMovConstReg* move = nativeMovConstReg_at(code_begin); -+ // Verifies the jump -+ NativeGeneralJump* jump = nativeGeneralJump_at(move->next_instruction_address()); -+ void* o= (void*)move->data(); -+ return o; -+} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/interp_masm_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/interp_masm_loongarch_64.cpp ---- a/hotspot/src/cpu/loongarch/vm/interp_masm_loongarch_64.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/interp_masm_loongarch_64.cpp 2023-12-20 09:23:19.788147991 +0800 ++#endif // CPU_LOONGARCH_VM_ICACHE_LOONGARCH_HPP +diff --git a/hotspot/src/cpu/loongarch/vm/interp_masm_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/interp_masm_loongarch_64.cpp +new file mode 100644 +index 00000000..8c84f215 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/interp_masm_loongarch_64.cpp @@ -0,0 +1,1960 @@ +/* + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. @@ -21441,9 +22351,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + unimplemented(); + } +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/interp_masm_loongarch_64.hpp b/hotspot/src/cpu/loongarch/vm/interp_masm_loongarch_64.hpp ---- a/hotspot/src/cpu/loongarch/vm/interp_masm_loongarch_64.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/interp_masm_loongarch_64.hpp 2023-12-20 09:23:19.788147991 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/interp_masm_loongarch_64.hpp b/hotspot/src/cpu/loongarch/vm/interp_masm_loongarch_64.hpp +new file mode 100644 +index 00000000..9113da54 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/interp_masm_loongarch_64.hpp @@ -0,0 +1,269 @@ +/* + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. @@ -21714,9 +22626,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +}; + +#endif // CPU_LOONGARCH_VM_INTERP_MASM_LOONGARCH_64_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/interpreterGenerator_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/interpreterGenerator_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/interpreterGenerator_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/interpreterGenerator_loongarch.hpp 2023-12-20 09:23:19.788147991 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/interpreterGenerator_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/interpreterGenerator_loongarch.hpp +new file mode 100644 +index 00000000..7f253b2d +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/interpreterGenerator_loongarch.hpp @@ -0,0 +1,51 @@ +/* + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. @@ -21769,13 +22683,15 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + void generate_counter_overflow(Label* do_continue); + +#endif // CPU_LOONGARCH_VM_INTERPRETERGENERATOR_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/interpreter_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/interpreter_loongarch_64.cpp ---- a/hotspot/src/cpu/loongarch/vm/interpreter_loongarch_64.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/interpreter_loongarch_64.cpp 2023-12-20 09:23:19.788147991 +0800 -@@ -0,0 +1,277 @@ +diff --git a/hotspot/src/cpu/loongarch/vm/interpreterRT_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/interpreterRT_loongarch.hpp +new file mode 100644 +index 00000000..052eb997 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/interpreterRT_loongarch.hpp +@@ -0,0 +1,66 @@ +/* -+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2022, Loongson Technology. All rights reserved. ++ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2015, 2021, Loongson Technology. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it @@ -21798,319 +22714,56 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + * + */ + -+#include "precompiled.hpp" -+#include "asm/macroAssembler.hpp" -+#include "interpreter/bytecodeHistogram.hpp" -+#include "interpreter/interpreter.hpp" -+#include "interpreter/interpreterGenerator.hpp" -+#include "interpreter/interpreterRuntime.hpp" -+#include "interpreter/templateTable.hpp" -+#include "oops/arrayOop.hpp" -+#include "oops/methodData.hpp" -+#include "oops/method.hpp" -+#include "oops/oop.inline.hpp" -+#include "prims/jvmtiExport.hpp" -+#include "prims/jvmtiThreadState.hpp" -+#include "prims/methodHandles.hpp" -+#include "runtime/arguments.hpp" -+#include "runtime/deoptimization.hpp" -+#include "runtime/frame.inline.hpp" -+#include "runtime/sharedRuntime.hpp" -+#include "runtime/stubRoutines.hpp" -+#include "runtime/synchronizer.hpp" -+#include "runtime/timer.hpp" -+#include "runtime/vframeArray.hpp" -+#include "utilities/debug.hpp" -+ -+#define __ _masm-> -+ -+#define A0 RA0 -+#define A1 RA1 -+#define A2 RA2 -+#define A3 RA3 -+#define A4 RA4 -+#define A5 RA5 -+#define A6 RA6 -+#define A7 RA7 -+#define T0 RT0 -+#define T1 RT1 -+#define T2 RT2 -+#define T3 RT3 -+#define T4 RT4 -+#define T5 RT5 -+#define T6 RT6 -+#define T7 RT7 -+#define T8 RT8 -+ -+address AbstractInterpreterGenerator::generate_slow_signature_handler() { -+ address entry = __ pc(); -+ // Rmethod: method -+ // LVP: pointer to locals -+ // A3: first stack arg -+ __ move(A3, SP); -+ __ addi_d(SP, SP, -18 * wordSize); -+ __ st_d(RA, SP, 0); -+ __ call_VM(noreg, -+ CAST_FROM_FN_PTR(address, -+ InterpreterRuntime::slow_signature_handler), -+ Rmethod, LVP, A3); -+ -+ // V0: result handler -+ -+ // Stack layout: -+ // ... -+ // 18 stack arg0 <--- old sp -+ // 17 floatReg arg7 -+ // ... -+ // 10 floatReg arg0 -+ // 9 float/double identifiers -+ // 8 IntReg arg7 -+ // ... -+ // 2 IntReg arg1 -+ // 1 aligned slot -+ // SP: 0 return address -+ -+ // Do FP first so we can use A3 as temp -+ __ ld_d(A3, Address(SP, 9 * wordSize)); // float/double identifiers -+ -+ for (int i= 0; i < Argument::n_float_register_parameters; i++) { -+ FloatRegister floatreg = as_FloatRegister(i + FA0->encoding()); -+ Label isdouble, done; -+ -+ __ andi(AT, A3, 1 << i); -+ __ bnez(AT, isdouble); -+ __ fld_s(floatreg, SP, (10 + i) * wordSize); -+ __ b(done); -+ __ bind(isdouble); -+ __ fld_d(floatreg, SP, (10 + i) * wordSize); -+ __ bind(done); -+ } -+ -+ // A0 is for env. -+ // If the mothed is not static, A1 will be corrected in generate_native_entry. -+ for (int i= 1; i < Argument::n_register_parameters; i++) { -+ Register reg = as_Register(i + A0->encoding()); -+ -+ __ ld_d(reg, SP, (1 + i) * wordSize); -+ } -+ -+ // A0/V0 contains the result from the call of -+ // InterpreterRuntime::slow_signature_handler so we don't touch it -+ // here. It will be loaded with the JNIEnv* later. -+ __ ld_d(RA, SP, 0); -+ __ addi_d(SP, SP, 18 * wordSize); -+ __ jr(RA); -+ return entry; -+} -+ -+ -+// -+// Various method entries -+// -+ -+address InterpreterGenerator::generate_math_entry(AbstractInterpreter::MethodKind kind) { -+ -+ // Rmethod: methodOop -+ // V0: scratrch -+ // Rsender: send 's sp -+ -+ if (!InlineIntrinsics) return NULL; // Generate a vanilla entry ++#ifndef CPU_LOONGARCH_VM_INTERPRETERRT_LOONGARCH_HPP ++#define CPU_LOONGARCH_VM_INTERPRETERRT_LOONGARCH_HPP + -+ address entry_point = __ pc(); -+ //guarantee(0, "LA not implemented yet"); -+ // These don't need a safepoint check because they aren't virtually -+ // callable. We won't enter these intrinsics from compiled code. -+ // If in the future we added an intrinsic which was virtually callable -+ // we'd have to worry about how to safepoint so that this code is used. ++#include "memory/allocation.hpp" + -+ // mathematical functions inlined by compiler -+ // (interpreter must provide identical implementation -+ // in order to avoid monotonicity bugs when switching -+ // from interpreter to compiler in the middle of some -+ // computation) -+ // -+ // stack: [ lo(arg) ] <-- sp -+ // [ hi(arg) ] -+ { -+ // Note: For JDK 1.3 StrictMath exists and Math.sin/cos/sqrt are -+ // java methods. Interpreter::method_kind(...) will select -+ // this entry point for the corresponding methods in JDK 1.3. -+ __ fld_d(FA0, SP, 0 * wordSize); -+ __ fld_d(FA1, SP, 1 * wordSize); -+ __ push2(RA, FP); -+ __ addi_d(FP, SP, 2 * wordSize); ++// native method calls + -+ // [ fp ] <-- sp -+ // [ ra ] -+ // [ lo ] <-- fp -+ // [ hi ] -+ //FIXME, need consider this -+ switch (kind) { -+ case Interpreter::java_lang_math_sin : -+ __ trigfunc('s'); -+ break; -+ case Interpreter::java_lang_math_cos : -+ __ trigfunc('c'); -+ break; -+ case Interpreter::java_lang_math_tan : -+ __ trigfunc('t'); -+ break; -+ case Interpreter::java_lang_math_sqrt: -+ __ fsqrt_d(F0, FA0); -+ break; -+ case Interpreter::java_lang_math_abs: -+ __ fabs_d(F0, FA0); -+ break; -+ case Interpreter::java_lang_math_log: -+ // Store to stack to convert 80bit precision back to 64bits -+ break; -+ case Interpreter::java_lang_math_log10: -+ // Store to stack to convert 80bit precision back to 64bits -+ break; -+ case Interpreter::java_lang_math_pow: -+ break; -+ case Interpreter::java_lang_math_exp: -+ break; ++class SignatureHandlerGenerator: public NativeSignatureIterator { ++ private: ++ MacroAssembler* _masm; ++ unsigned int _num_fp_args; ++ unsigned int _num_int_args; ++ int _stack_offset; + -+ default : -+ ShouldNotReachHere(); -+ } ++ void move(int from_offset, int to_offset); ++ void box(int from_offset, int to_offset); ++ void pass_int(); ++ void pass_long(); ++ void pass_object(); ++ void pass_float(); ++ void pass_double(); + -+ // must maintain return value in F0:F1 -+ __ ld_d(RA, FP, (-1) * wordSize); -+ //FIXME -+ __ ld_d(FP, FP, (-2) * wordSize); -+ __ move(SP, Rsender); -+ __ jr(RA); ++ public: ++ // Creation ++ SignatureHandlerGenerator(methodHandle method, CodeBuffer* buffer) : NativeSignatureIterator(method) { ++ _masm = new MacroAssembler(buffer); ++ _num_int_args = (method->is_static() ? 1 : 0); ++ _num_fp_args = 0; ++ _stack_offset = 0; + } -+ return entry_point; -+} -+ -+ -+// Abstract method entry -+// Attempt to execute abstract method. Throw exception -+address InterpreterGenerator::generate_abstract_entry(void) { -+ -+ // Rmethod: methodOop -+ // V0: receiver (unused) -+ // Rsender : sender 's sp -+ address entry_point = __ pc(); -+ -+ // abstract method entry -+ // throw exception -+ // adjust stack to what a normal return would do -+ __ empty_expression_stack(); -+ __ restore_bcp(); -+ __ restore_locals(); -+ __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_AbstractMethodError)); -+ // the call_VM checks for exception, so we should never return here. -+ __ should_not_reach_here(); -+ -+ return entry_point; -+} -+ -+ -+// Empty method, generate a very fast return. + -+address InterpreterGenerator::generate_empty_entry(void) { -+ -+ // Rmethod: methodOop -+ // V0: receiver (unused) -+ // Rsender: sender 's sp, must set sp to this value on return, on LoongArch, now use T0, as it right? -+ if (!UseFastEmptyMethods) return NULL; -+ -+ address entry_point = __ pc(); -+ //TODO: LA -+ //guarantee(0, "LA not implemented yet"); -+ Label slow_path; -+ __ li(RT0, SafepointSynchronize::address_of_state()); -+ __ ld_w(AT, RT0, 0); -+ __ li(RT0, (SafepointSynchronize::_not_synchronized)); -+ __ bne(AT, RT0,slow_path); -+ __ move(SP, Rsender); -+ __ jr(RA); -+ __ bind(slow_path); -+ (void) generate_normal_entry(false); -+ return entry_point; -+ -+} -+ -+void Deoptimization::unwind_callee_save_values(frame* f, vframeArray* vframe_array) { -+ -+ // This code is sort of the equivalent of C2IAdapter::setup_stack_frame back in -+ // the days we had adapter frames. When we deoptimize a situation where a -+ // compiled caller calls a compiled caller will have registers it expects -+ // to survive the call to the callee. If we deoptimize the callee the only -+ // way we can restore these registers is to have the oldest interpreter -+ // frame that we create restore these values. That is what this routine -+ // will accomplish. ++ // Code generation ++ void generate(uint64_t fingerprint); + -+ // At the moment we have modified c2 to not have any callee save registers -+ // so this problem does not exist and this routine is just a place holder. ++ // Code generation support ++ static Register from(); ++ static Register to(); ++ static Register temp(); ++}; + -+ assert(f->is_interpreted_frame(), "must be interpreted"); -+} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/interpreter_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/interpreter_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/interpreter_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/interpreter_loongarch.hpp 2023-12-20 09:23:19.788147991 +0800 -@@ -0,0 +1,50 @@ ++#endif // CPU_LOONGARCH_VM_INTERPRETERRT_LOONGARCH_HPP +diff --git a/hotspot/src/cpu/loongarch/vm/interpreterRT_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/interpreterRT_loongarch_64.cpp +new file mode 100644 +index 00000000..0c9df4aa +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/interpreterRT_loongarch_64.cpp +@@ -0,0 +1,274 @@ +/* -+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2020, Loongson Technology. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ * -+ */ -+ -+#ifndef CPU_LOONGARCH_VM_INTERPRETER_LOONGARCH_HPP -+#define CPU_LOONGARCH_VM_INTERPRETER_LOONGARCH_HPP -+ -+ public: -+ -+ // Sentinel placed in the code for interpreter returns so -+ // that i2c adapters and osr code can recognize an interpreter -+ // return address and convert the return to a specialized -+ // block of code to handle compiedl return values and cleaning -+ // the fpu stack. -+ static const int return_sentinel; -+ -+ static Address::ScaleFactor stackElementScale() { -+ return Address::times_8; -+ } -+ -+ // Offset from sp (which points to the last stack element) -+ static int expr_offset_in_bytes(int i) { return stackElementSize * i; } -+ // Size of interpreter code. Increase if too small. Interpreter will -+ // fail with a guarantee ("not enough space for interpreter generation"); -+ // if too small. -+ // Run with +PrintInterpreterSize to get the VM to print out the size. -+ // Max size with JVMTI and TaggedStackInterpreter -+ const static int InterpreterCodeSize = 168 * 1024; -+#endif // CPU_LOONGARCH_VM_INTERPRETER_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/interpreterRT_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/interpreterRT_loongarch_64.cpp ---- a/hotspot/src/cpu/loongarch/vm/interpreterRT_loongarch_64.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/interpreterRT_loongarch_64.cpp 2023-12-20 09:23:19.788147991 +0800 -@@ -0,0 +1,274 @@ -+/* -+ * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2021, Loongson Technology. All rights reserved. ++ * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2015, 2021, Loongson Technology. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it @@ -22382,13 +23035,15 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + // return result handler + return Interpreter::result_handler(m->result_type()); +IRT_END -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/interpreterRT_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/interpreterRT_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/interpreterRT_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/interpreterRT_loongarch.hpp 2023-12-20 09:23:19.788147991 +0800 -@@ -0,0 +1,66 @@ +diff --git a/hotspot/src/cpu/loongarch/vm/interpreter_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/interpreter_loongarch.hpp +new file mode 100644 +index 00000000..c83afbda +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/interpreter_loongarch.hpp +@@ -0,0 +1,50 @@ +/* -+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2021, Loongson Technology. All rights reserved. ++ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2015, 2020, Loongson Technology. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it @@ -22411,50 +23066,319 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + * + */ + -+#ifndef CPU_LOONGARCH_VM_INTERPRETERRT_LOONGARCH_HPP -+#define CPU_LOONGARCH_VM_INTERPRETERRT_LOONGARCH_HPP ++#ifndef CPU_LOONGARCH_VM_INTERPRETER_LOONGARCH_HPP ++#define CPU_LOONGARCH_VM_INTERPRETER_LOONGARCH_HPP + -+#include "memory/allocation.hpp" ++ public: + -+// native method calls ++ // Sentinel placed in the code for interpreter returns so ++ // that i2c adapters and osr code can recognize an interpreter ++ // return address and convert the return to a specialized ++ // block of code to handle compiedl return values and cleaning ++ // the fpu stack. ++ static const int return_sentinel; + -+class SignatureHandlerGenerator: public NativeSignatureIterator { -+ private: -+ MacroAssembler* _masm; -+ unsigned int _num_fp_args; -+ unsigned int _num_int_args; -+ int _stack_offset; ++ static Address::ScaleFactor stackElementScale() { ++ return Address::times_8; ++ } + -+ void move(int from_offset, int to_offset); -+ void box(int from_offset, int to_offset); -+ void pass_int(); -+ void pass_long(); -+ void pass_object(); -+ void pass_float(); -+ void pass_double(); ++ // Offset from sp (which points to the last stack element) ++ static int expr_offset_in_bytes(int i) { return stackElementSize * i; } ++ // Size of interpreter code. Increase if too small. Interpreter will ++ // fail with a guarantee ("not enough space for interpreter generation"); ++ // if too small. ++ // Run with +PrintInterpreterSize to get the VM to print out the size. ++ // Max size with JVMTI and TaggedStackInterpreter ++ const static int InterpreterCodeSize = 168 * 1024; ++#endif // CPU_LOONGARCH_VM_INTERPRETER_LOONGARCH_HPP +diff --git a/hotspot/src/cpu/loongarch/vm/interpreter_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/interpreter_loongarch_64.cpp +new file mode 100644 +index 00000000..5a4f102c +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/interpreter_loongarch_64.cpp +@@ -0,0 +1,277 @@ ++/* ++ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2015, 2022, Loongson Technology. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ */ + -+ public: -+ // Creation -+ SignatureHandlerGenerator(methodHandle method, CodeBuffer* buffer) : NativeSignatureIterator(method) { -+ _masm = new MacroAssembler(buffer); -+ _num_int_args = (method->is_static() ? 1 : 0); -+ _num_fp_args = 0; -+ _stack_offset = 0; ++#include "precompiled.hpp" ++#include "asm/macroAssembler.hpp" ++#include "interpreter/bytecodeHistogram.hpp" ++#include "interpreter/interpreter.hpp" ++#include "interpreter/interpreterGenerator.hpp" ++#include "interpreter/interpreterRuntime.hpp" ++#include "interpreter/templateTable.hpp" ++#include "oops/arrayOop.hpp" ++#include "oops/methodData.hpp" ++#include "oops/method.hpp" ++#include "oops/oop.inline.hpp" ++#include "prims/jvmtiExport.hpp" ++#include "prims/jvmtiThreadState.hpp" ++#include "prims/methodHandles.hpp" ++#include "runtime/arguments.hpp" ++#include "runtime/deoptimization.hpp" ++#include "runtime/frame.inline.hpp" ++#include "runtime/sharedRuntime.hpp" ++#include "runtime/stubRoutines.hpp" ++#include "runtime/synchronizer.hpp" ++#include "runtime/timer.hpp" ++#include "runtime/vframeArray.hpp" ++#include "utilities/debug.hpp" ++ ++#define __ _masm-> ++ ++#define A0 RA0 ++#define A1 RA1 ++#define A2 RA2 ++#define A3 RA3 ++#define A4 RA4 ++#define A5 RA5 ++#define A6 RA6 ++#define A7 RA7 ++#define T0 RT0 ++#define T1 RT1 ++#define T2 RT2 ++#define T3 RT3 ++#define T4 RT4 ++#define T5 RT5 ++#define T6 RT6 ++#define T7 RT7 ++#define T8 RT8 ++ ++address AbstractInterpreterGenerator::generate_slow_signature_handler() { ++ address entry = __ pc(); ++ // Rmethod: method ++ // LVP: pointer to locals ++ // A3: first stack arg ++ __ move(A3, SP); ++ __ addi_d(SP, SP, -18 * wordSize); ++ __ st_d(RA, SP, 0); ++ __ call_VM(noreg, ++ CAST_FROM_FN_PTR(address, ++ InterpreterRuntime::slow_signature_handler), ++ Rmethod, LVP, A3); ++ ++ // V0: result handler ++ ++ // Stack layout: ++ // ... ++ // 18 stack arg0 <--- old sp ++ // 17 floatReg arg7 ++ // ... ++ // 10 floatReg arg0 ++ // 9 float/double identifiers ++ // 8 IntReg arg7 ++ // ... ++ // 2 IntReg arg1 ++ // 1 aligned slot ++ // SP: 0 return address ++ ++ // Do FP first so we can use A3 as temp ++ __ ld_d(A3, Address(SP, 9 * wordSize)); // float/double identifiers ++ ++ for (int i= 0; i < Argument::n_float_register_parameters; i++) { ++ FloatRegister floatreg = as_FloatRegister(i + FA0->encoding()); ++ Label isdouble, done; ++ ++ __ andi(AT, A3, 1 << i); ++ __ bnez(AT, isdouble); ++ __ fld_s(floatreg, SP, (10 + i) * wordSize); ++ __ b(done); ++ __ bind(isdouble); ++ __ fld_d(floatreg, SP, (10 + i) * wordSize); ++ __ bind(done); + } + -+ // Code generation -+ void generate(uint64_t fingerprint); ++ // A0 is for env. ++ // If the mothed is not static, A1 will be corrected in generate_native_entry. ++ for (int i= 1; i < Argument::n_register_parameters; i++) { ++ Register reg = as_Register(i + A0->encoding()); + -+ // Code generation support -+ static Register from(); -+ static Register to(); -+ static Register temp(); -+}; ++ __ ld_d(reg, SP, (1 + i) * wordSize); ++ } + -+#endif // CPU_LOONGARCH_VM_INTERPRETERRT_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/javaFrameAnchor_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/javaFrameAnchor_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/javaFrameAnchor_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/javaFrameAnchor_loongarch.hpp 2023-12-20 09:23:19.788147991 +0800 ++ // A0/V0 contains the result from the call of ++ // InterpreterRuntime::slow_signature_handler so we don't touch it ++ // here. It will be loaded with the JNIEnv* later. ++ __ ld_d(RA, SP, 0); ++ __ addi_d(SP, SP, 18 * wordSize); ++ __ jr(RA); ++ return entry; ++} ++ ++ ++// ++// Various method entries ++// ++ ++address InterpreterGenerator::generate_math_entry(AbstractInterpreter::MethodKind kind) { ++ ++ // Rmethod: methodOop ++ // V0: scratrch ++ // Rsender: send 's sp ++ ++ if (!InlineIntrinsics) return NULL; // Generate a vanilla entry ++ ++ address entry_point = __ pc(); ++ //guarantee(0, "LA not implemented yet"); ++ // These don't need a safepoint check because they aren't virtually ++ // callable. We won't enter these intrinsics from compiled code. ++ // If in the future we added an intrinsic which was virtually callable ++ // we'd have to worry about how to safepoint so that this code is used. ++ ++ // mathematical functions inlined by compiler ++ // (interpreter must provide identical implementation ++ // in order to avoid monotonicity bugs when switching ++ // from interpreter to compiler in the middle of some ++ // computation) ++ // ++ // stack: [ lo(arg) ] <-- sp ++ // [ hi(arg) ] ++ { ++ // Note: For JDK 1.3 StrictMath exists and Math.sin/cos/sqrt are ++ // java methods. Interpreter::method_kind(...) will select ++ // this entry point for the corresponding methods in JDK 1.3. ++ __ fld_d(FA0, SP, 0 * wordSize); ++ __ fld_d(FA1, SP, 1 * wordSize); ++ __ push2(RA, FP); ++ __ addi_d(FP, SP, 2 * wordSize); ++ ++ // [ fp ] <-- sp ++ // [ ra ] ++ // [ lo ] <-- fp ++ // [ hi ] ++ //FIXME, need consider this ++ switch (kind) { ++ case Interpreter::java_lang_math_sin : ++ __ trigfunc('s'); ++ break; ++ case Interpreter::java_lang_math_cos : ++ __ trigfunc('c'); ++ break; ++ case Interpreter::java_lang_math_tan : ++ __ trigfunc('t'); ++ break; ++ case Interpreter::java_lang_math_sqrt: ++ __ fsqrt_d(F0, FA0); ++ break; ++ case Interpreter::java_lang_math_abs: ++ __ fabs_d(F0, FA0); ++ break; ++ case Interpreter::java_lang_math_log: ++ // Store to stack to convert 80bit precision back to 64bits ++ break; ++ case Interpreter::java_lang_math_log10: ++ // Store to stack to convert 80bit precision back to 64bits ++ break; ++ case Interpreter::java_lang_math_pow: ++ break; ++ case Interpreter::java_lang_math_exp: ++ break; ++ ++ default : ++ ShouldNotReachHere(); ++ } ++ ++ // must maintain return value in F0:F1 ++ __ ld_d(RA, FP, (-1) * wordSize); ++ //FIXME ++ __ ld_d(FP, FP, (-2) * wordSize); ++ __ move(SP, Rsender); ++ __ jr(RA); ++ } ++ return entry_point; ++} ++ ++ ++// Abstract method entry ++// Attempt to execute abstract method. Throw exception ++address InterpreterGenerator::generate_abstract_entry(void) { ++ ++ // Rmethod: methodOop ++ // V0: receiver (unused) ++ // Rsender : sender 's sp ++ address entry_point = __ pc(); ++ ++ // abstract method entry ++ // throw exception ++ // adjust stack to what a normal return would do ++ __ empty_expression_stack(); ++ __ restore_bcp(); ++ __ restore_locals(); ++ __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_AbstractMethodError)); ++ // the call_VM checks for exception, so we should never return here. ++ __ should_not_reach_here(); ++ ++ return entry_point; ++} ++ ++ ++// Empty method, generate a very fast return. ++ ++address InterpreterGenerator::generate_empty_entry(void) { ++ ++ // Rmethod: methodOop ++ // V0: receiver (unused) ++ // Rsender: sender 's sp, must set sp to this value on return, on LoongArch, now use T0, as it right? ++ if (!UseFastEmptyMethods) return NULL; ++ ++ address entry_point = __ pc(); ++ //TODO: LA ++ //guarantee(0, "LA not implemented yet"); ++ Label slow_path; ++ __ li(RT0, SafepointSynchronize::address_of_state()); ++ __ ld_w(AT, RT0, 0); ++ __ li(RT0, (SafepointSynchronize::_not_synchronized)); ++ __ bne(AT, RT0,slow_path); ++ __ move(SP, Rsender); ++ __ jr(RA); ++ __ bind(slow_path); ++ (void) generate_normal_entry(false); ++ return entry_point; ++ ++} ++ ++void Deoptimization::unwind_callee_save_values(frame* f, vframeArray* vframe_array) { ++ ++ // This code is sort of the equivalent of C2IAdapter::setup_stack_frame back in ++ // the days we had adapter frames. When we deoptimize a situation where a ++ // compiled caller calls a compiled caller will have registers it expects ++ // to survive the call to the callee. If we deoptimize the callee the only ++ // way we can restore these registers is to have the oldest interpreter ++ // frame that we create restore these values. That is what this routine ++ // will accomplish. ++ ++ // At the moment we have modified c2 to not have any callee save registers ++ // so this problem does not exist and this routine is just a place holder. ++ ++ assert(f->is_interpreted_frame(), "must be interpreted"); ++} +diff --git a/hotspot/src/cpu/loongarch/vm/javaFrameAnchor_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/javaFrameAnchor_loongarch.hpp +new file mode 100644 +index 00000000..de97de58 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/javaFrameAnchor_loongarch.hpp @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. @@ -22543,9 +23467,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + void set_last_Java_fp(intptr_t* fp) { _last_Java_fp = fp; } + +#endif // CPU_LOONGARCH_VM_JAVAFRAMEANCHOR_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/jniFastGetField_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/jniFastGetField_loongarch_64.cpp ---- a/hotspot/src/cpu/loongarch/vm/jniFastGetField_loongarch_64.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/jniFastGetField_loongarch_64.cpp 2023-12-20 09:23:19.788147991 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/jniFastGetField_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/jniFastGetField_loongarch_64.cpp +new file mode 100644 +index 00000000..5b52e54e +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/jniFastGetField_loongarch_64.cpp @@ -0,0 +1,169 @@ +/* + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. @@ -22716,64 +23642,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +address JNI_FastGetField::generate_fast_get_double_field() { + return generate_fast_get_int_field0(T_DOUBLE); +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/jni_loongarch.h b/hotspot/src/cpu/loongarch/vm/jni_loongarch.h ---- a/hotspot/src/cpu/loongarch/vm/jni_loongarch.h 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/jni_loongarch.h 2023-12-20 09:23:19.788147991 +0800 -@@ -0,0 +1,51 @@ -+/* -+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2020, Loongson Technology. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. Oracle designates this -+ * particular file as subject to the "Classpath" exception as provided -+ * by Oracle in the LICENSE file that accompanied this code. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ */ -+ -+#ifndef _JAVASOFT_JNI_MD_H_ -+#define _JAVASOFT_JNI_MD_H_ -+ -+// Note: please do not change these without also changing jni_md.h in the JDK -+// repository -+#ifndef __has_attribute -+ #define __has_attribute(x) 0 -+#endif -+#if (defined(__GNUC__) && ((__GNUC__ > 4) || (__GNUC__ == 4) && (__GNUC_MINOR__ > 2))) || __has_attribute(visibility) -+ #define JNIEXPORT __attribute__((visibility("default"))) -+ #define JNIIMPORT __attribute__((visibility("default"))) -+#else -+ #define JNIEXPORT -+ #define JNIIMPORT -+#endif -+ -+#define JNICALL -+ -+typedef int jint; -+ -+ typedef long jlong; -+ -+typedef signed char jbyte; -+ -+#endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/jniTypes_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/jniTypes_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/jniTypes_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/jniTypes_loongarch.hpp 2023-12-20 09:23:19.788147991 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/jniTypes_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/jniTypes_loongarch.hpp +new file mode 100644 +index 00000000..554ff216 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/jniTypes_loongarch.hpp @@ -0,0 +1,144 @@ +/* + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. @@ -22919,9 +23792,98 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +}; + +#endif // CPU_LOONGARCH_VM_JNITYPES_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/loongarch_64.ad b/hotspot/src/cpu/loongarch/vm/loongarch_64.ad ---- a/hotspot/src/cpu/loongarch/vm/loongarch_64.ad 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/loongarch_64.ad 2024-01-30 13:54:24.792708955 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/jni_loongarch.h b/hotspot/src/cpu/loongarch/vm/jni_loongarch.h +new file mode 100644 +index 00000000..eb25cbc3 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/jni_loongarch.h +@@ -0,0 +1,51 @@ ++/* ++ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2015, 2020, Loongson Technology. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. Oracle designates this ++ * particular file as subject to the "Classpath" exception as provided ++ * by Oracle in the LICENSE file that accompanied this code. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ */ ++ ++#ifndef _JAVASOFT_JNI_MD_H_ ++#define _JAVASOFT_JNI_MD_H_ ++ ++// Note: please do not change these without also changing jni_md.h in the JDK ++// repository ++#ifndef __has_attribute ++ #define __has_attribute(x) 0 ++#endif ++#if (defined(__GNUC__) && ((__GNUC__ > 4) || (__GNUC__ == 4) && (__GNUC_MINOR__ > 2))) || __has_attribute(visibility) ++ #define JNIEXPORT __attribute__((visibility("default"))) ++ #define JNIIMPORT __attribute__((visibility("default"))) ++#else ++ #define JNIEXPORT ++ #define JNIIMPORT ++#endif ++ ++#define JNICALL ++ ++typedef int jint; ++ ++ typedef long jlong; ++ ++typedef signed char jbyte; ++ ++#endif +diff --git a/hotspot/src/cpu/loongarch/vm/loongarch.ad b/hotspot/src/cpu/loongarch/vm/loongarch.ad +new file mode 100644 +index 00000000..48c44779 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/loongarch.ad +@@ -0,0 +1,24 @@ ++// ++// Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. ++// Copyright (c) 2015, 2020, Loongson Technology. All rights reserved. ++// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++// ++// This code is free software; you can redistribute it and/or modify it ++// under the terms of the GNU General Public License version 2 only, as ++// published by the Free Software Foundation. ++// ++// This code is distributed in the hope that it will be useful, but WITHOUT ++// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++// version 2 for more details (a copy is included in the LICENSE file that ++// accompanied this code). ++// ++// You should have received a copy of the GNU General Public License version ++// 2 along with this work; if not, write to the Free Software Foundation, ++// Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++// ++// Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++// or visit www.oracle.com if you need additional information or have any ++// questions. ++// ++// +diff --git a/hotspot/src/cpu/loongarch/vm/loongarch_64.ad b/hotspot/src/cpu/loongarch/vm/loongarch_64.ad +new file mode 100644 +index 00000000..fa4bf6e1 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/loongarch_64.ad @@ -0,0 +1,12861 @@ +// +// Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. @@ -35784,37 +36746,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +// These must follow all instruction definitions as they use the names +// defined in the instructions definitions. + -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/loongarch.ad b/hotspot/src/cpu/loongarch/vm/loongarch.ad ---- a/hotspot/src/cpu/loongarch/vm/loongarch.ad 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/loongarch.ad 2023-12-20 09:23:19.788147991 +0800 -@@ -0,0 +1,24 @@ -+// -+// Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. -+// Copyright (c) 2015, 2020, Loongson Technology. All rights reserved. -+// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+// -+// This code is free software; you can redistribute it and/or modify it -+// under the terms of the GNU General Public License version 2 only, as -+// published by the Free Software Foundation. -+// -+// This code is distributed in the hope that it will be useful, but WITHOUT -+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+// version 2 for more details (a copy is included in the LICENSE file that -+// accompanied this code). -+// -+// You should have received a copy of the GNU General Public License version -+// 2 along with this work; if not, write to the Free Software Foundation, -+// Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+// -+// Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+// or visit www.oracle.com if you need additional information or have any -+// questions. -+// -+// -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.cpp ---- a/hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.cpp 2023-12-20 09:23:19.791481286 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.cpp +new file mode 100644 +index 00000000..89295343 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.cpp @@ -0,0 +1,3895 @@ +/* + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. @@ -39711,9 +40647,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + + bind(L_exit); +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.hpp 2023-12-20 09:23:19.791481286 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.hpp +new file mode 100644 +index 00000000..8b123c29 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.hpp @@ -0,0 +1,771 @@ +/* + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. @@ -40486,9 +41424,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +}; + +#endif // CPU_LOONGARCH_VM_MACROASSEMBLER_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.inline.hpp b/hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.inline.hpp ---- a/hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.inline.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.inline.hpp 2023-12-20 09:23:19.791481286 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.inline.hpp b/hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.inline.hpp +new file mode 100644 +index 00000000..0b265a4d +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.inline.hpp @@ -0,0 +1,34 @@ +/* + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. @@ -40524,9 +41464,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +#include "code/codeCache.hpp" + +#endif // CPU_LOONGARCH_VM_MACROASSEMBLER_LOONGARCH_INLINE_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/metaspaceShared_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/metaspaceShared_loongarch_64.cpp ---- a/hotspot/src/cpu/loongarch/vm/metaspaceShared_loongarch_64.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/metaspaceShared_loongarch_64.cpp 2023-12-20 09:23:19.791481286 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/metaspaceShared_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/metaspaceShared_loongarch_64.cpp +new file mode 100644 +index 00000000..b36216c5 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/metaspaceShared_loongarch_64.cpp @@ -0,0 +1,120 @@ +/* + * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved. @@ -40648,9 +41590,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + + *mc_top = (char*)__ pc(); +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/methodHandles_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/methodHandles_loongarch.cpp ---- a/hotspot/src/cpu/loongarch/vm/methodHandles_loongarch.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/methodHandles_loongarch.cpp 2023-12-20 09:23:19.791481286 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/methodHandles_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/methodHandles_loongarch.cpp +new file mode 100644 +index 00000000..cb31ca5a +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/methodHandles_loongarch.cpp @@ -0,0 +1,566 @@ +/* + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. @@ -41218,9 +42162,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +void MethodHandles::trace_method_handle(MacroAssembler* _masm, const char* adaptername) { +} +#endif //PRODUCT -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/methodHandles_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/methodHandles_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/methodHandles_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/methodHandles_loongarch.hpp 2023-12-20 09:23:19.791481286 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/methodHandles_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/methodHandles_loongarch.hpp +new file mode 100644 +index 00000000..f8433742 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/methodHandles_loongarch.hpp @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved. @@ -41284,9 +42230,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + // Should be in sharedRuntime, not here. + return R3; + } -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/nativeInst_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/nativeInst_loongarch.cpp ---- a/hotspot/src/cpu/loongarch/vm/nativeInst_loongarch.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/nativeInst_loongarch.cpp 2023-12-20 09:23:19.791481286 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/nativeInst_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/nativeInst_loongarch.cpp +new file mode 100644 +index 00000000..639ac6cd +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/nativeInst_loongarch.cpp @@ -0,0 +1,485 @@ +/* + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. @@ -41773,9 +42721,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + return Assembler::high(insn_word(), 10) == Assembler::ld_w_op && + Assembler::low(insn_word(), 5) == AT->encoding(); +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/nativeInst_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/nativeInst_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/nativeInst_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/nativeInst_loongarch.hpp 2023-12-20 09:23:19.791481286 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/nativeInst_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/nativeInst_loongarch.hpp +new file mode 100644 +index 00000000..49323992 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/nativeInst_loongarch.hpp @@ -0,0 +1,513 @@ +/* + * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. @@ -42290,9 +43240,62 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + return (NativeCallTrampolineStub*)addr; +} +#endif // CPU_LOONGARCH_VM_NATIVEINST_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/register_definitions_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/register_definitions_loongarch.cpp ---- a/hotspot/src/cpu/loongarch/vm/register_definitions_loongarch.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/register_definitions_loongarch.cpp 2023-12-20 09:23:19.791481286 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/registerMap_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/registerMap_loongarch.hpp +new file mode 100644 +index 00000000..5ff7555d +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/registerMap_loongarch.hpp +@@ -0,0 +1,45 @@ ++/* ++ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2015, 2020, Loongson Technology. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ */ ++ ++#ifndef CPU_LOONGARCH_VM_REGISTERMAP_LOONGARCH_HPP ++#define CPU_LOONGARCH_VM_REGISTERMAP_LOONGARCH_HPP ++ ++// machine-dependent implemention for register maps ++ friend class frame; ++ ++ private: ++ // This is the hook for finding a register in an "well-known" location, ++ // such as a register block of a predetermined format. ++ // Since there is none, we just return NULL. ++ // See registerMap_sparc.hpp for an example of grabbing registers ++ // from register save areas of a standard layout. ++ address pd_location(VMReg reg) const {return NULL;} ++ ++ // no PD state to clear or copy: ++ void pd_clear() {} ++ void pd_initialize() {} ++ void pd_initialize_from(const RegisterMap* map) {} ++ ++#endif // CPU_LOONGARCH_VM_REGISTERMAP_LOONGARCH_HPP +diff --git a/hotspot/src/cpu/loongarch/vm/register_definitions_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/register_definitions_loongarch.cpp +new file mode 100644 +index 00000000..c6424c32 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/register_definitions_loongarch.cpp @@ -0,0 +1,103 @@ +/* + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. @@ -42397,9 +43400,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +REGISTER_DEFINITION(FloatRegister, f29); +REGISTER_DEFINITION(FloatRegister, f30); +REGISTER_DEFINITION(FloatRegister, f31); -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/register_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/register_loongarch.cpp ---- a/hotspot/src/cpu/loongarch/vm/register_loongarch.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/register_loongarch.cpp 2023-12-20 09:23:19.791481286 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/register_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/register_loongarch.cpp +new file mode 100644 +index 00000000..3104cd1c +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/register_loongarch.cpp @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. @@ -42460,9 +43465,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + }; + return is_valid() ? names[encoding()] : "fccnoreg"; +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/register_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/register_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/register_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/register_loongarch.hpp 2023-12-20 09:23:19.791481286 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/register_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/register_loongarch.hpp +new file mode 100644 +index 00000000..37b39f91 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/register_loongarch.hpp @@ -0,0 +1,436 @@ +/* + * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. @@ -42900,58 +43907,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +}; + +#endif //CPU_LOONGARCH_VM_REGISTER_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/registerMap_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/registerMap_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/registerMap_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/registerMap_loongarch.hpp 2023-12-20 09:23:19.791481286 +0800 -@@ -0,0 +1,45 @@ -+/* -+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2020, Loongson Technology. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ * -+ */ -+ -+#ifndef CPU_LOONGARCH_VM_REGISTERMAP_LOONGARCH_HPP -+#define CPU_LOONGARCH_VM_REGISTERMAP_LOONGARCH_HPP -+ -+// machine-dependent implemention for register maps -+ friend class frame; -+ -+ private: -+ // This is the hook for finding a register in an "well-known" location, -+ // such as a register block of a predetermined format. -+ // Since there is none, we just return NULL. -+ // See registerMap_sparc.hpp for an example of grabbing registers -+ // from register save areas of a standard layout. -+ address pd_location(VMReg reg) const {return NULL;} -+ -+ // no PD state to clear or copy: -+ void pd_clear() {} -+ void pd_initialize() {} -+ void pd_initialize_from(const RegisterMap* map) {} -+ -+#endif // CPU_LOONGARCH_VM_REGISTERMAP_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/relocInfo_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/relocInfo_loongarch.cpp ---- a/hotspot/src/cpu/loongarch/vm/relocInfo_loongarch.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/relocInfo_loongarch.cpp 2023-12-20 09:23:19.791481286 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/relocInfo_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/relocInfo_loongarch.cpp +new file mode 100644 +index 00000000..bf4498dc +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/relocInfo_loongarch.cpp @@ -0,0 +1,130 @@ +/* + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. @@ -43083,9 +44043,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + +void metadata_Relocation::pd_fix_value(address x) { +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/relocInfo_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/relocInfo_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/relocInfo_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/relocInfo_loongarch.hpp 2023-12-20 09:23:19.791481286 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/relocInfo_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/relocInfo_loongarch.hpp +new file mode 100644 +index 00000000..211242f3 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/relocInfo_loongarch.hpp @@ -0,0 +1,40 @@ +/* + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. @@ -43127,9 +44089,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + }; + +#endif // CPU_LOONGARCH_VM_RELOCINFO_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/runtime_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/runtime_loongarch_64.cpp ---- a/hotspot/src/cpu/loongarch/vm/runtime_loongarch_64.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/runtime_loongarch_64.cpp 2023-12-20 09:23:19.791481286 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/runtime_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/runtime_loongarch_64.cpp +new file mode 100644 +index 00000000..e6ee65f3 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/runtime_loongarch_64.cpp @@ -0,0 +1,199 @@ +/* + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. @@ -43330,9 +44294,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + masm->flush(); + _exception_blob = ExceptionBlob::create(&buffer, oop_maps, framesize); +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/sharedRuntime_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/sharedRuntime_loongarch_64.cpp ---- a/hotspot/src/cpu/loongarch/vm/sharedRuntime_loongarch_64.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/sharedRuntime_loongarch_64.cpp 2023-12-20 09:23:19.791481286 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/sharedRuntime_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/sharedRuntime_loongarch_64.cpp +new file mode 100644 +index 00000000..36786b53 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/sharedRuntime_loongarch_64.cpp @@ -0,0 +1,3453 @@ +/* + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. @@ -46787,9 +47753,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +} + +extern "C" int SpinPause() {return 0;} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/stubGenerator_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/stubGenerator_loongarch_64.cpp ---- a/hotspot/src/cpu/loongarch/vm/stubGenerator_loongarch_64.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/stubGenerator_loongarch_64.cpp 2023-12-20 09:23:19.791481286 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/stubGenerator_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/stubGenerator_loongarch_64.cpp +new file mode 100644 +index 00000000..361b7751 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/stubGenerator_loongarch_64.cpp @@ -0,0 +1,3445 @@ +/* + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. @@ -50236,9 +51204,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +void StubGenerator_generate(CodeBuffer* code, bool all) { + StubGenerator g(code, all); +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/stubRoutines_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/stubRoutines_loongarch_64.cpp ---- a/hotspot/src/cpu/loongarch/vm/stubRoutines_loongarch_64.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/stubRoutines_loongarch_64.cpp 2023-12-20 09:23:19.791481286 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/stubRoutines_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/stubRoutines_loongarch_64.cpp +new file mode 100644 +index 00000000..f0f3d55a +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/stubRoutines_loongarch_64.cpp @@ -0,0 +1,264 @@ +/* + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. @@ -50504,9 +51474,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + 0x02D578EDUL, 0x7DAEED62UL, // word swap + 0xD502ED78UL, 0xAE7D62EDUL, // byte swap of word swap +}; -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/stubRoutines_loongarch_64.hpp b/hotspot/src/cpu/loongarch/vm/stubRoutines_loongarch_64.hpp ---- a/hotspot/src/cpu/loongarch/vm/stubRoutines_loongarch_64.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/stubRoutines_loongarch_64.hpp 2023-12-20 09:23:19.791481286 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/stubRoutines_loongarch_64.hpp b/hotspot/src/cpu/loongarch/vm/stubRoutines_loongarch_64.hpp +new file mode 100644 +index 00000000..d020a527 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/stubRoutines_loongarch_64.hpp @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. @@ -50568,9 +51540,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +}; + +#endif // CPU_LOONGARCH_VM_STUBROUTINES_LOONGARCH_64_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/templateInterpreterGenerator_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/templateInterpreterGenerator_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/templateInterpreterGenerator_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/templateInterpreterGenerator_loongarch.hpp 2023-12-20 09:23:19.794814582 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/templateInterpreterGenerator_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/templateInterpreterGenerator_loongarch.hpp +new file mode 100644 +index 00000000..213e69b0 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/templateInterpreterGenerator_loongarch.hpp @@ -0,0 +1,35 @@ +/* + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. @@ -50607,9 +51581,58 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + // address generate_asm_interpreter_entry(bool synchronized); + +#endif // CPU_LOONGARCH_VM_TEMPLATEINTERPRETERGENERATOR_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/templateInterpreter_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/templateInterpreter_loongarch_64.cpp ---- a/hotspot/src/cpu/loongarch/vm/templateInterpreter_loongarch_64.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/templateInterpreter_loongarch_64.cpp 2023-12-20 09:23:19.794814582 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/templateInterpreter_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/templateInterpreter_loongarch.hpp +new file mode 100644 +index 00000000..39e3ad7b +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/templateInterpreter_loongarch.hpp +@@ -0,0 +1,41 @@ ++/* ++ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2015, 2020, Loongson Technology. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ */ ++ ++#ifndef CPU_LOONGARCH_VM_TEMPLATEINTERPRETER_LOONGARCH_HPP ++#define CPU_LOONGARCH_VM_TEMPLATEINTERPRETER_LOONGARCH_HPP ++ ++ ++ protected: ++ ++ // Size of interpreter code. Increase if too small. Interpreter will ++ // fail with a guarantee ("not enough space for interpreter generation"); ++ // if too small. ++ // Run with +PrintInterpreter to get the VM to print out the size. ++ // Max size with JVMTI ++ // The sethi() instruction generates lots more instructions when shell ++ // stack limit is unlimited, so that's why this is much bigger. ++ const static int InterpreterCodeSize = 500 * K; ++ ++#endif // CPU_LOONGARCH_VM_TEMPLATEINTERPRETER_LOONGARCH_HPP +diff --git a/hotspot/src/cpu/loongarch/vm/templateInterpreter_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/templateInterpreter_loongarch_64.cpp +new file mode 100644 +index 00000000..b25086a3 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/templateInterpreter_loongarch_64.cpp @@ -0,0 +1,2335 @@ +/* + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. @@ -52946,54 +53969,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +} +#endif // !PRODUCT +#endif // ! CC_INTERP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/templateInterpreter_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/templateInterpreter_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/templateInterpreter_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/templateInterpreter_loongarch.hpp 2023-12-20 09:23:19.794814582 +0800 -@@ -0,0 +1,41 @@ -+/* -+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2020, Loongson Technology. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ * -+ */ -+ -+#ifndef CPU_LOONGARCH_VM_TEMPLATEINTERPRETER_LOONGARCH_HPP -+#define CPU_LOONGARCH_VM_TEMPLATEINTERPRETER_LOONGARCH_HPP -+ -+ -+ protected: -+ -+ // Size of interpreter code. Increase if too small. Interpreter will -+ // fail with a guarantee ("not enough space for interpreter generation"); -+ // if too small. -+ // Run with +PrintInterpreter to get the VM to print out the size. -+ // Max size with JVMTI -+ // The sethi() instruction generates lots more instructions when shell -+ // stack limit is unlimited, so that's why this is much bigger. -+ const static int InterpreterCodeSize = 500 * K; -+ -+#endif // CPU_LOONGARCH_VM_TEMPLATEINTERPRETER_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/templateTable_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/templateTable_loongarch_64.cpp ---- a/hotspot/src/cpu/loongarch/vm/templateTable_loongarch_64.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/templateTable_loongarch_64.cpp 2023-12-20 09:23:19.794814582 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/templateTable_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/templateTable_loongarch_64.cpp +new file mode 100644 +index 00000000..228217f0 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/templateTable_loongarch_64.cpp @@ -0,0 +1,4024 @@ +/* + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. @@ -57019,9 +57999,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + __ membar(__ AnyAny);//no membar here for aarch64 +} +#endif // !CC_INTERP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/templateTable_loongarch_64.hpp b/hotspot/src/cpu/loongarch/vm/templateTable_loongarch_64.hpp ---- a/hotspot/src/cpu/loongarch/vm/templateTable_loongarch_64.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/templateTable_loongarch_64.hpp 2023-12-20 09:23:19.794814582 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/templateTable_loongarch_64.hpp b/hotspot/src/cpu/loongarch/vm/templateTable_loongarch_64.hpp +new file mode 100644 +index 00000000..c48d76e0 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/templateTable_loongarch_64.hpp @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. @@ -57067,12 +58049,14 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + static void index_check_without_pop(Register array, Register index); + +#endif // CPU_LOONGARCH_VM_TEMPLATETABLE_LOONGARCH_64_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/vmreg_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/vmreg_loongarch.cpp ---- a/hotspot/src/cpu/loongarch/vm/vmreg_loongarch.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/vmreg_loongarch.cpp 2023-12-20 09:23:19.794814582 +0800 -@@ -0,0 +1,51 @@ +diff --git a/hotspot/src/cpu/loongarch/vm/vmStructs_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/vmStructs_loongarch.hpp +new file mode 100644 +index 00000000..7c3ce680 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/vmStructs_loongarch.hpp +@@ -0,0 +1,68 @@ +/* -+ * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2020, Loongson Technology. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * @@ -57096,220 +58080,58 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + * + */ + -+#include "precompiled.hpp" -+#include "asm/assembler.hpp" -+#include "code/vmreg.hpp" ++#ifndef CPU_LOONGARCH_VM_VMSTRUCTS_LOONGARCH_HPP ++#define CPU_LOONGARCH_VM_VMSTRUCTS_LOONGARCH_HPP + ++// These are the CPU-specific fields, types and integer ++// constants required by the Serviceability Agent. This file is ++// referenced by vmStructs.cpp. + ++#define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field, unchecked_c1_static_field, unchecked_c2_static_field) \ ++ \ ++ /******************************/ \ ++ /* JavaCallWrapper */ \ ++ /******************************/ \ ++ /******************************/ \ ++ /* JavaFrameAnchor */ \ ++ /******************************/ \ ++ volatile_nonstatic_field(JavaFrameAnchor, _last_Java_fp, intptr_t*) \ ++ \ + -+void VMRegImpl::set_regName() { -+ Register reg = ::as_Register(0); -+ int i; -+ for (i = 0; i < ConcreteRegisterImpl::max_gpr ; ) { -+ regName[i++] = reg->name(); -+ regName[i++] = reg->name(); -+ reg = reg->successor(); -+ } ++ /* NOTE that we do not use the last_entry() macro here; it is used */ ++ /* in vmStructs__.hpp's VM_STRUCTS_OS_CPU macro (and must */ ++ /* be present there) */ + -+ FloatRegister freg = ::as_FloatRegister(0); -+ for ( ; i < ConcreteRegisterImpl::max_fpr ; ) { -+ regName[i++] = freg->name(); -+ regName[i++] = freg->name(); -+ freg = freg->successor(); -+ } + -+ for ( ; i < ConcreteRegisterImpl::number_of_registers ; i ++ ) { -+ regName[i] = "NON-GPR-FPR"; -+ } -+} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/vmreg_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/vmreg_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/vmreg_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/vmreg_loongarch.hpp 2023-12-20 09:23:19.794814582 +0800 -@@ -0,0 +1,35 @@ ++#define VM_TYPES_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c1_toplevel_type, declare_c2_type, declare_c2_toplevel_type) \ ++ ++ /* NOTE that we do not use the last_entry() macro here; it is used */ ++ /* in vmStructs__.hpp's VM_TYPES_OS_CPU macro (and must */ ++ /* be present there) */ ++ ++ ++#define VM_INT_CONSTANTS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant) \ ++ ++ /* NOTE that we do not use the last_entry() macro here; it is used */ ++ /* in vmStructs__.hpp's VM_INT_CONSTANTS_OS_CPU macro (and must */ ++ /* be present there) */ ++ ++#define VM_LONG_CONSTANTS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant) \ ++ ++ /* NOTE that we do not use the last_entry() macro here; it is used */ ++ /* in vmStructs__.hpp's VM_LONG_CONSTANTS_OS_CPU macro (and must */ ++ /* be present there) */ ++ ++#endif // CPU_LOONGARCH_VM_VMSTRUCTS_LOONGARCH_HPP +diff --git a/hotspot/src/cpu/loongarch/vm/vm_version_ext_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/vm_version_ext_loongarch.cpp +new file mode 100644 +index 00000000..c71f64e1 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/vm_version_ext_loongarch.cpp +@@ -0,0 +1,84 @@ +/* -+ * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2020, Loongson Technology. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ * -+ */ -+ -+#ifndef CPU_LOONGARCH_VM_VMREG_LOONGARCH_HPP -+#define CPU_LOONGARCH_VM_VMREG_LOONGARCH_HPP -+ -+bool is_Register(); -+Register as_Register(); -+ -+bool is_FloatRegister(); -+FloatRegister as_FloatRegister(); -+ -+#endif // CPU_LOONGARCH_VM_VMREG_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/vmreg_loongarch.inline.hpp b/hotspot/src/cpu/loongarch/vm/vmreg_loongarch.inline.hpp ---- a/hotspot/src/cpu/loongarch/vm/vmreg_loongarch.inline.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/vmreg_loongarch.inline.hpp 2023-12-20 09:23:19.794814582 +0800 -@@ -0,0 +1,66 @@ -+/* -+ * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2020, Loongson Technology. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ * -+ */ -+ -+#ifndef CPU_LOONGARCH_VM_VMREG_LOONGARCH_INLINE_HPP -+#define CPU_LOONGARCH_VM_VMREG_LOONGARCH_INLINE_HPP -+ -+inline VMReg RegisterImpl::as_VMReg() { -+ if( this==noreg ) return VMRegImpl::Bad(); -+ return VMRegImpl::as_VMReg(encoding() << 1 ); -+} -+ -+inline VMReg FloatRegisterImpl::as_VMReg() { -+ return VMRegImpl::as_VMReg((encoding() << 1) + ConcreteRegisterImpl::max_gpr); -+} -+ -+inline bool VMRegImpl::is_Register() { -+ return (unsigned int) value() < (unsigned int) ConcreteRegisterImpl::max_gpr; -+} -+ -+inline bool VMRegImpl::is_FloatRegister() { -+ return value() >= ConcreteRegisterImpl::max_gpr && value() < ConcreteRegisterImpl::max_fpr; -+} -+ -+inline Register VMRegImpl::as_Register() { -+ -+ assert( is_Register(), "must be"); -+ return ::as_Register(value() >> 1); -+} -+ -+inline FloatRegister VMRegImpl::as_FloatRegister() { -+ assert( is_FloatRegister(), "must be" ); -+ assert( is_even(value()), "must be" ); -+ return ::as_FloatRegister((value() - ConcreteRegisterImpl::max_gpr) >> 1); -+} -+ -+inline bool VMRegImpl::is_concrete() { -+ assert(is_reg(), "must be"); -+ if(is_Register()) return true; -+ if(is_FloatRegister()) return true; -+ assert(false, "what register?"); -+ return false; -+} -+ -+#endif // CPU_LOONGARCH_VM_VMREG_LOONGARCH_INLINE_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/vmStructs_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/vmStructs_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/vmStructs_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/vmStructs_loongarch.hpp 2023-12-20 09:23:19.794814582 +0800 -@@ -0,0 +1,68 @@ -+/* -+ * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2020, Loongson Technology. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ * -+ */ -+ -+#ifndef CPU_LOONGARCH_VM_VMSTRUCTS_LOONGARCH_HPP -+#define CPU_LOONGARCH_VM_VMSTRUCTS_LOONGARCH_HPP -+ -+// These are the CPU-specific fields, types and integer -+// constants required by the Serviceability Agent. This file is -+// referenced by vmStructs.cpp. -+ -+#define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field, unchecked_c1_static_field, unchecked_c2_static_field) \ -+ \ -+ /******************************/ \ -+ /* JavaCallWrapper */ \ -+ /******************************/ \ -+ /******************************/ \ -+ /* JavaFrameAnchor */ \ -+ /******************************/ \ -+ volatile_nonstatic_field(JavaFrameAnchor, _last_Java_fp, intptr_t*) \ -+ \ -+ -+ /* NOTE that we do not use the last_entry() macro here; it is used */ -+ /* in vmStructs__.hpp's VM_STRUCTS_OS_CPU macro (and must */ -+ /* be present there) */ -+ -+ -+#define VM_TYPES_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c1_toplevel_type, declare_c2_type, declare_c2_toplevel_type) \ -+ -+ /* NOTE that we do not use the last_entry() macro here; it is used */ -+ /* in vmStructs__.hpp's VM_TYPES_OS_CPU macro (and must */ -+ /* be present there) */ -+ -+ -+#define VM_INT_CONSTANTS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant) \ -+ -+ /* NOTE that we do not use the last_entry() macro here; it is used */ -+ /* in vmStructs__.hpp's VM_INT_CONSTANTS_OS_CPU macro (and must */ -+ /* be present there) */ -+ -+#define VM_LONG_CONSTANTS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant) \ -+ -+ /* NOTE that we do not use the last_entry() macro here; it is used */ -+ /* in vmStructs__.hpp's VM_LONG_CONSTANTS_OS_CPU macro (and must */ -+ /* be present there) */ -+ -+#endif // CPU_LOONGARCH_VM_VMSTRUCTS_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/vm_version_ext_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/vm_version_ext_loongarch.cpp ---- a/hotspot/src/cpu/loongarch/vm/vm_version_ext_loongarch.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/vm_version_ext_loongarch.cpp 2023-12-20 09:23:19.794814582 +0800 -@@ -0,0 +1,84 @@ -+/* -+ * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2018, 2020, Loongson Technology. All rights reserved. ++ * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2018, 2020, Loongson Technology. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it @@ -57391,9 +58213,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + strncpy(tmp, _cpu_desc, CPU_DETAILED_DESC_BUF_SIZE); + return tmp; +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/vm_version_ext_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/vm_version_ext_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/vm_version_ext_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/vm_version_ext_loongarch.hpp 2023-12-20 09:23:19.794814582 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/vm_version_ext_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/vm_version_ext_loongarch.hpp +new file mode 100644 +index 00000000..682dd9c7 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/vm_version_ext_loongarch.hpp @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. @@ -57449,9 +58273,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +}; + +#endif // CPU_LOONGARCH_VM_VM_VERSION_EXT_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/vm_version_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/vm_version_loongarch.cpp ---- a/hotspot/src/cpu/loongarch/vm/vm_version_loongarch.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/vm_version_loongarch.cpp 2023-12-20 09:23:19.794814582 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/vm_version_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/vm_version_loongarch.cpp +new file mode 100644 +index 00000000..81ea3b23 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/vm_version_loongarch.cpp @@ -0,0 +1,443 @@ +/* + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. @@ -57896,9 +58722,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + + get_processor_features(); +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/vm_version_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/vm_version_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/vm_version_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/vm_version_loongarch.hpp 2023-12-20 09:23:19.794814582 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/vm_version_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/vm_version_loongarch.hpp +new file mode 100644 +index 00000000..3b5f907a +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/vm_version_loongarch.hpp @@ -0,0 +1,299 @@ +/* + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. @@ -58199,9 +59027,181 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +}; + +#endif // CPU_LOONGARCH_VM_VM_VERSION_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/vtableStubs_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/vtableStubs_loongarch_64.cpp ---- a/hotspot/src/cpu/loongarch/vm/vtableStubs_loongarch_64.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/vtableStubs_loongarch_64.cpp 2023-12-20 09:23:19.794814582 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/vmreg_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/vmreg_loongarch.cpp +new file mode 100644 +index 00000000..52bccfc1 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/vmreg_loongarch.cpp +@@ -0,0 +1,51 @@ ++/* ++ * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2015, 2020, Loongson Technology. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ */ ++ ++#include "precompiled.hpp" ++#include "asm/assembler.hpp" ++#include "code/vmreg.hpp" ++ ++ ++ ++void VMRegImpl::set_regName() { ++ Register reg = ::as_Register(0); ++ int i; ++ for (i = 0; i < ConcreteRegisterImpl::max_gpr ; ) { ++ regName[i++] = reg->name(); ++ regName[i++] = reg->name(); ++ reg = reg->successor(); ++ } ++ ++ FloatRegister freg = ::as_FloatRegister(0); ++ for ( ; i < ConcreteRegisterImpl::max_fpr ; ) { ++ regName[i++] = freg->name(); ++ regName[i++] = freg->name(); ++ freg = freg->successor(); ++ } ++ ++ for ( ; i < ConcreteRegisterImpl::number_of_registers ; i ++ ) { ++ regName[i] = "NON-GPR-FPR"; ++ } ++} +diff --git a/hotspot/src/cpu/loongarch/vm/vmreg_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/vmreg_loongarch.hpp +new file mode 100644 +index 00000000..80a1fc57 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/vmreg_loongarch.hpp +@@ -0,0 +1,35 @@ ++/* ++ * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2015, 2020, Loongson Technology. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ */ ++ ++#ifndef CPU_LOONGARCH_VM_VMREG_LOONGARCH_HPP ++#define CPU_LOONGARCH_VM_VMREG_LOONGARCH_HPP ++ ++bool is_Register(); ++Register as_Register(); ++ ++bool is_FloatRegister(); ++FloatRegister as_FloatRegister(); ++ ++#endif // CPU_LOONGARCH_VM_VMREG_LOONGARCH_HPP +diff --git a/hotspot/src/cpu/loongarch/vm/vmreg_loongarch.inline.hpp b/hotspot/src/cpu/loongarch/vm/vmreg_loongarch.inline.hpp +new file mode 100644 +index 00000000..f822d4c3 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/vmreg_loongarch.inline.hpp +@@ -0,0 +1,66 @@ ++/* ++ * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2015, 2020, Loongson Technology. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ */ ++ ++#ifndef CPU_LOONGARCH_VM_VMREG_LOONGARCH_INLINE_HPP ++#define CPU_LOONGARCH_VM_VMREG_LOONGARCH_INLINE_HPP ++ ++inline VMReg RegisterImpl::as_VMReg() { ++ if( this==noreg ) return VMRegImpl::Bad(); ++ return VMRegImpl::as_VMReg(encoding() << 1 ); ++} ++ ++inline VMReg FloatRegisterImpl::as_VMReg() { ++ return VMRegImpl::as_VMReg((encoding() << 1) + ConcreteRegisterImpl::max_gpr); ++} ++ ++inline bool VMRegImpl::is_Register() { ++ return (unsigned int) value() < (unsigned int) ConcreteRegisterImpl::max_gpr; ++} ++ ++inline bool VMRegImpl::is_FloatRegister() { ++ return value() >= ConcreteRegisterImpl::max_gpr && value() < ConcreteRegisterImpl::max_fpr; ++} ++ ++inline Register VMRegImpl::as_Register() { ++ ++ assert( is_Register(), "must be"); ++ return ::as_Register(value() >> 1); ++} ++ ++inline FloatRegister VMRegImpl::as_FloatRegister() { ++ assert( is_FloatRegister(), "must be" ); ++ assert( is_even(value()), "must be" ); ++ return ::as_FloatRegister((value() - ConcreteRegisterImpl::max_gpr) >> 1); ++} ++ ++inline bool VMRegImpl::is_concrete() { ++ assert(is_reg(), "must be"); ++ if(is_Register()) return true; ++ if(is_FloatRegister()) return true; ++ assert(false, "what register?"); ++ return false; ++} ++ ++#endif // CPU_LOONGARCH_VM_VMREG_LOONGARCH_INLINE_HPP +diff --git a/hotspot/src/cpu/loongarch/vm/vtableStubs_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/vtableStubs_loongarch_64.cpp +new file mode 100644 +index 00000000..df0d176b +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/vtableStubs_loongarch_64.cpp @@ -0,0 +1,300 @@ +/* + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. @@ -58503,9 +59503,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +int VtableStub::pd_code_alignment() { + return wordSize; +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/assembler_mips.cpp b/hotspot/src/cpu/mips/vm/assembler_mips.cpp ---- a/hotspot/src/cpu/mips/vm/assembler_mips.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/assembler_mips.cpp 2023-12-20 09:23:19.794814582 +0800 +diff --git a/hotspot/src/cpu/mips/vm/assembler_mips.cpp b/hotspot/src/cpu/mips/vm/assembler_mips.cpp +new file mode 100644 +index 00000000..6c720972 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/assembler_mips.cpp @@ -0,0 +1,774 @@ +/* + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. @@ -59281,9 +60283,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + delay_state = no_delay; +#endif +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/assembler_mips.hpp b/hotspot/src/cpu/mips/vm/assembler_mips.hpp ---- a/hotspot/src/cpu/mips/vm/assembler_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/assembler_mips.hpp 2023-12-20 09:23:19.794814582 +0800 +diff --git a/hotspot/src/cpu/mips/vm/assembler_mips.hpp b/hotspot/src/cpu/mips/vm/assembler_mips.hpp +new file mode 100644 +index 00000000..e91b9db2 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/assembler_mips.hpp @@ -0,0 +1,1789 @@ +/* + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. @@ -61074,9 +62078,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + + +#endif // CPU_MIPS_VM_ASSEMBLER_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/assembler_mips.inline.hpp b/hotspot/src/cpu/mips/vm/assembler_mips.inline.hpp ---- a/hotspot/src/cpu/mips/vm/assembler_mips.inline.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/assembler_mips.inline.hpp 2023-12-20 09:23:19.794814582 +0800 +diff --git a/hotspot/src/cpu/mips/vm/assembler_mips.inline.hpp b/hotspot/src/cpu/mips/vm/assembler_mips.inline.hpp +new file mode 100644 +index 00000000..39aeb550 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/assembler_mips.inline.hpp @@ -0,0 +1,33 @@ +/* + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. @@ -61111,9 +62117,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +#include "code/codeCache.hpp" + +#endif // CPU_MIPS_VM_ASSEMBLER_MIPS_INLINE_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/bytecodeInterpreter_mips.cpp b/hotspot/src/cpu/mips/vm/bytecodeInterpreter_mips.cpp ---- a/hotspot/src/cpu/mips/vm/bytecodeInterpreter_mips.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/bytecodeInterpreter_mips.cpp 2023-12-20 09:23:19.794814582 +0800 +diff --git a/hotspot/src/cpu/mips/vm/bytecodeInterpreter_mips.cpp b/hotspot/src/cpu/mips/vm/bytecodeInterpreter_mips.cpp +new file mode 100644 +index 00000000..a4a1b28c +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/bytecodeInterpreter_mips.cpp @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. @@ -61168,9 +62176,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +#ifdef CC_INTERP + +#endif // CC_INTERP (all) -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/bytecodeInterpreter_mips.hpp b/hotspot/src/cpu/mips/vm/bytecodeInterpreter_mips.hpp ---- a/hotspot/src/cpu/mips/vm/bytecodeInterpreter_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/bytecodeInterpreter_mips.hpp 2023-12-20 09:23:19.794814582 +0800 +diff --git a/hotspot/src/cpu/mips/vm/bytecodeInterpreter_mips.hpp b/hotspot/src/cpu/mips/vm/bytecodeInterpreter_mips.hpp +new file mode 100644 +index 00000000..aac8b7a2 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/bytecodeInterpreter_mips.hpp @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. @@ -61282,9 +62292,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + ((VMJavaVal64*)(addr))->l) + +#endif // CPU_MIPS_VM_BYTECODEINTERPRETER_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/bytecodeInterpreter_mips.inline.hpp b/hotspot/src/cpu/mips/vm/bytecodeInterpreter_mips.inline.hpp ---- a/hotspot/src/cpu/mips/vm/bytecodeInterpreter_mips.inline.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/bytecodeInterpreter_mips.inline.hpp 2023-12-20 09:23:19.794814582 +0800 +diff --git a/hotspot/src/cpu/mips/vm/bytecodeInterpreter_mips.inline.hpp b/hotspot/src/cpu/mips/vm/bytecodeInterpreter_mips.inline.hpp +new file mode 100644 +index 00000000..8ce77ab9 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/bytecodeInterpreter_mips.inline.hpp @@ -0,0 +1,286 @@ +/* + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. @@ -61572,9 +62584,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +} + +#endif // CPU_MIPS_VM_BYTECODEINTERPRETER_MIPS_INLINE_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/bytecodes_mips.cpp b/hotspot/src/cpu/mips/vm/bytecodes_mips.cpp ---- a/hotspot/src/cpu/mips/vm/bytecodes_mips.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/bytecodes_mips.cpp 2023-12-20 09:23:19.794814582 +0800 +diff --git a/hotspot/src/cpu/mips/vm/bytecodes_mips.cpp b/hotspot/src/cpu/mips/vm/bytecodes_mips.cpp +new file mode 100644 +index 00000000..61efd1f5 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/bytecodes_mips.cpp @@ -0,0 +1,38 @@ +/* + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. @@ -61614,9 +62628,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + // No mips specific bytecodes + return code; +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/bytecodes_mips.hpp b/hotspot/src/cpu/mips/vm/bytecodes_mips.hpp ---- a/hotspot/src/cpu/mips/vm/bytecodes_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/bytecodes_mips.hpp 2023-12-20 09:23:19.794814582 +0800 +diff --git a/hotspot/src/cpu/mips/vm/bytecodes_mips.hpp b/hotspot/src/cpu/mips/vm/bytecodes_mips.hpp +new file mode 100644 +index 00000000..25a9562a +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/bytecodes_mips.hpp @@ -0,0 +1,31 @@ +/* + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. @@ -61649,9 +62665,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +// No Loongson specific bytecodes + +#endif // CPU_MIPS_VM_BYTECODES_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/bytes_mips.hpp b/hotspot/src/cpu/mips/vm/bytes_mips.hpp ---- a/hotspot/src/cpu/mips/vm/bytes_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/bytes_mips.hpp 2023-12-20 09:23:19.794814582 +0800 +diff --git a/hotspot/src/cpu/mips/vm/bytes_mips.hpp b/hotspot/src/cpu/mips/vm/bytes_mips.hpp +new file mode 100644 +index 00000000..515ffad4 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/bytes_mips.hpp @@ -0,0 +1,193 @@ +/* + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. @@ -61846,9 +62864,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + + +#endif // CPU_MIPS_VM_BYTES_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/c2_globals_mips.hpp b/hotspot/src/cpu/mips/vm/c2_globals_mips.hpp ---- a/hotspot/src/cpu/mips/vm/c2_globals_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/c2_globals_mips.hpp 2023-12-20 09:23:19.794814582 +0800 +diff --git a/hotspot/src/cpu/mips/vm/c2_globals_mips.hpp b/hotspot/src/cpu/mips/vm/c2_globals_mips.hpp +new file mode 100644 +index 00000000..f254e07a +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/c2_globals_mips.hpp @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. @@ -61950,9 +62970,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +define_pd_global(bool, NeverActAsServerClassMachine, false); + +#endif // CPU_MIPS_VM_C2_GLOBALS_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/c2_init_mips.cpp b/hotspot/src/cpu/mips/vm/c2_init_mips.cpp ---- a/hotspot/src/cpu/mips/vm/c2_init_mips.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/c2_init_mips.cpp 2023-12-20 09:23:19.794814582 +0800 +diff --git a/hotspot/src/cpu/mips/vm/c2_init_mips.cpp b/hotspot/src/cpu/mips/vm/c2_init_mips.cpp +new file mode 100644 +index 00000000..e6d5815f +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/c2_init_mips.cpp @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. @@ -61988,9 +63010,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +void Compile::pd_compiler2_init() { + guarantee(CodeEntryAlignment >= InteriorEntryAlignment, "" ); +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/codeBuffer_mips.hpp b/hotspot/src/cpu/mips/vm/codeBuffer_mips.hpp ---- a/hotspot/src/cpu/mips/vm/codeBuffer_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/codeBuffer_mips.hpp 2023-12-20 09:23:19.794814582 +0800 +diff --git a/hotspot/src/cpu/mips/vm/codeBuffer_mips.hpp b/hotspot/src/cpu/mips/vm/codeBuffer_mips.hpp +new file mode 100644 +index 00000000..1836b7a9 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/codeBuffer_mips.hpp @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. @@ -62027,9 +63051,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + void flush_bundle(bool start_new_bundle) {} + +#endif // CPU_MIPS_VM_CODEBUFFER_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/compiledIC_mips.cpp b/hotspot/src/cpu/mips/vm/compiledIC_mips.cpp ---- a/hotspot/src/cpu/mips/vm/compiledIC_mips.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/compiledIC_mips.cpp 2023-12-20 09:23:19.794814582 +0800 +diff --git a/hotspot/src/cpu/mips/vm/compiledIC_mips.cpp b/hotspot/src/cpu/mips/vm/compiledIC_mips.cpp +new file mode 100644 +index 00000000..8ffaaaf8 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/compiledIC_mips.cpp @@ -0,0 +1,173 @@ +/* + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. @@ -62204,9 +63230,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +} + +#endif // !PRODUCT -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/copy_mips.hpp b/hotspot/src/cpu/mips/vm/copy_mips.hpp ---- a/hotspot/src/cpu/mips/vm/copy_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/copy_mips.hpp 2024-01-30 13:54:24.792708955 +0800 +diff --git a/hotspot/src/cpu/mips/vm/copy_mips.hpp b/hotspot/src/cpu/mips/vm/copy_mips.hpp +new file mode 100644 +index 00000000..4442e1dc +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/copy_mips.hpp @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. @@ -62298,9 +63326,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +} + +#endif //CPU_MIPS_VM_COPY_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/cppInterpreterGenerator_mips.hpp b/hotspot/src/cpu/mips/vm/cppInterpreterGenerator_mips.hpp ---- a/hotspot/src/cpu/mips/vm/cppInterpreterGenerator_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/cppInterpreterGenerator_mips.hpp 2023-12-20 09:23:19.794814582 +0800 +diff --git a/hotspot/src/cpu/mips/vm/cppInterpreterGenerator_mips.hpp b/hotspot/src/cpu/mips/vm/cppInterpreterGenerator_mips.hpp +new file mode 100644 +index 00000000..37bd03b0 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/cppInterpreterGenerator_mips.hpp @@ -0,0 +1,53 @@ +/* + * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. @@ -62355,9 +63385,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + bool native); // C++ interpreter only + +#endif // CPU_MIPS_VM_CPPINTERPRETERGENERATOR_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/cppInterpreter_mips.cpp b/hotspot/src/cpu/mips/vm/cppInterpreter_mips.cpp ---- a/hotspot/src/cpu/mips/vm/cppInterpreter_mips.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/cppInterpreter_mips.cpp 2023-12-20 09:23:19.794814582 +0800 +diff --git a/hotspot/src/cpu/mips/vm/cppInterpreter_mips.cpp b/hotspot/src/cpu/mips/vm/cppInterpreter_mips.cpp +new file mode 100644 +index 00000000..1f8d75d5 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/cppInterpreter_mips.cpp @@ -0,0 +1,215 @@ +/* + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. @@ -62574,9 +63606,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +} + +#endif // CC_INTERP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/cppInterpreter_mips.hpp b/hotspot/src/cpu/mips/vm/cppInterpreter_mips.hpp ---- a/hotspot/src/cpu/mips/vm/cppInterpreter_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/cppInterpreter_mips.hpp 2023-12-20 09:23:19.794814582 +0800 +diff --git a/hotspot/src/cpu/mips/vm/cppInterpreter_mips.hpp b/hotspot/src/cpu/mips/vm/cppInterpreter_mips.hpp +new file mode 100644 +index 00000000..49c47330 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/cppInterpreter_mips.hpp @@ -0,0 +1,40 @@ +/* + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. @@ -62618,9 +63652,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + const static int InterpreterCodeSize = 210 * K; + +#endif // CPU_MIPS_VM_CPPINTERPRETER_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/debug_mips.cpp b/hotspot/src/cpu/mips/vm/debug_mips.cpp ---- a/hotspot/src/cpu/mips/vm/debug_mips.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/debug_mips.cpp 2023-12-20 09:23:19.794814582 +0800 +diff --git a/hotspot/src/cpu/mips/vm/debug_mips.cpp b/hotspot/src/cpu/mips/vm/debug_mips.cpp +new file mode 100644 +index 00000000..50de0365 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/debug_mips.cpp @@ -0,0 +1,51 @@ +/* + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. @@ -62673,9 +63709,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +void pd_obfuscate_location(char *buf,int buflen) {} + +#endif // PRODUCT -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/depChecker_mips.cpp b/hotspot/src/cpu/mips/vm/depChecker_mips.cpp ---- a/hotspot/src/cpu/mips/vm/depChecker_mips.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/depChecker_mips.cpp 2023-12-20 09:23:19.794814582 +0800 +diff --git a/hotspot/src/cpu/mips/vm/depChecker_mips.cpp b/hotspot/src/cpu/mips/vm/depChecker_mips.cpp +new file mode 100644 +index 00000000..756ccb68 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/depChecker_mips.cpp @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. @@ -62707,9 +63745,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +#include "depChecker_mips.hpp" + +// Nothing to do on mips -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/depChecker_mips.hpp b/hotspot/src/cpu/mips/vm/depChecker_mips.hpp ---- a/hotspot/src/cpu/mips/vm/depChecker_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/depChecker_mips.hpp 2023-12-20 09:23:19.794814582 +0800 +diff --git a/hotspot/src/cpu/mips/vm/depChecker_mips.hpp b/hotspot/src/cpu/mips/vm/depChecker_mips.hpp +new file mode 100644 +index 00000000..11e52b4e +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/depChecker_mips.hpp @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. @@ -62742,9 +63782,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +// Nothing to do on MIPS + +#endif // CPU_MIPS_VM_DEPCHECKER_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/disassembler_mips.hpp b/hotspot/src/cpu/mips/vm/disassembler_mips.hpp ---- a/hotspot/src/cpu/mips/vm/disassembler_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/disassembler_mips.hpp 2023-12-20 09:23:19.794814582 +0800 +diff --git a/hotspot/src/cpu/mips/vm/disassembler_mips.hpp b/hotspot/src/cpu/mips/vm/disassembler_mips.hpp +new file mode 100644 +index 00000000..c5f3a888 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/disassembler_mips.hpp @@ -0,0 +1,37 @@ +/* + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. @@ -62783,9 +63825,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + } + +#endif // CPU_MIPS_VM_DISASSEMBLER_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/frame_mips.cpp b/hotspot/src/cpu/mips/vm/frame_mips.cpp ---- a/hotspot/src/cpu/mips/vm/frame_mips.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/frame_mips.cpp 2023-12-20 09:23:19.798147877 +0800 +diff --git a/hotspot/src/cpu/mips/vm/frame_mips.cpp b/hotspot/src/cpu/mips/vm/frame_mips.cpp +new file mode 100644 +index 00000000..1c928976 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/frame_mips.cpp @@ -0,0 +1,711 @@ +/* + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. @@ -63498,9 +64542,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + init((intptr_t*)sp, (intptr_t*)fp, (address)pc); +} +#endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/frame_mips.hpp b/hotspot/src/cpu/mips/vm/frame_mips.hpp ---- a/hotspot/src/cpu/mips/vm/frame_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/frame_mips.hpp 2023-12-20 09:23:19.798147877 +0800 +diff --git a/hotspot/src/cpu/mips/vm/frame_mips.hpp b/hotspot/src/cpu/mips/vm/frame_mips.hpp +new file mode 100644 +index 00000000..9e684a8d +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/frame_mips.hpp @@ -0,0 +1,229 @@ +/* + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. @@ -63731,9 +64777,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +#endif // CC_INTERP + +#endif // CPU_MIPS_VM_FRAME_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/frame_mips.inline.hpp b/hotspot/src/cpu/mips/vm/frame_mips.inline.hpp ---- a/hotspot/src/cpu/mips/vm/frame_mips.inline.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/frame_mips.inline.hpp 2023-12-20 09:23:19.798147877 +0800 +diff --git a/hotspot/src/cpu/mips/vm/frame_mips.inline.hpp b/hotspot/src/cpu/mips/vm/frame_mips.inline.hpp +new file mode 100644 +index 00000000..60e56ac7 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/frame_mips.inline.hpp @@ -0,0 +1,312 @@ +/* + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. @@ -64047,9 +65095,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +} + +#endif // CPU_MIPS_VM_FRAME_MIPS_INLINE_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/globalDefinitions_mips.hpp b/hotspot/src/cpu/mips/vm/globalDefinitions_mips.hpp ---- a/hotspot/src/cpu/mips/vm/globalDefinitions_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/globalDefinitions_mips.hpp 2023-12-20 09:23:19.798147877 +0800 +diff --git a/hotspot/src/cpu/mips/vm/globalDefinitions_mips.hpp b/hotspot/src/cpu/mips/vm/globalDefinitions_mips.hpp +new file mode 100644 +index 00000000..bd00a8d4 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/globalDefinitions_mips.hpp @@ -0,0 +1,41 @@ +/* + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. @@ -64092,9 +65142,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +#define SUPPORTS_NATIVE_CX8 + +#endif // CPU_MIPS_VM_GLOBALDEFINITIONS_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/globals_mips.hpp b/hotspot/src/cpu/mips/vm/globals_mips.hpp ---- a/hotspot/src/cpu/mips/vm/globals_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/globals_mips.hpp 2023-12-20 09:23:19.798147877 +0800 +diff --git a/hotspot/src/cpu/mips/vm/globals_mips.hpp b/hotspot/src/cpu/mips/vm/globals_mips.hpp +new file mode 100644 +index 00000000..988bc351 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/globals_mips.hpp @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. @@ -64220,99 +65272,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + "Eliminate barriers for single active cpu") + +#endif // CPU_MIPS_VM_GLOBALS_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/icache_mips.cpp b/hotspot/src/cpu/mips/vm/icache_mips.cpp ---- a/hotspot/src/cpu/mips/vm/icache_mips.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/icache_mips.cpp 2023-12-20 09:23:19.798147877 +0800 -@@ -0,0 +1,41 @@ -+/* -+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2021, Loongson Technology. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ * -+ */ -+ -+#include "precompiled.hpp" -+#include "asm/macroAssembler.hpp" -+#include "runtime/icache.hpp" -+ -+void ICacheStubGenerator::generate_icache_flush(ICache::flush_icache_stub_t* flush_icache_stub) -+{ -+#define __ _masm-> -+ StubCodeMark mark(this, "ICache", "flush_icache_stub"); -+ address start = __ pc(); -+ -+ __ jr_hb(RA); -+ __ delayed()->ori(V0, RA2, 0); -+ -+ *flush_icache_stub = (ICache::flush_icache_stub_t)start; -+#undef __ -+} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/icache_mips.hpp b/hotspot/src/cpu/mips/vm/icache_mips.hpp ---- a/hotspot/src/cpu/mips/vm/icache_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/icache_mips.hpp 2023-12-20 09:23:19.798147877 +0800 -@@ -0,0 +1,41 @@ -+/* -+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2021, Loongson Technology. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ * -+ */ -+ -+#ifndef CPU_MIPS_VM_ICACHE_MIPS_HPP -+#define CPU_MIPS_VM_ICACHE_MIPS_HPP -+ -+// Interface for updating the instruction cache. Whenever the VM modifies -+// code, part of the processor instruction cache potentially has to be flushed. -+ -+class ICache : public AbstractICache { -+ public: -+ enum { -+ stub_size = 2 * BytesPerInstWord, // Size of the icache flush stub in bytes -+ line_size = 32, // flush instruction affects a dword -+ log2_line_size = 5 // log2(line_size) -+ }; -+}; -+ -+#endif // CPU_MIPS_VM_ICACHE_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/icBuffer_mips.cpp b/hotspot/src/cpu/mips/vm/icBuffer_mips.cpp ---- a/hotspot/src/cpu/mips/vm/icBuffer_mips.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/icBuffer_mips.cpp 2023-12-20 09:23:19.798147877 +0800 +diff --git a/hotspot/src/cpu/mips/vm/icBuffer_mips.cpp b/hotspot/src/cpu/mips/vm/icBuffer_mips.cpp +new file mode 100644 +index 00000000..96ea3453 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/icBuffer_mips.cpp @@ -0,0 +1,97 @@ +/* + * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. @@ -64411,9 +65375,105 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + void* o= (void*)move->data(); + return o; +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/interp_masm_mips_64.cpp b/hotspot/src/cpu/mips/vm/interp_masm_mips_64.cpp ---- a/hotspot/src/cpu/mips/vm/interp_masm_mips_64.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/interp_masm_mips_64.cpp 2023-12-20 09:23:19.798147877 +0800 +diff --git a/hotspot/src/cpu/mips/vm/icache_mips.cpp b/hotspot/src/cpu/mips/vm/icache_mips.cpp +new file mode 100644 +index 00000000..848964b6 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/icache_mips.cpp +@@ -0,0 +1,41 @@ ++/* ++ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2015, 2021, Loongson Technology. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ */ ++ ++#include "precompiled.hpp" ++#include "asm/macroAssembler.hpp" ++#include "runtime/icache.hpp" ++ ++void ICacheStubGenerator::generate_icache_flush(ICache::flush_icache_stub_t* flush_icache_stub) ++{ ++#define __ _masm-> ++ StubCodeMark mark(this, "ICache", "flush_icache_stub"); ++ address start = __ pc(); ++ ++ __ jr_hb(RA); ++ __ delayed()->ori(V0, RA2, 0); ++ ++ *flush_icache_stub = (ICache::flush_icache_stub_t)start; ++#undef __ ++} +diff --git a/hotspot/src/cpu/mips/vm/icache_mips.hpp b/hotspot/src/cpu/mips/vm/icache_mips.hpp +new file mode 100644 +index 00000000..78ee11cc +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/icache_mips.hpp +@@ -0,0 +1,41 @@ ++/* ++ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2015, 2021, Loongson Technology. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ */ ++ ++#ifndef CPU_MIPS_VM_ICACHE_MIPS_HPP ++#define CPU_MIPS_VM_ICACHE_MIPS_HPP ++ ++// Interface for updating the instruction cache. Whenever the VM modifies ++// code, part of the processor instruction cache potentially has to be flushed. ++ ++class ICache : public AbstractICache { ++ public: ++ enum { ++ stub_size = 2 * BytesPerInstWord, // Size of the icache flush stub in bytes ++ line_size = 32, // flush instruction affects a dword ++ log2_line_size = 5 // log2(line_size) ++ }; ++}; ++ ++#endif // CPU_MIPS_VM_ICACHE_MIPS_HPP +diff --git a/hotspot/src/cpu/mips/vm/interp_masm_mips_64.cpp b/hotspot/src/cpu/mips/vm/interp_masm_mips_64.cpp +new file mode 100644 +index 00000000..ed2d931e +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/interp_masm_mips_64.cpp @@ -0,0 +1,2084 @@ +/* + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. @@ -66499,9 +67559,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + unimplemented(); + } +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/interp_masm_mips_64.hpp b/hotspot/src/cpu/mips/vm/interp_masm_mips_64.hpp ---- a/hotspot/src/cpu/mips/vm/interp_masm_mips_64.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/interp_masm_mips_64.hpp 2023-12-20 09:23:19.798147877 +0800 +diff --git a/hotspot/src/cpu/mips/vm/interp_masm_mips_64.hpp b/hotspot/src/cpu/mips/vm/interp_masm_mips_64.hpp +new file mode 100644 +index 00000000..a2ebdec3 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/interp_masm_mips_64.hpp @@ -0,0 +1,269 @@ +/* + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. @@ -66772,9 +67834,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +}; + +#endif // CPU_MIPS_VM_INTERP_MASM_MIPS_64_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/interpreterGenerator_mips.hpp b/hotspot/src/cpu/mips/vm/interpreterGenerator_mips.hpp ---- a/hotspot/src/cpu/mips/vm/interpreterGenerator_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/interpreterGenerator_mips.hpp 2023-12-20 09:23:19.798147877 +0800 +diff --git a/hotspot/src/cpu/mips/vm/interpreterGenerator_mips.hpp b/hotspot/src/cpu/mips/vm/interpreterGenerator_mips.hpp +new file mode 100644 +index 00000000..26fced49 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/interpreterGenerator_mips.hpp @@ -0,0 +1,49 @@ +/* + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. @@ -66825,12 +67889,14 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + void generate_counter_overflow(Label* do_continue); + +#endif // CPU_MIPS_VM_INTERPRETERGENERATOR_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/interpreter_mips_64.cpp b/hotspot/src/cpu/mips/vm/interpreter_mips_64.cpp ---- a/hotspot/src/cpu/mips/vm/interpreter_mips_64.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/interpreter_mips_64.cpp 2023-12-20 09:23:19.798147877 +0800 -@@ -0,0 +1,286 @@ +diff --git a/hotspot/src/cpu/mips/vm/interpreterRT_mips.hpp b/hotspot/src/cpu/mips/vm/interpreterRT_mips.hpp +new file mode 100644 +index 00000000..8dec2007 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/interpreterRT_mips.hpp +@@ -0,0 +1,61 @@ +/* -+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2022, Loongson Technology. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * @@ -66854,327 +67920,50 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + * + */ + -+#include "precompiled.hpp" -+#include "asm/macroAssembler.hpp" -+#include "interpreter/bytecodeHistogram.hpp" -+#include "interpreter/interpreter.hpp" -+#include "interpreter/interpreterGenerator.hpp" -+#include "interpreter/interpreterRuntime.hpp" -+#include "interpreter/templateTable.hpp" -+#include "oops/arrayOop.hpp" -+#include "oops/methodData.hpp" -+#include "oops/method.hpp" -+#include "oops/oop.inline.hpp" -+#include "prims/jvmtiExport.hpp" -+#include "prims/jvmtiThreadState.hpp" -+#include "prims/methodHandles.hpp" -+#include "runtime/arguments.hpp" -+#include "runtime/deoptimization.hpp" -+#include "runtime/frame.inline.hpp" -+#include "runtime/sharedRuntime.hpp" -+#include "runtime/stubRoutines.hpp" -+#include "runtime/synchronizer.hpp" -+#include "runtime/timer.hpp" -+#include "runtime/vframeArray.hpp" -+#include "utilities/debug.hpp" -+ -+#define __ _masm-> -+ -+#define A0 RA0 -+#define A1 RA1 -+#define A2 RA2 -+#define A3 RA3 -+#define A4 RA4 -+#define A5 RA5 -+#define A6 RA6 -+#define A7 RA7 -+#define T0 RT0 -+#define T1 RT1 -+#define T2 RT2 -+#define T3 RT3 -+#define T8 RT8 -+#define T9 RT9 -+ -+ -+address AbstractInterpreterGenerator::generate_slow_signature_handler() { -+ address entry = __ pc(); -+ -+ // Rmethod: method -+ // LVP: pointer to locals -+ // A3: first stack arg -+ __ move(A3, SP); -+ __ daddiu(SP, SP, -10 * wordSize); -+ __ sd(RA, SP, 0); -+ __ call_VM(noreg, -+ CAST_FROM_FN_PTR(address, -+ InterpreterRuntime::slow_signature_handler), -+ Rmethod, LVP, A3); -+ -+ // V0: result handler -+ -+ // Stack layout: -+ // ... -+ // 10 stack arg0 <--- old sp -+ // 9 float/double identifiers -+ // 8 register arg7 -+ // ... -+ // 2 register arg1 -+ // 1 aligned slot -+ // SP: 0 return address -+ -+ // Do FP first so we can use T3 as temp -+ __ ld(T3, Address(SP, 9 * wordSize)); // float/double identifiers -+ -+ // A0 is for env. -+ // If the mothed is not static, A1 will be corrected in generate_native_entry. -+ for ( int i = 1; i < Argument::n_register_parameters; i++ ) { -+ Register reg = as_Register(i + A0->encoding()); -+ FloatRegister floatreg = as_FloatRegister(i + F12->encoding()); -+ Label isfloatordouble, isdouble, next; -+ -+ __ andi(AT, T3, 1 << (i*2)); // Float or Double? -+ __ bne(AT, R0, isfloatordouble); -+ __ delayed()->nop(); -+ -+ // Do Int register here -+ __ ld(reg, SP, (1 + i) * wordSize); -+ __ b (next); -+ __ delayed()->nop(); -+ -+ __ bind(isfloatordouble); -+ __ andi(AT, T3, 1 << ((i*2)+1)); // Double? -+ __ bne(AT, R0, isdouble); -+ __ delayed()->nop(); -+ -+ // Do Float Here -+ __ lwc1(floatreg, SP, (1 + i) * wordSize); -+ __ b(next); -+ __ delayed()->nop(); -+ -+ // Do Double here -+ __ bind(isdouble); -+ __ ldc1(floatreg, SP, (1 + i) * wordSize); -+ -+ __ bind(next); -+ } -+ -+ __ ld(RA, SP, 0); -+ __ daddiu(SP, SP, 10 * wordSize); -+ __ jr(RA); -+ __ delayed()->nop(); -+ return entry; -+} -+ -+ -+// -+// Various method entries -+// -+ -+address InterpreterGenerator::generate_math_entry(AbstractInterpreter::MethodKind kind) { -+ -+ // Rmethod: methodOop -+ // V0: scratrch -+ // Rsender: send 's sp -+ -+ if (!InlineIntrinsics) return NULL; // Generate a vanilla entry ++#ifndef CPU_MIPS_VM_INTERPRETERRT_MIPS_HPP ++#define CPU_MIPS_VM_INTERPRETERRT_MIPS_HPP + -+ address entry_point = __ pc(); ++#include "memory/allocation.hpp" + -+ // These don't need a safepoint check because they aren't virtually -+ // callable. We won't enter these intrinsics from compiled code. -+ // If in the future we added an intrinsic which was virtually callable -+ // we'd have to worry about how to safepoint so that this code is used. ++// native method calls + -+ // mathematical functions inlined by compiler -+ // (interpreter must provide identical implementation -+ // in order to avoid monotonicity bugs when switching -+ // from interpreter to compiler in the middle of some -+ // computation) -+ // -+ // stack: [ lo(arg) ] <-- sp -+ // [ hi(arg) ] -+ { -+ // Note: For JDK 1.3 StrictMath exists and Math.sin/cos/sqrt are -+ // java methods. Interpreter::method_kind(...) will select -+ // this entry point for the corresponding methods in JDK 1.3. -+ __ ldc1(F12, SP, 0 * wordSize); -+ __ ldc1(F13, SP, 1 * wordSize); -+ __ push2(RA, FP); -+ __ daddiu(FP, SP, 2 * wordSize); ++class SignatureHandlerGenerator: public NativeSignatureIterator { ++ private: ++ MacroAssembler* _masm; + -+ // [ fp ] <-- sp -+ // [ ra ] -+ // [ lo ] <-- fp -+ // [ hi ] -+ //FIXME, need consider this -+ switch (kind) { -+ case Interpreter::java_lang_math_sin : -+ __ trigfunc('s'); -+ break; -+ case Interpreter::java_lang_math_cos : -+ __ trigfunc('c'); -+ break; -+ case Interpreter::java_lang_math_tan : -+ __ trigfunc('t'); -+ break; -+ case Interpreter::java_lang_math_sqrt: -+ __ sqrt_d(F0, F12); -+ break; -+ case Interpreter::java_lang_math_abs: -+ __ abs_d(F0, F12); -+ break; -+ case Interpreter::java_lang_math_log: -+ // Store to stack to convert 80bit precision back to 64bits -+ break; -+ case Interpreter::java_lang_math_log10: -+ // Store to stack to convert 80bit precision back to 64bits -+ break; -+ case Interpreter::java_lang_math_pow: -+ break; -+ case Interpreter::java_lang_math_exp: -+ break; ++ void move(int from_offset, int to_offset); + -+ default : -+ ShouldNotReachHere(); -+ } ++ void box(int from_offset, int to_offset); ++ void pass_int(); ++ void pass_long(); ++ void pass_object(); ++ void pass_float(); ++ void pass_double(); + -+ // must maintain return value in F0:F1 -+ __ ld(RA, FP, (-1) * wordSize); -+ //FIXME -+ __ ld(FP, FP, (-2) * wordSize); -+ __ move(SP, Rsender); -+ __ jr(RA); -+ __ delayed()->nop(); ++ public: ++ // Creation ++ SignatureHandlerGenerator(methodHandle method, CodeBuffer* buffer) : NativeSignatureIterator(method) { ++ _masm = new MacroAssembler(buffer); + } -+ return entry_point; -+} -+ -+ -+// Abstract method entry -+// Attempt to execute abstract method. Throw exception -+address InterpreterGenerator::generate_abstract_entry(void) { -+ -+ // Rmethod: methodOop -+ // V0: receiver (unused) -+ // Rsender : sender 's sp -+ address entry_point = __ pc(); -+ -+ // abstract method entry -+ // throw exception -+ // adjust stack to what a normal return would do -+ __ empty_expression_stack(); -+ __ restore_bcp(); -+ __ restore_locals(); -+ __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_AbstractMethodError)); -+ // the call_VM checks for exception, so we should never return here. -+ __ should_not_reach_here(); + -+ return entry_point; -+} -+ -+ -+// Empty method, generate a very fast return. -+ -+address InterpreterGenerator::generate_empty_entry(void) { -+ -+ // Rmethod: methodOop -+ // V0: receiver (unused) -+ // Rsender: sender 's sp , must set sp to this value on return , on mips ,now use T0,as it right? -+ if (!UseFastEmptyMethods) return NULL; -+ -+ address entry_point = __ pc(); -+ -+ Label slow_path; -+ __ li(RT0, SafepointSynchronize::address_of_state()); -+ __ lw(AT, RT0, 0); -+ __ move(RT0, (SafepointSynchronize::_not_synchronized)); -+ __ bne(AT, RT0,slow_path); -+ __ delayed()->nop(); -+ __ move(SP, Rsender); -+ __ jr(RA); -+ __ delayed()->nop(); -+ __ bind(slow_path); -+ (void) generate_normal_entry(false); -+ -+ return entry_point; -+ -+} -+ -+void Deoptimization::unwind_callee_save_values(frame* f, vframeArray* vframe_array) { -+ -+ // This code is sort of the equivalent of C2IAdapter::setup_stack_frame back in -+ // the days we had adapter frames. When we deoptimize a situation where a -+ // compiled caller calls a compiled caller will have registers it expects -+ // to survive the call to the callee. If we deoptimize the callee the only -+ // way we can restore these registers is to have the oldest interpreter -+ // frame that we create restore these values. That is what this routine -+ // will accomplish. ++ // Code generation ++ void generate(uint64_t fingerprint); + -+ // At the moment we have modified c2 to not have any callee save registers -+ // so this problem does not exist and this routine is just a place holder. ++ // Code generation support ++ static Register from(); ++ static Register to(); ++ static Register temp(); ++}; + -+ assert(f->is_interpreted_frame(), "must be interpreted"); -+} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/interpreter_mips.hpp b/hotspot/src/cpu/mips/vm/interpreter_mips.hpp ---- a/hotspot/src/cpu/mips/vm/interpreter_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/interpreter_mips.hpp 2023-12-20 09:23:19.798147877 +0800 -@@ -0,0 +1,50 @@ ++#endif // CPU_MIPS_VM_INTERPRETERRT_MIPS_HPP +diff --git a/hotspot/src/cpu/mips/vm/interpreterRT_mips_64.cpp b/hotspot/src/cpu/mips/vm/interpreterRT_mips_64.cpp +new file mode 100644 +index 00000000..14b7e39a +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/interpreterRT_mips_64.cpp +@@ -0,0 +1,259 @@ +/* -+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2022, Loongson Technology. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ * -+ */ -+ -+#ifndef CPU_MIPS_VM_INTERPRETER_MIPS_HPP -+#define CPU_MIPS_VM_INTERPRETER_MIPS_HPP -+ -+ public: -+ -+ // Sentinel placed in the code for interpreter returns so -+ // that i2c adapters and osr code can recognize an interpreter -+ // return address and convert the return to a specialized -+ // block of code to handle compiedl return values and cleaning -+ // the fpu stack. -+ static const int return_sentinel; -+ -+ static Address::ScaleFactor stackElementScale() { -+ return Address::times_8; -+ } -+ -+ // Offset from sp (which points to the last stack element) -+ static int expr_offset_in_bytes(int i) { return stackElementSize * i; } -+ // Size of interpreter code. Increase if too small. Interpreter will -+ // fail with a guarantee ("not enough space for interpreter generation"); -+ // if too small. -+ // Run with +PrintInterpreterSize to get the VM to print out the size. -+ // Max size with JVMTI and TaggedStackInterpreter -+ const static int InterpreterCodeSize = 168 * 1024; -+#endif // CPU_MIPS_VM_INTERPRETER_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/interpreterRT_mips_64.cpp b/hotspot/src/cpu/mips/vm/interpreterRT_mips_64.cpp ---- a/hotspot/src/cpu/mips/vm/interpreterRT_mips_64.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/interpreterRT_mips_64.cpp 2023-12-20 09:23:19.798147877 +0800 -@@ -0,0 +1,259 @@ -+/* -+ * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2022, Loongson Technology. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * @@ -67432,12 +68221,14 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + // return result handler + return Interpreter::result_handler(m->result_type()); +IRT_END -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/interpreterRT_mips.hpp b/hotspot/src/cpu/mips/vm/interpreterRT_mips.hpp ---- a/hotspot/src/cpu/mips/vm/interpreterRT_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/interpreterRT_mips.hpp 2023-12-20 09:23:19.798147877 +0800 -@@ -0,0 +1,61 @@ +diff --git a/hotspot/src/cpu/mips/vm/interpreter_mips.hpp b/hotspot/src/cpu/mips/vm/interpreter_mips.hpp +new file mode 100644 +index 00000000..9a21d704 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/interpreter_mips.hpp +@@ -0,0 +1,50 @@ +/* -+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2022, Loongson Technology. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * @@ -67461,45 +68252,328 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + * + */ + -+#ifndef CPU_MIPS_VM_INTERPRETERRT_MIPS_HPP -+#define CPU_MIPS_VM_INTERPRETERRT_MIPS_HPP ++#ifndef CPU_MIPS_VM_INTERPRETER_MIPS_HPP ++#define CPU_MIPS_VM_INTERPRETER_MIPS_HPP + -+#include "memory/allocation.hpp" ++ public: + -+// native method calls ++ // Sentinel placed in the code for interpreter returns so ++ // that i2c adapters and osr code can recognize an interpreter ++ // return address and convert the return to a specialized ++ // block of code to handle compiedl return values and cleaning ++ // the fpu stack. ++ static const int return_sentinel; + -+class SignatureHandlerGenerator: public NativeSignatureIterator { -+ private: -+ MacroAssembler* _masm; ++ static Address::ScaleFactor stackElementScale() { ++ return Address::times_8; ++ } + -+ void move(int from_offset, int to_offset); ++ // Offset from sp (which points to the last stack element) ++ static int expr_offset_in_bytes(int i) { return stackElementSize * i; } ++ // Size of interpreter code. Increase if too small. Interpreter will ++ // fail with a guarantee ("not enough space for interpreter generation"); ++ // if too small. ++ // Run with +PrintInterpreterSize to get the VM to print out the size. ++ // Max size with JVMTI and TaggedStackInterpreter ++ const static int InterpreterCodeSize = 168 * 1024; ++#endif // CPU_MIPS_VM_INTERPRETER_MIPS_HPP +diff --git a/hotspot/src/cpu/mips/vm/interpreter_mips_64.cpp b/hotspot/src/cpu/mips/vm/interpreter_mips_64.cpp +new file mode 100644 +index 00000000..014c8127 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/interpreter_mips_64.cpp +@@ -0,0 +1,286 @@ ++/* ++ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2015, 2022, Loongson Technology. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ */ + -+ void box(int from_offset, int to_offset); -+ void pass_int(); -+ void pass_long(); -+ void pass_object(); -+ void pass_float(); -+ void pass_double(); ++#include "precompiled.hpp" ++#include "asm/macroAssembler.hpp" ++#include "interpreter/bytecodeHistogram.hpp" ++#include "interpreter/interpreter.hpp" ++#include "interpreter/interpreterGenerator.hpp" ++#include "interpreter/interpreterRuntime.hpp" ++#include "interpreter/templateTable.hpp" ++#include "oops/arrayOop.hpp" ++#include "oops/methodData.hpp" ++#include "oops/method.hpp" ++#include "oops/oop.inline.hpp" ++#include "prims/jvmtiExport.hpp" ++#include "prims/jvmtiThreadState.hpp" ++#include "prims/methodHandles.hpp" ++#include "runtime/arguments.hpp" ++#include "runtime/deoptimization.hpp" ++#include "runtime/frame.inline.hpp" ++#include "runtime/sharedRuntime.hpp" ++#include "runtime/stubRoutines.hpp" ++#include "runtime/synchronizer.hpp" ++#include "runtime/timer.hpp" ++#include "runtime/vframeArray.hpp" ++#include "utilities/debug.hpp" + -+ public: -+ // Creation -+ SignatureHandlerGenerator(methodHandle method, CodeBuffer* buffer) : NativeSignatureIterator(method) { -+ _masm = new MacroAssembler(buffer); ++#define __ _masm-> ++ ++#define A0 RA0 ++#define A1 RA1 ++#define A2 RA2 ++#define A3 RA3 ++#define A4 RA4 ++#define A5 RA5 ++#define A6 RA6 ++#define A7 RA7 ++#define T0 RT0 ++#define T1 RT1 ++#define T2 RT2 ++#define T3 RT3 ++#define T8 RT8 ++#define T9 RT9 ++ ++ ++address AbstractInterpreterGenerator::generate_slow_signature_handler() { ++ address entry = __ pc(); ++ ++ // Rmethod: method ++ // LVP: pointer to locals ++ // A3: first stack arg ++ __ move(A3, SP); ++ __ daddiu(SP, SP, -10 * wordSize); ++ __ sd(RA, SP, 0); ++ __ call_VM(noreg, ++ CAST_FROM_FN_PTR(address, ++ InterpreterRuntime::slow_signature_handler), ++ Rmethod, LVP, A3); ++ ++ // V0: result handler ++ ++ // Stack layout: ++ // ... ++ // 10 stack arg0 <--- old sp ++ // 9 float/double identifiers ++ // 8 register arg7 ++ // ... ++ // 2 register arg1 ++ // 1 aligned slot ++ // SP: 0 return address ++ ++ // Do FP first so we can use T3 as temp ++ __ ld(T3, Address(SP, 9 * wordSize)); // float/double identifiers ++ ++ // A0 is for env. ++ // If the mothed is not static, A1 will be corrected in generate_native_entry. ++ for ( int i = 1; i < Argument::n_register_parameters; i++ ) { ++ Register reg = as_Register(i + A0->encoding()); ++ FloatRegister floatreg = as_FloatRegister(i + F12->encoding()); ++ Label isfloatordouble, isdouble, next; ++ ++ __ andi(AT, T3, 1 << (i*2)); // Float or Double? ++ __ bne(AT, R0, isfloatordouble); ++ __ delayed()->nop(); ++ ++ // Do Int register here ++ __ ld(reg, SP, (1 + i) * wordSize); ++ __ b (next); ++ __ delayed()->nop(); ++ ++ __ bind(isfloatordouble); ++ __ andi(AT, T3, 1 << ((i*2)+1)); // Double? ++ __ bne(AT, R0, isdouble); ++ __ delayed()->nop(); ++ ++ // Do Float Here ++ __ lwc1(floatreg, SP, (1 + i) * wordSize); ++ __ b(next); ++ __ delayed()->nop(); ++ ++ // Do Double here ++ __ bind(isdouble); ++ __ ldc1(floatreg, SP, (1 + i) * wordSize); ++ ++ __ bind(next); + } + -+ // Code generation -+ void generate(uint64_t fingerprint); ++ __ ld(RA, SP, 0); ++ __ daddiu(SP, SP, 10 * wordSize); ++ __ jr(RA); ++ __ delayed()->nop(); ++ return entry; ++} + -+ // Code generation support -+ static Register from(); -+ static Register to(); -+ static Register temp(); -+}; + -+#endif // CPU_MIPS_VM_INTERPRETERRT_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/javaFrameAnchor_mips.hpp b/hotspot/src/cpu/mips/vm/javaFrameAnchor_mips.hpp ---- a/hotspot/src/cpu/mips/vm/javaFrameAnchor_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/javaFrameAnchor_mips.hpp 2023-12-20 09:23:19.798147877 +0800 ++// ++// Various method entries ++// ++ ++address InterpreterGenerator::generate_math_entry(AbstractInterpreter::MethodKind kind) { ++ ++ // Rmethod: methodOop ++ // V0: scratrch ++ // Rsender: send 's sp ++ ++ if (!InlineIntrinsics) return NULL; // Generate a vanilla entry ++ ++ address entry_point = __ pc(); ++ ++ // These don't need a safepoint check because they aren't virtually ++ // callable. We won't enter these intrinsics from compiled code. ++ // If in the future we added an intrinsic which was virtually callable ++ // we'd have to worry about how to safepoint so that this code is used. ++ ++ // mathematical functions inlined by compiler ++ // (interpreter must provide identical implementation ++ // in order to avoid monotonicity bugs when switching ++ // from interpreter to compiler in the middle of some ++ // computation) ++ // ++ // stack: [ lo(arg) ] <-- sp ++ // [ hi(arg) ] ++ { ++ // Note: For JDK 1.3 StrictMath exists and Math.sin/cos/sqrt are ++ // java methods. Interpreter::method_kind(...) will select ++ // this entry point for the corresponding methods in JDK 1.3. ++ __ ldc1(F12, SP, 0 * wordSize); ++ __ ldc1(F13, SP, 1 * wordSize); ++ __ push2(RA, FP); ++ __ daddiu(FP, SP, 2 * wordSize); ++ ++ // [ fp ] <-- sp ++ // [ ra ] ++ // [ lo ] <-- fp ++ // [ hi ] ++ //FIXME, need consider this ++ switch (kind) { ++ case Interpreter::java_lang_math_sin : ++ __ trigfunc('s'); ++ break; ++ case Interpreter::java_lang_math_cos : ++ __ trigfunc('c'); ++ break; ++ case Interpreter::java_lang_math_tan : ++ __ trigfunc('t'); ++ break; ++ case Interpreter::java_lang_math_sqrt: ++ __ sqrt_d(F0, F12); ++ break; ++ case Interpreter::java_lang_math_abs: ++ __ abs_d(F0, F12); ++ break; ++ case Interpreter::java_lang_math_log: ++ // Store to stack to convert 80bit precision back to 64bits ++ break; ++ case Interpreter::java_lang_math_log10: ++ // Store to stack to convert 80bit precision back to 64bits ++ break; ++ case Interpreter::java_lang_math_pow: ++ break; ++ case Interpreter::java_lang_math_exp: ++ break; ++ ++ default : ++ ShouldNotReachHere(); ++ } ++ ++ // must maintain return value in F0:F1 ++ __ ld(RA, FP, (-1) * wordSize); ++ //FIXME ++ __ ld(FP, FP, (-2) * wordSize); ++ __ move(SP, Rsender); ++ __ jr(RA); ++ __ delayed()->nop(); ++ } ++ return entry_point; ++} ++ ++ ++// Abstract method entry ++// Attempt to execute abstract method. Throw exception ++address InterpreterGenerator::generate_abstract_entry(void) { ++ ++ // Rmethod: methodOop ++ // V0: receiver (unused) ++ // Rsender : sender 's sp ++ address entry_point = __ pc(); ++ ++ // abstract method entry ++ // throw exception ++ // adjust stack to what a normal return would do ++ __ empty_expression_stack(); ++ __ restore_bcp(); ++ __ restore_locals(); ++ __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_AbstractMethodError)); ++ // the call_VM checks for exception, so we should never return here. ++ __ should_not_reach_here(); ++ ++ return entry_point; ++} ++ ++ ++// Empty method, generate a very fast return. ++ ++address InterpreterGenerator::generate_empty_entry(void) { ++ ++ // Rmethod: methodOop ++ // V0: receiver (unused) ++ // Rsender: sender 's sp , must set sp to this value on return , on mips ,now use T0,as it right? ++ if (!UseFastEmptyMethods) return NULL; ++ ++ address entry_point = __ pc(); ++ ++ Label slow_path; ++ __ li(RT0, SafepointSynchronize::address_of_state()); ++ __ lw(AT, RT0, 0); ++ __ move(RT0, (SafepointSynchronize::_not_synchronized)); ++ __ bne(AT, RT0,slow_path); ++ __ delayed()->nop(); ++ __ move(SP, Rsender); ++ __ jr(RA); ++ __ delayed()->nop(); ++ __ bind(slow_path); ++ (void) generate_normal_entry(false); ++ ++ return entry_point; ++ ++} ++ ++void Deoptimization::unwind_callee_save_values(frame* f, vframeArray* vframe_array) { ++ ++ // This code is sort of the equivalent of C2IAdapter::setup_stack_frame back in ++ // the days we had adapter frames. When we deoptimize a situation where a ++ // compiled caller calls a compiled caller will have registers it expects ++ // to survive the call to the callee. If we deoptimize the callee the only ++ // way we can restore these registers is to have the oldest interpreter ++ // frame that we create restore these values. That is what this routine ++ // will accomplish. ++ ++ // At the moment we have modified c2 to not have any callee save registers ++ // so this problem does not exist and this routine is just a place holder. ++ ++ assert(f->is_interpreted_frame(), "must be interpreted"); ++} +diff --git a/hotspot/src/cpu/mips/vm/javaFrameAnchor_mips.hpp b/hotspot/src/cpu/mips/vm/javaFrameAnchor_mips.hpp +new file mode 100644 +index 00000000..dccdf6a0 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/javaFrameAnchor_mips.hpp @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. @@ -67588,9 +68662,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + void set_last_Java_fp(intptr_t* fp) { _last_Java_fp = fp; } + +#endif // CPU_MIPS_VM_JAVAFRAMEANCHOR_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/jniFastGetField_mips_64.cpp b/hotspot/src/cpu/mips/vm/jniFastGetField_mips_64.cpp ---- a/hotspot/src/cpu/mips/vm/jniFastGetField_mips_64.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/jniFastGetField_mips_64.cpp 2023-12-20 09:23:19.798147877 +0800 +diff --git a/hotspot/src/cpu/mips/vm/jniFastGetField_mips_64.cpp b/hotspot/src/cpu/mips/vm/jniFastGetField_mips_64.cpp +new file mode 100644 +index 00000000..0f7dd942 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/jniFastGetField_mips_64.cpp @@ -0,0 +1,172 @@ +/* + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. @@ -67764,64 +68840,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +address JNI_FastGetField::generate_fast_get_double_field() { + return generate_fast_get_int_field0(T_DOUBLE); +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/jni_mips.h b/hotspot/src/cpu/mips/vm/jni_mips.h ---- a/hotspot/src/cpu/mips/vm/jni_mips.h 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/jni_mips.h 2023-12-20 09:23:19.798147877 +0800 -@@ -0,0 +1,51 @@ -+/* -+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2022, Loongson Technology. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. Oracle designates this -+ * particular file as subject to the "Classpath" exception as provided -+ * by Oracle in the LICENSE file that accompanied this code. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ */ -+ -+#ifndef _JAVASOFT_JNI_MD_H_ -+#define _JAVASOFT_JNI_MD_H_ -+ -+// Note: please do not change these without also changing jni_md.h in the JDK -+// repository -+#ifndef __has_attribute -+ #define __has_attribute(x) 0 -+#endif -+#if (defined(__GNUC__) && ((__GNUC__ > 4) || (__GNUC__ == 4) && (__GNUC_MINOR__ > 2))) || __has_attribute(visibility) -+ #define JNIEXPORT __attribute__((visibility("default"))) -+ #define JNIIMPORT __attribute__((visibility("default"))) -+#else -+ #define JNIEXPORT -+ #define JNIIMPORT -+#endif -+ -+#define JNICALL -+ -+typedef int jint; -+ -+typedef long jlong; -+ -+typedef signed char jbyte; -+ -+#endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/jniTypes_mips.hpp b/hotspot/src/cpu/mips/vm/jniTypes_mips.hpp ---- a/hotspot/src/cpu/mips/vm/jniTypes_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/jniTypes_mips.hpp 2023-12-20 09:23:19.798147877 +0800 +diff --git a/hotspot/src/cpu/mips/vm/jniTypes_mips.hpp b/hotspot/src/cpu/mips/vm/jniTypes_mips.hpp +new file mode 100644 +index 00000000..dfcd47b4 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/jniTypes_mips.hpp @@ -0,0 +1,144 @@ +/* + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. @@ -67967,9 +68990,68 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +}; + +#endif // CPU_MIPS_VM_JNITYPES_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/macroAssembler_mips.cpp b/hotspot/src/cpu/mips/vm/macroAssembler_mips.cpp ---- a/hotspot/src/cpu/mips/vm/macroAssembler_mips.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/macroAssembler_mips.cpp 2023-12-20 09:23:19.798147877 +0800 +diff --git a/hotspot/src/cpu/mips/vm/jni_mips.h b/hotspot/src/cpu/mips/vm/jni_mips.h +new file mode 100644 +index 00000000..6714f51d +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/jni_mips.h +@@ -0,0 +1,51 @@ ++/* ++ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2015, 2022, Loongson Technology. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. Oracle designates this ++ * particular file as subject to the "Classpath" exception as provided ++ * by Oracle in the LICENSE file that accompanied this code. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ */ ++ ++#ifndef _JAVASOFT_JNI_MD_H_ ++#define _JAVASOFT_JNI_MD_H_ ++ ++// Note: please do not change these without also changing jni_md.h in the JDK ++// repository ++#ifndef __has_attribute ++ #define __has_attribute(x) 0 ++#endif ++#if (defined(__GNUC__) && ((__GNUC__ > 4) || (__GNUC__ == 4) && (__GNUC_MINOR__ > 2))) || __has_attribute(visibility) ++ #define JNIEXPORT __attribute__((visibility("default"))) ++ #define JNIIMPORT __attribute__((visibility("default"))) ++#else ++ #define JNIEXPORT ++ #define JNIIMPORT ++#endif ++ ++#define JNICALL ++ ++typedef int jint; ++ ++typedef long jlong; ++ ++typedef signed char jbyte; ++ ++#endif +diff --git a/hotspot/src/cpu/mips/vm/macroAssembler_mips.cpp b/hotspot/src/cpu/mips/vm/macroAssembler_mips.cpp +new file mode 100644 +index 00000000..2b8840ae +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/macroAssembler_mips.cpp @@ -0,0 +1,4332 @@ +/* + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. @@ -72303,9 +73385,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + Unimplemented(); + } +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/macroAssembler_mips.hpp b/hotspot/src/cpu/mips/vm/macroAssembler_mips.hpp ---- a/hotspot/src/cpu/mips/vm/macroAssembler_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/macroAssembler_mips.hpp 2023-12-20 09:23:19.798147877 +0800 +diff --git a/hotspot/src/cpu/mips/vm/macroAssembler_mips.hpp b/hotspot/src/cpu/mips/vm/macroAssembler_mips.hpp +new file mode 100644 +index 00000000..ab972779 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/macroAssembler_mips.hpp @@ -0,0 +1,701 @@ +/* + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. @@ -73008,9 +74092,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + + +#endif // CPU_MIPS_VM_MACROASSEMBLER_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/macroAssembler_mips.inline.hpp b/hotspot/src/cpu/mips/vm/macroAssembler_mips.inline.hpp ---- a/hotspot/src/cpu/mips/vm/macroAssembler_mips.inline.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/macroAssembler_mips.inline.hpp 2023-12-20 09:23:19.798147877 +0800 +diff --git a/hotspot/src/cpu/mips/vm/macroAssembler_mips.inline.hpp b/hotspot/src/cpu/mips/vm/macroAssembler_mips.inline.hpp +new file mode 100644 +index 00000000..92c05fb7 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/macroAssembler_mips.inline.hpp @@ -0,0 +1,34 @@ +/* + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. @@ -73046,9 +74132,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +#include "code/codeCache.hpp" + +#endif // CPU_MIPS_VM_MACROASSEMBLER_MIPS_INLINE_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/metaspaceShared_mips_64.cpp b/hotspot/src/cpu/mips/vm/metaspaceShared_mips_64.cpp ---- a/hotspot/src/cpu/mips/vm/metaspaceShared_mips_64.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/metaspaceShared_mips_64.cpp 2023-12-20 09:23:19.798147877 +0800 +diff --git a/hotspot/src/cpu/mips/vm/metaspaceShared_mips_64.cpp b/hotspot/src/cpu/mips/vm/metaspaceShared_mips_64.cpp +new file mode 100644 +index 00000000..0c467df2 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/metaspaceShared_mips_64.cpp @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved. @@ -73173,9 +74261,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + + *mc_top = (char*)__ pc(); +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/methodHandles_mips.cpp b/hotspot/src/cpu/mips/vm/methodHandles_mips.cpp ---- a/hotspot/src/cpu/mips/vm/methodHandles_mips.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/methodHandles_mips.cpp 2023-12-20 09:23:19.798147877 +0800 +diff --git a/hotspot/src/cpu/mips/vm/methodHandles_mips.cpp b/hotspot/src/cpu/mips/vm/methodHandles_mips.cpp +new file mode 100644 +index 00000000..428c2713 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/methodHandles_mips.cpp @@ -0,0 +1,576 @@ +/* + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. @@ -73753,9 +74843,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +void MethodHandles::trace_method_handle(MacroAssembler* _masm, const char* adaptername) { +} +#endif //PRODUCT -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/methodHandles_mips.hpp b/hotspot/src/cpu/mips/vm/methodHandles_mips.hpp ---- a/hotspot/src/cpu/mips/vm/methodHandles_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/methodHandles_mips.hpp 2023-12-20 09:23:19.798147877 +0800 +diff --git a/hotspot/src/cpu/mips/vm/methodHandles_mips.hpp b/hotspot/src/cpu/mips/vm/methodHandles_mips.hpp +new file mode 100644 +index 00000000..03b65fc8 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/methodHandles_mips.hpp @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved. @@ -73819,9 +74911,42 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + // Should be in sharedRuntime, not here. + return I29; + } -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/mips_64.ad b/hotspot/src/cpu/mips/vm/mips_64.ad ---- a/hotspot/src/cpu/mips/vm/mips_64.ad 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/mips_64.ad 2024-01-30 13:54:24.792708955 +0800 +diff --git a/hotspot/src/cpu/mips/vm/mips.ad b/hotspot/src/cpu/mips/vm/mips.ad +new file mode 100644 +index 00000000..3563bbe0 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/mips.ad +@@ -0,0 +1,25 @@ ++// ++// Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. ++// Copyright (c) 2015, 2016, Loongson Technology. All rights reserved. ++// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++// ++// This code is free software; you can redistribute it and/or modify it ++// under the terms of the GNU General Public License version 2 only, as ++// published by the Free Software Foundation. ++// ++// This code is distributed in the hope that it will be useful, but WITHOUT ++// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++// version 2 for more details (a copy is included in the LICENSE file that ++// accompanied this code). ++// ++// You should have received a copy of the GNU General Public License version ++// 2 along with this work; if not, write to the Free Software Foundation, ++// Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++// ++// Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++// or visit www.oracle.com if you need additional information or have any ++// questions. ++// ++// ++ +diff --git a/hotspot/src/cpu/mips/vm/mips_64.ad b/hotspot/src/cpu/mips/vm/mips_64.ad +new file mode 100644 +index 00000000..29125913 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/mips_64.ad @@ -0,0 +1,14036 @@ +// +// Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. @@ -87859,38 +88984,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +// These must follow all instruction definitions as they use the names +// defined in the instructions definitions. + -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/mips.ad b/hotspot/src/cpu/mips/vm/mips.ad ---- a/hotspot/src/cpu/mips/vm/mips.ad 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/mips.ad 2023-12-20 09:23:19.798147877 +0800 -@@ -0,0 +1,25 @@ -+// -+// Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. -+// Copyright (c) 2015, 2016, Loongson Technology. All rights reserved. -+// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+// -+// This code is free software; you can redistribute it and/or modify it -+// under the terms of the GNU General Public License version 2 only, as -+// published by the Free Software Foundation. -+// -+// This code is distributed in the hope that it will be useful, but WITHOUT -+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+// version 2 for more details (a copy is included in the LICENSE file that -+// accompanied this code). -+// -+// You should have received a copy of the GNU General Public License version -+// 2 along with this work; if not, write to the Free Software Foundation, -+// Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+// -+// Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+// or visit www.oracle.com if you need additional information or have any -+// questions. -+// -+// -+ -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/nativeInst_mips.cpp b/hotspot/src/cpu/mips/vm/nativeInst_mips.cpp ---- a/hotspot/src/cpu/mips/vm/nativeInst_mips.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/nativeInst_mips.cpp 2023-12-20 09:23:19.798147877 +0800 +diff --git a/hotspot/src/cpu/mips/vm/nativeInst_mips.cpp b/hotspot/src/cpu/mips/vm/nativeInst_mips.cpp +new file mode 100644 +index 00000000..e1f7cd94 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/nativeInst_mips.cpp @@ -0,0 +1,1829 @@ +/* + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. @@ -89721,9 +90819,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + // we check the safepoint instruction like the this. + return is_op(Assembler::lw_op) && is_rt(AT); +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/nativeInst_mips.hpp b/hotspot/src/cpu/mips/vm/nativeInst_mips.hpp ---- a/hotspot/src/cpu/mips/vm/nativeInst_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/nativeInst_mips.hpp 2023-12-20 09:23:19.798147877 +0800 +diff --git a/hotspot/src/cpu/mips/vm/nativeInst_mips.hpp b/hotspot/src/cpu/mips/vm/nativeInst_mips.hpp +new file mode 100644 +index 00000000..13a4cb4e +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/nativeInst_mips.hpp @@ -0,0 +1,735 @@ +/* + * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. @@ -90460,9 +91560,64 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +} + +#endif // CPU_MIPS_VM_NATIVEINST_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/register_definitions_mips.cpp b/hotspot/src/cpu/mips/vm/register_definitions_mips.cpp ---- a/hotspot/src/cpu/mips/vm/register_definitions_mips.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/register_definitions_mips.cpp 2023-12-20 09:23:19.798147877 +0800 +diff --git a/hotspot/src/cpu/mips/vm/registerMap_mips.hpp b/hotspot/src/cpu/mips/vm/registerMap_mips.hpp +new file mode 100644 +index 00000000..7f800eb1 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/registerMap_mips.hpp +@@ -0,0 +1,47 @@ ++/* ++ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2015, 2016, Loongson Technology. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ */ ++ ++#ifndef CPU_MIPS_VM_REGISTERMAP_MIPS_HPP ++#define CPU_MIPS_VM_REGISTERMAP_MIPS_HPP ++ ++// machine-dependent implemention for register maps ++ friend class frame; ++ ++ private: ++#ifndef CORE ++ // This is the hook for finding a register in an "well-known" location, ++ // such as a register block of a predetermined format. ++ // Since there is none, we just return NULL. ++ // See registerMap_sparc.hpp for an example of grabbing registers ++ // from register save areas of a standard layout. ++ address pd_location(VMReg reg) const {return NULL;} ++#endif ++ ++ // no PD state to clear or copy: ++ void pd_clear() {} ++ void pd_initialize() {} ++ void pd_initialize_from(const RegisterMap* map) {} ++ ++#endif // CPU_MIPS_VM_REGISTERMAP_MIPS_HPP +diff --git a/hotspot/src/cpu/mips/vm/register_definitions_mips.cpp b/hotspot/src/cpu/mips/vm/register_definitions_mips.cpp +new file mode 100644 +index 00000000..4af25318 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/register_definitions_mips.cpp @@ -0,0 +1,103 @@ +/* + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. @@ -90567,60 +91722,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +REGISTER_DEFINITION(FloatRegister, f29); +REGISTER_DEFINITION(FloatRegister, f30); +REGISTER_DEFINITION(FloatRegister, f31); -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/registerMap_mips.hpp b/hotspot/src/cpu/mips/vm/registerMap_mips.hpp ---- a/hotspot/src/cpu/mips/vm/registerMap_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/registerMap_mips.hpp 2023-12-20 09:23:19.798147877 +0800 -@@ -0,0 +1,47 @@ -+/* -+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2016, Loongson Technology. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ * -+ */ -+ -+#ifndef CPU_MIPS_VM_REGISTERMAP_MIPS_HPP -+#define CPU_MIPS_VM_REGISTERMAP_MIPS_HPP -+ -+// machine-dependent implemention for register maps -+ friend class frame; -+ -+ private: -+#ifndef CORE -+ // This is the hook for finding a register in an "well-known" location, -+ // such as a register block of a predetermined format. -+ // Since there is none, we just return NULL. -+ // See registerMap_sparc.hpp for an example of grabbing registers -+ // from register save areas of a standard layout. -+ address pd_location(VMReg reg) const {return NULL;} -+#endif -+ -+ // no PD state to clear or copy: -+ void pd_clear() {} -+ void pd_initialize() {} -+ void pd_initialize_from(const RegisterMap* map) {} -+ -+#endif // CPU_MIPS_VM_REGISTERMAP_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/register_mips.cpp b/hotspot/src/cpu/mips/vm/register_mips.cpp ---- a/hotspot/src/cpu/mips/vm/register_mips.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/register_mips.cpp 2023-12-20 09:23:19.798147877 +0800 +diff --git a/hotspot/src/cpu/mips/vm/register_mips.cpp b/hotspot/src/cpu/mips/vm/register_mips.cpp +new file mode 100644 +index 00000000..4a9b22bf +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/register_mips.cpp @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. @@ -90674,9 +91780,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + return is_valid() ? names[encoding()] : "fnoreg"; +} + -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/register_mips.hpp b/hotspot/src/cpu/mips/vm/register_mips.hpp ---- a/hotspot/src/cpu/mips/vm/register_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/register_mips.hpp 2023-12-20 09:23:19.798147877 +0800 +diff --git a/hotspot/src/cpu/mips/vm/register_mips.hpp b/hotspot/src/cpu/mips/vm/register_mips.hpp +new file mode 100644 +index 00000000..88bf2d68 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/register_mips.hpp @@ -0,0 +1,346 @@ +/* + * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. @@ -91024,9 +92132,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +}; + +#endif //CPU_MIPS_VM_REGISTER_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/relocInfo_mips.cpp b/hotspot/src/cpu/mips/vm/relocInfo_mips.cpp ---- a/hotspot/src/cpu/mips/vm/relocInfo_mips.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/relocInfo_mips.cpp 2023-12-20 09:23:19.798147877 +0800 +diff --git a/hotspot/src/cpu/mips/vm/relocInfo_mips.cpp b/hotspot/src/cpu/mips/vm/relocInfo_mips.cpp +new file mode 100644 +index 00000000..cae43b2d +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/relocInfo_mips.cpp @@ -0,0 +1,156 @@ +/* + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. @@ -91184,9 +92294,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + +void metadata_Relocation::pd_fix_value(address x) { +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/relocInfo_mips.hpp b/hotspot/src/cpu/mips/vm/relocInfo_mips.hpp ---- a/hotspot/src/cpu/mips/vm/relocInfo_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/relocInfo_mips.hpp 2023-12-20 09:23:19.798147877 +0800 +diff --git a/hotspot/src/cpu/mips/vm/relocInfo_mips.hpp b/hotspot/src/cpu/mips/vm/relocInfo_mips.hpp +new file mode 100644 +index 00000000..04ad5dac +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/relocInfo_mips.hpp @@ -0,0 +1,40 @@ +/* + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. @@ -91228,9 +92340,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + }; + +#endif // CPU_MIPS_VM_RELOCINFO_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/runtime_mips_64.cpp b/hotspot/src/cpu/mips/vm/runtime_mips_64.cpp ---- a/hotspot/src/cpu/mips/vm/runtime_mips_64.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/runtime_mips_64.cpp 2023-12-20 09:23:19.798147877 +0800 +diff --git a/hotspot/src/cpu/mips/vm/runtime_mips_64.cpp b/hotspot/src/cpu/mips/vm/runtime_mips_64.cpp +new file mode 100644 +index 00000000..bb9269b4 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/runtime_mips_64.cpp @@ -0,0 +1,206 @@ +/* + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. @@ -91438,9 +92552,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + + _exception_blob = ExceptionBlob::create(&buffer, oop_maps, framesize); +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/sharedRuntime_mips_64.cpp b/hotspot/src/cpu/mips/vm/sharedRuntime_mips_64.cpp ---- a/hotspot/src/cpu/mips/vm/sharedRuntime_mips_64.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/sharedRuntime_mips_64.cpp 2023-12-20 09:23:19.801481172 +0800 +diff --git a/hotspot/src/cpu/mips/vm/sharedRuntime_mips_64.cpp b/hotspot/src/cpu/mips/vm/sharedRuntime_mips_64.cpp +new file mode 100644 +index 00000000..daf04c44 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/sharedRuntime_mips_64.cpp @@ -0,0 +1,3816 @@ +/* + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. @@ -95258,9 +96374,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + + reverse_words(m, (unsigned long *)m_ints, longwords); +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/stubGenerator_mips_64.cpp b/hotspot/src/cpu/mips/vm/stubGenerator_mips_64.cpp ---- a/hotspot/src/cpu/mips/vm/stubGenerator_mips_64.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/stubGenerator_mips_64.cpp 2023-12-20 09:23:19.801481172 +0800 +diff --git a/hotspot/src/cpu/mips/vm/stubGenerator_mips_64.cpp b/hotspot/src/cpu/mips/vm/stubGenerator_mips_64.cpp +new file mode 100644 +index 00000000..aeb797fa +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/stubGenerator_mips_64.cpp @@ -0,0 +1,2147 @@ +/* + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. @@ -97409,9 +98527,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +void StubGenerator_generate(CodeBuffer* code, bool all) { + StubGenerator g(code, all); +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/stubRoutines_mips_64.cpp b/hotspot/src/cpu/mips/vm/stubRoutines_mips_64.cpp ---- a/hotspot/src/cpu/mips/vm/stubRoutines_mips_64.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/stubRoutines_mips_64.cpp 2023-12-20 09:23:19.801481172 +0800 +diff --git a/hotspot/src/cpu/mips/vm/stubRoutines_mips_64.cpp b/hotspot/src/cpu/mips/vm/stubRoutines_mips_64.cpp +new file mode 100644 +index 00000000..733a48b8 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/stubRoutines_mips_64.cpp @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. @@ -97448,9 +98568,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + +//find the last fp value +address StubRoutines::gs2::_call_stub_compiled_return = NULL; -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/stubRoutines_mips_64.hpp b/hotspot/src/cpu/mips/vm/stubRoutines_mips_64.hpp ---- a/hotspot/src/cpu/mips/vm/stubRoutines_mips_64.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/stubRoutines_mips_64.hpp 2023-12-20 09:23:19.801481172 +0800 +diff --git a/hotspot/src/cpu/mips/vm/stubRoutines_mips_64.hpp b/hotspot/src/cpu/mips/vm/stubRoutines_mips_64.hpp +new file mode 100644 +index 00000000..920c0884 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/stubRoutines_mips_64.hpp @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. @@ -97511,9 +98633,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +}; + +#endif // CPU_MIPS_VM_STUBROUTINES_MIPS_64_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/templateInterpreterGenerator_mips.hpp b/hotspot/src/cpu/mips/vm/templateInterpreterGenerator_mips.hpp ---- a/hotspot/src/cpu/mips/vm/templateInterpreterGenerator_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/templateInterpreterGenerator_mips.hpp 2023-12-20 09:23:19.801481172 +0800 +diff --git a/hotspot/src/cpu/mips/vm/templateInterpreterGenerator_mips.hpp b/hotspot/src/cpu/mips/vm/templateInterpreterGenerator_mips.hpp +new file mode 100644 +index 00000000..a83c3728 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/templateInterpreterGenerator_mips.hpp @@ -0,0 +1,35 @@ +/* + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. @@ -97550,9 +98674,58 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + // address generate_asm_interpreter_entry(bool synchronized); + +#endif // CPU_MIPS_VM_TEMPLATEINTERPRETERGENERATOR_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/templateInterpreter_mips_64.cpp b/hotspot/src/cpu/mips/vm/templateInterpreter_mips_64.cpp ---- a/hotspot/src/cpu/mips/vm/templateInterpreter_mips_64.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/templateInterpreter_mips_64.cpp 2023-12-20 09:23:19.801481172 +0800 +diff --git a/hotspot/src/cpu/mips/vm/templateInterpreter_mips.hpp b/hotspot/src/cpu/mips/vm/templateInterpreter_mips.hpp +new file mode 100644 +index 00000000..204f1b2f +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/templateInterpreter_mips.hpp +@@ -0,0 +1,41 @@ ++/* ++ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2015, 2022, Loongson Technology. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ */ ++ ++#ifndef CPU_MIPS_VM_TEMPLATEINTERPRETER_MIPS_HPP ++#define CPU_MIPS_VM_TEMPLATEINTERPRETER_MIPS_HPP ++ ++ ++ protected: ++ ++ // Size of interpreter code. Increase if too small. Interpreter will ++ // fail with a guarantee ("not enough space for interpreter generation"); ++ // if too small. ++ // Run with +PrintInterpreter to get the VM to print out the size. ++ // Max size with JVMTI ++ // The sethi() instruction generates lots more instructions when shell ++ // stack limit is unlimited, so that's why this is much bigger. ++ const static int InterpreterCodeSize = 500 * K; ++ ++#endif // CPU_MIPS_VM_TEMPLATEINTERPRETER_MIPS_HPP +diff --git a/hotspot/src/cpu/mips/vm/templateInterpreter_mips_64.cpp b/hotspot/src/cpu/mips/vm/templateInterpreter_mips_64.cpp +new file mode 100644 +index 00000000..0cc5d330 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/templateInterpreter_mips_64.cpp @@ -0,0 +1,2306 @@ +/* + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. @@ -99860,13 +101033,15 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +} +#endif // !PRODUCT +#endif // ! CC_INTERP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/templateInterpreter_mips.hpp b/hotspot/src/cpu/mips/vm/templateInterpreter_mips.hpp ---- a/hotspot/src/cpu/mips/vm/templateInterpreter_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/templateInterpreter_mips.hpp 2023-12-20 09:23:19.801481172 +0800 -@@ -0,0 +1,41 @@ +diff --git a/hotspot/src/cpu/mips/vm/templateTable_mips.hpp b/hotspot/src/cpu/mips/vm/templateTable_mips.hpp +new file mode 100644 +index 00000000..d879e6dc +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/templateTable_mips.hpp +@@ -0,0 +1,34 @@ +/* -+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2022, Loongson Technology. All rights reserved. ++ * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2015, 2016, Loongson Technology. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it @@ -99889,25 +101064,20 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + * + */ + -+#ifndef CPU_MIPS_VM_TEMPLATEINTERPRETER_MIPS_HPP -+#define CPU_MIPS_VM_TEMPLATEINTERPRETER_MIPS_HPP -+ -+ -+ protected: -+ -+ // Size of interpreter code. Increase if too small. Interpreter will -+ // fail with a guarantee ("not enough space for interpreter generation"); -+ // if too small. -+ // Run with +PrintInterpreter to get the VM to print out the size. -+ // Max size with JVMTI -+ // The sethi() instruction generates lots more instructions when shell -+ // stack limit is unlimited, so that's why this is much bigger. -+ const static int InterpreterCodeSize = 500 * K; ++ static void prepare_invoke(Register method, Register index, int byte_no, ++ Bytecodes::Code code); ++ static void invokevirtual_helper(Register index, Register recv, ++ Register flags); ++ static void volatile_barrier(); + -+#endif // CPU_MIPS_VM_TEMPLATEINTERPRETER_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/templateTable_mips_64.cpp b/hotspot/src/cpu/mips/vm/templateTable_mips_64.cpp ---- a/hotspot/src/cpu/mips/vm/templateTable_mips_64.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/templateTable_mips_64.cpp 2023-12-20 09:23:19.801481172 +0800 ++ // Helpers ++ static void index_check(Register array, Register index); ++ static void index_check_without_pop(Register array, Register index); +diff --git a/hotspot/src/cpu/mips/vm/templateTable_mips_64.cpp b/hotspot/src/cpu/mips/vm/templateTable_mips_64.cpp +new file mode 100644 +index 00000000..7415511b +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/templateTable_mips_64.cpp @@ -0,0 +1,4623 @@ +/* + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. @@ -104532,9 +105702,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + __ sync(); +} +#endif // !CC_INTERP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/templateTable_mips_64.hpp b/hotspot/src/cpu/mips/vm/templateTable_mips_64.hpp ---- a/hotspot/src/cpu/mips/vm/templateTable_mips_64.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/templateTable_mips_64.hpp 2023-12-20 09:23:19.801481172 +0800 +diff --git a/hotspot/src/cpu/mips/vm/templateTable_mips_64.hpp b/hotspot/src/cpu/mips/vm/templateTable_mips_64.hpp +new file mode 100644 +index 00000000..b63274a2 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/templateTable_mips_64.hpp @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. @@ -104580,12 +105752,14 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + static void index_check_without_pop(Register array, Register index); + +#endif // CPU_MIPS_VM_TEMPLATETABLE_MIPS_64_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/templateTable_mips.hpp b/hotspot/src/cpu/mips/vm/templateTable_mips.hpp ---- a/hotspot/src/cpu/mips/vm/templateTable_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/templateTable_mips.hpp 2023-12-20 09:23:19.801481172 +0800 -@@ -0,0 +1,34 @@ +diff --git a/hotspot/src/cpu/mips/vm/vmStructs_mips.hpp b/hotspot/src/cpu/mips/vm/vmStructs_mips.hpp +new file mode 100644 +index 00000000..69399143 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/vmStructs_mips.hpp +@@ -0,0 +1,68 @@ +/* -+ * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, Loongson Technology. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * @@ -104609,260 +105783,58 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + * + */ + -+ static void prepare_invoke(Register method, Register index, int byte_no, -+ Bytecodes::Code code); -+ static void invokevirtual_helper(Register index, Register recv, -+ Register flags); -+ static void volatile_barrier(); ++#ifndef CPU_MIPS_VM_VMSTRUCTS_MIPS_HPP ++#define CPU_MIPS_VM_VMSTRUCTS_MIPS_HPP + -+ // Helpers -+ static void index_check(Register array, Register index); -+ static void index_check_without_pop(Register array, Register index); -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/vmreg_mips.cpp b/hotspot/src/cpu/mips/vm/vmreg_mips.cpp ---- a/hotspot/src/cpu/mips/vm/vmreg_mips.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/vmreg_mips.cpp 2023-12-20 09:23:19.801481172 +0800 -@@ -0,0 +1,51 @@ ++// These are the CPU-specific fields, types and integer ++// constants required by the Serviceability Agent. This file is ++// referenced by vmStructs.cpp. ++ ++#define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field, unchecked_c1_static_field, unchecked_c2_static_field) \ ++ \ ++ /******************************/ \ ++ /* JavaCallWrapper */ \ ++ /******************************/ \ ++ /******************************/ \ ++ /* JavaFrameAnchor */ \ ++ /******************************/ \ ++ volatile_nonstatic_field(JavaFrameAnchor, _last_Java_fp, intptr_t*) \ ++ \ ++ ++ /* NOTE that we do not use the last_entry() macro here; it is used */ ++ /* in vmStructs__.hpp's VM_STRUCTS_OS_CPU macro (and must */ ++ /* be present there) */ ++ ++ ++#define VM_TYPES_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c1_toplevel_type, declare_c2_type, declare_c2_toplevel_type) \ ++ ++ /* NOTE that we do not use the last_entry() macro here; it is used */ ++ /* in vmStructs__.hpp's VM_TYPES_OS_CPU macro (and must */ ++ /* be present there) */ ++ ++ ++#define VM_INT_CONSTANTS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant) \ ++ ++ /* NOTE that we do not use the last_entry() macro here; it is used */ ++ /* in vmStructs__.hpp's VM_INT_CONSTANTS_OS_CPU macro (and must */ ++ /* be present there) */ ++ ++#define VM_LONG_CONSTANTS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant) \ ++ ++ /* NOTE that we do not use the last_entry() macro here; it is used */ ++ /* in vmStructs__.hpp's VM_LONG_CONSTANTS_OS_CPU macro (and must */ ++ /* be present there) */ ++ ++#endif // CPU_MIPS_VM_VMSTRUCTS_MIPS_HPP +diff --git a/hotspot/src/cpu/mips/vm/vm_version_ext_mips.cpp b/hotspot/src/cpu/mips/vm/vm_version_ext_mips.cpp +new file mode 100644 +index 00000000..a98f70d9 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/vm_version_ext_mips.cpp +@@ -0,0 +1,89 @@ +/* -+ * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2022, Loongson Technology. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ * -+ */ -+ -+#include "precompiled.hpp" -+#include "asm/assembler.hpp" -+#include "code/vmreg.hpp" -+ -+ -+ -+void VMRegImpl::set_regName() { -+ Register reg = ::as_Register(0); -+ int i; -+ for (i = 0; i < ConcreteRegisterImpl::max_gpr ; ) { -+ regName[i++] = reg->name(); -+ regName[i++] = reg->name(); -+ reg = reg->successor(); -+ } -+ -+ FloatRegister freg = ::as_FloatRegister(0); -+ for ( ; i < ConcreteRegisterImpl::max_fpr ; ) { -+ regName[i++] = freg->name(); -+ regName[i++] = freg->name(); -+ freg = freg->successor(); -+ } -+ -+ for ( ; i < ConcreteRegisterImpl::number_of_registers ; i ++ ) { -+ regName[i] = "NON-GPR-FPR"; -+ } -+} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/vmreg_mips.hpp b/hotspot/src/cpu/mips/vm/vmreg_mips.hpp ---- a/hotspot/src/cpu/mips/vm/vmreg_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/vmreg_mips.hpp 2023-12-20 09:23:19.801481172 +0800 -@@ -0,0 +1,35 @@ -+/* -+ * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2019, Loongson Technology. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ * -+ */ -+ -+#ifndef CPU_MIPS_VM_VMREG_MIPS_HPP -+#define CPU_MIPS_VM_VMREG_MIPS_HPP -+ -+bool is_Register(); -+Register as_Register(); -+ -+bool is_FloatRegister(); -+FloatRegister as_FloatRegister(); -+ -+#endif // CPU_MIPS_VM_VMREG_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/vmreg_mips.inline.hpp b/hotspot/src/cpu/mips/vm/vmreg_mips.inline.hpp ---- a/hotspot/src/cpu/mips/vm/vmreg_mips.inline.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/vmreg_mips.inline.hpp 2023-12-20 09:23:19.801481172 +0800 -@@ -0,0 +1,68 @@ -+/* -+ * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2022, Loongson Technology. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ * -+ */ -+ -+#ifndef CPU_MIPS_VM_VMREG_MIPS_INLINE_HPP -+#define CPU_MIPS_VM_VMREG_MIPS_INLINE_HPP -+ -+inline VMReg RegisterImpl::as_VMReg() { -+ if( this==noreg ) return VMRegImpl::Bad(); -+ return VMRegImpl::as_VMReg(encoding() << 1 ); -+} -+ -+inline VMReg FloatRegisterImpl::as_VMReg() { -+ return VMRegImpl::as_VMReg((encoding() << 1) + ConcreteRegisterImpl::max_gpr); -+} -+ -+inline bool VMRegImpl::is_Register() { -+ return (unsigned int) value() < (unsigned int) ConcreteRegisterImpl::max_gpr; -+} -+ -+inline bool VMRegImpl::is_FloatRegister() { -+ return value() >= ConcreteRegisterImpl::max_gpr && value() < ConcreteRegisterImpl::max_fpr; -+} -+ -+inline Register VMRegImpl::as_Register() { -+ -+ assert( is_Register(), "must be"); -+ // Yuk -+ return ::as_Register(value() >> 1); -+} -+ -+inline FloatRegister VMRegImpl::as_FloatRegister() { -+ assert( is_FloatRegister(), "must be" ); -+ // Yuk -+ assert( is_even(value()), "must be" ); -+ return ::as_FloatRegister((value() - ConcreteRegisterImpl::max_gpr) >> 1); -+} -+ -+inline bool VMRegImpl::is_concrete() { -+ assert(is_reg(), "must be"); -+ if(is_Register()) return true; -+ if(is_FloatRegister()) return true; -+ assert(false, "what register?"); -+ return false; -+} -+ -+#endif // CPU_MIPS_VM_VMREG_MIPS_INLINE_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/vmStructs_mips.hpp b/hotspot/src/cpu/mips/vm/vmStructs_mips.hpp ---- a/hotspot/src/cpu/mips/vm/vmStructs_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/vmStructs_mips.hpp 2023-12-20 09:23:19.801481172 +0800 -@@ -0,0 +1,68 @@ -+/* -+ * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2016, Loongson Technology. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ * -+ */ -+ -+#ifndef CPU_MIPS_VM_VMSTRUCTS_MIPS_HPP -+#define CPU_MIPS_VM_VMSTRUCTS_MIPS_HPP -+ -+// These are the CPU-specific fields, types and integer -+// constants required by the Serviceability Agent. This file is -+// referenced by vmStructs.cpp. -+ -+#define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field, unchecked_c1_static_field, unchecked_c2_static_field) \ -+ \ -+ /******************************/ \ -+ /* JavaCallWrapper */ \ -+ /******************************/ \ -+ /******************************/ \ -+ /* JavaFrameAnchor */ \ -+ /******************************/ \ -+ volatile_nonstatic_field(JavaFrameAnchor, _last_Java_fp, intptr_t*) \ -+ \ -+ -+ /* NOTE that we do not use the last_entry() macro here; it is used */ -+ /* in vmStructs__.hpp's VM_STRUCTS_OS_CPU macro (and must */ -+ /* be present there) */ -+ -+ -+#define VM_TYPES_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c1_toplevel_type, declare_c2_type, declare_c2_toplevel_type) \ -+ -+ /* NOTE that we do not use the last_entry() macro here; it is used */ -+ /* in vmStructs__.hpp's VM_TYPES_OS_CPU macro (and must */ -+ /* be present there) */ -+ -+ -+#define VM_INT_CONSTANTS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant) \ -+ -+ /* NOTE that we do not use the last_entry() macro here; it is used */ -+ /* in vmStructs__.hpp's VM_INT_CONSTANTS_OS_CPU macro (and must */ -+ /* be present there) */ -+ -+#define VM_LONG_CONSTANTS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant) \ -+ -+ /* NOTE that we do not use the last_entry() macro here; it is used */ -+ /* in vmStructs__.hpp's VM_LONG_CONSTANTS_OS_CPU macro (and must */ -+ /* be present there) */ -+ -+#endif // CPU_MIPS_VM_VMSTRUCTS_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/vm_version_ext_mips.cpp b/hotspot/src/cpu/mips/vm/vm_version_ext_mips.cpp ---- a/hotspot/src/cpu/mips/vm/vm_version_ext_mips.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/vm_version_ext_mips.cpp 2023-12-20 09:23:19.801481172 +0800 -@@ -0,0 +1,89 @@ -+/* -+ * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2018, 2020, Loongson Technology. All rights reserved. ++ * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2018, 2020, Loongson Technology. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it @@ -104949,9 +105921,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + strncpy(tmp, _cpu_desc, CPU_DETAILED_DESC_BUF_SIZE); + return tmp; +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/vm_version_ext_mips.hpp b/hotspot/src/cpu/mips/vm/vm_version_ext_mips.hpp ---- a/hotspot/src/cpu/mips/vm/vm_version_ext_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/vm_version_ext_mips.hpp 2023-12-20 09:23:19.801481172 +0800 +diff --git a/hotspot/src/cpu/mips/vm/vm_version_ext_mips.hpp b/hotspot/src/cpu/mips/vm/vm_version_ext_mips.hpp +new file mode 100644 +index 00000000..a240fcc2 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/vm_version_ext_mips.hpp @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. @@ -105007,9 +105981,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +}; + +#endif // CPU_MIPS_VM_VM_VERSION_EXT_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/vm_version_mips.cpp b/hotspot/src/cpu/mips/vm/vm_version_mips.cpp ---- a/hotspot/src/cpu/mips/vm/vm_version_mips.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/vm_version_mips.cpp 2023-12-20 09:23:19.801481172 +0800 +diff --git a/hotspot/src/cpu/mips/vm/vm_version_mips.cpp b/hotspot/src/cpu/mips/vm/vm_version_mips.cpp +new file mode 100644 +index 00000000..aef8f074 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/vm_version_mips.cpp @@ -0,0 +1,510 @@ +/* + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. @@ -105521,9 +106497,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + + get_processor_features(); +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/vm_version_mips.hpp b/hotspot/src/cpu/mips/vm/vm_version_mips.hpp ---- a/hotspot/src/cpu/mips/vm/vm_version_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/vm_version_mips.hpp 2023-12-20 09:23:19.801481172 +0800 +diff --git a/hotspot/src/cpu/mips/vm/vm_version_mips.hpp b/hotspot/src/cpu/mips/vm/vm_version_mips.hpp +new file mode 100644 +index 00000000..0de01e5f +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/vm_version_mips.hpp @@ -0,0 +1,221 @@ +/* + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. @@ -105746,9 +106724,183 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +}; + +#endif // CPU_MIPS_VM_VM_VERSION_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/vtableStubs_mips_64.cpp b/hotspot/src/cpu/mips/vm/vtableStubs_mips_64.cpp ---- a/hotspot/src/cpu/mips/vm/vtableStubs_mips_64.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/vtableStubs_mips_64.cpp 2023-12-20 09:23:19.801481172 +0800 +diff --git a/hotspot/src/cpu/mips/vm/vmreg_mips.cpp b/hotspot/src/cpu/mips/vm/vmreg_mips.cpp +new file mode 100644 +index 00000000..86bd74d4 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/vmreg_mips.cpp +@@ -0,0 +1,51 @@ ++/* ++ * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2015, 2022, Loongson Technology. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ */ ++ ++#include "precompiled.hpp" ++#include "asm/assembler.hpp" ++#include "code/vmreg.hpp" ++ ++ ++ ++void VMRegImpl::set_regName() { ++ Register reg = ::as_Register(0); ++ int i; ++ for (i = 0; i < ConcreteRegisterImpl::max_gpr ; ) { ++ regName[i++] = reg->name(); ++ regName[i++] = reg->name(); ++ reg = reg->successor(); ++ } ++ ++ FloatRegister freg = ::as_FloatRegister(0); ++ for ( ; i < ConcreteRegisterImpl::max_fpr ; ) { ++ regName[i++] = freg->name(); ++ regName[i++] = freg->name(); ++ freg = freg->successor(); ++ } ++ ++ for ( ; i < ConcreteRegisterImpl::number_of_registers ; i ++ ) { ++ regName[i] = "NON-GPR-FPR"; ++ } ++} +diff --git a/hotspot/src/cpu/mips/vm/vmreg_mips.hpp b/hotspot/src/cpu/mips/vm/vmreg_mips.hpp +new file mode 100644 +index 00000000..6a970ea9 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/vmreg_mips.hpp +@@ -0,0 +1,35 @@ ++/* ++ * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2015, 2019, Loongson Technology. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ */ ++ ++#ifndef CPU_MIPS_VM_VMREG_MIPS_HPP ++#define CPU_MIPS_VM_VMREG_MIPS_HPP ++ ++bool is_Register(); ++Register as_Register(); ++ ++bool is_FloatRegister(); ++FloatRegister as_FloatRegister(); ++ ++#endif // CPU_MIPS_VM_VMREG_MIPS_HPP +diff --git a/hotspot/src/cpu/mips/vm/vmreg_mips.inline.hpp b/hotspot/src/cpu/mips/vm/vmreg_mips.inline.hpp +new file mode 100644 +index 00000000..77e18ce5 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/vmreg_mips.inline.hpp +@@ -0,0 +1,68 @@ ++/* ++ * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2015, 2022, Loongson Technology. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ */ ++ ++#ifndef CPU_MIPS_VM_VMREG_MIPS_INLINE_HPP ++#define CPU_MIPS_VM_VMREG_MIPS_INLINE_HPP ++ ++inline VMReg RegisterImpl::as_VMReg() { ++ if( this==noreg ) return VMRegImpl::Bad(); ++ return VMRegImpl::as_VMReg(encoding() << 1 ); ++} ++ ++inline VMReg FloatRegisterImpl::as_VMReg() { ++ return VMRegImpl::as_VMReg((encoding() << 1) + ConcreteRegisterImpl::max_gpr); ++} ++ ++inline bool VMRegImpl::is_Register() { ++ return (unsigned int) value() < (unsigned int) ConcreteRegisterImpl::max_gpr; ++} ++ ++inline bool VMRegImpl::is_FloatRegister() { ++ return value() >= ConcreteRegisterImpl::max_gpr && value() < ConcreteRegisterImpl::max_fpr; ++} ++ ++inline Register VMRegImpl::as_Register() { ++ ++ assert( is_Register(), "must be"); ++ // Yuk ++ return ::as_Register(value() >> 1); ++} ++ ++inline FloatRegister VMRegImpl::as_FloatRegister() { ++ assert( is_FloatRegister(), "must be" ); ++ // Yuk ++ assert( is_even(value()), "must be" ); ++ return ::as_FloatRegister((value() - ConcreteRegisterImpl::max_gpr) >> 1); ++} ++ ++inline bool VMRegImpl::is_concrete() { ++ assert(is_reg(), "must be"); ++ if(is_Register()) return true; ++ if(is_FloatRegister()) return true; ++ assert(false, "what register?"); ++ return false; ++} ++ ++#endif // CPU_MIPS_VM_VMREG_MIPS_INLINE_HPP +diff --git a/hotspot/src/cpu/mips/vm/vtableStubs_mips_64.cpp b/hotspot/src/cpu/mips/vm/vtableStubs_mips_64.cpp +new file mode 100644 +index 00000000..7779c58e +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/vtableStubs_mips_64.cpp @@ -0,0 +1,301 @@ +/* + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. @@ -106051,10 +107203,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +int VtableStub::pd_code_alignment() { + return wordSize; +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp b/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp ---- a/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp 2023-12-20 09:23:19.824814237 +0800 -@@ -1513,6 +1513,10 @@ +diff --git a/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp b/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp +index c1c053e6..5c90df10 100644 +--- a/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp ++++ b/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp +@@ -1513,6 +1513,10 @@ void LIR_Assembler::emit_opBranch(LIR_OpBranch* op) { } } @@ -106065,7 +107218,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp void LIR_Assembler::emit_opConvert(LIR_OpConvert* op) { LIR_Opr src = op->in_opr(); LIR_Opr dest = op->result_opr(); -@@ -2102,6 +2106,12 @@ +@@ -2102,6 +2106,12 @@ void LIR_Assembler::cmove(LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, L } @@ -106078,10 +107231,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp void LIR_Assembler::arith_op(LIR_Code code, LIR_Opr left, LIR_Opr right, LIR_Opr dest, CodeEmitInfo* info, bool pop_fpu_stack) { assert(info == NULL, "should never be used, idiv/irem and ldiv/lrem not handled by this method"); -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp b/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp ---- a/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp 2023-12-20 09:23:19.824814237 +0800 -@@ -242,20 +242,27 @@ +diff --git a/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp b/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp +index 92b73e1c..45da327e 100644 +--- a/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp ++++ b/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp +@@ -242,20 +242,27 @@ void LIRGenerator::increment_counter(LIR_Address* addr, int step) { __ add((LIR_Opr)addr, LIR_OprFact::intConst(step), (LIR_Opr)addr); } @@ -106116,9 +107270,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp bool LIRGenerator::strength_reduce_multiply(LIR_Opr left, jint c, LIR_Opr result, LIR_Opr tmp) { if (tmp->is_valid() && c > 0 && c < max_jint) { -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os/linux/vm/os_linux.cpp b/hotspot/src/os/linux/vm/os_linux.cpp ---- a/hotspot/src/os/linux/vm/os_linux.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/os/linux/vm/os_linux.cpp 2023-12-20 09:23:19.851480600 +0800 +diff --git a/hotspot/src/os/linux/vm/os_linux.cpp b/hotspot/src/os/linux/vm/os_linux.cpp +index 54cfcdd1..c3d22ba5 100644 +--- a/hotspot/src/os/linux/vm/os_linux.cpp ++++ b/hotspot/src/os/linux/vm/os_linux.cpp @@ -22,6 +22,12 @@ * */ @@ -106132,7 +107287,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp // no precompiled headers #include "classfile/classLoader.hpp" #include "classfile/systemDictionary.hpp" -@@ -2009,6 +2015,7 @@ +@@ -1972,6 +1978,7 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen) {EM_ALPHA, EM_ALPHA, ELFCLASS64, ELFDATA2LSB, (char*)"Alpha"}, {EM_MIPS_RS3_LE, EM_MIPS_RS3_LE, ELFCLASS32, ELFDATA2LSB, (char*)"MIPSel"}, {EM_MIPS, EM_MIPS, ELFCLASS32, ELFDATA2MSB, (char*)"MIPS"}, @@ -106140,7 +107295,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp {EM_PARISC, EM_PARISC, ELFCLASS32, ELFDATA2MSB, (char*)"PARISC"}, {EM_68K, EM_68K, ELFCLASS32, ELFDATA2MSB, (char*)"M68k"}, {EM_AARCH64, EM_AARCH64, ELFCLASS64, ELFDATA2LSB, (char*)"AARCH64"}, -@@ -2025,6 +2032,8 @@ +@@ -1988,6 +1995,8 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen) static Elf32_Half running_arch_code=EM_SPARCV9; #elif (defined __sparc) && (!defined _LP64) static Elf32_Half running_arch_code=EM_SPARC; @@ -106149,7 +107304,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #elif (defined __powerpc64__) static Elf32_Half running_arch_code=EM_PPC64; #elif (defined __powerpc__) -@@ -2049,7 +2058,7 @@ +@@ -2012,7 +2021,7 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen) static Elf32_Half running_arch_code=EM_LOONGARCH; #else #error Method os::dll_load requires that one of following is defined:\ @@ -106158,7 +107313,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #endif // Identify compatability class for VM's architecture and library's architecture -@@ -3897,7 +3906,7 @@ +@@ -3519,7 +3528,7 @@ size_t os::Linux::find_large_page_size() { #ifndef ZERO large_page_size = IA32_ONLY(4 * M) AMD64_ONLY(2 * M) IA64_ONLY(256 * M) SPARC_ONLY(4 * M) @@ -106167,7 +107322,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #endif // ZERO FILE *fp = fopen("/proc/meminfo", "r"); -@@ -5510,7 +5519,12 @@ +@@ -5126,7 +5135,12 @@ jint os::init_2(void) Linux::fast_thread_clock_init(); // Allocate a single page and mark it as readable for safepoint polling @@ -106180,7 +107335,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp guarantee( polling_page != MAP_FAILED, "os::init_2: failed to allocate polling page" ); os::set_polling_page( polling_page ); -@@ -5545,13 +5559,20 @@ +@@ -5161,13 +5175,20 @@ jint os::init_2(void) // size. Add a page for compiler2 recursion in main thread. // Add in 2*BytesPerWord times page size to account for VM stack during // class initialization depending on 32 or 64 bit VM. @@ -106202,9 +107357,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp tty->print_cr("\nThe stack size specified is too small, " "Specify at least %dk", os::Linux::min_stack_allowed/ K); -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os/linux/vm/os_perf_linux.cpp b/hotspot/src/os/linux/vm/os_perf_linux.cpp ---- a/hotspot/src/os/linux/vm/os_perf_linux.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/os/linux/vm/os_perf_linux.cpp 2023-12-20 09:23:19.851480600 +0800 +diff --git a/hotspot/src/os/linux/vm/os_perf_linux.cpp b/hotspot/src/os/linux/vm/os_perf_linux.cpp +index 0d1f7581..cbc6c075 100644 +--- a/hotspot/src/os/linux/vm/os_perf_linux.cpp ++++ b/hotspot/src/os/linux/vm/os_perf_linux.cpp @@ -50,6 +50,12 @@ #ifdef TARGET_ARCH_ppc # include "vm_version_ext_ppc.hpp" @@ -106218,9 +107374,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #include #include -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_loongarch/vm/assembler_linux_loongarch.cpp b/hotspot/src/os_cpu/linux_loongarch/vm/assembler_linux_loongarch.cpp ---- a/hotspot/src/os_cpu/linux_loongarch/vm/assembler_linux_loongarch.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_loongarch/vm/assembler_linux_loongarch.cpp 2023-12-20 09:23:19.868147074 +0800 +diff --git a/hotspot/src/os_cpu/linux_loongarch/vm/assembler_linux_loongarch.cpp b/hotspot/src/os_cpu/linux_loongarch/vm/assembler_linux_loongarch.cpp +new file mode 100644 +index 00000000..5ee0965f +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_loongarch/vm/assembler_linux_loongarch.cpp @@ -0,0 +1,92 @@ +/* + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. @@ -106314,9 +107472,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + } +#endif // MINIMIZE_RAM_USAGE +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_loongarch/vm/atomic_linux_loongarch.inline.hpp b/hotspot/src/os_cpu/linux_loongarch/vm/atomic_linux_loongarch.inline.hpp ---- a/hotspot/src/os_cpu/linux_loongarch/vm/atomic_linux_loongarch.inline.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_loongarch/vm/atomic_linux_loongarch.inline.hpp 2023-12-20 09:23:19.868147074 +0800 +diff --git a/hotspot/src/os_cpu/linux_loongarch/vm/atomic_linux_loongarch.inline.hpp b/hotspot/src/os_cpu/linux_loongarch/vm/atomic_linux_loongarch.inline.hpp +new file mode 100644 +index 00000000..69590ba5 +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_loongarch/vm/atomic_linux_loongarch.inline.hpp @@ -0,0 +1,206 @@ +/* + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. @@ -106524,9 +107684,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +} + +#endif // OS_CPU_LINUX_LOONGARCH_VM_ATOMIC_LINUX_LOONGARCH_INLINE_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_loongarch/vm/bytes_linux_loongarch.inline.hpp b/hotspot/src/os_cpu/linux_loongarch/vm/bytes_linux_loongarch.inline.hpp ---- a/hotspot/src/os_cpu/linux_loongarch/vm/bytes_linux_loongarch.inline.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_loongarch/vm/bytes_linux_loongarch.inline.hpp 2023-12-20 09:23:19.868147074 +0800 +diff --git a/hotspot/src/os_cpu/linux_loongarch/vm/bytes_linux_loongarch.inline.hpp b/hotspot/src/os_cpu/linux_loongarch/vm/bytes_linux_loongarch.inline.hpp +new file mode 100644 +index 00000000..4e205c46 +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_loongarch/vm/bytes_linux_loongarch.inline.hpp @@ -0,0 +1,37 @@ +/* + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. @@ -106565,9 +107727,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +inline u8 Bytes::swap_u8(u8 x) { return bswap_64(x); } + +#endif // OS_CPU_LINUX_LOONGARCH_VM_BYTES_LINUX_LOONGARCH_INLINE_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_loongarch/vm/copy_linux_loongarch.inline.hpp b/hotspot/src/os_cpu/linux_loongarch/vm/copy_linux_loongarch.inline.hpp ---- a/hotspot/src/os_cpu/linux_loongarch/vm/copy_linux_loongarch.inline.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_loongarch/vm/copy_linux_loongarch.inline.hpp 2023-12-20 09:23:19.868147074 +0800 +diff --git a/hotspot/src/os_cpu/linux_loongarch/vm/copy_linux_loongarch.inline.hpp b/hotspot/src/os_cpu/linux_loongarch/vm/copy_linux_loongarch.inline.hpp +new file mode 100644 +index 00000000..7d6e11a9 +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_loongarch/vm/copy_linux_loongarch.inline.hpp @@ -0,0 +1,125 @@ +/* + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. @@ -106694,9 +107858,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +} + +#endif // OS_CPU_LINUX_LOONGARCH_VM_COPY_LINUX_LOONGARCH_INLINE_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_loongarch/vm/globals_linux_loongarch.hpp b/hotspot/src/os_cpu/linux_loongarch/vm/globals_linux_loongarch.hpp ---- a/hotspot/src/os_cpu/linux_loongarch/vm/globals_linux_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_loongarch/vm/globals_linux_loongarch.hpp 2023-12-20 09:23:19.868147074 +0800 +diff --git a/hotspot/src/os_cpu/linux_loongarch/vm/globals_linux_loongarch.hpp b/hotspot/src/os_cpu/linux_loongarch/vm/globals_linux_loongarch.hpp +new file mode 100644 +index 00000000..8ec3fa82 +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_loongarch/vm/globals_linux_loongarch.hpp @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. @@ -106741,9 +107907,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +define_pd_global(uintx,HeapBaseMinAddress, 2*G); + +#endif // OS_CPU_LINUX_LOONGARCH_VM_GLOBALS_LINUX_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_loongarch/vm/orderAccess_linux_loongarch.inline.hpp b/hotspot/src/os_cpu/linux_loongarch/vm/orderAccess_linux_loongarch.inline.hpp ---- a/hotspot/src/os_cpu/linux_loongarch/vm/orderAccess_linux_loongarch.inline.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_loongarch/vm/orderAccess_linux_loongarch.inline.hpp 2023-12-20 09:23:19.868147074 +0800 +diff --git a/hotspot/src/os_cpu/linux_loongarch/vm/orderAccess_linux_loongarch.inline.hpp b/hotspot/src/os_cpu/linux_loongarch/vm/orderAccess_linux_loongarch.inline.hpp +new file mode 100644 +index 00000000..3e050c8d +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_loongarch/vm/orderAccess_linux_loongarch.inline.hpp @@ -0,0 +1,115 @@ +/* + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. @@ -106860,9 +108028,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +#undef inlasm_sync + +#endif // OS_CPU_LINUX_LOONGARCH_VM_ORDERACCESS_LINUX_LOONGARCH_INLINE_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_loongarch/vm/os_linux_loongarch.cpp b/hotspot/src/os_cpu/linux_loongarch/vm/os_linux_loongarch.cpp ---- a/hotspot/src/os_cpu/linux_loongarch/vm/os_linux_loongarch.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_loongarch/vm/os_linux_loongarch.cpp 2023-12-20 09:23:19.868147074 +0800 +diff --git a/hotspot/src/os_cpu/linux_loongarch/vm/os_linux_loongarch.cpp b/hotspot/src/os_cpu/linux_loongarch/vm/os_linux_loongarch.cpp +new file mode 100644 +index 00000000..f2c3df84 +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_loongarch/vm/os_linux_loongarch.cpp @@ -0,0 +1,750 @@ +/* + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. @@ -107614,9 +108784,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +bool os::is_ActiveCoresMP() { + return UseActiveCoresMP && _initial_active_processor_count == 1; +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_loongarch/vm/os_linux_loongarch.hpp b/hotspot/src/os_cpu/linux_loongarch/vm/os_linux_loongarch.hpp ---- a/hotspot/src/os_cpu/linux_loongarch/vm/os_linux_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_loongarch/vm/os_linux_loongarch.hpp 2023-12-20 09:23:19.868147074 +0800 +diff --git a/hotspot/src/os_cpu/linux_loongarch/vm/os_linux_loongarch.hpp b/hotspot/src/os_cpu/linux_loongarch/vm/os_linux_loongarch.hpp +new file mode 100644 +index 00000000..a7321ae0 +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_loongarch/vm/os_linux_loongarch.hpp @@ -0,0 +1,39 @@ +/* + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. @@ -107657,9 +108829,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + static bool is_ActiveCoresMP(); + +#endif // OS_CPU_LINUX_LOONGARCH_VM_OS_LINUX_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_loongarch/vm/prefetch_linux_loongarch.inline.hpp b/hotspot/src/os_cpu/linux_loongarch/vm/prefetch_linux_loongarch.inline.hpp ---- a/hotspot/src/os_cpu/linux_loongarch/vm/prefetch_linux_loongarch.inline.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_loongarch/vm/prefetch_linux_loongarch.inline.hpp 2023-12-20 09:23:19.868147074 +0800 +diff --git a/hotspot/src/os_cpu/linux_loongarch/vm/prefetch_linux_loongarch.inline.hpp b/hotspot/src/os_cpu/linux_loongarch/vm/prefetch_linux_loongarch.inline.hpp +new file mode 100644 +index 00000000..a1cedcd8 +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_loongarch/vm/prefetch_linux_loongarch.inline.hpp @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. @@ -107717,9 +108891,168 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +} + +#endif // OS_CPU_LINUX_LOONGARCH_VM_PREFETCH_LINUX_LOONGARCH_INLINE_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_loongarch/vm/thread_linux_loongarch.cpp b/hotspot/src/os_cpu/linux_loongarch/vm/thread_linux_loongarch.cpp ---- a/hotspot/src/os_cpu/linux_loongarch/vm/thread_linux_loongarch.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_loongarch/vm/thread_linux_loongarch.cpp 2023-12-20 09:23:19.868147074 +0800 +diff --git a/hotspot/src/os_cpu/linux_loongarch/vm/threadLS_linux_loongarch.cpp b/hotspot/src/os_cpu/linux_loongarch/vm/threadLS_linux_loongarch.cpp +new file mode 100644 +index 00000000..be28a562 +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_loongarch/vm/threadLS_linux_loongarch.cpp +@@ -0,0 +1,84 @@ ++/* ++ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2015, 2022, Loongson Technology. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ */ ++ ++#include "precompiled.hpp" ++#include "runtime/thread.inline.hpp" ++#include "runtime/threadLocalStorage.hpp" ++ ++// Map stack pointer (%esp) to thread pointer for faster TLS access ++// ++// Here we use a flat table for better performance. Getting current thread ++// is down to one memory access (read _sp_map[%esp>>12]) in generated code ++// and two in runtime code (-fPIC code needs an extra load for _sp_map). ++// ++// This code assumes stack page is not shared by different threads. It works ++// in 32-bit VM when page size is 4K (or a multiple of 4K, if that matters). ++// ++// Notice that _sp_map is allocated in the bss segment, which is ZFOD ++// (zero-fill-on-demand). While it reserves 4M address space upfront, ++// actual memory pages are committed on demand. ++// ++// If an application creates and destroys a lot of threads, usually the ++// stack space freed by a thread will soon get reused by new thread ++// (this is especially true in NPTL or LinuxThreads in fixed-stack mode). ++// No memory page in _sp_map is wasted. ++// ++// However, it's still possible that we might end up populating & ++// committing a large fraction of the 4M table over time, but the actual ++// amount of live data in the table could be quite small. The max wastage ++// is less than 4M bytes. If it becomes an issue, we could use madvise() ++// with MADV_DONTNEED to reclaim unused (i.e. all-zero) pages in _sp_map. ++// MADV_DONTNEED on Linux keeps the virtual memory mapping, but zaps the ++// physical memory page (i.e. similar to MADV_FREE on Solaris). ++ ++#ifdef MINIMIZE_RAM_USAGE ++Thread* ThreadLocalStorage::_sp_map[1UL << (SP_BITLENGTH - PAGE_SHIFT)]; ++#endif // MINIMIZE_RAM_USAGE ++ ++void ThreadLocalStorage::generate_code_for_get_thread() { ++ // nothing we can do here for user-level thread ++} ++ ++void ThreadLocalStorage::pd_init() { ++#ifdef MINIMIZE_RAM_USAGE ++ assert(align_size_down(os::vm_page_size(), PAGE_SIZE) == os::vm_page_size(), ++ "page size must be multiple of PAGE_SIZE"); ++#endif // MINIMIZE_RAM_USAGE ++} ++ ++void ThreadLocalStorage::pd_set_thread(Thread* thread) { ++ os::thread_local_storage_at_put(ThreadLocalStorage::thread_index(), thread); ++#ifdef MINIMIZE_RAM_USAGE ++ address stack_top = os::current_stack_base(); ++ size_t stack_size = os::current_stack_size(); ++ ++ for (address p = stack_top - stack_size; p < stack_top; p += PAGE_SIZE) { ++ int index = ((uintptr_t)p >> PAGE_SHIFT) & ((1UL << (SP_BITLENGTH - PAGE_SHIFT)) - 1); ++ assert(thread == NULL || _sp_map[index] == NULL || thread == _sp_map[index], ++ "thread exited without detaching from VM??"); ++ _sp_map[index] = thread; ++ } ++#endif // MINIMIZE_RAM_USAGE ++} +diff --git a/hotspot/src/os_cpu/linux_loongarch/vm/threadLS_linux_loongarch.hpp b/hotspot/src/os_cpu/linux_loongarch/vm/threadLS_linux_loongarch.hpp +new file mode 100644 +index 00000000..4fab788a +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_loongarch/vm/threadLS_linux_loongarch.hpp +@@ -0,0 +1,61 @@ ++/* ++ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2015, 2022, Loongson Technology. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ */ ++ ++#ifndef OS_CPU_LINUX_LOONGARCH_VM_THREADLS_LINUX_LOONGARCH_HPP ++#define OS_CPU_LINUX_LOONGARCH_VM_THREADLS_LINUX_LOONGARCH_HPP ++ ++#ifdef MINIMIZE_RAM_USAGE ++ // Processor dependent parts of ThreadLocalStorage ++ //only the low 2G space for user program in Linux ++ ++ #define SP_BITLENGTH 34 ++ #define PAGE_SHIFT 14 ++ #define PAGE_SIZE (1UL << PAGE_SHIFT) ++ ++ static Thread* _sp_map[1UL << (SP_BITLENGTH - PAGE_SHIFT)]; ++ static int _sp_map_low; ++ static int _sp_map_high; ++#endif // MINIMIZE_RAM_USAGE ++ ++public: ++#ifdef MINIMIZE_RAM_USAGE ++ static Thread** sp_map_addr() { return _sp_map; } ++#endif // MINIMIZE_RAM_USAGE ++ ++ static Thread* thread() { ++#ifdef MINIMIZE_RAM_USAGE ++ /* Thread::thread() can also be optimized in the same way as __get_thread() */ ++ //return (Thread*) os::thread_local_storage_at(thread_index()); ++ uintptr_t sp; ++ uintptr_t mask = (1UL << (SP_BITLENGTH - PAGE_SHIFT)) - 1; ++ ++ __asm__ __volatile__ ("addi.d %0, $r29, 0 " : "=r" (sp)); ++ ++ return _sp_map[(sp >> PAGE_SHIFT) & mask]; ++#else ++ return (Thread*) os::thread_local_storage_at(thread_index()); ++#endif // MINIMIZE_RAM_USAGE ++ } ++#endif // OS_CPU_LINUX_LOONGARCH_VM_THREADLS_LINUX_LOONGARCH_HPP +diff --git a/hotspot/src/os_cpu/linux_loongarch/vm/thread_linux_loongarch.cpp b/hotspot/src/os_cpu/linux_loongarch/vm/thread_linux_loongarch.cpp +new file mode 100644 +index 00000000..44f666d6 +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_loongarch/vm/thread_linux_loongarch.cpp @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. @@ -107820,9 +109153,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + +void JavaThread::cache_global_variables() { } + -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_loongarch/vm/thread_linux_loongarch.hpp b/hotspot/src/os_cpu/linux_loongarch/vm/thread_linux_loongarch.hpp ---- a/hotspot/src/os_cpu/linux_loongarch/vm/thread_linux_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_loongarch/vm/thread_linux_loongarch.hpp 2023-12-20 09:23:19.868147074 +0800 +diff --git a/hotspot/src/os_cpu/linux_loongarch/vm/thread_linux_loongarch.hpp b/hotspot/src/os_cpu/linux_loongarch/vm/thread_linux_loongarch.hpp +new file mode 100644 +index 00000000..d6dd2521 +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_loongarch/vm/thread_linux_loongarch.hpp @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. @@ -107899,162 +109234,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + static void disable_register_stack_guard() {} + +#endif // OS_CPU_LINUX_LOONGARCH_VM_THREAD_LINUX_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_loongarch/vm/threadLS_linux_loongarch.cpp b/hotspot/src/os_cpu/linux_loongarch/vm/threadLS_linux_loongarch.cpp ---- a/hotspot/src/os_cpu/linux_loongarch/vm/threadLS_linux_loongarch.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_loongarch/vm/threadLS_linux_loongarch.cpp 2023-12-20 09:23:19.868147074 +0800 -@@ -0,0 +1,84 @@ -+/* -+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2022, Loongson Technology. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ * -+ */ -+ -+#include "precompiled.hpp" -+#include "runtime/thread.inline.hpp" -+#include "runtime/threadLocalStorage.hpp" -+ -+// Map stack pointer (%esp) to thread pointer for faster TLS access -+// -+// Here we use a flat table for better performance. Getting current thread -+// is down to one memory access (read _sp_map[%esp>>12]) in generated code -+// and two in runtime code (-fPIC code needs an extra load for _sp_map). -+// -+// This code assumes stack page is not shared by different threads. It works -+// in 32-bit VM when page size is 4K (or a multiple of 4K, if that matters). -+// -+// Notice that _sp_map is allocated in the bss segment, which is ZFOD -+// (zero-fill-on-demand). While it reserves 4M address space upfront, -+// actual memory pages are committed on demand. -+// -+// If an application creates and destroys a lot of threads, usually the -+// stack space freed by a thread will soon get reused by new thread -+// (this is especially true in NPTL or LinuxThreads in fixed-stack mode). -+// No memory page in _sp_map is wasted. -+// -+// However, it's still possible that we might end up populating & -+// committing a large fraction of the 4M table over time, but the actual -+// amount of live data in the table could be quite small. The max wastage -+// is less than 4M bytes. If it becomes an issue, we could use madvise() -+// with MADV_DONTNEED to reclaim unused (i.e. all-zero) pages in _sp_map. -+// MADV_DONTNEED on Linux keeps the virtual memory mapping, but zaps the -+// physical memory page (i.e. similar to MADV_FREE on Solaris). -+ -+#ifdef MINIMIZE_RAM_USAGE -+Thread* ThreadLocalStorage::_sp_map[1UL << (SP_BITLENGTH - PAGE_SHIFT)]; -+#endif // MINIMIZE_RAM_USAGE -+ -+void ThreadLocalStorage::generate_code_for_get_thread() { -+ // nothing we can do here for user-level thread -+} -+ -+void ThreadLocalStorage::pd_init() { -+#ifdef MINIMIZE_RAM_USAGE -+ assert(align_size_down(os::vm_page_size(), PAGE_SIZE) == os::vm_page_size(), -+ "page size must be multiple of PAGE_SIZE"); -+#endif // MINIMIZE_RAM_USAGE -+} -+ -+void ThreadLocalStorage::pd_set_thread(Thread* thread) { -+ os::thread_local_storage_at_put(ThreadLocalStorage::thread_index(), thread); -+#ifdef MINIMIZE_RAM_USAGE -+ address stack_top = os::current_stack_base(); -+ size_t stack_size = os::current_stack_size(); -+ -+ for (address p = stack_top - stack_size; p < stack_top; p += PAGE_SIZE) { -+ int index = ((uintptr_t)p >> PAGE_SHIFT) & ((1UL << (SP_BITLENGTH - PAGE_SHIFT)) - 1); -+ assert(thread == NULL || _sp_map[index] == NULL || thread == _sp_map[index], -+ "thread exited without detaching from VM??"); -+ _sp_map[index] = thread; -+ } -+#endif // MINIMIZE_RAM_USAGE -+} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_loongarch/vm/threadLS_linux_loongarch.hpp b/hotspot/src/os_cpu/linux_loongarch/vm/threadLS_linux_loongarch.hpp ---- a/hotspot/src/os_cpu/linux_loongarch/vm/threadLS_linux_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_loongarch/vm/threadLS_linux_loongarch.hpp 2023-12-20 09:23:19.868147074 +0800 -@@ -0,0 +1,61 @@ -+/* -+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2022, Loongson Technology. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ * -+ */ -+ -+#ifndef OS_CPU_LINUX_LOONGARCH_VM_THREADLS_LINUX_LOONGARCH_HPP -+#define OS_CPU_LINUX_LOONGARCH_VM_THREADLS_LINUX_LOONGARCH_HPP -+ -+#ifdef MINIMIZE_RAM_USAGE -+ // Processor dependent parts of ThreadLocalStorage -+ //only the low 2G space for user program in Linux -+ -+ #define SP_BITLENGTH 34 -+ #define PAGE_SHIFT 14 -+ #define PAGE_SIZE (1UL << PAGE_SHIFT) -+ -+ static Thread* _sp_map[1UL << (SP_BITLENGTH - PAGE_SHIFT)]; -+ static int _sp_map_low; -+ static int _sp_map_high; -+#endif // MINIMIZE_RAM_USAGE -+ -+public: -+#ifdef MINIMIZE_RAM_USAGE -+ static Thread** sp_map_addr() { return _sp_map; } -+#endif // MINIMIZE_RAM_USAGE -+ -+ static Thread* thread() { -+#ifdef MINIMIZE_RAM_USAGE -+ /* Thread::thread() can also be optimized in the same way as __get_thread() */ -+ //return (Thread*) os::thread_local_storage_at(thread_index()); -+ uintptr_t sp; -+ uintptr_t mask = (1UL << (SP_BITLENGTH - PAGE_SHIFT)) - 1; -+ -+ __asm__ __volatile__ ("addi.d %0, $r29, 0 " : "=r" (sp)); -+ -+ return _sp_map[(sp >> PAGE_SHIFT) & mask]; -+#else -+ return (Thread*) os::thread_local_storage_at(thread_index()); -+#endif // MINIMIZE_RAM_USAGE -+ } -+#endif // OS_CPU_LINUX_LOONGARCH_VM_THREADLS_LINUX_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_loongarch/vm/vmStructs_linux_loongarch.hpp b/hotspot/src/os_cpu/linux_loongarch/vm/vmStructs_linux_loongarch.hpp ---- a/hotspot/src/os_cpu/linux_loongarch/vm/vmStructs_linux_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_loongarch/vm/vmStructs_linux_loongarch.hpp 2023-12-20 09:23:19.868147074 +0800 +diff --git a/hotspot/src/os_cpu/linux_loongarch/vm/vmStructs_linux_loongarch.hpp b/hotspot/src/os_cpu/linux_loongarch/vm/vmStructs_linux_loongarch.hpp +new file mode 100644 +index 00000000..0097cadc +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_loongarch/vm/vmStructs_linux_loongarch.hpp @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. @@ -108111,9 +109295,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +#define VM_LONG_CONSTANTS_OS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant) + +#endif // OS_CPU_LINUX_LOONGARCH_VM_VMSTRUCTS_LINUX_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_loongarch/vm/vm_version_linux_loongarch.cpp b/hotspot/src/os_cpu/linux_loongarch/vm/vm_version_linux_loongarch.cpp ---- a/hotspot/src/os_cpu/linux_loongarch/vm/vm_version_linux_loongarch.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_loongarch/vm/vm_version_linux_loongarch.cpp 2023-12-20 09:23:19.868147074 +0800 +diff --git a/hotspot/src/os_cpu/linux_loongarch/vm/vm_version_linux_loongarch.cpp b/hotspot/src/os_cpu/linux_loongarch/vm/vm_version_linux_loongarch.cpp +new file mode 100644 +index 00000000..80a1538d +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_loongarch/vm/vm_version_linux_loongarch.cpp @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. @@ -108144,9 +109330,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +#include "runtime/os.hpp" +#include "vm_version_loongarch.hpp" + -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_mips/vm/assembler_linux_mips.cpp b/hotspot/src/os_cpu/linux_mips/vm/assembler_linux_mips.cpp ---- a/hotspot/src/os_cpu/linux_mips/vm/assembler_linux_mips.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_mips/vm/assembler_linux_mips.cpp 2023-12-20 09:23:19.868147074 +0800 +diff --git a/hotspot/src/os_cpu/linux_mips/vm/assembler_linux_mips.cpp b/hotspot/src/os_cpu/linux_mips/vm/assembler_linux_mips.cpp +new file mode 100644 +index 00000000..4ba53d93 +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_mips/vm/assembler_linux_mips.cpp @@ -0,0 +1,111 @@ +/* + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. @@ -108259,9 +109447,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + } +#endif // MINIMIZE_RAM_USAGE +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_mips/vm/atomic_linux_mips.inline.hpp b/hotspot/src/os_cpu/linux_mips/vm/atomic_linux_mips.inline.hpp ---- a/hotspot/src/os_cpu/linux_mips/vm/atomic_linux_mips.inline.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_mips/vm/atomic_linux_mips.inline.hpp 2023-12-20 09:23:19.868147074 +0800 +diff --git a/hotspot/src/os_cpu/linux_mips/vm/atomic_linux_mips.inline.hpp b/hotspot/src/os_cpu/linux_mips/vm/atomic_linux_mips.inline.hpp +new file mode 100644 +index 00000000..1c7ad605 +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_mips/vm/atomic_linux_mips.inline.hpp @@ -0,0 +1,258 @@ +/* + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. @@ -108521,9 +109711,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +} + +#endif // OS_CPU_LINUX_MIPS_VM_ATOMIC_LINUX_MIPS_INLINE_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_mips/vm/bytes_linux_mips.inline.hpp b/hotspot/src/os_cpu/linux_mips/vm/bytes_linux_mips.inline.hpp ---- a/hotspot/src/os_cpu/linux_mips/vm/bytes_linux_mips.inline.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_mips/vm/bytes_linux_mips.inline.hpp 2023-12-20 09:23:19.868147074 +0800 +diff --git a/hotspot/src/os_cpu/linux_mips/vm/bytes_linux_mips.inline.hpp b/hotspot/src/os_cpu/linux_mips/vm/bytes_linux_mips.inline.hpp +new file mode 100644 +index 00000000..5b5cd10a +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_mips/vm/bytes_linux_mips.inline.hpp @@ -0,0 +1,37 @@ +/* + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. @@ -108562,9 +109754,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +inline u8 Bytes::swap_u8(u8 x) { return bswap_64(x); } + +#endif // OS_CPU_LINUX_MIPS_VM_BYTES_LINUX_MIPS_INLINE_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_mips/vm/copy_linux_mips.inline.hpp b/hotspot/src/os_cpu/linux_mips/vm/copy_linux_mips.inline.hpp ---- a/hotspot/src/os_cpu/linux_mips/vm/copy_linux_mips.inline.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_mips/vm/copy_linux_mips.inline.hpp 2023-12-20 09:23:19.868147074 +0800 +diff --git a/hotspot/src/os_cpu/linux_mips/vm/copy_linux_mips.inline.hpp b/hotspot/src/os_cpu/linux_mips/vm/copy_linux_mips.inline.hpp +new file mode 100644 +index 00000000..73ac3450 +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_mips/vm/copy_linux_mips.inline.hpp @@ -0,0 +1,125 @@ +/* + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. @@ -108691,9 +109885,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +} + +#endif // OS_CPU_LINUX_MIPS_VM_COPY_LINUX_MIPS_INLINE_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_mips/vm/globals_linux_mips.hpp b/hotspot/src/os_cpu/linux_mips/vm/globals_linux_mips.hpp ---- a/hotspot/src/os_cpu/linux_mips/vm/globals_linux_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_mips/vm/globals_linux_mips.hpp 2023-12-20 09:23:19.868147074 +0800 +diff --git a/hotspot/src/os_cpu/linux_mips/vm/globals_linux_mips.hpp b/hotspot/src/os_cpu/linux_mips/vm/globals_linux_mips.hpp +new file mode 100644 +index 00000000..f1599ac5 +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_mips/vm/globals_linux_mips.hpp @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. @@ -108746,63 +109942,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +define_pd_global(uintx,HeapBaseMinAddress, 2*G); + +#endif // OS_CPU_LINUX_MIPS_VM_GLOBALS_LINUX_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_mips/vm/linux_mips_64.ad b/hotspot/src/os_cpu/linux_mips/vm/linux_mips_64.ad ---- a/hotspot/src/os_cpu/linux_mips/vm/linux_mips_64.ad 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_mips/vm/linux_mips_64.ad 2023-12-20 09:23:19.868147074 +0800 -@@ -0,0 +1,50 @@ -+// -+// Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. -+// Copyright (c) 2015, 2016, Loongson Technology. All rights reserved. -+// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+// -+// This code is free software; you can redistribute it and/or modify it -+// under the terms of the GNU General Public License version 2 only, as -+// published by the Free Software Foundation. -+// -+// This code is distributed in the hope that it will be useful, but WITHOUT -+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+// version 2 for more details (a copy is included in the LICENSE file that -+// accompanied this code). -+// -+// You should have received a copy of the GNU General Public License version -+// 2 along with this work; if not, write to the Free Software Foundation, -+// Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+// -+// Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+// or visit www.oracle.com if you need additional information or have any -+// questions. -+// -+// -+ -+// AMD64 Linux Architecture Description File -+ -+//----------OS-DEPENDENT ENCODING BLOCK---------------------------------------- -+// This block specifies the encoding classes used by the compiler to -+// output byte streams. Encoding classes generate functions which are -+// called by Machine Instruction Nodes in order to generate the bit -+// encoding of the instruction. Operands specify their base encoding -+// interface with the interface keyword. There are currently -+// supported four interfaces, REG_INTER, CONST_INTER, MEMORY_INTER, & -+// COND_INTER. REG_INTER causes an operand to generate a function -+// which returns its register number when queried. CONST_INTER causes -+// an operand to generate a function which returns the value of the -+// constant when queried. MEMORY_INTER causes an operand to generate -+// four functions which return the Base Register, the Index Register, -+// the Scale Value, and the Offset Value of the operand when queried. -+// COND_INTER causes an operand to generate six functions which return -+// the encoding code (ie - encoding bits for the instruction) -+// associated with each basic boolean condition for a conditional -+// instruction. Instructions specify two basic values for encoding. -+// They use the ins_encode keyword to specify their encoding class -+// (which must be one of the class names specified in the encoding -+// block), and they use the opcode keyword to specify, in order, their -+// primary, secondary, and tertiary opcode. Only the opcode sections -+// which a particular instruction needs for encoding need to be -+// specified. -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_mips/vm/linux_mips.ad b/hotspot/src/os_cpu/linux_mips/vm/linux_mips.ad ---- a/hotspot/src/os_cpu/linux_mips/vm/linux_mips.ad 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_mips/vm/linux_mips.ad 2023-12-20 09:23:19.868147074 +0800 +diff --git a/hotspot/src/os_cpu/linux_mips/vm/linux_mips.ad b/hotspot/src/os_cpu/linux_mips/vm/linux_mips.ad +new file mode 100644 +index 00000000..5e38996f +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_mips/vm/linux_mips.ad @@ -0,0 +1,153 @@ +// +// Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. @@ -108957,9 +110101,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +} + +%} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_mips/vm/linux_mips.s b/hotspot/src/os_cpu/linux_mips/vm/linux_mips.s ---- a/hotspot/src/os_cpu/linux_mips/vm/linux_mips.s 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_mips/vm/linux_mips.s 2023-12-20 09:23:19.868147074 +0800 +diff --git a/hotspot/src/os_cpu/linux_mips/vm/linux_mips.s b/hotspot/src/os_cpu/linux_mips/vm/linux_mips.s +new file mode 100644 +index 00000000..f87fbf26 +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_mips/vm/linux_mips.s @@ -0,0 +1,25 @@ +# +# Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. @@ -108986,9 +110132,67 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +# + + -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_mips/vm/orderAccess_linux_mips.inline.hpp b/hotspot/src/os_cpu/linux_mips/vm/orderAccess_linux_mips.inline.hpp ---- a/hotspot/src/os_cpu/linux_mips/vm/orderAccess_linux_mips.inline.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_mips/vm/orderAccess_linux_mips.inline.hpp 2023-12-20 09:23:19.868147074 +0800 +diff --git a/hotspot/src/os_cpu/linux_mips/vm/linux_mips_64.ad b/hotspot/src/os_cpu/linux_mips/vm/linux_mips_64.ad +new file mode 100644 +index 00000000..ca4d0947 +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_mips/vm/linux_mips_64.ad +@@ -0,0 +1,50 @@ ++// ++// Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. ++// Copyright (c) 2015, 2016, Loongson Technology. All rights reserved. ++// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++// ++// This code is free software; you can redistribute it and/or modify it ++// under the terms of the GNU General Public License version 2 only, as ++// published by the Free Software Foundation. ++// ++// This code is distributed in the hope that it will be useful, but WITHOUT ++// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++// version 2 for more details (a copy is included in the LICENSE file that ++// accompanied this code). ++// ++// You should have received a copy of the GNU General Public License version ++// 2 along with this work; if not, write to the Free Software Foundation, ++// Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++// ++// Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++// or visit www.oracle.com if you need additional information or have any ++// questions. ++// ++// ++ ++// AMD64 Linux Architecture Description File ++ ++//----------OS-DEPENDENT ENCODING BLOCK---------------------------------------- ++// This block specifies the encoding classes used by the compiler to ++// output byte streams. Encoding classes generate functions which are ++// called by Machine Instruction Nodes in order to generate the bit ++// encoding of the instruction. Operands specify their base encoding ++// interface with the interface keyword. There are currently ++// supported four interfaces, REG_INTER, CONST_INTER, MEMORY_INTER, & ++// COND_INTER. REG_INTER causes an operand to generate a function ++// which returns its register number when queried. CONST_INTER causes ++// an operand to generate a function which returns the value of the ++// constant when queried. MEMORY_INTER causes an operand to generate ++// four functions which return the Base Register, the Index Register, ++// the Scale Value, and the Offset Value of the operand when queried. ++// COND_INTER causes an operand to generate six functions which return ++// the encoding code (ie - encoding bits for the instruction) ++// associated with each basic boolean condition for a conditional ++// instruction. Instructions specify two basic values for encoding. ++// They use the ins_encode keyword to specify their encoding class ++// (which must be one of the class names specified in the encoding ++// block), and they use the opcode keyword to specify, in order, their ++// primary, secondary, and tertiary opcode. Only the opcode sections ++// which a particular instruction needs for encoding need to be ++// specified. +diff --git a/hotspot/src/os_cpu/linux_mips/vm/orderAccess_linux_mips.inline.hpp b/hotspot/src/os_cpu/linux_mips/vm/orderAccess_linux_mips.inline.hpp +new file mode 100644 +index 00000000..c9bc169a +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_mips/vm/orderAccess_linux_mips.inline.hpp @@ -0,0 +1,115 @@ +/* + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. @@ -109105,9 +110309,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +#undef inlasm_sync + +#endif // OS_CPU_LINUX_MIPS_VM_ORDERACCESS_LINUX_MIPS_INLINE_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_mips/vm/os_linux_mips.cpp b/hotspot/src/os_cpu/linux_mips/vm/os_linux_mips.cpp ---- a/hotspot/src/os_cpu/linux_mips/vm/os_linux_mips.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_mips/vm/os_linux_mips.cpp 2023-12-20 09:23:19.868147074 +0800 +diff --git a/hotspot/src/os_cpu/linux_mips/vm/os_linux_mips.cpp b/hotspot/src/os_cpu/linux_mips/vm/os_linux_mips.cpp +new file mode 100644 +index 00000000..43487dab +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_mips/vm/os_linux_mips.cpp @@ -0,0 +1,1015 @@ +/* + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. @@ -110124,9 +111330,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +bool os::is_ActiveCoresMP() { + return UseActiveCoresMP && _initial_active_processor_count == 1; +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_mips/vm/os_linux_mips.hpp b/hotspot/src/os_cpu/linux_mips/vm/os_linux_mips.hpp ---- a/hotspot/src/os_cpu/linux_mips/vm/os_linux_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_mips/vm/os_linux_mips.hpp 2023-12-20 09:23:19.868147074 +0800 +diff --git a/hotspot/src/os_cpu/linux_mips/vm/os_linux_mips.hpp b/hotspot/src/os_cpu/linux_mips/vm/os_linux_mips.hpp +new file mode 100644 +index 00000000..c07d0815 +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_mips/vm/os_linux_mips.hpp @@ -0,0 +1,39 @@ +/* + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. @@ -110167,9 +111375,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + static bool is_ActiveCoresMP(); + +#endif // OS_CPU_LINUX_MIPS_VM_OS_LINUX_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_mips/vm/prefetch_linux_mips.inline.hpp b/hotspot/src/os_cpu/linux_mips/vm/prefetch_linux_mips.inline.hpp ---- a/hotspot/src/os_cpu/linux_mips/vm/prefetch_linux_mips.inline.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_mips/vm/prefetch_linux_mips.inline.hpp 2023-12-20 09:23:19.868147074 +0800 +diff --git a/hotspot/src/os_cpu/linux_mips/vm/prefetch_linux_mips.inline.hpp b/hotspot/src/os_cpu/linux_mips/vm/prefetch_linux_mips.inline.hpp +new file mode 100644 +index 00000000..93490345 +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_mips/vm/prefetch_linux_mips.inline.hpp @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. @@ -110229,13 +111439,15 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +} + +#endif // OS_CPU_LINUX_MIPS_VM_PREFETCH_LINUX_MIPS_INLINE_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_mips/vm/thread_linux_mips.cpp b/hotspot/src/os_cpu/linux_mips/vm/thread_linux_mips.cpp ---- a/hotspot/src/os_cpu/linux_mips/vm/thread_linux_mips.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_mips/vm/thread_linux_mips.cpp 2023-12-20 09:23:19.868147074 +0800 -@@ -0,0 +1,99 @@ +diff --git a/hotspot/src/os_cpu/linux_mips/vm/threadLS_linux_mips.cpp b/hotspot/src/os_cpu/linux_mips/vm/threadLS_linux_mips.cpp +new file mode 100644 +index 00000000..be28a562 +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_mips/vm/threadLS_linux_mips.cpp +@@ -0,0 +1,84 @@ +/* -+ * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2021, Loongson Technology. All rights reserved. ++ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2015, 2022, Loongson Technology. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it @@ -110259,85 +111471,244 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + */ + +#include "precompiled.hpp" -+#include "runtime/frame.inline.hpp" +#include "runtime/thread.inline.hpp" -+#include "runtime/sharedRuntime.hpp" ++#include "runtime/threadLocalStorage.hpp" + -+void JavaThread::pd_initialize() -+{ -+ _anchor.clear(); -+} ++// Map stack pointer (%esp) to thread pointer for faster TLS access ++// ++// Here we use a flat table for better performance. Getting current thread ++// is down to one memory access (read _sp_map[%esp>>12]) in generated code ++// and two in runtime code (-fPIC code needs an extra load for _sp_map). ++// ++// This code assumes stack page is not shared by different threads. It works ++// in 32-bit VM when page size is 4K (or a multiple of 4K, if that matters). ++// ++// Notice that _sp_map is allocated in the bss segment, which is ZFOD ++// (zero-fill-on-demand). While it reserves 4M address space upfront, ++// actual memory pages are committed on demand. ++// ++// If an application creates and destroys a lot of threads, usually the ++// stack space freed by a thread will soon get reused by new thread ++// (this is especially true in NPTL or LinuxThreads in fixed-stack mode). ++// No memory page in _sp_map is wasted. ++// ++// However, it's still possible that we might end up populating & ++// committing a large fraction of the 4M table over time, but the actual ++// amount of live data in the table could be quite small. The max wastage ++// is less than 4M bytes. If it becomes an issue, we could use madvise() ++// with MADV_DONTNEED to reclaim unused (i.e. all-zero) pages in _sp_map. ++// MADV_DONTNEED on Linux keeps the virtual memory mapping, but zaps the ++// physical memory page (i.e. similar to MADV_FREE on Solaris). + -+// For Forte Analyzer AsyncGetCallTrace profiling support - thread is -+// currently interrupted by SIGPROF -+bool JavaThread::pd_get_top_frame_for_signal_handler(frame* fr_addr, -+ void* ucontext, bool isInJava) { ++#ifdef MINIMIZE_RAM_USAGE ++Thread* ThreadLocalStorage::_sp_map[1UL << (SP_BITLENGTH - PAGE_SHIFT)]; ++#endif // MINIMIZE_RAM_USAGE + -+ assert(Thread::current() == this, "caller must be current thread"); -+ return pd_get_top_frame(fr_addr, ucontext, isInJava); ++void ThreadLocalStorage::generate_code_for_get_thread() { ++ // nothing we can do here for user-level thread +} + -+bool JavaThread::pd_get_top_frame_for_profiling(frame* fr_addr, void* ucontext, bool isInJava) { -+ return pd_get_top_frame(fr_addr, ucontext, isInJava); ++void ThreadLocalStorage::pd_init() { ++#ifdef MINIMIZE_RAM_USAGE ++ assert(align_size_down(os::vm_page_size(), PAGE_SIZE) == os::vm_page_size(), ++ "page size must be multiple of PAGE_SIZE"); ++#endif // MINIMIZE_RAM_USAGE +} + -+bool JavaThread::pd_get_top_frame(frame* fr_addr, void* ucontext, bool isInJava) { -+ assert(this->is_Java_thread(), "must be JavaThread"); -+ JavaThread* jt = (JavaThread *)this; ++void ThreadLocalStorage::pd_set_thread(Thread* thread) { ++ os::thread_local_storage_at_put(ThreadLocalStorage::thread_index(), thread); ++#ifdef MINIMIZE_RAM_USAGE ++ address stack_top = os::current_stack_base(); ++ size_t stack_size = os::current_stack_size(); + -+ // If we have a last_Java_frame, then we should use it even if -+ // isInJava == true. It should be more reliable than ucontext info. -+ if (jt->has_last_Java_frame() && jt->frame_anchor()->walkable()) { -+ *fr_addr = jt->pd_last_frame(); -+ return true; ++ for (address p = stack_top - stack_size; p < stack_top; p += PAGE_SIZE) { ++ int index = ((uintptr_t)p >> PAGE_SHIFT) & ((1UL << (SP_BITLENGTH - PAGE_SHIFT)) - 1); ++ assert(thread == NULL || _sp_map[index] == NULL || thread == _sp_map[index], ++ "thread exited without detaching from VM??"); ++ _sp_map[index] = thread; + } ++#endif // MINIMIZE_RAM_USAGE ++} +diff --git a/hotspot/src/os_cpu/linux_mips/vm/threadLS_linux_mips.hpp b/hotspot/src/os_cpu/linux_mips/vm/threadLS_linux_mips.hpp +new file mode 100644 +index 00000000..e595195e +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_mips/vm/threadLS_linux_mips.hpp +@@ -0,0 +1,61 @@ ++/* ++ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2015, 2022, Loongson Technology. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ */ + -+ // At this point, we don't have a last_Java_frame, so -+ // we try to glean some information out of the ucontext -+ // if we were running Java code when SIGPROF came in. -+ if (isInJava) { -+ ucontext_t* uc = (ucontext_t*) ucontext; ++#ifndef OS_CPU_LINUX_MIPS_VM_THREADLS_LINUX_MIPS_HPP ++#define OS_CPU_LINUX_MIPS_VM_THREADLS_LINUX_MIPS_HPP + -+ intptr_t* ret_fp; -+ intptr_t* ret_sp; -+ ExtendedPC addr = os::Linux::fetch_frame_from_ucontext(this, uc, -+ &ret_sp, &ret_fp); -+ if (addr.pc() == NULL || ret_sp == NULL ) { -+ // ucontext wasn't useful -+ return false; -+ } ++#ifdef MINIMIZE_RAM_USAGE ++ // Processor dependent parts of ThreadLocalStorage ++ //only the low 2G space for user program in Linux + -+ frame ret_frame(ret_sp, ret_fp, addr.pc()); -+ if (!ret_frame.safe_for_sender(jt)) { -+#ifdef COMPILER2 -+ // C2 uses ebp as a general register see if NULL fp helps -+ frame ret_frame2(ret_sp, NULL, addr.pc()); -+ if (!ret_frame2.safe_for_sender(jt)) { -+ // nothing else to try if the frame isn't good -+ return false; -+ } -+ ret_frame = ret_frame2; -+#else -+ // nothing else to try if the frame isn't good -+ return false; -+#endif /* COMPILER2 */ -+ } -+ *fr_addr = ret_frame; -+ return true; -+ } ++ #define SP_BITLENGTH 34 ++ #define PAGE_SHIFT 14 ++ #define PAGE_SIZE (1UL << PAGE_SHIFT) + -+ // nothing else to try -+ return false; -+} ++ static Thread* _sp_map[1UL << (SP_BITLENGTH - PAGE_SHIFT)]; ++ static int _sp_map_low; ++ static int _sp_map_high; ++#endif // MINIMIZE_RAM_USAGE + -+void JavaThread::cache_global_variables() { } ++public: ++#ifdef MINIMIZE_RAM_USAGE ++ static Thread** sp_map_addr() { return _sp_map; } ++#endif // MINIMIZE_RAM_USAGE + -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_mips/vm/thread_linux_mips.hpp b/hotspot/src/os_cpu/linux_mips/vm/thread_linux_mips.hpp ---- a/hotspot/src/os_cpu/linux_mips/vm/thread_linux_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_mips/vm/thread_linux_mips.hpp 2023-12-20 09:23:19.868147074 +0800 -@@ -0,0 +1,75 @@ ++ static Thread* thread() { ++#ifdef MINIMIZE_RAM_USAGE ++ /* Thread::thread() can also be optimized in the same way as __get_thread() */ ++ //return (Thread*) os::thread_local_storage_at(thread_index()); ++ uintptr_t sp; ++ uintptr_t mask = (1UL << (SP_BITLENGTH - PAGE_SHIFT)) - 1; ++ ++ __asm__ __volatile__ ("daddiu %0, $29, 0 " : "=r" (sp)); ++ ++ return _sp_map[(sp >> PAGE_SHIFT) & mask]; ++#else ++ return (Thread*) os::thread_local_storage_at(thread_index()); ++#endif // MINIMIZE_RAM_USAGE ++ } ++#endif // OS_CPU_LINUX_MIPS_VM_THREADLS_LINUX_MIPS_HPP +diff --git a/hotspot/src/os_cpu/linux_mips/vm/thread_linux_mips.cpp b/hotspot/src/os_cpu/linux_mips/vm/thread_linux_mips.cpp +new file mode 100644 +index 00000000..44f666d6 +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_mips/vm/thread_linux_mips.cpp +@@ -0,0 +1,99 @@ +/* -+ * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2015, 2021, Loongson Technology. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ */ ++ ++#include "precompiled.hpp" ++#include "runtime/frame.inline.hpp" ++#include "runtime/thread.inline.hpp" ++#include "runtime/sharedRuntime.hpp" ++ ++void JavaThread::pd_initialize() ++{ ++ _anchor.clear(); ++} ++ ++// For Forte Analyzer AsyncGetCallTrace profiling support - thread is ++// currently interrupted by SIGPROF ++bool JavaThread::pd_get_top_frame_for_signal_handler(frame* fr_addr, ++ void* ucontext, bool isInJava) { ++ ++ assert(Thread::current() == this, "caller must be current thread"); ++ return pd_get_top_frame(fr_addr, ucontext, isInJava); ++} ++ ++bool JavaThread::pd_get_top_frame_for_profiling(frame* fr_addr, void* ucontext, bool isInJava) { ++ return pd_get_top_frame(fr_addr, ucontext, isInJava); ++} ++ ++bool JavaThread::pd_get_top_frame(frame* fr_addr, void* ucontext, bool isInJava) { ++ assert(this->is_Java_thread(), "must be JavaThread"); ++ JavaThread* jt = (JavaThread *)this; ++ ++ // If we have a last_Java_frame, then we should use it even if ++ // isInJava == true. It should be more reliable than ucontext info. ++ if (jt->has_last_Java_frame() && jt->frame_anchor()->walkable()) { ++ *fr_addr = jt->pd_last_frame(); ++ return true; ++ } ++ ++ // At this point, we don't have a last_Java_frame, so ++ // we try to glean some information out of the ucontext ++ // if we were running Java code when SIGPROF came in. ++ if (isInJava) { ++ ucontext_t* uc = (ucontext_t*) ucontext; ++ ++ intptr_t* ret_fp; ++ intptr_t* ret_sp; ++ ExtendedPC addr = os::Linux::fetch_frame_from_ucontext(this, uc, ++ &ret_sp, &ret_fp); ++ if (addr.pc() == NULL || ret_sp == NULL ) { ++ // ucontext wasn't useful ++ return false; ++ } ++ ++ frame ret_frame(ret_sp, ret_fp, addr.pc()); ++ if (!ret_frame.safe_for_sender(jt)) { ++#ifdef COMPILER2 ++ // C2 uses ebp as a general register see if NULL fp helps ++ frame ret_frame2(ret_sp, NULL, addr.pc()); ++ if (!ret_frame2.safe_for_sender(jt)) { ++ // nothing else to try if the frame isn't good ++ return false; ++ } ++ ret_frame = ret_frame2; ++#else ++ // nothing else to try if the frame isn't good ++ return false; ++#endif /* COMPILER2 */ ++ } ++ *fr_addr = ret_frame; ++ return true; ++ } ++ ++ // nothing else to try ++ return false; ++} ++ ++void JavaThread::cache_global_variables() { } ++ +diff --git a/hotspot/src/os_cpu/linux_mips/vm/thread_linux_mips.hpp b/hotspot/src/os_cpu/linux_mips/vm/thread_linux_mips.hpp +new file mode 100644 +index 00000000..cb11c36a +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_mips/vm/thread_linux_mips.hpp +@@ -0,0 +1,75 @@ ++/* ++ * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2021, Loongson Technology. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * @@ -110411,162 +111782,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + static void disable_register_stack_guard() {} + +#endif // OS_CPU_LINUX_MIPS_VM_THREAD_LINUX_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_mips/vm/threadLS_linux_mips.cpp b/hotspot/src/os_cpu/linux_mips/vm/threadLS_linux_mips.cpp ---- a/hotspot/src/os_cpu/linux_mips/vm/threadLS_linux_mips.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_mips/vm/threadLS_linux_mips.cpp 2023-12-20 09:23:19.868147074 +0800 -@@ -0,0 +1,84 @@ -+/* -+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2022, Loongson Technology. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ * -+ */ -+ -+#include "precompiled.hpp" -+#include "runtime/thread.inline.hpp" -+#include "runtime/threadLocalStorage.hpp" -+ -+// Map stack pointer (%esp) to thread pointer for faster TLS access -+// -+// Here we use a flat table for better performance. Getting current thread -+// is down to one memory access (read _sp_map[%esp>>12]) in generated code -+// and two in runtime code (-fPIC code needs an extra load for _sp_map). -+// -+// This code assumes stack page is not shared by different threads. It works -+// in 32-bit VM when page size is 4K (or a multiple of 4K, if that matters). -+// -+// Notice that _sp_map is allocated in the bss segment, which is ZFOD -+// (zero-fill-on-demand). While it reserves 4M address space upfront, -+// actual memory pages are committed on demand. -+// -+// If an application creates and destroys a lot of threads, usually the -+// stack space freed by a thread will soon get reused by new thread -+// (this is especially true in NPTL or LinuxThreads in fixed-stack mode). -+// No memory page in _sp_map is wasted. -+// -+// However, it's still possible that we might end up populating & -+// committing a large fraction of the 4M table over time, but the actual -+// amount of live data in the table could be quite small. The max wastage -+// is less than 4M bytes. If it becomes an issue, we could use madvise() -+// with MADV_DONTNEED to reclaim unused (i.e. all-zero) pages in _sp_map. -+// MADV_DONTNEED on Linux keeps the virtual memory mapping, but zaps the -+// physical memory page (i.e. similar to MADV_FREE on Solaris). -+ -+#ifdef MINIMIZE_RAM_USAGE -+Thread* ThreadLocalStorage::_sp_map[1UL << (SP_BITLENGTH - PAGE_SHIFT)]; -+#endif // MINIMIZE_RAM_USAGE -+ -+void ThreadLocalStorage::generate_code_for_get_thread() { -+ // nothing we can do here for user-level thread -+} -+ -+void ThreadLocalStorage::pd_init() { -+#ifdef MINIMIZE_RAM_USAGE -+ assert(align_size_down(os::vm_page_size(), PAGE_SIZE) == os::vm_page_size(), -+ "page size must be multiple of PAGE_SIZE"); -+#endif // MINIMIZE_RAM_USAGE -+} -+ -+void ThreadLocalStorage::pd_set_thread(Thread* thread) { -+ os::thread_local_storage_at_put(ThreadLocalStorage::thread_index(), thread); -+#ifdef MINIMIZE_RAM_USAGE -+ address stack_top = os::current_stack_base(); -+ size_t stack_size = os::current_stack_size(); -+ -+ for (address p = stack_top - stack_size; p < stack_top; p += PAGE_SIZE) { -+ int index = ((uintptr_t)p >> PAGE_SHIFT) & ((1UL << (SP_BITLENGTH - PAGE_SHIFT)) - 1); -+ assert(thread == NULL || _sp_map[index] == NULL || thread == _sp_map[index], -+ "thread exited without detaching from VM??"); -+ _sp_map[index] = thread; -+ } -+#endif // MINIMIZE_RAM_USAGE -+} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_mips/vm/threadLS_linux_mips.hpp b/hotspot/src/os_cpu/linux_mips/vm/threadLS_linux_mips.hpp ---- a/hotspot/src/os_cpu/linux_mips/vm/threadLS_linux_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_mips/vm/threadLS_linux_mips.hpp 2023-12-20 09:23:19.868147074 +0800 -@@ -0,0 +1,61 @@ -+/* -+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2022, Loongson Technology. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ * -+ */ -+ -+#ifndef OS_CPU_LINUX_MIPS_VM_THREADLS_LINUX_MIPS_HPP -+#define OS_CPU_LINUX_MIPS_VM_THREADLS_LINUX_MIPS_HPP -+ -+#ifdef MINIMIZE_RAM_USAGE -+ // Processor dependent parts of ThreadLocalStorage -+ //only the low 2G space for user program in Linux -+ -+ #define SP_BITLENGTH 34 -+ #define PAGE_SHIFT 14 -+ #define PAGE_SIZE (1UL << PAGE_SHIFT) -+ -+ static Thread* _sp_map[1UL << (SP_BITLENGTH - PAGE_SHIFT)]; -+ static int _sp_map_low; -+ static int _sp_map_high; -+#endif // MINIMIZE_RAM_USAGE -+ -+public: -+#ifdef MINIMIZE_RAM_USAGE -+ static Thread** sp_map_addr() { return _sp_map; } -+#endif // MINIMIZE_RAM_USAGE -+ -+ static Thread* thread() { -+#ifdef MINIMIZE_RAM_USAGE -+ /* Thread::thread() can also be optimized in the same way as __get_thread() */ -+ //return (Thread*) os::thread_local_storage_at(thread_index()); -+ uintptr_t sp; -+ uintptr_t mask = (1UL << (SP_BITLENGTH - PAGE_SHIFT)) - 1; -+ -+ __asm__ __volatile__ ("daddiu %0, $29, 0 " : "=r" (sp)); -+ -+ return _sp_map[(sp >> PAGE_SHIFT) & mask]; -+#else -+ return (Thread*) os::thread_local_storage_at(thread_index()); -+#endif // MINIMIZE_RAM_USAGE -+ } -+#endif // OS_CPU_LINUX_MIPS_VM_THREADLS_LINUX_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_mips/vm/vmStructs_linux_mips.hpp b/hotspot/src/os_cpu/linux_mips/vm/vmStructs_linux_mips.hpp ---- a/hotspot/src/os_cpu/linux_mips/vm/vmStructs_linux_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_mips/vm/vmStructs_linux_mips.hpp 2023-12-20 09:23:19.868147074 +0800 +diff --git a/hotspot/src/os_cpu/linux_mips/vm/vmStructs_linux_mips.hpp b/hotspot/src/os_cpu/linux_mips/vm/vmStructs_linux_mips.hpp +new file mode 100644 +index 00000000..b7454bf0 +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_mips/vm/vmStructs_linux_mips.hpp @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. @@ -110623,9 +111843,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +#define VM_LONG_CONSTANTS_OS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant) + +#endif // OS_CPU_LINUX_MIPS_VM_VMSTRUCTS_LINUX_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_mips/vm/vm_version_linux_mips.cpp b/hotspot/src/os_cpu/linux_mips/vm/vm_version_linux_mips.cpp ---- a/hotspot/src/os_cpu/linux_mips/vm/vm_version_linux_mips.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_mips/vm/vm_version_linux_mips.cpp 2023-12-20 09:23:19.868147074 +0800 +diff --git a/hotspot/src/os_cpu/linux_mips/vm/vm_version_linux_mips.cpp b/hotspot/src/os_cpu/linux_mips/vm/vm_version_linux_mips.cpp +new file mode 100644 +index 00000000..ce697823 +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_mips/vm/vm_version_linux_mips.cpp @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. @@ -110655,30 +111877,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +#include "precompiled.hpp" +#include "runtime/os.hpp" +#include "vm_version_mips.hpp" -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/tools/hsdis/hsdis.c b/hotspot/src/share/tools/hsdis/hsdis.c ---- a/hotspot/src/share/tools/hsdis/hsdis.c 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/tools/hsdis/hsdis.c 2023-12-20 09:23:19.908146618 +0800 -@@ -493,6 +493,16 @@ - #if defined(LIBARCH_ppc64) || defined(LIBARCH_ppc64le) - res = "powerpc:common64"; - #endif -+#ifdef LIBARCH_mips64 -+#ifdef LOONGSON -+ res = "mips:loongson_3a"; -+#else -+ res = "mips:isa64"; -+#endif -+#endif -+#ifdef LIBARCH_loongarch64 -+ res = "loongarch"; -+#endif - #ifdef LIBARCH_aarch64 - res = "aarch64"; - #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/tools/hsdis/Makefile b/hotspot/src/share/tools/hsdis/Makefile ---- a/hotspot/src/share/tools/hsdis/Makefile 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/tools/hsdis/Makefile 2023-12-20 09:23:19.904813322 +0800 -@@ -105,12 +105,25 @@ +diff --git a/hotspot/src/share/tools/hsdis/Makefile b/hotspot/src/share/tools/hsdis/Makefile +index 0d1b6089..a9754ce2 100644 +--- a/hotspot/src/share/tools/hsdis/Makefile ++++ b/hotspot/src/share/tools/hsdis/Makefile +@@ -105,12 +105,25 @@ CFLAGS/sparc += -m32 endif CFLAGS += $(CFLAGS/$(ARCH)) CFLAGS += -fPIC @@ -110704,9 +111907,31 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp LDFLAGS += -ldl OUTFLAGS += -o $@ else -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/adlc/main.cpp b/hotspot/src/share/vm/adlc/main.cpp ---- a/hotspot/src/share/vm/adlc/main.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/adlc/main.cpp 2023-12-20 09:23:19.908146618 +0800 +diff --git a/hotspot/src/share/tools/hsdis/hsdis.c b/hotspot/src/share/tools/hsdis/hsdis.c +index 4fb49648..f6ef5bea 100644 +--- a/hotspot/src/share/tools/hsdis/hsdis.c ++++ b/hotspot/src/share/tools/hsdis/hsdis.c +@@ -493,6 +493,16 @@ static const char* native_arch_name() { + #if defined(LIBARCH_ppc64) || defined(LIBARCH_ppc64le) + res = "powerpc:common64"; + #endif ++#ifdef LIBARCH_mips64 ++#ifdef LOONGSON ++ res = "mips:loongson_3a"; ++#else ++ res = "mips:isa64"; ++#endif ++#endif ++#ifdef LIBARCH_loongarch64 ++ res = "loongarch"; ++#endif + #ifdef LIBARCH_aarch64 + res = "aarch64"; + #endif +diff --git a/hotspot/src/share/vm/adlc/main.cpp b/hotspot/src/share/vm/adlc/main.cpp +index 52044f12..50c58587 100644 +--- a/hotspot/src/share/vm/adlc/main.cpp ++++ b/hotspot/src/share/vm/adlc/main.cpp @@ -22,6 +22,12 @@ * */ @@ -110720,7 +111945,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp // MAIN.CPP - Entry point for the Architecture Description Language Compiler #include "adlc.hpp" -@@ -234,6 +240,14 @@ +@@ -234,6 +240,14 @@ int main(int argc, char *argv[]) AD.addInclude(AD._CPP_file, "nativeInst_x86.hpp"); AD.addInclude(AD._CPP_file, "vmreg_x86.inline.hpp"); #endif @@ -110735,9 +111960,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_ARCH_aarch64 AD.addInclude(AD._CPP_file, "assembler_aarch64.inline.hpp"); AD.addInclude(AD._CPP_file, "nativeInst_aarch64.hpp"); -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/asm/assembler.hpp b/hotspot/src/share/vm/asm/assembler.hpp ---- a/hotspot/src/share/vm/asm/assembler.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/asm/assembler.hpp 2023-12-20 09:23:19.911479913 +0800 +diff --git a/hotspot/src/share/vm/asm/assembler.hpp b/hotspot/src/share/vm/asm/assembler.hpp +index f7f1ae1d..572aa997 100644 +--- a/hotspot/src/share/vm/asm/assembler.hpp ++++ b/hotspot/src/share/vm/asm/assembler.hpp @@ -22,6 +22,12 @@ * */ @@ -110766,7 +111992,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_ARCH_aarch64 # include "register_aarch64.hpp" # include "vm_version_aarch64.hpp" -@@ -468,6 +482,12 @@ +@@ -468,6 +482,12 @@ class AbstractAssembler : public ResourceObj { #ifdef TARGET_ARCH_ppc # include "assembler_ppc.hpp" #endif @@ -110779,9 +112005,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #endif // SHARE_VM_ASM_ASSEMBLER_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/asm/assembler.inline.hpp b/hotspot/src/share/vm/asm/assembler.inline.hpp ---- a/hotspot/src/share/vm/asm/assembler.inline.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/asm/assembler.inline.hpp 2023-12-20 09:23:19.911479913 +0800 +diff --git a/hotspot/src/share/vm/asm/assembler.inline.hpp b/hotspot/src/share/vm/asm/assembler.inline.hpp +index 1a48cb31..8ac90e14 100644 +--- a/hotspot/src/share/vm/asm/assembler.inline.hpp ++++ b/hotspot/src/share/vm/asm/assembler.inline.hpp @@ -22,6 +22,12 @@ * */ @@ -110808,9 +112035,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_ARCH_aarch64 # include "assembler_aarch64.inline.hpp" #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/asm/codeBuffer.cpp b/hotspot/src/share/vm/asm/codeBuffer.cpp ---- a/hotspot/src/share/vm/asm/codeBuffer.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/asm/codeBuffer.cpp 2023-12-20 09:23:19.911479913 +0800 +diff --git a/hotspot/src/share/vm/asm/codeBuffer.cpp b/hotspot/src/share/vm/asm/codeBuffer.cpp +index d94ac406..f6b57811 100644 +--- a/hotspot/src/share/vm/asm/codeBuffer.cpp ++++ b/hotspot/src/share/vm/asm/codeBuffer.cpp @@ -22,6 +22,12 @@ * */ @@ -110824,7 +112052,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #include "precompiled.hpp" #include "asm/codeBuffer.hpp" #include "compiler/disassembler.hpp" -@@ -323,6 +329,7 @@ +@@ -323,6 +329,7 @@ void CodeSection::relocate(address at, RelocationHolder const& spec, int format) assert(rtype == relocInfo::none || rtype == relocInfo::runtime_call_type || rtype == relocInfo::internal_word_type|| @@ -110832,9 +112060,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp rtype == relocInfo::section_word_type || rtype == relocInfo::external_word_type, "code needs relocation information"); -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/asm/codeBuffer.hpp b/hotspot/src/share/vm/asm/codeBuffer.hpp ---- a/hotspot/src/share/vm/asm/codeBuffer.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/asm/codeBuffer.hpp 2023-12-20 09:23:19.911479913 +0800 +diff --git a/hotspot/src/share/vm/asm/codeBuffer.hpp b/hotspot/src/share/vm/asm/codeBuffer.hpp +index 02b619ad..c04560a0 100644 +--- a/hotspot/src/share/vm/asm/codeBuffer.hpp ++++ b/hotspot/src/share/vm/asm/codeBuffer.hpp @@ -22,6 +22,12 @@ * */ @@ -110848,7 +112077,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifndef SHARE_VM_ASM_CODEBUFFER_HPP #define SHARE_VM_ASM_CODEBUFFER_HPP -@@ -635,6 +641,12 @@ +@@ -635,6 +641,12 @@ class CodeBuffer: public StackObj { #ifdef TARGET_ARCH_ppc # include "codeBuffer_ppc.hpp" #endif @@ -110861,9 +112090,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp }; -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/asm/macroAssembler.hpp b/hotspot/src/share/vm/asm/macroAssembler.hpp ---- a/hotspot/src/share/vm/asm/macroAssembler.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/asm/macroAssembler.hpp 2023-12-20 09:23:19.911479913 +0800 +diff --git a/hotspot/src/share/vm/asm/macroAssembler.hpp b/hotspot/src/share/vm/asm/macroAssembler.hpp +index 1482eb63..0be415b6 100644 +--- a/hotspot/src/share/vm/asm/macroAssembler.hpp ++++ b/hotspot/src/share/vm/asm/macroAssembler.hpp @@ -22,6 +22,12 @@ * */ @@ -110889,9 +112119,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +# include "macroAssembler_loongarch.hpp" +#endif #endif // SHARE_VM_ASM_MACROASSEMBLER_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/asm/macroAssembler.inline.hpp b/hotspot/src/share/vm/asm/macroAssembler.inline.hpp ---- a/hotspot/src/share/vm/asm/macroAssembler.inline.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/asm/macroAssembler.inline.hpp 2023-12-20 09:23:19.911479913 +0800 +diff --git a/hotspot/src/share/vm/asm/macroAssembler.inline.hpp b/hotspot/src/share/vm/asm/macroAssembler.inline.hpp +index db3daa52..6f4e523c 100644 +--- a/hotspot/src/share/vm/asm/macroAssembler.inline.hpp ++++ b/hotspot/src/share/vm/asm/macroAssembler.inline.hpp @@ -22,6 +22,12 @@ * */ @@ -110918,9 +112149,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_ARCH_aarch64 # include "macroAssembler_aarch64.inline.hpp" #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/asm/register.hpp b/hotspot/src/share/vm/asm/register.hpp ---- a/hotspot/src/share/vm/asm/register.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/asm/register.hpp 2023-12-20 09:23:19.911479913 +0800 +diff --git a/hotspot/src/share/vm/asm/register.hpp b/hotspot/src/share/vm/asm/register.hpp +index c5008901..6a20929e 100644 +--- a/hotspot/src/share/vm/asm/register.hpp ++++ b/hotspot/src/share/vm/asm/register.hpp @@ -22,6 +22,12 @@ * */ @@ -110934,7 +112166,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifndef SHARE_VM_ASM_REGISTER_HPP #define SHARE_VM_ASM_REGISTER_HPP -@@ -108,6 +114,12 @@ +@@ -108,6 +114,12 @@ const type name = ((type)name##_##type##EnumValue) #ifdef TARGET_ARCH_ppc # include "register_ppc.hpp" #endif @@ -110947,9 +112179,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_ARCH_aarch64 # include "register_aarch64.hpp" #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/c1/c1_Defs.hpp b/hotspot/src/share/vm/c1/c1_Defs.hpp ---- a/hotspot/src/share/vm/c1/c1_Defs.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/c1/c1_Defs.hpp 2023-12-20 09:23:19.911479913 +0800 +diff --git a/hotspot/src/share/vm/c1/c1_Defs.hpp b/hotspot/src/share/vm/c1/c1_Defs.hpp +index b0cd7637..b42b9de1 100644 +--- a/hotspot/src/share/vm/c1/c1_Defs.hpp ++++ b/hotspot/src/share/vm/c1/c1_Defs.hpp @@ -22,6 +22,12 @@ * */ @@ -110973,7 +112206,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_ARCH_aarch64 # include "register_aarch64.hpp" #endif -@@ -56,6 +65,9 @@ +@@ -56,6 +65,9 @@ enum { #ifdef TARGET_ARCH_x86 # include "c1_Defs_x86.hpp" #endif @@ -110983,9 +112216,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_ARCH_aarch64 # include "c1_Defs_aarch64.hpp" #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/c1/c1_FpuStackSim.hpp b/hotspot/src/share/vm/c1/c1_FpuStackSim.hpp ---- a/hotspot/src/share/vm/c1/c1_FpuStackSim.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/c1/c1_FpuStackSim.hpp 2023-12-20 09:23:19.911479913 +0800 +diff --git a/hotspot/src/share/vm/c1/c1_FpuStackSim.hpp b/hotspot/src/share/vm/c1/c1_FpuStackSim.hpp +index f07e97a4..6bc367a8 100644 +--- a/hotspot/src/share/vm/c1/c1_FpuStackSim.hpp ++++ b/hotspot/src/share/vm/c1/c1_FpuStackSim.hpp @@ -22,6 +22,12 @@ * */ @@ -110999,7 +112233,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifndef SHARE_VM_C1_C1_FPUSTACKSIM_HPP #define SHARE_VM_C1_C1_FPUSTACKSIM_HPP -@@ -35,6 +41,9 @@ +@@ -35,6 +41,9 @@ class FpuStackSim; #ifdef TARGET_ARCH_x86 # include "c1_FpuStackSim_x86.hpp" #endif @@ -111009,9 +112243,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_ARCH_aarch64 # include "c1_FpuStackSim_aarch64.hpp" #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/c1/c1_FrameMap.cpp b/hotspot/src/share/vm/c1/c1_FrameMap.cpp ---- a/hotspot/src/share/vm/c1/c1_FrameMap.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/c1/c1_FrameMap.cpp 2023-12-20 09:23:19.911479913 +0800 +diff --git a/hotspot/src/share/vm/c1/c1_FrameMap.cpp b/hotspot/src/share/vm/c1/c1_FrameMap.cpp +index 1dac94d5..b1e37ec4 100644 +--- a/hotspot/src/share/vm/c1/c1_FrameMap.cpp ++++ b/hotspot/src/share/vm/c1/c1_FrameMap.cpp @@ -22,6 +22,12 @@ * */ @@ -111035,9 +112270,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_ARCH_aarch64 # include "vmreg_aarch64.inline.hpp" #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/c1/c1_FrameMap.hpp b/hotspot/src/share/vm/c1/c1_FrameMap.hpp ---- a/hotspot/src/share/vm/c1/c1_FrameMap.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/c1/c1_FrameMap.hpp 2023-12-20 09:23:19.911479913 +0800 +diff --git a/hotspot/src/share/vm/c1/c1_FrameMap.hpp b/hotspot/src/share/vm/c1/c1_FrameMap.hpp +index 41571e3d..c0e7b28e 100644 +--- a/hotspot/src/share/vm/c1/c1_FrameMap.hpp ++++ b/hotspot/src/share/vm/c1/c1_FrameMap.hpp @@ -22,6 +22,12 @@ * */ @@ -111051,7 +112287,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifndef SHARE_VM_C1_C1_FRAMEMAP_HPP #define SHARE_VM_C1_C1_FRAMEMAP_HPP -@@ -85,6 +91,9 @@ +@@ -85,6 +91,9 @@ class FrameMap : public CompilationResourceObj { #ifdef TARGET_ARCH_x86 # include "c1_FrameMap_x86.hpp" #endif @@ -111061,298 +112297,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_ARCH_aarch64 # include "c1_FrameMap_aarch64.hpp" #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/c1/c1_globals.hpp b/hotspot/src/share/vm/c1/c1_globals.hpp ---- a/hotspot/src/share/vm/c1/c1_globals.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/c1/c1_globals.hpp 2023-12-20 09:23:19.921479797 +0800 -@@ -22,6 +22,12 @@ - * - */ - -+/* -+ * This file has been modified by Loongson Technology in 2022. These -+ * modifications are Copyright (c) 2015, 2022, Loongson Technology, and are made -+ * available on the same license terms set forth above. -+ */ -+ - #ifndef SHARE_VM_C1_C1_GLOBALS_HPP - #define SHARE_VM_C1_C1_GLOBALS_HPP - -@@ -29,6 +35,9 @@ - #ifdef TARGET_ARCH_x86 - # include "c1_globals_x86.hpp" - #endif -+#ifdef TARGET_ARCH_loongarch -+# include "c1_globals_loongarch.hpp" -+#endif - #ifdef TARGET_ARCH_aarch64 - # include "c1_globals_aarch64.hpp" - #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/c1/c1_LinearScan.cpp b/hotspot/src/share/vm/c1/c1_LinearScan.cpp ---- a/hotspot/src/share/vm/c1/c1_LinearScan.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/c1/c1_LinearScan.cpp 2023-12-20 09:23:19.918146502 +0800 -@@ -22,6 +22,12 @@ - * - */ - -+/* -+ * This file has been modified by Loongson Technology in 2022. These -+ * modifications are Copyright (c) 2015, 2022, Loongson Technology, and are made -+ * available on the same license terms set forth above. -+ */ -+ - #include "precompiled.hpp" - #include "c1/c1_CFGPrinter.hpp" - #include "c1/c1_CodeStubs.hpp" -@@ -35,6 +41,9 @@ - #ifdef TARGET_ARCH_x86 - # include "vmreg_x86.inline.hpp" - #endif -+#ifdef TARGET_ARCH_loongarch -+# include "vmreg_loongarch.inline.hpp" -+#endif - #ifdef TARGET_ARCH_aarch64 - # include "vmreg_aarch64.inline.hpp" - #endif -@@ -1266,6 +1275,23 @@ - } - break; - } -+ case lir_cmp_cmove: { -+ assert(op->as_Op4() != NULL, "lir_cmp_cmove must be LIR_Op4"); -+ LIR_Op4* cmove = (LIR_Op4*)op; -+ -+ LIR_Opr move_from = cmove->in_opr3(); -+ LIR_Opr move_to = cmove->result_opr(); -+ -+ if (move_to->is_register() && move_from->is_register()) { -+ Interval* from = interval_at(reg_num(move_from)); -+ Interval* to = interval_at(reg_num(move_to)); -+ if (from != NULL && to != NULL) { -+ to->set_register_hint(from); -+ TRACE_LINEAR_SCAN(4, tty->print_cr("operation at op_id %d: added hint from interval %d to %d", cmove->id(), from->reg_num(), to->reg_num())); -+ } -+ } -+ break; -+ } - } - } - -@@ -2104,7 +2130,7 @@ - #ifdef _LP64 - return LIR_OprFact::double_cpu(assigned_reg, assigned_reg); - #else --#if defined(SPARC) || defined(PPC) -+#if defined(SPARC) || defined(PPC) || defined(LOONGARCH) - return LIR_OprFact::double_cpu(assigned_regHi, assigned_reg); - #else - return LIR_OprFact::double_cpu(assigned_reg, assigned_regHi); -@@ -3285,7 +3311,9 @@ - check_live = (move->patch_code() == lir_patch_none); - } - LIR_OpBranch* branch = op->as_OpBranch(); -- if (branch != NULL && branch->stub() != NULL && branch->stub()->is_exception_throw_stub()) { -+ LIR_OpCmpBranch* cmp_branch = op->as_OpCmpBranch(); -+ if ((branch != NULL && branch->stub() != NULL && branch->stub()->is_exception_throw_stub()) || -+ (cmp_branch != NULL && cmp_branch->stub() != NULL && cmp_branch->stub()->is_exception_throw_stub())) { - // Don't bother checking the stub in this case since the - // exception stub will never return to normal control flow. - check_live = false; -@@ -6148,6 +6176,16 @@ - if (branch->ublock() == target_from) { - branch->change_ublock(target_to); - } -+ } else if (op->code() == lir_cmp_branch || op->code() == lir_cmp_float_branch) { -+ assert(op->as_OpCmpBranch() != NULL, "branch must be of type LIR_OpCmpBranch"); -+ LIR_OpCmpBranch* branch = (LIR_OpCmpBranch*)op; -+ -+ if (branch->block() == target_from) { -+ branch->change_block(target_to); -+ } -+ if (branch->ublock() == target_from) { -+ branch->change_ublock(target_to); -+ } - } - } - } -@@ -6252,6 +6290,20 @@ - instructions->truncate(instructions->length() - 1); - } - } -+ } else if (prev_op->code() == lir_cmp_branch || prev_op->code() == lir_cmp_float_branch) { -+ assert(prev_op->as_OpCmpBranch() != NULL, "branch must be of type LIR_OpCmpBranch"); -+ LIR_OpCmpBranch* prev_branch = (LIR_OpCmpBranch*)prev_op; -+ -+ if (prev_branch->stub() == NULL) { -+ if (prev_branch->block() == code->at(i + 1) && prev_branch->info() == NULL) { -+ TRACE_LINEAR_SCAN(3, tty->print_cr("Negating conditional branch and deleting unconditional branch at end of block B%d", block->block_id())); -+ -+ // eliminate a conditional branch to the immediate successor -+ prev_branch->change_block(last_branch->block()); -+ prev_branch->negate_cond(); -+ instructions->trunc_to(instructions->length() - 1); -+ } -+ } - } - } - } -@@ -6328,6 +6380,13 @@ - assert(op_branch->block() == NULL || code->index_of(op_branch->block()) != -1, "branch target not valid"); - assert(op_branch->ublock() == NULL || code->index_of(op_branch->ublock()) != -1, "branch target not valid"); - } -+ -+ LIR_OpCmpBranch* op_cmp_branch = instructions->at(j)->as_OpCmpBranch(); -+ -+ if (op_cmp_branch != NULL) { -+ assert(op_cmp_branch->block() == NULL || code->find(op_cmp_branch->block()) != -1, "branch target not valid"); -+ assert(op_cmp_branch->ublock() == NULL || code->find(op_cmp_branch->ublock()) != -1, "branch target not valid"); -+ } - } - - for (j = 0; j < block->number_of_sux() - 1; j++) { -@@ -6571,6 +6630,24 @@ - break; - } - -+ case lir_cmp_branch: -+ case lir_cmp_float_branch: { -+ LIR_OpCmpBranch* branch = op->as_OpCmpBranch(); -+ if (branch->block() == NULL) { -+ inc_counter(counter_stub_branch); -+ } else { -+ inc_counter(counter_cond_branch); -+ } -+ inc_counter(counter_cmp); -+ break; -+ } -+ -+ case lir_cmp_cmove: { -+ inc_counter(counter_misc_inst); -+ inc_counter(counter_cmp); -+ break; -+ } -+ - case lir_neg: - case lir_add: - case lir_sub: -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/c1/c1_LinearScan.hpp b/hotspot/src/share/vm/c1/c1_LinearScan.hpp ---- a/hotspot/src/share/vm/c1/c1_LinearScan.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/c1/c1_LinearScan.hpp 2023-12-20 09:23:19.918146502 +0800 -@@ -22,6 +22,12 @@ - * - */ - -+/* -+ * This file has been modified by Loongson Technology in 2022. These -+ * modifications are Copyright (c) 2015, 2022, Loongson Technology, and are made -+ * available on the same license terms set forth above. -+ */ -+ - #ifndef SHARE_VM_C1_C1_LINEARSCAN_HPP - #define SHARE_VM_C1_C1_LINEARSCAN_HPP - -@@ -976,6 +982,9 @@ - #ifdef TARGET_ARCH_x86 - # include "c1_LinearScan_x86.hpp" - #endif -+#ifdef TARGET_ARCH_loongarch -+# include "c1_LinearScan_loongarch.hpp" -+#endif - #ifdef TARGET_ARCH_aarch64 - # include "c1_LinearScan_aarch64.hpp" - #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp b/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp ---- a/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp 2023-12-20 09:23:19.914813209 +0800 -@@ -22,6 +22,12 @@ - * - */ - -+/* -+ * This file has been modified by Loongson Technology in 2022. These -+ * modifications are Copyright (c) 2015, 2022, Loongson Technology, and are made -+ * available on the same license terms set forth above. -+ */ -+ - #include "precompiled.hpp" - #include "c1/c1_Compilation.hpp" - #include "c1/c1_Instruction.hpp" -@@ -34,6 +40,10 @@ - # include "nativeInst_x86.hpp" - # include "vmreg_x86.inline.hpp" - #endif -+#ifdef TARGET_ARCH_loongarch -+# include "nativeInst_loongarch.hpp" -+# include "vmreg_loongarch.inline.hpp" -+#endif - #ifdef TARGET_ARCH_aarch64 - # include "nativeInst_aarch64.hpp" - # include "vmreg_aarch64.inline.hpp" -@@ -811,6 +821,18 @@ - } - - -+void LIR_Assembler::emit_op4(LIR_Op4* op) { -+ switch (op->code()) { -+ case lir_cmp_cmove: -+ cmp_cmove(op->condition(), op->in_opr1(), op->in_opr2(), op->in_opr3(), op->in_opr4(), op->result_opr(), op->type()); -+ break; -+ -+ default: -+ Unimplemented(); -+ break; -+ } -+} -+ - void LIR_Assembler::build_frame() { - _masm->build_frame(initial_frame_size_in_bytes(), bang_size_in_bytes()); - } -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/c1/c1_LIRAssembler.hpp b/hotspot/src/share/vm/c1/c1_LIRAssembler.hpp ---- a/hotspot/src/share/vm/c1/c1_LIRAssembler.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/c1/c1_LIRAssembler.hpp 2023-12-20 09:23:19.914813209 +0800 -@@ -22,6 +22,12 @@ - * - */ - -+/* -+ * This file has been modified by Loongson Technology in 2022. These -+ * modifications are Copyright (c) 2015, 2022, Loongson Technology, and are made -+ * available on the same license terms set forth above. -+ */ -+ - #ifndef SHARE_VM_C1_C1_LIRASSEMBLER_HPP - #define SHARE_VM_C1_C1_LIRASSEMBLER_HPP - -@@ -195,7 +201,9 @@ - void emit_op1(LIR_Op1* op); - void emit_op2(LIR_Op2* op); - void emit_op3(LIR_Op3* op); -+ void emit_op4(LIR_Op4* op); - void emit_opBranch(LIR_OpBranch* op); -+ void emit_opCmpBranch(LIR_OpCmpBranch* op); - void emit_opLabel(LIR_OpLabel* op); - void emit_arraycopy(LIR_OpArrayCopy* op); - void emit_updatecrc32(LIR_OpUpdateCRC32* op); -@@ -227,6 +235,7 @@ - void volatile_move_op(LIR_Opr src, LIR_Opr result, BasicType type, CodeEmitInfo* info); - void comp_mem_op(LIR_Opr src, LIR_Opr result, BasicType type, CodeEmitInfo* info); // info set for null exceptions - void comp_fl2i(LIR_Code code, LIR_Opr left, LIR_Opr right, LIR_Opr result, LIR_Op2* op); -+ void cmp_cmove(LIR_Condition code, LIR_Opr left, LIR_Opr right, LIR_Opr src1, LIR_Opr src2, LIR_Opr result, BasicType type); - void cmove(LIR_Condition code, LIR_Opr left, LIR_Opr right, LIR_Opr result, BasicType type); - - void call( LIR_OpJavaCall* op, relocInfo::relocType rtype); -@@ -265,6 +274,9 @@ - #ifdef TARGET_ARCH_x86 - # include "c1_LIRAssembler_x86.hpp" - #endif -+#ifdef TARGET_ARCH_loongarch -+# include "c1_LIRAssembler_loongarch.hpp" -+#endif - #ifdef TARGET_ARCH_aarch64 - # include "c1_LIRAssembler_aarch64.hpp" - #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/c1/c1_LIR.cpp b/hotspot/src/share/vm/c1/c1_LIR.cpp ---- a/hotspot/src/share/vm/c1/c1_LIR.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/c1/c1_LIR.cpp 2023-12-20 09:23:19.914813209 +0800 +diff --git a/hotspot/src/share/vm/c1/c1_LIR.cpp b/hotspot/src/share/vm/c1/c1_LIR.cpp +index fa37e7a0..5d33d3f7 100644 +--- a/hotspot/src/share/vm/c1/c1_LIR.cpp ++++ b/hotspot/src/share/vm/c1/c1_LIR.cpp @@ -22,6 +22,12 @@ * */ @@ -111366,7 +112314,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #include "precompiled.hpp" #include "c1/c1_InstructionPrinter.hpp" #include "c1/c1_LIR.hpp" -@@ -79,6 +85,17 @@ +@@ -79,6 +85,17 @@ FloatRegister LIR_OprDesc::as_double_reg() const { #endif @@ -111384,7 +112332,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp LIR_Opr LIR_OprFact::illegalOpr = LIR_OprFact::illegal(); -@@ -149,13 +166,19 @@ +@@ -149,13 +166,19 @@ void LIR_Address::verify0() const { #endif #ifdef _LP64 assert(base()->is_cpu_register(), "wrong base operand"); @@ -111405,7 +112353,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #else assert(base()->is_single_cpu(), "wrong base operand"); assert(index()->is_illegal() || index()->is_single_cpu(), "wrong index operand"); -@@ -258,8 +281,6 @@ +@@ -258,8 +281,6 @@ bool LIR_OprDesc::is_oop() const { } } @@ -111414,7 +112362,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp void LIR_Op2::verify() const { #ifdef ASSERT switch (code()) { -@@ -301,6 +322,18 @@ +@@ -301,6 +322,18 @@ void LIR_Op2::verify() const { #endif } @@ -111433,7 +112381,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp LIR_OpBranch::LIR_OpBranch(LIR_Condition cond, BasicType type, BlockBegin* block) : LIR_Op(lir_branch, LIR_OprFact::illegalOpr, (CodeEmitInfo*)NULL) -@@ -358,6 +391,55 @@ +@@ -358,6 +391,55 @@ void LIR_OpBranch::negate_cond() { } } @@ -111489,7 +112437,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp LIR_OpTypeCheck::LIR_OpTypeCheck(LIR_Code code, LIR_Opr result, LIR_Opr object, ciKlass* klass, LIR_Opr tmp1, LIR_Opr tmp2, LIR_Opr tmp3, -@@ -560,10 +642,7 @@ +@@ -560,10 +642,7 @@ void LIR_OpVisitState::visit(LIR_Op* op) { assert(opConvert->_info == NULL, "must be"); if (opConvert->_opr->is_valid()) do_input(opConvert->_opr); if (opConvert->_result->is_valid()) do_output(opConvert->_result); @@ -111501,7 +112449,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp do_stub(opConvert->_stub); break; -@@ -661,6 +740,25 @@ +@@ -661,6 +740,25 @@ void LIR_OpVisitState::visit(LIR_Op* op) { break; } @@ -111527,7 +112475,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp // special handling for cmove: right input operand must not be equal // to the result operand, otherwise the backend fails case lir_cmove: -@@ -806,6 +904,29 @@ +@@ -806,6 +904,29 @@ void LIR_OpVisitState::visit(LIR_Op* op) { break; } @@ -111557,7 +112505,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp // LIR_OpJavaCall case lir_static_call: -@@ -1121,6 +1242,13 @@ +@@ -1121,6 +1242,13 @@ void LIR_Op2::emit_code(LIR_Assembler* masm) { masm->emit_op2(this); } @@ -111571,7 +112519,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp void LIR_OpAllocArray::emit_code(LIR_Assembler* masm) { masm->emit_alloc_array(this); masm->append_code_stub(stub()); -@@ -1141,6 +1269,10 @@ +@@ -1141,6 +1269,10 @@ void LIR_Op3::emit_code(LIR_Assembler* masm) { masm->emit_op3(this); } @@ -111582,7 +112530,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp void LIR_OpLock::emit_code(LIR_Assembler* masm) { masm->emit_lock(this); if (stub()) { -@@ -1381,7 +1513,6 @@ +@@ -1381,7 +1513,6 @@ void LIR_List::cmp_mem_int(LIR_Condition condition, LIR_Opr base, int disp, int info)); } @@ -111590,7 +112538,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp void LIR_List::cmp_reg_mem(LIR_Condition condition, LIR_Opr reg, LIR_Address* addr, CodeEmitInfo* info) { append(new LIR_Op2( lir_cmp, -@@ -1391,6 +1522,17 @@ +@@ -1391,6 +1522,17 @@ void LIR_List::cmp_reg_mem(LIR_Condition condition, LIR_Opr reg, LIR_Address* ad info)); } @@ -111608,7 +112556,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp void LIR_List::allocate_object(LIR_Opr dst, LIR_Opr t1, LIR_Opr t2, LIR_Opr t3, LIR_Opr t4, int header_size, int object_size, LIR_Opr klass, bool init_check, CodeStub* stub) { append(new LIR_OpAllocObj( -@@ -1520,18 +1662,6 @@ +@@ -1520,18 +1662,6 @@ void LIR_List::store_check(LIR_Opr object, LIR_Opr array, LIR_Opr tmp1, LIR_Opr append(c); } @@ -111627,7 +112575,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp void LIR_List::cas_long(LIR_Opr addr, LIR_Opr cmp_value, LIR_Opr new_value, LIR_Opr t1, LIR_Opr t2, LIR_Opr result) { append(new LIR_OpCompareAndSwap(lir_cas_long, addr, cmp_value, new_value, t1, t2, result)); -@@ -1780,6 +1910,8 @@ +@@ -1780,6 +1910,8 @@ const char * LIR_Op::name() const { case lir_cmp_l2i: s = "cmp_l2i"; break; case lir_ucmp_fd2i: s = "ucomp_fd2i"; break; case lir_cmp_fd2i: s = "comp_fd2i"; break; @@ -111636,7 +112584,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp case lir_cmove: s = "cmove"; break; case lir_add: s = "add"; break; case lir_sub: s = "sub"; break; -@@ -1809,6 +1941,8 @@ +@@ -1809,6 +1941,8 @@ const char * LIR_Op::name() const { // LIR_Op3 case lir_idiv: s = "idiv"; break; case lir_irem: s = "irem"; break; @@ -111645,7 +112593,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp // LIR_OpJavaCall case lir_static_call: s = "static"; break; case lir_optvirtual_call: s = "optvirtual"; break; -@@ -1960,6 +2094,26 @@ +@@ -1960,6 +2094,26 @@ void LIR_OpBranch::print_instr(outputStream* out) const { } } @@ -111672,7 +112620,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp void LIR_Op::print_condition(outputStream* out, LIR_Condition cond) { switch(cond) { case lir_cond_equal: out->print("[EQ]"); break; -@@ -1980,12 +2134,9 @@ +@@ -1980,12 +2134,9 @@ void LIR_OpConvert::print_instr(outputStream* out) const { print_bytecode(out, bytecode()); in_opr()->print(out); out->print(" "); result_opr()->print(out); out->print(" "); @@ -111687,7 +112635,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp } void LIR_OpConvert::print_bytecode(outputStream* out, Bytecodes::Code code) { -@@ -2031,9 +2182,6 @@ +@@ -2031,9 +2182,6 @@ void LIR_OpRoundFP::print_instr(outputStream* out) const { // LIR_Op2 void LIR_Op2::print_instr(outputStream* out) const { @@ -111697,7 +112645,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp in_opr1()->print(out); out->print(" "); in_opr2()->print(out); out->print(" "); if (tmp1_opr()->is_valid()) { tmp1_opr()->print(out); out->print(" "); } -@@ -2082,6 +2230,18 @@ +@@ -2082,6 +2230,18 @@ void LIR_Op3::print_instr(outputStream* out) const { result_opr()->print(out); } @@ -111716,7 +112664,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp void LIR_OpLock::print_instr(outputStream* out) const { hdr_opr()->print(out); out->print(" "); -@@ -2095,10 +2255,14 @@ +@@ -2095,10 +2255,14 @@ void LIR_OpLock::print_instr(outputStream* out) const { #ifdef ASSERT void LIR_OpAssert::print_instr(outputStream* out) const { @@ -111731,9 +112679,451 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp } #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp ---- a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp 2024-01-30 13:54:24.796042252 +0800 +diff --git a/hotspot/src/share/vm/c1/c1_LIR.hpp b/hotspot/src/share/vm/c1/c1_LIR.hpp +index 24b86202..aec77afe 100644 +--- a/hotspot/src/share/vm/c1/c1_LIR.hpp ++++ b/hotspot/src/share/vm/c1/c1_LIR.hpp +@@ -22,6 +22,11 @@ + * + */ + ++/* ++ * This file has been modified by Loongson Technology in 2022. These ++ * modifications are Copyright (c) 2018, 2022, Loongson Technology, and are made ++ * available on the same license terms set forth above. ++ */ + #ifndef SHARE_VM_C1_C1_LIR_HPP + #define SHARE_VM_C1_C1_LIR_HPP + +@@ -452,7 +457,7 @@ class LIR_OprDesc: public CompilationResourceObj { + // for compatibility with RInfo + int fpu () const { return lo_reg_half(); } + #endif +-#if defined(SPARC) || defined(ARM) || defined(PPC) || defined(AARCH64) ++#if defined(SPARC) || defined(ARM) || defined(PPC) || defined(AARCH64) || defined(LOONGARCH) + FloatRegister as_float_reg () const; + FloatRegister as_double_reg () const; + #endif +@@ -542,7 +547,7 @@ class LIR_Address: public LIR_OprPtr { + , _type(type) + , _disp(0) { verify(); } + +-#if defined(X86) || defined(ARM) || defined(AARCH64) ++#if defined(X86) || defined(ARM) || defined(AARCH64) || defined(LOONGARCH) + LIR_Address(LIR_Opr base, LIR_Opr index, Scale scale, intx disp, BasicType type): + _base(base) + , _index(index) +@@ -658,7 +663,13 @@ class LIR_OprFact: public AllStatic { + LIR_OprDesc::double_type | + LIR_OprDesc::cpu_register | + LIR_OprDesc::double_size); } +-#endif // PPC ++#elif defined(LOONGARCH) ++ static LIR_Opr double_fpu(int reg) { return (LIR_Opr)(intptr_t)((reg << LIR_OprDesc::reg1_shift) | ++ (reg << LIR_OprDesc::reg2_shift) | ++ LIR_OprDesc::double_type | ++ LIR_OprDesc::fpu_register | ++ LIR_OprDesc::double_size); } ++#endif // LOONGARCH + + static LIR_Opr virtual_register(int index, BasicType type) { + LIR_Opr res; +@@ -872,9 +883,11 @@ class LIR_OpConvert; + class LIR_OpAllocObj; + class LIR_OpRoundFP; + class LIR_Op2; ++class LIR_OpCmpBranch; + class LIR_OpDelay; + class LIR_Op3; + class LIR_OpAllocArray; ++class LIR_Op4; + class LIR_OpCall; + class LIR_OpJavaCall; + class LIR_OpRTCall; +@@ -943,6 +956,8 @@ enum LIR_Code { + , lir_cmp_l2i + , lir_ucmp_fd2i + , lir_cmp_fd2i ++ , lir_cmp_branch ++ , lir_cmp_float_branch + , lir_cmove + , lir_add + , lir_sub +@@ -976,6 +991,9 @@ enum LIR_Code { + , lir_idiv + , lir_irem + , end_op3 ++ , begin_op4 ++ , lir_cmp_cmove ++ , end_op4 + , begin_opJavaCall + , lir_static_call + , lir_optvirtual_call +@@ -1139,12 +1157,14 @@ class LIR_Op: public CompilationResourceObj { + virtual LIR_OpAllocObj* as_OpAllocObj() { return NULL; } + virtual LIR_OpRoundFP* as_OpRoundFP() { return NULL; } + virtual LIR_OpBranch* as_OpBranch() { return NULL; } ++ virtual LIR_OpCmpBranch* as_OpCmpBranch() { return NULL; } + virtual LIR_OpRTCall* as_OpRTCall() { return NULL; } + virtual LIR_OpConvert* as_OpConvert() { return NULL; } + virtual LIR_Op0* as_Op0() { return NULL; } + virtual LIR_Op1* as_Op1() { return NULL; } + virtual LIR_Op2* as_Op2() { return NULL; } + virtual LIR_Op3* as_Op3() { return NULL; } ++ virtual LIR_Op4* as_Op4() { return NULL; } + virtual LIR_OpArrayCopy* as_OpArrayCopy() { return NULL; } + virtual LIR_OpUpdateCRC32* as_OpUpdateCRC32() { return NULL; } + virtual LIR_OpTypeCheck* as_OpTypeCheck() { return NULL; } +@@ -1474,37 +1494,18 @@ class LIR_OpConvert: public LIR_Op1 { + private: + Bytecodes::Code _bytecode; + ConversionStub* _stub; +-#if defined(PPC) || defined(AARCH64) +- LIR_Opr _tmp1; +- LIR_Opr _tmp2; +-#endif ++ LIR_Opr _tmp; + + public: +- LIR_OpConvert(Bytecodes::Code code, LIR_Opr opr, LIR_Opr result, ConversionStub* stub) ++ LIR_OpConvert(Bytecodes::Code code, LIR_Opr opr, LIR_Opr result, ConversionStub* stub, LIR_Opr tmp) + : LIR_Op1(lir_convert, opr, result) + , _stub(stub) +-#ifdef PPC +- , _tmp1(LIR_OprDesc::illegalOpr()) +- , _tmp2(LIR_OprDesc::illegalOpr()) +-#endif ++ , _tmp(tmp) + , _bytecode(code) {} + +-#if defined(PPC) || defined(AARCH64) +- LIR_OpConvert(Bytecodes::Code code, LIR_Opr opr, LIR_Opr result, ConversionStub* stub +- ,LIR_Opr tmp1, LIR_Opr tmp2) +- : LIR_Op1(lir_convert, opr, result) +- , _stub(stub) +- , _tmp1(tmp1) +- , _tmp2(tmp2) +- , _bytecode(code) {} +-#endif +- + Bytecodes::Code bytecode() const { return _bytecode; } + ConversionStub* stub() const { return _stub; } +-#if defined(PPC) || defined(AARCH64) +- LIR_Opr tmp1() const { return _tmp1; } +- LIR_Opr tmp2() const { return _tmp2; } +-#endif ++ LIR_Opr tmp() const { return _tmp; } + + virtual void emit_code(LIR_Assembler* masm); + virtual LIR_OpConvert* as_OpConvert() { return this; } +@@ -1659,7 +1660,7 @@ class LIR_Op2: public LIR_Op { + , _tmp3(LIR_OprFact::illegalOpr) + , _tmp4(LIR_OprFact::illegalOpr) + , _tmp5(LIR_OprFact::illegalOpr) { +- assert(code == lir_cmp || code == lir_assert, "code check"); ++ assert(code == lir_cmp || code == lir_cmp_branch || code == lir_cmp_float_branch || code == lir_assert, "code check"); + } + + LIR_Op2(LIR_Code code, LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, LIR_Opr result, BasicType type) +@@ -1691,7 +1692,7 @@ class LIR_Op2: public LIR_Op { + , _tmp3(LIR_OprFact::illegalOpr) + , _tmp4(LIR_OprFact::illegalOpr) + , _tmp5(LIR_OprFact::illegalOpr) { +- assert(code != lir_cmp && is_in_range(code, begin_op2, end_op2), "code check"); ++ assert((code != lir_cmp && code != lir_cmp_branch && code != lir_cmp_float_branch) && is_in_range(code, begin_op2, end_op2), "code check"); + } + + LIR_Op2(LIR_Code code, LIR_Opr opr1, LIR_Opr opr2, LIR_Opr result, LIR_Opr tmp1, LIR_Opr tmp2 = LIR_OprFact::illegalOpr, +@@ -1707,7 +1708,7 @@ class LIR_Op2: public LIR_Op { + , _tmp3(tmp3) + , _tmp4(tmp4) + , _tmp5(tmp5) { +- assert(code != lir_cmp && is_in_range(code, begin_op2, end_op2), "code check"); ++ assert((code != lir_cmp && code != lir_cmp_branch && code != lir_cmp_float_branch) && is_in_range(code, begin_op2, end_op2), "code check"); + } + + LIR_Opr in_opr1() const { return _opr1; } +@@ -1719,10 +1720,12 @@ class LIR_Op2: public LIR_Op { + LIR_Opr tmp4_opr() const { return _tmp4; } + LIR_Opr tmp5_opr() const { return _tmp5; } + LIR_Condition condition() const { +- assert(code() == lir_cmp || code() == lir_cmove || code() == lir_assert, "only valid for cmp and cmove and assert"); return _condition; ++ assert(code() == lir_cmp || code() == lir_cmp_branch || code() == lir_cmp_float_branch || code() == lir_cmove || code() == lir_assert, "only valid for cmp and cmove and assert"); ++ return _condition; + } + void set_condition(LIR_Condition condition) { +- assert(code() == lir_cmp || code() == lir_cmove, "only valid for cmp and cmove"); _condition = condition; ++ assert(code() == lir_cmp || code() == lir_cmp_branch || code() == lir_cmp_float_branch || code() == lir_cmove, "only valid for cmp and cmove"); ++ _condition = condition; + } + + void set_fpu_stack_size(int size) { _fpu_stack_size = size; } +@@ -1736,6 +1739,43 @@ class LIR_Op2: public LIR_Op { + virtual void print_instr(outputStream* out) const PRODUCT_RETURN; + }; + ++class LIR_OpCmpBranch: public LIR_Op2 { ++ friend class LIR_OpVisitState; ++ ++ private: ++ Label* _label; ++ BlockBegin* _block; // if this is a branch to a block, this is the block ++ BlockBegin* _ublock; // if this is a float-branch, this is the unorderd block ++ CodeStub* _stub; // if this is a branch to a stub, this is the stub ++ ++ public: ++ LIR_OpCmpBranch(LIR_Condition cond, LIR_Opr left, LIR_Opr right, Label* lbl, CodeEmitInfo* info = NULL) ++ : LIR_Op2(lir_cmp_branch, cond, left, right, info) ++ , _label(lbl) ++ , _block(NULL) ++ , _ublock(NULL) ++ , _stub(NULL) { } ++ ++ LIR_OpCmpBranch(LIR_Condition cond, LIR_Opr left, LIR_Opr right, CodeStub* stub, CodeEmitInfo* info = NULL); ++ LIR_OpCmpBranch(LIR_Condition cond, LIR_Opr left, LIR_Opr right, BlockBegin* block, CodeEmitInfo* info = NULL); ++ ++ // for unordered comparisons ++ LIR_OpCmpBranch(LIR_Condition cond, LIR_Opr left, LIR_Opr right, BlockBegin* block, BlockBegin* ublock, CodeEmitInfo* info = NULL); ++ ++ Label* label() const { return _label; } ++ BlockBegin* block() const { return _block; } ++ BlockBegin* ublock() const { return _ublock; } ++ CodeStub* stub() const { return _stub; } ++ ++ void change_block(BlockBegin* b); ++ void change_ublock(BlockBegin* b); ++ void negate_cond(); ++ ++ virtual void emit_code(LIR_Assembler* masm); ++ virtual LIR_OpCmpBranch* as_OpCmpBranch() { return this; } ++ virtual void print_instr(outputStream* out) const PRODUCT_RETURN; ++}; ++ + class LIR_OpAllocArray : public LIR_Op { + friend class LIR_OpVisitState; + +@@ -1776,7 +1816,6 @@ class LIR_OpAllocArray : public LIR_Op { + virtual void print_instr(outputStream* out) const PRODUCT_RETURN; + }; + +- + class LIR_Op3: public LIR_Op { + friend class LIR_OpVisitState; + +@@ -1800,6 +1839,48 @@ class LIR_Op3: public LIR_Op { + }; + + ++class LIR_Op4: public LIR_Op { ++ friend class LIR_OpVisitState; ++ ++ private: ++ LIR_Opr _opr1; ++ LIR_Opr _opr2; ++ LIR_Opr _opr3; ++ LIR_Opr _opr4; ++ BasicType _type; ++ LIR_Condition _condition; ++ ++ void verify() const; ++ ++ public: ++ LIR_Op4(LIR_Code code, LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, LIR_Opr opr3, LIR_Opr opr4, LIR_Opr result, BasicType type) ++ : LIR_Op(code, result, NULL) ++ , _opr1(opr1) ++ , _opr2(opr2) ++ , _opr3(opr3) ++ , _opr4(opr4) ++ , _type(type) ++ , _condition(condition) { ++ assert(is_in_range(code, begin_op4, end_op4), "code check"); ++ assert(type != T_ILLEGAL, "cmove should have type"); ++ } ++ LIR_Opr in_opr1() const { return _opr1; } ++ LIR_Opr in_opr2() const { return _opr2; } ++ LIR_Opr in_opr3() const { return _opr3; } ++ LIR_Opr in_opr4() const { return _opr4; } ++ BasicType type() const { return _type; } ++ LIR_Condition condition() const { ++ assert(code() == lir_cmp_cmove, "only valid for cmp cmove"); return _condition; ++ } ++ void set_condition(LIR_Condition condition) { ++ assert(code() == lir_cmp_cmove, "only valid for cmp cmove"); _condition = condition; ++ } ++ ++ virtual void emit_code(LIR_Assembler* masm); ++ virtual LIR_Op4* as_Op4() { return this; } ++ virtual void print_instr(outputStream* out) const PRODUCT_RETURN; ++}; ++ + //-------------------------------- + class LabelObj: public CompilationResourceObj { + private: +@@ -2141,17 +2222,9 @@ class LIR_List: public CompilationResourceObj { + + void safepoint(LIR_Opr tmp, CodeEmitInfo* info) { append(new LIR_Op1(lir_safepoint, tmp, info)); } + +-#ifdef PPC +- void convert(Bytecodes::Code code, LIR_Opr left, LIR_Opr dst, LIR_Opr tmp1, LIR_Opr tmp2) { append(new LIR_OpConvert(code, left, dst, NULL, tmp1, tmp2)); } +-#endif +-#if defined(AARCH64) +- void convert(Bytecodes::Code code, LIR_Opr left, LIR_Opr dst, +- ConversionStub* stub = NULL, LIR_Opr tmp1 = LIR_OprDesc::illegalOpr()) { +- append(new LIR_OpConvert(code, left, dst, stub, tmp1, LIR_OprDesc::illegalOpr())); ++ void convert(Bytecodes::Code code, LIR_Opr left, LIR_Opr dst, ConversionStub* stub = NULL, LIR_Opr tmp = LIR_OprFact::illegalOpr) { ++ append(new LIR_OpConvert(code, left, dst, stub, tmp)); + } +-#else +- void convert(Bytecodes::Code code, LIR_Opr left, LIR_Opr dst, ConversionStub* stub = NULL/*, bool is_32bit = false*/) { append(new LIR_OpConvert(code, left, dst, stub)); } +-#endif + + void logical_and (LIR_Opr left, LIR_Opr right, LIR_Opr dst) { append(new LIR_Op2(lir_logic_and, left, right, dst)); } + void logical_or (LIR_Opr left, LIR_Opr right, LIR_Opr dst) { append(new LIR_Op2(lir_logic_or, left, right, dst)); } +@@ -2256,6 +2329,48 @@ class LIR_List: public CompilationResourceObj { + append(new LIR_OpBranch(cond, type, block, unordered)); + } + ++#if defined(X86) || defined(AARCH64) ++ ++ template ++ void cmp_branch(LIR_Condition condition, LIR_Opr left, LIR_Opr right, BasicType type, T tgt, CodeEmitInfo* info = NULL) { ++ cmp(condition, left, right, info); ++ branch(condition, type, tgt); ++ } ++ ++ void cmp_branch(LIR_Condition condition, LIR_Opr left, LIR_Opr right, BasicType type, BlockBegin* block, BlockBegin* unordered) { ++ cmp(condition, left, right); ++ branch(condition, type, block, unordered); ++ } ++ ++ void cmp_cmove(LIR_Condition condition, LIR_Opr left, LIR_Opr right, LIR_Opr src1, LIR_Opr src2, LIR_Opr dst, BasicType type) { ++ cmp(condition, left, right); ++ cmove(condition, src1, src2, dst, type); ++ } ++ ++#endif ++ ++#ifdef LOONGARCH ++ ++ template ++ void cmp_branch(LIR_Condition condition, LIR_Opr left, LIR_Opr right, BasicType type, T tgt, CodeEmitInfo* info = NULL) { ++ append(new LIR_OpCmpBranch(condition, left, right, tgt, info)); ++ } ++ ++ void cmp_branch(LIR_Condition condition, LIR_Opr left, LIR_Opr right, BasicType type, BlockBegin* block, BlockBegin* unordered) { ++ append(new LIR_OpCmpBranch(condition, left, right, block, unordered)); ++ } ++ ++ void cmp_cmove(LIR_Condition condition, LIR_Opr left, LIR_Opr right, LIR_Opr src1, LIR_Opr src2, LIR_Opr dst, BasicType type) { ++ append(new LIR_Op4(lir_cmp_cmove, condition, left, right, src1, src2, dst, type)); ++ } ++ ++#endif ++ ++ template ++ void cmp_branch(LIR_Condition condition, LIR_Opr left, int right, BasicType type, T tgt, CodeEmitInfo* info = NULL) { ++ cmp_branch(condition, left, LIR_OprFact::intConst(right), type, tgt, info); ++ } ++ + void shift_left(LIR_Opr value, LIR_Opr count, LIR_Opr dst, LIR_Opr tmp); + void shift_right(LIR_Opr value, LIR_Opr count, LIR_Opr dst, LIR_Opr tmp); + void unsigned_shift_right(LIR_Opr value, LIR_Opr count, LIR_Opr dst, LIR_Opr tmp); +diff --git a/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp b/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp +index e5cd19f1..a18c5300 100644 +--- a/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp ++++ b/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp +@@ -22,6 +22,12 @@ + * + */ + ++/* ++ * This file has been modified by Loongson Technology in 2022. These ++ * modifications are Copyright (c) 2015, 2022, Loongson Technology, and are made ++ * available on the same license terms set forth above. ++ */ ++ + #include "precompiled.hpp" + #include "c1/c1_Compilation.hpp" + #include "c1/c1_Instruction.hpp" +@@ -34,6 +40,10 @@ + # include "nativeInst_x86.hpp" + # include "vmreg_x86.inline.hpp" + #endif ++#ifdef TARGET_ARCH_loongarch ++# include "nativeInst_loongarch.hpp" ++# include "vmreg_loongarch.inline.hpp" ++#endif + #ifdef TARGET_ARCH_aarch64 + # include "nativeInst_aarch64.hpp" + # include "vmreg_aarch64.inline.hpp" +@@ -811,6 +821,18 @@ void LIR_Assembler::emit_op2(LIR_Op2* op) { + } + + ++void LIR_Assembler::emit_op4(LIR_Op4* op) { ++ switch (op->code()) { ++ case lir_cmp_cmove: ++ cmp_cmove(op->condition(), op->in_opr1(), op->in_opr2(), op->in_opr3(), op->in_opr4(), op->result_opr(), op->type()); ++ break; ++ ++ default: ++ Unimplemented(); ++ break; ++ } ++} ++ + void LIR_Assembler::build_frame() { + _masm->build_frame(initial_frame_size_in_bytes(), bang_size_in_bytes()); + } +diff --git a/hotspot/src/share/vm/c1/c1_LIRAssembler.hpp b/hotspot/src/share/vm/c1/c1_LIRAssembler.hpp +index 1a68d458..ac0f4e7a 100644 +--- a/hotspot/src/share/vm/c1/c1_LIRAssembler.hpp ++++ b/hotspot/src/share/vm/c1/c1_LIRAssembler.hpp +@@ -22,6 +22,12 @@ + * + */ + ++/* ++ * This file has been modified by Loongson Technology in 2022. These ++ * modifications are Copyright (c) 2015, 2022, Loongson Technology, and are made ++ * available on the same license terms set forth above. ++ */ ++ + #ifndef SHARE_VM_C1_C1_LIRASSEMBLER_HPP + #define SHARE_VM_C1_C1_LIRASSEMBLER_HPP + +@@ -195,7 +201,9 @@ class LIR_Assembler: public CompilationResourceObj { + void emit_op1(LIR_Op1* op); + void emit_op2(LIR_Op2* op); + void emit_op3(LIR_Op3* op); ++ void emit_op4(LIR_Op4* op); + void emit_opBranch(LIR_OpBranch* op); ++ void emit_opCmpBranch(LIR_OpCmpBranch* op); + void emit_opLabel(LIR_OpLabel* op); + void emit_arraycopy(LIR_OpArrayCopy* op); + void emit_updatecrc32(LIR_OpUpdateCRC32* op); +@@ -227,6 +235,7 @@ class LIR_Assembler: public CompilationResourceObj { + void volatile_move_op(LIR_Opr src, LIR_Opr result, BasicType type, CodeEmitInfo* info); + void comp_mem_op(LIR_Opr src, LIR_Opr result, BasicType type, CodeEmitInfo* info); // info set for null exceptions + void comp_fl2i(LIR_Code code, LIR_Opr left, LIR_Opr right, LIR_Opr result, LIR_Op2* op); ++ void cmp_cmove(LIR_Condition code, LIR_Opr left, LIR_Opr right, LIR_Opr src1, LIR_Opr src2, LIR_Opr result, BasicType type); + void cmove(LIR_Condition code, LIR_Opr left, LIR_Opr right, LIR_Opr result, BasicType type); + + void call( LIR_OpJavaCall* op, relocInfo::relocType rtype); +@@ -265,6 +274,9 @@ class LIR_Assembler: public CompilationResourceObj { + #ifdef TARGET_ARCH_x86 + # include "c1_LIRAssembler_x86.hpp" + #endif ++#ifdef TARGET_ARCH_loongarch ++# include "c1_LIRAssembler_loongarch.hpp" ++#endif + #ifdef TARGET_ARCH_aarch64 + # include "c1_LIRAssembler_aarch64.hpp" + #endif +diff --git a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp +index e98834d0..d1a987c6 100644 +--- a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp ++++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp @@ -22,6 +22,12 @@ * */ @@ -111747,26 +113137,25 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #include "precompiled.hpp" #include "c1/c1_Defs.hpp" #include "c1/c1_Compilation.hpp" -@@ -483,13 +489,11 @@ +@@ -483,13 +489,11 @@ void LIRGenerator::array_range_check(LIR_Opr array, LIR_Opr index, CodeEmitInfo* null_check_info, CodeEmitInfo* range_check_info) { CodeStub* stub = new RangeCheckStub(range_check_info, index); if (index->is_constant()) { - cmp_mem_int(lir_cond_belowEqual, array, arrayOopDesc::length_offset_in_bytes(), - index->as_jint(), null_check_info); - __ branch(lir_cond_belowEqual, T_INT, stub); // forward branch -- } else { ++ cmp_mem_int_branch(lir_cond_belowEqual, array, arrayOopDesc::length_offset_in_bytes(), ++ index->as_jint(), stub, null_check_info); // forward branch + } else { - cmp_reg_mem(lir_cond_aboveEqual, index, array, - arrayOopDesc::length_offset_in_bytes(), T_INT, null_check_info); - __ branch(lir_cond_aboveEqual, T_INT, stub); // forward branch -+ cmp_mem_int_branch(lir_cond_belowEqual, array, arrayOopDesc::length_offset_in_bytes(), -+ index->as_jint(), stub, null_check_info); // forward branch -+ } else { + cmp_reg_mem_branch(lir_cond_aboveEqual, index, array, arrayOopDesc::length_offset_in_bytes(), + T_INT, stub, null_check_info); // forward branch } } -@@ -497,12 +501,10 @@ +@@ -497,12 +501,10 @@ void LIRGenerator::array_range_check(LIR_Opr array, LIR_Opr index, void LIRGenerator::nio_range_check(LIR_Opr buffer, LIR_Opr index, LIR_Opr result, CodeEmitInfo* info) { CodeStub* stub = new RangeCheckStub(info, index, true); if (index->is_constant()) { @@ -111782,7 +113171,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp } __ move(index, result); } -@@ -935,7 +937,7 @@ +@@ -935,7 +937,7 @@ LIR_Opr LIRGenerator::force_to_spill(LIR_Opr value, BasicType t) { return tmp; } @@ -111791,7 +113180,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp if (if_instr->should_profile()) { ciMethod* method = if_instr->profiled_method(); assert(method != NULL, "method should be set if branch is profiled"); -@@ -956,10 +958,17 @@ +@@ -956,10 +958,17 @@ void LIRGenerator::profile_branch(If* if_instr, If::Condition cond) { __ metadata2reg(md->constant_encoding(), md_reg); LIR_Opr data_offset_reg = new_pointer_register(); @@ -111813,7 +113202,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp // MDO cells are intptr_t, so the data_reg width is arch-dependent. LIR_Opr data_reg = new_pointer_register(); -@@ -1306,8 +1315,8 @@ +@@ -1306,8 +1315,8 @@ void LIRGenerator::do_isPrimitive(Intrinsic* x) { } __ move(new LIR_Address(rcvr.result(), java_lang_Class::klass_offset_in_bytes(), T_ADDRESS), temp, info); @@ -111824,7 +113213,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp } // Example: Thread.currentThread() -@@ -1500,7 +1509,6 @@ +@@ -1500,7 +1509,6 @@ void LIRGenerator::G1SATBCardTableModRef_pre_barrier(LIR_Opr addr_opr, LIR_Opr p // Read the marking-in-progress flag. LIR_Opr flag_val = new_register(T_INT); __ load(mark_active_flag_addr, flag_val); @@ -111832,7 +113221,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp LIR_PatchCode pre_val_patch_code = lir_patch_none; -@@ -1529,7 +1537,7 @@ +@@ -1529,7 +1537,7 @@ void LIRGenerator::G1SATBCardTableModRef_pre_barrier(LIR_Opr addr_opr, LIR_Opr p slow = new G1PreBarrierStub(pre_val); } @@ -111841,7 +113230,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp __ branch_destination(slow->continuation()); } -@@ -1587,10 +1595,8 @@ +@@ -1587,10 +1595,8 @@ void LIRGenerator::G1SATBCardTableModRef_post_barrier(LIR_OprDesc* addr, LIR_Opr } assert(new_val->is_register(), "must be a register at this point"); @@ -111853,7 +113242,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp __ branch_destination(slow->continuation()); } -@@ -1860,12 +1866,10 @@ +@@ -1860,12 +1866,10 @@ void LIRGenerator::do_NIOCheckIndex(Intrinsic* x) { CodeEmitInfo* info = state_for(x); CodeStub* stub = new RangeCheckStub(info, index.result(), true); if (index.result()->is_constant()) { @@ -111869,7 +113258,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp } __ move(index.result(), result); } else { -@@ -1946,8 +1950,8 @@ +@@ -1946,8 +1950,8 @@ void LIRGenerator::do_LoadIndexed(LoadIndexed* x) { } else if (use_length) { // TODO: use a (modified) version of array_range_check that does not require a // constant length to be loaded to a register @@ -111880,7 +113269,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp } else { array_range_check(array.result(), index.result(), null_check_info, range_check_info); // The range check performs the null check, so clear it out for the load -@@ -2129,7 +2133,7 @@ +@@ -2129,7 +2133,7 @@ void LIRGenerator::do_UnsafeGetRaw(UnsafeGetRaw* x) { assert(index_op->type() == T_INT, "only int constants supported"); addr = new LIR_Address(base_op, index_op->as_jint(), dst_type); } else { @@ -111889,7 +113278,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp addr = new LIR_Address(base_op, index_op, LIR_Address::Scale(log2_scale), 0, dst_type); #elif defined(GENERATE_ADDRESS_IS_PREFERRED) addr = generate_address(base_op, index_op, log2_scale, 0, dst_type); -@@ -2344,19 +2348,18 @@ +@@ -2344,19 +2348,18 @@ void LIRGenerator::do_UnsafeGetObject(UnsafeGetObject* x) { if (off.type()->is_int()) { referent_off = LIR_OprFact::intConst(java_lang_ref_Reference::referent_offset); @@ -111912,7 +113301,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp } LIR_Opr src_klass = new_register(T_METADATA); if (gen_type_check) { -@@ -2366,8 +2369,7 @@ +@@ -2366,8 +2369,7 @@ void LIRGenerator::do_UnsafeGetObject(UnsafeGetObject* x) { LIR_Address* reference_type_addr = new LIR_Address(src_klass, in_bytes(InstanceKlass::reference_type_offset()), T_BYTE); LIR_Opr reference_type = new_register(T_INT); __ move(reference_type_addr, reference_type); @@ -111922,7 +113311,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp } { // We have determined that src->_klass->_reference_type != REF_NONE -@@ -2447,19 +2449,14 @@ +@@ -2447,19 +2449,14 @@ void LIRGenerator::do_SwitchRanges(SwitchRangeArray* x, LIR_Opr value, BlockBegi int high_key = one_range->high_key(); BlockBegin* dest = one_range->sux(); if (low_key == high_key) { @@ -111947,7 +113336,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp __ branch_destination(L->label()); } } -@@ -2546,8 +2543,7 @@ +@@ -2546,8 +2543,7 @@ void LIRGenerator::do_TableSwitch(TableSwitch* x) { do_SwitchRanges(create_lookup_ranges(x), value, x->default_sux()); } else { for (int i = 0; i < len; i++) { @@ -111957,7 +113346,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp } __ jump(x->default_sux()); } -@@ -2572,8 +2568,7 @@ +@@ -2572,8 +2568,7 @@ void LIRGenerator::do_LookupSwitch(LookupSwitch* x) { } else { int len = x->length(); for (int i = 0; i < len; i++) { @@ -111967,7 +113356,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp } __ jump(x->default_sux()); } -@@ -2625,7 +2620,6 @@ +@@ -2625,7 +2620,6 @@ void LIRGenerator::do_Goto(Goto* x) { } LIR_Opr md_reg = new_register(T_METADATA); __ metadata2reg(md->constant_encoding(), md_reg); @@ -111975,7 +113364,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp increment_counter(new LIR_Address(md_reg, offset, NOT_LP64(T_INT) LP64_ONLY(T_LONG)), DataLayout::counter_increment); } -@@ -3079,8 +3073,8 @@ +@@ -3079,8 +3073,8 @@ void LIRGenerator::do_IfOp(IfOp* x) { f_val.dont_load_item(); LIR_Opr reg = rlock_result(x); @@ -111986,7 +113375,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp } #ifdef JFR_HAVE_INTRINSICS -@@ -3120,8 +3114,7 @@ +@@ -3120,8 +3114,7 @@ void LIRGenerator::do_getEventWriter(Intrinsic* x) { T_OBJECT); LIR_Opr result = rlock_result(x); __ move_wide(jobj_addr, result); @@ -111996,7 +113385,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp __ move_wide(new LIR_Address(result, T_OBJECT), result); __ branch_destination(L_end->label()); -@@ -3485,10 +3478,9 @@ +@@ -3485,10 +3478,9 @@ void LIRGenerator::increment_event_counter_impl(CodeEmitInfo* info, LIR_Opr meth = new_register(T_METADATA); __ metadata2reg(method->constant_encoding(), meth); __ logical_and(result, mask, result); @@ -112008,7 +113397,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp __ branch_destination(overflow->continuation()); } } -@@ -3600,8 +3592,7 @@ +@@ -3600,8 +3592,7 @@ void LIRGenerator::do_RangeCheckPredicate(RangeCheckPredicate *x) { CodeEmitInfo *info = state_for(x, x->state()); CodeStub* stub = new PredicateFailedStub(info); @@ -112018,7 +113407,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp } } -@@ -3749,8 +3740,7 @@ +@@ -3749,8 +3740,7 @@ LIR_Opr LIRGenerator::maybe_mask_boolean(StoreIndexed* x, LIR_Opr array, LIR_Opr __ move(new LIR_Address(klass, in_bytes(Klass::layout_helper_offset()), T_INT), layout); int diffbit = Klass::layout_helper_boolean_diffbit(); __ logical_and(layout, LIR_OprFact::intConst(diffbit), layout); @@ -112028,9 +113417,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp value = value_fixed; } return value; -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/c1/c1_LIRGenerator.hpp b/hotspot/src/share/vm/c1/c1_LIRGenerator.hpp ---- a/hotspot/src/share/vm/c1/c1_LIRGenerator.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.hpp 2023-12-20 09:23:19.918146502 +0800 +diff --git a/hotspot/src/share/vm/c1/c1_LIRGenerator.hpp b/hotspot/src/share/vm/c1/c1_LIRGenerator.hpp +index 27be79fe..57c253db 100644 +--- a/hotspot/src/share/vm/c1/c1_LIRGenerator.hpp ++++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.hpp @@ -22,6 +22,12 @@ * */ @@ -112044,7 +113434,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifndef SHARE_VM_C1_C1_LIRGENERATOR_HPP #define SHARE_VM_C1_C1_LIRGENERATOR_HPP -@@ -246,6 +252,9 @@ +@@ -246,6 +252,9 @@ class LIRGenerator: public InstructionVisitor, public BlockClosure { void do_getClass(Intrinsic* x); void do_currentThread(Intrinsic* x); void do_MathIntrinsic(Intrinsic* x); @@ -112054,7 +113444,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp void do_ArrayCopy(Intrinsic* x); void do_CompareAndSwap(Intrinsic* x, ValueType* type); void do_NIOCheckIndex(Intrinsic* x); -@@ -335,8 +344,10 @@ +@@ -335,8 +344,10 @@ class LIRGenerator: public InstructionVisitor, public BlockClosure { void new_instance (LIR_Opr dst, ciInstanceKlass* klass, bool is_unresolved, LIR_Opr scratch1, LIR_Opr scratch2, LIR_Opr scratch3, LIR_Opr scratch4, LIR_Opr klass_reg, CodeEmitInfo* info); // machine dependent @@ -112067,7 +113457,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp void cmp_reg_mem(LIR_Condition condition, LIR_Opr reg, LIR_Opr base, LIR_Opr disp, BasicType type, CodeEmitInfo* info); void arraycopy_helper(Intrinsic* x, int* flags, ciArrayKlass** expected_type); -@@ -364,7 +375,7 @@ +@@ -364,7 +375,7 @@ class LIRGenerator: public InstructionVisitor, public BlockClosure { LIR_Opr safepoint_poll_register(); @@ -112076,357 +113466,185 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp void increment_event_counter_impl(CodeEmitInfo* info, ciMethod *method, int frequency, int bci, bool backedge, bool notify); -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/c1/c1_LIR.hpp b/hotspot/src/share/vm/c1/c1_LIR.hpp ---- a/hotspot/src/share/vm/c1/c1_LIR.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/c1/c1_LIR.hpp 2023-12-20 09:23:19.914813209 +0800 -@@ -22,6 +22,11 @@ +diff --git a/hotspot/src/share/vm/c1/c1_LinearScan.cpp b/hotspot/src/share/vm/c1/c1_LinearScan.cpp +index 1f6281bf..4549ff09 100644 +--- a/hotspot/src/share/vm/c1/c1_LinearScan.cpp ++++ b/hotspot/src/share/vm/c1/c1_LinearScan.cpp +@@ -22,6 +22,12 @@ * */ +/* + * This file has been modified by Loongson Technology in 2022. These -+ * modifications are Copyright (c) 2018, 2022, Loongson Technology, and are made ++ * modifications are Copyright (c) 2015, 2022, Loongson Technology, and are made + * available on the same license terms set forth above. + */ - #ifndef SHARE_VM_C1_C1_LIR_HPP - #define SHARE_VM_C1_C1_LIR_HPP - -@@ -452,7 +457,7 @@ - // for compatibility with RInfo - int fpu () const { return lo_reg_half(); } ++ + #include "precompiled.hpp" + #include "c1/c1_CFGPrinter.hpp" + #include "c1/c1_CodeStubs.hpp" +@@ -35,6 +41,9 @@ + #ifdef TARGET_ARCH_x86 + # include "vmreg_x86.inline.hpp" #endif --#if defined(SPARC) || defined(ARM) || defined(PPC) || defined(AARCH64) -+#if defined(SPARC) || defined(ARM) || defined(PPC) || defined(AARCH64) || defined(LOONGARCH) - FloatRegister as_float_reg () const; - FloatRegister as_double_reg () const; ++#ifdef TARGET_ARCH_loongarch ++# include "vmreg_loongarch.inline.hpp" ++#endif + #ifdef TARGET_ARCH_aarch64 + # include "vmreg_aarch64.inline.hpp" #endif -@@ -542,7 +547,7 @@ - , _type(type) - , _disp(0) { verify(); } +@@ -1256,6 +1265,23 @@ void LinearScan::add_register_hints(LIR_Op* op) { + LIR_Opr move_from = cmove->in_opr1(); + LIR_Opr move_to = cmove->result_opr(); --#if defined(X86) || defined(ARM) || defined(AARCH64) -+#if defined(X86) || defined(ARM) || defined(AARCH64) || defined(LOONGARCH) - LIR_Address(LIR_Opr base, LIR_Opr index, Scale scale, intx disp, BasicType type): - _base(base) - , _index(index) -@@ -658,7 +663,13 @@ - LIR_OprDesc::double_type | - LIR_OprDesc::cpu_register | - LIR_OprDesc::double_size); } --#endif // PPC -+#elif defined(LOONGARCH) -+ static LIR_Opr double_fpu(int reg) { return (LIR_Opr)(intptr_t)((reg << LIR_OprDesc::reg1_shift) | -+ (reg << LIR_OprDesc::reg2_shift) | -+ LIR_OprDesc::double_type | -+ LIR_OprDesc::fpu_register | -+ LIR_OprDesc::double_size); } -+#endif // LOONGARCH - - static LIR_Opr virtual_register(int index, BasicType type) { - LIR_Opr res; -@@ -872,9 +883,11 @@ - class LIR_OpAllocObj; - class LIR_OpRoundFP; - class LIR_Op2; -+class LIR_OpCmpBranch; - class LIR_OpDelay; - class LIR_Op3; - class LIR_OpAllocArray; -+class LIR_Op4; - class LIR_OpCall; - class LIR_OpJavaCall; - class LIR_OpRTCall; -@@ -943,6 +956,8 @@ - , lir_cmp_l2i - , lir_ucmp_fd2i - , lir_cmp_fd2i -+ , lir_cmp_branch -+ , lir_cmp_float_branch - , lir_cmove - , lir_add - , lir_sub -@@ -976,6 +991,9 @@ - , lir_idiv - , lir_irem - , end_op3 -+ , begin_op4 -+ , lir_cmp_cmove -+ , end_op4 - , begin_opJavaCall - , lir_static_call - , lir_optvirtual_call -@@ -1139,12 +1157,14 @@ - virtual LIR_OpAllocObj* as_OpAllocObj() { return NULL; } - virtual LIR_OpRoundFP* as_OpRoundFP() { return NULL; } - virtual LIR_OpBranch* as_OpBranch() { return NULL; } -+ virtual LIR_OpCmpBranch* as_OpCmpBranch() { return NULL; } - virtual LIR_OpRTCall* as_OpRTCall() { return NULL; } - virtual LIR_OpConvert* as_OpConvert() { return NULL; } - virtual LIR_Op0* as_Op0() { return NULL; } - virtual LIR_Op1* as_Op1() { return NULL; } - virtual LIR_Op2* as_Op2() { return NULL; } - virtual LIR_Op3* as_Op3() { return NULL; } -+ virtual LIR_Op4* as_Op4() { return NULL; } - virtual LIR_OpArrayCopy* as_OpArrayCopy() { return NULL; } - virtual LIR_OpUpdateCRC32* as_OpUpdateCRC32() { return NULL; } - virtual LIR_OpTypeCheck* as_OpTypeCheck() { return NULL; } -@@ -1474,37 +1494,18 @@ - private: - Bytecodes::Code _bytecode; - ConversionStub* _stub; --#if defined(PPC) || defined(AARCH64) -- LIR_Opr _tmp1; -- LIR_Opr _tmp2; --#endif -+ LIR_Opr _tmp; - - public: -- LIR_OpConvert(Bytecodes::Code code, LIR_Opr opr, LIR_Opr result, ConversionStub* stub) -+ LIR_OpConvert(Bytecodes::Code code, LIR_Opr opr, LIR_Opr result, ConversionStub* stub, LIR_Opr tmp) - : LIR_Op1(lir_convert, opr, result) - , _stub(stub) --#ifdef PPC -- , _tmp1(LIR_OprDesc::illegalOpr()) -- , _tmp2(LIR_OprDesc::illegalOpr()) --#endif -+ , _tmp(tmp) - , _bytecode(code) {} - --#if defined(PPC) || defined(AARCH64) -- LIR_OpConvert(Bytecodes::Code code, LIR_Opr opr, LIR_Opr result, ConversionStub* stub -- ,LIR_Opr tmp1, LIR_Opr tmp2) -- : LIR_Op1(lir_convert, opr, result) -- , _stub(stub) -- , _tmp1(tmp1) -- , _tmp2(tmp2) -- , _bytecode(code) {} --#endif -- - Bytecodes::Code bytecode() const { return _bytecode; } - ConversionStub* stub() const { return _stub; } --#if defined(PPC) || defined(AARCH64) -- LIR_Opr tmp1() const { return _tmp1; } -- LIR_Opr tmp2() const { return _tmp2; } --#endif -+ LIR_Opr tmp() const { return _tmp; } - - virtual void emit_code(LIR_Assembler* masm); - virtual LIR_OpConvert* as_OpConvert() { return this; } -@@ -1659,7 +1660,7 @@ - , _tmp3(LIR_OprFact::illegalOpr) - , _tmp4(LIR_OprFact::illegalOpr) - , _tmp5(LIR_OprFact::illegalOpr) { -- assert(code == lir_cmp || code == lir_assert, "code check"); -+ assert(code == lir_cmp || code == lir_cmp_branch || code == lir_cmp_float_branch || code == lir_assert, "code check"); - } - - LIR_Op2(LIR_Code code, LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, LIR_Opr result, BasicType type) -@@ -1691,7 +1692,7 @@ - , _tmp3(LIR_OprFact::illegalOpr) - , _tmp4(LIR_OprFact::illegalOpr) - , _tmp5(LIR_OprFact::illegalOpr) { -- assert(code != lir_cmp && is_in_range(code, begin_op2, end_op2), "code check"); -+ assert((code != lir_cmp && code != lir_cmp_branch && code != lir_cmp_float_branch) && is_in_range(code, begin_op2, end_op2), "code check"); - } - - LIR_Op2(LIR_Code code, LIR_Opr opr1, LIR_Opr opr2, LIR_Opr result, LIR_Opr tmp1, LIR_Opr tmp2 = LIR_OprFact::illegalOpr, -@@ -1707,7 +1708,7 @@ - , _tmp3(tmp3) - , _tmp4(tmp4) - , _tmp5(tmp5) { -- assert(code != lir_cmp && is_in_range(code, begin_op2, end_op2), "code check"); -+ assert((code != lir_cmp && code != lir_cmp_branch && code != lir_cmp_float_branch) && is_in_range(code, begin_op2, end_op2), "code check"); - } - - LIR_Opr in_opr1() const { return _opr1; } -@@ -1719,10 +1720,12 @@ - LIR_Opr tmp4_opr() const { return _tmp4; } - LIR_Opr tmp5_opr() const { return _tmp5; } - LIR_Condition condition() const { -- assert(code() == lir_cmp || code() == lir_cmove || code() == lir_assert, "only valid for cmp and cmove and assert"); return _condition; -+ assert(code() == lir_cmp || code() == lir_cmp_branch || code() == lir_cmp_float_branch || code() == lir_cmove || code() == lir_assert, "only valid for cmp and cmove and assert"); -+ return _condition; - } - void set_condition(LIR_Condition condition) { -- assert(code() == lir_cmp || code() == lir_cmove, "only valid for cmp and cmove"); _condition = condition; -+ assert(code() == lir_cmp || code() == lir_cmp_branch || code() == lir_cmp_float_branch || code() == lir_cmove, "only valid for cmp and cmove"); -+ _condition = condition; - } - - void set_fpu_stack_size(int size) { _fpu_stack_size = size; } -@@ -1736,6 +1739,43 @@ - virtual void print_instr(outputStream* out) const PRODUCT_RETURN; - }; - -+class LIR_OpCmpBranch: public LIR_Op2 { -+ friend class LIR_OpVisitState; -+ -+ private: -+ Label* _label; -+ BlockBegin* _block; // if this is a branch to a block, this is the block -+ BlockBegin* _ublock; // if this is a float-branch, this is the unorderd block -+ CodeStub* _stub; // if this is a branch to a stub, this is the stub -+ -+ public: -+ LIR_OpCmpBranch(LIR_Condition cond, LIR_Opr left, LIR_Opr right, Label* lbl, CodeEmitInfo* info = NULL) -+ : LIR_Op2(lir_cmp_branch, cond, left, right, info) -+ , _label(lbl) -+ , _block(NULL) -+ , _ublock(NULL) -+ , _stub(NULL) { } -+ -+ LIR_OpCmpBranch(LIR_Condition cond, LIR_Opr left, LIR_Opr right, CodeStub* stub, CodeEmitInfo* info = NULL); -+ LIR_OpCmpBranch(LIR_Condition cond, LIR_Opr left, LIR_Opr right, BlockBegin* block, CodeEmitInfo* info = NULL); -+ -+ // for unordered comparisons -+ LIR_OpCmpBranch(LIR_Condition cond, LIR_Opr left, LIR_Opr right, BlockBegin* block, BlockBegin* ublock, CodeEmitInfo* info = NULL); -+ -+ Label* label() const { return _label; } -+ BlockBegin* block() const { return _block; } -+ BlockBegin* ublock() const { return _ublock; } -+ CodeStub* stub() const { return _stub; } -+ -+ void change_block(BlockBegin* b); -+ void change_ublock(BlockBegin* b); -+ void negate_cond(); ++ if (move_to->is_register() && move_from->is_register()) { ++ Interval* from = interval_at(reg_num(move_from)); ++ Interval* to = interval_at(reg_num(move_to)); ++ if (from != NULL && to != NULL) { ++ to->set_register_hint(from); ++ TRACE_LINEAR_SCAN(4, tty->print_cr("operation at op_id %d: added hint from interval %d to %d", cmove->id(), from->reg_num(), to->reg_num())); ++ } ++ } ++ break; ++ } ++ case lir_cmp_cmove: { ++ assert(op->as_Op4() != NULL, "lir_cmp_cmove must be LIR_Op4"); ++ LIR_Op4* cmove = (LIR_Op4*)op; + -+ virtual void emit_code(LIR_Assembler* masm); -+ virtual LIR_OpCmpBranch* as_OpCmpBranch() { return this; } -+ virtual void print_instr(outputStream* out) const PRODUCT_RETURN; -+}; ++ LIR_Opr move_from = cmove->in_opr3(); ++ LIR_Opr move_to = cmove->result_opr(); + - class LIR_OpAllocArray : public LIR_Op { - friend class LIR_OpVisitState; - -@@ -1776,7 +1816,6 @@ - virtual void print_instr(outputStream* out) const PRODUCT_RETURN; - }; - -- - class LIR_Op3: public LIR_Op { - friend class LIR_OpVisitState; - -@@ -1800,6 +1839,48 @@ - }; - + if (move_to->is_register() && move_from->is_register()) { + Interval* from = interval_at(reg_num(move_from)); + Interval* to = interval_at(reg_num(move_to)); +@@ -2104,7 +2130,7 @@ LIR_Opr LinearScan::calc_operand_for_interval(const Interval* interval) { + #ifdef _LP64 + return LIR_OprFact::double_cpu(assigned_reg, assigned_reg); + #else +-#if defined(SPARC) || defined(PPC) ++#if defined(SPARC) || defined(PPC) || defined(LOONGARCH) + return LIR_OprFact::double_cpu(assigned_regHi, assigned_reg); + #else + return LIR_OprFact::double_cpu(assigned_reg, assigned_regHi); +@@ -3285,7 +3311,9 @@ void LinearScan::verify_no_oops_in_fixed_intervals() { + check_live = (move->patch_code() == lir_patch_none); + } + LIR_OpBranch* branch = op->as_OpBranch(); +- if (branch != NULL && branch->stub() != NULL && branch->stub()->is_exception_throw_stub()) { ++ LIR_OpCmpBranch* cmp_branch = op->as_OpCmpBranch(); ++ if ((branch != NULL && branch->stub() != NULL && branch->stub()->is_exception_throw_stub()) || ++ (cmp_branch != NULL && cmp_branch->stub() != NULL && cmp_branch->stub()->is_exception_throw_stub())) { + // Don't bother checking the stub in this case since the + // exception stub will never return to normal control flow. + check_live = false; +@@ -6142,6 +6170,16 @@ void ControlFlowOptimizer::substitute_branch_target(BlockBegin* block, BlockBegi + assert(op->as_OpBranch() != NULL, "branch must be of type LIR_OpBranch"); + LIR_OpBranch* branch = (LIR_OpBranch*)op; -+class LIR_Op4: public LIR_Op { -+ friend class LIR_OpVisitState; ++ if (branch->block() == target_from) { ++ branch->change_block(target_to); ++ } ++ if (branch->ublock() == target_from) { ++ branch->change_ublock(target_to); ++ } ++ } else if (op->code() == lir_cmp_branch || op->code() == lir_cmp_float_branch) { ++ assert(op->as_OpCmpBranch() != NULL, "branch must be of type LIR_OpCmpBranch"); ++ LIR_OpCmpBranch* branch = (LIR_OpCmpBranch*)op; + -+ private: -+ LIR_Opr _opr1; -+ LIR_Opr _opr2; -+ LIR_Opr _opr3; -+ LIR_Opr _opr4; -+ BasicType _type; -+ LIR_Condition _condition; + if (branch->block() == target_from) { + branch->change_block(target_to); + } +@@ -6252,6 +6290,20 @@ void ControlFlowOptimizer::delete_unnecessary_jumps(BlockList* code) { + instructions->truncate(instructions->length() - 1); + } + } ++ } else if (prev_op->code() == lir_cmp_branch || prev_op->code() == lir_cmp_float_branch) { ++ assert(prev_op->as_OpCmpBranch() != NULL, "branch must be of type LIR_OpCmpBranch"); ++ LIR_OpCmpBranch* prev_branch = (LIR_OpCmpBranch*)prev_op; + -+ void verify() const; ++ if (prev_branch->stub() == NULL) { ++ if (prev_branch->block() == code->at(i + 1) && prev_branch->info() == NULL) { ++ TRACE_LINEAR_SCAN(3, tty->print_cr("Negating conditional branch and deleting unconditional branch at end of block B%d", block->block_id())); + -+ public: -+ LIR_Op4(LIR_Code code, LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, LIR_Opr opr3, LIR_Opr opr4, LIR_Opr result, BasicType type) -+ : LIR_Op(code, result, NULL) -+ , _opr1(opr1) -+ , _opr2(opr2) -+ , _opr3(opr3) -+ , _opr4(opr4) -+ , _type(type) -+ , _condition(condition) { -+ assert(is_in_range(code, begin_op4, end_op4), "code check"); -+ assert(type != T_ILLEGAL, "cmove should have type"); -+ } -+ LIR_Opr in_opr1() const { return _opr1; } -+ LIR_Opr in_opr2() const { return _opr2; } -+ LIR_Opr in_opr3() const { return _opr3; } -+ LIR_Opr in_opr4() const { return _opr4; } -+ BasicType type() const { return _type; } -+ LIR_Condition condition() const { -+ assert(code() == lir_cmp_cmove, "only valid for cmp cmove"); return _condition; -+ } -+ void set_condition(LIR_Condition condition) { -+ assert(code() == lir_cmp_cmove, "only valid for cmp cmove"); _condition = condition; -+ } ++ // eliminate a conditional branch to the immediate successor ++ prev_branch->change_block(last_branch->block()); ++ prev_branch->negate_cond(); ++ instructions->trunc_to(instructions->length() - 1); ++ } ++ } + } + } + } +@@ -6328,6 +6380,13 @@ void ControlFlowOptimizer::verify(BlockList* code) { + assert(op_branch->block() == NULL || code->index_of(op_branch->block()) != -1, "branch target not valid"); + assert(op_branch->ublock() == NULL || code->index_of(op_branch->ublock()) != -1, "branch target not valid"); + } + -+ virtual void emit_code(LIR_Assembler* masm); -+ virtual LIR_Op4* as_Op4() { return this; } -+ virtual void print_instr(outputStream* out) const PRODUCT_RETURN; -+}; ++ LIR_OpCmpBranch* op_cmp_branch = instructions->at(j)->as_OpCmpBranch(); + - //-------------------------------- - class LabelObj: public CompilationResourceObj { - private: -@@ -2141,17 +2222,9 @@ - - void safepoint(LIR_Opr tmp, CodeEmitInfo* info) { append(new LIR_Op1(lir_safepoint, tmp, info)); } - --#ifdef PPC -- void convert(Bytecodes::Code code, LIR_Opr left, LIR_Opr dst, LIR_Opr tmp1, LIR_Opr tmp2) { append(new LIR_OpConvert(code, left, dst, NULL, tmp1, tmp2)); } --#endif --#if defined(AARCH64) -- void convert(Bytecodes::Code code, LIR_Opr left, LIR_Opr dst, -- ConversionStub* stub = NULL, LIR_Opr tmp1 = LIR_OprDesc::illegalOpr()) { -- append(new LIR_OpConvert(code, left, dst, stub, tmp1, LIR_OprDesc::illegalOpr())); -+ void convert(Bytecodes::Code code, LIR_Opr left, LIR_Opr dst, ConversionStub* stub = NULL, LIR_Opr tmp = LIR_OprFact::illegalOpr) { -+ append(new LIR_OpConvert(code, left, dst, stub, tmp)); - } --#else -- void convert(Bytecodes::Code code, LIR_Opr left, LIR_Opr dst, ConversionStub* stub = NULL/*, bool is_32bit = false*/) { append(new LIR_OpConvert(code, left, dst, stub)); } --#endif ++ if (op_cmp_branch != NULL) { ++ assert(op_cmp_branch->block() == NULL || code->find(op_cmp_branch->block()) != -1, "branch target not valid"); ++ assert(op_cmp_branch->ublock() == NULL || code->find(op_cmp_branch->ublock()) != -1, "branch target not valid"); ++ } + } - void logical_and (LIR_Opr left, LIR_Opr right, LIR_Opr dst) { append(new LIR_Op2(lir_logic_and, left, right, dst)); } - void logical_or (LIR_Opr left, LIR_Opr right, LIR_Opr dst) { append(new LIR_Op2(lir_logic_or, left, right, dst)); } -@@ -2256,6 +2329,48 @@ - append(new LIR_OpBranch(cond, type, block, unordered)); - } + for (j = 0; j < block->number_of_sux() - 1; j++) { +@@ -6571,6 +6630,24 @@ void LinearScanStatistic::collect(LinearScan* allocator) { + break; + } -+#if defined(X86) || defined(AARCH64) -+ -+ template -+ void cmp_branch(LIR_Condition condition, LIR_Opr left, LIR_Opr right, BasicType type, T tgt, CodeEmitInfo* info = NULL) { -+ cmp(condition, left, right, info); -+ branch(condition, type, tgt); -+ } -+ -+ void cmp_branch(LIR_Condition condition, LIR_Opr left, LIR_Opr right, BasicType type, BlockBegin* block, BlockBegin* unordered) { -+ cmp(condition, left, right); -+ branch(condition, type, block, unordered); -+ } -+ -+ void cmp_cmove(LIR_Condition condition, LIR_Opr left, LIR_Opr right, LIR_Opr src1, LIR_Opr src2, LIR_Opr dst, BasicType type) { -+ cmp(condition, left, right); -+ cmove(condition, src1, src2, dst, type); -+ } -+ -+#endif -+ -+#ifdef LOONGARCH -+ -+ template -+ void cmp_branch(LIR_Condition condition, LIR_Opr left, LIR_Opr right, BasicType type, T tgt, CodeEmitInfo* info = NULL) { -+ append(new LIR_OpCmpBranch(condition, left, right, tgt, info)); -+ } ++ case lir_cmp_branch: ++ case lir_cmp_float_branch: { ++ LIR_OpCmpBranch* branch = op->as_OpCmpBranch(); ++ if (branch->block() == NULL) { ++ inc_counter(counter_stub_branch); ++ } else { ++ inc_counter(counter_cond_branch); ++ } ++ inc_counter(counter_cmp); ++ break; ++ } + -+ void cmp_branch(LIR_Condition condition, LIR_Opr left, LIR_Opr right, BasicType type, BlockBegin* block, BlockBegin* unordered) { -+ append(new LIR_OpCmpBranch(condition, left, right, block, unordered)); -+ } ++ case lir_cmp_cmove: { ++ inc_counter(counter_misc_inst); ++ inc_counter(counter_cmp); ++ break; ++ } + -+ void cmp_cmove(LIR_Condition condition, LIR_Opr left, LIR_Opr right, LIR_Opr src1, LIR_Opr src2, LIR_Opr dst, BasicType type) { -+ append(new LIR_Op4(lir_cmp_cmove, condition, left, right, src1, src2, dst, type)); -+ } + case lir_neg: + case lir_add: + case lir_sub: +diff --git a/hotspot/src/share/vm/c1/c1_LinearScan.hpp b/hotspot/src/share/vm/c1/c1_LinearScan.hpp +index 96e6b3ba..576a07d7 100644 +--- a/hotspot/src/share/vm/c1/c1_LinearScan.hpp ++++ b/hotspot/src/share/vm/c1/c1_LinearScan.hpp +@@ -22,6 +22,12 @@ + * + */ + ++/* ++ * This file has been modified by Loongson Technology in 2022. These ++ * modifications are Copyright (c) 2015, 2022, Loongson Technology, and are made ++ * available on the same license terms set forth above. ++ */ + + #ifndef SHARE_VM_C1_C1_LINEARSCAN_HPP + #define SHARE_VM_C1_C1_LINEARSCAN_HPP + +@@ -976,6 +982,9 @@ class LinearScanTimers : public StackObj { + #ifdef TARGET_ARCH_x86 + # include "c1_LinearScan_x86.hpp" + #endif ++#ifdef TARGET_ARCH_loongarch ++# include "c1_LinearScan_loongarch.hpp" +#endif -+ -+ template -+ void cmp_branch(LIR_Condition condition, LIR_Opr left, int right, BasicType type, T tgt, CodeEmitInfo* info = NULL) { -+ cmp_branch(condition, left, LIR_OprFact::intConst(right), type, tgt, info); -+ } -+ - void shift_left(LIR_Opr value, LIR_Opr count, LIR_Opr dst, LIR_Opr tmp); - void shift_right(LIR_Opr value, LIR_Opr count, LIR_Opr dst, LIR_Opr tmp); - void unsigned_shift_right(LIR_Opr value, LIR_Opr count, LIR_Opr dst, LIR_Opr tmp); -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/c1/c1_MacroAssembler.hpp b/hotspot/src/share/vm/c1/c1_MacroAssembler.hpp ---- a/hotspot/src/share/vm/c1/c1_MacroAssembler.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/c1/c1_MacroAssembler.hpp 2023-12-20 09:23:19.918146502 +0800 + #ifdef TARGET_ARCH_aarch64 + # include "c1_LinearScan_aarch64.hpp" + #endif +diff --git a/hotspot/src/share/vm/c1/c1_MacroAssembler.hpp b/hotspot/src/share/vm/c1/c1_MacroAssembler.hpp +index 7e22bbaa..12aca7bf 100644 +--- a/hotspot/src/share/vm/c1/c1_MacroAssembler.hpp ++++ b/hotspot/src/share/vm/c1/c1_MacroAssembler.hpp @@ -22,6 +22,12 @@ * */ @@ -112440,7 +113658,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifndef SHARE_VM_C1_C1_MACROASSEMBLER_HPP #define SHARE_VM_C1_C1_MACROASSEMBLER_HPP -@@ -50,6 +56,9 @@ +@@ -50,6 +56,9 @@ class C1_MacroAssembler: public MacroAssembler { #ifdef TARGET_ARCH_x86 # include "c1_MacroAssembler_x86.hpp" #endif @@ -112450,9 +113668,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_ARCH_aarch64 # include "c1_MacroAssembler_aarch64.hpp" #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/c1/c1_Runtime1.cpp b/hotspot/src/share/vm/c1/c1_Runtime1.cpp ---- a/hotspot/src/share/vm/c1/c1_Runtime1.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/c1/c1_Runtime1.cpp 2023-12-20 09:23:19.918146502 +0800 +diff --git a/hotspot/src/share/vm/c1/c1_Runtime1.cpp b/hotspot/src/share/vm/c1/c1_Runtime1.cpp +index aebc3775..f1253506 100644 +--- a/hotspot/src/share/vm/c1/c1_Runtime1.cpp ++++ b/hotspot/src/share/vm/c1/c1_Runtime1.cpp @@ -22,6 +22,12 @@ * */ @@ -112466,7 +113685,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #include "precompiled.hpp" #include "asm/codeBuffer.hpp" #include "c1/c1_CodeStubs.hpp" -@@ -710,6 +716,7 @@ +@@ -710,6 +716,7 @@ JRT_ENTRY(void, Runtime1::deoptimize(JavaThread* thread)) // Return to the now deoptimized frame. JRT_END @@ -112474,7 +113693,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp static Klass* resolve_field_return_klass(methodHandle caller, int bci, TRAPS) { Bytecode_field field_access(caller, bci); -@@ -1186,6 +1193,47 @@ +@@ -1186,6 +1193,47 @@ JRT_ENTRY(void, Runtime1::patch_code(JavaThread* thread, Runtime1::StubID stub_i } JRT_END @@ -112522,9 +113741,37 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp // // Entry point for compiled code. We want to patch a nmethod. // We don't do a normal VM transition here because we want to -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/classfile/bytecodeAssembler.cpp b/hotspot/src/share/vm/classfile/bytecodeAssembler.cpp ---- a/hotspot/src/share/vm/classfile/bytecodeAssembler.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/classfile/bytecodeAssembler.cpp 2023-12-20 09:23:19.924813093 +0800 +diff --git a/hotspot/src/share/vm/c1/c1_globals.hpp b/hotspot/src/share/vm/c1/c1_globals.hpp +index 8f7f9f61..0e2d926b 100644 +--- a/hotspot/src/share/vm/c1/c1_globals.hpp ++++ b/hotspot/src/share/vm/c1/c1_globals.hpp +@@ -22,6 +22,12 @@ + * + */ + ++/* ++ * This file has been modified by Loongson Technology in 2022. These ++ * modifications are Copyright (c) 2015, 2022, Loongson Technology, and are made ++ * available on the same license terms set forth above. ++ */ ++ + #ifndef SHARE_VM_C1_C1_GLOBALS_HPP + #define SHARE_VM_C1_C1_GLOBALS_HPP + +@@ -29,6 +35,9 @@ + #ifdef TARGET_ARCH_x86 + # include "c1_globals_x86.hpp" + #endif ++#ifdef TARGET_ARCH_loongarch ++# include "c1_globals_loongarch.hpp" ++#endif + #ifdef TARGET_ARCH_aarch64 + # include "c1_globals_aarch64.hpp" + #endif +diff --git a/hotspot/src/share/vm/classfile/bytecodeAssembler.cpp b/hotspot/src/share/vm/classfile/bytecodeAssembler.cpp +index f067419f..5aa19dc8 100644 +--- a/hotspot/src/share/vm/classfile/bytecodeAssembler.cpp ++++ b/hotspot/src/share/vm/classfile/bytecodeAssembler.cpp @@ -22,6 +22,12 @@ * */ @@ -112551,9 +113798,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_ARCH_sparc # include "bytes_sparc.hpp" #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/classfile/classFileStream.hpp b/hotspot/src/share/vm/classfile/classFileStream.hpp ---- a/hotspot/src/share/vm/classfile/classFileStream.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/classfile/classFileStream.hpp 2023-12-20 09:23:19.928146388 +0800 +diff --git a/hotspot/src/share/vm/classfile/classFileStream.hpp b/hotspot/src/share/vm/classfile/classFileStream.hpp +index 9632c8c8..fad25c44 100644 +--- a/hotspot/src/share/vm/classfile/classFileStream.hpp ++++ b/hotspot/src/share/vm/classfile/classFileStream.hpp @@ -22,6 +22,12 @@ * */ @@ -112580,9 +113828,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_ARCH_aarch64 # include "bytes_aarch64.hpp" #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/classfile/stackMapTable.hpp b/hotspot/src/share/vm/classfile/stackMapTable.hpp ---- a/hotspot/src/share/vm/classfile/stackMapTable.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/classfile/stackMapTable.hpp 2023-12-20 09:23:19.931479683 +0800 +diff --git a/hotspot/src/share/vm/classfile/stackMapTable.hpp b/hotspot/src/share/vm/classfile/stackMapTable.hpp +index a36a7ba3..d7c1f086 100644 +--- a/hotspot/src/share/vm/classfile/stackMapTable.hpp ++++ b/hotspot/src/share/vm/classfile/stackMapTable.hpp @@ -22,6 +22,12 @@ * */ @@ -112609,9 +113858,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_ARCH_aarch64 # include "bytes_aarch64.hpp" #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/classfile/verifier.cpp b/hotspot/src/share/vm/classfile/verifier.cpp ---- a/hotspot/src/share/vm/classfile/verifier.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/classfile/verifier.cpp 2024-01-30 13:54:24.836041846 +0800 +diff --git a/hotspot/src/share/vm/classfile/verifier.cpp b/hotspot/src/share/vm/classfile/verifier.cpp +index 2dddd1fd..4a20d15f 100644 +--- a/hotspot/src/share/vm/classfile/verifier.cpp ++++ b/hotspot/src/share/vm/classfile/verifier.cpp @@ -22,6 +22,12 @@ * */ @@ -112638,9 +113888,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_ARCH_aarch64 # include "bytes_aarch64.hpp" #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/code/codeBlob.cpp b/hotspot/src/share/vm/code/codeBlob.cpp ---- a/hotspot/src/share/vm/code/codeBlob.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/code/codeBlob.cpp 2023-12-20 09:23:19.931479683 +0800 +diff --git a/hotspot/src/share/vm/code/codeBlob.cpp b/hotspot/src/share/vm/code/codeBlob.cpp +index aff2aaf0..9ba76007 100644 +--- a/hotspot/src/share/vm/code/codeBlob.cpp ++++ b/hotspot/src/share/vm/code/codeBlob.cpp @@ -22,6 +22,12 @@ * */ @@ -112667,9 +113918,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef COMPILER1 #include "c1/c1_Runtime1.hpp" #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/code/compiledIC.hpp b/hotspot/src/share/vm/code/compiledIC.hpp ---- a/hotspot/src/share/vm/code/compiledIC.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/code/compiledIC.hpp 2023-12-20 09:23:19.934812978 +0800 +diff --git a/hotspot/src/share/vm/code/compiledIC.hpp b/hotspot/src/share/vm/code/compiledIC.hpp +index f910f118..e282a3f3 100644 +--- a/hotspot/src/share/vm/code/compiledIC.hpp ++++ b/hotspot/src/share/vm/code/compiledIC.hpp @@ -22,6 +22,12 @@ * */ @@ -112696,9 +113948,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp //----------------------------------------------------------------------------- // The CompiledIC represents a compiled inline cache. -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/code/relocInfo.hpp b/hotspot/src/share/vm/code/relocInfo.hpp ---- a/hotspot/src/share/vm/code/relocInfo.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/code/relocInfo.hpp 2023-12-20 09:23:19.934812978 +0800 +diff --git a/hotspot/src/share/vm/code/relocInfo.hpp b/hotspot/src/share/vm/code/relocInfo.hpp +index ad55a2fd..81350482 100644 +--- a/hotspot/src/share/vm/code/relocInfo.hpp ++++ b/hotspot/src/share/vm/code/relocInfo.hpp @@ -22,6 +22,12 @@ * */ @@ -112712,7 +113965,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifndef SHARE_VM_CODE_RELOCINFO_HPP #define SHARE_VM_CODE_RELOCINFO_HPP -@@ -261,7 +267,11 @@ +@@ -261,7 +267,11 @@ class relocInfo VALUE_OBJ_CLASS_SPEC { poll_return_type = 11, // polling instruction for safepoints at return metadata_type = 12, // metadata that used to be oops trampoline_stub_type = 13, // stub-entry for trampoline @@ -112724,7 +113977,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp data_prefix_tag = 15, // tag for a prefix (carries data arguments) type_mask = 15 // A mask which selects only the above values }; -@@ -288,6 +298,7 @@ +@@ -288,6 +298,7 @@ class relocInfo VALUE_OBJ_CLASS_SPEC { ; #endif @@ -112732,7 +113985,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #define APPLY_TO_RELOCATIONS(visitor) \ visitor(oop) \ visitor(metadata) \ -@@ -300,9 +311,26 @@ +@@ -300,9 +311,26 @@ class relocInfo VALUE_OBJ_CLASS_SPEC { visitor(internal_word) \ visitor(poll) \ visitor(poll_return) \ @@ -112760,20 +114013,20 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp public: enum { -@@ -433,6 +461,12 @@ +@@ -432,6 +460,12 @@ class relocInfo VALUE_OBJ_CLASS_SPEC { + #endif #ifdef TARGET_ARCH_ppc # include "relocInfo_ppc.hpp" - #endif ++#endif +#ifdef TARGET_ARCH_mips +# include "relocInfo_mips.hpp" +#endif +#ifdef TARGET_ARCH_loongarch +# include "relocInfo_loongarch.hpp" -+#endif + #endif - protected: -@@ -1024,6 +1058,15 @@ +@@ -1024,6 +1058,15 @@ class metadata_Relocation : public DataRelocation { // Note: metadata_value transparently converts Universe::non_metadata_word to NULL. }; @@ -112789,9 +114042,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp class virtual_call_Relocation : public CallRelocation { relocInfo::relocType type() { return relocInfo::virtual_call_type; } -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/code/vmreg.hpp b/hotspot/src/share/vm/code/vmreg.hpp ---- a/hotspot/src/share/vm/code/vmreg.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/code/vmreg.hpp 2023-12-20 09:23:19.938146274 +0800 +diff --git a/hotspot/src/share/vm/code/vmreg.hpp b/hotspot/src/share/vm/code/vmreg.hpp +index 07b595b6..5bc7131a 100644 +--- a/hotspot/src/share/vm/code/vmreg.hpp ++++ b/hotspot/src/share/vm/code/vmreg.hpp @@ -22,6 +22,12 @@ * */ @@ -112818,7 +114072,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #endif //------------------------------VMReg------------------------------------------ -@@ -158,6 +170,12 @@ +@@ -158,6 +170,12 @@ public: #ifdef TARGET_ARCH_x86 # include "vmreg_x86.hpp" #endif @@ -112831,9 +114085,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_ARCH_aarch64 # include "vmreg_aarch64.hpp" #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/compiler/disassembler.cpp b/hotspot/src/share/vm/compiler/disassembler.cpp ---- a/hotspot/src/share/vm/compiler/disassembler.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/compiler/disassembler.cpp 2023-12-20 09:23:19.938146274 +0800 +diff --git a/hotspot/src/share/vm/compiler/disassembler.cpp b/hotspot/src/share/vm/compiler/disassembler.cpp +index dfdd5f77..2dd0ff69 100644 +--- a/hotspot/src/share/vm/compiler/disassembler.cpp ++++ b/hotspot/src/share/vm/compiler/disassembler.cpp @@ -22,6 +22,12 @@ * */ @@ -112860,9 +114115,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef SHARK #include "shark/sharkEntry.hpp" #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/compiler/disassembler.hpp b/hotspot/src/share/vm/compiler/disassembler.hpp ---- a/hotspot/src/share/vm/compiler/disassembler.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/compiler/disassembler.hpp 2023-12-20 09:23:19.938146274 +0800 +diff --git a/hotspot/src/share/vm/compiler/disassembler.hpp b/hotspot/src/share/vm/compiler/disassembler.hpp +index 168851cc..8b632748 100644 +--- a/hotspot/src/share/vm/compiler/disassembler.hpp ++++ b/hotspot/src/share/vm/compiler/disassembler.hpp @@ -22,6 +22,12 @@ * */ @@ -112876,23 +114132,24 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifndef SHARE_VM_COMPILER_DISASSEMBLER_HPP #define SHARE_VM_COMPILER_DISASSEMBLER_HPP -@@ -96,6 +102,12 @@ +@@ -95,6 +101,12 @@ class Disassembler { + #endif #ifdef TARGET_ARCH_ppc # include "disassembler_ppc.hpp" - #endif ++#endif +#ifdef TARGET_ARCH_mips +# include "disassembler_mips.hpp" +#endif +#ifdef TARGET_ARCH_loongarch +# include "disassembler_loongarch.hpp" -+#endif + #endif - public: -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.hpp ---- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.hpp 2023-12-20 09:23:19.958146045 +0800 -@@ -86,6 +86,9 @@ +diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.hpp +index 733b5c91..678a1ee8 100644 +--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.hpp ++++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.hpp +@@ -86,6 +86,9 @@ class CardTableExtension : public CardTableModRefBS { void inline_write_ref_field_gc(void* field, oop new_val) { jbyte* byte = byte_for(field); *byte = youngergen_card; @@ -112902,10 +114159,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp } // Adaptive size policy support -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.cpp ---- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.cpp 2023-12-20 09:23:19.958146045 +0800 -@@ -105,6 +105,9 @@ +diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.cpp +index 1dde1074..8b800b31 100644 +--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.cpp ++++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.cpp +@@ -105,6 +105,9 @@ ParMarkBitMap::mark_obj(HeapWord* addr, size_t size) assert(end_bit_ok, "concurrency problem"); DEBUG_ONLY(Atomic::inc_ptr(&mark_bitmap_count)); DEBUG_ONLY(Atomic::add_ptr(size, &mark_bitmap_size)); @@ -112915,10 +114173,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp return true; } return false; -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psCompactionManager.inline.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psCompactionManager.inline.hpp ---- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psCompactionManager.inline.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psCompactionManager.inline.hpp 2023-12-20 09:23:19.958146045 +0800 -@@ -33,6 +33,9 @@ +diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psCompactionManager.inline.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psCompactionManager.inline.hpp +index 6cf76353..4d34bc20 100644 +--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psCompactionManager.inline.hpp ++++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psCompactionManager.inline.hpp +@@ -33,6 +33,9 @@ void ParCompactionManager::push_objarray(oop obj, size_t index) ObjArrayTask task(obj, index); assert(task.is_valid(), "bad ObjArrayTask"); _objarray_stack.push(task); @@ -112928,7 +114187,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp } void ParCompactionManager::push_region(size_t index) -@@ -44,6 +47,9 @@ +@@ -44,6 +47,9 @@ void ParCompactionManager::push_region(size_t index) assert(region_ptr->_pushed++ == 0, "should only be pushed once"); #endif region_stack()->push(index); @@ -112938,10 +114197,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp } #endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSCOMPACTIONMANAGER_INLINE_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp ---- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp 2023-12-20 09:23:19.961479341 +0800 -@@ -499,6 +499,9 @@ +diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp +index 0fa980ef..2f66493e 100644 +--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp ++++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp +@@ -499,6 +499,9 @@ void ParallelCompactData::add_obj(HeapWord* addr, size_t len) if (beg_region == end_region) { // All in one region. _region_data[beg_region].add_live_obj(len); @@ -112951,7 +114211,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp return; } -@@ -517,6 +520,9 @@ +@@ -517,6 +520,9 @@ void ParallelCompactData::add_obj(HeapWord* addr, size_t len) const size_t end_ofs = region_offset(addr + len - 1); _region_data[end_region].set_partial_obj_size(end_ofs + 1); _region_data[end_region].set_partial_obj_addr(addr); @@ -112961,7 +114221,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp } void -@@ -3229,6 +3235,9 @@ +@@ -3229,6 +3235,9 @@ void PSParallelCompact::fill_blocks(size_t region_idx) if (new_block != cur_block) { cur_block = new_block; sd.block(cur_block)->set_offset(bitmap->bits_to_words(live_bits)); @@ -112971,11 +114231,12 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp } const size_t end_bit = bitmap->find_obj_end(beg_bit, range_end); -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp ---- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp 2023-12-20 09:23:19.961479341 +0800 -@@ -1329,6 +1329,9 @@ - const int obj_size = obj->acquire_size(); +diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp +index 881f380c..461b8393 100644 +--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp ++++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp +@@ -1329,6 +1329,9 @@ inline bool PSParallelCompact::mark_obj(oop obj) { + const int obj_size = obj->size(); if (mark_bitmap()->mark_obj(obj, obj_size)) { _summary_data.add_obj(obj, obj_size); +#if (defined MIPS || defined LOONGARCH) && !defined ZERO @@ -112984,7 +114245,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp return true; } else { return false; -@@ -1363,6 +1366,9 @@ +@@ -1363,6 +1366,9 @@ inline void PSParallelCompact::mark_and_push(ParCompactionManager* cm, T* p) { oop obj = oopDesc::decode_heap_oop_not_null(heap_oop); if (mark_bitmap()->is_unmarked(obj) && mark_obj(obj)) { cm->push(obj); @@ -112994,10 +114255,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp } } } -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp ---- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp 2023-12-20 09:23:19.961479341 +0800 -@@ -41,8 +41,9 @@ +diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp +index a3313200..29101966 100644 +--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp ++++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp +@@ -41,8 +41,9 @@ template inline void PSPromotionManager::claim_or_forward_internal_depth(T* p) { if (p != NULL) { // XXX: error if p != NULL here oop o = oopDesc::load_decode_heap_oop_not_null(p); @@ -113009,7 +114271,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp // Card mark if (PSScavenge::is_obj_in_young(o)) { PSScavenge::card_table()->inline_write_ref_field_gc(p, o); -@@ -107,11 +108,19 @@ +@@ -102,11 +103,19 @@ oop PSPromotionManager::copy_to_survivor_space(oop o) { oop new_obj = NULL; @@ -113029,7 +114291,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp // The same test as "o->is_forwarded()" if (!test_mark->is_marked()) { bool new_obj_is_tenured = false; -@@ -146,6 +155,10 @@ +@@ -141,6 +150,10 @@ oop PSPromotionManager::copy_to_survivor_space(oop o) { } } } @@ -113040,8 +114302,8 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp } } -@@ -206,6 +219,9 @@ - Prefetch::write(new_obj, PrefetchCopyIntervalInBytes); +@@ -200,6 +213,9 @@ oop PSPromotionManager::copy_to_survivor_space(oop o) { + // Copy obj Copy::aligned_disjoint_words((HeapWord*)o, (HeapWord*)new_obj, new_obj_size); +#if (defined MIPS || defined LOONGARCH) && !defined ZERO @@ -113049,8 +114311,8 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +#endif // Now we have to CAS in the header. - -@@ -265,6 +281,10 @@ + if (o->cas_forward_to(new_obj, test_mark)) { +@@ -247,6 +263,10 @@ oop PSPromotionManager::copy_to_survivor_space(oop o) { // don't update this before the unallocation! new_obj = o->forwardee(); } @@ -113061,10 +114323,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp } else { assert(o->is_forwarded(), "Sanity"); new_obj = o->forwardee(); -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.inline.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.inline.hpp ---- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.inline.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.inline.hpp 2023-12-20 09:23:19.961479341 +0800 -@@ -71,14 +71,22 @@ +diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.inline.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.inline.hpp +index 1a722a7c..4980be39 100644 +--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.inline.hpp ++++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.inline.hpp +@@ -71,14 +71,22 @@ inline void PSScavenge::copy_and_push_safe_barrier(PSPromotionManager* pm, assert(should_scavenge(p, true), "revisiting object?"); oop o = oopDesc::load_decode_heap_oop_not_null(p); @@ -113086,12 +114349,12 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifndef PRODUCT // This code must come after the CAS test, or it will print incorrect // information. -- if (TraceScavenge && o->is_forwarded()) { +- if (TraceScavenge && o->is_forwarded()) { + if (TraceScavenge && m->is_marked()) { gclog_or_tty->print_cr("{%s %s " PTR_FORMAT " -> " PTR_FORMAT " (%d)}", "forwarding", new_obj->klass()->internal_name(), p2i((void *)o), p2i((void *)new_obj), new_obj->size()); -@@ -138,8 +146,9 @@ +@@ -138,8 +146,9 @@ class PSScavengeFromKlassClosure: public OopClosure { oop o = *p; oop new_obj; @@ -113103,9 +114366,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp } else { new_obj = _pm->copy_to_survivor_space(o); } -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp b/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp ---- a/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp 2023-12-20 09:23:19.968145932 +0800 +diff --git a/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp b/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp +index e14c50bf..8b386007 100644 +--- a/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp ++++ b/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp @@ -22,6 +22,12 @@ * */ @@ -113130,9 +114394,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #endif // This file contains the platform-independent parts -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/interpreter/bytecode.hpp b/hotspot/src/share/vm/interpreter/bytecode.hpp ---- a/hotspot/src/share/vm/interpreter/bytecode.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/interpreter/bytecode.hpp 2023-12-20 09:23:19.968145932 +0800 +diff --git a/hotspot/src/share/vm/interpreter/bytecode.hpp b/hotspot/src/share/vm/interpreter/bytecode.hpp +index 7e55fd00..a06dcd58 100644 +--- a/hotspot/src/share/vm/interpreter/bytecode.hpp ++++ b/hotspot/src/share/vm/interpreter/bytecode.hpp @@ -22,6 +22,12 @@ * */ @@ -113159,9 +114424,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_ARCH_aarch64 # include "bytes_aarch64.hpp" #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp ---- a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp 2023-12-20 09:23:19.968145932 +0800 +diff --git a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp +index 28843715..c17fe8d7 100644 +--- a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp ++++ b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp @@ -22,6 +22,12 @@ * */ @@ -113185,7 +114451,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_ARCH_aarch64 # include "bytes_aarch64.hpp" #endif -@@ -592,6 +601,12 @@ +@@ -592,6 +601,12 @@ void print(); #ifdef TARGET_ARCH_x86 # include "bytecodeInterpreter_x86.hpp" #endif @@ -113198,9 +114464,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_ARCH_aarch64 # include "bytecodeInterpreter_aarch64.hpp" #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.inline.hpp b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.inline.hpp ---- a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.inline.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.inline.hpp 2023-12-20 09:23:19.968145932 +0800 +diff --git a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.inline.hpp b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.inline.hpp +index f5db0b4d..8adbf95a 100644 +--- a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.inline.hpp ++++ b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.inline.hpp @@ -22,6 +22,12 @@ * */ @@ -113227,9 +114494,40 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_ARCH_aarch64 # include "bytecodeInterpreter_aarch64.inline.hpp" #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/interpreter/bytecodes.cpp b/hotspot/src/share/vm/interpreter/bytecodes.cpp ---- a/hotspot/src/share/vm/interpreter/bytecodes.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/interpreter/bytecodes.cpp 2024-01-30 13:54:24.866041540 +0800 +diff --git a/hotspot/src/share/vm/interpreter/bytecodeStream.hpp b/hotspot/src/share/vm/interpreter/bytecodeStream.hpp +index b814b88d..e1f24216 100644 +--- a/hotspot/src/share/vm/interpreter/bytecodeStream.hpp ++++ b/hotspot/src/share/vm/interpreter/bytecodeStream.hpp +@@ -22,6 +22,12 @@ + * + */ + ++/* ++ * This file has been modified by Loongson Technology in 2020. These ++ * modifications are Copyright (c) 2015, 2020, Loongson Technology, and are made ++ * available on the same license terms set forth above. ++ */ ++ + #ifndef SHARE_VM_INTERPRETER_BYTECODESTREAM_HPP + #define SHARE_VM_INTERPRETER_BYTECODESTREAM_HPP + +@@ -32,6 +38,12 @@ + #ifdef TARGET_ARCH_x86 + # include "bytes_x86.hpp" + #endif ++#ifdef TARGET_ARCH_mips ++# include "bytes_mips.hpp" ++#endif ++#ifdef TARGET_ARCH_loongarch ++# include "bytes_loongarch.hpp" ++#endif + #ifdef TARGET_ARCH_aarch64 + # include "bytes_aarch64.hpp" + #endif +diff --git a/hotspot/src/share/vm/interpreter/bytecodes.cpp b/hotspot/src/share/vm/interpreter/bytecodes.cpp +index ce5632ea..7f8e8801 100644 +--- a/hotspot/src/share/vm/interpreter/bytecodes.cpp ++++ b/hotspot/src/share/vm/interpreter/bytecodes.cpp @@ -22,6 +22,12 @@ * */ @@ -113256,9 +114554,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_ARCH_aarch64 # include "bytes_aarch64.hpp" #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/interpreter/bytecodes.hpp b/hotspot/src/share/vm/interpreter/bytecodes.hpp ---- a/hotspot/src/share/vm/interpreter/bytecodes.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/interpreter/bytecodes.hpp 2023-12-20 09:23:19.968145932 +0800 +diff --git a/hotspot/src/share/vm/interpreter/bytecodes.hpp b/hotspot/src/share/vm/interpreter/bytecodes.hpp +index c3463cd7..bdf4c487 100644 +--- a/hotspot/src/share/vm/interpreter/bytecodes.hpp ++++ b/hotspot/src/share/vm/interpreter/bytecodes.hpp @@ -22,6 +22,12 @@ * */ @@ -113272,7 +114571,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifndef SHARE_VM_INTERPRETER_BYTECODES_HPP #define SHARE_VM_INTERPRETER_BYTECODES_HPP -@@ -292,6 +298,12 @@ +@@ -292,6 +298,12 @@ class Bytecodes: AllStatic { #ifdef TARGET_ARCH_x86 # include "bytecodes_x86.hpp" #endif @@ -113285,9 +114584,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_ARCH_aarch64 # include "bytecodes_aarch64.hpp" #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/interpreter/bytecodeStream.hpp b/hotspot/src/share/vm/interpreter/bytecodeStream.hpp ---- a/hotspot/src/share/vm/interpreter/bytecodeStream.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/interpreter/bytecodeStream.hpp 2023-12-20 09:23:19.968145932 +0800 +diff --git a/hotspot/src/share/vm/interpreter/cppInterpreter.hpp b/hotspot/src/share/vm/interpreter/cppInterpreter.hpp +index 6a644750..f9c540fb 100644 +--- a/hotspot/src/share/vm/interpreter/cppInterpreter.hpp ++++ b/hotspot/src/share/vm/interpreter/cppInterpreter.hpp @@ -22,6 +22,12 @@ * */ @@ -113298,25 +114598,26 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + * available on the same license terms set forth above. + */ + - #ifndef SHARE_VM_INTERPRETER_BYTECODESTREAM_HPP - #define SHARE_VM_INTERPRETER_BYTECODESTREAM_HPP + #ifndef SHARE_VM_INTERPRETER_CPPINTERPRETER_HPP + #define SHARE_VM_INTERPRETER_CPPINTERPRETER_HPP -@@ -32,6 +38,12 @@ +@@ -84,6 +90,12 @@ class CppInterpreter: public AbstractInterpreter { #ifdef TARGET_ARCH_x86 - # include "bytes_x86.hpp" + # include "cppInterpreter_x86.hpp" #endif +#ifdef TARGET_ARCH_mips -+# include "bytes_mips.hpp" ++# include "cppInterpreter_mips.hpp" +#endif +#ifdef TARGET_ARCH_loongarch -+# include "bytes_loongarch.hpp" ++# include "cppInterpreter_loongarch.hpp" +#endif #ifdef TARGET_ARCH_aarch64 - # include "bytes_aarch64.hpp" + # include "cppInterpreter_aarch64.hpp" #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/interpreter/cppInterpreterGenerator.hpp b/hotspot/src/share/vm/interpreter/cppInterpreterGenerator.hpp ---- a/hotspot/src/share/vm/interpreter/cppInterpreterGenerator.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/interpreter/cppInterpreterGenerator.hpp 2023-12-20 09:23:19.968145932 +0800 +diff --git a/hotspot/src/share/vm/interpreter/cppInterpreterGenerator.hpp b/hotspot/src/share/vm/interpreter/cppInterpreterGenerator.hpp +index 6a08a3f4..1fd19994 100644 +--- a/hotspot/src/share/vm/interpreter/cppInterpreterGenerator.hpp ++++ b/hotspot/src/share/vm/interpreter/cppInterpreterGenerator.hpp @@ -22,6 +22,12 @@ * */ @@ -113330,7 +114631,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifndef SHARE_VM_INTERPRETER_CPPINTERPRETERGENERATOR_HPP #define SHARE_VM_INTERPRETER_CPPINTERPRETERGENERATOR_HPP -@@ -50,6 +56,12 @@ +@@ -50,6 +56,12 @@ class CppInterpreterGenerator: public AbstractInterpreterGenerator { #ifdef TARGET_ARCH_x86 # include "cppInterpreterGenerator_x86.hpp" #endif @@ -113343,9 +114644,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_ARCH_aarch64 # include "cppInterpreterGenerator_aarch64.hpp" #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/interpreter/cppInterpreter.hpp b/hotspot/src/share/vm/interpreter/cppInterpreter.hpp ---- a/hotspot/src/share/vm/interpreter/cppInterpreter.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/interpreter/cppInterpreter.hpp 2023-12-20 09:23:19.968145932 +0800 +diff --git a/hotspot/src/share/vm/interpreter/interpreter.hpp b/hotspot/src/share/vm/interpreter/interpreter.hpp +index ebfb68d3..610949f3 100644 +--- a/hotspot/src/share/vm/interpreter/interpreter.hpp ++++ b/hotspot/src/share/vm/interpreter/interpreter.hpp @@ -22,6 +22,12 @@ * */ @@ -113356,25 +114658,26 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + * available on the same license terms set forth above. + */ + - #ifndef SHARE_VM_INTERPRETER_CPPINTERPRETER_HPP - #define SHARE_VM_INTERPRETER_CPPINTERPRETER_HPP + #ifndef SHARE_VM_INTERPRETER_INTERPRETER_HPP + #define SHARE_VM_INTERPRETER_INTERPRETER_HPP -@@ -84,6 +90,12 @@ +@@ -148,6 +154,12 @@ class Interpreter: public CC_INTERP_ONLY(CppInterpreter) NOT_CC_INTERP(TemplateI #ifdef TARGET_ARCH_x86 - # include "cppInterpreter_x86.hpp" + # include "interpreter_x86.hpp" #endif +#ifdef TARGET_ARCH_mips -+# include "cppInterpreter_mips.hpp" ++# include "interpreter_mips.hpp" +#endif +#ifdef TARGET_ARCH_loongarch -+# include "cppInterpreter_loongarch.hpp" ++# include "interpreter_loongarch.hpp" +#endif #ifdef TARGET_ARCH_aarch64 - # include "cppInterpreter_aarch64.hpp" + # include "interpreter_aarch64.hpp" #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/interpreter/interpreterGenerator.hpp b/hotspot/src/share/vm/interpreter/interpreterGenerator.hpp ---- a/hotspot/src/share/vm/interpreter/interpreterGenerator.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/interpreter/interpreterGenerator.hpp 2023-12-20 09:23:19.968145932 +0800 +diff --git a/hotspot/src/share/vm/interpreter/interpreterGenerator.hpp b/hotspot/src/share/vm/interpreter/interpreterGenerator.hpp +index 1dc7cb29..92bbe6b4 100644 +--- a/hotspot/src/share/vm/interpreter/interpreterGenerator.hpp ++++ b/hotspot/src/share/vm/interpreter/interpreterGenerator.hpp @@ -22,6 +22,12 @@ * */ @@ -113388,7 +114691,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifndef SHARE_VM_INTERPRETER_INTERPRETERGENERATOR_HPP #define SHARE_VM_INTERPRETER_INTERPRETERGENERATOR_HPP -@@ -44,6 +50,12 @@ +@@ -44,6 +50,12 @@ InterpreterGenerator(StubQueue* _code); #ifdef TARGET_ARCH_x86 # include "interpreterGenerator_x86.hpp" #endif @@ -113401,38 +114704,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_ARCH_aarch64 # include "interpreterGenerator_aarch64.hpp" #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/interpreter/interpreter.hpp b/hotspot/src/share/vm/interpreter/interpreter.hpp ---- a/hotspot/src/share/vm/interpreter/interpreter.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/interpreter/interpreter.hpp 2023-12-20 09:23:19.968145932 +0800 -@@ -22,6 +22,12 @@ - * - */ - -+/* -+ * This file has been modified by Loongson Technology in 2020. These -+ * modifications are Copyright (c) 2015, 2020, Loongson Technology, and are made -+ * available on the same license terms set forth above. -+ */ -+ - #ifndef SHARE_VM_INTERPRETER_INTERPRETER_HPP - #define SHARE_VM_INTERPRETER_INTERPRETER_HPP - -@@ -148,6 +154,12 @@ - #ifdef TARGET_ARCH_x86 - # include "interpreter_x86.hpp" - #endif -+#ifdef TARGET_ARCH_mips -+# include "interpreter_mips.hpp" -+#endif -+#ifdef TARGET_ARCH_loongarch -+# include "interpreter_loongarch.hpp" -+#endif - #ifdef TARGET_ARCH_aarch64 - # include "interpreter_aarch64.hpp" - #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp ---- a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp 2023-12-20 09:23:19.968145932 +0800 +diff --git a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp +index cad9d290..85303e4b 100644 +--- a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp ++++ b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp @@ -22,6 +22,12 @@ * */ @@ -113459,7 +114734,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_ARCH_aarch64 # include "vm_version_aarch64.hpp" #endif -@@ -1290,7 +1302,7 @@ +@@ -1290,7 +1302,7 @@ IRT_ENTRY(void, InterpreterRuntime::prepare_native_call(JavaThread* thread, Meth // preparing the same method will be sure to see non-null entry & mirror. IRT_END @@ -113468,9 +114743,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp IRT_LEAF(void, InterpreterRuntime::popframe_move_outgoing_args(JavaThread* thread, void* src_address, void* dest_address)) if (src_address == dest_address) { return; -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp b/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp ---- a/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp 2023-12-20 09:23:19.968145932 +0800 +diff --git a/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp b/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp +index 472bf4d9..9a98d555 100644 +--- a/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp ++++ b/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp @@ -22,6 +22,12 @@ * */ @@ -113484,7 +114760,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifndef SHARE_VM_INTERPRETER_INTERPRETERRUNTIME_HPP #define SHARE_VM_INTERPRETER_INTERPRETERRUNTIME_HPP -@@ -156,7 +162,7 @@ +@@ -156,7 +162,7 @@ class InterpreterRuntime: AllStatic { Method* method, intptr_t* from, intptr_t* to); @@ -113493,7 +114769,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp // Popframe support (only needed on x86, AMD64 and ARM) static void popframe_move_outgoing_args(JavaThread* thread, void* src_address, void* dest_address); #endif -@@ -165,6 +171,12 @@ +@@ -165,6 +171,12 @@ class InterpreterRuntime: AllStatic { #ifdef TARGET_ARCH_x86 # include "interpreterRT_x86.hpp" #endif @@ -113506,9 +114782,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_ARCH_aarch64 # include "interpreterRT_aarch64.hpp" #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp b/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp ---- a/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp 2023-12-20 09:23:19.971479225 +0800 +diff --git a/hotspot/src/share/vm/interpreter/templateInterpreter.hpp b/hotspot/src/share/vm/interpreter/templateInterpreter.hpp +index 5f76dca8..757860f4 100644 +--- a/hotspot/src/share/vm/interpreter/templateInterpreter.hpp ++++ b/hotspot/src/share/vm/interpreter/templateInterpreter.hpp @@ -22,6 +22,12 @@ * */ @@ -113519,25 +114796,26 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + * available on the same license terms set forth above. + */ + - #ifndef SHARE_VM_INTERPRETER_TEMPLATEINTERPRETERGENERATOR_HPP - #define SHARE_VM_INTERPRETER_TEMPLATEINTERPRETERGENERATOR_HPP + #ifndef SHARE_VM_INTERPRETER_TEMPLATEINTERPRETER_HPP + #define SHARE_VM_INTERPRETER_TEMPLATEINTERPRETER_HPP -@@ -89,6 +95,12 @@ +@@ -190,6 +196,12 @@ class TemplateInterpreter: public AbstractInterpreter { #ifdef TARGET_ARCH_x86 - # include "templateInterpreterGenerator_x86.hpp" + # include "templateInterpreter_x86.hpp" #endif +#ifdef TARGET_ARCH_mips -+# include "templateInterpreterGenerator_mips.hpp" ++# include "templateInterpreter_mips.hpp" +#endif +#ifdef TARGET_ARCH_loongarch -+# include "templateInterpreterGenerator_loongarch.hpp" ++# include "templateInterpreter_loongarch.hpp" +#endif #ifdef TARGET_ARCH_aarch64 - # include "templateInterpreterGenerator_aarch64.hpp" + # include "templateInterpreter_aarch64.hpp" #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/interpreter/templateInterpreter.hpp b/hotspot/src/share/vm/interpreter/templateInterpreter.hpp ---- a/hotspot/src/share/vm/interpreter/templateInterpreter.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/interpreter/templateInterpreter.hpp 2023-12-20 09:23:19.971479225 +0800 +diff --git a/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp b/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp +index bd94bd02..28ca437e 100644 +--- a/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp ++++ b/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp @@ -22,6 +22,12 @@ * */ @@ -113548,25 +114826,26 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + * available on the same license terms set forth above. + */ + - #ifndef SHARE_VM_INTERPRETER_TEMPLATEINTERPRETER_HPP - #define SHARE_VM_INTERPRETER_TEMPLATEINTERPRETER_HPP + #ifndef SHARE_VM_INTERPRETER_TEMPLATEINTERPRETERGENERATOR_HPP + #define SHARE_VM_INTERPRETER_TEMPLATEINTERPRETERGENERATOR_HPP -@@ -190,6 +196,12 @@ +@@ -89,6 +95,12 @@ class TemplateInterpreterGenerator: public AbstractInterpreterGenerator { #ifdef TARGET_ARCH_x86 - # include "templateInterpreter_x86.hpp" + # include "templateInterpreterGenerator_x86.hpp" #endif +#ifdef TARGET_ARCH_mips -+# include "templateInterpreter_mips.hpp" ++# include "templateInterpreterGenerator_mips.hpp" +#endif +#ifdef TARGET_ARCH_loongarch -+# include "templateInterpreter_loongarch.hpp" ++# include "templateInterpreterGenerator_loongarch.hpp" +#endif #ifdef TARGET_ARCH_aarch64 - # include "templateInterpreter_aarch64.hpp" + # include "templateInterpreterGenerator_aarch64.hpp" #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/interpreter/templateTable.hpp b/hotspot/src/share/vm/interpreter/templateTable.hpp ---- a/hotspot/src/share/vm/interpreter/templateTable.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/interpreter/templateTable.hpp 2023-12-20 09:23:19.971479225 +0800 +diff --git a/hotspot/src/share/vm/interpreter/templateTable.hpp b/hotspot/src/share/vm/interpreter/templateTable.hpp +index 60d243c1..1b73822a 100644 +--- a/hotspot/src/share/vm/interpreter/templateTable.hpp ++++ b/hotspot/src/share/vm/interpreter/templateTable.hpp @@ -22,6 +22,12 @@ * */ @@ -113591,7 +114870,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #endif #ifndef CC_INTERP -@@ -367,6 +377,10 @@ +@@ -367,6 +377,10 @@ class TemplateTable: AllStatic { # include "templateTable_zero.hpp" #elif defined TARGET_ARCH_MODEL_ppc_64 # include "templateTable_ppc_64.hpp" @@ -113602,10 +114881,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #endif }; -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/jfr/utilities/jfrBigEndian.hpp b/hotspot/src/share/vm/jfr/utilities/jfrBigEndian.hpp ---- a/hotspot/src/share/vm/jfr/utilities/jfrBigEndian.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/jfr/utilities/jfrBigEndian.hpp 2023-12-20 09:23:19.984812406 +0800 -@@ -116,7 +116,7 @@ +diff --git a/hotspot/src/share/vm/jfr/utilities/jfrBigEndian.hpp b/hotspot/src/share/vm/jfr/utilities/jfrBigEndian.hpp +index 6d9ab39f..f4e9a4ca 100644 +--- a/hotspot/src/share/vm/jfr/utilities/jfrBigEndian.hpp ++++ b/hotspot/src/share/vm/jfr/utilities/jfrBigEndian.hpp +@@ -116,7 +116,7 @@ inline T JfrBigEndian::read_unaligned(const address location) { inline bool JfrBigEndian::platform_supports_unaligned_reads(void) { #if defined(IA32) || defined(AMD64) || defined(PPC) || defined(S390) return true; @@ -113614,9 +114894,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp return false; #else #warning "Unconfigured platform" -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/jfr/writers/jfrEncoders.hpp b/hotspot/src/share/vm/jfr/writers/jfrEncoders.hpp ---- a/hotspot/src/share/vm/jfr/writers/jfrEncoders.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/jfr/writers/jfrEncoders.hpp 2023-12-20 09:23:19.984812406 +0800 +diff --git a/hotspot/src/share/vm/jfr/writers/jfrEncoders.hpp b/hotspot/src/share/vm/jfr/writers/jfrEncoders.hpp +index 42a8b719..f08f6ee1 100644 +--- a/hotspot/src/share/vm/jfr/writers/jfrEncoders.hpp ++++ b/hotspot/src/share/vm/jfr/writers/jfrEncoders.hpp @@ -22,6 +22,12 @@ * */ @@ -113643,9 +114924,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp // // The Encoding policy prescribes a template -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/memory/barrierSet.hpp b/hotspot/src/share/vm/memory/barrierSet.hpp ---- a/hotspot/src/share/vm/memory/barrierSet.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/memory/barrierSet.hpp 2023-12-20 09:23:19.988145701 +0800 +diff --git a/hotspot/src/share/vm/memory/barrierSet.hpp b/hotspot/src/share/vm/memory/barrierSet.hpp +index 13ff9b27..081b7074 100644 +--- a/hotspot/src/share/vm/memory/barrierSet.hpp ++++ b/hotspot/src/share/vm/memory/barrierSet.hpp @@ -27,6 +27,7 @@ #include "memory/memRegion.hpp" @@ -113654,7 +114936,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp // This class provides the interface between a barrier implementation and // the rest of the system. -@@ -95,8 +96,16 @@ +@@ -95,8 +96,16 @@ private: // Keep this private so as to catch violations at build time. virtual void write_ref_field_pre_work( void* field, oop new_val) { guarantee(false, "Not needed"); }; protected: @@ -113673,7 +114955,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp public: // ...then the post-write version. -@@ -132,9 +141,17 @@ +@@ -132,9 +141,17 @@ public: // Below length is the # array elements being written virtual void write_ref_array_pre(oop* dst, int length, @@ -113693,10 +114975,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp // Below count is the # array elements being written, starting // at the address "start", which may not necessarily be HeapWord-aligned inline void write_ref_array(HeapWord* start, size_t count); -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/memory/cardTableModRefBS.hpp b/hotspot/src/share/vm/memory/cardTableModRefBS.hpp ---- a/hotspot/src/share/vm/memory/cardTableModRefBS.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/memory/cardTableModRefBS.hpp 2023-12-20 09:23:19.988145701 +0800 -@@ -316,6 +316,9 @@ +diff --git a/hotspot/src/share/vm/memory/cardTableModRefBS.hpp b/hotspot/src/share/vm/memory/cardTableModRefBS.hpp +index 01e46888..80bd1518 100644 +--- a/hotspot/src/share/vm/memory/cardTableModRefBS.hpp ++++ b/hotspot/src/share/vm/memory/cardTableModRefBS.hpp +@@ -316,6 +316,9 @@ public: inline void inline_write_ref_array(MemRegion mr) { dirty_MemRegion(mr); @@ -113706,7 +114989,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp } protected: void write_ref_array_work(MemRegion mr) { -@@ -329,7 +332,11 @@ +@@ -329,7 +332,11 @@ public: // *** Card-table-barrier-specific things. @@ -113719,7 +115002,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp template inline void inline_write_ref_field(T* field, oop newVal, bool release) { jbyte* byte = byte_for((void*)field); -@@ -339,6 +346,9 @@ +@@ -339,6 +346,9 @@ public: } else { *byte = dirty_card; } @@ -113729,10 +115012,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp } // These are used by G1, when it uses the card table as a temporary data -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/memory/cardTableRS.cpp b/hotspot/src/share/vm/memory/cardTableRS.cpp ---- a/hotspot/src/share/vm/memory/cardTableRS.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/memory/cardTableRS.cpp 2023-12-20 09:23:19.988145701 +0800 -@@ -252,6 +252,9 @@ +diff --git a/hotspot/src/share/vm/memory/cardTableRS.cpp b/hotspot/src/share/vm/memory/cardTableRS.cpp +index fb33a708..da22acba 100644 +--- a/hotspot/src/share/vm/memory/cardTableRS.cpp ++++ b/hotspot/src/share/vm/memory/cardTableRS.cpp +@@ -252,6 +252,9 @@ void ClearNoncleanCardWrapper::do_MemRegion(MemRegion mr) { // cur_youngergen_and_prev_nonclean_card ==> no change. void CardTableRS::write_ref_field_gc_par(void* field, oop new_val) { jbyte* entry = ct_bs()->byte_for(field); @@ -113742,7 +115026,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp do { jbyte entry_val = *entry; // We put this first because it's probably the most common case. -@@ -266,7 +269,12 @@ +@@ -266,7 +269,12 @@ void CardTableRS::write_ref_field_gc_par(void* field, oop new_val) { jbyte new_val = cur_youngergen_and_prev_nonclean_card; jbyte res = Atomic::cmpxchg(new_val, entry, entry_val); // Did the CAS succeed? @@ -113756,10 +115040,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp // Otherwise, retry, to see the new value. continue; } else { -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/memory/cardTableRS.hpp b/hotspot/src/share/vm/memory/cardTableRS.hpp ---- a/hotspot/src/share/vm/memory/cardTableRS.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/memory/cardTableRS.hpp 2023-12-20 09:23:19.988145701 +0800 -@@ -121,7 +121,14 @@ +diff --git a/hotspot/src/share/vm/memory/cardTableRS.hpp b/hotspot/src/share/vm/memory/cardTableRS.hpp +index 25884fea..5d4e77f2 100644 +--- a/hotspot/src/share/vm/memory/cardTableRS.hpp ++++ b/hotspot/src/share/vm/memory/cardTableRS.hpp +@@ -121,7 +121,14 @@ public: void inline_write_ref_field_gc(void* field, oop new_val) { jbyte* byte = _ct_bs->byte_for(field); @@ -113775,9 +115060,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp } void write_ref_field_gc_work(void* field, oop new_val) { inline_write_ref_field_gc(field, new_val); -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/memory/metaspace.cpp b/hotspot/src/share/vm/memory/metaspace.cpp ---- a/hotspot/src/share/vm/memory/metaspace.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/memory/metaspace.cpp 2023-12-20 09:23:19.991478997 +0800 +diff --git a/hotspot/src/share/vm/memory/metaspace.cpp b/hotspot/src/share/vm/memory/metaspace.cpp +index fb0564ac..9cec7d43 100644 +--- a/hotspot/src/share/vm/memory/metaspace.cpp ++++ b/hotspot/src/share/vm/memory/metaspace.cpp @@ -21,6 +21,13 @@ * questions. * @@ -113792,7 +115078,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #include "precompiled.hpp" #include "gc_interface/collectedHeap.hpp" #include "memory/allocation.hpp" -@@ -3065,12 +3072,12 @@ +@@ -3065,12 +3072,12 @@ void Metaspace::allocate_metaspace_compressed_klass_ptrs(char* requested_addr, a // Don't use large pages for the class space. bool large_pages = false; @@ -113807,7 +115093,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp ReservedSpace metaspace_rs; // Our compressed klass pointers may fit nicely into the lower 32 -@@ -3107,7 +3114,7 @@ +@@ -3107,7 +3114,7 @@ void Metaspace::allocate_metaspace_compressed_klass_ptrs(char* requested_addr, a } } @@ -113816,9 +115102,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp if (!metaspace_rs.is_reserved()) { #if INCLUDE_CDS -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/oops/constantPool.hpp b/hotspot/src/share/vm/oops/constantPool.hpp ---- a/hotspot/src/share/vm/oops/constantPool.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/oops/constantPool.hpp 2023-12-20 09:23:19.998145587 +0800 +diff --git a/hotspot/src/share/vm/oops/constantPool.hpp b/hotspot/src/share/vm/oops/constantPool.hpp +index 635bf6d1..18822d9f 100644 +--- a/hotspot/src/share/vm/oops/constantPool.hpp ++++ b/hotspot/src/share/vm/oops/constantPool.hpp @@ -22,6 +22,12 @@ * */ @@ -113846,9 +115133,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp // A constantPool is an array containing class constants as described in the // class file. -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/oops/klass.hpp b/hotspot/src/share/vm/oops/klass.hpp ---- a/hotspot/src/share/vm/oops/klass.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/oops/klass.hpp 2023-12-20 09:23:20.001478882 +0800 +diff --git a/hotspot/src/share/vm/oops/klass.hpp b/hotspot/src/share/vm/oops/klass.hpp +index acef3348..23fc0b99 100644 +--- a/hotspot/src/share/vm/oops/klass.hpp ++++ b/hotspot/src/share/vm/oops/klass.hpp @@ -32,6 +32,9 @@ #include "oops/klassPS.hpp" #include "oops/metadata.hpp" @@ -113859,7 +115147,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #include "utilities/accessFlags.hpp" #include "utilities/macros.hpp" #if INCLUDE_ALL_GCS -@@ -289,8 +292,18 @@ +@@ -289,8 +292,18 @@ protected: // The Klasses are not placed in the Heap, so the Card Table or // the Mod Union Table can't be used to mark when klasses have modified oops. // The CT and MUT bits saves this information for the individual Klasses. @@ -113880,10 +115168,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp bool has_modified_oops() { return _modified_oops == 1; } void accumulate_modified_oops() { if (has_modified_oops()) _accumulated_modified_oops = 1; } -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/oops/oop.hpp b/hotspot/src/share/vm/oops/oop.hpp ---- a/hotspot/src/share/vm/oops/oop.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/oops/oop.hpp 2023-12-20 09:23:20.001478882 +0800 -@@ -72,7 +72,13 @@ +diff --git a/hotspot/src/share/vm/oops/oop.hpp b/hotspot/src/share/vm/oops/oop.hpp +index 0678c6b3..1cb20e35 100644 +--- a/hotspot/src/share/vm/oops/oop.hpp ++++ b/hotspot/src/share/vm/oops/oop.hpp +@@ -72,7 +72,13 @@ class oopDesc { markOop mark() const { return _mark; } markOop* mark_addr() const { return (markOop*) &_mark; } @@ -113898,9 +115187,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp void release_set_mark(markOop m); markOop cas_set_mark(markOop new_mark, markOop old_mark); -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/oops/oop.inline.hpp b/hotspot/src/share/vm/oops/oop.inline.hpp ---- a/hotspot/src/share/vm/oops/oop.inline.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/oops/oop.inline.hpp 2023-12-20 09:23:20.001478882 +0800 +diff --git a/hotspot/src/share/vm/oops/oop.inline.hpp b/hotspot/src/share/vm/oops/oop.inline.hpp +index beec739d..8660c1e3 100644 +--- a/hotspot/src/share/vm/oops/oop.inline.hpp ++++ b/hotspot/src/share/vm/oops/oop.inline.hpp @@ -22,6 +22,12 @@ * */ @@ -113927,9 +115217,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp // Implementation of all inlined member functions defined in oop.hpp // We need a separate file to avoid circular references -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/oops/oop.pcgc.inline.hpp b/hotspot/src/share/vm/oops/oop.pcgc.inline.hpp ---- a/hotspot/src/share/vm/oops/oop.pcgc.inline.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/oops/oop.pcgc.inline.hpp 2023-12-20 09:23:20.001478882 +0800 +diff --git a/hotspot/src/share/vm/oops/oop.pcgc.inline.hpp b/hotspot/src/share/vm/oops/oop.pcgc.inline.hpp +index 8a460394..b28bb991 100644 +--- a/hotspot/src/share/vm/oops/oop.pcgc.inline.hpp ++++ b/hotspot/src/share/vm/oops/oop.pcgc.inline.hpp @@ -22,6 +22,12 @@ * */ @@ -113943,7 +115234,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifndef SHARE_VM_OOPS_OOP_PCGC_INLINE_HPP #define SHARE_VM_OOPS_OOP_PCGC_INLINE_HPP -@@ -75,7 +81,7 @@ +@@ -75,7 +81,7 @@ inline oop oopDesc::forward_to_atomic(oop p) { // forwarding pointer. oldMark = curMark; } @@ -113952,9 +115243,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp } #endif // SHARE_VM_OOPS_OOP_PCGC_INLINE_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/opto/buildOopMap.cpp b/hotspot/src/share/vm/opto/buildOopMap.cpp ---- a/hotspot/src/share/vm/opto/buildOopMap.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/opto/buildOopMap.cpp 2023-12-20 09:23:20.004812178 +0800 +diff --git a/hotspot/src/share/vm/opto/buildOopMap.cpp b/hotspot/src/share/vm/opto/buildOopMap.cpp +index 91642f1d..5df185df 100644 +--- a/hotspot/src/share/vm/opto/buildOopMap.cpp ++++ b/hotspot/src/share/vm/opto/buildOopMap.cpp @@ -22,6 +22,12 @@ * */ @@ -113981,10 +115273,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp // The functions in this file builds OopMaps after all scheduling is done. // -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/opto/bytecodeInfo.cpp b/hotspot/src/share/vm/opto/bytecodeInfo.cpp ---- a/hotspot/src/share/vm/opto/bytecodeInfo.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/opto/bytecodeInfo.cpp 2023-12-20 09:23:20.004812178 +0800 -@@ -361,9 +361,20 @@ +diff --git a/hotspot/src/share/vm/opto/bytecodeInfo.cpp b/hotspot/src/share/vm/opto/bytecodeInfo.cpp +index 7fd615d3..ad472e87 100644 +--- a/hotspot/src/share/vm/opto/bytecodeInfo.cpp ++++ b/hotspot/src/share/vm/opto/bytecodeInfo.cpp +@@ -361,9 +361,20 @@ bool InlineTree::try_to_inline(ciMethod* callee_method, ciMethod* caller_method, } else if (forced_inline()) { // Inlining was forced by CompilerOracle, ciReplay or annotation } else if (profile.count() == 0) { @@ -114005,36 +115298,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp } } -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/opto/c2compiler.cpp b/hotspot/src/share/vm/opto/c2compiler.cpp ---- a/hotspot/src/share/vm/opto/c2compiler.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/opto/c2compiler.cpp 2023-12-20 09:23:20.004812178 +0800 -@@ -22,6 +22,12 @@ - * - */ - -+/* -+ * This file has been modified by Loongson Technology in 2020. These -+ * modifications are Copyright (c) 2015, 2020, Loongson Technology, and are made -+ * available on the same license terms set forth above. -+ */ -+ - #include "precompiled.hpp" - #include "opto/c2compiler.hpp" - #include "opto/runtime.hpp" -@@ -39,6 +45,10 @@ - # include "adfiles/ad_zero.hpp" - #elif defined TARGET_ARCH_MODEL_ppc_64 - # include "adfiles/ad_ppc_64.hpp" -+#elif defined TARGET_ARCH_MODEL_mips_64 -+# include "adfiles/ad_mips_64.hpp" -+#elif defined TARGET_ARCH_MODEL_loongarch_64 -+# include "adfiles/ad_loongarch_64.hpp" - #endif - - // register information defined by ADLC -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/opto/c2_globals.hpp b/hotspot/src/share/vm/opto/c2_globals.hpp ---- a/hotspot/src/share/vm/opto/c2_globals.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/opto/c2_globals.hpp 2023-12-20 09:23:20.004812178 +0800 +diff --git a/hotspot/src/share/vm/opto/c2_globals.hpp b/hotspot/src/share/vm/opto/c2_globals.hpp +index 82d2efef..d373b204 100644 +--- a/hotspot/src/share/vm/opto/c2_globals.hpp ++++ b/hotspot/src/share/vm/opto/c2_globals.hpp @@ -22,6 +22,12 @@ * */ @@ -114061,9 +115328,38 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_ARCH_arm # include "c2_globals_arm.hpp" #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/opto/chaitin.hpp b/hotspot/src/share/vm/opto/chaitin.hpp ---- a/hotspot/src/share/vm/opto/chaitin.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/opto/chaitin.hpp 2023-12-20 09:23:20.008145473 +0800 +diff --git a/hotspot/src/share/vm/opto/c2compiler.cpp b/hotspot/src/share/vm/opto/c2compiler.cpp +index 137f4960..f689d64a 100644 +--- a/hotspot/src/share/vm/opto/c2compiler.cpp ++++ b/hotspot/src/share/vm/opto/c2compiler.cpp +@@ -22,6 +22,12 @@ + * + */ + ++/* ++ * This file has been modified by Loongson Technology in 2020. These ++ * modifications are Copyright (c) 2015, 2020, Loongson Technology, and are made ++ * available on the same license terms set forth above. ++ */ ++ + #include "precompiled.hpp" + #include "opto/c2compiler.hpp" + #include "opto/runtime.hpp" +@@ -39,6 +45,10 @@ + # include "adfiles/ad_zero.hpp" + #elif defined TARGET_ARCH_MODEL_ppc_64 + # include "adfiles/ad_ppc_64.hpp" ++#elif defined TARGET_ARCH_MODEL_mips_64 ++# include "adfiles/ad_mips_64.hpp" ++#elif defined TARGET_ARCH_MODEL_loongarch_64 ++# include "adfiles/ad_loongarch_64.hpp" + #endif + + // register information defined by ADLC +diff --git a/hotspot/src/share/vm/opto/chaitin.hpp b/hotspot/src/share/vm/opto/chaitin.hpp +index de6d443c..0b27dc93 100644 +--- a/hotspot/src/share/vm/opto/chaitin.hpp ++++ b/hotspot/src/share/vm/opto/chaitin.hpp @@ -22,6 +22,12 @@ * */ @@ -114077,7 +115373,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifndef SHARE_VM_OPTO_CHAITIN_HPP #define SHARE_VM_OPTO_CHAITIN_HPP -@@ -136,8 +142,12 @@ +@@ -136,8 +142,12 @@ public: // Number of registers this live range uses when it colors private: @@ -114090,7 +115386,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp public: int num_regs() const { return _num_regs; } void set_num_regs( int reg ) { assert( _num_regs == reg || !_num_regs, "" ); _num_regs = reg; } -@@ -145,7 +155,11 @@ +@@ -145,7 +155,11 @@ public: private: // Number of physical registers this live range uses when it colors // Architecture and register-set dependent @@ -114102,9 +115398,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp public: void set_reg_pressure(int i) { _reg_pressure = i; } int reg_pressure() const { return _reg_pressure; } -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/opto/compile.cpp b/hotspot/src/share/vm/opto/compile.cpp ---- a/hotspot/src/share/vm/opto/compile.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/opto/compile.cpp 2023-12-20 09:23:20.008145473 +0800 +diff --git a/hotspot/src/share/vm/opto/compile.cpp b/hotspot/src/share/vm/opto/compile.cpp +index ae22ba84..9004dc0d 100644 +--- a/hotspot/src/share/vm/opto/compile.cpp ++++ b/hotspot/src/share/vm/opto/compile.cpp @@ -22,6 +22,12 @@ * */ @@ -114129,10 +115426,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #endif // -------------------- Compile::mach_constant_base_node ----------------------- -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/opto/compile.hpp b/hotspot/src/share/vm/opto/compile.hpp ---- a/hotspot/src/share/vm/opto/compile.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/opto/compile.hpp 2023-12-20 09:23:20.008145473 +0800 -@@ -1025,7 +1025,7 @@ +diff --git a/hotspot/src/share/vm/opto/compile.hpp b/hotspot/src/share/vm/opto/compile.hpp +index b4f4cfef..d263ee2f 100644 +--- a/hotspot/src/share/vm/opto/compile.hpp ++++ b/hotspot/src/share/vm/opto/compile.hpp +@@ -1025,7 +1025,7 @@ class Compile : public Phase { bool in_scratch_emit_size() const { return _in_scratch_emit_size; } enum ScratchBufferBlob { @@ -114141,9 +115439,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp MAX_locs_size = 128, // number of relocInfo elements MAX_const_size = 128, MAX_stubs_size = 128 -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/opto/gcm.cpp b/hotspot/src/share/vm/opto/gcm.cpp ---- a/hotspot/src/share/vm/opto/gcm.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/opto/gcm.cpp 2023-12-20 09:23:20.011478768 +0800 +diff --git a/hotspot/src/share/vm/opto/gcm.cpp b/hotspot/src/share/vm/opto/gcm.cpp +index f51484ef..12457b7c 100644 +--- a/hotspot/src/share/vm/opto/gcm.cpp ++++ b/hotspot/src/share/vm/opto/gcm.cpp @@ -22,6 +22,12 @@ * */ @@ -114168,9 +115467,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/opto/lcm.cpp b/hotspot/src/share/vm/opto/lcm.cpp ---- a/hotspot/src/share/vm/opto/lcm.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/opto/lcm.cpp 2023-12-20 09:23:20.011478768 +0800 +diff --git a/hotspot/src/share/vm/opto/lcm.cpp b/hotspot/src/share/vm/opto/lcm.cpp +index c6178a71..2d492568 100644 +--- a/hotspot/src/share/vm/opto/lcm.cpp ++++ b/hotspot/src/share/vm/opto/lcm.cpp @@ -22,6 +22,12 @@ * */ @@ -114195,9 +115495,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #endif // Optimization - Graph Style -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/opto/locknode.hpp b/hotspot/src/share/vm/opto/locknode.hpp ---- a/hotspot/src/share/vm/opto/locknode.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/opto/locknode.hpp 2023-12-20 09:23:20.014812063 +0800 +diff --git a/hotspot/src/share/vm/opto/locknode.hpp b/hotspot/src/share/vm/opto/locknode.hpp +index b320f6bf..4bfb0ff0 100644 +--- a/hotspot/src/share/vm/opto/locknode.hpp ++++ b/hotspot/src/share/vm/opto/locknode.hpp @@ -22,6 +22,12 @@ * */ @@ -114222,9 +115523,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #endif //------------------------------BoxLockNode------------------------------------ -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/opto/matcher.cpp b/hotspot/src/share/vm/opto/matcher.cpp ---- a/hotspot/src/share/vm/opto/matcher.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/opto/matcher.cpp 2023-12-20 09:23:20.018145359 +0800 +diff --git a/hotspot/src/share/vm/opto/matcher.cpp b/hotspot/src/share/vm/opto/matcher.cpp +index 6660b4b4..dec46861 100644 +--- a/hotspot/src/share/vm/opto/matcher.cpp ++++ b/hotspot/src/share/vm/opto/matcher.cpp @@ -22,6 +22,12 @@ * */ @@ -114249,9 +115551,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #endif OptoReg::Name OptoReg::c_frame_pointer; -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/opto/output.cpp b/hotspot/src/share/vm/opto/output.cpp ---- a/hotspot/src/share/vm/opto/output.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/opto/output.cpp 2023-12-20 09:23:20.018145359 +0800 +diff --git a/hotspot/src/share/vm/opto/output.cpp b/hotspot/src/share/vm/opto/output.cpp +index 6032b72a..7fb4dea2 100644 +--- a/hotspot/src/share/vm/opto/output.cpp ++++ b/hotspot/src/share/vm/opto/output.cpp @@ -22,6 +22,12 @@ * */ @@ -114265,7 +115568,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #include "precompiled.hpp" #include "asm/assembler.inline.hpp" #include "code/compiledIC.hpp" -@@ -844,6 +850,27 @@ +@@ -844,6 +850,27 @@ void Compile::Process_OopMap_Node(MachNode *mach, int current_offset) { // Add the safepoint in the DebugInfoRecorder if( !mach->is_MachCall() ) { mcall = NULL; @@ -114293,7 +115596,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp debug_info()->add_safepoint(safepoint_pc_offset, sfn->_oop_map); } else { mcall = mach->as_MachCall(); -@@ -1502,6 +1529,22 @@ +@@ -1502,6 +1529,22 @@ void Compile::fill_buffer(CodeBuffer* cb, uint* blk_starts) { DEBUG_ONLY( uint instr_offset = cb->insts_size(); ) n->emit(*cb, _regalloc); current_offset = cb->insts_size(); @@ -114316,9 +115619,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp // Above we only verified that there is enough space in the instruction section. // However, the instruction may emit stubs that cause code buffer expansion. -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/opto/output.hpp b/hotspot/src/share/vm/opto/output.hpp ---- a/hotspot/src/share/vm/opto/output.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/opto/output.hpp 2023-12-20 09:23:20.018145359 +0800 +diff --git a/hotspot/src/share/vm/opto/output.hpp b/hotspot/src/share/vm/opto/output.hpp +index ba728413..37f954de 100644 +--- a/hotspot/src/share/vm/opto/output.hpp ++++ b/hotspot/src/share/vm/opto/output.hpp @@ -22,6 +22,12 @@ * */ @@ -114343,13 +115647,14 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #endif class Arena; -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/opto/regmask.cpp b/hotspot/src/share/vm/opto/regmask.cpp ---- a/hotspot/src/share/vm/opto/regmask.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/opto/regmask.cpp 2023-12-20 09:23:20.021478654 +0800 +diff --git a/hotspot/src/share/vm/opto/regmask.cpp b/hotspot/src/share/vm/opto/regmask.cpp +index 352ccfb9..9a656d03 100644 +--- a/hotspot/src/share/vm/opto/regmask.cpp ++++ b/hotspot/src/share/vm/opto/regmask.cpp @@ -22,6 +22,12 @@ * */ - + +/* + * This file has been modified by Loongson Technology in 2020. These + * modifications are Copyright (c) 2015, 2020, Loongson Technology, and are made @@ -114368,11 +115673,12 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +#elif defined TARGET_ARCH_MODEL_loongarch_64 +# include "adfiles/ad_loongarch_64.hpp" #endif - + #define RM_SIZE _RM_SIZE /* a constant private to the class RegMask */ -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/opto/regmask.hpp b/hotspot/src/share/vm/opto/regmask.hpp ---- a/hotspot/src/share/vm/opto/regmask.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/opto/regmask.hpp 2023-12-20 09:23:20.021478654 +0800 +diff --git a/hotspot/src/share/vm/opto/regmask.hpp b/hotspot/src/share/vm/opto/regmask.hpp +index 5ceebb3f..6d08b687 100644 +--- a/hotspot/src/share/vm/opto/regmask.hpp ++++ b/hotspot/src/share/vm/opto/regmask.hpp @@ -22,6 +22,12 @@ * */ @@ -114396,10 +115702,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +# include "adfiles/adGlobals_loongarch_64.hpp" #endif - -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/opto/runtime.cpp b/hotspot/src/share/vm/opto/runtime.cpp ---- a/hotspot/src/share/vm/opto/runtime.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/opto/runtime.cpp 2023-12-20 09:23:20.021478654 +0800 + // Some fun naming (textual) substitutions: +diff --git a/hotspot/src/share/vm/opto/runtime.cpp b/hotspot/src/share/vm/opto/runtime.cpp +index a43b37f2..f2bcafa2 100644 +--- a/hotspot/src/share/vm/opto/runtime.cpp ++++ b/hotspot/src/share/vm/opto/runtime.cpp @@ -22,6 +22,12 @@ * */ @@ -114424,9 +115731,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/opto/type.cpp b/hotspot/src/share/vm/opto/type.cpp ---- a/hotspot/src/share/vm/opto/type.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/opto/type.cpp 2023-12-20 09:23:20.024811948 +0800 +diff --git a/hotspot/src/share/vm/opto/type.cpp b/hotspot/src/share/vm/opto/type.cpp +index 58572f13..299d48b1 100644 +--- a/hotspot/src/share/vm/opto/type.cpp ++++ b/hotspot/src/share/vm/opto/type.cpp @@ -22,6 +22,12 @@ * */ @@ -114440,7 +115748,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #include "precompiled.hpp" #include "ci/ciMethodData.hpp" #include "ci/ciTypeFlow.hpp" -@@ -68,6 +74,16 @@ +@@ -68,6 +74,16 @@ const Type::TypeInfo Type::_type_info[Type::lastype] = { { Bad, T_ILLEGAL, "vectord:", false, Op_RegD, relocInfo::none }, // VectorD { Bad, T_ILLEGAL, "vectorx:", false, 0, relocInfo::none }, // VectorX { Bad, T_ILLEGAL, "vectory:", false, 0, relocInfo::none }, // VectorY @@ -114457,9 +115765,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #elif defined(PPC64) { Bad, T_ILLEGAL, "vectors:", false, 0, relocInfo::none }, // VectorS { Bad, T_ILLEGAL, "vectord:", false, Op_RegL, relocInfo::none }, // VectorD -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/prims/jniCheck.cpp b/hotspot/src/share/vm/prims/jniCheck.cpp ---- a/hotspot/src/share/vm/prims/jniCheck.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/prims/jniCheck.cpp 2023-12-20 09:23:20.028145243 +0800 +diff --git a/hotspot/src/share/vm/prims/jniCheck.cpp b/hotspot/src/share/vm/prims/jniCheck.cpp +index 593ca8a1..82813b71 100644 +--- a/hotspot/src/share/vm/prims/jniCheck.cpp ++++ b/hotspot/src/share/vm/prims/jniCheck.cpp @@ -22,6 +22,12 @@ * */ @@ -114486,9 +115795,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp // Complain every extra number of unplanned local refs #define CHECK_JNI_LOCAL_REF_CAP_WARN_THRESHOLD 32 -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/prims/jni_md.h b/hotspot/src/share/vm/prims/jni_md.h ---- a/hotspot/src/share/vm/prims/jni_md.h 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/prims/jni_md.h 2023-12-20 09:23:20.028145243 +0800 +diff --git a/hotspot/src/share/vm/prims/jni_md.h b/hotspot/src/share/vm/prims/jni_md.h +index 6209a664..271715d4 100644 +--- a/hotspot/src/share/vm/prims/jni_md.h ++++ b/hotspot/src/share/vm/prims/jni_md.h @@ -22,6 +22,12 @@ * or visit www.oracle.com if you need additional information or have any * questions. @@ -114515,9 +115825,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp /* -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp b/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp ---- a/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp 2023-12-20 09:23:20.031478538 +0800 +diff --git a/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp b/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp +index ab31d0d9..0d8570b7 100644 +--- a/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp ++++ b/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp @@ -22,6 +22,12 @@ * */ @@ -114544,9 +115855,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp // FIXME: add Deprecated attribute // FIXME: fix Synthetic attribute // FIXME: per Serguei, add error return handling for ConstantPool::copy_cpool_bytes() -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/prims/methodHandles.hpp b/hotspot/src/share/vm/prims/methodHandles.hpp ---- a/hotspot/src/share/vm/prims/methodHandles.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/prims/methodHandles.hpp 2023-12-20 09:23:20.034811834 +0800 +diff --git a/hotspot/src/share/vm/prims/methodHandles.hpp b/hotspot/src/share/vm/prims/methodHandles.hpp +index db6e0618..84108285 100644 +--- a/hotspot/src/share/vm/prims/methodHandles.hpp ++++ b/hotspot/src/share/vm/prims/methodHandles.hpp @@ -22,6 +22,12 @@ * */ @@ -114560,7 +115872,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifndef SHARE_VM_PRIMS_METHODHANDLES_HPP #define SHARE_VM_PRIMS_METHODHANDLES_HPP -@@ -198,6 +204,13 @@ +@@ -198,6 +204,13 @@ public: #ifdef TARGET_ARCH_ppc # include "methodHandles_ppc.hpp" #endif @@ -114574,9 +115886,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp // Tracing static void trace_method_handle(MacroAssembler* _masm, const char* adaptername) PRODUCT_RETURN; -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/runtime/atomic.inline.hpp b/hotspot/src/share/vm/runtime/atomic.inline.hpp ---- a/hotspot/src/share/vm/runtime/atomic.inline.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/runtime/atomic.inline.hpp 2023-12-20 09:23:20.038145129 +0800 +diff --git a/hotspot/src/share/vm/runtime/atomic.inline.hpp b/hotspot/src/share/vm/runtime/atomic.inline.hpp +index 222f29cb..7c7c6edb 100644 +--- a/hotspot/src/share/vm/runtime/atomic.inline.hpp ++++ b/hotspot/src/share/vm/runtime/atomic.inline.hpp @@ -22,6 +22,12 @@ * */ @@ -114603,9 +115916,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_OS_ARCH_linux_sparc # include "atomic_linux_sparc.inline.hpp" #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/runtime/deoptimization.cpp b/hotspot/src/share/vm/runtime/deoptimization.cpp ---- a/hotspot/src/share/vm/runtime/deoptimization.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/runtime/deoptimization.cpp 2023-12-20 09:23:20.038145129 +0800 +diff --git a/hotspot/src/share/vm/runtime/deoptimization.cpp b/hotspot/src/share/vm/runtime/deoptimization.cpp +index f91afdc4..36a924fd 100644 +--- a/hotspot/src/share/vm/runtime/deoptimization.cpp ++++ b/hotspot/src/share/vm/runtime/deoptimization.cpp @@ -22,6 +22,12 @@ * */ @@ -114645,9 +115959,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #endif // COMPILER2 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/runtime/dtraceJSDT.hpp b/hotspot/src/share/vm/runtime/dtraceJSDT.hpp ---- a/hotspot/src/share/vm/runtime/dtraceJSDT.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/runtime/dtraceJSDT.hpp 2023-12-20 09:23:20.038145129 +0800 +diff --git a/hotspot/src/share/vm/runtime/dtraceJSDT.hpp b/hotspot/src/share/vm/runtime/dtraceJSDT.hpp +index db568def..490c5f5a 100644 +--- a/hotspot/src/share/vm/runtime/dtraceJSDT.hpp ++++ b/hotspot/src/share/vm/runtime/dtraceJSDT.hpp @@ -22,6 +22,12 @@ * */ @@ -114674,9 +115989,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp class RegisteredProbes; typedef jlong OpaqueProbes; -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/runtime/frame.cpp b/hotspot/src/share/vm/runtime/frame.cpp ---- a/hotspot/src/share/vm/runtime/frame.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/runtime/frame.cpp 2023-12-20 09:23:20.041478424 +0800 +diff --git a/hotspot/src/share/vm/runtime/frame.cpp b/hotspot/src/share/vm/runtime/frame.cpp +index 338b7ad3..5a161133 100644 +--- a/hotspot/src/share/vm/runtime/frame.cpp ++++ b/hotspot/src/share/vm/runtime/frame.cpp @@ -22,6 +22,12 @@ * */ @@ -114704,9 +116020,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/runtime/frame.hpp b/hotspot/src/share/vm/runtime/frame.hpp ---- a/hotspot/src/share/vm/runtime/frame.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/runtime/frame.hpp 2023-12-20 09:23:20.041478424 +0800 +diff --git a/hotspot/src/share/vm/runtime/frame.hpp b/hotspot/src/share/vm/runtime/frame.hpp +index 2d80ecc2..4a9e6edb 100644 +--- a/hotspot/src/share/vm/runtime/frame.hpp ++++ b/hotspot/src/share/vm/runtime/frame.hpp @@ -22,6 +22,12 @@ * */ @@ -114731,7 +116048,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #endif #endif // COMPILER2 #ifdef TARGET_ARCH_zero -@@ -489,6 +499,12 @@ +@@ -489,6 +499,12 @@ class frame VALUE_OBJ_CLASS_SPEC { #ifdef TARGET_ARCH_x86 # include "frame_x86.hpp" #endif @@ -114744,9 +116061,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_ARCH_aarch64 # include "frame_aarch64.hpp" #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/runtime/frame.inline.hpp b/hotspot/src/share/vm/runtime/frame.inline.hpp ---- a/hotspot/src/share/vm/runtime/frame.inline.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/runtime/frame.inline.hpp 2023-12-20 09:23:20.041478424 +0800 +diff --git a/hotspot/src/share/vm/runtime/frame.inline.hpp b/hotspot/src/share/vm/runtime/frame.inline.hpp +index 710b8230..704cc8df 100644 +--- a/hotspot/src/share/vm/runtime/frame.inline.hpp ++++ b/hotspot/src/share/vm/runtime/frame.inline.hpp @@ -22,6 +22,12 @@ * */ @@ -114773,7 +116091,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_ARCH_zero # include "entryFrame_zero.hpp" # include "fakeStubFrame_zero.hpp" -@@ -115,6 +127,12 @@ +@@ -115,6 +127,12 @@ inline oop* frame::interpreter_frame_temp_oop_addr() const { #ifdef TARGET_ARCH_ppc # include "frame_ppc.inline.hpp" #endif @@ -114786,9 +116104,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #endif // SHARE_VM_RUNTIME_FRAME_INLINE_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/runtime/globals.hpp b/hotspot/src/share/vm/runtime/globals.hpp ---- a/hotspot/src/share/vm/runtime/globals.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/runtime/globals.hpp 2023-12-20 09:23:20.041478424 +0800 +diff --git a/hotspot/src/share/vm/runtime/globals.hpp b/hotspot/src/share/vm/runtime/globals.hpp +index 23ce8af5..f36137aa 100644 +--- a/hotspot/src/share/vm/runtime/globals.hpp ++++ b/hotspot/src/share/vm/runtime/globals.hpp @@ -55,6 +55,12 @@ #ifdef TARGET_ARCH_ppc # include "globals_ppc.hpp" @@ -114841,7 +116160,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_ARCH_arm # include "c2_globals_arm.hpp" #endif -@@ -3209,7 +3233,7 @@ +@@ -3209,7 +3233,7 @@ class CommandLineFlags { product(uintx, InitialHeapSize, 0, \ "Initial heap size (in bytes); zero means use ergonomics") \ \ @@ -114850,9 +116169,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp "Maximum heap size (in bytes)") \ \ product(uintx, OldSize, ScaleForWordSize(4*M), \ -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/runtime/icache.hpp b/hotspot/src/share/vm/runtime/icache.hpp ---- a/hotspot/src/share/vm/runtime/icache.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/runtime/icache.hpp 2023-12-20 09:23:20.041478424 +0800 +diff --git a/hotspot/src/share/vm/runtime/icache.hpp b/hotspot/src/share/vm/runtime/icache.hpp +index ba81a06f..9c0cfdb7 100644 +--- a/hotspot/src/share/vm/runtime/icache.hpp ++++ b/hotspot/src/share/vm/runtime/icache.hpp @@ -22,6 +22,12 @@ * */ @@ -114866,7 +116186,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifndef SHARE_VM_RUNTIME_ICACHE_HPP #define SHARE_VM_RUNTIME_ICACHE_HPP -@@ -86,7 +92,12 @@ +@@ -86,7 +92,12 @@ class AbstractICache : AllStatic { #ifdef TARGET_ARCH_ppc # include "icache_ppc.hpp" #endif @@ -114880,9 +116200,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp class ICacheStubGenerator : public StubCodeGenerator { -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/runtime/javaCalls.hpp b/hotspot/src/share/vm/runtime/javaCalls.hpp ---- a/hotspot/src/share/vm/runtime/javaCalls.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/runtime/javaCalls.hpp 2023-12-20 09:23:20.041478424 +0800 +diff --git a/hotspot/src/share/vm/runtime/java.cpp b/hotspot/src/share/vm/runtime/java.cpp +index 0a263b01..9ba0deca 100644 +--- a/hotspot/src/share/vm/runtime/java.cpp ++++ b/hotspot/src/share/vm/runtime/java.cpp @@ -22,6 +22,12 @@ * */ @@ -114893,26 +116214,27 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + * available on the same license terms set forth above. + */ + - #ifndef SHARE_VM_RUNTIME_JAVACALLS_HPP - #define SHARE_VM_RUNTIME_JAVACALLS_HPP - -@@ -49,6 +55,12 @@ + #include "precompiled.hpp" + #include "classfile/classLoader.hpp" + #include "classfile/symbolTable.hpp" +@@ -84,6 +90,12 @@ #ifdef TARGET_ARCH_ppc - # include "jniTypes_ppc.hpp" + # include "vm_version_ppc.hpp" #endif +#ifdef TARGET_ARCH_mips -+# include "jniTypes_mips.hpp" ++# include "vm_version_mips.hpp" +#endif +#ifdef TARGET_ARCH_loongarch -+# include "jniTypes_loongarch.hpp" ++# include "vm_version_loongarch.hpp" +#endif - - // A JavaCallWrapper is constructed before each JavaCall and destructed after the call. - // Its purpose is to allocate/deallocate a new handle block and to save/restore the last -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/runtime/java.cpp b/hotspot/src/share/vm/runtime/java.cpp ---- a/hotspot/src/share/vm/runtime/java.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/runtime/java.cpp 2023-12-20 09:23:20.041478424 +0800 -@@ -22,6 +22,13 @@ + #if INCLUDE_ALL_GCS + #include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp" + #include "gc_implementation/parallelScavenge/psScavenge.hpp" +diff --git a/hotspot/src/share/vm/runtime/javaCalls.hpp b/hotspot/src/share/vm/runtime/javaCalls.hpp +index 6126bbe7..1747e2b2 100644 +--- a/hotspot/src/share/vm/runtime/javaCalls.hpp ++++ b/hotspot/src/share/vm/runtime/javaCalls.hpp +@@ -22,6 +22,12 @@ * */ @@ -114922,26 +116244,26 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + * available on the same license terms set forth above. + */ + -+ - #include "precompiled.hpp" - #include "cds/dynamicArchive.hpp" - #include "classfile/classLoader.hpp" -@@ -87,6 +94,12 @@ + #ifndef SHARE_VM_RUNTIME_JAVACALLS_HPP + #define SHARE_VM_RUNTIME_JAVACALLS_HPP + +@@ -49,6 +55,12 @@ #ifdef TARGET_ARCH_ppc - # include "vm_version_ppc.hpp" + # include "jniTypes_ppc.hpp" #endif +#ifdef TARGET_ARCH_mips -+# include "vm_version_mips.hpp" ++# include "jniTypes_mips.hpp" +#endif +#ifdef TARGET_ARCH_loongarch -+# include "vm_version_loongarch.hpp" ++# include "jniTypes_loongarch.hpp" +#endif - #if INCLUDE_ALL_GCS - #include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp" - #include "gc_implementation/parallelScavenge/psScavenge.hpp" -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/runtime/javaFrameAnchor.hpp b/hotspot/src/share/vm/runtime/javaFrameAnchor.hpp ---- a/hotspot/src/share/vm/runtime/javaFrameAnchor.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/runtime/javaFrameAnchor.hpp 2023-12-20 09:23:20.044811719 +0800 + + // A JavaCallWrapper is constructed before each JavaCall and destructed after the call. + // Its purpose is to allocate/deallocate a new handle block and to save/restore the last +diff --git a/hotspot/src/share/vm/runtime/javaFrameAnchor.hpp b/hotspot/src/share/vm/runtime/javaFrameAnchor.hpp +index 129a01e2..c2b1b2e6 100644 +--- a/hotspot/src/share/vm/runtime/javaFrameAnchor.hpp ++++ b/hotspot/src/share/vm/runtime/javaFrameAnchor.hpp @@ -22,6 +22,12 @@ * */ @@ -114955,7 +116277,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifndef SHARE_VM_RUNTIME_JAVAFRAMEANCHOR_HPP #define SHARE_VM_RUNTIME_JAVAFRAMEANCHOR_HPP -@@ -80,6 +86,12 @@ +@@ -80,6 +86,12 @@ friend class JavaCallWrapper; #ifdef TARGET_ARCH_x86 # include "javaFrameAnchor_x86.hpp" #endif @@ -114968,10 +116290,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_ARCH_aarch64 # include "javaFrameAnchor_aarch64.hpp" #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/runtime/os.cpp b/hotspot/src/share/vm/runtime/os.cpp ---- a/hotspot/src/share/vm/runtime/os.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/runtime/os.cpp 2023-12-20 09:23:20.044811719 +0800 -@@ -1122,7 +1122,8 @@ +diff --git a/hotspot/src/share/vm/runtime/os.cpp b/hotspot/src/share/vm/runtime/os.cpp +index 96eed036..28c78409 100644 +--- a/hotspot/src/share/vm/runtime/os.cpp ++++ b/hotspot/src/share/vm/runtime/os.cpp +@@ -1122,7 +1122,8 @@ bool os::is_first_C_frame(frame* fr) { uintptr_t old_fp = (uintptr_t)fr->link(); if ((old_fp & fp_align_mask) != 0) return true; @@ -114981,9 +116304,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp // stack grows downwards; if old_fp is below current fp or if the stack // frame is too large, either the stack is corrupted or fp is not saved -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/runtime/os.hpp b/hotspot/src/share/vm/runtime/os.hpp ---- a/hotspot/src/share/vm/runtime/os.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/runtime/os.hpp 2023-12-20 09:23:20.044811719 +0800 +diff --git a/hotspot/src/share/vm/runtime/os.hpp b/hotspot/src/share/vm/runtime/os.hpp +index 836c231b..0ca6e645 100644 +--- a/hotspot/src/share/vm/runtime/os.hpp ++++ b/hotspot/src/share/vm/runtime/os.hpp @@ -22,6 +22,12 @@ * */ @@ -114997,7 +116321,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifndef SHARE_VM_RUNTIME_OS_HPP #define SHARE_VM_RUNTIME_OS_HPP -@@ -857,6 +863,12 @@ +@@ -857,6 +863,12 @@ class os: AllStatic { #ifdef TARGET_OS_ARCH_linux_x86 # include "os_linux_x86.hpp" #endif @@ -115010,9 +116334,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_OS_ARCH_linux_aarch64 # include "os_linux_aarch64.hpp" #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/runtime/prefetch.inline.hpp b/hotspot/src/share/vm/runtime/prefetch.inline.hpp ---- a/hotspot/src/share/vm/runtime/prefetch.inline.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/runtime/prefetch.inline.hpp 2023-12-20 09:23:20.048145015 +0800 +diff --git a/hotspot/src/share/vm/runtime/prefetch.inline.hpp b/hotspot/src/share/vm/runtime/prefetch.inline.hpp +index f4e30de3..fec16f84 100644 +--- a/hotspot/src/share/vm/runtime/prefetch.inline.hpp ++++ b/hotspot/src/share/vm/runtime/prefetch.inline.hpp @@ -46,6 +46,12 @@ #ifdef TARGET_OS_ARCH_linux_ppc # include "prefetch_linux_ppc.inline.hpp" @@ -115026,9 +116351,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp // Solaris #ifdef TARGET_OS_ARCH_solaris_x86 -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/runtime/registerMap.hpp b/hotspot/src/share/vm/runtime/registerMap.hpp ---- a/hotspot/src/share/vm/runtime/registerMap.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/runtime/registerMap.hpp 2023-12-20 09:23:20.048145015 +0800 +diff --git a/hotspot/src/share/vm/runtime/registerMap.hpp b/hotspot/src/share/vm/runtime/registerMap.hpp +index 67ef212d..1e26dfcb 100644 +--- a/hotspot/src/share/vm/runtime/registerMap.hpp ++++ b/hotspot/src/share/vm/runtime/registerMap.hpp @@ -22,6 +22,12 @@ * */ @@ -115055,7 +116381,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp class JavaThread; -@@ -156,6 +168,12 @@ +@@ -156,6 +168,12 @@ class RegisterMap : public StackObj { #ifdef TARGET_ARCH_ppc # include "registerMap_ppc.hpp" #endif @@ -115068,9 +116394,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp }; -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/runtime/relocator.hpp b/hotspot/src/share/vm/runtime/relocator.hpp ---- a/hotspot/src/share/vm/runtime/relocator.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/runtime/relocator.hpp 2023-12-20 09:23:20.048145015 +0800 +diff --git a/hotspot/src/share/vm/runtime/relocator.hpp b/hotspot/src/share/vm/runtime/relocator.hpp +index bb19c75f..53f3c9f6 100644 +--- a/hotspot/src/share/vm/runtime/relocator.hpp ++++ b/hotspot/src/share/vm/runtime/relocator.hpp @@ -22,6 +22,12 @@ * */ @@ -115097,9 +116424,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp // This code has been converted from the 1.1E java virtual machine // Thanks to the JavaTopics group for using the code -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/runtime/safepoint.cpp b/hotspot/src/share/vm/runtime/safepoint.cpp ---- a/hotspot/src/share/vm/runtime/safepoint.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/runtime/safepoint.cpp 2023-12-20 09:23:20.048145015 +0800 +diff --git a/hotspot/src/share/vm/runtime/safepoint.cpp b/hotspot/src/share/vm/runtime/safepoint.cpp +index 440617c8..be0e4dd1 100644 +--- a/hotspot/src/share/vm/runtime/safepoint.cpp ++++ b/hotspot/src/share/vm/runtime/safepoint.cpp @@ -22,6 +22,12 @@ * */ @@ -115128,9 +116456,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #if INCLUDE_ALL_GCS #include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp" #include "gc_implementation/shared/suspendibleThreadSet.hpp" -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/runtime/sharedRuntime.cpp b/hotspot/src/share/vm/runtime/sharedRuntime.cpp ---- a/hotspot/src/share/vm/runtime/sharedRuntime.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/runtime/sharedRuntime.cpp 2023-12-20 09:23:20.048145015 +0800 +diff --git a/hotspot/src/share/vm/runtime/sharedRuntime.cpp b/hotspot/src/share/vm/runtime/sharedRuntime.cpp +index 5f540247..abcd6066 100644 +--- a/hotspot/src/share/vm/runtime/sharedRuntime.cpp ++++ b/hotspot/src/share/vm/runtime/sharedRuntime.cpp @@ -22,6 +22,12 @@ * */ @@ -115160,7 +116489,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef COMPILER1 #include "c1/c1_Runtime1.hpp" #endif -@@ -220,7 +235,6 @@ +@@ -220,7 +235,6 @@ void SharedRuntime::print_ic_miss_histogram() { } } #endif // PRODUCT @@ -115168,9 +116497,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #if INCLUDE_ALL_GCS // G1 write-barrier pre: executed before a pointer store. -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/runtime/sharedRuntimeTrig.cpp b/hotspot/src/share/vm/runtime/sharedRuntimeTrig.cpp ---- a/hotspot/src/share/vm/runtime/sharedRuntimeTrig.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/runtime/sharedRuntimeTrig.cpp 2023-12-20 09:23:20.048145015 +0800 +diff --git a/hotspot/src/share/vm/runtime/sharedRuntimeTrig.cpp b/hotspot/src/share/vm/runtime/sharedRuntimeTrig.cpp +index 37880d8a..3987880b 100644 +--- a/hotspot/src/share/vm/runtime/sharedRuntimeTrig.cpp ++++ b/hotspot/src/share/vm/runtime/sharedRuntimeTrig.cpp @@ -22,6 +22,12 @@ * */ @@ -115184,7 +116514,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #include "precompiled.hpp" #include "prims/jni.h" #include "runtime/interfaceSupport.hpp" -@@ -534,6 +540,15 @@ +@@ -534,6 +540,15 @@ static SAFEBUF int __ieee754_rem_pio2(double x, double *y) { * then 3 2 * sin(x) = x + (S1*x + (x *(r-y/2)+y)) */ @@ -115200,9 +116530,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp static const double S1 = -1.66666666666666324348e-01, /* 0xBFC55555, 0x55555549 */ -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/runtime/stackValueCollection.cpp b/hotspot/src/share/vm/runtime/stackValueCollection.cpp ---- a/hotspot/src/share/vm/runtime/stackValueCollection.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/runtime/stackValueCollection.cpp 2023-12-20 09:23:20.048145015 +0800 +diff --git a/hotspot/src/share/vm/runtime/stackValueCollection.cpp b/hotspot/src/share/vm/runtime/stackValueCollection.cpp +index 87747683..fe81c1bf 100644 +--- a/hotspot/src/share/vm/runtime/stackValueCollection.cpp ++++ b/hotspot/src/share/vm/runtime/stackValueCollection.cpp @@ -22,6 +22,12 @@ * */ @@ -115229,9 +116560,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/runtime/statSampler.cpp b/hotspot/src/share/vm/runtime/statSampler.cpp ---- a/hotspot/src/share/vm/runtime/statSampler.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/runtime/statSampler.cpp 2023-12-20 09:23:20.048145015 +0800 +diff --git a/hotspot/src/share/vm/runtime/statSampler.cpp b/hotspot/src/share/vm/runtime/statSampler.cpp +index 41f46962..3b430890 100644 +--- a/hotspot/src/share/vm/runtime/statSampler.cpp ++++ b/hotspot/src/share/vm/runtime/statSampler.cpp @@ -22,6 +22,12 @@ * */ @@ -115258,9 +116590,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp // -------------------------------------------------------- // StatSamplerTask -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/runtime/stubRoutines.hpp b/hotspot/src/share/vm/runtime/stubRoutines.hpp ---- a/hotspot/src/share/vm/runtime/stubRoutines.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/runtime/stubRoutines.hpp 2023-12-20 09:23:20.048145015 +0800 +diff --git a/hotspot/src/share/vm/runtime/stubRoutines.hpp b/hotspot/src/share/vm/runtime/stubRoutines.hpp +index e18b9127..9bf93376 100644 +--- a/hotspot/src/share/vm/runtime/stubRoutines.hpp ++++ b/hotspot/src/share/vm/runtime/stubRoutines.hpp @@ -22,6 +22,12 @@ * */ @@ -115287,7 +116620,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp // StubRoutines provides entry points to assembly routines used by // compiled code and the run-time system. Platform-specific entry -@@ -116,6 +128,10 @@ +@@ -116,6 +128,10 @@ class StubRoutines: AllStatic { # include "stubRoutines_zero.hpp" #elif defined TARGET_ARCH_MODEL_ppc_64 # include "stubRoutines_ppc_64.hpp" @@ -115298,9 +116631,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #endif static jint _verify_oop_count; -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/runtime/thread.cpp b/hotspot/src/share/vm/runtime/thread.cpp ---- a/hotspot/src/share/vm/runtime/thread.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/runtime/thread.cpp 2023-12-20 09:23:20.051478310 +0800 +diff --git a/hotspot/src/share/vm/runtime/thread.cpp b/hotspot/src/share/vm/runtime/thread.cpp +index e6586c40..3db678ff 100644 +--- a/hotspot/src/share/vm/runtime/thread.cpp ++++ b/hotspot/src/share/vm/runtime/thread.cpp @@ -22,6 +22,12 @@ * */ @@ -115312,11 +116646,12 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + */ + #include "precompiled.hpp" - #include "cds/dynamicArchive.hpp" #include "classfile/classLoader.hpp" -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/runtime/thread.hpp b/hotspot/src/share/vm/runtime/thread.hpp ---- a/hotspot/src/share/vm/runtime/thread.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/runtime/thread.hpp 2023-12-20 09:23:20.051478310 +0800 + #include "classfile/javaClasses.hpp" +diff --git a/hotspot/src/share/vm/runtime/thread.hpp b/hotspot/src/share/vm/runtime/thread.hpp +index 1c19ab72..aa69217e 100644 +--- a/hotspot/src/share/vm/runtime/thread.hpp ++++ b/hotspot/src/share/vm/runtime/thread.hpp @@ -22,6 +22,12 @@ * */ @@ -115330,7 +116665,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifndef SHARE_VM_RUNTIME_THREAD_HPP #define SHARE_VM_RUNTIME_THREAD_HPP -@@ -1711,6 +1717,12 @@ +@@ -1711,6 +1717,12 @@ public: #ifdef TARGET_OS_ARCH_linux_x86 # include "thread_linux_x86.hpp" #endif @@ -115343,9 +116678,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_OS_ARCH_linux_aarch64 # include "thread_linux_aarch64.hpp" #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/runtime/threadLocalStorage.hpp b/hotspot/src/share/vm/runtime/threadLocalStorage.hpp ---- a/hotspot/src/share/vm/runtime/threadLocalStorage.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/runtime/threadLocalStorage.hpp 2023-12-20 09:23:20.051478310 +0800 +diff --git a/hotspot/src/share/vm/runtime/threadLocalStorage.hpp b/hotspot/src/share/vm/runtime/threadLocalStorage.hpp +index 58c1afc8..0938b2ed 100644 +--- a/hotspot/src/share/vm/runtime/threadLocalStorage.hpp ++++ b/hotspot/src/share/vm/runtime/threadLocalStorage.hpp @@ -22,6 +22,12 @@ * */ @@ -115359,7 +116695,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifndef SHARE_VM_RUNTIME_THREADLOCALSTORAGE_HPP #define SHARE_VM_RUNTIME_THREADLOCALSTORAGE_HPP -@@ -51,6 +57,12 @@ +@@ -51,6 +57,12 @@ class ThreadLocalStorage : AllStatic { #ifdef TARGET_OS_ARCH_linux_x86 # include "threadLS_linux_x86.hpp" #endif @@ -115372,9 +116708,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_OS_ARCH_linux_aarch64 # include "threadLS_linux_aarch64.hpp" #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/runtime/virtualspace.cpp b/hotspot/src/share/vm/runtime/virtualspace.cpp ---- a/hotspot/src/share/vm/runtime/virtualspace.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/runtime/virtualspace.cpp 2023-12-20 09:23:20.051478310 +0800 +diff --git a/hotspot/src/share/vm/runtime/virtualspace.cpp b/hotspot/src/share/vm/runtime/virtualspace.cpp +index 66392b75..5ced38d8 100644 +--- a/hotspot/src/share/vm/runtime/virtualspace.cpp ++++ b/hotspot/src/share/vm/runtime/virtualspace.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. @@ -115382,7 +116719,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it -@@ -147,6 +148,15 @@ +@@ -147,6 +148,15 @@ void ReservedSpace::initialize(size_t size, size_t alignment, bool large, bool special = large && !os::can_commit_large_page_memory(); char* base = NULL; @@ -115398,7 +116735,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp if (requested_address != 0) { requested_address -= noaccess_prefix; // adjust requested address assert(requested_address != NULL, "huge noaccess prefix?"); -@@ -193,6 +203,12 @@ +@@ -193,6 +203,12 @@ void ReservedSpace::initialize(size_t size, size_t alignment, bool large, if (failed_to_reserve_as_requested(base, requested_address, size, false)) { // OS ignored requested address. Try different address. base = NULL; @@ -115411,9 +116748,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp } } else { base = os::reserve_memory(size, NULL, alignment); -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/runtime/vmStructs.cpp b/hotspot/src/share/vm/runtime/vmStructs.cpp ---- a/hotspot/src/share/vm/runtime/vmStructs.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/runtime/vmStructs.cpp 2023-12-20 09:23:20.054811605 +0800 +diff --git a/hotspot/src/share/vm/runtime/vmStructs.cpp b/hotspot/src/share/vm/runtime/vmStructs.cpp +index 32e3921b..c6cc4c43 100644 +--- a/hotspot/src/share/vm/runtime/vmStructs.cpp ++++ b/hotspot/src/share/vm/runtime/vmStructs.cpp @@ -22,6 +22,12 @@ * */ @@ -115425,9 +116763,9 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + */ + #include "precompiled.hpp" - #include "classfile/symbolTable.hpp" #include "classfile/dictionary.hpp" -@@ -124,6 +130,12 @@ + #include "classfile/javaClasses.hpp" +@@ -122,6 +128,12 @@ #ifdef TARGET_ARCH_ppc # include "vmStructs_ppc.hpp" #endif @@ -115440,7 +116778,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_OS_ARCH_linux_x86 # include "vmStructs_linux_x86.hpp" #endif -@@ -151,6 +163,12 @@ +@@ -149,6 +161,12 @@ #ifdef TARGET_OS_ARCH_linux_ppc # include "vmStructs_linux_ppc.hpp" #endif @@ -115453,7 +116791,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_OS_ARCH_aix_ppc # include "vmStructs_aix_ppc.hpp" #endif -@@ -210,6 +228,10 @@ +@@ -208,6 +226,10 @@ # include "adfiles/adGlobals_zero.hpp" #elif defined TARGET_ARCH_MODEL_ppc_64 # include "adfiles/adGlobals_ppc_64.hpp" @@ -115464,9 +116802,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #endif #endif // COMPILER2 -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/runtime/vm_version.cpp b/hotspot/src/share/vm/runtime/vm_version.cpp ---- a/hotspot/src/share/vm/runtime/vm_version.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/runtime/vm_version.cpp 2023-12-20 09:23:20.054811605 +0800 +diff --git a/hotspot/src/share/vm/runtime/vm_version.cpp b/hotspot/src/share/vm/runtime/vm_version.cpp +index 91f9c70f..d8dcfcfc 100644 +--- a/hotspot/src/share/vm/runtime/vm_version.cpp ++++ b/hotspot/src/share/vm/runtime/vm_version.cpp @@ -22,6 +22,12 @@ * */ @@ -115493,7 +116832,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp const char* Abstract_VM_Version::_s_vm_release = Abstract_VM_Version::vm_release(); const char* Abstract_VM_Version::_s_internal_vm_info_string = Abstract_VM_Version::internal_vm_info_string(); -@@ -193,6 +205,14 @@ +@@ -193,6 +205,14 @@ const char* Abstract_VM_Version::jre_release_version() { #else #define CPU "ppc64" #endif @@ -115508,9 +116847,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #else #define CPU IA32_ONLY("x86") \ IA64_ONLY("ia64") \ -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/utilities/copy.hpp b/hotspot/src/share/vm/utilities/copy.hpp ---- a/hotspot/src/share/vm/utilities/copy.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/utilities/copy.hpp 2024-01-30 13:54:24.896041236 +0800 +diff --git a/hotspot/src/share/vm/utilities/copy.hpp b/hotspot/src/share/vm/utilities/copy.hpp +index c1d82c70..73b858b8 100644 +--- a/hotspot/src/share/vm/utilities/copy.hpp ++++ b/hotspot/src/share/vm/utilities/copy.hpp @@ -22,6 +22,12 @@ * */ @@ -115524,7 +116864,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifndef SHARE_VM_UTILITIES_COPY_HPP #define SHARE_VM_UTILITIES_COPY_HPP -@@ -350,6 +356,13 @@ +@@ -350,6 +356,13 @@ class Copy : AllStatic { #ifdef TARGET_ARCH_ppc # include "copy_ppc.hpp" #endif @@ -115538,10 +116878,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp }; -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/utilities/debug.cpp b/hotspot/src/share/vm/utilities/debug.cpp ---- a/hotspot/src/share/vm/utilities/debug.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/utilities/debug.cpp 2023-12-20 09:23:20.061478196 +0800 -@@ -690,6 +690,7 @@ +diff --git a/hotspot/src/share/vm/utilities/debug.cpp b/hotspot/src/share/vm/utilities/debug.cpp +index 58a32a2b..1026585f 100644 +--- a/hotspot/src/share/vm/utilities/debug.cpp ++++ b/hotspot/src/share/vm/utilities/debug.cpp +@@ -690,6 +690,7 @@ void help() { tty->print_cr(" pns($sp, $ebp, $pc) on Linux/x86 or"); tty->print_cr(" pns($sp, $fp, $pc) on Linux/AArch64 or"); tty->print_cr(" pns($sp, 0, $pc) on Linux/ppc64 or"); @@ -115549,9 +116890,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp tty->print_cr(" pns($sp + 0x7ff, 0, $pc) on Solaris/SPARC"); tty->print_cr(" - in gdb do 'set overload-resolution off' before calling pns()"); tty->print_cr(" - in dbx do 'frame 1' before calling pns()"); -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/utilities/globalDefinitions.hpp b/hotspot/src/share/vm/utilities/globalDefinitions.hpp ---- a/hotspot/src/share/vm/utilities/globalDefinitions.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/utilities/globalDefinitions.hpp 2023-12-20 09:23:20.064811491 +0800 +diff --git a/hotspot/src/share/vm/utilities/globalDefinitions.hpp b/hotspot/src/share/vm/utilities/globalDefinitions.hpp +index 81866b84..61fc0c48 100644 +--- a/hotspot/src/share/vm/utilities/globalDefinitions.hpp ++++ b/hotspot/src/share/vm/utilities/globalDefinitions.hpp @@ -22,6 +22,12 @@ * */ @@ -115565,7 +116907,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifndef SHARE_VM_UTILITIES_GLOBALDEFINITIONS_HPP #define SHARE_VM_UTILITIES_GLOBALDEFINITIONS_HPP -@@ -455,6 +461,12 @@ +@@ -455,6 +461,12 @@ enum RTMState { #ifdef TARGET_ARCH_ppc # include "globalDefinitions_ppc.hpp" #endif @@ -115578,9 +116920,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp /* * If a platform does not support native stack walking -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/utilities/macros.hpp b/hotspot/src/share/vm/utilities/macros.hpp ---- a/hotspot/src/share/vm/utilities/macros.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/utilities/macros.hpp 2023-12-20 09:23:20.064811491 +0800 +diff --git a/hotspot/src/share/vm/utilities/macros.hpp b/hotspot/src/share/vm/utilities/macros.hpp +index 599e1074..41ef06e2 100644 +--- a/hotspot/src/share/vm/utilities/macros.hpp ++++ b/hotspot/src/share/vm/utilities/macros.hpp @@ -22,6 +22,12 @@ * */ @@ -115625,10 +116968,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #if defined(PPC32) || defined(PPC64) #ifndef PPC #define PPC -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/utilities/taskqueue.hpp b/hotspot/src/share/vm/utilities/taskqueue.hpp ---- a/hotspot/src/share/vm/utilities/taskqueue.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/utilities/taskqueue.hpp 2023-12-20 09:23:20.068144786 +0800 -@@ -121,11 +121,22 @@ +diff --git a/hotspot/src/share/vm/utilities/taskqueue.hpp b/hotspot/src/share/vm/utilities/taskqueue.hpp +index bc06cacc..46be35a3 100644 +--- a/hotspot/src/share/vm/utilities/taskqueue.hpp ++++ b/hotspot/src/share/vm/utilities/taskqueue.hpp +@@ -121,11 +121,22 @@ protected: Age(const Age& age) { _data = age._data; } Age(idx_t top, idx_t tag) { _fields._top = top; _fields._tag = tag; } @@ -115651,7 +116995,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp // Increment top; if it wraps, increment tag also. void increment() { -@@ -195,23 +206,50 @@ +@@ -195,23 +206,50 @@ protected: public: TaskQueueSuper() : _bottom(0), _age() {} @@ -115703,7 +117047,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp _age.set(0); } -@@ -263,7 +301,9 @@ +@@ -263,7 +301,9 @@ protected: typedef typename TaskQueueSuper::Age Age; typedef typename TaskQueueSuper::idx_t idx_t; @@ -115713,7 +117057,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp using TaskQueueSuper::_age; using TaskQueueSuper::increment_index; using TaskQueueSuper::decrement_index; -@@ -327,7 +367,11 @@ +@@ -327,7 +367,11 @@ template void GenericTaskQueue::oops_do(OopClosure* f) { // tty->print_cr("START OopTaskQueue::oops_do"); uint iters = size(); @@ -115725,7 +117069,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp for (uint i = 0; i < iters; ++i) { index = decrement_index(index); // tty->print_cr(" doing entry %d," INTPTR_T " -> " INTPTR_T, -@@ -345,14 +389,22 @@ +@@ -345,14 +389,22 @@ template bool GenericTaskQueue::push_slow(E t, uint dirty_n_elems) { if (dirty_n_elems == N - 1) { // Actually means 0, so do the push. @@ -115748,7 +117092,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp TASKQUEUE_STATS_ONLY(stats.record_push()); return true; } -@@ -407,7 +459,11 @@ +@@ -407,7 +459,11 @@ bool GenericTaskQueue::pop_global(volatile E& t) { #if !(defined SPARC || defined IA32 || defined AMD64) OrderAccess::fence(); #endif @@ -115760,7 +117104,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp uint n_elems = size(localBot, oldAge.top()); if (n_elems == 0) { return false; -@@ -662,7 +718,11 @@ +@@ -662,7 +718,11 @@ public: template inline bool GenericTaskQueue::push(E t) { @@ -115772,7 +117116,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp assert(localBot < N, "_bottom out of range."); idx_t top = _age.top(); uint dirty_n_elems = dirty_size(localBot, top); -@@ -674,7 +734,11 @@ +@@ -674,7 +734,11 @@ GenericTaskQueue::push(E t) { // assignment. However, casting to E& means that we trigger an // unused-value warning. So, we cast the E& to void. (void) const_cast(_elems[localBot] = t); @@ -115784,7 +117128,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp TASKQUEUE_STATS_ONLY(stats.record_push()); return true; } else { -@@ -684,7 +748,11 @@ +@@ -684,7 +748,11 @@ GenericTaskQueue::push(E t) { template inline bool GenericTaskQueue::pop_local(volatile E& t) { @@ -115796,7 +117140,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp // This value cannot be N-1. That can only occur as a result of // the assignment to bottom in this method. If it does, this method // resets the size to 0 before the next call (which is sequential, -@@ -693,7 +761,11 @@ +@@ -693,7 +761,11 @@ GenericTaskQueue::pop_local(volatile E& t) { assert(dirty_n_elems != N - 1, "Shouldn't be possible..."); if (dirty_n_elems == 0) return false; localBot = decrement_index(localBot); @@ -115808,9 +117152,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp // This is necessary to prevent any read below from being reordered // before the store just above. OrderAccess::fence(); -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/utilities/vmError.cpp b/hotspot/src/share/vm/utilities/vmError.cpp ---- a/hotspot/src/share/vm/utilities/vmError.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/utilities/vmError.cpp 2023-12-20 09:23:20.068144786 +0800 +diff --git a/hotspot/src/share/vm/utilities/vmError.cpp b/hotspot/src/share/vm/utilities/vmError.cpp +index fa7a3250..7098a98a 100644 +--- a/hotspot/src/share/vm/utilities/vmError.cpp ++++ b/hotspot/src/share/vm/utilities/vmError.cpp @@ -22,6 +22,13 @@ * */ @@ -115825,7 +117170,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #include #include "precompiled.hpp" #include "compiler/compileBroker.hpp" -@@ -488,7 +495,12 @@ +@@ -488,7 +495,12 @@ void VMError::report(outputStream* st) { JDK_Version::runtime_name() : ""; const char* runtime_version = JDK_Version::runtime_version() != NULL ? JDK_Version::runtime_version() : ""; @@ -115839,9 +117184,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp st->print_cr("# Java VM: %s (%s %s %s %s)", Abstract_VM_Version::vm_name(), Abstract_VM_Version::vm_release(), -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/test/compiler/criticalnatives/argumentcorruption/Test8167409.sh b/hotspot/test/compiler/criticalnatives/argumentcorruption/Test8167409.sh ---- a/hotspot/test/compiler/criticalnatives/argumentcorruption/Test8167409.sh 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/test/compiler/criticalnatives/argumentcorruption/Test8167409.sh 2023-12-20 09:23:20.104811033 +0800 +diff --git a/hotspot/test/compiler/criticalnatives/argumentcorruption/Test8167409.sh b/hotspot/test/compiler/criticalnatives/argumentcorruption/Test8167409.sh +index fcf1d04b..5b8e7dcc 100644 +--- a/hotspot/test/compiler/criticalnatives/argumentcorruption/Test8167409.sh ++++ b/hotspot/test/compiler/criticalnatives/argumentcorruption/Test8167409.sh @@ -24,6 +24,12 @@ # questions. # @@ -115855,7 +117201,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp ## @test Test8167409.sh ## @bug 8167409 ## @summary Invalid value passed to critical JNI function -@@ -68,6 +74,18 @@ +@@ -68,6 +74,18 @@ if [ $VM_CPU = "aarch64" ]; then exit 0; fi @@ -115874,12 +117220,13 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp THIS_DIR=. cp ${TESTSRC}${FS}*.java ${THIS_DIR} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForOtherCPU.java b/hotspot/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForOtherCPU.java ---- a/hotspot/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForOtherCPU.java 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForOtherCPU.java 2023-12-20 09:23:20.114810919 +0800 -@@ -34,11 +34,12 @@ +diff --git a/hotspot/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForOtherCPU.java b/hotspot/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForOtherCPU.java +index fa9a6f20..885957cf 100644 +--- a/hotspot/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForOtherCPU.java ++++ b/hotspot/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForOtherCPU.java +@@ -34,11 +34,12 @@ import com.oracle.java.testlibrary.cli.predicate.OrPredicate; public class GenericTestCaseForOtherCPU extends - DigestOptionsBase.TestCase { + SHAOptionsBase.TestCase { public GenericTestCaseForOtherCPU(String optionName) { - // Execute the test case on any CPU except SPARC and X86 + // Execute the test case on any CPU except SPARC, LoongArch64 and X86 @@ -115892,10 +117239,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp } @Override -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/test/compiler/testlibrary/sha/predicate/IntrinsicPredicates.java b/hotspot/test/compiler/testlibrary/sha/predicate/IntrinsicPredicates.java ---- a/hotspot/test/compiler/testlibrary/sha/predicate/IntrinsicPredicates.java 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/test/compiler/testlibrary/sha/predicate/IntrinsicPredicates.java 2023-12-20 09:23:20.128144100 +0800 -@@ -62,18 +62,24 @@ +diff --git a/hotspot/test/compiler/testlibrary/sha/predicate/IntrinsicPredicates.java b/hotspot/test/compiler/testlibrary/sha/predicate/IntrinsicPredicates.java +index dc8c3984..2427b2bf 100644 +--- a/hotspot/test/compiler/testlibrary/sha/predicate/IntrinsicPredicates.java ++++ b/hotspot/test/compiler/testlibrary/sha/predicate/IntrinsicPredicates.java +@@ -62,18 +62,24 @@ public class IntrinsicPredicates { = new OrPredicate( new CPUSpecificPredicate("sparc.*", new String[] { "sha1" }, null), @@ -115922,10 +117270,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp public static final BooleanSupplier SHA512_INSTRUCTION_AVAILABLE = new OrPredicate( -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/test/runtime/6929067/Test6929067.sh b/hotspot/test/runtime/6929067/Test6929067.sh ---- a/hotspot/test/runtime/6929067/Test6929067.sh 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/test/runtime/6929067/Test6929067.sh 2023-12-20 09:23:20.144810575 +0800 -@@ -97,6 +97,10 @@ +diff --git a/hotspot/test/runtime/6929067/Test6929067.sh b/hotspot/test/runtime/6929067/Test6929067.sh +index 2bbb3401..1a5482e6 100644 +--- a/hotspot/test/runtime/6929067/Test6929067.sh ++++ b/hotspot/test/runtime/6929067/Test6929067.sh +@@ -97,6 +97,10 @@ case "$ARCH" in i686) ARCH=i386 ;; @@ -115936,21 +117285,32 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp # Assuming other ARCH values need no translation esac -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/test/runtime/Unsafe/RangeCheck.java b/hotspot/test/runtime/Unsafe/RangeCheck.java ---- a/hotspot/test/runtime/Unsafe/RangeCheck.java 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/test/runtime/Unsafe/RangeCheck.java 2023-12-20 09:23:20.154810460 +0800 -@@ -44,6 +44,7 @@ +diff --git a/hotspot/test/runtime/Unsafe/RangeCheck.java b/hotspot/test/runtime/Unsafe/RangeCheck.java +index 9ded944c..0c8bcfb9 100644 +--- a/hotspot/test/runtime/Unsafe/RangeCheck.java ++++ b/hotspot/test/runtime/Unsafe/RangeCheck.java +@@ -28,6 +28,8 @@ + * @library /testlibrary + */ + ++import org.jcp.xml.dsig.internal.dom.Utils; ++ + import com.oracle.java.testlibrary.*; + import sun.misc.Unsafe; + +@@ -43,6 +45,7 @@ public class RangeCheck { + true, "-Xmx32m", "-XX:-TransmitErrorReport", - "-XX:-CreateCoredumpOnCrash", + "-XX:-InlineUnsafeOps", // The compiler intrinsics doesn't have the assert DummyClassWithMainRangeCheck.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb.start()); -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/test/test_env.sh b/hotspot/test/test_env.sh ---- a/hotspot/test/test_env.sh 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/test/test_env.sh 2023-12-20 09:23:20.161477051 +0800 -@@ -211,6 +211,29 @@ +diff --git a/hotspot/test/test_env.sh b/hotspot/test/test_env.sh +index 5ba4f28c..d9d8bb6b 100644 +--- a/hotspot/test/test_env.sh ++++ b/hotspot/test/test_env.sh +@@ -211,6 +211,29 @@ if [ $? = 0 ] then VM_CPU="aarch64" fi @@ -115980,10 +117340,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp export VM_TYPE VM_BITS VM_OS VM_CPU echo "VM_TYPE=${VM_TYPE}" echo "VM_BITS=${VM_BITS}" -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/test/testlibrary/com/oracle/java/testlibrary/Platform.java b/hotspot/test/testlibrary/com/oracle/java/testlibrary/Platform.java ---- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/Platform.java 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/test/testlibrary/com/oracle/java/testlibrary/Platform.java 2023-12-20 09:23:20.164810346 +0800 -@@ -126,6 +126,10 @@ +diff --git a/hotspot/test/testlibrary/com/oracle/java/testlibrary/Platform.java b/hotspot/test/testlibrary/com/oracle/java/testlibrary/Platform.java +index 6a140793..56a6375b 100644 +--- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/Platform.java ++++ b/hotspot/test/testlibrary/com/oracle/java/testlibrary/Platform.java +@@ -126,6 +126,10 @@ public class Platform { return isArch("aarch64"); } @@ -115994,7 +117355,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp private static boolean isArch(String archnameRE) { return Pattern.compile(archnameRE, Pattern.CASE_INSENSITIVE) .matcher(osArch) -@@ -136,6 +140,10 @@ +@@ -136,6 +140,10 @@ public class Platform { return osArch; } @@ -116005,10 +117366,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp /** * Return a boolean for whether we expect to be able to attach * the SA to our own processes on this system. -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/test/testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java b/hotspot/test/testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java ---- a/hotspot/test/testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/test/testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java 2023-12-20 09:23:20.168143641 +0800 -@@ -43,7 +43,7 @@ +diff --git a/hotspot/test/testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java b/hotspot/test/testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java +index 7d56a4a3..41825e18 100644 +--- a/hotspot/test/testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java ++++ b/hotspot/test/testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java +@@ -43,7 +43,7 @@ import java.util.Set; */ public class TestMutuallyExclusivePlatformPredicates { private static enum MethodGroup { @@ -116017,9 +117379,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp BITNESS("is32bit", "is64bit"), OS("isAix", "isLinux", "isSolaris", "isWindows", "isOSX"), VM_TYPE("isClient", "isServer", "isGraal", "isMinimal"), -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/jdk/make/Images.gmk b/jdk/make/Images.gmk ---- a/jdk/make/Images.gmk 2024-01-11 09:53:23.000000000 +0800 -+++ b/jdk/make/Images.gmk 2023-12-20 09:23:20.618138492 +0800 +diff --git a/jdk/make/Images.gmk b/jdk/make/Images.gmk +index 991c0af7..91716856 100644 +--- a/jdk/make/Images.gmk ++++ b/jdk/make/Images.gmk @@ -23,6 +23,12 @@ # questions. # @@ -116033,7 +117396,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/jdk/m include $(SPEC) include MakeBase.gmk include JavaCompilation.gmk -@@ -650,6 +656,11 @@ +@@ -650,6 +656,11 @@ $(JDK_IMAGE_DIR)/src.zip: $(IMAGES_OUTPUTDIR)/src.zip $(ECHO) $(LOG_INFO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@) $(install-file) @@ -116045,10 +117408,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/jdk/m ################################################################################ # Post processing (strip etc) -@@ -729,6 +740,14 @@ +@@ -728,6 +739,14 @@ ifneq ($(POST_STRIP_CMD), ) + endif - ################################################################################ ++################################################################################ +# Loongson added list, architecture dependent files +ifeq ($(OPENJDK_TARGET_CPU), mips64) + ifeq ($(OPENJDK_TARGET_CPU_ENDIAN), little) @@ -116056,11 +117420,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/jdk/m + endif +endif + -+################################################################################ + ################################################################################ # Include the custom makefile right here, after all variables have been defined - # so that they may be overridden, but before the main targets are declared, so -@@ -753,6 +772,7 @@ +@@ -753,6 +772,7 @@ jdk-image: $(JDK_BIN_TARGETS) $(JDKJRE_BIN_TARGETS) \ $(JDKJRE_DOC_TARGETS) $(JDK_DOC_TARGETS) \ $(JDK_INFO_FILE) $(JDKJRE_STRIP_LIST) $(JDK_BIN_STRIP_LIST) \ $(JDK_IMAGE_DIR)/src.zip \ @@ -116068,9 +117431,48 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/jdk/m $(JDK_BIN_ISADIR_LINK_TARGETS) $(JDKJRE_BIN_ISADIR_LINK_TARGETS) jre-overlay-image: $(JRE_OVERLAY_BIN_TARGETS) $(JRE_OVERLAY_LIB_TARGETS) \ -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/jdk/make/lib/SoundLibraries.gmk b/jdk/make/lib/SoundLibraries.gmk ---- a/jdk/make/lib/SoundLibraries.gmk 2024-01-11 09:53:23.000000000 +0800 -+++ b/jdk/make/lib/SoundLibraries.gmk 2023-12-20 09:23:20.694804279 +0800 +diff --git a/jdk/make/gensrc/GensrcMisc.gmk b/jdk/make/gensrc/GensrcMisc.gmk +index 0e3dee5c..d428ac8c 100644 +--- a/jdk/make/gensrc/GensrcMisc.gmk ++++ b/jdk/make/gensrc/GensrcMisc.gmk +@@ -23,6 +23,12 @@ + # questions. + # + ++# ++# This file has been modified by Loongson Technology in 2018. These ++# modifications are Copyright (c) 2018, Loongson Technology, and are made ++# available on the same license terms set forth above. ++# ++ + include ProfileNames.gmk + + ################################################################################ +@@ -30,6 +36,11 @@ include ProfileNames.gmk + # string and the runtime name into the Version.java file. + # To be printed by java -version + ++company_name = ++ifneq ($(COMPANY_NAME),N/A) ++ company_name=($(COMPANY_NAME)) ++endif ++ + $(JDK_OUTPUTDIR)/gensrc/sun/misc/Version.java \ + $(PROFILE_VERSION_JAVA_TARGETS): \ + $(JDK_TOPDIR)/src/share/classes/sun/misc/Version.java.template +@@ -41,6 +52,8 @@ $(PROFILE_VERSION_JAVA_TARGETS): \ + -e 's/@@java_runtime_version@@/$(FULL_VERSION)/g' \ + -e 's/@@java_runtime_name@@/$(RUNTIME_NAME)/g' \ + -e 's/@@java_profile_name@@/$(call profile_version_name, $@)/g' \ ++ -e 's/@@company_name@@/$(company_name)/g' \ ++ -e 's/@@loongson_runtime_name@@/$(LOONGSON_RUNTIME_NAME)/g' \ + $< > $@.tmp + $(MV) $@.tmp $@ + +diff --git a/jdk/make/lib/SoundLibraries.gmk b/jdk/make/lib/SoundLibraries.gmk +index b59a9462..8ce97dc8 100644 +--- a/jdk/make/lib/SoundLibraries.gmk ++++ b/jdk/make/lib/SoundLibraries.gmk @@ -23,6 +23,12 @@ # questions. # @@ -116084,7 +117486,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/jdk/m LIBJSOUND_SRC_DIRS := \ $(JDK_TOPDIR)/src/share/native/com/sun/media/sound \ $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/com/sun/media/sound -@@ -136,6 +142,14 @@ +@@ -136,6 +142,14 @@ else LIBJSOUND_CFLAGS += -DX_ARCH=X_PPC endif @@ -116099,9 +117501,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/jdk/m ifeq ($(OPENJDK_TARGET_CPU), ppc64) LIBJSOUND_CFLAGS += -DX_ARCH=X_PPC64 endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/jdk/src/share/classes/sun/misc/Version.java.template b/jdk/src/share/classes/sun/misc/Version.java.template ---- a/jdk/src/share/classes/sun/misc/Version.java.template 2024-01-11 09:53:23.000000000 +0800 -+++ b/jdk/src/share/classes/sun/misc/Version.java.template 2023-12-20 09:23:21.388129678 +0800 +diff --git a/jdk/src/share/classes/sun/misc/Version.java.template b/jdk/src/share/classes/sun/misc/Version.java.template +index 32e2586e..16b43a39 100644 +--- a/jdk/src/share/classes/sun/misc/Version.java.template ++++ b/jdk/src/share/classes/sun/misc/Version.java.template @@ -23,6 +23,13 @@ * questions. */ @@ -116116,22 +117519,26 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/jdk/s package sun.misc; import java.io.PrintStream; -@@ -47,6 +54,9 @@ - private static final String company_name = - "@@company_name@@"; +@@ -43,6 +50,12 @@ public class Version { + private static final String java_runtime_version = + "@@java_runtime_version@@"; ++ ++ private static final String company_name = ++ "@@company_name@@"; ++ + private static final String loongson_runtime_name = + "@@loongson_runtime_name@@"; -+ + static { init(); - } -@@ -106,7 +116,11 @@ +@@ -103,7 +116,12 @@ public class Version { /* Second line: runtime version (ie, libraries). */ -- ps.print(java_runtime_name + " " + company_name + " " + "(build " + java_runtime_version); -+ ps.print(java_runtime_name + " " + company_name + " "); +- ps.print(java_runtime_name + " (build " + java_runtime_version); ++ ps.print(java_runtime_name + " "); ++ + if (loongson_runtime_name.length() > 0) { + ps.print(" ("+ loongson_runtime_name +")"); + } @@ -116139,9 +117546,20 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/jdk/s if (java_profile_name.length() > 0) { // profile name -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/jdk/src/solaris/bin/loongarch64/jvm.cfg b/jdk/src/solaris/bin/loongarch64/jvm.cfg ---- a/jdk/src/solaris/bin/loongarch64/jvm.cfg 1970-01-01 08:00:00.000000000 +0800 -+++ b/jdk/src/solaris/bin/loongarch64/jvm.cfg 2023-12-20 09:23:21.804791575 +0800 +@@ -120,7 +138,7 @@ public class Version { + String java_vm_name = System.getProperty("java.vm.name"); + String java_vm_version = System.getProperty("java.vm.version"); + String java_vm_info = System.getProperty("java.vm.info"); +- ps.println(java_vm_name + " (build " + java_vm_version + ", " + ++ ps.println(java_vm_name + " " + company_name + " " + "(build " + java_vm_version + ", " + + java_vm_info + ")"); + } + +diff --git a/jdk/src/solaris/bin/loongarch64/jvm.cfg b/jdk/src/solaris/bin/loongarch64/jvm.cfg +new file mode 100644 +index 00000000..42a06755 +--- /dev/null ++++ b/jdk/src/solaris/bin/loongarch64/jvm.cfg @@ -0,0 +1,36 @@ +# Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2015, 2022, Loongson Technology. All rights reserved. @@ -116179,9 +117597,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/jdk/s +# +-server KNOWN +-client IGNORE -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/jdk/src/solaris/bin/mips64/jvm.cfg b/jdk/src/solaris/bin/mips64/jvm.cfg ---- a/jdk/src/solaris/bin/mips64/jvm.cfg 1970-01-01 08:00:00.000000000 +0800 -+++ b/jdk/src/solaris/bin/mips64/jvm.cfg 2023-12-20 09:23:21.804791575 +0800 +diff --git a/jdk/src/solaris/bin/mips64/jvm.cfg b/jdk/src/solaris/bin/mips64/jvm.cfg +new file mode 100644 +index 00000000..42a06755 +--- /dev/null ++++ b/jdk/src/solaris/bin/mips64/jvm.cfg @@ -0,0 +1,36 @@ +# Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2015, 2022, Loongson Technology. All rights reserved. @@ -116219,10 +117639,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/jdk/s +# +-server KNOWN +-client IGNORE -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/jdk/test/jdk/jfr/event/os/TestCPUInformation.java b/jdk/test/jdk/jfr/event/os/TestCPUInformation.java ---- a/jdk/test/jdk/jfr/event/os/TestCPUInformation.java 2024-01-11 09:53:23.000000000 +0800 -+++ b/jdk/test/jdk/jfr/event/os/TestCPUInformation.java 2024-01-30 13:54:25.486035237 +0800 -@@ -54,8 +54,8 @@ +diff --git a/jdk/test/jdk/jfr/event/os/TestCPUInformation.java b/jdk/test/jdk/jfr/event/os/TestCPUInformation.java +index 17c8419c..a8b76cb7 100644 +--- a/jdk/test/jdk/jfr/event/os/TestCPUInformation.java ++++ b/jdk/test/jdk/jfr/event/os/TestCPUInformation.java +@@ -54,8 +54,8 @@ public class TestCPUInformation { Events.assertField(event, "hwThreads").atLeast(1); Events.assertField(event, "cores").atLeast(1); Events.assertField(event, "sockets").atLeast(1); @@ -116233,49 +117654,16 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/jdk/t } } } -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/jdk/test/sun/management/jmxremote/bootstrap/linux-loongarch64/launcher b/jdk/test/sun/management/jmxremote/bootstrap/linux-loongarch64/launcher ---- a/jdk/test/sun/management/jmxremote/bootstrap/linux-loongarch64/launcher 1970-01-01 08:00:00.000000000 +0800 -+++ b/jdk/test/sun/management/jmxremote/bootstrap/linux-loongarch64/launcher 2023-12-20 09:23:22.678114913 +0800 -@@ -0,0 +1,8 @@ -+ELF @XJ@8 @@@ @ 88 8   PP@ > ~  ~ x@0>0~ 0~ HH H DDPtd  QtdRtd > ~  ~ /lib64/ld.so.1GNUGNUka43b 2v   -+  k|  |nagHYBu(  x  T    libdl.so.2_ITM_deregisterTMCloneTable_ITM_registerTMCloneTabledlsymdlopenlibc.so.6sprintfabortstrlenmallocstderrfwritefprintf__libc_start_mainGLIBC_2.27__libc_csu_fini__libc_csu_init OP X ` h p  x       ( 0 8  @  -+A(aAE!(L( L( L( L( L( La( LA( L Т 0 8e(f cEcA  0 8 P 1 8j 0 !0 8!L  !0 8!L@X( @L@ L@@  IEI@( @L L@cw'b*a )DwW )a (w&c@ LS@c@a)v)vb)b(WĢ)̢( D PĢ({Wa(v(c Lca`)v@)vł)@̲)̲( 5`(&̂(&W P̂(A&WMW̢)̂(A&Ģ(W̢()  ")B) 2) b>)̂(!&Ŵ)̂(1D(&PW P"΢͂̂(Lr)r(1dA(&TW P̢(&(΢(͂(a&LB)B(@̢(&!(͢(B(L")"(@̢(&(͢( L)(@̢(&(͢(L)̢(&(͢(((L)(E@̢(&(͢(("(B(L P@P@P@P@̢(&(͢(L@̢(&(͢(L̂(&a(͂(L a`(v@(c L@cw)y)r9s9a)x)z`){@)| )9I ;@@&eDL"8_a(w(x(y(z`({@(| (c L@ L@JNI_CreateJavaVMUsage: %s jvm-path classpath class -+-Djava.class.path=%s%scan't get address of JNI_CreateJavaVM -+Can't create Java VM -+([Ljava/lang/String;)Vmain from C!java/lang/String;,zR|    O ~ (~  o    -+    h o oo` 0 0 0 0 0 0 0 0~ GCC: (Loongnix 8.3.0-6.lnd.vec.24+b1) 8.3.08 H h     `    -+    0       ~ (~ 0~  H     H  x !  7 F(~ m  y ~ L (~ 0~  ~  H   + GZm t  \   x   6  1 = T  BUH a crtstuff.cderegister_tm_clones__do_global_dtors_auxcompleted.6858__do_global_dtors_aux_fini_array_entryframe_dummy__frame_dummy_init_array_entrylauncher.c__FRAME_END____init_array_end_DYNAMIC__init_array_start__GNU_EH_FRAME_HDR_GLOBAL_OFFSET_TABLE___libc_csu_finifprintf@@GLIBC_2.27_ITM_deregisterTMCloneTablefwrite@@GLIBC_2.27malloc@@GLIBC_2.27_edata__libc_start_main@@GLIBC_2.27abort@@GLIBC_2.27strlen@@GLIBC_2.27JNU_FindCreateJavaVM__dso_handle_IO_stdin_useddlopen@@GLIBC_2.27__libc_csu_initsprintf@@GLIBC_2.27dlsym@@GLIBC_2.27__bss_startmainstderr@@GLIBC_2.27__TMC_END___ITM_registerTMCloneTable.symtab.strtab.shstrtab.interp.note.ABI-tag.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.text.rodata.eh_frame_hdr.eh_frame.init_array.fini_array.dynamic.got.plt.got.sdata.bss.comment8 8#H H 1h h$H TDo 0N  V ^o` ` ko @z B 0 0 X    8 ~  >(~ (>0~ 0> @HH H@H @ @0@,@* F{[I -\ 文件末尾没有换行符 -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/jdk/test/sun/management/jmxremote/bootstrap/linux-mips64el/launcher b/jdk/test/sun/management/jmxremote/bootstrap/linux-mips64el/launcher ---- a/jdk/test/sun/management/jmxremote/bootstrap/linux-mips64el/launcher 1970-01-01 08:00:00.000000000 +0800 -+++ b/jdk/test/sun/management/jmxremote/bootstrap/linux-mips64el/launcher 2023-12-20 09:23:22.678114913 +0800 -@@ -0,0 +1,22 @@ -+ELF` @"@8 @! @@@   p888TTXXX0H@@$$444 @(((((<((p?((GNUTEo"MPL# X`   -+< 5p -+@ppp -+pppp -+oo -+ooL -+ -+   , X 0   I & y  <N"p`] "_DYNAMIC_LINKING__RLD_MAP__libc_csu_init__libc_csu_fini__libc_start_main__gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalize_Jv_RegisterClassesdlopendlsymstderrfprintfstrlenmallocsprintfJNU_FindCreateJavaVMfwritelibdl.so.2libc.so.6_IO_stdin_usedGLIBC_2.0GLIBC_2.20ii (ii 2ii (ii 2X`g<-`gȀ@Ȁ g%%Ȁ<'-% g$$(0%H@%P <-ycd8d@b܈dBd/DB,@y  <-yxcd8d@e܈d/((-(E{(y  g<-(g8 @@H DP 9g$ gg<-g8hDd@P 9gg  Pg80(%<-Pg$%@ @%P0Edߨ%@ %80(@gPg%<-g%¯B(@耂C܈B%0@PHEd% `%@ $BdB% @%@ Bd% @Ѐ%@ BdB%8@PpFdP߈Edߘ%@ h<B4P¯hgX$T¯$`£BdB% @X%@@耂B%8@&$$PߐDd؀%@ $Pg@gHg%0%(% `%@ ¯A耂B%8@$$P߸Dd؀%@ $x@B0B@߈cdc%(`%@ D@@B܈B@PgdPfd%@  7@@B8B@Ped%@ ((-@@B0B@Ped%@ 0@B`B@(0$% `%@ 88@@BhB@8 % `%@  @BxB@% `%@  @@B܀B@% `%@ HBBH% `%@ %%ߠߘ߰gg0<-Ђg`hp/P( 8%%H% -+@%%0%(% ` 1fQf80( @g%x d%x d%x d%x d%x d%x d%x  d%x  dg<-ggJNI_CreateJavaVMUsage: %s jvm-path classpath class -+-Djava.class.path=%s%scan't get address of JNI_CreateJavaVM -+Can't create Java VM -+([Ljava/lang/String;)Vmain from C!java/lang/String/lib64/ld.so.1GNU X X0 `X p`GCC: (Debian 6.3.0-18+deb9u1) 6.3.0 201705160 @ ?@XAgnu8P  L -+ -+ -+ -+  `  `  04X`hpQ U`hm o   X ` XU0h `+`<IRXeq X" H!p` p1 0 FpS"b qpx 7  `  `  ,2  /usr/lib/gcc/mips64el-linux-gnuabi64/6/../../../mips64el-linux-gnuabi64/Scrt1.ohltcrtstuff.c__JCR_LIST__deregister_tm_clones__do_global_dtors_auxcompleted.6216__do_global_dtors_aux_fini_array_entryframe_dummy__frame_dummy_init_array_entrylauncher.c__FRAME_END____JCR_END___MIPS_STUBS___init_array_end__dso_handle_DYNAMIC__init_array_start__TMC_END___GLOBAL_OFFSET_TABLE__gp__libc_csu_fini__cxa_finalize@@GLIBC_2.2_DYNAMIC_LINKING_ITM_deregisterTMCloneTablestderr@@GLIBC_2.0_edatadlopen@@GLIBC_2.2fwrite@@GLIBC_2.0malloc@@GLIBC_2.0JNU_FindCreateJavaVM__data_start__gmon_start___IO_stdin_used_fdatastrlen@@GLIBC_2.0__libc_start_main@@GLIBC_2.0fprintf@@GLIBC_2.0__RLD_MAP__libc_csu_initdlsym@@GLIBC_2.0__bss_startmain__start_ftext_Jv_RegisterClassessprintf@@GLIBC_2.0_fbss_ITM_registerTMCloneTable.symtab.strtab.shstrtab.MIPS.abiflags.MIPS.options.note.gnu.build-id.dynamic.hash.dynsym.dynstr.gnu.version.gnu.version_r.rel.dyn.init.text.MIPS.stubs.fini.rodata.interp.eh_frame.note.ABI-tag.init_array.fini_array.jcr.data.rld_map.got.sdata.bss.comment.pdr.gnu.attributes*p88* pPPh8$K@T  Z @b  <joL -+L -+0wo -+ -+`  -+ -+@ @` ` ``(    0044 XX``hhpp 0- o8H6 XL!0 -\ 文件末尾没有换行符 -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/jdk/test/sun/security/pkcs11/PKCS11Test.java b/jdk/test/sun/security/pkcs11/PKCS11Test.java ---- a/jdk/test/sun/security/pkcs11/PKCS11Test.java 2024-01-11 09:53:23.000000000 +0800 -+++ b/jdk/test/sun/security/pkcs11/PKCS11Test.java 2023-12-20 09:23:22.824779901 +0800 +diff --git a/jdk/test/sun/management/jmxremote/bootstrap/linux-loongarch64/launcher b/jdk/test/sun/management/jmxremote/bootstrap/linux-loongarch64/launcher +new file mode 100644 +index 00000000..e69de29b +diff --git a/jdk/test/sun/management/jmxremote/bootstrap/linux-mips64el/launcher b/jdk/test/sun/management/jmxremote/bootstrap/linux-mips64el/launcher +new file mode 100644 +index 00000000..e69de29b +diff --git a/jdk/test/sun/security/pkcs11/PKCS11Test.java b/jdk/test/sun/security/pkcs11/PKCS11Test.java +index 5fc9c605..9db6a17d 100644 +--- a/jdk/test/sun/security/pkcs11/PKCS11Test.java ++++ b/jdk/test/sun/security/pkcs11/PKCS11Test.java @@ -21,6 +21,11 @@ * questions. */ @@ -116288,7 +117676,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/jdk/t // common infrastructure for SunPKCS11 tests -@@ -589,6 +594,9 @@ +@@ -589,6 +594,9 @@ public abstract class PKCS11Test { "/usr/lib64/"}); osMap.put("Linux-ppc64-64", new String[]{"/usr/lib64/"}); osMap.put("Linux-ppc64le-64", new String[]{"/usr/lib64/"}); @@ -116298,26 +117686,6 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/jdk/t osMap.put("Windows-x86-32", new String[]{ PKCS11_BASE + "/nss/lib/windows-i586/".replace('/', SEP)}); osMap.put("Windows-amd64-64", new String[]{ ---- openjdk-bak/jdk/make/gensrc/GensrcMisc.gmk 2024-05-07 14:16:26.518106671 +0800 -+++ openjdk/jdk/make/gensrc/GensrcMisc.gmk 2024-05-07 15:35:01.746736722 +0800 -@@ -23,6 +23,12 @@ - # questions. - # - -+# -+# This file has been modified by Loongson Technology in 2018. These -+# modifications are Copyright (c) 2018, Loongson Technology, and are made -+# available on the same license terms set forth above. -+# -+ - include ProfileNames.gmk - - ################################################################################ -@@ -47,6 +53,7 @@ - -e 's/@@java_runtime_name@@/$(RUNTIME_NAME)/g' \ - -e 's/@@java_profile_name@@/$(call profile_version_name, $@)/g' \ - -e 's/@@company_name@@/$(company_name)/g' \ -+ -e 's/@@loongson_runtime_name@@/$(LOONGSON_RUNTIME_NAME)/g' \ - $< > $@.tmp - $(MV) $@.tmp $@ - +-- +2.33.0 + diff --git a/openjdk-1.8.0.spec b/openjdk-1.8.0.spec index bcfaeda163a9b06c7ddf3199bacccd33934a3976..0e27c71df799e029c49841abb82aa0e9569149c3 100644 --- a/openjdk-1.8.0.spec +++ b/openjdk-1.8.0.spec @@ -936,7 +936,7 @@ Provides: java-%{javaver}-%{origin}-accessibility%{?1} = %{epoch}:%{version}-%{r Name: java-%{javaver}-%{origin} Version: %{javaver}.%{updatever}.%{buildver} -Release: 3 +Release: 4 # java-1.5.0-ibm from jpackage.org set Epoch to 1 for unknown reasons # and this change was brought into RHEL-4. java-1.5.0-ibm packages # also included the epoch in their virtual provides. This created a @@ -2624,6 +2624,10 @@ cjc.mainProgram(arg) %endif %changelog +* Wed May 15 2024 songliyang -1:1.8.0.412-b08.4 +- fix LoongArch64-support.patch error that apply patch on loongarch64 in prep stage +- fix loongson vendor error + * Tue May 7 2024 kuenking111 -1:1.8.0.412-b08.3 - add DependencyContext-mark_dependent_nmethods-crash-in-Dynamic-cds-mode.patch - add 8138922-StubCodeDesc-constructor-publishes-partially-constructed.patch