Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8276799: Implementation of JEP 422: Linux/RISC-V Port #5

Closed
wants to merge 162 commits into from
Closed
Changes from all commits
Commits
Show all changes
162 commits
Select commit Hold shift + click to select a range
ca2888c
Set project to riscv-port
RealFYang Jun 28, 2023
78922dc
Merge branch 'master' into riscv-port
RealFYang Jul 9, 2023
8907d7d
Merge branch 'master' into riscv-port
RealFYang Jul 27, 2023
0708236
Merge remote-tracking branch 'origin/master' into riscv-port
RealFYang Aug 5, 2023
7cdc187
Merge remote-tracking branch 'origin/master' into riscv-port
RealFYang Aug 16, 2023
b9c9c2c
Merge remote-tracking branch 'origin/master' into riscv-port
RealFYang Aug 20, 2023
dfa7925
Cherry-picked JDK-8276799: initial load of RISC-V backend (cannot pas…
RealFYang Mar 24, 2022
c51e546
Drop zgc part
zhengxiaolinX Mar 28, 2023
7772140
Drop the C2 Vector part
zhengxiaolinX Mar 27, 2023
b2011ba
Revert:
zhengxiaolinX Mar 27, 2023
a032c61
Revert JDK-8221554: aarch64 cross-modifying code
zhengxiaolinX May 1, 2023
fd89cf6
Revert JDK-8242263: Diagnose synchronization on primitive wrappers
zhengxiaolinX Apr 30, 2023
feea78c
Revert JDK-8278104: C1 should support the compiler directive 'BreakAt…
zhengxiaolinX Apr 30, 2023
651009a
Revert:
zhengxiaolinX Apr 29, 2023
b078a2e
Revert JDK-8229258: Rework markOop and markOopDesc into a simpler mar…
zhengxiaolinX Apr 25, 2023
4b27cd8
Revert:
zhengxiaolinX Mar 31, 2023
d1b463b
Revert JDK-8173585: Intrinsify StringLatin1.indexOf(char)
zhengxiaolinX Mar 31, 2023
a0cdf8d
Revert JDK-8281632: riscv: Improve interpreter stack banging, and cha…
zhengxiaolinX Apr 4, 2023
8db4bf1
Port aarch64 style sig handler from os_linux_aarch64.cpp
zhengxiaolinX Apr 4, 2023
fd38974
Revert:
zhengxiaolinX Apr 4, 2023
892b40a
Revert JDK-8263002: Remove CDS MiscCode region
zhengxiaolinX Apr 4, 2023
945a317
Revert JDK-8254158: Consolidate per-platform stack overflow handling …
zhengxiaolinX Apr 4, 2023
c1a03e0
Revert JDK-8202579: Revisit VM_Version and VM_Version_ext for overlap…
zhengxiaolinX Apr 4, 2023
0cfdbd8
Revert JDK-8191278: MappedByteBuffer bulk access memory failures are …
zhengxiaolinX Apr 4, 2023
dd6a7c5
Revert JDK-8282085: The REGISTER_DEFINITION macro is useless after JD…
zhengxiaolinX Apr 6, 2023
561261b
Revert JDK-7175279: Don't use x87 FPU on x86-64
zhengxiaolinX Apr 6, 2023
ff4e144
Revert JDK-8255909: Remove unused delayed_value methods
zhengxiaolinX Apr 6, 2023
afe35a3
Revert JDK-8263679: C1: Remove vtable call
zhengxiaolinX Apr 6, 2023
655b34c
Revert JDK-8264063: Outer Safepoint poll load should not reference th…
zhengxiaolinX Apr 6, 2023
4a6f7da
Revert:
zhengxiaolinX Apr 6, 2023
4b0f208
Revert JDK-8256238: Remove Matcher::pass_original_key_for_aes
zhengxiaolinX Apr 6, 2023
36d7ece
Revert JDK-8242492: C2: Remove Matcher::vector_shift_count_ideal_reg()
zhengxiaolinX Apr 6, 2023
b78e448
Revert JDK-8266937: Remove Compile::reshape_address
zhengxiaolinX Apr 6, 2023
cd34a5c
Revert JDK-8272771: frame::pd_ps() is not implemented on any platform
zhengxiaolinX Apr 6, 2023
bdb16da
Revert JDK-8268858: Determine register pressure automatically by the …
zhengxiaolinX Apr 6, 2023
bbaa7a9
Revert JDK-8253040: Remove unused Matcher::regnum_to_fpu_offset()
zhengxiaolinX Apr 6, 2023
ce9ad0a
Revert JDK-8254084: Remove TemplateTable::pd_initialize
zhengxiaolinX Apr 6, 2023
4942918
Revert JDK-8224815: 8224815: Remove non-GC uses of CollectedHeap::is_…
zhengxiaolinX Apr 6, 2023
a71fabb
Revert JDK-8253540: InterpreterRuntime::monitorexit should be a JRT_L…
zhengxiaolinX Apr 6, 2023
a0b18ee
Revert JDK-8278387: riscv: Implement UseHeavyMonitors consistently &&…
zhengxiaolinX Apr 7, 2023
1e844b8
Revert JDK-8258192: Obsolete the CriticalJNINatives flag. CriticalJNI…
zhengxiaolinX Apr 4, 2023
58ad930
8202976: Add C1 lea patching support for x86 (RISC-V part)
zhengxiaolinX Apr 11, 2023
2074b8e
Revert 8232365: Implementation for JEP 363: Remove the Concurrent Mar…
zhengxiaolinX Apr 11, 2023
f838cf4
Revert 8220051: Remove global safepoint code
zhengxiaolinX Apr 11, 2023
13faeae
Revert 8253180: ZGC: Implementation of JEP 376: ZGC: Concurrent Threa…
zhengxiaolinX Apr 11, 2023
99ca43f
JDK-8243155: AArch64: Add support for SqrtVF
zhengxiaolinX Apr 12, 2023
4bbd814
Revert JDK-8267098: AArch64: C1 StubFrames end confusingly
zhengxiaolinX Apr 12, 2023
eb37cfd
Revert JDK-8247691: [aarch64] Incorrect handling of VM exceptions in …
zhengxiaolinX Apr 12, 2023
3fa279b
Revert JDK-8212681: Refactor IC locking to use a fine grained Compile…
zhengxiaolinX Apr 13, 2023
727f1a8
Revert JDK-8225681: vmTestbase/nsk/jvmti/RedefineClasses/StressRedefi…
zhengxiaolinX Apr 13, 2023
26e3755
Revert JDK-8232046: AArch64 build failure after JDK-8225681
zhengxiaolinX Apr 13, 2023
4fc68bc
Revert JDK-8213084: Rework and enhance Print[Opto]Assembly output
zhengxiaolinX Apr 13, 2023
f660c59
Revert JDK-8241909: Remove useless code cache lookup in frame::patch_pc
zhengxiaolinX Apr 13, 2023
0d1ed43
Revert JDK-8277411: C2 fast_unlock intrinsic on AArch64 has unnecessa…
zhengxiaolinX Apr 16, 2023
cac7117
Revert JDK-8210381: Obsolete EmitSync
zhengxiaolinX Apr 16, 2023
ca7ab86
Revert JDK-8256425: Obsolete Biased Locking in JDK 18
zhengxiaolinX Apr 16, 2023
864e551
Revert JDK-8227680: FastJNIAccessors: Check for JVMTI field access ev…
zhengxiaolinX Apr 17, 2023
b822b64
Revert JDK-8249768: Move static oops and NullPointerException oops fr…
zhengxiaolinX Apr 18, 2023
c82c482
Revert JDK-8217998: Remove method_type field associated with the appe…
zhengxiaolinX Apr 18, 2023
3e50d62
Revert JDK-8277372: Add getters for BOT and card table members
zhengxiaolinX Apr 30, 2023
6a81a82
Revert JDK-8260941: Remove the conc_scan parameter for CardTable
zhengxiaolinX Apr 19, 2023
24688cb
Revert JDK-8220301: Remove jbyte use in CardTable
zhengxiaolinX Apr 19, 2023
6ee2726
Revert JDK-8230486: G1BarrierSetAssembler::g1_write_barrier_post unne…
zhengxiaolinX Apr 19, 2023
57067a3
Revert JDK-8242449: AArch64: r27 can be allocated in CompressedOops mode
zhengxiaolinX Apr 21, 2023
0db5207
A fix for interpreter frame verification code, skipping the locals ch…
zhengxiaolinX Apr 23, 2023
795da5a
ShenandoahGC adaptations on JDK11 for RISC-V backend
zhengxiaolinX Apr 11, 2023
d8b14fd
Revert JDK-8248404: AArch64: Remove uses of long and unsigned long
zhengxiaolinX Apr 25, 2023
94c1c9c
Revert JDK-8280503: Use allStatic.hpp instead of allocation.hpp where…
zhengxiaolinX Apr 25, 2023
49e6399
Revert JDK-8276453: Undefined behavior in C1 LIR_OprDesc causes SEGV …
zhengxiaolinX Apr 25, 2023
b94bda9
Revert JDK-8256205: Simplify compiler calling convention handling
zhengxiaolinX Apr 25, 2023
3fc9484
Revert JDK-8183574: Unify the is_power_of_2 functions
zhengxiaolinX Apr 25, 2023
31b18aa
Revert JDK-8276976: Rename LIR_OprDesc to LIR_Opr
zhengxiaolinX Apr 25, 2023
2e64fa4
Revert JDK-8269672: C1: Remove unaligned move on all architectures
zhengxiaolinX Apr 25, 2023
5f15abe
Revert JDK-8264805: Remove the experimental Ahead-of-Time Compiler
zhengxiaolinX Apr 25, 2023
4cfd20c
Revert JDK-8277417: C1 LIR instruction for load-klass
zhengxiaolinX Apr 25, 2023
eb4de6f
Revert JDK-8245957: Remove unused LIR_OpBranch::type after SPARC port…
zhengxiaolinX Apr 25, 2023
d34f25c
Revert JDK-8266950: Remove vestigial support for non-strict floating-…
zhengxiaolinX Apr 25, 2023
02c0a84
Revert JDK-8276217: Harmonize StrictMath intrinsics handling
zhengxiaolinX Apr 25, 2023
8dbace1
Revert JDK-8276209: Some call sites doesn't pass the parameter 'size'…
zhengxiaolinX Apr 25, 2023
8930b60
Revert JDK-8229838: Rename markOop files to markWord
zhengxiaolinX Apr 25, 2023
f11c5a2
Revert JDK-8235673: [C1, C2] Split inlining control flags
zhengxiaolinX Apr 25, 2023
6908dc5
Revert JDK-8262074: Consolidate the default value of MetaspaceSize
zhengxiaolinX Apr 25, 2023
a3e991b
Revert JDK-8246023: Obsolete LIRFillDelaySlot
zhengxiaolinX Apr 25, 2023
9f6082a
Revert JDK-8136414: Large performance penalty declaring a method stri…
zhengxiaolinX Apr 25, 2023
fbf03fc
Revert JDK-8251462: Simplify compilation policy
zhengxiaolinX Apr 25, 2023
b1f3fd0
Revert JDK-8250902: Implement MD5 Intrinsics on x86
zhengxiaolinX Apr 27, 2023
b5e96cb
Revert JDK-8253555: Make ByteSize and WordSize typed scoped enums
zhengxiaolinX Apr 27, 2023
592afab
Revert JDK-8253457: Remove unimplemented register stack functions
zhengxiaolinX Apr 29, 2023
28238cf
Revert JDK-8253539: Remove unused JavaThread functions for set_last_J…
zhengxiaolinX Apr 29, 2023
f9322bb
Revert JDK-8269853: Prefetch::read should accept pointer to const
zhengxiaolinX Apr 29, 2023
aa6f732
Revert:
zhengxiaolinX Apr 29, 2023
a588973
Revert JDK-8256254: Convert vmIntrinsics::ID to enum class
zhengxiaolinX Apr 29, 2023
245d01e
Revert JDK-8216557: Aarch64: Add support for Concurrent Class Unloading
zhengxiaolinX Apr 6, 2023
aee3144
Revert JDK-8223173: Implement fast class initialization checks on AAR…
zhengxiaolinX Apr 29, 2023
c259a42
Revert JDK-8268119: Rename copy_os_cpu.inline.hpp files to copy_os_cp…
zhengxiaolinX Apr 29, 2023
6033e30
Revert JDK-8241436: C2: Factor out C2-specific code from MacroAssembler
zhengxiaolinX Apr 29, 2023
115cd21
Revert JDK-8222297: IRT_ENTRY/IRT_LEAF etc are the same as JRT && JDK…
zhengxiaolinX Apr 30, 2023
6cbf43d
Revert JDK-8245289: Clean up offset code in JavaClasses
zhengxiaolinX Apr 30, 2023
8c9b9f4
Revert JDK-8242629: Remove references to deprecated java.util.Observe…
zhengxiaolinX Apr 30, 2023
43f2a4f
Revert JDK-8256155: Allow multiple large page sizes to be used on Linux
zhengxiaolinX Apr 30, 2023
a93191b
Revert JDK-8252204: AArch64: Implement SHA3 accelerator/intrinsic
zhengxiaolinX Apr 30, 2023
29acd4f
Revert JDK-8253717: Relocate stack overflow code out of thread.hpp/cp…
zhengxiaolinX Apr 30, 2023
6fa17c6
Revert JDK-8258459: Decouple gc_globals.hpp from globals.hpp
zhengxiaolinX Apr 30, 2023
bcc26e7
Revert JDK-8223136: Move compressed oops functions to CompressedOops …
zhengxiaolinX Apr 30, 2023
81d8ea9
Revert JDK-8247912: Make narrowOop a scoped enum
zhengxiaolinX Apr 30, 2023
f980e03
Revert JDK-8260467: Move well-known classes from systemDictionary.hpp…
zhengxiaolinX Apr 30, 2023
2c68b06
Revert JDK-8268858: Determine register pressure automatically by the …
zhengxiaolinX Apr 30, 2023
932ebd6
Revert JDK-8276563: Undefined Behaviour in class Assembler && 8257882…
zhengxiaolinX Apr 30, 2023
9c85aa8
Revert JDK-8240363: Refactor Compile::Output() to its own Phase
zhengxiaolinX Apr 30, 2023
3a58114
Revert RotateLeft && RotateRight matching rules
zhengxiaolinX Apr 30, 2023
2157738
Revert JDK-8230565: ZGC: Redesign C2 load barrier to expand on the Ma…
zhengxiaolinX Apr 30, 2023
4673921
Revert JDK-8252990: Intrinsify Unsafe.storeStoreFence
zhengxiaolinX Apr 30, 2023
e254a03
Revert JDK-8255150: Add utility methods to check long indexes and ran…
zhengxiaolinX Apr 30, 2023
2c18203
Revert reset_label part of JDK-8248411: [aarch64] Insufficient error …
zhengxiaolinX Apr 30, 2023
014972a
Revert JDK-8242289: C2: Support platform-specific node cloning in Mat…
zhengxiaolinX Apr 30, 2023
d15e155
Revert JDK-8255782: Turn UseTLAB and ResizeTLAB from product_pd to pr…
zhengxiaolinX Apr 30, 2023
f3fa0cf
Revert JDK-8265245: depChecker_<cpu> don't have any functionalities
zhengxiaolinX Apr 30, 2023
97a3d4d
Revert JDK-8241438: Move IntelJccErratum mitigation code to platform-…
zhengxiaolinX Apr 30, 2023
8a3e7b8
Revert JDK-8260355: AArch64: deoptimization stub should save vector r…
zhengxiaolinX Apr 30, 2023
5fc20f9
Revert JDK-8250914: Matcher::stack_direction() is unused
zhengxiaolinX Apr 30, 2023
aab3322
Revert CacheWB*Node matching rules
zhengxiaolinX Apr 30, 2023
705981a
Revert JDK-8263595: Remove oop type punning in JavaCallArguments
zhengxiaolinX Apr 30, 2023
bba2272
Revert JDK-8260012: Reduce inclusion of collectedHeap.hpp and heapIns…
zhengxiaolinX Apr 30, 2023
49000a4
Revert JDK-8271869: AArch64: build errors with GCC11 in frame::saved_…
zhengxiaolinX Apr 30, 2023
14a46a8
Revert JDK-8230392: Define AArch64 as MULTI_COPY_ATOMIC
zhengxiaolinX Apr 30, 2023
8740928
Revert:
zhengxiaolinX Apr 30, 2023
94b40f4
Revert JDK-8222637: Obsolete NeedsDeoptSuspend
zhengxiaolinX Apr 30, 2023
09968c9
Revert JDK-8220051: Remove global safepoint code
zhengxiaolinX Apr 30, 2023
2f4fb2b
Revert JDK-8272873: C2: Inlining should not depend on absolute call s…
zhengxiaolinX Apr 30, 2023
2df3625
Revert JDK-8220049: Obsolete ThreadLocalHandshakes
zhengxiaolinX Apr 30, 2023
a875c4c
Revert:
zhengxiaolinX Apr 30, 2023
19a9e6e
Revert JDK-8213436: Obsolete UseMembar && JDK-8188764: Obsolete Assum…
zhengxiaolinX May 10, 2023
0c4a9d1
Misc adaptations to jdk11u
zhengxiaolinX May 1, 2023
4ce5e05
Save all call-clobbered registers for spark tests may crash
zhengxiaolinX May 20, 2023
1b8778b
Build with gcc 13
kuaiwei Aug 22, 2023
49b8029
Merge remote-tracking branch 'origin/master' into riscv-port
RealFYang Aug 27, 2023
cf63613
Merge remote-tracking branch 'origin/master' into riscv-port
RealFYang Sep 4, 2023
4c23be6
Fix copyright information
kuaiwei Sep 5, 2023
16bc06c
Merge remote-tracking branch 'origin/master' into riscv-port
RealFYang Sep 8, 2023
70a060f
8247533: SA stack walking sometimes fails with sun.jvm.hotspot.debugg…
plummercj Jul 2, 2020
1940458
Merge remote-tracking branch 'origin/master' into riscv-port
RealFYang Sep 15, 2023
2cadd13
8283737: riscv: MacroAssembler::stop() should emit fixed-length instr…
zhengxiaolinX Mar 30, 2022
729e0db
8285437: riscv: Fix MachNode size mismatch for MacroAssembler::verify…
zhengxiaolinX Apr 24, 2022
5cab06c
8287418: riscv: Fix correctness issue of MacroAssembler::movptr
zhengxiaolinX May 30, 2022
41d7329
Fix: Fixed-length mv() mistakenly redirected to li() during reshaping
kuaiwei Sep 22, 2023
51cb95d
Merge remote-tracking branch 'origin/master' into riscv-port
RealFYang Sep 26, 2023
21dcf3b
Merge remote-tracking branch 'origin/master' into riscv-port
RealFYang Oct 6, 2023
7ce8b2d
Merge riscv-port
kuaiwei Oct 9, 2023
26f4b26
8293100: RISC-V: Need to save and restore callee-saved FloatRegisters…
zhengxiaolinX Sep 2, 2022
69ea557
8295926: RISC-V: C1: Fix LIRGenerator::do_LibmIntrinsic
zhengxiaolinX Oct 28, 2022
ec57f23
Fix test error after port 8295926
kuaiwei Oct 9, 2023
b115ec4
Revert JDK-8247533: SA stack walking sometimes fails with sun.jvm.hot…
kuaiwei Oct 17, 2023
de4ea77
Merge remote-tracking branch 'origin/master' into riscv-port
RealFYang Oct 18, 2023
68d4b98
Merge remote-tracking branch 'origin/master' into riscv-port
RealFYang Oct 28, 2023
5bb7be8
Merge remote-tracking branch 'origin/master' into riscv-port
RealFYang Nov 9, 2023
1ad3aac
Merge remote-tracking branch 'origin/master' into riscv-port
RealFYang Dec 2, 2023
583e938
Merge branch 'openjdk:master' into port_jdk11u_initial_patch
kuaiwei Jan 15, 2024
9fb86c9
Merge riscv-port
kuaiwei Jan 18, 2024
d616e73
Merge branch 'port_jdk11u_initial_patch' of github.com:kuaiwei/riscv-…
kuaiwei Jan 19, 2024
a0a61dd
Merge remote-tracking branch 'origin/master' into riscv-port
RealFYang Jan 21, 2024
5295936
Merge riscv-port
kuaiwei Jan 29, 2024
4b01e13
Remove unused zSyscall_linux_riscv.hpp
kuaiwei Jan 31, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .jcheck/conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[general]
project=jdk-updates
project=riscv-port
jbs=JDK
version=11.0.23

3 changes: 2 additions & 1 deletion make/autoconf/hotspot.m4
Original file line number Diff line number Diff line change
@@ -370,7 +370,8 @@ AC_DEFUN_ONCE([HOTSPOT_SETUP_JVM_FEATURES],
AC_MSG_CHECKING([if shenandoah can be built])
if HOTSPOT_CHECK_JVM_FEATURE(shenandoahgc); then
if test "x$OPENJDK_TARGET_CPU_ARCH" = "xx86" || \
test "x$OPENJDK_TARGET_CPU" = "xaarch64"; then
test "x$OPENJDK_TARGET_CPU" = "xaarch64" || \
test "x$OPENJDK_TARGET_CPU" = "xriscv64"; then
AC_MSG_RESULT([yes])
else
DISABLED_JVM_FEATURES="$DISABLED_JVM_FEATURES shenandoahgc"
8 changes: 7 additions & 1 deletion make/autoconf/libraries.m4
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2022, Oracle and/or its affiliates. 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
@@ -130,6 +130,12 @@ AC_DEFUN_ONCE([LIB_SETUP_LIBRARIES],
BASIC_JVM_LIBS="$BASIC_JVM_LIBS -lthread"
fi

# Because RISC-V only has word-sized atomics, it requries libatomic where
# other common architectures do not. So link libatomic by default.
if test "x$OPENJDK_TARGET_OS" = xlinux && test "x$OPENJDK_TARGET_CPU" = xriscv64; then
BASIC_JVM_LIBS="$BASIC_JVM_LIBS -latomic"
fi

# perfstat lib
if test "x$OPENJDK_TARGET_OS" = xaix; then
BASIC_JVM_LIBS="$BASIC_JVM_LIBS -lperfstat"
4 changes: 3 additions & 1 deletion make/autoconf/platform.m4
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2021, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2022, Oracle and/or its affiliates. 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
@@ -554,6 +554,8 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS_HELPER],
HOTSPOT_$1_CPU_DEFINE=PPC64
elif test "x$OPENJDK_$1_CPU" = xppc64le; then
HOTSPOT_$1_CPU_DEFINE=PPC64
elif test "x$OPENJDK_$1_CPU" = xriscv64; then
HOTSPOT_$1_CPU_DEFINE=RISCV64

# The cpu defines below are for zero, we don't support them directly.
elif test "x$OPENJDK_$1_CPU" = xsparc; then
8 changes: 7 additions & 1 deletion make/hotspot/gensrc/GensrcAdlc.gmk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2013, 2022, Oracle and/or its affiliates. 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
@@ -150,6 +150,12 @@ ifeq ($(call check-jvm-feature, compiler2), true)
$d/os_cpu/$(HOTSPOT_TARGET_OS)_$(HOTSPOT_TARGET_CPU_ARCH)/$(HOTSPOT_TARGET_OS)_$(HOTSPOT_TARGET_CPU_ARCH).ad \
)))

ifeq ($(HOTSPOT_TARGET_CPU_ARCH), riscv)
AD_SRC_FILES += $(call uniq, $(wildcard $(foreach d, $(AD_SRC_ROOTS), \
$d/cpu/$(HOTSPOT_TARGET_CPU_ARCH)/$(HOTSPOT_TARGET_CPU_ARCH)_b.ad \
)))
endif

ifeq ($(call check-jvm-feature, shenandoahgc), true)
AD_SRC_FILES += $(call uniq, $(wildcard $(foreach d, $(AD_SRC_ROOTS), \
$d/cpu/$(HOTSPOT_TARGET_CPU_ARCH)/gc/shenandoah/shenandoah_$(HOTSPOT_TARGET_CPU).ad \
6 changes: 4 additions & 2 deletions src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2020, Red Hat Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -1593,7 +1593,9 @@ void LIR_Assembler::emit_compare_and_swap(LIR_OpCompareAndSwap* op) {
}


void LIR_Assembler::cmove(LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, LIR_Opr result, BasicType type) {
void LIR_Assembler::cmove(LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, LIR_Opr result, BasicType type,
LIR_Opr cmp_opr1, LIR_Opr cmp_opr2) {
assert(cmp_opr1 == LIR_OprFact::illegalOpr && cmp_opr2 == LIR_OprFact::illegalOpr, "unnecessary cmp oprs on aarch64");

Assembler::Condition acond, ncond;
switch (condition) {
7 changes: 5 additions & 2 deletions src/hotspot/cpu/arm/c1_LIRAssembler_arm.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2022, Oracle and/or its affiliates. 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
@@ -1824,7 +1824,10 @@ void LIR_Assembler::emit_compare_and_swap(LIR_OpCompareAndSwap* op) {
}


void LIR_Assembler::cmove(LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, LIR_Opr result, BasicType type) {
void LIR_Assembler::cmove(LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, LIR_Opr result, BasicType type,
LIR_Opr cmp_opr1, LIR_Opr cmp_opr2) {
assert(cmp_opr1 == LIR_OprFact::illegalOpr && cmp_opr2 == LIR_OprFact::illegalOpr, "unnecessary cmp oprs on arm");

AsmCondition acond = al;
AsmCondition ncond = nv;
if (opr1 != opr2) {
8 changes: 5 additions & 3 deletions src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2019, SAP SE. All rights reserved.
* Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2021 SAP SE. 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
@@ -1553,8 +1553,10 @@ inline void load_to_reg(LIR_Assembler *lasm, LIR_Opr src, LIR_Opr dst) {
}
}

void LIR_Assembler::cmove(LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, LIR_Opr result, BasicType type,
LIR_Opr cmp_opr1, LIR_Opr cmp_opr2) {
assert(cmp_opr1 == LIR_OprFact::illegalOpr && cmp_opr2 == LIR_OprFact::illegalOpr, "unnecessary cmp oprs on ppc");

void LIR_Assembler::cmove(LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, LIR_Opr result, BasicType type) {
if (opr1->is_equal(opr2) || opr1->is_same_register(opr2)) {
load_to_reg(this, opr1, result); // Condition doesn't matter.
return;
177 changes: 177 additions & 0 deletions src/hotspot/cpu/riscv/abstractInterpreter_riscv.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
/*
* Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
* Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. 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 "interpreter/interpreter.hpp"
#include "oops/constMethod.hpp"
#include "oops/klass.inline.hpp"
#include "oops/method.hpp"
#include "runtime/frame.inline.hpp"
#include "utilities/align.hpp"
#include "utilities/debug.hpp"
#include "utilities/macros.hpp"

int AbstractInterpreter::BasicType_as_index(BasicType type) {
int i = 0;
switch (type) {
case T_BOOLEAN: i = 0; break;
case T_CHAR : i = 1; break;
case T_BYTE : i = 2; break;
case T_SHORT : i = 3; break;
case T_INT : i = 4; break;
case T_LONG : i = 5; break;
case T_VOID : i = 6; break;
case T_FLOAT : i = 7; break;
case T_DOUBLE : i = 8; break;
case T_OBJECT : i = 9; break;
case T_ARRAY : i = 9; break;
default : ShouldNotReachHere();
}
assert(0 <= i && i < AbstractInterpreter::number_of_result_handlers,
"index out of bounds");
return i;
}

// How much stack a method activation needs in words.
int AbstractInterpreter::size_top_interpreter_activation(Method* method) {
const int entry_size = frame::interpreter_frame_monitor_size();

// total overhead size: entry_size + (saved fp thru expr stack
// bottom). be sure to change this if you add/subtract anything
// to/from the overhead area
const int overhead_size =
-(frame::interpreter_frame_initial_sp_offset) + entry_size;

const int stub_code = frame::entry_frame_after_call_words;
assert_cond(method != NULL);
const int method_stack = (method->max_locals() + method->max_stack()) *
Interpreter::stackElementWords;
return (overhead_size + method_stack + stub_code);
}

// asm based interpreter deoptimization helpers
int AbstractInterpreter::size_activation(int max_stack,
int temps,
int extra_args,
int monitors,
int callee_params,
int callee_locals,
bool is_top_frame) {
// Note: This calculation must exactly parallel the frame setup
// in TemplateInterpreterGenerator::generate_method_entry.

// fixed size of an interpreter frame:
int overhead = frame::sender_sp_offset -
frame::interpreter_frame_initial_sp_offset;
// Our locals were accounted for by the caller (or last_frame_adjust
// on the transistion) Since the callee parameters already account
// for the callee's params we only need to account for the extra
// locals.
int size = overhead +
(callee_locals - callee_params) +
monitors * frame::interpreter_frame_monitor_size() +
// On the top frame, at all times SP <= ESP, and SP is
// 16-aligned. We ensure this by adjusting SP on method
// entry and re-entry to allow room for the maximum size of
// the expression stack. When we call another method we bump
// SP so that no stack space is wasted. So, only on the top
// frame do we need to allow max_stack words.
(is_top_frame ? max_stack : temps + extra_args);

// On riscv we always keep the stack pointer 16-aligned, so we
// must round up here.
size = align_up(size, 2);

return size;
}

void AbstractInterpreter::layout_activation(Method* method,
int tempcount,
int popframe_extra_args,
int moncount,
int caller_actual_parameters,
int callee_param_count,
int callee_locals,
frame* caller,
frame* interpreter_frame,
bool is_top_frame,
bool is_bottom_frame) {
// The frame interpreter_frame is guaranteed to be the right size,
// as determined by a previous call to the size_activation() method.
// It is also guaranteed to be walkable even though it is in a
// skeletal state
assert_cond(method != NULL && caller != NULL && interpreter_frame != NULL);
int max_locals = method->max_locals() * Interpreter::stackElementWords;
int extra_locals = (method->max_locals() - method->size_of_parameters()) *
Interpreter::stackElementWords;

#ifdef ASSERT
assert(caller->sp() == interpreter_frame->sender_sp(), "Frame not properly walkable");
#endif

interpreter_frame->interpreter_frame_set_method(method);
// NOTE the difference in using sender_sp and interpreter_frame_sender_sp
// interpreter_frame_sender_sp is the original sp of the caller (the unextended_sp)
// and sender_sp is fp
intptr_t* locals = NULL;
if (caller->is_interpreted_frame()) {
locals = caller->interpreter_frame_last_sp() + caller_actual_parameters - 1;
} else {
locals = interpreter_frame->sender_sp() + max_locals - 1;
}

#ifdef ASSERT
if (caller->is_interpreted_frame()) {
assert(locals < caller->fp() + frame::interpreter_frame_initial_sp_offset, "bad placement");
}
#endif

interpreter_frame->interpreter_frame_set_locals(locals);
BasicObjectLock* montop = interpreter_frame->interpreter_frame_monitor_begin();
BasicObjectLock* monbot = montop - moncount;
interpreter_frame->interpreter_frame_set_monitor_end(monbot);

// Set last_sp
intptr_t* last_sp = (intptr_t*) monbot -
tempcount*Interpreter::stackElementWords -
popframe_extra_args;
interpreter_frame->interpreter_frame_set_last_sp(last_sp);

// All frames but the initial (oldest) interpreter frame we fill in have
// a value for sender_sp that allows walking the stack but isn't
// truly correct. Correct the value here.
if (extra_locals != 0 &&
interpreter_frame->sender_sp() ==
interpreter_frame->interpreter_frame_sender_sp()) {
interpreter_frame->set_interpreter_frame_sender_sp(caller->sp() +
extra_locals);
}

*interpreter_frame->interpreter_frame_cache_addr() =
method->constants()->cache();
*interpreter_frame->interpreter_frame_mirror_addr() =
method->method_holder()->java_mirror();
}
Loading