Skip to content

Commit 83171fc

Browse files
committed
FROM LOONGSON: loongarch port
Squashed commit of the following: commit 47b2742 Merge: 9a352ac 86f9b3f Author: aoqi <aoqi@loongson.cn> Date: Thu Dec 28 17:11:20 2023 +0800 Merge commit 9a352ac Author: loongson-jvm <jvm@loongson.cn> Date: Wed Dec 27 16:33:58 2023 +0800 Update (2023.12.27, 2nd) 33272: Implement ensureMaterializedForStackWalk intrinsic 32033: Add vector intrinsics for unsigned (zero extended) casts 33177: Implement poly1305 intrinsic 33257: java/lang/Math/RoundTests.java failed with -Xcomp after 32796 33134: 8320959: jdk/jfr/event/runtime/TestShutdownEvent.java crash with CONF=fastdebug -Xcomp commit 64e0649 Author: loongson-jvm <jvm@loongson.cn> Date: Wed Dec 27 14:10:06 2023 +0800 Update (2023.12.27) 33161: LA port of 8320368: Per-CPU optimization of Klass range reservation 33160: LA port of 8261837: SIGSEGV in ciVirtualCallTypeData::translate_from 33159: LA port of 8318776: Require supports_cx8 to always be true commit cf24236 Merge: 114dfbe ea6e92e Author: aoqi <aoqi@loongson.cn> Date: Wed Dec 27 11:06:38 2023 +0800 Merge commit 114dfbe Author: loongson-jvm <jvm@loongson.cn> Date: Wed Dec 13 15:01:07 2023 +0800 Update (2023.12.13) 31769: [6000] Support AM{SWAP/ADD}{_DB}.{B/H} and AMCAS{_DB}.{B/H/W/D} insns commit 8ff0b92 Author: loongson-jvm <jvm@loongson.cn> Date: Mon Dec 11 14:26:20 2023 +0800 Update (2023.12.11, 4th) 33080: Fix byte_array_inflate vld is out of range 33031: Refresh the CountPositives macro 33068: Vectorize StringCompareToDifferentLength 24527: Fix a typo for invokeinterface in 8604 32871: Supplement 32674 commit f542478 Author: loongson-jvm <jvm@loongson.cn> Date: Mon Dec 11 11:48:36 2023 +0800 Update (2023.12.11, 3rd) 33126: LA port of 8315801: [PPC64] JNI code should be more similar to the Panama implementation 33125: LA port of 8320272: Make method_entry_barrier address shared commit dc2a89f Merge: 24c6146 e47cf61 Author: aoqi <aoqi@loongson.cn> Date: Mon Dec 11 11:39:39 2023 +0800 Merge commit 24c6146 Author: loongson-jvm <jvm@loongson.cn> Date: Mon Dec 11 11:37:48 2023 +0800 Update (2023.12.11, 2nd) 33113: LA port of 8301997: Move method resolution information out of the cpCache 33112: LA port of 8254693: Add Panama feature to pass heap segments to native code 33111: LA port of 8309893: Integrate ReplicateB/S/I/L/F/D nodes to Replicate node commit 7672817 Merge: 9c5d0f9 ffa35d8 Author: aoqi <aoqi@loongson.cn> Date: Mon Dec 11 11:28:29 2023 +0800 Merge commit 9c5d0f9 Merge: a010294 8555e0f Author: aoqi <aoqi@loongson.cn> Date: Mon Dec 11 11:24:58 2023 +0800 Merge commit a010294 Author: loongson-jvm <jvm@loongson.cn> Date: Mon Dec 11 11:23:05 2023 +0800 Update (2023.12.11) 32995: 8319268: Build failure with GCC8.3.1 after 8313643 commit d24b593 Merge: ffb601f d354141 Author: aoqi <aoqi@loongson.cn> Date: Mon Dec 11 11:05:48 2023 +0800 Merge commit ffb601f Author: loongson-jvm <jvm@loongson.cn> Date: Fri Dec 8 19:05:19 2023 +0800 Update (2023.12.08, 3rd) 32922: LA port of 8318609: Upcall stubs should be smaller 32921: LA port of 8318598: FFM stylistic cleanups commit f3b1a7d Merge: ee7bb53 d96f38b Author: aoqi <aoqi@loongson.cn> Date: Fri Dec 8 18:42:24 2023 +0800 Merge commit ee7bb53 Author: loongson-jvm <jvm@loongson.cn> Date: Fri Dec 8 18:31:48 2023 +0800 Update (2023.12.08, 2nd) 32841: LA port of 8316309: AArch64: VMError::print_native_stack() crashes on Java native method frame 32840: LA port of 8312522: Implementation of Foreign Function & Memory API commit 57190e4 Merge: 09ae79f 6fc3514 Author: aoqi <aoqi@loongson.cn> Date: Fri Dec 8 18:07:35 2023 +0800 Merge commit 09ae79f Author: loongson-jvm <jvm@loongson.cn> Date: Fri Dec 8 13:32:02 2023 +0800 Update (2023.12.08) 29494: Fix assert(_succ != current) failed: invariant 32796: Rethinking the ties-to-positive round mode 32874: Amend 30985: Insert acqure membar for load-exclusive with acquire to fix typo 32611: Remove unnecessary initialize constant pool for native wrapper 24942: 8316563: test tools/jpackage/linux/LinuxResourceTest.java fails on CentOS Linux release 8.5.2111 and Fedora 27 32758: Multiple uses of register t7 commit 536dc47 Merge: a46503f fb4098f Author: aoqi <aoqi@loongson.cn> Date: Wed Oct 25 11:51:23 2023 +0800 Merge commit a46503f Merge: a81b301 3105538 Author: aoqi <aoqi@loongson.cn> Date: Wed Oct 25 11:49:45 2023 +0800 Merge commit a81b301 Author: loongson-jvm <jvm@loongson.cn> Date: Wed Oct 25 11:48:47 2023 +0800 Update (2023.10.25) 32674: LA port of 8315966: Relativize initial_sp in interpreter frames commit 8516cb0 Merge: facdf9c edcc559 Author: aoqi <aoqi@loongson.cn> Date: Wed Oct 25 11:09:04 2023 +0800 Merge commit facdf9c Author: loongson-jvm <jvm@loongson.cn> Date: Tue Oct 24 16:07:30 2023 +0800 Update (2023.10.24) 29823: Fix ShenandoahGC cmpxchg_oop register be clobbered issue 32688: Revamp the SIMD string compress routines 32603: Mux generate_fill for the ClearArray node 32600: Remove duplicate definitions after 8315020 commit 65ba6b8 Author: loongson-jvm <jvm@loongson.cn> Date: Fri Sep 22 17:04:51 2023 +0800 Update (2023.09.22, 2nd) 32616: LA port of 8316179: Use consistent naming for lightweight locking in MacroAssembler commit f50b223 Merge: 9da6dbd c04c9ea Author: aoqi <aoqi@loongson.cn> Date: Fri Sep 22 16:45:11 2023 +0800 Merge commit 9da6dbd Author: loongson-jvm <jvm@loongson.cn> Date: Fri Sep 22 16:41:59 2023 +0800 Update (2023.09.22) 32609: LA port of 8308869: C2: use profile data in subtype checks when profile has more than one class 32608: LA port of 8292692: Move MethodCounters inline functions out of method.hpp commit 1cc7139 Merge: 2a9d294 ce93d27 Author: aoqi <aoqi@loongson.cn> Date: Fri Sep 22 15:54:27 2023 +0800 Merge commit 2a9d294 Merge: 675233f 024133b Author: aoqi <aoqi@loongson.cn> Date: Fri Sep 22 09:30:36 2023 +0800 Merge commit 675233f Author: loongson-jvm <jvm@loongson.cn> Date: Fri Sep 22 09:25:37 2023 +0800 Update (2023.09.21, 2nd) 32358: LA port of 8310596: Utilize existing method frame::interpreter_frame_monitor_size_in_bytes() commit 8f36a1d Merge: da3e94b cb3f968 Author: aoqi <aoqi@loongson.cn> Date: Thu Sep 21 16:47:20 2023 +0800 Merge commit da3e94b Author: loongson-jvm <jvm@loongson.cn> Date: Thu Sep 21 16:04:09 2023 +0800 Update (2023.09.21) 32275: LA port of 8313419: Template interpreter produces no safepoint check for return bytecodes 32274: LA port of 8308984: Relativize last_sp (and top_frame_sp) in interpreter frames commit 7add703 Merge: af148e2 68815d5 Author: aoqi <aoqi@loongson.cn> Date: Thu Sep 21 14:37:50 2023 +0800 Merge commit af148e2 Author: loongson-jvm <jvm@loongson.cn> Date: Wed Sep 20 17:30:47 2023 +0800 Update (2023.09.20, 4th) 29793: Expurgating call_stub_entry 32506: Vectorize the C2 node string_inflate to imporve the score of CharBufferAppend.appendStringBuilder 32519: Fix for 31967 set default MaxGCPauseMillis 32419: Vectorized StubGenerator::generate_fill() 31967: [G1GC] Set default MaxGCPauseMillis=150ms commit 65c465a Author: loongson-jvm <jvm@loongson.cn> Date: Wed Sep 20 15:43:36 2023 +0800 Update (2023.09.20, 3rd) 32446: Fix the error of assert(v_align > 1) when MaxVectorSize is 4 or 8 30382: LA port of 8292591: Experimentally add back barrier-less Java thread transitions 32377: Optimize VectorMaskFirstTrue 32328: implement the intrinsic of ShiftRightImplWork 32365: Support comparison of DecodeN with zero 24480: [LA][C2] Eliminate unnecessary CastP2X 32304: Decompose the rem calculation in the DivMod nodes commit ccd2390 Author: loongson-jvm <jvm@loongson.cn> Date: Wed Sep 20 10:56:59 2023 +0800 Update (2023.09.20, 2nd) 32268: [shenandoah] Use indirect memory operand for cmpxchg 32266: [C2] Effect TEMP_DEF res for get_and_set/add 32163: The size of is_wide_vector should be greater than 8 bytes commit e7e23ca Author: loongson-jvm <jvm@loongson.cn> Date: Wed Sep 20 01:22:37 2023 +0800 Update (2023.09.20) 32186: LA port of 8314020: Print instruction blocks in byte units 32187: LA port of 8308340: C2: Idealize Fma nodes commit d3ab292 Merge: 9fb163d b32d641 Author: aoqi <aoqi@loongson.cn> Date: Tue Sep 19 22:52:46 2023 +0800 Merge commit 9fb163d Author: loongson-jvm <jvm@loongson.cn> Date: Tue Sep 19 22:06:01 2023 +0800 Update (2023.09.19) 30718: Implement PopulateIndex 30721: Implement SignumF/D and SignumVF/D commit 9044c55 Author: loongson-jvm <jvm@loongson.cn> Date: Wed Aug 30 02:27:49 2023 +0800 Update (2023.08.30, 2nd) 32093: Add CMoveD-CmpN node 32079: LA port of 8313796: AsyncGetCallTrace crash on unreadable interpreter method pointer commit 5ea14bb Merge: b61da16 242a2e6 Author: aoqi <aoqi@loongson.cn> Date: Wed Aug 30 02:20:31 2023 +0800 Merge commit b61da16 Author: loongson-jvm <jvm@loongson.cn> Date: Wed Aug 30 02:14:48 2023 +0800 Update (2023.08.30) 31974: LA port of 8301996: Move field resolution information out of the cpCache 31973: LA port of 8313023: Return value corrupted when using CCS + isTrivial (mainline) 30508: Add 32, 64bit vectorAPI of HF2F, F2HF commit c6a84e2 Merge: 0d1279d cff25dd Author: aoqi <aoqi@loongson.cn> Date: Wed Aug 30 02:04:13 2023 +0800 Merge commit 0d1279d Author: loongson-jvm <jvm@loongson.cn> Date: Tue Aug 15 16:02:52 2023 +0800 Update (2023.08.15) 31942: Implement ExtractV 31838: 32 and 64 bits vector implementation 31751: Use base+disp for cmpxchg 31927: Typo in xBarrierSetAssembler_loongarch.cpp 30985: Insert acqure membar for load-exclusive with acquire 31863: [C2] Effect TEMP_DEF res for cmpxchg commit cffa896 Author: loongson-jvm <jvm@loongson.cn> Date: Thu Aug 3 10:51:07 2023 +0800 Update (2023.08.03) 31878: LA port of 8312077: Fix signed integer overflow, final part commit 0e1b12c Merge: 4fafebb a9d21c6 Author: aoqi <aoqi@loongson.cn> Date: Thu Aug 3 09:11:26 2023 +0800 Merge commit 4fafebb Author: loongson-jvm <jvm@loongson.cn> Date: Wed Aug 2 18:33:52 2023 +0800 Update (2023.08.02, 2nd) 31782: Fix the failure of TestIRMatching.java 31743: LA port of 8312014: [s390x] TestSigInfoInHsErrFile.java Failure 31742: LA port of 8303134: JFR: Missing stack trace during chunk rotation stress 31741: LA port of 8311870: Split CompressedKlassPointers from compressedOops.hpp commit 974f956 Merge: f6140fc 71cac8c Author: aoqi <aoqi@loongson.cn> Date: Wed Aug 2 18:25:21 2023 +0800 Merge commit f6140fc Merge: 71f3c2f aac903d Author: aoqi <aoqi@loongson.cn> Date: Wed Aug 2 18:18:06 2023 +0800 Merge commit 71f3c2f Author: loongson-jvm <jvm@loongson.cn> Date: Wed Aug 2 18:03:41 2023 +0800 Update (2023.08.02) 23520: 8311631: When multiple users run tools/jpackage/share/LicenseTest.java, Permission denied for writing /var/tmp/*.files 11541: Prevent load reorder of VarHandle::getOpaque 31269: Ordering memory barriers testcases 31601: revert some copyright update by loongson commit 7c69468 Author: loongson-jvm <jvm@loongson.cn> Date: Wed Jul 12 13:49:33 2023 +0800 Update (2023.07.12, 5th) 31534: LA port of 8309209: C2 failed "assert(_stack_guard_state == stack_guard_reserved_disabled) failed: inconsistent state" 31535: LA port of 8310948: Fix ignored-qualifiers warning in Hotspot commit 9f94503 Merge: c95fd63 66d2736 Author: aoqi <aoqi@loongson.cn> Date: Wed Jul 12 10:42:17 2023 +0800 Merge commit c95fd63 Author: loongson-jvm <jvm@loongson.cn> Date: Wed Jul 12 10:38:05 2023 +0800 Update (2023.07.12, 4th) 31556: Supplement missing nodes about CMoveF/D 31469: LA port of 8310459: [BACKOUT] 8304450: [vectorapi] Refactor VectorShuffle implementation 31470: LA port of 8309685: Fix -Wconversion warnings in assembler and register code 31471: LA port of 8310906: Fix -Wconversion warnings in runtime, oops and some code header files. commit 24440db Merge: e1380b4 ded1370 Author: aoqi <aoqi@loongson.cn> Date: Wed Jul 12 10:24:34 2023 +0800 Merge commit e1380b4 Author: loongson-jvm <jvm@loongson.cn> Date: Wed Jul 12 10:16:48 2023 +0800 Update (2023.07.12, 3rd) 31414: LA port of 8264899: C1: -XX:AbortVMOnException does not work if all methods in the call stack are compiled with C1 and there are no exception handlers 31413: LA port of 8310225: Reduce inclusion of oopMapCache.hpp and generateOopMap.hpp commit 1380eee Merge: d9071d6 3be50da Author: aoqi <aoqi@loongson.cn> Date: Wed Jul 12 09:43:44 2023 +0800 Merge commit d9071d6 Author: loongson-jvm <jvm@loongson.cn> Date: Wed Jul 12 09:42:05 2023 +0800 Update (2023.07.12, 2nd) 31343: LA port of 8309390: [JVMCI] improve copying system properties into libgraal 31330: LA port of 8309878: Reduce inclusion of resolvedIndyEntry.hpp commit 1d3da2b Merge: 0d55602 181845a Author: aoqi <aoqi@loongson.cn> Date: Wed Jul 12 09:29:43 2023 +0800 Merge commit 0d55602 Merge: c9db257 6f492e8 Author: aoqi <aoqi@loongson.cn> Date: Wed Jul 12 09:28:30 2023 +0800 Merge commit c9db257 Merge: cb1e5b4 bb377b2 Author: aoqi <aoqi@loongson.cn> Date: Wed Jul 12 09:25:31 2023 +0800 Merge commit cb1e5b4 Author: loongson-jvm <jvm@loongson.cn> Date: Wed Jul 12 09:14:39 2023 +0800 Update (2023.07.12) 31170: Fix conflicting types for MIN2() 31168: LA port of 8303040: linux PPC64le: Implementation of Foreign Function & Memory API (Preview) 31096: LA port of 8306302: C2 Superword fix: use VectorMaskCmp and VectorBlend instead of CMoveVF/D commit 0d6d37f Merge: a9a3284 a46b5ac Author: aoqi <aoqi@loongson.cn> Date: Wed Jul 12 09:05:12 2023 +0800 Merge commit a9a3284 Author: loongson-jvm <jvm@loongson.cn> Date: Tue Jul 11 21:25:29 2023 +0800 Update (2023.07.11, 3rd) 31095: LA port of 8308276: Change layout API to work with bytes, not bits 31094: LA port of 8308396: Fix offset_of conversion warnings in runtime code commit 631ba62 Merge: 17f06b4 2836c34 Author: aoqi <aoqi@loongson.cn> Date: Tue Jul 11 21:20:08 2023 +0800 Merge commit 17f06b4 Author: loongson-jvm <jvm@loongson.cn> Date: Tue Jul 11 21:16:58 2023 +0800 Update (2023.07.11, 2nd) 28384: LA initial port zgc_generational 31041: LA port of 8307806: Rename Atomic::fetch_and_add and friends 31000: LA port of 8296469: Instrument VMError::report with reentrant iteration step for register and stack printing commit df6ef87 Merge: 3906467 6d4782b Author: aoqi <aoqi@loongson.cn> Date: Tue Jul 11 21:00:38 2023 +0800 Merge commit 3906467 Author: loongson-jvm <jvm@loongson.cn> Date: Tue Jul 11 20:24:53 2023 +0800 Update (2023.07.11) 31106: sun/net/InetAddress/nameservice/simple/DefaultCaching.java fail with -Xcomp 29329: LA port of 8295257: Remove implicit noreg temp register arguments in aarch64 MacroAssembler 29198: LA port of 8293351: Add second tmp register to aarch64 BarrierSetAssembler::load_at 31364: [LoongArch64] zero build failed after openjdk#25064 28984: 8309778: java/nio/file/Files/CopyAndMove.java fails when using second test directory commit 4d10bd7 Author: loongson-jvm <jvm@loongson.cn> Date: Mon Jul 3 20:52:35 2023 +0800 Update (2023.07.03, 2nd) 31295: Provide information when hitting a HaltNode 30973: serviceability/jvmti/events/FramePop/framepop02/framepop02.java crash with -Xcomp 25064: Enable NUMA Mode on LoongArch by Default 31006: Fix VectorInsert commit d846929 Author: loongson-jvm <jvm@loongson.cn> Date: Mon Jul 3 17:10:02 2023 +0800 Update (2023.07.03) 23738: [C2][LA] enable misaligned vectors store/load 29261: LA intrinsics for compareUnsigned method in Integer and Long 29201: LA port of 8283186: Explicitly pass a third temp register to MacroAssembler::store_heap_oop 31010: LA port of 8304915: Create jdk.internal.util.Architecture enum and apply 30943: LA port of 8303588: [JVMCI] make JVMCI source directories conform with standard layout 30829: LA port of 8291555: Implement alternative fast-locking scheme 30358: Add support for ordering memory barriers 30777: testlibrary_tests/ir_framework/tests/TestDFlags.java fail with VerifyOops 30895: LA port of 8302815: Use new Math.clamp method in core libraries 30894: TestArrayStructs.java fails after JDK-8303604 commit 3c44296 Author: loongson-jvm <jvm@loongson.cn> Date: Wed May 17 17:23:08 2023 +0800 Update (2023.05.17, 6th) 30909: LA port of 8299229: [JVMCI] add support for UseZGC commit c048dce Merge: 94c578a cc9f7ad Author: aoqi <aoqi@loongson.cn> Date: Wed May 17 16:41:52 2023 +0800 Merge commit 94c578a Author: loongson-jvm <jvm@loongson.cn> Date: Wed May 17 15:54:54 2023 +0800 Update (2023.05.17, 5th) 30892: LA port of 8300197: Freeze/thaw an interpreter frame using a single copy_to_chunk() call 30891: LA port of 8303002: Reject packed structs from linker 30882: LA port of 8304265: Implementation of Foreign Function and Memory API (Third Preview) commit 9d971d7 Merge: a385354 705ad7d Author: aoqi <aoqi@loongson.cn> Date: Wed May 17 15:20:11 2023 +0800 Merge commit a385354 Merge: 03cec09 750bece Author: aoqi <aoqi@loongson.cn> Date: Wed May 17 14:23:59 2023 +0800 Merge commit 03cec09 Author: loongson-jvm <jvm@loongson.cn> Date: Wed May 17 14:21:33 2023 +0800 Update (2023.05.17, 4th) 30733: Replace NULL with nullptr in cpu/loongarch 30732: LA port of 8304450: [vectorapi] Refactor VectorShuffle implementation commit 5182941 Merge: c101669 781d6d7 Author: aoqi <aoqi@loongson.cn> Date: Wed May 17 14:13:04 2023 +0800 Merge commit c101669 Merge: f0cc6f9 b9bdbe9 Author: aoqi <aoqi@loongson.cn> Date: Wed May 17 14:10:02 2023 +0800 Merge commit f0cc6f9 Author: loongson-jvm <jvm@loongson.cn> Date: Wed May 17 14:08:20 2023 +0800 Update (2023.05.17, 3rd) 30570: LA port of 8241613: Suspicious calls to MacroAssembler::null_check(Register, offset) commit 768cc60 Merge: cb62ea3 35cb303 Author: aoqi <aoqi@loongson.cn> Date: Wed May 17 14:02:19 2023 +0800 Merge commit cb62ea3 Author: loongson-jvm <jvm@loongson.cn> Date: Wed May 17 13:57:48 2023 +0800 Update (2023.05.17, 2nd) 30554: LA port of 8301995: Move invokedynamic resolution information out of ConstantPoolCacheEntry 30553: LA port of 8304301: Remove the global option SuperWordMaxVectorSize 30552: LA port of 8231349: Move intrinsic stubs generation to compiler runtime initialization code commit 979f814 Merge: 22b4029 69152c3 Author: aoqi <aoqi@loongson.cn> Date: Wed May 17 13:51:03 2023 +0800 Merge commit 22b4029 Author: loongson-jvm <jvm@loongson.cn> Date: Wed May 17 13:47:11 2023 +0800 Update (2023.05.17) 30647: Optimize temporary register usage of vectorNode 30702: remove test TestOptoLoopAlignment.java for LoongArch 28218: Fix skiping JTReg tests 30520: UseActiveCoresMP should be able to be turned off on a single-core machine 30278: 8305944: assert(is_aligned(ref, HeapWordSize)) failed: invariant 30039: Fix VectorTest beacause of 8292289 30396: CMoveVF, CMoveVD support 30457: Use membars when accessing volatile _thread_state 30400: LA port of 8232365: Implementation for JEP 363: Remove the Concurrent Mark Sweep (CMS) Garbage Collector commit 45e0892 Author: loongson-jvm <jvm@loongson.cn> Date: Fri Mar 31 00:44:54 2023 +0800 Update (2023.03.31) 30412: LA port of 8303684: Lift upcall sharing mechanism to AbstractLinker (mainline) 30411: LA port of 8304283: Modernize the switch statements in jdk.internal.foreign 30410: LA port of 8303154: Investigate and improve instruction cache flushing during compilation commit 22c4d45 Merge: 195bfab 75168ea Author: aoqi <aoqi@loongson.cn> Date: Fri Mar 31 00:34:41 2023 +0800 Merge commit 195bfab Author: loongson-jvm <jvm@loongson.cn> Date: Thu Mar 30 18:40:42 2023 +0800 Update (2023.03.30) 30302: LA port of 8303022: "assert(allocates2(pc)) failed: not in CodeBuffer memory" When linking downcall handle 30301: LA port of 8303415: Add VM_Version::is_intrinsic_supported(id) 30300: LA port of 8300783: Consolidate byteswap implementations 30298: update HF2F and F2HF because of 8302976 commit 80eef3d Merge: 4af4bbb 2b81fae Author: aoqi <aoqi@loongson.cn> Date: Thu Mar 30 18:32:07 2023 +0800 Merge commit 4af4bbb Author: loongson-jvm <jvm@loongson.cn> Date: Wed Mar 29 10:21:40 2023 +0800 Update (2023.03.29) 30284: adjust VectorCast 30281: auto-vectorized FP16 conversions 29722: Sanitise c2i and i2c adapters 30285: ArrayCopy: Align destination address 30258: ShiftCntV should be cloned commit e4167bd Merge: 67a5ed9 02875e7 Author: aoqi <aoqi@loongson.cn> Date: Tue Mar 28 21:31:58 2023 +0800 Merge commit 67a5ed9 Merge: 331190d 6e19387 Author: aoqi <aoqi@loongson.cn> Date: Tue Mar 28 21:22:01 2023 +0800 Merge commit 331190d Author: loongson-jvm <jvm@loongson.cn> Date: Tue Mar 28 21:19:39 2023 +0800 Update (2023.03.28) (openjdk#32) 30225: remove a Chinese punctuation 30090: [C2] Fix typo for umodL_Reg_Reg instruction 29982: [C2] Add CountedLoopEnd_reg_imm12_short and branchConIU_reg_imm12_short commit a9b8a19 Author: loongson-jvm <jvm@loongson.cn> Date: Fri Mar 10 11:47:53 2023 +0800 Update (2023.03.10) 29885: LA port of 8302369: Reduce the stack size of the C1 compiler 29991: LA port of 8302070: Factor null-check into load_klass() calls commit faa0fd4 Merge: 6dfb473 fcaf871 Author: aoqi <aoqi@loongson.cn> Date: Fri Mar 10 11:03:40 2023 +0800 Merge commit 6dfb473 Author: loongson-jvm <jvm@loongson.cn> Date: Thu Mar 9 19:21:40 2023 +0800 Update (2023.03.09) 29860: LA port of 8300255: Introduce interface for GC oop verification in the assembler commit ce2e630 Merge: 8019771 861e302 Author: aoqi <aoqi@loongson.cn> Date: Thu Mar 9 19:12:28 2023 +0800 Merge commit 8019771 Author: loongson-jvm <jvm@loongson.cn> Date: Wed Mar 8 17:11:40 2023 +0800 Update (2023.03.08) 29783: LA port of 8151413: os::allocation_granularity/page_size and friends return signed values 29782: Replace NULL with nullptr in os_cpu/linux_loongarch commit b1a571e Merge: ea5c4ce 638d612 Author: aoqi <aoqi@loongson.cn> Date: Wed Mar 8 16:58:24 2023 +0800 Merge commit ea5c4ce Author: loongson-jvm <jvm@loongson.cn> Date: Tue Mar 7 18:52:48 2023 +0800 Update (2023.03.07) 29715: LA port of 8301346: Remove dead emit_entry_barrier_stub definition 29714: LA port of 8299795: Relativize locals in interpreter frames 29713: LA port of 8298400: Virtual thread instability when stack overflows commit 19bcbbd Merge: c4910f7 bc750f7 Author: aoqi <aoqi@loongson.cn> Date: Tue Mar 7 14:11:55 2023 +0800 Merge commit c4910f7 Author: loongson-jvm <jvm@loongson.cn> Date: Mon Mar 6 17:50:45 2023 +0800 Update (2023.03.06) 29691: LA port of 8299089: Instrument global jni handles with tag to make them distinguishable 29690: LA port of 8299312: Clean up BarrierSetNMethod commit 4fa2aca Merge: 285fa37 910dffe Author: aoqi <aoqi@loongson.cn> Date: Mon Mar 6 11:56:37 2023 +0800 Merge commit 285fa37 Author: loongson-jvm <jvm@loongson.cn> Date: Sat Mar 4 00:16:28 2023 +0800 Update (2023.03.04) 29677: LA port of 8283740: C1: Convert flag TwoOperandLIRForm to a constant on all platforms commit 600ee96 Merge: 69a5579 3b374c0 Author: aoqi <aoqi@loongson.cn> Date: Fri Mar 3 23:13:24 2023 +0800 Merge commit 69a5579 Author: loongson-jvm <jvm@loongson.cn> Date: Fri Mar 3 23:08:15 2023 +0800 Update (2023.03.03) 29668: Delete VectorTest temporarily beacause of 8292289 29667: LA port of 8297036: Generalize C2 stub mechanism commit 990b191 Merge: b1b5090 8ff2928 Author: aoqi <aoqi@loongson.cn> Date: Fri Mar 3 18:24:18 2023 +0800 Merge commit b1b5090 Author: loongson-jvm <jvm@loongson.cn> Date: Thu Mar 2 15:41:52 2023 +0800 Update (2023.03.02) 29477: Implementation of Foreign Function and Memory API (Second Preview), Foreign linker implementation update 29476: LA port of 8295258: Add BasicType argument to AccessInternal::decorator_fixup 29475: LA port of 8297864: Dead code elimination commit 6629598 Merge: 04a8176 d562d3f Author: aoqi <aoqi@loongson.cn> Date: Thu Mar 2 09:19:36 2023 +0800 Merge commit 04a8176 Author: loongson-jvm <jvm@loongson.cn> Date: Thu Mar 2 09:14:17 2023 +0800 Update (2023.03.01) 29437: [C2] Add branch instruct with immI12 for reduce spill_code 28247: 8301942: java/net/httpclient/DigestEchoClientSSL.java fail with -Xcomp 29763: Draw out StubRoutines::la::_call_stub_compiled_return 29546: 8301737: java/rmi/server/UnicastRemoteObject/serialFilter/FilterUROTest.java fail with -Xcomp 29524: java/net/httpclient/* fail with -Xcomp 29539: jdk/incubator/concurrent/StructuredTaskScope/StructuredTaskScopeTest.java failed with -Xcomp 27906: Inline ActiveCoresMP commit 9761533 Author: loongson-jvm <jvm@loongson.cn> Date: Fri Feb 24 09:16:47 2023 +0800 Update (2023.02.23) 29453: Some cpu features use hwcap detect 29350: Use registers as temp space 29614: Take off redundant shift assemblers 28639: Clean up generate_exception_blob 28670: Define S8 as Rdispatch 21995: Refresh interp mdp helpers commit d81e2e1 Author: loongson-jvm <jvm@loongson.cn> Date: Fri Feb 3 00:12:43 2023 +0800 Update (2023.02.02) 29327: Should use RA as the ret_addr of remove_activation 20449: Redefine pipe_class for general and floating-point instructions 29124: ChaCha20 intrinsics 28999: Make intrinsic conversions between bit representations of half precision values and floats 29332: T_LONG/T_DOUBLE only needs to be load/store once commit 3562a2a Author: loongson-jvm <jvm@loongson.cn> Date: Tue Jan 10 20:21:31 2023 +0800 Update (2023.01.10) 29064: LA port of 8296875: Generational ZGC: Refactor loom code 29063: LA port of 8286302: Port JEP 425 to PPC64 commit 88c7634 Merge: ea8ad06 c685569 Author: aoqi <aoqi@loongson.cn> Date: Tue Jan 10 16:53:05 2023 +0800 Merge commit ea8ad06 Author: loongson-jvm <jvm@loongson.cn> Date: Mon Jan 9 19:13:33 2023 +0800 Update (2023.01.09) 28982: LA port of 8294591: Fix cast-function-type warning in TemplateTable commit 69df8f6 Merge: 9cfcce4 09ac9eb Author: aoqi <aoqi@loongson.cn> Date: Mon Jan 9 18:47:33 2023 +0800 Merge commit 9cfcce4 Author: loongson-jvm <jvm@loongson.cn> Date: Sun Jan 8 16:04:09 2023 +0800 Update (2023.01.07) 29345: No need to preserve static regs in throw_exception stub frame 28537: forward_exception_entry should not require exception_pc on stack 29399: 8299439: java/text/Format/NumberFormat/CurrencyFormat.java fails for hr_HR 29389: Disable convi2l_type_required 29341: Since T4 can be alloced by C2, it must be saved 29259: Read in the bcp from S0 for the top level interpreter frames 29270: [C2] support {U}DivMod{I/L} 28756: Detach the temp argument of jump_from_interpreted 27559: Corrects the stack offset of SharedRuntime::verify_oop_args() 29266: Delete useless variables and function in class Address 28781: [LA] more configs of Arraycopy stress tests on LA commit 8a71def Author: loongson-jvm <jvm@loongson.cn> Date: Mon Nov 21 17:27:38 2022 +0800 Update (2022.11.21) 28892: LA port of 8296926: Sort include lines of files in the include/ directory 28891: LA port of 8295711: Rename ZBarrierSetAssembler::load_at parameter name from tmp_thread to tmp2 commit 2c88716 Merge: 1595b14 2159170 Author: aoqi <aoqi@loongson.cn> Date: Mon Nov 21 09:34:12 2022 +0800 Merge commit 1595b14 Merge: 5146ebc 17e3412 Author: aoqi <aoqi@loongson.cn> Date: Sat Nov 19 12:09:12 2022 +0800 Merge commit 5146ebc Author: loongson-jvm <jvm@loongson.cn> Date: Sat Nov 19 10:58:27 2022 +0800 Update (2022.11.19) 28685: LA port of 8293939: Move continuation_enter_setup and friends 28677: Use correct register in fast_unlock() commit 5513c29 Merge: 2283610 f84b0ad Author: aoqi <aoqi@loongson.cn> Date: Sat Nov 19 00:33:19 2022 +0800 Merge commit 2283610 Author: loongson-jvm <jvm@loongson.cn> Date: Wed Nov 9 09:15:01 2022 +0800 Update (2022.11.08) 28678: Fix a typo in PosixSignals::pd_hotspot_signal_handler 28665: [LA] useless code in share/utilities/macros.hpp commit 78e7701 Author: loongson-jvm <jvm@loongson.cn> Date: Wed Nov 2 20:56:33 2022 +0800 Update (2022.11.02) 26770: [Loom] Virtual Threads Running Stub Implementation 28316: [C2] Vitrual thread awared ThreadLocal node 28312: currentThread entry should be vthread awared 28548: Fix misleading-indentation warnings with minimal and core build 28061: Use Deoptimization::UnrollBlock::initial_info to get FP 28314: Misc crash dump improvements 28272: Delete b*_long() 28046: LA port of 8293035: Cleanup MacroAssembler::movoop code patching logic aarch64 riscv 27813: Inline cache buffer stub code size reduction 22999: Undefine SSR and SHIFT_count 28396: [C2] specify priority of register selection within phases of RA 28524: LA port of 8262074: Consolidate the default value of MetaspaceSize 28280: Implement isFinite intrinsic 28101: Implement isInfinite intrinsic commit c525a38 Author: loongson-jvm <jvm@loongson.cn> Date: Wed Nov 2 09:05:50 2022 +0800 update to jdk-20+20 28477: Fix misleading-indentation warnings 28476: Add some basic types for VectorLoadConst 28451: Fix error: the compiler can assume that the address of 'L' will never be NULL 28448: LA port of 8295457: Make the signatures of write barrier methods consistent 28452: 8294438: Fix misleading-indentation warnings in hotspot commit 3f4f4e8 Merge: b284181 388a56e Author: aoqi <aoqi@loongson.cn> Date: Tue Nov 1 22:41:06 2022 +0800 Merge commit b284181 Merge: 9359d74 760a260 Author: aoqi <aoqi@loongson.cn> Date: Thu Oct 20 10:52:12 2022 +0800 Merge commit 9359d74 Merge: b85db91 0ec1838 Author: aoqi <aoqi@loongson.cn> Date: Wed Oct 12 15:16:24 2022 +0800 Merge commit b85db91 Author: loongson-jvm <jvm@loongson.cn> Date: Wed Oct 12 14:34:16 2022 +0800 Update to jdk-20+17 28197: LA port of 8294190: Incorrect check messages in SharedRuntime::generate_uncommon_trap_blob commit f54b42d Merge: 5e18837 79ccc79 Author: aoqi <aoqi@loongson.cn> Date: Wed Oct 12 02:45:35 2022 +0800 Merge commit 5e18837 Author: loongson-jvm <jvm@loongson.cn> Date: Wed Oct 12 02:39:26 2022 +0800 Update to jdk-20+16 28098: Minimal build failed with --disable-precompiled-headers 28096: LA port of 8293851: hs_err should print more stack in hex dump commit e922be0 Merge: d6e3bed 711e252 Author: aoqi <aoqi@loongson.cn> Date: Tue Oct 11 21:21:38 2022 +0800 Merge commit d6e3bed Author: loongson-jvm <jvm@loongson.cn> Date: Sat Oct 8 21:32:03 2022 +0800 Update (2022.10.08) 28194: Build fail after 28073 28073: Implementation of Foreign Function & Memory API 28027: Represent Registers as values commit c516cbe Author: loongson-jvm <jvm@loongson.cn> Date: Sat Oct 1 19:39:51 2022 +0800 Update (2022.09.30) 28135: Add linux-loongarch64 to CheckedFeatures.notImplemented 28039: Fix typo for generate_method_entry_barrier and BarrierSetAssembler::nmethod_entry_barrier 28128: using Address reference as argument 28133: 8293657: sun/management/jmxremote/bootstrap/RmiBootstrapTest.java#id1 failed with "SSLHandshakeException: Remote host terminated the handshake" 27811: [LA][C2] xml.validation fatal error SIGSEGV with +UseFPUForSpilling 28051: LA port of 8293660: Fix frame::sender_for_compiled_frame frame size assert 27891: Deprecated assembler removal 27957: Mark stub code without alignment padding 27965: Remove unused CORE macro definition 28048: Enable hsdis for loongarch64 commit 90ce205 Author: loongson-jvm <jvm@loongson.cn> Date: Wed Sep 21 09:02:25 2022 +0800 Update to jdk-20+15 27984: LA port of 8293353: [BACKOUT] G1: Remove redundant is-marking-active checks in C1 barrier 27982: LA port of 8292584: assert(cb != __null) failed: must be with -XX:-Inline commit 1eb1c75 Merge: 0657abd 95c7c55 Author: aoqi <aoqi@loongson.cn> Date: Tue Sep 20 21:16:25 2022 +0800 Merge commit 0657abd Author: loongson-jvm <jvm@loongson.cn> Date: Mon Sep 19 17:56:00 2022 +0800 Update to jdk-20+13 27971: failed to build after JDK-8290025 27970: LA port of 8282410: Remove SA ProcDebugger support 27969: LA port of 8292890: Remove PrintTouchedMethodsAtExit and LogTouchedMethods 27968: LA port of 8290025: Remove the Sweeper commit 9b721b1 Merge: 3e50300 0d51f63 Author: aoqi <aoqi@loongson.cn> Date: Mon Sep 19 11:28:17 2022 +0800 Merge commit 3e50300 Author: loongson-jvm <jvm@loongson.cn> Date: Sat Sep 17 23:40:43 2022 +0800 Update to jdk-20+12 27637: LA port of 8292267: Clean up synchronizer.hpp commit aba80ba Merge: b7e3b3b 7b81a9c Author: aoqi <aoqi@loongson.cn> Date: Sat Sep 17 18:14:48 2022 +0800 Merge commit b7e3b3b Author: loongson-jvm <jvm@loongson.cn> Date: Sat Sep 17 09:42:52 2022 +0800 Update (2022.09.16) 27686: Fix encoding of Assembler::amadd_d 27605: C1: Skip RX in register saver commit 896b64e Author: loongson-jvm <jvm@loongson.cn> Date: Wed Sep 14 21:17:04 2022 +0800 Update (2022.09.14) (openjdk#4) 27793: reduce some CodeBuffer size 27659: Make in_scratch_emit_size a virtual method 27683: Method activation needs more stack words 27583: [C2] Remove reg_class no_Ax_reg and no_T8_reg 27627: Basic type should be 64-bit supported 27751: MacroAssembler::argument_address should not blows arg_slot 25965: Allow larger CodeEntryAlignment 27824: Remove redundant ld_ptr/st_ptr assembler 27898: libsaproc: Fix compile errors on upstream system commit e45ae0f Author: loongson-jvm <jvm@loongson.cn> Date: Sat Sep 3 18:40:22 2022 +0800 Update (2022.09.03) (openjdk#3) 23864: Fix caller saved fpu regset 27580: Delete MIPS instructions in LA files 26659: Fix push_fpu/pop_fpu typo and implement push_vp/pop_vp to save/restore vector register commit 57e68ca Author: loongson-jvm <jvm@loongson.cn> Date: Fri Sep 2 16:05:19 2022 +0800 Update (2022.09.02) (openjdk#2) 27335: [C2] Make FP register allocable 27449: Codebuffer shared stubs enhancement 27464: [C2] Fix conditionally allocatable S5 to get correct ALL_REG_mask.size() 20630: [C2] adjust register pressure closer to allocable size 22010: Refactor fast_lock/unlock assembler 23531: Support monitor count 27499: LA port of JDK-8285435: Show file and line in MacroAssembler::verify_oop for AArch64 and RISC-V platforms (Port from x86) 27338: [JVMCI] Implement JVMCI for LoongArch64 27492: unify offsets of framePoint whether javaFrame of nativeFrame 27576: Revert MacroAssembler::remove_frame 26091: C1: Enable optimizations for RISC-V and LoongArch 27183: [C2] Make T4 allocatable 26733: C2: Load float immediate by vldi 27611: build failed with --disable-precompiled-headers 26284: Rectification of JNI argument shuffling 27604: Add reg class no_CR_reg 27648: Recursive locking case is not triggered in fast_lock commit 1093dc1 Author: loongson-jvm <43648753+loongson-jvm@users.noreply.github.com> Date: Fri Sep 2 09:13:47 2022 +0800 Update (2022.09.01) * 27085: 8291640: java/beans/XMLDecoder/8028054/Task.java should use the 3-arg Class.forName * 23726: LA port of 8265245: depChecker_<cpu> don't have any functionalities * 27130: revert c-call convention part of 27086 * 27445: LA port of 8243392: Remodel CDS/Metaspace storage reservation * 27427: Normalized the use of loongarch in comments * 27395: C2: Mark non-volatile floating-registers as SOE * 27363: Implement ZSaveLiveRegisters * 27062: 8292362: java/lang/Thread/jni/AttachCurrentThread/AttachTest.java#id1 failed on some platforms commit fee26ec Author: aoqi <aoqi@loongson.cn> Date: Fri Aug 12 15:10:33 2022 +0800 update to jdk-20+10 27360: LA port of 8290840: Refactor the "os" class commit 2b121ae Merge: 8e4e305 e4925a3 Author: aoqi <aoqi@loongson.cn> Date: Fri Aug 12 15:07:09 2022 +0800 Merge commit 8e4e305 Author: aoqi <aoqi@loongson.cn> Date: Thu Aug 11 21:07:56 2022 +0800 update to jdk-20+9 27312: LA port of 8291106: ZPlatformGranuleSizeShift is redundant 27311: LA port of 8291000: C2: Purge LoadPLocked and Store*Conditional nodes commit 17cd2c4 Merge: 526ad75 13f0f12 Author: aoqi <aoqi@loongson.cn> Date: Thu Aug 11 15:06:51 2022 +0800 Merge commit 526ad75 Author: aoqi <aoqi@loongson.cn> Date: Thu Aug 11 14:32:45 2022 +0800 Initial Linux/LoongArch64 Port A complete (i.e., template interpreter, C1 JIT compiler, C2 JIT compiler, Vector API, ZGC and Shenandoah GC) LoongArch64 port has been implemented. Co-authored-by: Ao Qi <aoqi@loongson.cn> Co-authored-by: Wang Rui <wangrui@loongson.cn> Co-authored-by: Zhai Xiang <zhaixiang@loongson.cn> Co-authored-by: Wang Haomin <wanghaomin@loongson.cn> Co-authored-by: Sun Guoyun <sunguoyun@loongson.cn> Co-authored-by: Pan Xuefeng <panxuefeng@loongson.cn> Co-authored-by: Sun Xu <sunxu01@loongson.cn>
1 parent 8153097 commit 83171fc

File tree

308 files changed

+80326
-223
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

308 files changed

+80326
-223
lines changed

make/autoconf/jvm-features.m4

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@
2323
# questions.
2424
#
2525

26+
#
27+
# This file has been modified by Loongson Technology in 2022. These
28+
# modifications are Copyright (c) 2020, 2022, Loongson Technology, and are made
29+
# available on the same license terms set forth above.
30+
#
31+
2632
###############################################################################
2733
# Terminology used in this file:
2834
#
@@ -283,6 +289,8 @@ AC_DEFUN_ONCE([JVM_FEATURES_CHECK_JVMCI],
283289
AC_MSG_RESULT([yes])
284290
elif test "x$OPENJDK_TARGET_CPU" = "xriscv64"; then
285291
AC_MSG_RESULT([yes])
292+
elif test "x$OPENJDK_TARGET_CPU" = "xloongarch64"; then
293+
AC_MSG_RESULT([yes])
286294
else
287295
AC_MSG_RESULT([no, $OPENJDK_TARGET_CPU])
288296
AVAILABLE=false
@@ -300,7 +308,8 @@ AC_DEFUN_ONCE([JVM_FEATURES_CHECK_SHENANDOAHGC],
300308
if test "x$OPENJDK_TARGET_CPU_ARCH" = "xx86" || \
301309
test "x$OPENJDK_TARGET_CPU" = "xaarch64" || \
302310
test "x$OPENJDK_TARGET_CPU" = "xppc64le" || \
303-
test "x$OPENJDK_TARGET_CPU" = "xriscv64"; then
311+
test "x$OPENJDK_TARGET_CPU" = "xriscv64" || \
312+
test "x$OPENJDK_TARGET_CPU" = "xloongarch64"; then
304313
AC_MSG_RESULT([yes])
305314
else
306315
AC_MSG_RESULT([no, $OPENJDK_TARGET_CPU])
@@ -358,6 +367,13 @@ AC_DEFUN_ONCE([JVM_FEATURES_CHECK_ZGC],
358367
AC_MSG_RESULT([no, $OPENJDK_TARGET_OS-$OPENJDK_TARGET_CPU])
359368
AVAILABLE=false
360369
fi
370+
elif test "x$OPENJDK_TARGET_CPU" = "xloongarch64"; then
371+
if test "x$OPENJDK_TARGET_OS" = "xlinux"; then
372+
AC_MSG_RESULT([yes])
373+
else
374+
AC_MSG_RESULT([no, $OPENJDK_TARGET_OS-$OPENJDK_TARGET_CPU])
375+
AVAILABLE=false
376+
fi
361377
else
362378
AC_MSG_RESULT([no, $OPENJDK_TARGET_OS-$OPENJDK_TARGET_CPU])
363379
AVAILABLE=false

make/autoconf/platform.m4

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@
2323
# questions.
2424
#
2525

26+
#
27+
# This file has been modified by Loongson Technology in 2023. These
28+
# modifications are Copyright (c) 2018, 2023, Loongson Technology, and are made
29+
# available on the same license terms set forth above.
30+
#
31+
2632
# Support macro for PLATFORM_EXTRACT_TARGET_AND_BUILD.
2733
# Converts autoconf style CPU name to OpenJDK style, into
2834
# VAR_CPU, VAR_CPU_ARCH, VAR_CPU_BITS and VAR_CPU_ENDIAN.
@@ -545,11 +551,20 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS_HELPER],
545551
HOTSPOT_$1_CPU=ppc_64
546552
elif test "x$OPENJDK_$1_CPU" = xppc64le; then
547553
HOTSPOT_$1_CPU=ppc_64
554+
elif test "x$OPENJDK_$1_CPU" = xloongarch; then
555+
HOTSPOT_$1_CPU=loongarch_64
556+
elif test "x$OPENJDK_$1_CPU" = xloongarch64; then
557+
HOTSPOT_$1_CPU=loongarch_64
548558
fi
549559
AC_SUBST(HOTSPOT_$1_CPU)
550560
551561
# This is identical with OPENJDK_*, but define anyway for consistency.
552562
HOTSPOT_$1_CPU_ARCH=${OPENJDK_$1_CPU_ARCH}
563+
# Override hotspot cpu definitions for LOONGARCH platforms
564+
if test "x$OPENJDK_$1_CPU" = xloongarch64; then
565+
HOTSPOT_TARGET_CPU_ARCH=loongarch
566+
fi
567+
553568
AC_SUBST(HOTSPOT_$1_CPU_ARCH)
554569
555570
# Setup HOTSPOT_$1_CPU_DEFINE
@@ -569,6 +584,8 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS_HELPER],
569584
HOTSPOT_$1_CPU_DEFINE=PPC64
570585
elif test "x$OPENJDK_$1_CPU" = xriscv64; then
571586
HOTSPOT_$1_CPU_DEFINE=RISCV64
587+
elif test "x$OPENJDK_$1_CPU" = xloongarch64; then
588+
HOTSPOT_$1_CPU_DEFINE=LOONGARCH64
572589
573590
# The cpu defines below are for zero, we don't support them directly.
574591
elif test "x$OPENJDK_$1_CPU" = xsparc; then
@@ -581,8 +598,6 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS_HELPER],
581598
HOTSPOT_$1_CPU_DEFINE=S390
582599
elif test "x$OPENJDK_$1_CPU" = xs390x; then
583600
HOTSPOT_$1_CPU_DEFINE=S390
584-
elif test "x$OPENJDK_$1_CPU" = xloongarch64; then
585-
HOTSPOT_$1_CPU_DEFINE=LOONGARCH64
586601
elif test "x$OPENJDK_$1_CPU" != x; then
587602
HOTSPOT_$1_CPU_DEFINE=$(echo $OPENJDK_$1_CPU | tr a-z A-Z)
588603
fi
Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
/*
2+
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
3+
* Copyright (c) 2015, 2023, Loongson Technology. All rights reserved.
4+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5+
*
6+
* This code is free software; you can redistribute it and/or modify it
7+
* under the terms of the GNU General Public License version 2 only, as
8+
* published by the Free Software Foundation.
9+
*
10+
* This code is distributed in the hope that it will be useful, but WITHOUT
11+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13+
* version 2 for more details (a copy is included in the LICENSE file that
14+
* accompanied this code).
15+
*
16+
* You should have received a copy of the GNU General Public License version
17+
* 2 along with this work; if not, write to the Free Software Foundation,
18+
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19+
*
20+
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21+
* or visit www.oracle.com if you need additional information or have any
22+
* questions.
23+
*
24+
*/
25+
26+
#include "precompiled.hpp"
27+
#include "ci/ciMethod.hpp"
28+
#include "interpreter/interpreter.hpp"
29+
#include "oops/klass.inline.hpp"
30+
#include "runtime/frame.inline.hpp"
31+
32+
int AbstractInterpreter::BasicType_as_index(BasicType type) {
33+
int i = 0;
34+
switch (type) {
35+
case T_BOOLEAN: i = 0; break;
36+
case T_CHAR : i = 1; break;
37+
case T_BYTE : i = 2; break;
38+
case T_SHORT : i = 3; break;
39+
case T_INT : i = 4; break;
40+
case T_LONG :
41+
case T_VOID :
42+
case T_FLOAT :
43+
case T_DOUBLE : i = 5; break;
44+
case T_OBJECT :
45+
case T_ARRAY : i = 6; break;
46+
default : ShouldNotReachHere();
47+
}
48+
assert(0 <= i && i < AbstractInterpreter::number_of_result_handlers,
49+
"index out of bounds");
50+
return i;
51+
}
52+
53+
// How much stack a method activation needs in words.
54+
int AbstractInterpreter::size_top_interpreter_activation(Method* method) {
55+
const int entry_size = frame::interpreter_frame_monitor_size();
56+
57+
// total overhead size: entry_size + (saved fp thru expr stack
58+
// bottom). be sure to change this if you add/subtract anything
59+
// to/from the overhead area
60+
const int overhead_size =
61+
-(frame::interpreter_frame_initial_sp_offset) + entry_size;
62+
63+
const int stub_code = frame::entry_frame_after_call_words;
64+
assert(method != nullptr, "invalid method");
65+
const int method_stack = (method->max_locals() + method->max_stack()) *
66+
Interpreter::stackElementWords;
67+
return (overhead_size + method_stack + stub_code);
68+
}
69+
70+
// asm based interpreter deoptimization helpers
71+
int AbstractInterpreter::size_activation(int max_stack,
72+
int temps,
73+
int extra_args,
74+
int monitors,
75+
int callee_params,
76+
int callee_locals,
77+
bool is_top_frame) {
78+
// Note: This calculation must exactly parallel the frame setup
79+
// in AbstractInterpreterGenerator::generate_method_entry.
80+
81+
// fixed size of an interpreter frame:
82+
int overhead = frame::sender_sp_offset -
83+
frame::interpreter_frame_initial_sp_offset;
84+
// Our locals were accounted for by the caller (or last_frame_adjust
85+
// on the transition) Since the callee parameters already account
86+
// for the callee's params we only need to account for the extra
87+
// locals.
88+
int size = overhead +
89+
(callee_locals - callee_params)*Interpreter::stackElementWords +
90+
monitors * frame::interpreter_frame_monitor_size() +
91+
temps* Interpreter::stackElementWords + extra_args;
92+
93+
return size;
94+
}
95+
96+
void AbstractInterpreter::layout_activation(Method* method,
97+
int tempcount,
98+
int popframe_extra_args,
99+
int moncount,
100+
int caller_actual_parameters,
101+
int callee_param_count,
102+
int callee_locals,
103+
frame* caller,
104+
frame* interpreter_frame,
105+
bool is_top_frame,
106+
bool is_bottom_frame) {
107+
// Note: This calculation must exactly parallel the frame setup
108+
// in AbstractInterpreterGenerator::generate_method_entry.
109+
// If interpreter_frame!=nullptr, set up the method, locals, and monitors.
110+
// The frame interpreter_frame, if not null, is guaranteed to be the
111+
// right size, as determined by a previous call to this method.
112+
// It is also guaranteed to be walkable even though it is in a skeletal state
113+
114+
// fixed size of an interpreter frame:
115+
116+
int max_locals = method->max_locals() * Interpreter::stackElementWords;
117+
int extra_locals = (method->max_locals() - method->size_of_parameters()) * Interpreter::stackElementWords;
118+
119+
#ifdef ASSERT
120+
assert(caller->sp() == interpreter_frame->sender_sp(), "Frame not properly walkable(2)");
121+
#endif
122+
123+
interpreter_frame->interpreter_frame_set_method(method);
124+
// NOTE the difference in using sender_sp and interpreter_frame_sender_sp
125+
// interpreter_frame_sender_sp is the original sp of the caller (the unextended_sp)
126+
// and sender_sp is fp+8
127+
intptr_t* locals = interpreter_frame->sender_sp() + max_locals - 1;
128+
129+
#ifdef ASSERT
130+
if (caller->is_interpreted_frame()) {
131+
assert(locals < caller->fp() + frame::interpreter_frame_initial_sp_offset, "bad placement");
132+
}
133+
#endif
134+
135+
interpreter_frame->interpreter_frame_set_locals(locals);
136+
BasicObjectLock* montop = interpreter_frame->interpreter_frame_monitor_begin();
137+
BasicObjectLock* monbot = montop - moncount;
138+
interpreter_frame->interpreter_frame_set_monitor_end(montop - moncount);
139+
140+
//set last sp;
141+
intptr_t* esp = (intptr_t*) monbot - tempcount*Interpreter::stackElementWords -
142+
popframe_extra_args;
143+
interpreter_frame->interpreter_frame_set_last_sp(esp);
144+
// All frames but the initial interpreter frame we fill in have a
145+
// value for sender_sp that allows walking the stack but isn't
146+
// truly correct. Correct the value here.
147+
//
148+
if (extra_locals != 0 &&
149+
interpreter_frame->sender_sp() == interpreter_frame->interpreter_frame_sender_sp() ) {
150+
interpreter_frame->set_interpreter_frame_sender_sp(caller->sp() + extra_locals);
151+
}
152+
*interpreter_frame->interpreter_frame_cache_addr() = method->constants()->cache();
153+
*interpreter_frame->interpreter_frame_mirror_addr() = method->method_holder()->java_mirror();
154+
}
155+

0 commit comments

Comments
 (0)