Skip to content

Commit de5e86d

Browse files
committed
LOONGSON: LoongArch port
Rebased-by: xtex <xtex@aosc.io> Squashed commit of the following: commit 1e9bfdb0be0d81b59cbaa0096b33294eb84b9acd Merge: 1e63782b81e8 dfcd8d2 Author: aoqi <aoqi@loongson.cn> Date: Thu Oct 17 09:28:39 2024 +0800 Merge commit 1e63782b81e88ed5bff353b4bddedcce288b96eb Author: loongson-jvm <jvm@loongson.cn> Date: Thu Oct 17 09:28:05 2024 +0800 Update (2024.10.16, 2nd) 34942: 8338748: [17u,21u] Test Disconnect.java compile error: cannot find symbol after JDK-8299813 commit 8f0b7c7b1c6df8722d53f46309a5160b1a83b5c9 Merge: 88873b8fe094 b99bff9 Author: aoqi <aoqi@loongson.cn> Date: Wed Oct 16 17:44:48 2024 +0800 Merge commit 88873b8fe0940d20186af6d834a928054bae4461 Author: loongson-jvm <jvm@loongson.cn> Date: Wed Oct 16 17:43:29 2024 +0800 Update (2024.10.16) 34617: LA port of 8333354: ubsan: frame.inline.hpp:91:25: and src/hotspot/share/runtime/frame.inline.hpp:88:29: runtime error: member call on null pointer of type 'const struct SmallRegisterMap' 34182: LA port of 8329258: TailCall should not use frame pointer register for jump target 34100: LA port of 8325469: Freeze/Thaw code can crash in the presence of OSR frames 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 fdcbc441ae07832e92ae2f92d10f5d92a130b8da Merge: 21396b1c331c 33f4d80 Author: aoqi <aoqi@loongson.cn> Date: Wed Oct 16 15:08:06 2024 +0800 Merge commit 21396b1c331c81fb95bf42772e242e49d3d1cf0e Merge: c42b99b5d290 d6e8788 Author: aoqi <aoqi@loongson.cn> Date: Fri Jul 19 11:11:34 2024 +0800 Merge commit c42b99b5d290227bd46c8d09a35c5c56721a7a2a Merge: e656407d8685 a0b3c6c Author: aoqi <aoqi@loongson.cn> Date: Fri Jul 19 11:11:02 2024 +0800 Merge commit e656407d868508caae67d032fd32db6e0d4c9ed4 Author: loongson-jvm <jvm@loongson.cn> Date: Fri Jul 19 11:09:17 2024 +0800 Update (2024.07.19, 2nd) 33726: Link time optimization breaks build: no match insn: amcas_db_d $r12,$r25,$r15 34106: merge three or more continuous membars to one 33980: Fix generate__kernel_rem_pio2 commit 5ff4b49cde19f99eef702e1c010c7fd9fd2428c3 Author: loongson-jvm <jvm@loongson.cn> Date: Fri Jul 19 10:44:57 2024 +0800 Update (2024.07.19) 33974: LA port of 8322962: Upcall stub might go undetected when freezing frames 33435: LA port of 8320275: assert(_chunk->bitmap().at(index)) failed: Bit not set at index 31743: LA port of 8312014: [s390x] TestSigInfoInHsErrFile.java Failure commit f2febd07b69102a3522eec4fbb50e7b00a916171 Merge: a54f4f287b12 2971cb5 Author: aoqi <aoqi@loongson.cn> Date: Fri Jul 19 10:24:57 2024 +0800 Merge commit a54f4f287b121d2eae46b3faea0cff942a683312 Author: Ao Qi <6079963+theaoqi@users.noreply.github.com> Date: Tue May 14 11:04:07 2024 +0800 Update (2024.05.14) amend Rename createJavaProcessBuilder commit 68b3b27716a88a99b972683803370dc88544ca96 Author: loongson-jvm <jvm@loongson.cn> Date: Fri Apr 26 18:06:41 2024 +0800 Update (2024.04.26, 2nd) 34058: LA port of 8322122: Enhance generation of addresses commit 9888334a6b847043fc19c2079b252bc842c99b65 Merge: 2e3590a6d244 05f18b1 Author: aoqi <aoqi@loongson.cn> Date: Fri Apr 26 17:55:48 2024 +0800 Merge commit 2e3590a6d24424ac42e5bd376f80bbe1e9e56bad Author: loongson-jvm <jvm@loongson.cn> Date: Fri Apr 26 17:54:07 2024 +0800 Update (2024.04.26) 31556: Supplement missing nodes about CMoveF/D 33160: LA port of 8261837: SIGSEGV in ciVirtualCallTypeData::translate_from 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 33230: LA port of 8321269: Require platforms to define DEFAULT_CACHE_LINE_SIZE commit e5bd59648904d72353c8016e53c2b8a7836bc481 Merge: b79d5ae5e156 36b5ac4 Author: aoqi <aoqi@loongson.cn> Date: Fri Apr 26 17:41:40 2024 +0800 Merge commit b79d5ae5e15668f3984e573930a2f6cc064afe5d Author: loongson-jvm <jvm@loongson.cn> Date: Mon Jan 29 18:22:54 2024 +0800 Update (2024.01.29) 32358: LA port of 8310596: Utilize existing method frame::interpreter_frame_monitor_size_in_bytes() 31534: LA port of 8309209: C2 failed "assert(_stack_guard_state == stack_guard_reserved_disabled) failed: inconsistent state" 32616: LA port of 8316179: Use consistent naming for lightweight locking in MacroAssembler ProcessTools fix commit 0479ac7d0075c77606e18fc28bcc165016123510 Merge: 451be8fcd80d 375769c Author: aoqi <aoqi@loongson.cn> Date: Mon Jan 29 16:25:34 2024 +0800 Merge commit 451be8fcd80da8b58ef878a32699e959d90c59f6 Author: loongson-jvm <jvm@loongson.cn> Date: Fri Jan 26 16:02:55 2024 +0800 Update (2024.01.26, 4th) 33257: java/lang/Math/RoundTests.java failed with -Xcomp after 32796 commit 797f2a28bbefc3e96d7e4eca4e4e854878d4a946 Author: loongson-jvm <jvm@loongson.cn> Date: Fri Jan 26 15:45:09 2024 +0800 Update (2024.01.26, 3rd) 24527: Fix a typo for invokeinterface in openjdk#8604 29494: Fix assert(_succ != current) failed: invariant 32874: Amend 30985: Insert acqure membar for load-exclusive with acquire to fix typo 29823: Fix ShenandoahGC cmpxchg_oop register be clobbered issue 32796: Rethinking the ties-to-positive round mode 32688: Revamp the SIMD string compress routines commit 3cd251b662a4bdad34b60432f7ec4d419fda8d06 Author: loongson-jvm <jvm@loongson.cn> Date: Fri Jan 26 15:24:57 2024 +0800 Update (2024.01.26, 2nd) 33068: Vectorize StringCompareToDifferentLength 33080: Fix byte_array_inflate vld is out of range 33031: Refresh the CountPositives macro 32603: Mux generate_fill for the ClearArray node 29793: Expurgating call_stub_entry commit 73acfae6df6519b11f52c342e0213e23b9cec9a8 Author: loongson-jvm <jvm@loongson.cn> Date: Fri Jan 26 14:59:30 2024 +0800 Update (2024.01.26) 32186: LA port of 8314020: Print instruction blocks in byte units 32079: LA port of 8313796: AsyncGetCallTrace crash on unreadable interpreter method pointer commit c1ce7c271a54c331585dc82978f8d2ba71645127 Merge: 2557e0ff7005 060c4f7 Author: aoqi <aoqi@loongson.cn> Date: Fri Jan 26 14:30:04 2024 +0800 Merge commit 2557e0ff70053157fcf79cb9b36bfaa10050d946 Author: loongson-jvm <jvm@loongson.cn> Date: Fri Jan 12 10:59:35 2024 +0800 Update (2024.01.12, 2nd) 32506: Vectorize the C2 node string_inflate to imporve the score of CharBufferAppend.appendStringBuilder 32419: Vectorized StubGenerator::generate_fill() 30382: LA port of 8292591: Experimentally add back barrier-less Java thread transitions 32365: Support comparison of DecodeN with zero 24480: [LA][C2] Eliminate unnecessary CastP2X 32266: [C2] Effect TEMP_DEF res for get_and_set/add 31769: [6000] Support AM{SWAP/ADD}{_DB}.{B/H} and AMCAS{_DB}.{B/H/W/D} insns 32268: [shenandoah] Use indirect memory operand for cmpxchg 31751: Use base+disp for cmpxchg 30985: Insert acqure membar for load-exclusive with acquire 31863: [C2] Effect TEMP_DEF res for cmpxchg commit 73075208466960879bf48be6dc54a84bf1113716 Author: loongson-jvm <jvm@loongson.cn> Date: Fri Jan 12 00:23:18 2024 +0800 Update (2024.01.12) 32519: Fix for 31967 set default MaxGCPauseMillis 31967: [G1GC] Set default MaxGCPauseMillis=150ms 32446: Fix the error of assert(v_align > 1) when MaxVectorSize is 4 or 8 commit 1ec5e046959fa9d3905e5f8b73a6e349a4b7e95f Author: loongson-jvm <jvm@loongson.cn> Date: Thu Jan 11 13:31:01 2024 +0800 Update (2024.01.11, 7th) 30718: Implement PopulateIndex 30721: Implement SignumF/D and SignumVF/D 30508: Add 32, 64bit vectorAPI of HF2F, F2HF 32377: Optimize VectorMaskFirstTrue 32328: implement the intrinsic of ShiftRightImplWork 31838: 32 and 64 bits vector implementation 32304: Decompose the rem calculation in the DivMod nodes commit efb109f4d1f8fbd31e8eadd9c5b848fe4b5d67c0 Author: loongson-jvm <jvm@loongson.cn> Date: Thu Jan 11 12:44:57 2024 +0800 Update (2024.01.11, 6th) 32163: The size of is_wide_vector should be greater than 8 bytes commit a8525b812a58df80432570556e16e903c7569409 Author: loongson-jvm <jvm@loongson.cn> Date: Thu Jan 11 12:02:37 2024 +0800 Update (2024.01.11, 5th) 32093: Add CMoveD-CmpN node 31973: LA port of 8313023: Return value corrupted when using CCS + isTrivial (mainline) commit 350030440ab7b863166393a8ee328d60316be0e6 Merge: bcf24afe39a1 890adb6 Author: aoqi <aoqi@loongson.cn> Date: Thu Jan 11 11:51:44 2024 +0800 Merge commit bcf24afe39a17e92622c44af11ed79f48bfb657d Author: loongson-jvm <jvm@loongson.cn> Date: Thu Jan 11 11:49:46 2024 +0800 Update (2024.01.11, 4th) 31927: Typo in xBarrierSetAssembler_loongarch.cpp amend Rename createJavaProcessBuilder commit 5543f883944cc75c615fdecc9478c95926e38cf6 Merge: b2d81d05e49d a10dbce Author: aoqi <aoqi@loongson.cn> Date: Thu Jan 11 11:18:22 2024 +0800 Merge commit b2d81d05e49def94e8284774c5120c2fbbd99a8d Author: loongson-jvm <jvm@loongson.cn> Date: Thu Jan 11 11:17:12 2024 +0800 Update (2024.01.11, 3rd) 31742: LA port of 8303134: JFR: Missing stack trace during chunk rotation stress commit 9aaacf4c38a13d2b6ab90763f9c5d34cd65f3ec0 Merge: 94dd13a83eb2 fde53fc Author: aoqi <aoqi@loongson.cn> Date: Thu Jan 11 10:37:27 2024 +0800 Merge commit 94dd13a83eb2a23937debda8deccf1c1398e1870 Author: loongson-jvm <jvm@loongson.cn> Date: Thu Jan 11 10:27:55 2024 +0800 Update (2024.01.11, 2nd) 31469: LA port of 8310459: [BACKOUT] 8304450: [vectorapi] Refactor VectorShuffle implementation commit 7082651ed37a99a441d7e8cc83c7a444903bb136 Merge: 5e2547d409e4 e67393f Author: aoqi <aoqi@loongson.cn> Date: Thu Jan 11 10:11:13 2024 +0800 Merge commit 5e2547d409e444e4c16c7f5fe898298c7bd98a62 Author: loongson-jvm <jvm@loongson.cn> Date: Thu Jan 11 10:02:10 2024 +0800 Update (2024.01.11) 11541: Prevent load reorder of VarHandle::getOpaque 31269: Ordering memory barriers testcases 31601: revert some copyright update by loongson 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 54f2095 commit de5e86d

File tree

304 files changed

+79760
-221
lines changed

Some content is hidden

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

304 files changed

+79760
-221
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 & 0 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 2022. These
28+
# modifications are Copyright (c) 2018, 2022, 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
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)