Compare commits

...

80 Commits

Author SHA1 Message Date
Kim Barrett
998d0baab0 8324799: Use correct extension for C++ test headers
Reviewed-by: jwaters, gli, coleenp, lmesnik
2024-02-29 06:24:42 +00:00
David Holmes
0735c8ab26 8318302: ThreadCountLimit.java failed with "Native memory allocation (mprotect) failed to protect 16384 bytes for memory to guard stack pages"
Co-authored-by: Stefan Karlsson <stefank@openjdk.org>
Reviewed-by: shade, stefank
2024-02-29 05:28:32 +00:00
Magnus Ihse Bursie
5fa2bdc6c7 8326953: Race in creation of win-exports.def with static-libs
Reviewed-by: jwaters, erikj, dholmes
2024-02-28 22:48:17 +00:00
Hannes Wallnöfer
be2b92bd8b 8326694: Defer setting of autocapitalize attribute
Reviewed-by: jjg
2024-02-28 18:13:16 +00:00
Lance Andersen
38ad514589 8326687: Inconsistent use of "ZIP", "Zip" and "zip" in java.util.zip/jar zipfs javadoc
Reviewed-by: dfuchs, jpai, gli
2024-02-28 17:14:08 +00:00
Vladimir Kozlov
b938a5c9ed 8324969: C2: prevent elimination of unbalanced coarsened locking regions
Reviewed-by: epeter, vlivanov, dlong
2024-02-28 16:04:47 +00:00
Albert Mingkun Yang
a93605f7fb 8326763: Consolidate print methods in ContiguousSpace
Reviewed-by: stefank, gli
2024-02-28 15:14:43 +00:00
Alexey Ivanov
41242cbe5d 8325762: Use PassFailJFrame.Builder.splitUI() in PrintLatinCJKTest.java
Reviewed-by: honkar, dmarkov
2024-02-28 14:42:03 +00:00
Zhengyu Gu
5db50aca69 8326892: Remove unused PSAdaptiveSizePolicyResizeVirtualSpaceAlot develop flag
Reviewed-by: gli, tschatzl
2024-02-28 13:55:48 +00:00
Thomas Schatzl
eb4b6fa621 8326590: Improve description of MarkStackSize[Max] flags
Reviewed-by: iwalulya
2024-02-28 10:42:44 +00:00
Thomas Schatzl
e7e8083139 8326781: G1ConcurrentMark::top_at_rebuild_start() should take a HeapRegion* not an uint
Reviewed-by: iwalulya, ayang
2024-02-28 10:37:54 +00:00
Magnus Ihse Bursie
e6b3bda2c3 8326509: Clean up JNIEXPORT in Hotspot after JDK-8017234
Reviewed-by: djelinski, jwaters, dholmes
2024-02-28 10:31:18 +00:00
Kuai Wei
1ab6bd434f 8326135: Enhance adlc to report unused operands
Reviewed-by: kvn, vlivanov
2024-02-28 08:44:49 +00:00
Andrew Leonard
3b90ddfefe 8326685: Linux builds not reproducible if two builds configured in different build folders
Reviewed-by: ihse, erikj
2024-02-28 08:37:53 +00:00
Matthias Baesken
9b1f1e5294 8326389: [test] improve assertEquals failure output
Reviewed-by: clanger, jpai
2024-02-28 08:37:44 +00:00
Christian Hagedorn
6cad07c23b 8325746: Refactor Loop Unswitching code
Reviewed-by: epeter, kvn
2024-02-28 07:03:57 +00:00
Robert Toyonaga
4dd6c44cbd 8326529: JFR: Test for CompilerCompile events fails due to time out
Reviewed-by: egahlin
2024-02-28 00:50:31 +00:00
William Kemper
33f2382767 8325807: Shenandoah: Refactor full gc in preparation for generational mode changes
Reviewed-by: shade, ysr, kdnilsen
2024-02-27 23:06:17 +00:00
Weijun Wang
419191c653 8325680: Uninitialised memory in deleteGSSCB of GSSLibStub.c:179
Reviewed-by: valeriep, djelinski
2024-02-27 22:26:08 +00:00
SendaoYan
349df0a0e5 8326726: Problem list Exhaustiveness.java due to 8326616
Reviewed-by: jlahoda
2024-02-27 22:19:14 +00:00
Hamlin Li
552411f832 8326824: Test: remove redundant test in compiler/vectorapi/reshape/utils/TestCastMethods.java
Reviewed-by: kvn
2024-02-27 20:08:22 +00:00
Tobias Hartmann
9f0e7da64e 8326638: Crash in PhaseIdealLoop::remix_address_expressions due to unexpected Region instead of Loop
Reviewed-by: chagedorn, kvn
2024-02-27 16:58:22 +00:00
Jiangli Zhou
81b065a95d 8326714: Make file-local functions static in src/java.base/unix/native/libjava/childproc.c
Reviewed-by: djelinski, rriggs
2024-02-27 16:43:37 +00:00
Zhengyu Gu
4fcae1aef5 8326722: Cleanup unnecessary forward declaration in collectedHeap.hpp
Reviewed-by: tschatzl
2024-02-27 15:09:56 +00:00
Markus Grönlund
c5c866aafe 8326219: applications/kitchensink/Kitchensink8H.java timed out
Reviewed-by: egahlin
2024-02-27 11:41:23 +00:00
Magnus Ihse Bursie
ac3ce2aa15 8326583: Remove over-generalized DefineNativeToolchain solution
Reviewed-by: erikj
2024-02-27 11:14:11 +00:00
Magnus Ihse Bursie
bceaed6d4d 8326406: Remove mapfile support from makefiles
Reviewed-by: jwaters, erikj
2024-02-27 10:54:49 +00:00
Taizo Kurashige
16d917a85f 8313710: jcmd: typo in the documentation of JFR.start and JFR.dump
Reviewed-by: dholmes, egahlin
2024-02-27 10:39:48 +00:00
Viktor Klang
60cbf29250 8325754: Dead AbstractQueuedSynchronizer$ConditionNodes survive minor garbage collections
Reviewed-by: alanb
2024-02-27 10:38:36 +00:00
Magnus Ihse Bursie
da14aa463b 8017234: Hotspot should stop using mapfiles
Reviewed-by: djelinski, erikj, dholmes
2024-02-27 10:26:55 +00:00
Kim Barrett
d482c1af28 8326524: Rename agent_common.h
Reviewed-by: coleenp, sspitsyn, jwaters, dlong, lmesnik
2024-02-27 10:26:42 +00:00
Suchismith Roy
e85355ada4 8320005: Allow loading of shared objects with .a extension on AIX
Reviewed-by: amitkumar, stuefe, jkern, mdoerr
2024-02-27 09:15:40 +00:00
Albert Mingkun Yang
5d3d40d962 8326659: Serial: Remove redundant TenuredSpace::print_on
Reviewed-by: tschatzl
2024-02-27 09:12:20 +00:00
Afshin Zafari
7583419d88 8324828: Avoid multiple search of reserved regions during splitting
Reviewed-by: stuefe, jsjolen
2024-02-27 08:59:10 +00:00
Lei Zaakjyu
c5f1dcccfc 8325082: Rename headers named 'heapRegion*' of G1
Reviewed-by: stefank, tschatzl
2024-02-27 08:58:52 +00:00
Denghui Dong
4d82ea102a 8325144: C1: Optimize CriticalEdgeFinder
Reviewed-by: dlong, chagedorn
2024-02-27 08:28:49 +00:00
Hamlin Li
a48f5966be 8322179: RISC-V: Implement SHA-1 intrinsic
Reviewed-by: tonyp, fyang
2024-02-27 08:17:33 +00:00
SendaoYan
5daf63b717 8326636: Problem list StartupOutput.java due to 8326615
Reviewed-by: kvn, thartmann
2024-02-27 08:14:38 +00:00
Dan Lutker
97aca09e58 8326717: Disable stringop-overflow in shenandoahLock.cpp
Reviewed-by: erikj, shade
2024-02-27 07:34:10 +00:00
Daniel Jeliński
ec9437dbcc 8325247: Memory leak in SessionKeyRef class def when using PKCS11 security provider
Reviewed-by: valeriep
2024-02-27 07:06:35 +00:00
Jiangli Zhou
0901dedefe 8326433: Make file-local functions static in src/jdk.jdwp.agent/unix/native/libjdwp/exec_md.c
Reviewed-by: cjplummer, sspitsyn
2024-02-27 01:34:19 +00:00
Justin Lu
d22d890cac 8325898: ChoiceFormat returns erroneous result when formatting bad pattern
Reviewed-by: naoto
2024-02-26 23:43:52 +00:00
Patricio Chilano Mateo
93feda3d9a 8322962: Upcall stub might go undetected when freezing frames
Reviewed-by: jvernee, alanb, mdoerr, fyang, dlong
2024-02-26 23:29:18 +00:00
Alex Menkov
fc67c2b4f1 8325530: Vague error message when com.sun.tools.attach.VirtualMachine fails to load agent library
Reviewed-by: sspitsyn, cjplummer
2024-02-26 23:18:49 +00:00
Weijun Wang
b87d9cf2c9 8325506: Ensure randomness is only read from provided SecureRandom object
Reviewed-by: kdriver, valeriep
2024-02-26 21:52:40 +00:00
Anthony Scarpino
0963a4e9a1 8326699: Problemlist CertMsgCheck.java
Reviewed-by: rhalade
2024-02-26 21:00:07 +00:00
sunyaqi
bf13a4e281 8322881: java/nio/file/Files/CopyMoveVariations.java fails with AccessDeniedException due to permissions of files in /tmp
Reviewed-by: bpb
2024-02-26 20:47:59 +00:00
Anthony Scarpino
f62b5789ad 8311644: Server should not send bad_certificate alert when the client does not send any certificates
Reviewed-by: djelinski, jjiang, ssahoo
2024-02-26 16:49:01 +00:00
Claes Redestad
9a9cfbe0ba 8325340: Add ASCII fast-path to Data-/ObjectInputStream.readUTF
Reviewed-by: rgiulietti, bpb, rriggs
2024-02-26 16:05:18 +00:00
Magnus Ihse Bursie
3780ad3133 8326587: Separate out Microsoft toolchain linking
Reviewed-by: erikj
2024-02-26 15:43:47 +00:00
Albert Mingkun Yang
2d3c9c5e67 8325553: Parallel: Use per-marker cache for marking stats during Full GC
Reviewed-by: sjohanss, tschatzl
2024-02-26 15:34:10 +00:00
Lance Andersen
20c71ceacd 8321156: Improve the handling of invalid UTF-8 byte sequences for ZipInputStream::getNextEntry and ZipFile::getComment
Reviewed-by: jpai, alanb
2024-02-26 15:31:55 +00:00
Claes Redestad
c042f08632 8326653: Remove jdk.internal.reflect.UTF8
Reviewed-by: rriggs, alanb
2024-02-26 15:30:21 +00:00
Eirik Bjørsnøs
bb6b04897b 8326099: GZIPOutputStream should use Deflater.getBytesRead() instead of Deflater.getTotalIn()
Reviewed-by: jpai
2024-02-26 14:15:24 +00:00
Emanuel Peter
490825fb91 8325589: C2 SuperWord refactoring: create VLoopAnalyzer with Submodules
Reviewed-by: kvn, chagedorn
2024-02-26 13:02:04 +00:00
Chen Liang
3a00fc732a 8323698: Class use page does not include extends/implements type arguments
Reviewed-by: prappo, hannesw
2024-02-26 12:10:58 +00:00
Albert Mingkun Yang
f32f574004 8326575: Remove unused ContiguousSpace::set_top_for_allocations
Reviewed-by: tschatzl, sjohanss
2024-02-26 09:36:48 +00:00
Thomas Schatzl
09f755a64d 8325857: G1 Full GC flushes mark stats cache too early
Reviewed-by: iwalulya, ayang
2024-02-26 07:28:37 +00:00
Korov
1799ffeaa9 8310351: Typo in ImmutableCollections
Reviewed-by: jlaskey, jpai
2024-02-25 11:52:19 +00:00
Leonid Mesnik
d10f277bd3 8326006: Allow TEST_VM_FLAGLESS to set flagless mode
Reviewed-by: tschatzl, ayang
2024-02-23 19:58:38 +00:00
Joe Darcy
63f6a563a3 8326530: Widen allowable error bound of Math.tan
Reviewed-by: bpb, rgiulietti
2024-02-23 18:03:02 +00:00
Magnus Ihse Bursie
27574b384c 8326585: COMPARE_BUILD=PATCH fails if patch -R fails
Reviewed-by: erikj
2024-02-23 17:31:13 +00:00
Weijun Wang
c26c5833cc 8311003: missing @since info in jdk.security.jgss
Reviewed-by: mullan
2024-02-23 16:10:44 +00:00
Martin Doerr
09a78b5da9 8326378: [PPC64] CodeEntryAlignment too large
Reviewed-by: shade, lucy
2024-02-23 13:52:10 +00:00
Albert Mingkun Yang
ef2d5c40c0 8326065: Merge Space into ContiguousSpace
Reviewed-by: cjplummer, sjohanss
2024-02-23 11:47:29 +00:00
Ivan Walulya
11fdca0634 8325202: gc/g1/TestMarkStackOverflow.java intermittently crash: G1CMMarkStack::ChunkAllocator::allocate_new_chunk
Reviewed-by: tschatzl, ayang
2024-02-23 10:48:50 +00:00
Roland Westrelin
5d414da504 8325372: Shenandoah: SIGSEGV crash in unnecessary_acquire due to LoadStore split through phi
Reviewed-by: shade, rkennke, thartmann
2024-02-23 10:09:06 +00:00
Jan Lahoda
93a2e773a5 8326129: Java Record Pattern Match leads to infinite loop
Reviewed-by: vromero
2024-02-23 10:08:56 +00:00
Roman Kennke
336bbbe389 8139457: Relax alignment of array elements
Co-authored-by: Fei Yang <fyang@openjdk.org>
Co-authored-by: Thomas Stuefe <stuefe@openjdk.org>
Reviewed-by: stuefe, stefank, shade, coleenp, kdnilsen, aboldtch
2024-02-23 10:05:25 +00:00
Jan Lahoda
cb809f8e04 8325215: Incorrect not exhaustive switch error
Reviewed-by: vromero
2024-02-23 08:56:14 +00:00
Erik Gahlin
c4409eafc4 8325994: JFR: Examples in JFR.start help use incorrect separator
Reviewed-by: mikael
2024-02-23 02:02:35 +00:00
Jaikiran Pai
54f09d7345 8278527: java/util/concurrent/tck/JSR166TestCase.java fails nanoTime test
Reviewed-by: martin, lancea
2024-02-23 00:53:19 +00:00
Justin Lu
00ffc42cef 8318761: MessageFormat pattern support for CompactNumberFormat, ListFormat, and DateTimeFormatter
Reviewed-by: naoto, rriggs
2024-02-22 22:27:12 +00:00
Thomas Stuefe
d695af89f6 8326376: java -version failed with CONF=fastdebug -XX:InitialCodeCacheSize=1024K -XX:ReservedCodeCacheSize=1200k
Reviewed-by: kvn, jwaters
2024-02-22 17:45:34 +00:00
Stefan Karlsson
9f9a732c38 8325752: Remove badMetaWordVal
Reviewed-by: coleenp, tschatzl
2024-02-22 16:02:26 +00:00
Stefan Karlsson
864cf22241 8325742: Remove MetaWord usage from MemRegion
Reviewed-by: coleenp, tschatzl
2024-02-22 15:58:41 +00:00
Erik Gahlin
8e5c0ee402 8324832: JFR: Improve sorting of 'jfr summary'
Reviewed-by: mgronlun
2024-02-22 15:29:05 +00:00
Renjith Kannath Pariyangad
724a2a2c4a 8321192: j.a.PrintJob/ImageTest/ImageTest.java: Fail or skip the test if there's no printer
Reviewed-by: aivanov, tr
2024-02-22 14:05:02 +00:00
Fredrik Bredberg
f365d807e5 8325153: SEGV in stackChunkOopDesc::derelativize_address(int)
Reviewed-by: stefank, coleenp
2024-02-22 13:07:32 +00:00
Roland Westrelin
4406915ebc 8323274: C2: array load may float above range check
Reviewed-by: epeter, thartmann
2024-02-22 11:07:13 +00:00
1121 changed files with 10399 additions and 5812 deletions

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2020, 2024, 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
@@ -38,7 +38,7 @@ HSDIS_OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/hsdis
REAL_HSDIS_NAME := hsdis-$(OPENJDK_TARGET_CPU_LEGACY_LIB)$(SHARED_LIBRARY_SUFFIX)
BUILT_HSDIS_LIB := $(HSDIS_OUTPUT_DIR)/$(REAL_HSDIS_NAME)
HSDIS_TOOLCHAIN := TOOLCHAIN_DEFAULT
HSDIS_LINK_TYPE := C
HSDIS_TOOLCHAIN_CFLAGS := $(CFLAGS_JDKLIB)
HSDIS_TOOLCHAIN_LDFLAGS := $(LDFLAGS_JDKLIB)
@@ -59,8 +59,8 @@ endif
ifeq ($(HSDIS_BACKEND), llvm)
# Use C++ instead of C
HSDIS_LINK_TYPE := C++
HSDIS_TOOLCHAIN_CFLAGS := $(CXXFLAGS_JDKLIB)
HSDIS_TOOLCHAIN := TOOLCHAIN_LINK_CXX
ifeq ($(call isTargetOs, linux), true)
LLVM_OS := pc-linux-gnu
@@ -91,14 +91,11 @@ ifeq ($(HSDIS_BACKEND), binutils)
endif
endif
$(eval $(call DefineNativeToolchain, TOOLCHAIN_MINGW, \
CC := $(MINGW_BASE)-gcc, \
LD := $(MINGW_BASE)-ld, \
OBJCOPY := $(MINGW_BASE)-objcopy, \
RC := $(RC), \
SYSROOT_CFLAGS := --sysroot=$(MINGW_SYSROOT), \
SYSROOT_LDFLAGS := --sysroot=$(MINGW_SYSROOT), \
))
BUILD_HSDIS_CC := $(MINGW_BASE)-gcc
BUILD_HSDIS_LD := $(MINGW_BASE)-ld
BUILD_HSDIS_OBJCOPY := $(MINGW_BASE)-objcopy
BUILD_HSDIS_SYSROOT_CFLAGS := --sysroot=$(MINGW_SYSROOT)
BUILD_HSDIS_SYSROOT_LDFLAGS := --sysroot=$(MINGW_SYSROOT)
MINGW_SYSROOT_LIB_PATH := $(MINGW_SYSROOT)/mingw/lib
ifeq ($(wildcard $(MINGW_SYSROOT_LIB_PATH)), )
@@ -122,8 +119,8 @@ ifeq ($(HSDIS_BACKEND), binutils)
TOOLCHAIN_TYPE := gcc
OPENJDK_TARGET_OS := linux
OPENJDK_TARGET_OS_TYPE := unix
CC_OUT_OPTION := -o$(SPACE)
LD_OUT_OPTION := -o$(SPACE)
GENDEPS_FLAGS := -MMD -MF
CFLAGS_DEBUG_SYMBOLS := -g
DISABLED_WARNINGS :=
@@ -131,7 +128,6 @@ ifeq ($(HSDIS_BACKEND), binutils)
CFLAGS_WARNINGS_ARE_ERRORS := -Werror
SHARED_LIBRARY_FLAGS := -shared
HSDIS_TOOLCHAIN := TOOLCHAIN_MINGW
HSDIS_TOOLCHAIN_CFLAGS :=
HSDIS_TOOLCHAIN_LDFLAGS := -L$(MINGW_GCC_LIB_PATH) -L$(MINGW_SYSROOT_LIB_PATH)
MINGW_DLLCRT := $(MINGW_SYSROOT_LIB_PATH)/dllcrt2.o
@@ -144,9 +140,9 @@ endif
$(eval $(call SetupJdkLibrary, BUILD_HSDIS, \
NAME := hsdis, \
LINK_TYPE := $(HSDIS_LINK_TYPE), \
SRC := $(TOPDIR)/src/utils/hsdis/$(HSDIS_BACKEND), \
EXTRA_HEADER_DIRS := $(TOPDIR)/src/utils/hsdis, \
TOOLCHAIN := $(HSDIS_TOOLCHAIN), \
OUTPUT_DIR := $(HSDIS_OUTPUT_DIR), \
OBJECT_DIR := $(HSDIS_OUTPUT_DIR), \
DISABLED_WARNINGS_gcc := undef format-nonliteral sign-compare, \

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2024, 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
@@ -427,8 +427,9 @@ else # $(HAS_SPEC)=true
# Cleanup after a compare build
define CleanupCompareBuild
# If running with a COMPARE_BUILD patch, reverse-apply it
$(if $(COMPARE_BUILD_PATCH), cd $(topdir) && $(PATCH) -R -p1 < $(COMPARE_BUILD_PATCH))
# If running with a COMPARE_BUILD patch, reverse-apply it, but continue
# even if that fails (can happen with removed files).
$(if $(COMPARE_BUILD_PATCH), cd $(topdir) && $(PATCH) -R -p1 < $(COMPARE_BUILD_PATCH) || true)
# Move this build away and restore the original build
$(MKDIR) -p $(topdir)/build/compare-build
$(MV) $(OUTPUTDIR) $(COMPARE_BUILD_OUTPUTDIR)

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2015, 2024, 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
@@ -40,6 +40,7 @@ LDCXX := @BUILD_LDCXX@
AS := @BUILD_AS@
NM := @BUILD_NM@
AR := @BUILD_AR@
LIB := @BUILD_LIB@
OBJCOPY := @BUILD_OBJCOPY@
STRIP := @BUILD_STRIP@
SYSROOT_CFLAGS := @BUILD_SYSROOT_CFLAGS@

View File

@@ -40,7 +40,6 @@ AC_DEFUN([FLAGS_SETUP_SHARED_LIBS],
SET_EXECUTABLE_ORIGIN='-Wl,-rpath,\$$ORIGIN[$]1'
SET_SHARED_LIBRARY_ORIGIN="-Wl,-z,origin $SET_EXECUTABLE_ORIGIN"
SET_SHARED_LIBRARY_NAME='-Wl,-soname=[$]1'
SET_SHARED_LIBRARY_MAPFILE='-Wl,-version-script=[$]1'
elif test "x$TOOLCHAIN_TYPE" = xclang; then
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
@@ -49,7 +48,6 @@ AC_DEFUN([FLAGS_SETUP_SHARED_LIBS],
SET_EXECUTABLE_ORIGIN='-Wl,-rpath,@loader_path$(or [$]1,/.)'
SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN"
SET_SHARED_LIBRARY_NAME='-Wl,-install_name,@rpath/[$]1'
SET_SHARED_LIBRARY_MAPFILE='-Wl,-exported_symbols_list,[$]1'
elif test "x$OPENJDK_TARGET_OS" = xaix; then
# Linking is different on aix
@@ -57,14 +55,12 @@ AC_DEFUN([FLAGS_SETUP_SHARED_LIBS],
SET_EXECUTABLE_ORIGIN=""
SET_SHARED_LIBRARY_ORIGIN=''
SET_SHARED_LIBRARY_NAME=''
SET_SHARED_LIBRARY_MAPFILE=''
else
# Default works for linux, might work on other platforms as well.
SHARED_LIBRARY_FLAGS='-shared'
SET_EXECUTABLE_ORIGIN='-Wl,-rpath,\$$ORIGIN[$]1'
SET_SHARED_LIBRARY_NAME='-Wl,-soname=[$]1'
SET_SHARED_LIBRARY_MAPFILE='-Wl,-version-script=[$]1'
# arm specific settings
if test "x$OPENJDK_TARGET_CPU" = "xarm"; then
@@ -80,20 +76,17 @@ AC_DEFUN([FLAGS_SETUP_SHARED_LIBS],
SET_EXECUTABLE_ORIGIN=""
SET_SHARED_LIBRARY_ORIGIN=''
SET_SHARED_LIBRARY_NAME=''
SET_SHARED_LIBRARY_MAPFILE=''
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
SHARED_LIBRARY_FLAGS="-dll"
SET_EXECUTABLE_ORIGIN=''
SET_SHARED_LIBRARY_ORIGIN=''
SET_SHARED_LIBRARY_NAME=''
SET_SHARED_LIBRARY_MAPFILE='-def:[$]1'
fi
AC_SUBST(SET_EXECUTABLE_ORIGIN)
AC_SUBST(SET_SHARED_LIBRARY_ORIGIN)
AC_SUBST(SET_SHARED_LIBRARY_NAME)
AC_SUBST(SET_SHARED_LIBRARY_MAPFILE)
AC_SUBST(SHARED_LIBRARY_FLAGS)
])
@@ -122,6 +115,11 @@ AC_DEFUN([FLAGS_SETUP_DEBUG_SYMBOLS],
# Add debug prefix map gcc system include paths, as they cause
# non-deterministic debug paths depending on gcc path location.
DEBUG_PREFIX_MAP_GCC_INCLUDE_PATHS
# Add debug prefix map for OUTPUTDIR to handle the scenario when
# it is not located within WORKSPACE_ROOT
outputdir_slash="${OUTPUTDIR%/}/"
DEBUG_PREFIX_CFLAGS="$DEBUG_PREFIX_CFLAGS -fdebug-prefix-map=${outputdir_slash}="
]
)
fi

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2024, 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
@@ -93,7 +93,7 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
BASIC_LDFLAGS_JVM_ONLY="-Wl,-lC_r -bbigtoc"
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
BASIC_LDFLAGS="-nologo -opt:ref"
BASIC_LDFLAGS="-opt:ref"
BASIC_LDFLAGS_JDK_ONLY="-incremental:no"
BASIC_LDFLAGS_JVM_ONLY="-opt:icf,8 -subsystem:windows"
fi

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2024, 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
@@ -33,9 +33,6 @@ AC_DEFUN([FLAGS_SETUP_ARFLAGS],
# FIXME: figure out if we should select AR flags depending on OS or toolchain.
if test "x$OPENJDK_TARGET_OS" = xaix; then
ARFLAGS="-X64"
elif test "x$OPENJDK_TARGET_OS" = xwindows; then
# lib.exe is used as AR to create static libraries.
ARFLAGS="-nologo -NODEFAULTLIB:MSVCRT"
else
ARFLAGS=""
fi
@@ -43,6 +40,18 @@ AC_DEFUN([FLAGS_SETUP_ARFLAGS],
AC_SUBST(ARFLAGS)
])
AC_DEFUN([FLAGS_SETUP_LIBFLAGS],
[
# LIB is used to create static libraries on Windows
if test "x$OPENJDK_TARGET_OS" = xwindows; then
LIBFLAGS="-nodefaultlib:msvcrt"
else
LIBFLAGS=""
fi
AC_SUBST(LIBFLAGS)
])
AC_DEFUN([FLAGS_SETUP_STRIPFLAGS],
[
## Setup strip.

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2024, 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
@@ -364,24 +364,12 @@ AC_DEFUN([FLAGS_SETUP_TOOLCHAIN_CONTROL],
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
CC_OUT_OPTION=-Fo
LD_OUT_OPTION=-out:
AR_OUT_OPTION=-out:
else
# The option used to specify the target .o,.a or .so file.
# When compiling, how to specify the to be created object file.
CC_OUT_OPTION='-o$(SPACE)'
# When linking, how to specify the output
LD_OUT_OPTION='-o$(SPACE)'
# When archiving, how to specify the destination static archive.
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
AR_OUT_OPTION='-r -cs$(SPACE)'
else
AR_OUT_OPTION='-rcs$(SPACE)'
fi
fi
AC_SUBST(CC_OUT_OPTION)
AC_SUBST(LD_OUT_OPTION)
AC_SUBST(AR_OUT_OPTION)
# Generate make dependency files
if test "x$TOOLCHAIN_TYPE" = xgcc; then
@@ -423,6 +411,7 @@ AC_DEFUN([FLAGS_SETUP_FLAGS],
FLAGS_SETUP_LDFLAGS
FLAGS_SETUP_ARFLAGS
FLAGS_SETUP_LIBFLAGS
FLAGS_SETUP_STRIPFLAGS
FLAGS_SETUP_RCFLAGS
FLAGS_SETUP_NMFLAGS

View File

@@ -498,8 +498,6 @@ COMPILER_COMMAND_FILE_FLAG := @COMPILER_COMMAND_FILE_FLAG@
COMPILER_BINDCMD_FILE_FLAG := @COMPILER_BINDCMD_FILE_FLAG@
CC_OUT_OPTION := @CC_OUT_OPTION@
LD_OUT_OPTION := @LD_OUT_OPTION@
AR_OUT_OPTION := @AR_OUT_OPTION@
# Flags used for overriding the default opt setting for a C/C++ source file.
C_O_FLAG_HIGHEST_JVM := @C_O_FLAG_HIGHEST_JVM@
@@ -604,10 +602,10 @@ BUILD_SYSROOT_LDFLAGS := @BUILD_SYSROOT_LDFLAGS@
AS := @AS@
# AR is used to create a static library (is ar in unix, lib.exe in windows)
AR := @AR@
ARFLAGS := @ARFLAGS@
LIB := @LIB@
LIBFLAGS := @LIBFLAGS@
NM := @NM@
NMFLAGS := @NMFLAGS@
STRIP := @STRIP@
@@ -619,10 +617,6 @@ INSTALL_NAME_TOOL := @INSTALL_NAME_TOOL@
METAL := @METAL@
METALLIB := @METALLIB@
# Options to linker to specify a mapfile.
# (Note absence of := assignment, because we do not want to evaluate the macro body here)
SET_SHARED_LIBRARY_MAPFILE = @SET_SHARED_LIBRARY_MAPFILE@
#
# Options for generating debug symbols
COMPILE_WITH_DEBUG_SYMBOLS := @COMPILE_WITH_DEBUG_SYMBOLS@

View File

@@ -732,11 +732,10 @@ AC_DEFUN_ONCE([TOOLCHAIN_DETECT_TOOLCHAIN_CORE],
AC_SUBST(AS)
#
# Setup the archiver (AR)
# Setup tools for creating static libraries (AR/LIB)
#
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
# The corresponding ar tool is lib.exe (used to create static libraries)
UTIL_LOOKUP_TOOLCHAIN_PROGS(AR, lib)
UTIL_LOOKUP_TOOLCHAIN_PROGS(LIB, lib)
elif test "x$TOOLCHAIN_TYPE" = xgcc; then
UTIL_LOOKUP_TOOLCHAIN_PROGS(AR, ar gcc-ar)
else

View File

@@ -40,8 +40,8 @@ include native/CompileFile.gmk
include native/DebugSymbols.gmk
include native/Flags.gmk
include native/Link.gmk
include native/LinkMicrosoft.gmk
include native/Paths.gmk
include native/ToolchainDefinitions.gmk
################################################################################
# Setup make rules for creating a native binary (a shared library or an
@@ -54,7 +54,8 @@ include native/ToolchainDefinitions.gmk
# NAME The base name for the resulting binary, excluding decorations (like *.exe)
# TYPE Type of binary (EXECUTABLE, LIBRARY or STATIC_LIBRARY). Default is LIBRARY.
# SUFFIX Override the default suffix for the output file
# TOOLCHAIN Name of toolchain setup to use. Defaults to TOOLCHAIN_DEFAULT.
# TARGET_TYPE The type to target, BUILD or TARGET. Defaults to TARGET.
# LINK_TYPE The language to use for the linker, C or C++. Defaults to C.
# SRC one or more directory roots to scan for C/C++ files.
# CFLAGS the compiler flags to be used, used both for C and C++.
# CXXFLAGS the compiler flags to be used for c++, if set overrides CFLAGS.
@@ -72,7 +73,8 @@ include native/ToolchainDefinitions.gmk
# used both for C and C++.
# LIBS_<toolchain>_<OS> the libraries to link to for the specified target
# OS and toolchain, used both for C and C++.
# ARFLAGS the archiver flags to be used
# ARFLAGS the archiver flags to be used on unix platforms
# LIBFLAGS the flags for the lib tool used on windows
# OBJECT_DIR the directory where we store the object files
# OUTPUT_DIR the directory where the resulting binary is put
# SYMBOLS_DIR the directory where the debug symbols are put, defaults to OUTPUT_DIR
@@ -87,11 +89,18 @@ include native/ToolchainDefinitions.gmk
# VERSIONINFO_RESOURCE Input file for RC. Setting this implies that RC will be run
# RCFLAGS flags for RC.
# EMBED_MANIFEST if true, embed manifest on Windows.
# MAPFILE mapfile
# USE_MAPFILE_FOR_SYMBOLS if true and this is a STATIC_BUILD, just copy the
# mapfile for the output symbols file
# CC the compiler to use, default is $(CC)
# LD the linker to use, default is $(LD)
# CC the C compiler to use
# CXX the C++ compiler to use
# LD the Linker to use
# AR the static linker to use
# LIB the Windows lib tool to use for creating static libraries
# AS the assembler to use
# MT the Windows MT tool to use
# RC the Windows RC tool to use
# OBJCOPY the objcopy tool for debug symbol handling
# STRIP the tool to use for stripping debug symbols
# SYSROOT_CFLAGS the compiler flags for using the specific sysroot
# SYSROOT_LDFLAGS the linker flags for using the specific sysroot
# OPTIMIZATION sets optimization level to NONE, LOW, HIGH, HIGHEST, HIGHEST_JVM, SIZE
# DISABLED_WARNINGS_<toolchain> Disable the given warnings for the specified toolchain
# DISABLED_WARNINGS_<toolchain>_<OS> Disable the given warnings for the specified
@@ -198,12 +207,18 @@ define SetupNativeCompilationBody
# Prepare for linking
$$(eval $$(call SetupLinkerFlags,$1))
$$(eval $$(call SetupLinking,$1))
ifneq ($(TOOLCHAIN_TYPE), microsoft)
$$(eval $$(call SetupLinking,$1))
endif
$$(eval $$(call SetupObjectFileList,$1))
# Link the individually compiled files into a single unit
$$(eval $$(call CreateLinkedResult,$1))
ifneq ($(TOOLCHAIN_TYPE), microsoft)
$$(eval $$(call CreateLinkedResult,$1))
else
$$(eval $$(call CreateLinkedResultMicrosoft,$1))
endif
ifeq ($(GENERATE_COMPILE_COMMANDS_ONLY), true)
# Override all targets (this is a hack)
@@ -284,6 +299,44 @@ define SetupBasicVariables
$1_SAFE_NAME := $$(strip $$(subst /,_, $1))
endef
################################################################################
# Setup the toolchain variables
define SetupToolchain
ifeq ($$($1_TARGET_TYPE), BUILD)
$$(call SetIfEmpty, $1_CC, $(BUILD_CC))
$$(call SetIfEmpty, $1_CXX, $(BUILD_CXX))
$$(call SetIfEmpty, $1_AR, $(BUILD_AR))
$$(call SetIfEmpty, $1_LIB, $(BUILD_LIB))
$$(call SetIfEmpty, $1_AS, $(BUILD_AS))
$$(call SetIfEmpty, $1_OBJCOPY, $(BUILD_OBJCOPY))
$$(call SetIfEmpty, $1_STRIP, $(BUILD_STRIP))
$$(call SetIfEmpty, $1_SYSROOT_CFLAGS, $(BUILD_SYSROOT_CFLAGS))
$$(call SetIfEmpty, $1_SYSROOT_LDFLAGS, $(BUILD_SYSROOT_LDFLAGS))
ifeq ($$($1_LINK_TYPE), C++)
$$(call SetIfEmpty, $1_LD, $(BUILD_LDCXX))
else
$$(call SetIfEmpty, $1_LD, $(BUILD_LD))
endif
else
$$(call SetIfEmpty, $1_CC, $(CC))
$$(call SetIfEmpty, $1_CXX, $(CXX))
$$(call SetIfEmpty, $1_AR, $(AR))
$$(call SetIfEmpty, $1_LIB, $(LIB))
$$(call SetIfEmpty, $1_AS, $(AS))
$$(call SetIfEmpty, $1_MT, $(MT))
$$(call SetIfEmpty, $1_RC, $(RC))
$$(call SetIfEmpty, $1_OBJCOPY, $(OBJCOPY))
$$(call SetIfEmpty, $1_STRIP, $(STRIP))
$$(call SetIfEmpty, $1_SYSROOT_CFLAGS, $(SYSROOT_CFLAGS))
$$(call SetIfEmpty, $1_SYSROOT_LDFLAGS, $(SYSROOT_LDFLAGS))
ifeq ($$($1_LINK_TYPE), C++)
$$(call SetIfEmpty, $1_LD, $(LDCXX))
else
$$(call SetIfEmpty, $1_LD, $(LD))
endif
endif
endef
################################################################################
# Setup machinery needed by the build system
define SetupBuildSystemSupport

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2015, 2024, 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
@@ -103,6 +103,7 @@ define SetupTestFilesCompilationBody
$$(eval $$(call SetupNativeCompilation, BUILD_TEST_$$(name), \
NAME := $$(unprefixed_name), \
TYPE := $$($1_COMPILATION_TYPE), \
LINK_TYPE := $(if $$(filter %.cpp, $$(file)), C++, C), \
EXTRA_FILES := $$(file) $$($1_EXTRA_FILES), \
OBJECT_DIR := $$($1_OUTPUT_DIR)/support/$$(name), \
OUTPUT_DIR := $$($1_OUTPUT_DIR)/$$($1_OUTPUT_SUBDIR), \
@@ -113,7 +114,6 @@ define SetupTestFilesCompilationBody
DISABLED_WARNINGS_clang := undef format-nonliteral \
missing-field-initializers sometimes-uninitialized, \
LIBS := $$($1_LIBS_$$(name)), \
TOOLCHAIN := $(if $$(filter %.cpp, $$(file)), TOOLCHAIN_LINK_CXX, TOOLCHAIN_DEFAULT), \
OPTIMIZATION := $$(if $$($1_OPTIMIZATION_$$(name)),$$($1_OPTIMIZATION_$$(name)),LOW), \
COPY_DEBUG_SYMBOLS := $$($1_COPY_DEBUG_SYMBOLS), \
STRIP_SYMBOLS := $$(if $$($1_STRIP_SYMBOLS_$$(name)),$$($1_STRIP_SYMBOLS_$$(name)),false), \

View File

@@ -27,7 +27,6 @@
# This file contains functionality related to linking a native binary;
# creating either a dynamic library, a static library or an executable.
################################################################################
# GetEntitlementsFile
# Find entitlements file for executable when signing on macosx. If no
@@ -49,24 +48,15 @@ GetEntitlementsFile = \
################################################################################
define SetupLinking
ifneq ($(DISABLE_MAPFILES), true)
$1_REAL_MAPFILE := $$($1_MAPFILE)
endif
ifneq ($$($1_REAL_MAPFILE), )
$1_EXTRA_LDFLAGS += $(call SET_SHARED_LIBRARY_MAPFILE,$$($1_REAL_MAPFILE))
endif
# Unless specifically set, stripping should only happen if symbols are also
# being copied.
$$(call SetIfEmpty, $1_STRIP_SYMBOLS, $$($1_COPY_DEBUG_SYMBOLS))
ifneq ($$($1_STRIP_SYMBOLS), false)
ifneq ($$($1_STRIP), )
# Default to using the global STRIPFLAGS. Allow for overriding with an empty value
$1_STRIPFLAGS ?= $(STRIPFLAGS)
$1_STRIP_CMD := $$($1_STRIP) $$($1_STRIPFLAGS) $$($1_TARGET)
endif
# Default to using the global STRIPFLAGS. Allow for overriding with an
# empty value
$1_STRIPFLAGS ?= $(STRIPFLAGS)
$1_STRIP_CMD := $$($1_STRIP) $$($1_STRIPFLAGS) $$($1_TARGET)
endif
endef
@@ -81,7 +71,7 @@ endef
################################################################################
define CreateStaticLibrary
# Include partial linking when building the static library with clang on linux.
# Include partial linking when building the static library with clang on linux
ifeq ($(call isTargetOs, linux), true)
ifneq ($(findstring $(TOOLCHAIN_TYPE), clang), )
$1_ENABLE_PARTIAL_LINKING := true
@@ -96,14 +86,7 @@ define CreateStaticLibrary
$1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \
$$($1_OBJECT_DIR)/$$($1_NOSUFFIX).vardeps)
# Generating a static library, ie object file archive.
ifeq ($(STATIC_BUILD), true)
ifeq ($$($1_USE_MAPFILE_FOR_SYMBOLS), true)
STATIC_MAPFILE_DEP := $$($1_MAPFILE)
endif
endif
$1_TARGET_DEPS := $$($1_ALL_OBJS) $$($1_RES) $$($1_VARDEPS_FILE) $$(STATIC_MAPFILE_DEP)
$1_TARGET_DEPS := $$($1_ALL_OBJS) $$($1_VARDEPS_FILE)
$1_AR_OBJ_ARG := $$($1_LD_OBJ_ARG)
# With clang on linux, partial linking is enabled and 'AR' takes the output
@@ -128,36 +111,19 @@ define CreateStaticLibrary
$$(call ExecuteWithLog, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_partial_link, \
$(if $$($1_LINK_OBJS_RELATIVE), $$(CD) $$(OUTPUTDIR) ; ) \
$$($1_LD) $(LDFLAGS_CXX_PARTIAL_LINKING) $$($1_SYSROOT_LDFLAGS) \
$(LD_OUT_OPTION)$$($1_TARGET_RELOCATABLE) \
-o $$($1_TARGET_RELOCATABLE) \
$$($1_LD_OBJ_ARG))
endif
$$(call ExecuteWithLog, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_link, \
$(if $$($1_LINK_OBJS_RELATIVE), $$(CD) $$(OUTPUTDIR) ; ) \
$$($1_AR) $$(ARFLAGS) $$($1_ARFLAGS) $(AR_OUT_OPTION)$$($1_TARGET) $$($1_AR_OBJ_ARG) \
$$($1_RES))
$$($1_AR) $$(ARFLAGS) $$($1_ARFLAGS) -r -cs $$($1_TARGET) \
$$($1_AR_OBJ_ARG) $$($1_RES))
ifeq ($(STATIC_BUILD), true)
ifeq ($$($1_USE_MAPFILE_FOR_SYMBOLS), true)
$(CP) $$($1_MAPFILE) $$(@D)/$$(basename $$(@F)).symbols
else
# get the exported symbols from mapfiles and if there
# is no mapfile, get them from the archive
$(RM) $$(@D)/$$(basename $$(@F)).symbols; \
if [ ! -z $$($1_MAPFILE) -a -e $$($1_MAPFILE) ]; then \
$(ECHO) "Getting symbols from mapfile $$($1_MAPFILE)"; \
$(AWK) '/global:/','/local:/' $$($1_MAPFILE) | \
$(SED) -e 's/#.*//;s/global://;s/local://;s/\;//;s/^[ ]*/_/;/^_$$$$/d' | \
$(EGREP) -v "JNI_OnLoad|JNI_OnUnload|Agent_OnLoad|Agent_OnUnload|Agent_OnAttach" > \
$$(@D)/$$(basename $$(@F)).symbols || true; \
$(NM) $(NMFLAGS) $$($1_TARGET) | $(GREP) " T " | \
$(EGREP) "JNI_OnLoad|JNI_OnUnload|Agent_OnLoad|Agent_OnUnload|Agent_OnAttach" | \
$(CUT) -d ' ' -f 3 >> $$(@D)/$$(basename $$(@F)).symbols || true;\
else \
$(ECHO) "Getting symbols from nm"; \
$(NM) $(NMFLAGS) -m $$($1_TARGET) | $(GREP) "__TEXT" | \
$(EGREP) -v "non-external|private extern|__TEXT,__eh_frame" | \
$(SED) -e 's/.* //' > $$(@D)/$$(basename $$(@F)).symbols; \
fi
endif
$(RM) $$(@D)/$$(basename $$(@F)).symbols; \
$(ECHO) "Getting symbols from nm"; \
$(NM) $(NMFLAGS) -m $$($1_TARGET) | $(GREP) "__TEXT" | \
$(EGREP) -v "non-external|private extern|__TEXT,__eh_frame" | \
$(SED) -e 's/.* //' > $$(@D)/$$(basename $$(@F)).symbols
endif
endef
@@ -174,39 +140,13 @@ define CreateDynamicLibraryOrExecutable
endif
endif
ifeq ($(call isTargetOs, windows), true)
ifeq ($$($1_EMBED_MANIFEST), true)
$1_EXTRA_LDFLAGS += -manifest:embed
endif
$1_IMPORT_LIBRARY := $$($1_OBJECT_DIR)/$$($1_NAME).lib
$1_EXTRA_LDFLAGS += "-implib:$$($1_IMPORT_LIBRARY)"
ifeq ($$($1_TYPE), LIBRARY)
# To properly trigger downstream dependants of the import library, just as
# for debug files, we must have a recipe in the rule. To avoid rerunning
# the recipe every time have it touch the target. If an import library
# file is deleted by something external, explicitly delete the target to
# trigger a rebuild of both.
ifneq ($$(wildcard $$($1_IMPORT_LIBRARY)), $$($1_IMPORT_LIBRARY))
$$(call LogDebug, Deleting $$($1_BASENAME) because import library is missing)
$$(shell $(RM) $$($1_TARGET))
endif
$$($1_IMPORT_LIBRARY): $$($1_TARGET)
$(TOUCH) $$@
$1 += $$($1_IMPORT_LIBRARY)
endif
endif
$1_VARDEPS := $$($1_LD) $$($1_SYSROOT_LDFLAGS) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) \
$$($1_LIBS) $$($1_EXTRA_LIBS) $$($1_MT) \
$$($1_CREATE_DEBUGINFO_CMDS) $$($1_MANIFEST_VERSION) \
$$($1_STRIP_CMD) $$($1_CREATE_DEBUGLINK_CMDS)
$1_VARDEPS := $$($1_LD) $$($1_SYSROOT_LDFLAGS) $$($1_LDFLAGS) \
$$($1_EXTRA_LDFLAGS) $$($1_LIBS) $$($1_EXTRA_LIBS) \
$$($1_CREATE_DEBUGINFO_CMDS) $$($1_STRIP_CMD) $$($1_CREATE_DEBUGLINK_CMDS)
$1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \
$$($1_OBJECT_DIR)/$$($1_NOSUFFIX).vardeps)
$1_TARGET_DEPS := $$($1_ALL_OBJS) $$($1_RES) $$($1_MANIFEST) \
$$($1_REAL_MAPFILE) $$($1_VARDEPS_FILE)
$1_TARGET_DEPS := $$($1_ALL_OBJS) $$($1_VARDEPS_FILE)
$$($1_TARGET): $$($1_TARGET_DEPS)
ifneq ($$($1_OBJ_FILE_LIST), )
@@ -216,47 +156,27 @@ define CreateDynamicLibraryOrExecutable
$$(eval $$(call ListPathsSafely, $1_ALL_OBJS, $$($1_OBJ_FILE_LIST)))
endif
endif
# Keep as much as possible on one execution line for best performance
# on Windows
$$(call LogInfo, Linking $$($1_BASENAME))
$$(call MakeDir, $$($1_OUTPUT_DIR) $$($1_SYMBOLS_DIR))
ifeq ($(call isTargetOs, windows), true)
$$(call ExecuteWithLog, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_link, \
$$($1_LD) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) $$($1_SYSROOT_LDFLAGS) \
$(LD_OUT_OPTION)$$($1_TARGET) $$($1_LD_OBJ_ARG) $$($1_RES) \
$$($1_LIBS) $$($1_EXTRA_LIBS)) \
| $(GREP) -v "^ Creating library .*\.lib and object .*\.exp" || \
test "$$$$?" = "1" ; \
$$($1_CREATE_DEBUGINFO_CMDS)
$$($1_STRIP_CMD)
$$($1_CREATE_DEBUGLINK_CMDS)
ifeq ($(call isBuildOsEnv, windows.wsl2), true)
$$(CHMOD) +x $$($1_TARGET)
endif
else
$$(call ExecuteWithLog, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_link, \
$$(if $$($1_LINK_OBJS_RELATIVE), $$(CD) $$(OUTPUTDIR) ; ) \
$$($1_LD) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) $$($1_SYSROOT_LDFLAGS) \
$(LD_OUT_OPTION)$$($1_TARGET) $$($1_LD_OBJ_ARG) $$($1_RES) \
$$($1_LIBS) $$($1_EXTRA_LIBS)) ; \
$$($1_CREATE_DEBUGINFO_CMDS)
$$($1_STRIP_CMD)
$$($1_CREATE_DEBUGLINK_CMDS)
endif
ifeq ($(call isTargetOs, windows), true)
ifneq ($$($1_MANIFEST), )
$$($1_MT) -nologo -manifest $$($1_MANIFEST) -identity:"$$($1_NAME).exe, version=$$($1_MANIFEST_VERSION)" -outputresource:$$@;#1
endif
endif
$$(call ExecuteWithLog, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_link, \
$$(if $$($1_LINK_OBJS_RELATIVE), $$(CD) $$(OUTPUTDIR) ; ) \
$$($1_LD) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) \
$$($1_SYSROOT_LDFLAGS) -o $$($1_TARGET) $$($1_LD_OBJ_ARG) \
$$($1_LIBS) $$($1_EXTRA_LIBS))
$$($1_CREATE_DEBUGINFO_CMDS)
$$($1_STRIP_CMD)
$$($1_CREATE_DEBUGLINK_CMDS)
# On macosx, optionally run codesign on every binary.
# Remove signature explicitly first to avoid warnings if the linker
# added a default adhoc signature.
ifeq ($(MACOSX_CODESIGN_MODE), hardened)
$(CODESIGN) --remove-signature $$@
$(CODESIGN) -f -s "$(MACOSX_CODESIGN_IDENTITY)" --timestamp --options runtime \
--entitlements $$(call GetEntitlementsFile, $$@) $$@
$(CODESIGN) -f -s "$(MACOSX_CODESIGN_IDENTITY)" --timestamp \
--options runtime --entitlements \
$$(call GetEntitlementsFile, $$@) $$@
else ifeq ($(MACOSX_CODESIGN_MODE), debug)
$(CODESIGN) --remove-signature $$@
$(CODESIGN) -f -s - --entitlements $$(call GetEntitlementsFile, $$@) $$@
$(CODESIGN) -f -s - --entitlements \
$$(call GetEntitlementsFile, $$@) $$@
endif
endef

View File

@@ -0,0 +1,112 @@
#
# Copyright (c) 2011, 2024, 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
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
################################################################################
# This file contains functionality related to linking a native binary;
# creating either a dynamic library, a static library or an executable.
################################################################################
define CreateLinkedResultMicrosoft
ifeq ($$($1_TYPE), STATIC_LIBRARY)
$$(eval $$(call CreateStaticLibraryMicrosoft,$1))
else
$$(eval $$(call CreateDynamicLibraryOrExecutableMicrosoft,$1))
endif
endef
################################################################################
define CreateStaticLibraryMicrosoft
$1_VARDEPS := $$($1_LIB) $$(LIBFLAGS) $$($1_LIBFLAGS) $$($1_LIBS) \
$$($1_EXTRA_LIBS)
$1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \
$$($1_OBJECT_DIR)/$$($1_NOSUFFIX).vardeps)
$$($1_TARGET): $$($1_ALL_OBJS) $$($1_RES) $$($1_VARDEPS_FILE)
ifneq ($$($1_OBJ_FILE_LIST), )
$$(eval $$(call ListPathsSafely, $1_ALL_OBJS, $$($1_OBJ_FILE_LIST)))
endif
$$(call LogInfo, Building static library $$($1_BASENAME))
$$(call MakeDir, $$($1_OUTPUT_DIR) $$($1_SYMBOLS_DIR))
$$(call ExecuteWithLog, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_link, \
$$($1_LIB) -nologo $$(LIBFLAGS) $$($1_LIBFLAGS) -out:$$($1_TARGET) \
$$($1_LD_OBJ_ARG) $$($1_RES))
endef
################################################################################
define CreateDynamicLibraryOrExecutableMicrosoft
ifeq ($$($1_EMBED_MANIFEST), true)
$1_EXTRA_LDFLAGS += -manifest:embed
endif
$1_IMPORT_LIBRARY := $$($1_OBJECT_DIR)/$$($1_NAME).lib
$1_EXTRA_LDFLAGS += "-implib:$$($1_IMPORT_LIBRARY)"
ifeq ($$($1_TYPE), LIBRARY)
# To properly trigger downstream dependants of the import library, just as
# for debug files, we must have a recipe in the rule. To avoid rerunning
# the recipe every time have it touch the target. If an import library
# file is deleted by something external, explicitly delete the target to
# trigger a rebuild of both.
ifneq ($$(wildcard $$($1_IMPORT_LIBRARY)), $$($1_IMPORT_LIBRARY))
$$(call LogDebug, Deleting $$($1_BASENAME) because import library is missing)
$$(shell $(RM) $$($1_TARGET))
endif
$$($1_IMPORT_LIBRARY): $$($1_TARGET)
$(TOUCH) $$@
$1 += $$($1_IMPORT_LIBRARY)
endif
$1_VARDEPS := $$($1_LD) $$($1_SYSROOT_LDFLAGS) $$($1_LDFLAGS) \
$$($1_EXTRA_LDFLAGS) $$($1_LIBS) $$($1_EXTRA_LIBS) $$($1_MT) \
$$($1_MANIFEST_VERSION)
$1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \
$$($1_OBJECT_DIR)/$$($1_NOSUFFIX).vardeps)
$1_TARGET_DEPS := $$($1_ALL_OBJS) $$($1_RES) $$($1_MANIFEST) \
$$($1_VARDEPS_FILE)
$$($1_TARGET): $$($1_TARGET_DEPS)
ifneq ($$($1_OBJ_FILE_LIST), )
$$(eval $$(call ListPathsSafely, $1_ALL_OBJS, $$($1_OBJ_FILE_LIST)))
endif
$$(call LogInfo, Linking $$($1_BASENAME))
$$(call MakeDir, $$($1_OUTPUT_DIR) $$($1_SYMBOLS_DIR))
$$(call ExecuteWithLog, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_link, \
$$($1_LD) -nologo $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) \
$$($1_SYSROOT_LDFLAGS) -out:$$($1_TARGET) $$($1_LD_OBJ_ARG) \
$$($1_RES) $$($1_LIBS) $$($1_EXTRA_LIBS)) \
| $(GREP) -v "^ Creating library .*\.lib and object .*\.exp" || \
test "$$$$?" = "1"
ifeq ($(call isBuildOsEnv, windows.wsl2), true)
$$(CHMOD) +x $$($1_TARGET)
endif
ifneq ($$($1_MANIFEST), )
$$($1_MT) -nologo -manifest $$($1_MANIFEST) \
-identity:"$$($1_NAME).exe, version=$$($1_MANIFEST_VERSION)" \
-outputresource:$$@;#1
endif
endef

View File

@@ -1,125 +0,0 @@
#
# Copyright (c) 2011, 2024, 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
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
################################################################################
# This file contains functionality related to setting up our toolchain
# definition variables.
################################################################################
# Define a native toolchain configuration that can be used by
# SetupNativeCompilation calls
#
# Parameter 1 is the name of the toolchain definition
#
# Remaining parameters are named arguments:
# EXTENDS - Optional parent definition to get defaults from
# CC - The C compiler
# CXX - The C++ compiler
# LD - The Linker
# AR - Static linker
# AS - Assembler
# MT - Windows MT tool
# RC - Windows RC tool
# OBJCOPY - The objcopy tool for debug symbol handling
# STRIP - The tool to use for stripping debug symbols
# SYSROOT_CFLAGS - Compiler flags for using the specific sysroot
# SYSROOT_LDFLAGS - Linker flags for using the specific sysroot
DefineNativeToolchain = $(NamedParamsMacroTemplate)
define DefineNativeToolchainBody
# If extending another definition, get default values from that,
# otherwise, nothing more needs to be done as variable assignments
# already happened in NamedParamsMacroTemplate.
ifneq ($$($1_EXTENDS), )
$$(call SetIfEmpty, $1_CC, $$($$($1_EXTENDS)_CC))
$$(call SetIfEmpty, $1_CXX, $$($$($1_EXTENDS)_CXX))
$$(call SetIfEmpty, $1_LD, $$($$($1_EXTENDS)_LD))
$$(call SetIfEmpty, $1_AR, $$($$($1_EXTENDS)_AR))
$$(call SetIfEmpty, $1_AS, $$($$($1_EXTENDS)_AS))
$$(call SetIfEmpty, $1_MT, $$($$($1_EXTENDS)_MT))
$$(call SetIfEmpty, $1_RC, $$($$($1_EXTENDS)_RC))
$$(call SetIfEmpty, $1_OBJCOPY, $$($$($1_EXTENDS)_OBJCOPY))
$$(call SetIfEmpty, $1_STRIP, $$($$($1_EXTENDS)_STRIP))
$$(call SetIfEmpty, $1_SYSROOT_CFLAGS, $$($$($1_EXTENDS)_SYSROOT_CFLAGS))
$$(call SetIfEmpty, $1_SYSROOT_LDFLAGS, $$($$($1_EXTENDS)_SYSROOT_LDFLAGS))
endif
endef
# Create a default toolchain with the main compiler and linker
$(eval $(call DefineNativeToolchain, TOOLCHAIN_DEFAULT, \
CC := $(CC), \
CXX := $(CXX), \
LD := $(LD), \
AR := $(AR), \
AS := $(AS), \
MT := $(MT), \
RC := $(RC), \
OBJCOPY := $(OBJCOPY), \
STRIP := $(STRIP), \
SYSROOT_CFLAGS := $(SYSROOT_CFLAGS), \
SYSROOT_LDFLAGS := $(SYSROOT_LDFLAGS), \
))
# Create a toolchain where linking is done with the C++ linker
$(eval $(call DefineNativeToolchain, TOOLCHAIN_LINK_CXX, \
EXTENDS := TOOLCHAIN_DEFAULT, \
LD := $(LDCXX), \
))
# Create a toolchain with the BUILD compiler, used for build tools that
# are to be run during the build.
$(eval $(call DefineNativeToolchain, TOOLCHAIN_BUILD, \
CC := $(BUILD_CC), \
CXX := $(BUILD_CXX), \
LD := $(BUILD_LD), \
AR := $(BUILD_AR), \
AS := $(BUILD_AS), \
OBJCOPY := $(BUILD_OBJCOPY), \
STRIP := $(BUILD_STRIP), \
SYSROOT_CFLAGS := $(BUILD_SYSROOT_CFLAGS), \
SYSROOT_LDFLAGS := $(BUILD_SYSROOT_LDFLAGS), \
))
# BUILD toolchain with the C++ linker
$(eval $(call DefineNativeToolchain, TOOLCHAIN_BUILD_LINK_CXX, \
EXTENDS := TOOLCHAIN_BUILD, \
LD := $(BUILD_LDCXX), \
))
################################################################################
# Setup the toolchain to be used
define SetupToolchain
$$(call SetIfEmpty, $1_TOOLCHAIN, TOOLCHAIN_DEFAULT)
$$(call SetIfEmpty, $1_CC, $$($$($1_TOOLCHAIN)_CC))
$$(call SetIfEmpty, $1_CXX, $$($$($1_TOOLCHAIN)_CXX))
$$(call SetIfEmpty, $1_LD, $$($$($1_TOOLCHAIN)_LD))
$$(call SetIfEmpty, $1_AR, $$($$($1_TOOLCHAIN)_AR))
$$(call SetIfEmpty, $1_AS, $$($$($1_TOOLCHAIN)_AS))
$$(call SetIfEmpty, $1_MT, $$($$($1_TOOLCHAIN)_MT))
$$(call SetIfEmpty, $1_RC, $$($$($1_TOOLCHAIN)_RC))
$$(call SetIfEmpty, $1_OBJCOPY, $$($$($1_TOOLCHAIN)_OBJCOPY))
$$(call SetIfEmpty, $1_STRIP, $$($$($1_TOOLCHAIN)_STRIP))
$$(call SetIfEmpty, $1_SYSROOT_CFLAGS, $$($$($1_TOOLCHAIN)_SYSROOT_CFLAGS))
$$(call SetIfEmpty, $1_SYSROOT_LDFLAGS, $$($$($1_TOOLCHAIN)_SYSROOT_LDFLAGS))
endef

View File

@@ -1,26 +0,0 @@
#
# Copyright (c) 2016, 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
# 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.
#
JVM_handle_aix_signal
numa_error
numa_warn

View File

@@ -1,26 +0,0 @@
#
# Copyright (c) 2016, 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
# 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.
#
JVM_AccessVMBooleanFlag
JVM_AccessVMIntFlag
JVM_VMBreakPoint

View File

@@ -1,27 +0,0 @@
#
# Copyright (c) 2016, 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
# 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.
#
JVM_handle_linux_signal
JVM_IsUseContainerSupport
numa_error
numa_warn

View File

@@ -1,24 +0,0 @@
#
# Copyright (c) 2016, 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
# 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.
#
JVM_handle_bsd_signal

View File

@@ -1,35 +0,0 @@
#
# Copyright (c) 2016, 2023, 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
# 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.
#
AsyncGetCallTrace
jio_fprintf
jio_printf
jio_snprintf
jio_vfprintf
jio_vsnprintf
JNI_CreateJavaVM
JNI_GetCreatedJavaVMs
JNI_GetDefaultJavaVMInitArgs
JVM_IsForeignLinkerSupported
JVM_FindClassFromBootLoader
JVM_InitAgentProperties

View File

@@ -1,233 +0,0 @@
#
# Copyright (c) 2016, 2023, 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
# 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.
#
JVM_ActiveProcessorCount
JVM_AreNestMates
JVM_ArrayCopy
JVM_AssertionStatusDirectives
JVM_BeforeHalt
JVM_CallStackWalk
JVM_Clone
JVM_ConstantPoolGetClassAt
JVM_ConstantPoolGetClassAtIfLoaded
JVM_ConstantPoolGetClassRefIndexAt
JVM_ConstantPoolGetDoubleAt
JVM_ConstantPoolGetFieldAt
JVM_ConstantPoolGetFieldAtIfLoaded
JVM_ConstantPoolGetFloatAt
JVM_ConstantPoolGetIntAt
JVM_ConstantPoolGetLongAt
JVM_ConstantPoolGetMemberRefInfoAt
JVM_ConstantPoolGetMethodAt
JVM_ConstantPoolGetMethodAtIfLoaded
JVM_ConstantPoolGetNameAndTypeRefIndexAt
JVM_ConstantPoolGetNameAndTypeRefInfoAt
JVM_ConstantPoolGetSize
JVM_ConstantPoolGetStringAt
JVM_ConstantPoolGetTagAt
JVM_ConstantPoolGetUTF8At
JVM_CurrentCarrierThread
JVM_CurrentThread
JVM_SetCurrentThread
JVM_CurrentTimeMillis
JVM_DefineClass
JVM_DefineClassWithSource
JVM_DesiredAssertionStatus
JVM_DumpAllStacks
JVM_DumpClassListToFile
JVM_DumpDynamicArchive
JVM_DumpThreads
JVM_ExpandStackFrameInfo
JVM_FillInStackTrace
JVM_FindClassFromCaller
JVM_FindClassFromClass
JVM_FindLibraryEntry
JVM_FindLoadedClass
JVM_FindPrimitiveClass
JVM_FindSignal
JVM_FreeMemory
JVM_GC
JVM_GetAllThreads
JVM_GetAndClearReferencePendingList
JVM_GetArrayElement
JVM_GetArrayLength
JVM_GetCallerClass
JVM_GetClassAccessFlags
JVM_GetClassAnnotations
JVM_GetClassConstantPool
JVM_GetClassContext
JVM_GetClassCPEntriesCount
JVM_GetClassCPTypes
JVM_GetClassDeclaredConstructors
JVM_GetClassDeclaredFields
JVM_GetClassDeclaredMethods
JVM_GetClassFieldsCount
JVM_GetClassFileVersion
JVM_GetClassInterfaces
JVM_GetClassMethodsCount
JVM_GetClassModifiers
JVM_GetClassNameUTF
JVM_GetClassSignature
JVM_GetClassSigners
JVM_GetClassTypeAnnotations
JVM_GetCPClassNameUTF
JVM_GetCPFieldClassNameUTF
JVM_GetCPFieldModifiers
JVM_GetCPFieldNameUTF
JVM_GetCPFieldSignatureUTF
JVM_GetCPMethodClassNameUTF
JVM_GetCPMethodModifiers
JVM_GetCPMethodNameUTF
JVM_GetCPMethodSignatureUTF
JVM_GetDeclaredClasses
JVM_GetDeclaringClass
JVM_GetEnclosingMethodInfo
JVM_GetExtendedNPEMessage
JVM_GetFieldIxModifiers
JVM_GetFieldTypeAnnotations
JVM_GetInheritedAccessControlContext
JVM_GetManagement
JVM_GetMethodIxArgsSize
JVM_GetMethodIxByteCode
JVM_GetMethodIxByteCodeLength
JVM_GetMethodIxExceptionIndexes
JVM_GetMethodIxExceptionsCount
JVM_GetMethodIxExceptionTableEntry
JVM_GetMethodIxExceptionTableLength
JVM_GetMethodIxLocalsCount
JVM_GetMethodIxMaxStack
JVM_GetMethodIxModifiers
JVM_GetMethodIxNameUTF
JVM_GetMethodIxSignatureUTF
JVM_GetMethodParameters
JVM_GetMethodTypeAnnotations
JVM_GetNanoTimeAdjustment
JVM_GetNestHost
JVM_GetNestMembers
JVM_GetNextThreadIdOffset
JVM_GetPermittedSubclasses
JVM_GetPrimitiveArrayElement
JVM_GetProperties
JVM_GetProtectionDomain
JVM_GetRandomSeedForDumping
JVM_GetRecordComponents
JVM_GetSimpleBinaryName
JVM_GetStackAccessControlContext
JVM_GetSystemPackage
JVM_GetSystemPackages
JVM_GetTemporaryDirectory
JVM_GetVmArguments
JVM_Halt
JVM_HasReferencePendingList
JVM_HoldsLock
JVM_GetStackTrace
JVM_IHashCode
JVM_InitClassName
JVM_InitStackTraceElement
JVM_InitStackTraceElementArray
JVM_InitializeFromArchive
JVM_InternString
JVM_Interrupt
JVM_InvokeMethod
JVM_IsArrayClass
JVM_IsCDSDumpingEnabled
JVM_IsConstructorIx
JVM_IsDumpingClassList
JVM_IsFinalizationEnabled
JVM_IsHiddenClass
JVM_IsInterface
JVM_IsPreviewEnabled
JVM_IsContinuationsSupported
JVM_IsPrimitiveClass
JVM_IsRecord
JVM_IsSameClassPackage
JVM_IsSharingEnabled
JVM_IsSupportedJNIVersion
JVM_IsVMGeneratedMethodIx
JVM_LatestUserDefinedLoader
JVM_LoadZipLibrary
JVM_LoadLibrary
JVM_LookupDefineClass
JVM_LookupLambdaProxyClassFromArchive
JVM_LogLambdaFormInvoker
JVM_MaxMemory
JVM_MaxObjectInspectionAge
JVM_MonitorNotify
JVM_MonitorNotifyAll
JVM_MonitorWait
JVM_MoreStackWalk
JVM_NanoTime
JVM_NativePath
JVM_NewArray
JVM_NewInstanceFromConstructor
JVM_NewMultiArray
JVM_PhantomReferenceRefersTo
JVM_PrintWarningAtDynamicAgentLoad
JVM_RaiseSignal
JVM_RawMonitorCreate
JVM_RawMonitorDestroy
JVM_RawMonitorEnter
JVM_RawMonitorExit
JVM_ReferenceClear
JVM_ReferenceRefersTo
JVM_RegisterContinuationMethods
JVM_RegisterLambdaProxyClassForArchiving
JVM_RegisterSignal
JVM_ReleaseUTF
JVM_ReportFinalizationComplete
JVM_SetArrayElement
JVM_SetClassSigners
JVM_SetNativeThreadName
JVM_SetPrimitiveArrayElement
JVM_SetStackWalkContinuation
JVM_SetThreadPriority
JVM_SleepNanos
JVM_StartThread
JVM_TotalMemory
JVM_UnloadLibrary
JVM_WaitForReferencePendingList
JVM_Yield
# Module related API's
JVM_AddModuleExports
JVM_AddModuleExportsToAll
JVM_AddModuleExportsToAllUnnamed
JVM_AddReadsModule
JVM_DefineArchivedModules
JVM_DefineModule
JVM_SetBootLoaderUnnamedModule
# Virtual thread notifications for JVMTI
JVM_VirtualThreadStart
JVM_VirtualThreadEnd
JVM_VirtualThreadMount
JVM_VirtualThreadUnmount
JVM_VirtualThreadHideFrames
JVM_VirtualThreadDisableSuspend
# Scoped values
JVM_EnsureMaterializedForStackWalk_func
JVM_FindScopedValueBindings
JVM_ScopedValueCache
JVM_SetScopedValueCache
#

View File

@@ -0,0 +1,11 @@
SUNWprivate_1.1 {
global:
*;
local:
__bss_start;
_edata;
_end;
_fini;
_init;
};

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2013, 2024, 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
@@ -45,7 +45,6 @@ ifeq ($(call check-jvm-feature, compiler2), true)
ADLC_CFLAGS := -qnortti -qeh -q64 -DAIX
endif
else ifeq ($(call isBuildOs, windows), true)
ADLC_LDFLAGS += -nologo
ADLC_CFLAGS := -nologo -EHsc
ADLC_CFLAGS_WARNINGS := -W3 -D_CRT_SECURE_NO_WARNINGS
endif
@@ -72,7 +71,8 @@ ifeq ($(call check-jvm-feature, compiler2), true)
$(eval $(call SetupNativeCompilation, BUILD_ADLC, \
NAME := adlc, \
TYPE := EXECUTABLE, \
TOOLCHAIN := TOOLCHAIN_BUILD_LINK_CXX, \
TARGET_TYPE := BUILD, \
LINK_TYPE := C++, \
SRC := $(TOPDIR)/src/hotspot/share/adlc, \
EXTRA_FILES := $(TOPDIR)/src/hotspot/share/opto/opcodes.cpp, \
CFLAGS := $(ADLC_CFLAGS) $(ADLC_CFLAGS_WARNINGS), \

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2016, 2024, 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
@@ -50,7 +50,7 @@ endif
$(eval $(call SetupJdkLibrary, BUILD_GTEST_LIBGTEST, \
NAME := gtest, \
TYPE := STATIC_LIBRARY, \
TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
LINK_TYPE := C++, \
OUTPUT_DIR := $(JVM_OUTPUTDIR)/libgtest, \
OBJECT_DIR := $(JVM_OUTPUTDIR)/libgtest/objs, \
SRC := \
@@ -75,25 +75,11 @@ $(eval $(call SetupJdkLibrary, BUILD_GTEST_LIBGTEST, \
TARGETS += $(BUILD_GTEST_LIBGTEST)
################################################################################
ifeq ($(call isTargetOs, windows), true)
GTEST_JVM_MAPFILE := $(JVM_MAPFILE)
else
GTEST_JVM_MAPFILE := $(JVM_OUTPUTDIR)/gtest/mapfile
$(JVM_OUTPUTDIR)/gtest/symbols: $(JVM_OUTPUTDIR)/symbols
$(call MakeDir, $(@D))
( $(CAT) $< ; echo "runUnitTests" ) > $@
$(GTEST_JVM_MAPFILE): $(JVM_OUTPUTDIR)/gtest/symbols
$(call create-mapfile)
endif
# Additional disabled warnings are due to code in the test source.
$(eval $(call SetupJdkLibrary, BUILD_GTEST_LIBJVM, \
NAME := jvm, \
TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
LINK_TYPE := C++, \
OUTPUT_DIR := $(JVM_OUTPUTDIR)/gtest, \
OBJECT_DIR := $(JVM_OUTPUTDIR)/gtest/objs, \
SRC := $(GTEST_TEST_SRC), \
@@ -123,8 +109,6 @@ $(eval $(call SetupJdkLibrary, BUILD_GTEST_LIBJVM, \
LIBS_unix := -lgtest, \
LIBS_windows := $(JVM_OUTPUTDIR)/libgtest/gtest.lib, \
OPTIMIZATION := $(JVM_OPTIMIZATION), \
MAPFILE := $(GTEST_JVM_MAPFILE), \
USE_MAPFILE_FOR_SYMBOLS := true, \
COPY_DEBUG_SYMBOLS := $(GTEST_COPY_DEBUG_SYMBOLS), \
ZIP_EXTERNAL_DEBUG_SYMBOLS := false, \
STRIP_SYMBOLS := false, \
@@ -134,14 +118,19 @@ $(eval $(call SetupJdkLibrary, BUILD_GTEST_LIBJVM, \
$(BUILD_GTEST_LIBJVM) : $(BUILD_GTEST_LIBGTEST)
ifeq ($(call isTargetOs, windows), true)
$(BUILD_GTEST_LIBJVM_TARGET): $(WIN_EXPORT_FILE)
endif
TARGETS += $(BUILD_GTEST_LIBJVM)
################################################################################
$(eval $(call SetupJdkExecutable, BUILD_GTEST_LAUNCHER, \
TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
NAME := gtestLauncher, \
TYPE := EXECUTABLE, \
LINK_TYPE := C++, \
OUTPUT_DIR := $(JVM_OUTPUTDIR)/gtest, \
EXTRA_FILES := $(GTEST_LAUNCHER_SRC), \
OBJECT_DIR := $(JVM_OUTPUTDIR)/gtest/launcher-objs, \

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2013, 2024, 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
@@ -33,7 +33,6 @@ include lib/JvmFlags.gmk
# Setup compilation of the main Hotspot native library (libjvm).
JVM_OUTPUTDIR := $(JVM_VARIANT_OUTPUTDIR)/libjvm
JVM_MAPFILE := $(JVM_OUTPUTDIR)/mapfile
################################################################################
# Platform independent setup
@@ -146,12 +145,28 @@ $(call FillFindCache, $(JVM_SRC_DIRS))
# operator new.
LIBJVM_STATIC_EXCLUDE_OBJS := operator_new.o
ifeq ($(call isTargetOs, windows), true)
ifeq ($(STATIC_LIBS), true)
WIN_EXPORT_FILE := $(JVM_OUTPUTDIR)/static-win-exports.def
else
WIN_EXPORT_FILE := $(JVM_OUTPUTDIR)/win-exports.def
endif
JVM_LDFLAGS += -def:$(WIN_EXPORT_FILE)
endif
ifeq ($(call isTargetOs, linux), true)
HOTSPOT_VERSION_SCRIPT := $(TOPDIR)/make/data/hotspot-symbols/version-script.txt
JVM_LDFLAGS += -Wl,--exclude-libs,ALL -Wl,-version-script=$(HOTSPOT_VERSION_SCRIPT)
endif
################################################################################
# Now set up the actual compilation of the main hotspot native library
$(eval $(call SetupJdkLibrary, BUILD_LIBJVM, \
NAME := jvm, \
TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
LINK_TYPE := C++, \
OUTPUT_DIR := $(JVM_LIB_OUTPUTDIR), \
SRC := $(JVM_SRC_DIRS), \
EXCLUDES := $(JVM_EXCLUDES), \
@@ -169,6 +184,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJVM, \
DISABLED_WARNINGS_gcc_jvmciCodeInstaller.cpp := stringop-overflow, \
DISABLED_WARNINGS_gcc_jvmtiTagMap.cpp := stringop-overflow, \
DISABLED_WARNINGS_gcc_postaloc.cpp := address, \
DISABLED_WARNINGS_gcc_shenandoahLock.cpp := stringop-overflow, \
DISABLED_WARNINGS_gcc_synchronizer.cpp := stringop-overflow, \
DISABLED_WARNINGS_clang := $(DISABLED_WARNINGS_clang), \
DISABLED_WARNINGS_clang_arguments.cpp := missing-field-initializers, \
@@ -194,8 +210,6 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJVM, \
LIBS := $(JVM_LIBS), \
OPTIMIZATION := $(JVM_OPTIMIZATION), \
OBJECT_DIR := $(JVM_OUTPUTDIR)/objs, \
MAPFILE := $(JVM_MAPFILE), \
USE_MAPFILE_FOR_SYMBOLS := true, \
STRIPFLAGS := $(JVM_STRIPFLAGS), \
EMBED_MANIFEST := true, \
RC_FILEDESC := $(HOTSPOT_VM_DISTRO) $(OPENJDK_TARGET_CPU_BITS)-Bit $(JVM_VARIANT) VM, \
@@ -204,11 +218,47 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJVM, \
STATIC_LIB_EXCLUDE_OBJS := $(LIBJVM_STATIC_EXCLUDE_OBJS), \
))
ifeq ($(call isTargetOs, windows), true)
# The following lines create a list of vftable symbols to be filtered out of
# the symbol file. Removing this line causes the linker to complain about too
# many (> 64K) symbols, so the _guess_ is that this line is here to keep down
# the number of exported symbols below that limit.
#
# Some usages of C++ lambdas require the vftable symbol of classes that use
# the lambda type as a template parameter. The usage of those classes won't
# link if their vftable symbols are removed. That's why there's an exception
# for vftable symbols containing the string 'lambda'.
#
# A very simple example of a lambda usage that fails if the lambda vftable
# symbols are missing in the symbol file:
#
# #include <functional>
# std::function<void()> f = [](){}
FILTER_SYMBOLS_AWK_SCRIPT := \
'{ \
if ($$7 ~ /\?\?_7.*@@6B@/ && $$7 !~ /type_info/ && $$7 !~ /lambda/) print " " $$7; \
}'
# A more correct solution would be to send BUILD_LIBJVM_ALL_OBJS instead of
# cd && *.obj, but this will result in very long command lines, which could be
# problematic.
$(WIN_EXPORT_FILE): $(BUILD_LIBJVM_ALL_OBJS)
$(call LogInfo, Generating list of symbols to export from object files)
$(call MakeDir, $(@D))
$(ECHO) "EXPORTS" > $@.tmp
$(CD) $(BUILD_LIBJVM_OBJECT_DIR) && \
$(DUMPBIN) -symbols *$(OBJ_SUFFIX) | $(AWK) $(FILTER_SYMBOLS_AWK_SCRIPT) | $(SORT) -u >> $@.tmp
$(RM) $@
$(MV) $@.tmp $@
$(BUILD_LIBJVM_TARGET): $(WIN_EXPORT_FILE)
endif
# Always recompile abstract_vm_version.cpp if libjvm needs to be relinked. This ensures
# that the internal vm version is updated as it relies on __DATE__ and __TIME__
# macros.
ABSTRACT_VM_VERSION_OBJ := $(JVM_OUTPUTDIR)/objs/abstract_vm_version$(OBJ_SUFFIX)
$(ABSTRACT_VM_VERSION_OBJ): $(filter-out $(ABSTRACT_VM_VERSION_OBJ) $(JVM_MAPFILE), \
$(ABSTRACT_VM_VERSION_OBJ): $(filter-out $(ABSTRACT_VM_VERSION_OBJ), \
$(BUILD_LIBJVM_TARGET_DEPS))
ifneq ($(GENERATE_COMPILE_COMMANDS_ONLY), true)
@@ -236,11 +286,6 @@ endif
# 1540-1090 : (I) The destructor of "..." might not be called.
# 1540-1639 : (I) The behavior of long type bit fields has changed ...
# Include mapfile generation. It relies on BUILD_LIBJVM_ALL_OBJS which is only
# defined after the above call to BUILD_LIBJVM. Mapfile will be generated
# after all object files are built, but before the jvm library is linked.
include lib/JvmMapfile.gmk
TARGETS += $(BUILD_LIBJVM)
################################################################################

View File

@@ -1,176 +0,0 @@
#
# Copyright (c) 2013, 2023, 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
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
$(eval $(call IncludeCustomExtension, hotspot/lib/JvmMapfile.gmk))
################################################################################
# Combine a list of static symbols
ifeq ($(call And, $(call isTargetOs, windows) $(call isTargetCpu, x86_64)), false)
# On Windows x86_64, we should not have any symbols at all, since that
# results in duplicate warnings from the linker (JDK-8043491).
SYMBOLS_SRC += $(TOPDIR)/make/data/hotspot-symbols/symbols-shared
endif
ifeq ($(call isTargetOsType, unix), true)
SYMBOLS_SRC += $(TOPDIR)/make/data/hotspot-symbols/symbols-unix
endif
ifneq ($(wildcard $(TOPDIR)/make/data/hotspot-symbols/symbols-$(OPENJDK_TARGET_OS)), )
SYMBOLS_SRC += $(TOPDIR)/make/data/hotspot-symbols/symbols-$(OPENJDK_TARGET_OS)
endif
ifneq ($(findstring debug, $(DEBUG_LEVEL)), )
ifneq ($(wildcard $(TOPDIR)/make/data/hotspot-symbols/symbols-$(OPENJDK_TARGET_OS)-debug), )
SYMBOLS_SRC += $(TOPDIR)/make/data/hotspot-symbols/symbols-$(OPENJDK_TARGET_OS)-debug
endif
endif
################################################################################
# Create a dynamic list of symbols from the built object files. This is highly
# platform dependent.
ifeq ($(call isTargetOs, linux), true)
DUMP_SYMBOLS_CMD := $(NM) $(NMFLAGS) --defined-only *$(OBJ_SUFFIX)
ifneq ($(FILTER_SYMBOLS_PATTERN), )
FILTER_SYMBOLS_PATTERN := $(FILTER_SYMBOLS_PATTERN)|
endif
FILTER_SYMBOLS_PATTERN := $(FILTER_SYMBOLS_PATTERN)^_ZTV|^gHotSpotVM|^UseSharedSpaces$$
FILTER_SYMBOLS_PATTERN := $(FILTER_SYMBOLS_PATTERN)|^_ZN9Arguments17SharedArchivePathE$$
FILTER_SYMBOLS_AWK_SCRIPT := \
'{ \
if ($$3 ~ /$(FILTER_SYMBOLS_PATTERN)/) print $$3; \
}'
else ifeq ($(call isTargetOs, macosx), true)
# nm on macosx prints out "warning: nm: no name list" to stderr for
# files without symbols. Hide this, even at the expense of hiding real errors.
DUMP_SYMBOLS_CMD := $(NM) $(NMFLAGS) -Uj *$(OBJ_SUFFIX) 2> /dev/null
ifneq ($(FILTER_SYMBOLS_PATTERN), )
FILTER_SYMBOLS_PATTERN := $(FILTER_SYMBOLS_PATTERN)|
endif
FILTER_SYMBOLS_PATTERN := $(FILTER_SYMBOLS_PATTERN)^_ZTV|^gHotSpotVM
FILTER_SYMBOLS_AWK_SCRIPT := \
'{ \
if ($$3 ~ /$(FILTER_SYMBOLS_PATTERN)/) print $$3; \
}'
# NOTE: The script is from the old build. It is broken and finds no symbols.
# The script below might be what was intended, but it fails to link with tons
# of 'cannot export hidden symbol vtable for X'.
# '{ if ($$1 ~ /^__ZTV/ || $$1 ~ /^_gHotSpotVM/) print substr($$1, 2) }'
else ifeq ($(call isTargetOs, aix), true)
# NOTE: The old build had the solution below. This should to be fixed in
# configure instead.
# On AIX we have to prevent that we pick up the 'nm' version from the GNU binutils
# which may be installed under /opt/freeware/bin. So better use an absolute path here!
# NM=/usr/bin/nm
DUMP_SYMBOLS_CMD := $(NM) $(NMFLAGS) -B -C *$(OBJ_SUFFIX)
FILTER_SYMBOLS_AWK_SCRIPT := \
'{ \
if (($$2="d" || $$2="D") && ($$3 ~ /^__vft/ || $$3 ~ /^gHotSpotVM/)) print $$3; \
if ($$3 ~ /^UseSharedSpaces$$/) print $$3; \
if ($$3 ~ /^SharedArchivePath__9Arguments$$/) print $$3; \
}'
else ifeq ($(call isTargetOs, windows), true)
DUMP_SYMBOLS_CMD := $(DUMPBIN) -symbols *$(OBJ_SUFFIX)
# The following lines create a list of vftable symbols to be filtered out of
# the mapfile. Removing this line causes the linker to complain about too many
# (> 64K) symbols, so the _guess_ is that this line is here to keep down the
# number of exported symbols below that limit.
#
# Some usages of C++ lambdas require the vftable symbol of classes that use
# the lambda type as a template parameter. The usage of those classes won't
# link if their vftable symbols are removed. That's why there's an exception
# for vftable symbols containing the string 'lambda'.
#
# A very simple example of a lambda usage that fails if the lambda vftable
# symbols are missing in the mapfile:
#
# #include <functional>
# std::function<void()> f = [](){}
FILTER_SYMBOLS_AWK_SCRIPT := \
'{ \
if ($$7 ~ /\?\?_7.*@@6B@/ && $$7 !~ /type_info/ && $$7 !~ /lambda/) print $$7; \
}'
else
$(error Unknown target OS $(OPENJDK_TARGET_OS) in JvmMapfile.gmk)
endif
# A more correct solution would be to send BUILD_LIBJVM_ALL_OBJS instead of
# cd && *.o, but this will result in very long command lines, which is
# problematic on some platforms.
$(JVM_OUTPUTDIR)/symbols-objects: $(BUILD_LIBJVM_ALL_OBJS)
$(call LogInfo, Generating symbol list from object files)
$(CD) $(JVM_OUTPUTDIR)/objs && \
$(DUMP_SYMBOLS_CMD) | $(AWK) $(FILTER_SYMBOLS_AWK_SCRIPT) | $(SORT) -u > $@
SYMBOLS_SRC += $(JVM_OUTPUTDIR)/symbols-objects
################################################################################
# Now concatenate all symbol lists into a single file and remove comments.
$(JVM_OUTPUTDIR)/symbols: $(SYMBOLS_SRC)
$(SED) -e '/^#/d' $^ > $@
################################################################################
# Finally convert the symbol list into a platform-specific mapfile
ifeq ($(call isTargetOs, macosx), true)
# On macosx, we need to add a leading underscore
define create-mapfile-work
$(AWK) '{ if ($$0 ~ ".") { print " _" $$0 } }' < $^ > $@.tmp
endef
else ifeq ($(call isTargetOs, windows), true)
# On windows, add an 'EXPORTS' header
define create-mapfile-work
$(ECHO) "EXPORTS" > $@.tmp
$(AWK) '{ if ($$0 ~ ".") { print " " $$0 } }' < $^ >> $@.tmp
endef
else
# Assume standard linker script
define create-mapfile-work
$(PRINTF) "SUNWprivate_1.1 { \n global: \n" > $@.tmp
$(AWK) '{ if ($$0 ~ ".") { print " " $$0 ";" } }' < $^ >> $@.tmp
$(PRINTF) " local: \n *; \n }; \n" >> $@.tmp
endef
endif
define create-mapfile
$(call LogInfo, Creating mapfile)
$(call MakeDir, $(@D))
$(call create-mapfile-work)
$(RM) $@
$(MV) $@.tmp $@
endef
$(JVM_MAPFILE): $(JVM_OUTPUTDIR)/symbols
$(call create-mapfile)

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2024, 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
@@ -242,7 +242,7 @@ endif
ifeq ($(call isTargetOs, linux)+$(call isTargetCpu, x86_64)+$(INCLUDE_COMPILER2)+$(filter $(TOOLCHAIN_TYPE), gcc), true+true+true+gcc)
$(eval $(call SetupJdkLibrary, BUILD_LIB_SIMD_SORT, \
NAME := simdsort, \
TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
LINK_TYPE := C++, \
OPTIMIZATION := HIGH, \
CFLAGS := $(CFLAGS_JDKLIB), \
CXXFLAGS := $(CXXFLAGS_JDKLIB) -std=c++17, \

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2024, 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
@@ -115,7 +115,7 @@ TARGETS += $(BUILD_LIBZIP)
$(eval $(call SetupJdkLibrary, BUILD_LIBJIMAGE, \
NAME := jimage, \
TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
LINK_TYPE := C++, \
OPTIMIZATION := LOW, \
CFLAGS := $(CFLAGS_JDKLIB), \
CXXFLAGS := $(CXXFLAGS_JDKLIB), \

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2024, 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
@@ -51,13 +51,14 @@ ifeq ($(call isTargetOs, aix), false)
-DUSE_PLATFORM_MIDI_IN=TRUE \
#
LIBJSOUND_LINK_TYPE := C
ifeq ($(call isTargetOs, macosx), true)
LIBJSOUND_TOOLCHAIN := TOOLCHAIN_LINK_CXX
LIBJSOUND_LINK_TYPE := C++
endif
$(eval $(call SetupJdkLibrary, BUILD_LIBJSOUND, \
NAME := jsound, \
TOOLCHAIN := $(LIBJSOUND_TOOLCHAIN), \
LINK_TYPE := $(LIBJSOUND_LINK_TYPE), \
OPTIMIZATION := LOW, \
CFLAGS := $(CFLAGS_JDKLIB) \
$(LIBJSOUND_CFLAGS), \

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2024, 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
@@ -562,9 +562,9 @@ LIBFONTMANAGER_CFLAGS += $(X_CFLAGS) -DLE_STANDALONE -DHEADLESS
# libawt_xawt). See JDK-8196516 for details.
$(eval $(call SetupJdkLibrary, BUILD_LIBFONTMANAGER, \
NAME := fontmanager, \
LINK_TYPE := C++, \
EXCLUDE_FILES := $(LIBFONTMANAGER_EXCLUDE_FILES) \
AccelGlyphCache.c, \
TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
CFLAGS := $(CFLAGS_JDKLIB) $(LIBFONTMANAGER_CFLAGS), \
CXXFLAGS := $(CXXFLAGS_JDKLIB) $(LIBFONTMANAGER_CFLAGS), \
OPTIMIZATION := $(LIBFONTMANAGER_OPTIMIZATION), \

View File

@@ -45,16 +45,16 @@ else ifeq ($(call isTargetOs, windows), true)
endif
endif
SA_TOOLCHAIN := $(TOOLCHAIN_DEFAULT)
SA_LINK_TYPE := C
ifeq ($(call isTargetOs, linux), true)
SA_TOOLCHAIN := TOOLCHAIN_LINK_CXX
SA_LINK_TYPE := C++
endif
################################################################################
$(eval $(call SetupJdkLibrary, BUILD_LIBSA, \
NAME := saproc, \
TOOLCHAIN := $(SA_TOOLCHAIN), \
LINK_TYPE := $(SA_LINK_TYPE), \
OPTIMIZATION := HIGH, \
DISABLED_WARNINGS_gcc := sign-compare, \
DISABLED_WARNINGS_gcc_ps_core.c := pointer-arith, \

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2015, 2024, 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
@@ -31,7 +31,7 @@ ifeq ($(call isTargetOs, linux macosx windows), true)
$(eval $(call SetupJdkLibrary, BUILD_LIBLE, \
NAME := le, \
TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
LINK_TYPE := C++, \
OPTIMIZATION := LOW, \
CFLAGS := $(CXXFLAGS_JDKLIB), \
LDFLAGS := $(LDFLAGS_JDKLIB), \

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2018, 2024, 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
@@ -32,13 +32,13 @@ include LauncherCommon.gmk
ifeq ($(call isTargetOs, linux), true)
JPACKAGE_APPLAUNCHER_SRC := \
$(call FindSrcDirsForComponent, jdk.jpackage, applauncher)
JPACKAGE_APPLAUNCHER_TOOLCHAIN := TOOLCHAIN_DEFAULT
JPACKAGE_APPLAUNCHER_LINK_TYPE := C
JPACKAGE_APPLAUNCHER_INCLUDE_FILES := %.c
else
JPACKAGE_APPLAUNCHER_SRC := \
$(call FindSrcDirsForComponent, jdk.jpackage, applauncher) \
$(call FindSrcDirsForComponent, jdk.jpackage, common)
JPACKAGE_APPLAUNCHER_TOOLCHAIN := TOOLCHAIN_LINK_CXX
JPACKAGE_APPLAUNCHER_LINK_TYPE := C++
endif
@@ -59,11 +59,11 @@ JPACKAGE_APPLAUNCHER_INCLUDES := $(addprefix -I, $(JPACKAGE_APPLAUNCHER_SRC))
# Output app launcher executable in resources dir, and symbols in the object dir
$(eval $(call SetupJdkExecutable, BUILD_JPACKAGE_APPLAUNCHEREXE, \
NAME := jpackageapplauncher, \
LINK_TYPE := $(JPACKAGE_APPLAUNCHER_LINK_TYPE), \
OUTPUT_DIR := $(JPACKAGE_OUTPUT_DIR), \
SYMBOLS_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/jpackageapplauncher, \
SRC := $(JPACKAGE_APPLAUNCHER_SRC), \
INCLUDE_FILES := $(JPACKAGE_APPLAUNCHER_INCLUDE_FILES), \
TOOLCHAIN := $(JPACKAGE_APPLAUNCHER_TOOLCHAIN), \
OPTIMIZATION := LOW, \
DISABLED_WARNINGS_clang_LinuxPackage.c := format-nonliteral, \
DISABLED_WARNINGS_clang_JvmLauncherLib.c := format-nonliteral, \
@@ -103,7 +103,7 @@ ifeq ($(call isTargetOs, linux), true)
SYMBOLS_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjpackageapplauncheraux, \
SRC := $(JPACKAGE_LIBAPPLAUNCHER_SRC), \
EXCLUDE_FILES := LinuxLauncher.c LinuxPackage.c, \
TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
LINK_TYPE := C++, \
OPTIMIZATION := LOW, \
DISABLED_WARNINGS_clang_JvmLauncherLib.c := format-nonliteral, \
DISABLED_WARNINGS_clang_tstrings.cpp := format-nonliteral, \
@@ -177,10 +177,10 @@ ifeq ($(call isTargetOs, windows), true)
# Build non-console version of launcher
$(eval $(call SetupJdkExecutable, BUILD_JPACKAGE_APPLAUNCHERWEXE, \
NAME := jpackageapplauncherw, \
LINK_TYPE := $(BUILD_JPACKAGE_APPLAUNCHEREXE_LINK_TYPE), \
OUTPUT_DIR := $(JPACKAGE_OUTPUT_DIR), \
SYMBOLS_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/jpackageapplauncherw, \
SRC := $(BUILD_JPACKAGE_APPLAUNCHEREXE_SRC), \
TOOLCHAIN := $(BUILD_JPACKAGE_APPLAUNCHEREXE_TOOLCHAIN), \
OPTIMIZATION := $(BUILD_JPACKAGE_APPLAUNCHEREXE_OPTIMIZATION), \
CXXFLAGS := $(BUILD_JPACKAGE_APPLAUNCHEREXE_CXXFLAGS), \
CXXFLAGS_windows := $(BUILD_JPACKAGE_APPLAUNCHEREXE_CXXFLAGS_windows) -DJP_LAUNCHERW, \

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2024, 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.
*
@@ -118,10 +118,6 @@ extern "C" {
else
Disassembler::decode((address)start, (address)start + len);
}
JNIEXPORT void das1(uintptr_t insn) {
das(insn, 1);
}
}
#define __ as->

View File

@@ -1209,7 +1209,7 @@ void LIR_Assembler::emit_alloc_array(LIR_OpAllocArray* op) {
len,
tmp1,
tmp2,
arrayOopDesc::header_size(op->type()),
arrayOopDesc::base_offset_in_bytes(op->type()),
array_element_size(op->type()),
op->klass()->as_register(),
*op->stub()->entry());

View File

@@ -188,6 +188,12 @@ void C1_MacroAssembler::initialize_header(Register obj, Register klass, Register
if (len->is_valid()) {
strw(len, Address(obj, arrayOopDesc::length_offset_in_bytes()));
int base_offset = arrayOopDesc::length_offset_in_bytes() + BytesPerInt;
if (!is_aligned(base_offset, BytesPerWord)) {
assert(is_aligned(base_offset, BytesPerInt), "must be 4-byte aligned");
// Clear gap/first 4 bytes following the length field.
strw(zr, Address(obj, base_offset));
}
} else if (UseCompressedClassPointers) {
store_klass_gap(obj, zr);
}
@@ -266,7 +272,7 @@ void C1_MacroAssembler::initialize_object(Register obj, Register klass, Register
verify_oop(obj);
}
void C1_MacroAssembler::allocate_array(Register obj, Register len, Register t1, Register t2, int header_size, int f, Register klass, Label& slow_case) {
void C1_MacroAssembler::allocate_array(Register obj, Register len, Register t1, Register t2, int base_offset_in_bytes, int f, Register klass, Label& slow_case) {
assert_different_registers(obj, len, t1, t2, klass);
// determine alignment mask
@@ -279,7 +285,7 @@ void C1_MacroAssembler::allocate_array(Register obj, Register len, Register t1,
const Register arr_size = t2; // okay to be the same
// align object end
mov(arr_size, (int32_t)header_size * BytesPerWord + MinObjAlignmentInBytesMask);
mov(arr_size, (int32_t)base_offset_in_bytes + MinObjAlignmentInBytesMask);
add(arr_size, arr_size, len, ext::uxtw, f);
andr(arr_size, arr_size, ~MinObjAlignmentInBytesMask);
@@ -287,8 +293,11 @@ void C1_MacroAssembler::allocate_array(Register obj, Register len, Register t1,
initialize_header(obj, klass, len, t1, t2);
// Align-up to word boundary, because we clear the 4 bytes potentially
// following the length field in initialize_header().
int base_offset = align_up(base_offset_in_bytes, BytesPerWord);
// clear rest of allocated space
initialize_body(obj, arr_size, header_size * BytesPerWord, t1, t2);
initialize_body(obj, arr_size, base_offset, t1, t2);
if (Compilation::current()->bailed_out()) {
return;
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2021, Red Hat Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -100,7 +100,7 @@ using MacroAssembler::null_check;
// header_size: size of object header in words
// f : element scale factor
// slow_case : exit to slow case implementation if fast allocation fails
void allocate_array(Register obj, Register len, Register t, Register t2, int header_size, int f, Register klass, Label& slow_case);
void allocate_array(Register obj, Register len, Register t, Register t2, int base_offset_in_bytes, int f, Register klass, Label& slow_case);
int rsp_offset() const { return _rsp_offset; }
void set_rsp_offset(int n) { _rsp_offset = n; }

View File

@@ -28,8 +28,8 @@
#include "gc/g1/g1BarrierSetAssembler.hpp"
#include "gc/g1/g1BarrierSetRuntime.hpp"
#include "gc/g1/g1CardTable.hpp"
#include "gc/g1/g1HeapRegion.hpp"
#include "gc/g1/g1ThreadLocalData.hpp"
#include "gc/g1/heapRegion.hpp"
#include "gc/shared/collectedHeap.hpp"
#include "interpreter/interp_masm.hpp"
#include "runtime/javaThread.hpp"

View File

@@ -245,9 +245,13 @@ address UpcallLinker::make_upcall_stub(jobject receiver, Method* entry,
__ mov_metadata(rmethod, entry);
__ str(rmethod, Address(rthread, JavaThread::callee_target_offset())); // just in case callee is deoptimized
__ push_cont_fastpath(rthread);
__ ldr(rscratch1, Address(rmethod, Method::from_compiled_offset()));
__ blr(rscratch1);
__ pop_cont_fastpath(rthread);
// return value shuffle
if (!needs_return_buffer) {
#ifdef ASSERT

View File

@@ -968,7 +968,7 @@ void LIR_Assembler::emit_alloc_array(LIR_OpAllocArray* op) {
op->tmp1()->as_register(),
op->tmp2()->as_register(),
op->tmp3()->as_register(),
arrayOopDesc::header_size(op->type()),
arrayOopDesc::base_offset_in_bytes(op->type()),
type2aelembytes(op->type()),
op->klass()->as_register(),
*op->stub()->entry());

View File

@@ -29,8 +29,8 @@
#include "gc/g1/g1BarrierSetRuntime.hpp"
#include "gc/g1/g1ThreadLocalData.hpp"
#include "gc/g1/g1CardTable.hpp"
#include "gc/g1/g1HeapRegion.hpp"
#include "gc/g1/g1ThreadLocalData.hpp"
#include "gc/g1/heapRegion.hpp"
#include "interpreter/interp_masm.hpp"
#include "runtime/javaThread.hpp"
#include "runtime/sharedRuntime.hpp"

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2023 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -2298,7 +2298,7 @@ void LIR_Assembler::emit_alloc_array(LIR_OpAllocArray* op) {
op->tmp1()->as_register(),
op->tmp2()->as_register(),
op->tmp3()->as_register(),
arrayOopDesc::header_size(op->type()),
arrayOopDesc::base_offset_in_bytes(op->type()),
type2aelembytes(op->type()),
op->klass()->as_register(),
*op->stub()->entry());

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2018 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -310,7 +310,7 @@ void C1_MacroAssembler::allocate_array(
Register t1, // temp register
Register t2, // temp register
Register t3, // temp register
int hdr_size, // object header size in words
int base_offset_in_bytes, // elements offset in bytes
int elt_size, // element size in bytes
Register klass, // object klass
Label& slow_case // continuation point if fast allocation fails
@@ -342,7 +342,7 @@ void C1_MacroAssembler::allocate_array(
sldi(t1, len, log2_elt_size);
arr_len_in_bytes = t1;
}
addi(arr_size, arr_len_in_bytes, hdr_size * wordSize + MinObjAlignmentInBytesMask); // Add space for header & alignment.
addi(arr_size, arr_len_in_bytes, base_offset_in_bytes + MinObjAlignmentInBytesMask); // Add space for header & alignment.
clrrdi(arr_size, arr_size, LogMinObjAlignmentInBytes); // Align array size.
// Allocate space & initialize header.
@@ -352,8 +352,18 @@ void C1_MacroAssembler::allocate_array(
// Initialize body.
const Register base = t2;
const Register index = t3;
addi(base, obj, hdr_size * wordSize); // compute address of first element
addi(index, arr_size, -(hdr_size * wordSize)); // compute index = number of bytes to clear
addi(base, obj, base_offset_in_bytes); // compute address of first element
addi(index, arr_size, -(base_offset_in_bytes)); // compute index = number of bytes to clear
// Zero first 4 bytes, if start offset is not word aligned.
if (!is_aligned(base_offset_in_bytes, BytesPerWord)) {
assert(is_aligned(base_offset_in_bytes, BytesPerInt), "must be 4-byte aligned");
li(t1, 0);
stw(t1, 0, base);
addi(base, base, BytesPerInt);
// Note: initialize_body will align index down, no need to correct it here.
}
initialize_body(base, index);
if (CURRENT_ENV->dtrace_alloc_probes()) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2015 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -80,7 +80,7 @@
Register t1, // temp register
Register t2, // temp register
Register t3, // temp register
int hdr_size, // object header size in words
int base_offset_in_bytes, // elements offset in bytes
int elt_size, // element size in bytes
Register klass, // object klass
Label& slow_case // continuation point if fast allocation fails

View File

@@ -30,9 +30,9 @@
#include "gc/g1/g1BarrierSetRuntime.hpp"
#include "gc/g1/g1CardTable.hpp"
#include "gc/g1/g1DirtyCardQueue.hpp"
#include "gc/g1/g1HeapRegion.hpp"
#include "gc/g1/g1SATBMarkQueueSet.hpp"
#include "gc/g1/g1ThreadLocalData.hpp"
#include "gc/g1/heapRegion.hpp"
#include "interpreter/interp_masm.hpp"
#include "runtime/jniHandles.hpp"
#include "runtime/sharedRuntime.hpp"

View File

@@ -60,7 +60,7 @@ define_pd_global(bool, VMContinuations, true);
// Use large code-entry alignment.
define_pd_global(uintx, CodeCacheSegmentSize, 128);
define_pd_global(intx, CodeEntryAlignment, 128);
define_pd_global(intx, CodeEntryAlignment, 64);
define_pd_global(intx, OptoLoopAlignment, 16);
define_pd_global(intx, InlineSmallCode, 1500);

View File

@@ -243,10 +243,14 @@ address UpcallLinker::make_upcall_stub(jobject receiver, Method* entry,
__ load_const_optimized(R19_method, (intptr_t)entry);
__ std(R19_method, in_bytes(JavaThread::callee_target_offset()), R16_thread);
__ push_cont_fastpath();
__ ld(call_target_address, in_bytes(Method::from_compiled_offset()), R19_method);
__ mtctr(call_target_address);
__ bctrl();
__ pop_cont_fastpath();
// return value shuffle
if (!needs_return_buffer) {
// CallArranger can pick a return type that goes in the same reg for both CCs.

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2020, Red Hat Inc. All rights reserved.
* Copyright (c) 2020, 2023, Huawei Technologies Co., Ltd. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -1020,7 +1020,7 @@ void LIR_Assembler::emit_alloc_array(LIR_OpAllocArray* op) {
len,
tmp1,
tmp2,
arrayOopDesc::header_size(op->type()),
arrayOopDesc::base_offset_in_bytes(op->type()),
array_element_size(op->type()),
op->klass()->as_register(),
*op->stub()->entry());

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2024, 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.
@@ -280,7 +280,7 @@ void C1_MacroAssembler::initialize_object(Register obj, Register klass, Register
verify_oop(obj);
}
void C1_MacroAssembler::allocate_array(Register obj, Register len, Register tmp1, Register tmp2, int header_size, int f, Register klass, Label& slow_case) {
void C1_MacroAssembler::allocate_array(Register obj, Register len, Register tmp1, Register tmp2, int base_offset_in_bytes, int f, Register klass, Label& slow_case) {
assert_different_registers(obj, len, tmp1, tmp2, klass);
// determine alignment mask
@@ -292,7 +292,7 @@ void C1_MacroAssembler::allocate_array(Register obj, Register len, Register tmp1
const Register arr_size = tmp2; // okay to be the same
// align object end
mv(arr_size, (int32_t)header_size * BytesPerWord + MinObjAlignmentInBytesMask);
mv(arr_size, (int32_t)base_offset_in_bytes + MinObjAlignmentInBytesMask);
shadd(arr_size, len, arr_size, t0, f);
andi(arr_size, arr_size, ~(uint)MinObjAlignmentInBytesMask);
@@ -300,9 +300,20 @@ void C1_MacroAssembler::allocate_array(Register obj, Register len, Register tmp1
initialize_header(obj, klass, len, tmp1, tmp2);
// Clear leading 4 bytes, if necessary.
// TODO: This could perhaps go into initialize_body() and also clear the leading 4 bytes
// for non-array objects, thereby replacing the klass-gap clearing code in initialize_header().
int base_offset = base_offset_in_bytes;
if (!is_aligned(base_offset, BytesPerWord)) {
assert(is_aligned(base_offset, BytesPerInt), "must be 4-byte aligned");
sw(zr, Address(obj, base_offset));
base_offset += BytesPerInt;
}
assert(is_aligned(base_offset, BytesPerWord), "must be word-aligned");
// clear rest of allocated space
const Register len_zero = len;
initialize_body(obj, arr_size, header_size * BytesPerWord, len_zero);
initialize_body(obj, arr_size, base_offset, len_zero);
membar(MacroAssembler::StoreStore);

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2015, 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.
@@ -101,7 +101,7 @@ using MacroAssembler::null_check;
// header_size: size of object header in words
// f : element scale factor
// slow_case : exit to slow case implementation if fast allocation fails
void allocate_array(Register obj, Register len, Register tmp1, Register tmp2, int header_size, int f, Register klass, Label& slow_case);
void allocate_array(Register obj, Register len, Register tmp1, Register tmp2, int base_offset_in_bytes, int f, Register klass, Label& slow_case);
int rsp_offset() const { return _rsp_offset; }

View File

@@ -29,8 +29,8 @@
#include "gc/g1/g1BarrierSetAssembler.hpp"
#include "gc/g1/g1BarrierSetRuntime.hpp"
#include "gc/g1/g1CardTable.hpp"
#include "gc/g1/g1HeapRegion.hpp"
#include "gc/g1/g1ThreadLocalData.hpp"
#include "gc/g1/heapRegion.hpp"
#include "gc/shared/collectedHeap.hpp"
#include "interpreter/interp_masm.hpp"
#include "runtime/javaThread.hpp"

View File

@@ -4809,6 +4809,348 @@ class StubGenerator: public StubCodeGenerator {
return (address) start;
}
// ------------------------ SHA-1 intrinsic ------------------------
// K't =
// 5a827999, 0 <= t <= 19
// 6ed9eba1, 20 <= t <= 39
// 8f1bbcdc, 40 <= t <= 59
// ca62c1d6, 60 <= t <= 79
void sha1_prepare_k(Register cur_k, int round) {
assert(round >= 0 && round < 80, "must be");
static const int64_t ks[] = {0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6};
if ((round % 20) == 0) {
__ mv(cur_k, ks[round/20]);
}
}
// W't =
// M't, 0 <= t <= 15
// ROTL'1(W't-3 ^ W't-8 ^ W't-14 ^ W't-16), 16 <= t <= 79
void sha1_prepare_w(Register cur_w, Register ws[], Register buf, int round) {
assert(round >= 0 && round < 80, "must be");
if (round < 16) {
// in the first 16 rounds, in ws[], every register contains 2 W't, e.g.
// in ws[0], high part contains W't-0, low part contains W't-1,
// in ws[1], high part contains W't-2, low part contains W't-3,
// ...
// in ws[7], high part contains W't-14, low part contains W't-15.
if ((round % 2) == 0) {
__ ld(ws[round/2], Address(buf, (round/2) * 8));
// reverse bytes, as SHA-1 is defined in big-endian.
__ revb(ws[round/2], ws[round/2]);
__ srli(cur_w, ws[round/2], 32);
} else {
__ mv(cur_w, ws[round/2]);
}
return;
}
if ((round % 2) == 0) {
int idx = 16;
// W't = ROTL'1(W't-3 ^ W't-8 ^ W't-14 ^ W't-16), 16 <= t <= 79
__ srli(t1, ws[(idx-8)/2], 32);
__ xorr(t0, ws[(idx-3)/2], t1);
__ srli(t1, ws[(idx-14)/2], 32);
__ srli(cur_w, ws[(idx-16)/2], 32);
__ xorr(cur_w, cur_w, t1);
__ xorr(cur_w, cur_w, t0);
__ rolw_imm(cur_w, cur_w, 1, t0);
// copy the cur_w value to ws[8].
// now, valid w't values are at:
// w0: ws[0]'s lower 32 bits
// w1 ~ w14: ws[1] ~ ws[7]
// w15: ws[8]'s higher 32 bits
__ slli(ws[idx/2], cur_w, 32);
return;
}
int idx = 17;
// W't = ROTL'1(W't-3 ^ W't-8 ^ W't-14 ^ W't-16), 16 <= t <= 79
__ srli(t1, ws[(idx-3)/2], 32);
__ xorr(t0, t1, ws[(idx-8)/2]);
__ xorr(cur_w, ws[(idx-16)/2], ws[(idx-14)/2]);
__ xorr(cur_w, cur_w, t0);
__ rolw_imm(cur_w, cur_w, 1, t0);
// copy the cur_w value to ws[8]
__ zero_extend(cur_w, cur_w, 32);
__ orr(ws[idx/2], ws[idx/2], cur_w);
// shift the w't registers, so they start from ws[0] again.
// now, valid w't values are at:
// w0 ~ w15: ws[0] ~ ws[7]
Register ws_0 = ws[0];
for (int i = 0; i < 16/2; i++) {
ws[i] = ws[i+1];
}
ws[8] = ws_0;
}
// f't(x, y, z) =
// Ch(x, y, z) = (x & y) ^ (~x & z) , 0 <= t <= 19
// Parity(x, y, z) = x ^ y ^ z , 20 <= t <= 39
// Maj(x, y, z) = (x & y) ^ (x & z) ^ (y & z) , 40 <= t <= 59
// Parity(x, y, z) = x ^ y ^ z , 60 <= t <= 79
void sha1_f(Register dst, Register x, Register y, Register z, int round) {
assert(round >= 0 && round < 80, "must be");
assert_different_registers(dst, x, y, z, t0, t1);
if (round < 20) {
// (x & y) ^ (~x & z)
__ andr(t0, x, y);
__ andn(dst, z, x);
__ xorr(dst, dst, t0);
} else if (round >= 40 && round < 60) {
// (x & y) ^ (x & z) ^ (y & z)
__ andr(t0, x, y);
__ andr(t1, x, z);
__ andr(dst, y, z);
__ xorr(dst, dst, t0);
__ xorr(dst, dst, t1);
} else {
// x ^ y ^ z
__ xorr(dst, x, y);
__ xorr(dst, dst, z);
}
}
// T = ROTL'5(a) + f't(b, c, d) + e + K't + W't
// e = d
// d = c
// c = ROTL'30(b)
// b = a
// a = T
void sha1_process_round(Register a, Register b, Register c, Register d, Register e,
Register cur_k, Register cur_w, Register tmp, int round) {
assert(round >= 0 && round < 80, "must be");
assert_different_registers(a, b, c, d, e, cur_w, cur_k, tmp, t0);
// T = ROTL'5(a) + f't(b, c, d) + e + K't + W't
// cur_w will be recalculated at the beginning of each round,
// so, we can reuse it as a temp register here.
Register tmp2 = cur_w;
// reuse e as a temporary register, as we will mv new value into it later
Register tmp3 = e;
__ add(tmp2, cur_k, tmp2);
__ add(tmp3, tmp3, tmp2);
__ rolw_imm(tmp2, a, 5, t0);
sha1_f(tmp, b, c, d, round);
__ add(tmp2, tmp2, tmp);
__ add(tmp2, tmp2, tmp3);
// e = d
// d = c
// c = ROTL'30(b)
// b = a
// a = T
__ mv(e, d);
__ mv(d, c);
__ rolw_imm(c, b, 30);
__ mv(b, a);
__ mv(a, tmp2);
}
// H(i)0 = a + H(i-1)0
// H(i)1 = b + H(i-1)1
// H(i)2 = c + H(i-1)2
// H(i)3 = d + H(i-1)3
// H(i)4 = e + H(i-1)4
void sha1_calculate_im_hash(Register a, Register b, Register c, Register d, Register e,
Register prev_ab, Register prev_cd, Register prev_e) {
assert_different_registers(a, b, c, d, e, prev_ab, prev_cd, prev_e);
__ add(a, a, prev_ab);
__ srli(prev_ab, prev_ab, 32);
__ add(b, b, prev_ab);
__ add(c, c, prev_cd);
__ srli(prev_cd, prev_cd, 32);
__ add(d, d, prev_cd);
__ add(e, e, prev_e);
}
void sha1_preserve_prev_abcde(Register a, Register b, Register c, Register d, Register e,
Register prev_ab, Register prev_cd, Register prev_e) {
assert_different_registers(a, b, c, d, e, prev_ab, prev_cd, prev_e, t0);
__ slli(t0, b, 32);
__ zero_extend(prev_ab, a, 32);
__ orr(prev_ab, prev_ab, t0);
__ slli(t0, d, 32);
__ zero_extend(prev_cd, c, 32);
__ orr(prev_cd, prev_cd, t0);
__ mv(prev_e, e);
}
// Intrinsic for:
// void sun.security.provider.SHA.implCompress0(byte[] buf, int ofs)
// void sun.security.provider.DigestBase.implCompressMultiBlock0(byte[] b, int ofs, int limit)
//
// Arguments:
//
// Inputs:
// c_rarg0: byte[] src array + offset
// c_rarg1: int[] SHA.state
// - - - - - - below are only for implCompressMultiBlock0 - - - - - -
// c_rarg2: int offset
// c_rarg3: int limit
//
// Outputs:
// - - - - - - below are only for implCompressMultiBlock0 - - - - - -
// c_rarg0: int offset, when (multi_block == true)
//
address generate_sha1_implCompress(bool multi_block, const char *name) {
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", name);
address start = __ pc();
__ enter();
RegSet saved_regs = RegSet::range(x18, x27);
if (multi_block) {
// use x9 as src below.
saved_regs += RegSet::of(x9);
}
__ push_reg(saved_regs, sp);
// c_rarg0 - c_rarg3: x10 - x13
Register buf = c_rarg0;
Register state = c_rarg1;
Register offset = c_rarg2;
Register limit = c_rarg3;
// use src to contain the original start point of the array.
Register src = x9;
if (multi_block) {
__ sub(limit, limit, offset);
__ add(limit, limit, buf);
__ sub(src, buf, offset);
}
// [args-reg]: x14 - x17
// [temp-reg]: x28 - x31
// [saved-reg]: x18 - x27
// h0/1/2/3/4
const Register a = x14, b = x15, c = x16, d = x17, e = x28;
// w0, w1, ... w15
// put two adjecent w's in one register:
// one at high word part, another at low word part
// at different round (even or odd), w't value reside in different items in ws[].
// w0 ~ w15, either reside in
// ws[0] ~ ws[7], where
// w0 at higher 32 bits of ws[0],
// w1 at lower 32 bits of ws[0],
// ...
// w14 at higher 32 bits of ws[7],
// w15 at lower 32 bits of ws[7].
// or, reside in
// w0: ws[0]'s lower 32 bits
// w1 ~ w14: ws[1] ~ ws[7]
// w15: ws[8]'s higher 32 bits
Register ws[9] = {x29, x30, x31, x18,
x19, x20, x21, x22,
x23}; // auxiliary register for calculating w's value
// current k't's value
const Register cur_k = x24;
// current w't's value
const Register cur_w = x25;
// values of a, b, c, d, e in the previous round
const Register prev_ab = x26, prev_cd = x27;
const Register prev_e = offset; // reuse offset/c_rarg2
// load 5 words state into a, b, c, d, e.
//
// To minimize the number of memory operations, we apply following
// optimization: read the states (a/b/c/d) of 4-byte values in pairs,
// with a single ld, and split them into 2 registers.
//
// And, as the core algorithm of SHA-1 works on 32-bits words, so
// in the following code, it does not care about the content of
// higher 32-bits in a/b/c/d/e. Based on this observation,
// we can apply further optimization, which is to just ignore the
// higher 32-bits in a/c/e, rather than set the higher
// 32-bits of a/c/e to zero explicitly with extra instructions.
__ ld(a, Address(state, 0));
__ srli(b, a, 32);
__ ld(c, Address(state, 8));
__ srli(d, c, 32);
__ lw(e, Address(state, 16));
Label L_sha1_loop;
if (multi_block) {
__ BIND(L_sha1_loop);
}
sha1_preserve_prev_abcde(a, b, c, d, e, prev_ab, prev_cd, prev_e);
for (int round = 0; round < 80; round++) {
// prepare K't value
sha1_prepare_k(cur_k, round);
// prepare W't value
sha1_prepare_w(cur_w, ws, buf, round);
// one round process
sha1_process_round(a, b, c, d, e, cur_k, cur_w, t2, round);
}
// compute the intermediate hash value
sha1_calculate_im_hash(a, b, c, d, e, prev_ab, prev_cd, prev_e);
if (multi_block) {
int64_t block_bytes = 16 * 4;
__ addi(buf, buf, block_bytes);
__ bge(limit, buf, L_sha1_loop, true);
}
// store back the state.
__ zero_extend(a, a, 32);
__ slli(b, b, 32);
__ orr(a, a, b);
__ sd(a, Address(state, 0));
__ zero_extend(c, c, 32);
__ slli(d, d, 32);
__ orr(c, c, d);
__ sd(c, Address(state, 8));
__ sw(e, Address(state, 16));
// return offset
if (multi_block) {
__ sub(c_rarg0, buf, src);
}
__ pop_reg(saved_regs, sp);
__ leave();
__ ret();
return (address) start;
}
#ifdef COMPILER2
static const int64_t right_2_bits = right_n_bits(2);
@@ -5273,6 +5615,11 @@ static const int64_t right_3_bits = right_n_bits(3);
StubRoutines::_chacha20Block = generate_chacha20Block();
}
if (UseSHA1Intrinsics) {
StubRoutines::_sha1_implCompress = generate_sha1_implCompress(false, "sha1_implCompress");
StubRoutines::_sha1_implCompressMB = generate_sha1_implCompress(true, "sha1_implCompressMB");
}
#endif // COMPILER2_OR_JVMCI
}

View File

@@ -39,7 +39,7 @@ enum platform_dependent_constants {
// simply increase sizes if too small (assembler will crash if too small)
_initial_stubs_code_size = 10000,
_continuation_stubs_code_size = 2000,
_compiler_stubs_code_size = 15000 ZGC_ONLY(+5000),
_compiler_stubs_code_size = 25000 ZGC_ONLY(+5000),
_final_stubs_code_size = 20000 ZGC_ONLY(+10000)
};

View File

@@ -267,9 +267,13 @@ address UpcallLinker::make_upcall_stub(jobject receiver, Method* entry,
__ mov_metadata(xmethod, entry);
__ sd(xmethod, Address(xthread, JavaThread::callee_target_offset())); // just in case callee is deoptimized
__ push_cont_fastpath(xthread);
__ ld(t0, Address(xmethod, Method::from_compiled_offset()));
__ jalr(t0);
__ pop_cont_fastpath(xthread);
// return value shuffle
if (!needs_return_buffer) {
#ifdef ASSERT

View File

@@ -149,16 +149,6 @@ void VM_Version::initialize() {
FLAG_SET_DEFAULT(UseAESCTRIntrinsics, false);
}
if (UseSHA1Intrinsics) {
warning("Intrinsics for SHA-1 crypto hash functions not available on this CPU.");
FLAG_SET_DEFAULT(UseSHA1Intrinsics, false);
}
if (UseSHA3Intrinsics) {
warning("Intrinsics for SHA3-224, SHA3-256, SHA3-384 and SHA3-512 crypto hash functions not available on this CPU.");
FLAG_SET_DEFAULT(UseSHA3Intrinsics, false);
}
if (UseCRC32Intrinsics) {
warning("CRC32 intrinsics are not available on this CPU.");
FLAG_SET_DEFAULT(UseCRC32Intrinsics, false);
@@ -260,11 +250,8 @@ void VM_Version::initialize() {
// NOTE: Make sure codes dependent on UseRVV are put after c2_initialize(),
// as there are extra checks inside it which could disable UseRVV
// in some situations.
if (UseZvkn && !UseRVV) {
FLAG_SET_DEFAULT(UseZvkn, false);
warning("Cannot enable Zvkn on cpu without RVV support.");
}
// ChaCha20
if (UseRVV) {
if (FLAG_IS_DEFAULT(UseChaCha20Intrinsics)) {
FLAG_SET_DEFAULT(UseChaCha20Intrinsics, true);
@@ -276,29 +263,65 @@ void VM_Version::initialize() {
FLAG_SET_DEFAULT(UseChaCha20Intrinsics, false);
}
if (!UseZvkn && UseSHA) {
warning("SHA instructions are not available on this CPU");
FLAG_SET_DEFAULT(UseSHA, false);
} else if (UseZvkn && FLAG_IS_DEFAULT(UseSHA)) {
// SHA's
if (FLAG_IS_DEFAULT(UseSHA)) {
FLAG_SET_DEFAULT(UseSHA, true);
}
if (!UseSHA) {
// SHA-1, no RVV required though.
if (UseSHA) {
if (FLAG_IS_DEFAULT(UseSHA1Intrinsics)) {
FLAG_SET_DEFAULT(UseSHA1Intrinsics, true);
}
} else if (UseSHA1Intrinsics) {
warning("Intrinsics for SHA-1 crypto hash functions not available on this CPU.");
FLAG_SET_DEFAULT(UseSHA1Intrinsics, false);
}
// UseZvkn (depends on RVV) and SHA-2.
if (UseZvkn && !UseRVV) {
FLAG_SET_DEFAULT(UseZvkn, false);
warning("Cannot enable Zvkn on cpu without RVV support.");
}
// SHA-2, depends on Zvkn.
if (UseSHA) {
if (UseZvkn) {
if (FLAG_IS_DEFAULT(UseSHA256Intrinsics)) {
FLAG_SET_DEFAULT(UseSHA256Intrinsics, true);
}
if (FLAG_IS_DEFAULT(UseSHA512Intrinsics)) {
FLAG_SET_DEFAULT(UseSHA512Intrinsics, true);
}
} else {
if (UseSHA256Intrinsics) {
warning("Intrinsics for SHA-224 and SHA-256 crypto hash functions not available on this CPU, UseZvkn needed.");
FLAG_SET_DEFAULT(UseSHA256Intrinsics, false);
}
if (UseSHA512Intrinsics) {
warning("Intrinsics for SHA-384 and SHA-512 crypto hash functions not available on this CPU, UseZvkn needed.");
FLAG_SET_DEFAULT(UseSHA512Intrinsics, false);
}
}
} else {
if (UseSHA256Intrinsics) {
warning("Intrinsics for SHA-224 and SHA-256 crypto hash functions not available on this CPU, UseZvkn needed.");
warning("Intrinsics for SHA-224 and SHA-256 crypto hash functions not available on this CPU, as UseSHA disabled.");
FLAG_SET_DEFAULT(UseSHA256Intrinsics, false);
}
if (UseSHA512Intrinsics) {
warning("Intrinsics for SHA-384 and SHA-512 crypto hash functions not available on this CPU, UseZvkn needed.");
warning("Intrinsics for SHA-384 and SHA-512 crypto hash functions not available on this CPU, as UseSHA disabled.");
FLAG_SET_DEFAULT(UseSHA512Intrinsics, false);
}
} else {
if (FLAG_IS_DEFAULT(UseSHA256Intrinsics)) {
FLAG_SET_DEFAULT(UseSHA256Intrinsics, true);
}
if (FLAG_IS_DEFAULT(UseSHA512Intrinsics)) {
FLAG_SET_DEFAULT(UseSHA512Intrinsics, true);
}
}
// SHA-3
if (UseSHA3Intrinsics) {
warning("Intrinsics for SHA3-224, SHA3-256, SHA3-384 and SHA3-512 crypto hash functions not available on this CPU.");
FLAG_SET_DEFAULT(UseSHA3Intrinsics, false);
}
// UseSHA
if (!(UseSHA1Intrinsics || UseSHA256Intrinsics || UseSHA3Intrinsics || UseSHA512Intrinsics)) {
FLAG_SET_DEFAULT(UseSHA, false);
}
}

View File

@@ -2382,7 +2382,7 @@ void LIR_Assembler::emit_alloc_array(LIR_OpAllocArray* op) {
op->len()->as_register(),
op->tmp1()->as_register(),
op->tmp2()->as_register(),
arrayOopDesc::header_size(op->type()),
arrayOopDesc::base_offset_in_bytes(op->type()),
type2aelembytes(op->type()),
op->klass()->as_register(),
*op->stub()->entry());

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2023 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -271,7 +271,7 @@ void C1_MacroAssembler::allocate_array(
Register len, // array length
Register t1, // temp register
Register t2, // temp register
int hdr_size, // object header size in words
int base_offset_in_bytes, // elements offset in bytes
int elt_size, // element size in bytes
Register klass, // object klass
Label& slow_case // Continuation point if fast allocation fails.
@@ -297,8 +297,8 @@ void C1_MacroAssembler::allocate_array(
case 8: z_sllg(arr_size, len, 3); break;
default: ShouldNotReachHere();
}
add2reg(arr_size, hdr_size * wordSize + MinObjAlignmentInBytesMask); // Add space for header & alignment.
z_nill(arr_size, (~MinObjAlignmentInBytesMask) & 0xffff); // Align array size.
add2reg(arr_size, base_offset_in_bytes + MinObjAlignmentInBytesMask); // Add space for header & alignment.
z_nill(arr_size, (~MinObjAlignmentInBytesMask) & 0xffff); // Align array size.
try_allocate(obj, arr_size, 0, t1, slow_case);
@@ -308,9 +308,9 @@ void C1_MacroAssembler::allocate_array(
Label done;
Register object_fields = t1;
Register Rzero = Z_R1_scratch;
z_aghi(arr_size, -(hdr_size * BytesPerWord));
z_aghi(arr_size, -base_offset_in_bytes);
z_bre(done); // Jump if size of fields is zero.
z_la(object_fields, hdr_size * BytesPerWord, obj);
z_la(object_fields, base_offset_in_bytes, obj);
z_xgr(Rzero, Rzero);
initialize_body(object_fields, arr_size, Rzero);
bind(done);

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2023 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -86,7 +86,7 @@
Register len, // array length
Register t1, // temp register
Register t2, // temp register
int hdr_size, // object header size in words
int base_offset_in_bytes, // elements offset in bytes
int elt_size, // element size in bytes
Register klass, // object klass
Label& slow_case // Continuation point if fast allocation fails.

View File

@@ -31,9 +31,9 @@
#include "gc/g1/g1BarrierSetAssembler.hpp"
#include "gc/g1/g1BarrierSetRuntime.hpp"
#include "gc/g1/g1DirtyCardQueue.hpp"
#include "gc/g1/g1HeapRegion.hpp"
#include "gc/g1/g1SATBMarkQueueSet.hpp"
#include "gc/g1/g1ThreadLocalData.hpp"
#include "gc/g1/heapRegion.hpp"
#include "interpreter/interp_masm.hpp"
#include "runtime/jniHandles.hpp"
#include "runtime/sharedRuntime.hpp"

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2024, 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
@@ -1618,7 +1618,7 @@ void LIR_Assembler::emit_alloc_array(LIR_OpAllocArray* op) {
len,
tmp1,
tmp2,
arrayOopDesc::header_size(op->type()),
arrayOopDesc::base_offset_in_bytes(op->type()),
array_element_size(op->type()),
op->klass()->as_register(),
*op->stub()->entry());

View File

@@ -186,6 +186,15 @@ void C1_MacroAssembler::initialize_header(Register obj, Register klass, Register
if (len->is_valid()) {
movl(Address(obj, arrayOopDesc::length_offset_in_bytes()), len);
#ifdef _LP64
int base_offset = arrayOopDesc::length_offset_in_bytes() + BytesPerInt;
if (!is_aligned(base_offset, BytesPerWord)) {
assert(is_aligned(base_offset, BytesPerInt), "must be 4-byte aligned");
// Clear gap/first 4 bytes following the length field.
xorl(t1, t1);
movl(Address(obj, base_offset), t1);
}
#endif
}
#ifdef _LP64
else if (UseCompressedClassPointers) {
@@ -269,7 +278,7 @@ void C1_MacroAssembler::initialize_object(Register obj, Register klass, Register
verify_oop(obj);
}
void C1_MacroAssembler::allocate_array(Register obj, Register len, Register t1, Register t2, int header_size, Address::ScaleFactor f, Register klass, Label& slow_case) {
void C1_MacroAssembler::allocate_array(Register obj, Register len, Register t1, Register t2, int base_offset_in_bytes, Address::ScaleFactor f, Register klass, Label& slow_case) {
assert(obj == rax, "obj must be in rax, for cmpxchg");
assert_different_registers(obj, len, t1, t2, klass);
@@ -282,7 +291,7 @@ void C1_MacroAssembler::allocate_array(Register obj, Register len, Register t1,
const Register arr_size = t2; // okay to be the same
// align object end
movptr(arr_size, header_size * BytesPerWord + MinObjAlignmentInBytesMask);
movptr(arr_size, base_offset_in_bytes + MinObjAlignmentInBytesMask);
lea(arr_size, Address(arr_size, len, f));
andptr(arr_size, ~MinObjAlignmentInBytesMask);
@@ -292,7 +301,10 @@ void C1_MacroAssembler::allocate_array(Register obj, Register len, Register t1,
// clear rest of allocated space
const Register len_zero = len;
initialize_body(obj, arr_size, header_size * BytesPerWord, len_zero);
// Align-up to word boundary, because we clear the 4 bytes potentially
// following the length field in initialize_header().
int base_offset = align_up(base_offset_in_bytes, BytesPerWord);
initialize_body(obj, arr_size, base_offset, len_zero);
if (CURRENT_ENV->dtrace_alloc_probes()) {
assert(obj == rax, "must be");

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2024, 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
@@ -89,7 +89,7 @@
// header_size: size of object header in words
// f : element scale factor
// slow_case : exit to slow case implementation if fast allocation fails
void allocate_array(Register obj, Register len, Register t, Register t2, int header_size, Address::ScaleFactor f, Register klass, Label& slow_case);
void allocate_array(Register obj, Register len, Register t, Register t2, int base_offset_in_bytes, Address::ScaleFactor f, Register klass, Label& slow_case);
int rsp_offset() const { return _rsp_offset; }
void set_rsp_offset(int n) { _rsp_offset = n; }

View File

@@ -28,8 +28,8 @@
#include "gc/g1/g1BarrierSetAssembler.hpp"
#include "gc/g1/g1BarrierSetRuntime.hpp"
#include "gc/g1/g1CardTable.hpp"
#include "gc/g1/g1HeapRegion.hpp"
#include "gc/g1/g1ThreadLocalData.hpp"
#include "gc/g1/heapRegion.hpp"
#include "interpreter/interp_masm.hpp"
#include "runtime/sharedRuntime.hpp"
#include "utilities/debug.hpp"

View File

@@ -300,8 +300,12 @@ address UpcallLinker::make_upcall_stub(jobject receiver, Method* entry,
__ mov_metadata(rbx, entry);
__ movptr(Address(r15_thread, JavaThread::callee_target_offset()), rbx); // just in case callee is deoptimized
__ push_cont_fastpath();
__ call(Address(rbx, Method::from_compiled_offset()));
__ pop_cont_fastpath();
// return value shuffle
if (!needs_return_buffer) {
#ifdef ASSERT

View File

@@ -4459,7 +4459,7 @@ instruct loadD(regD dst, memory mem)
// max = java.lang.Math.max(float a, float b)
instruct maxF_reg(legRegF dst, legRegF a, legRegF b, legRegF tmp, legRegF atmp, legRegF btmp) %{
predicate(UseAVX > 0 && !SuperWord::is_reduction(n));
predicate(UseAVX > 0 && !VLoopReductions::is_reduction(n));
match(Set dst (MaxF a b));
effect(USE a, USE b, TEMP tmp, TEMP atmp, TEMP btmp);
format %{ "maxF $dst, $a, $b \t! using tmp, atmp and btmp as TEMP" %}
@@ -4470,7 +4470,7 @@ instruct maxF_reg(legRegF dst, legRegF a, legRegF b, legRegF tmp, legRegF atmp,
%}
instruct maxF_reduction_reg(legRegF dst, legRegF a, legRegF b, legRegF xmmt, rRegI tmp, rFlagsReg cr) %{
predicate(UseAVX > 0 && SuperWord::is_reduction(n));
predicate(UseAVX > 0 && VLoopReductions::is_reduction(n));
match(Set dst (MaxF a b));
effect(USE a, USE b, TEMP xmmt, TEMP tmp, KILL cr);
@@ -4484,7 +4484,7 @@ instruct maxF_reduction_reg(legRegF dst, legRegF a, legRegF b, legRegF xmmt, rRe
// max = java.lang.Math.max(double a, double b)
instruct maxD_reg(legRegD dst, legRegD a, legRegD b, legRegD tmp, legRegD atmp, legRegD btmp) %{
predicate(UseAVX > 0 && !SuperWord::is_reduction(n));
predicate(UseAVX > 0 && !VLoopReductions::is_reduction(n));
match(Set dst (MaxD a b));
effect(USE a, USE b, TEMP atmp, TEMP btmp, TEMP tmp);
format %{ "maxD $dst, $a, $b \t! using tmp, atmp and btmp as TEMP" %}
@@ -4495,7 +4495,7 @@ instruct maxD_reg(legRegD dst, legRegD a, legRegD b, legRegD tmp, legRegD atmp,
%}
instruct maxD_reduction_reg(legRegD dst, legRegD a, legRegD b, legRegD xmmt, rRegL tmp, rFlagsReg cr) %{
predicate(UseAVX > 0 && SuperWord::is_reduction(n));
predicate(UseAVX > 0 && VLoopReductions::is_reduction(n));
match(Set dst (MaxD a b));
effect(USE a, USE b, TEMP xmmt, TEMP tmp, KILL cr);
@@ -4509,7 +4509,7 @@ instruct maxD_reduction_reg(legRegD dst, legRegD a, legRegD b, legRegD xmmt, rRe
// min = java.lang.Math.min(float a, float b)
instruct minF_reg(legRegF dst, legRegF a, legRegF b, legRegF tmp, legRegF atmp, legRegF btmp) %{
predicate(UseAVX > 0 && !SuperWord::is_reduction(n));
predicate(UseAVX > 0 && !VLoopReductions::is_reduction(n));
match(Set dst (MinF a b));
effect(USE a, USE b, TEMP tmp, TEMP atmp, TEMP btmp);
format %{ "minF $dst, $a, $b \t! using tmp, atmp and btmp as TEMP" %}
@@ -4520,7 +4520,7 @@ instruct minF_reg(legRegF dst, legRegF a, legRegF b, legRegF tmp, legRegF atmp,
%}
instruct minF_reduction_reg(legRegF dst, legRegF a, legRegF b, legRegF xmmt, rRegI tmp, rFlagsReg cr) %{
predicate(UseAVX > 0 && SuperWord::is_reduction(n));
predicate(UseAVX > 0 && VLoopReductions::is_reduction(n));
match(Set dst (MinF a b));
effect(USE a, USE b, TEMP xmmt, TEMP tmp, KILL cr);
@@ -4534,7 +4534,7 @@ instruct minF_reduction_reg(legRegF dst, legRegF a, legRegF b, legRegF xmmt, rRe
// min = java.lang.Math.min(double a, double b)
instruct minD_reg(legRegD dst, legRegD a, legRegD b, legRegD tmp, legRegD atmp, legRegD btmp) %{
predicate(UseAVX > 0 && !SuperWord::is_reduction(n));
predicate(UseAVX > 0 && !VLoopReductions::is_reduction(n));
match(Set dst (MinD a b));
effect(USE a, USE b, TEMP tmp, TEMP atmp, TEMP btmp);
format %{ "minD $dst, $a, $b \t! using tmp, atmp and btmp as TEMP" %}
@@ -4545,7 +4545,7 @@ instruct minD_reg(legRegD dst, legRegD a, legRegD b, legRegD tmp, legRegD atmp,
%}
instruct minD_reduction_reg(legRegD dst, legRegD a, legRegD b, legRegD xmmt, rRegL tmp, rFlagsReg cr) %{
predicate(UseAVX > 0 && SuperWord::is_reduction(n));
predicate(UseAVX > 0 && VLoopReductions::is_reduction(n));
match(Set dst (MinD a b));
effect(USE a, USE b, TEMP xmmt, TEMP tmp, KILL cr);

View File

@@ -1127,10 +1127,9 @@ bool os::dll_address_to_library_name(address addr, char* buf,
return true;
}
void *os::dll_load(const char *filename, char *ebuf, int ebuflen) {
static void* dll_load_library(const char *filename, char *ebuf, int ebuflen) {
log_info(os)("attempting shared library load of %s", filename);
if (ebuf && ebuflen > 0) {
ebuf[0] = '\0';
ebuf[ebuflen - 1] = '\0';
@@ -1178,6 +1177,26 @@ void *os::dll_load(const char *filename, char *ebuf, int ebuflen) {
}
return nullptr;
}
// Load library named <filename>
// If filename matches <name>.so, and loading fails, repeat with <name>.a.
void *os::dll_load(const char *filename, char *ebuf, int ebuflen) {
void* result = nullptr;
char* const file_path = strdup(filename);
char* const pointer_to_dot = strrchr(file_path, '.');
const char old_extension[] = ".so";
const char new_extension[] = ".a";
STATIC_ASSERT(sizeof(old_extension) >= sizeof(new_extension));
// First try to load the existing file.
result = dll_load_library(filename, ebuf, ebuflen);
// If the load fails,we try to reload by changing the extension to .a for .so files only.
// Shared object in .so format dont have braces, hence they get removed for archives with members.
if (result == nullptr && pointer_to_dot != nullptr && strcmp(pointer_to_dot, old_extension) == 0) {
snprintf(pointer_to_dot, sizeof(old_extension), "%s", new_extension);
result = dll_load_library(file_path, ebuf, ebuflen);
}
FREE_C_HEAP_ARRAY(char, file_path);
return result;
}
void os::print_dll_info(outputStream *st) {
st->print_cr("Dynamic libraries:");

View File

@@ -28,6 +28,11 @@
.global CFUNC(_Copy_conjoint_words)
.global CFUNC(_Copy_disjoint_words)
#ifdef __APPLE__
.private_extern CFUNC(_Copy_conjoint_words)
.private_extern CFUNC(_Copy_disjoint_words)
#endif
s .req x0
d .req x1
count .req x2

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2022 SAP SE. All rights reserved.
* Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2022, 2024, 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
@@ -39,6 +39,15 @@
.global SYMBOL(_SafeFetch32_fault)
.global SYMBOL(_SafeFetch32_continuation)
#ifdef __APPLE__
.private_extern SYMBOL(SafeFetchN_impl)
.private_extern SYMBOL(_SafeFetchN_fault)
.private_extern SYMBOL(_SafeFetchN_continuation)
.private_extern SYMBOL(SafeFetch32_impl)
.private_extern SYMBOL(_SafeFetch32_fault)
.private_extern SYMBOL(_SafeFetch32_continuation)
#endif
# Support for int SafeFetch32(int* address, int defaultval);
#
# x0 : address

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2004, 2022, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2004, 2024, 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
@@ -32,6 +32,7 @@
#endif
.globl SYMBOL(fixcw)
.globl SYMBOL(SpinPause)
# NOTE WELL! The _Copy functions are called directly
# from server-compiler-generated code via CallLeafNoFP,
@@ -50,6 +51,20 @@
.globl SYMBOL(_Atomic_cmpxchg_long)
.globl SYMBOL(_Atomic_move_long)
#ifdef __APPLE__
.private_extern SYMBOL(fixcw)
.private_extern SYMBOL(SpinPause)
.private_extern SYMBOL(_Copy_arrayof_conjoint_bytes)
.private_extern SYMBOL(_Copy_conjoint_jshorts_atomic)
.private_extern SYMBOL(_Copy_arrayof_conjoint_jshorts)
.private_extern SYMBOL(_Copy_conjoint_jints_atomic)
.private_extern SYMBOL(_Copy_arrayof_conjoint_jints)
.private_extern SYMBOL(_Copy_conjoint_jlongs_atomic)
.private_extern SYMBOL(_mmx_Copy_arrayof_conjoint_jshorts)
.private_extern SYMBOL(_Atomic_cmpxchg_long)
.private_extern SYMBOL(_Atomic_move_long)
#endif
.text
# Support for void os::Solaris::init_thread_fpu_state() in os_solaris_i486.cpp
@@ -62,7 +77,6 @@ SYMBOL(fixcw):
popl %eax
ret
.globl SYMBOL(SpinPause)
ELF_TYPE(SpinPause,@function)
.p2align 4,,15
SYMBOL(SpinPause):

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
#
# Copyright (c) 2004, 2024, 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
@@ -31,22 +31,33 @@
#endif
# NOTE WELL! The _Copy functions are called directly
# from server-compiler-generated code via CallLeafNoFP,
# which means that they *must* either not use floating
# point or use it in the same manner as does the server
# compiler.
# from server-compiler-generated code via CallLeafNoFP,
# which means that they *must* either not use floating
# point or use it in the same manner as does the server
# compiler.
.globl SYMBOL(SpinPause)
.globl SYMBOL(_Copy_arrayof_conjoint_bytes)
.globl SYMBOL(_Copy_arrayof_conjoint_jshorts)
.globl SYMBOL(_Copy_arrayof_conjoint_jshorts)
.globl SYMBOL(_Copy_conjoint_jshorts_atomic)
.globl SYMBOL(_Copy_arrayof_conjoint_jints)
.globl SYMBOL(_Copy_conjoint_jints_atomic)
.globl SYMBOL(_Copy_arrayof_conjoint_jlongs)
.globl SYMBOL(_Copy_conjoint_jlongs_atomic)
.text
#ifdef __APPLE__
.private_extern SYMBOL(SpinPause)
.private_extern SYMBOL(_Copy_arrayof_conjoint_bytes)
.private_extern SYMBOL(_Copy_arrayof_conjoint_jshorts)
.private_extern SYMBOL(_Copy_conjoint_jshorts_atomic)
.private_extern SYMBOL(_Copy_arrayof_conjoint_jints)
.private_extern SYMBOL(_Copy_conjoint_jints_atomic)
.private_extern SYMBOL(_Copy_arrayof_conjoint_jlongs)
.private_extern SYMBOL(_Copy_conjoint_jlongs_atomic)
#endif
.text
.globl SYMBOL(SpinPause)
.p2align 4,,15
ELF_TYPE(SpinPause,@function)
SYMBOL(SpinPause):
@@ -63,7 +74,7 @@ SYMBOL(SpinPause):
# rdx - count, treated as ssize_t
#
.p2align 4,,15
ELF_TYPE(_Copy_arrayof_conjoint_bytes,@function)
ELF_TYPE(_Copy_arrayof_conjoint_bytes,@function)
SYMBOL(_Copy_arrayof_conjoint_bytes):
movq %rdx,%r8 # byte count
shrq $3,%rdx # qword count
@@ -71,7 +82,7 @@ SYMBOL(_Copy_arrayof_conjoint_bytes):
leaq -1(%rdi,%r8,1),%rax # from + bcount*1 - 1
jbe acb_CopyRight
cmpq %rax,%rsi
jbe acb_CopyLeft
jbe acb_CopyLeft
acb_CopyRight:
leaq -8(%rdi,%rdx,8),%rax # from + qcount*8 - 8
leaq -8(%rsi,%rdx,8),%rcx # to + qcount*8 - 8
@@ -165,8 +176,8 @@ acb_CopyLeft:
# rdx - count, treated as ssize_t
#
.p2align 4,,15
ELF_TYPE(_Copy_arrayof_conjoint_jshorts,@function)
ELF_TYPE(_Copy_conjoint_jshorts_atomic,@function)
ELF_TYPE(_Copy_arrayof_conjoint_jshorts,@function)
ELF_TYPE(_Copy_conjoint_jshorts_atomic,@function)
SYMBOL(_Copy_arrayof_conjoint_jshorts):
SYMBOL(_Copy_conjoint_jshorts_atomic):
movq %rdx,%r8 # word count
@@ -175,7 +186,7 @@ SYMBOL(_Copy_conjoint_jshorts_atomic):
leaq -2(%rdi,%r8,2),%rax # from + wcount*2 - 2
jbe acs_CopyRight
cmpq %rax,%rsi
jbe acs_CopyLeft
jbe acs_CopyLeft
acs_CopyRight:
leaq -8(%rdi,%rdx,8),%rax # from + qcount*8 - 8
leaq -8(%rsi,%rdx,8),%rcx # to + qcount*8 - 8
@@ -255,8 +266,8 @@ acs_CopyLeft:
# rdx - count, treated as ssize_t
#
.p2align 4,,15
ELF_TYPE(_Copy_arrayof_conjoint_jints,@function)
ELF_TYPE(_Copy_conjoint_jints_atomic,@function)
ELF_TYPE(_Copy_arrayof_conjoint_jints,@function)
ELF_TYPE(_Copy_conjoint_jints_atomic,@function)
SYMBOL(_Copy_arrayof_conjoint_jints):
SYMBOL(_Copy_conjoint_jints_atomic):
movq %rdx,%r8 # dword count
@@ -265,7 +276,7 @@ SYMBOL(_Copy_conjoint_jints_atomic):
leaq -4(%rdi,%r8,4),%rax # from + dcount*4 - 4
jbe aci_CopyRight
cmpq %rax,%rsi
jbe aci_CopyLeft
jbe aci_CopyLeft
aci_CopyRight:
leaq -8(%rdi,%rdx,8),%rax # from + qcount*8 - 8
leaq -8(%rsi,%rdx,8),%rcx # to + qcount*8 - 8
@@ -334,15 +345,15 @@ aci_CopyLeft:
# rdx - count, treated as ssize_t
#
.p2align 4,,15
ELF_TYPE(_Copy_arrayof_conjoint_jlongs,@function)
ELF_TYPE(_Copy_conjoint_jlongs_atomic,@function)
ELF_TYPE(_Copy_arrayof_conjoint_jlongs,@function)
ELF_TYPE(_Copy_conjoint_jlongs_atomic,@function)
SYMBOL(_Copy_arrayof_conjoint_jlongs):
SYMBOL(_Copy_conjoint_jlongs_atomic):
cmpq %rdi,%rsi
leaq -8(%rdi,%rdx,8),%rax # from + count*8 - 8
jbe acl_CopyRight
cmpq %rax,%rsi
jbe acl_CopyLeft
jbe acl_CopyLeft
acl_CopyRight:
leaq -8(%rsi,%rdx,8),%rcx # to + count*8 - 8
negq %rdx

View File

@@ -1,6 +1,6 @@
#
# Copyright (c) 2022 SAP SE. All rights reserved.
# Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2022, 2024, 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
@@ -38,13 +38,22 @@
.globl SYMBOL(_SafeFetch32_continuation)
.globl SYMBOL(_SafeFetchN_continuation)
#ifdef __APPLE__
.private_extern SYMBOL(SafeFetch32_impl)
.private_extern SYMBOL(SafeFetchN_impl)
.private_extern SYMBOL(_SafeFetch32_fault)
.private_extern SYMBOL(_SafeFetchN_fault)
.private_extern SYMBOL(_SafeFetch32_continuation)
.private_extern SYMBOL(_SafeFetchN_continuation)
#endif
.text
# Support for int SafeFetch32(int* address, int defaultval);
#
# %rdi : address
# %esi : defaultval
ELF_TYPE(SafeFetch32_impl,@function)
ELF_TYPE(SafeFetch32_impl,@function)
SYMBOL(SafeFetch32_impl:)
SYMBOL(_SafeFetch32_fault:)
movl (%rdi), %eax

View File

@@ -24,6 +24,7 @@
.text
.globl aarch64_atomic_fetch_add_8_default_impl
.hidden aarch64_atomic_fetch_add_8_default_impl
.align 5
aarch64_atomic_fetch_add_8_default_impl:
#ifdef __ARM_FEATURE_ATOMICS
@@ -40,6 +41,7 @@ aarch64_atomic_fetch_add_8_default_impl:
ret
.globl aarch64_atomic_fetch_add_4_default_impl
.hidden aarch64_atomic_fetch_add_4_default_impl
.align 5
aarch64_atomic_fetch_add_4_default_impl:
#ifdef __ARM_FEATURE_ATOMICS
@@ -56,6 +58,7 @@ aarch64_atomic_fetch_add_4_default_impl:
ret
.global aarch64_atomic_fetch_add_8_relaxed_default_impl
.hidden aarch64_atomic_fetch_add_8_relaxed_default_impl
.align 5
aarch64_atomic_fetch_add_8_relaxed_default_impl:
#ifdef __ARM_FEATURE_ATOMICS
@@ -71,6 +74,7 @@ aarch64_atomic_fetch_add_8_relaxed_default_impl:
ret
.global aarch64_atomic_fetch_add_4_relaxed_default_impl
.hidden aarch64_atomic_fetch_add_4_relaxed_default_impl
.align 5
aarch64_atomic_fetch_add_4_relaxed_default_impl:
#ifdef __ARM_FEATURE_ATOMICS
@@ -86,6 +90,7 @@ aarch64_atomic_fetch_add_4_relaxed_default_impl:
ret
.globl aarch64_atomic_xchg_4_default_impl
.hidden aarch64_atomic_xchg_4_default_impl
.align 5
aarch64_atomic_xchg_4_default_impl:
#ifdef __ARM_FEATURE_ATOMICS
@@ -101,6 +106,7 @@ aarch64_atomic_xchg_4_default_impl:
ret
.globl aarch64_atomic_xchg_8_default_impl
.hidden aarch64_atomic_xchg_8_default_impl
.align 5
aarch64_atomic_xchg_8_default_impl:
#ifdef __ARM_FEATURE_ATOMICS
@@ -116,6 +122,7 @@ aarch64_atomic_xchg_8_default_impl:
ret
.globl aarch64_atomic_cmpxchg_1_default_impl
.hidden aarch64_atomic_cmpxchg_1_default_impl
.align 5
aarch64_atomic_cmpxchg_1_default_impl:
#ifdef __ARM_FEATURE_ATOMICS
@@ -136,6 +143,7 @@ aarch64_atomic_cmpxchg_1_default_impl:
ret
.globl aarch64_atomic_cmpxchg_4_default_impl
.hidden aarch64_atomic_cmpxchg_4_default_impl
.align 5
aarch64_atomic_cmpxchg_4_default_impl:
#ifdef __ARM_FEATURE_ATOMICS
@@ -155,6 +163,7 @@ aarch64_atomic_cmpxchg_4_default_impl:
ret
.globl aarch64_atomic_cmpxchg_8_default_impl
.hidden aarch64_atomic_cmpxchg_8_default_impl
.align 5
aarch64_atomic_cmpxchg_8_default_impl:
#ifdef __ARM_FEATURE_ATOMICS
@@ -174,6 +183,7 @@ aarch64_atomic_cmpxchg_8_default_impl:
ret
.globl aarch64_atomic_cmpxchg_4_release_default_impl
.hidden aarch64_atomic_cmpxchg_4_release_default_impl
.align 5
aarch64_atomic_cmpxchg_4_release_default_impl:
#ifdef __ARM_FEATURE_ATOMICS
@@ -191,6 +201,7 @@ aarch64_atomic_cmpxchg_4_release_default_impl:
ret
.globl aarch64_atomic_cmpxchg_8_release_default_impl
.hidden aarch64_atomic_cmpxchg_8_release_default_impl
.align 5
aarch64_atomic_cmpxchg_8_release_default_impl:
#ifdef __ARM_FEATURE_ATOMICS
@@ -208,6 +219,7 @@ aarch64_atomic_cmpxchg_8_release_default_impl:
ret
.globl aarch64_atomic_cmpxchg_4_seq_cst_default_impl
.hidden aarch64_atomic_cmpxchg_4_seq_cst_default_impl
.align 5
aarch64_atomic_cmpxchg_4_seq_cst_default_impl:
#ifdef __ARM_FEATURE_ATOMICS
@@ -225,6 +237,7 @@ aarch64_atomic_cmpxchg_4_seq_cst_default_impl:
ret
.globl aarch64_atomic_cmpxchg_8_seq_cst_default_impl
.hidden aarch64_atomic_cmpxchg_8_seq_cst_default_impl
.align 5
aarch64_atomic_cmpxchg_8_seq_cst_default_impl:
#ifdef __ARM_FEATURE_ATOMICS
@@ -242,6 +255,7 @@ aarch64_atomic_cmpxchg_8_seq_cst_default_impl:
ret
.globl aarch64_atomic_cmpxchg_1_relaxed_default_impl
.hidden aarch64_atomic_cmpxchg_1_relaxed_default_impl
.align 5
aarch64_atomic_cmpxchg_1_relaxed_default_impl:
#ifdef __ARM_FEATURE_ATOMICS
@@ -260,6 +274,7 @@ aarch64_atomic_cmpxchg_1_relaxed_default_impl:
ret
.globl aarch64_atomic_cmpxchg_4_relaxed_default_impl
.hidden aarch64_atomic_cmpxchg_4_relaxed_default_impl
.align 5
aarch64_atomic_cmpxchg_4_relaxed_default_impl:
#ifdef __ARM_FEATURE_ATOMICS
@@ -277,6 +292,7 @@ aarch64_atomic_cmpxchg_4_relaxed_default_impl:
ret
.globl aarch64_atomic_cmpxchg_8_relaxed_default_impl
.hidden aarch64_atomic_cmpxchg_8_relaxed_default_impl
.align 5
aarch64_atomic_cmpxchg_8_relaxed_default_impl:
#ifdef __ARM_FEATURE_ATOMICS

View File

@@ -24,6 +24,9 @@
.global _Copy_conjoint_words
.global _Copy_disjoint_words
.hidden _Copy_conjoint_words
.hidden _Copy_disjoint_words
s .req x0
d .req x1
count .req x2

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2022 SAP SE. All rights reserved.
* Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2022, 2024, 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
@@ -30,6 +30,13 @@
.globl _SafeFetch32_fault
.globl _SafeFetch32_continuation
.hidden SafeFetchN_impl
.hidden _SafeFetchN_fault
.hidden _SafeFetchN_continuation
.hidden SafeFetch32_impl
.hidden _SafeFetch32_fault
.hidden _SafeFetch32_continuation
# Support for int SafeFetch32(int* address, int defaultval);
#
# x0 : address

View File

@@ -25,22 +25,23 @@
// Clobber x1, flags.
// All other registers are preserved,
.global _ZN10JavaThread25aarch64_get_thread_helperEv
.type _ZN10JavaThread25aarch64_get_thread_helperEv, %function
.global _ZN10JavaThread25aarch64_get_thread_helperEv
.hidden _ZN10JavaThread25aarch64_get_thread_helperEv
.type _ZN10JavaThread25aarch64_get_thread_helperEv, %function
_ZN10JavaThread25aarch64_get_thread_helperEv:
hint #0x19 // paciasp
stp x29, x30, [sp, -16]!
adrp x0, :tlsdesc:_ZN6Thread12_thr_currentE
ldr x1, [x0, #:tlsdesc_lo12:_ZN6Thread12_thr_currentE]
add x0, x0, :tlsdesc_lo12:_ZN6Thread12_thr_currentE
.tlsdesccall _ZN6Thread12_thr_currentE
blr x1
mrs x1, tpidr_el0
add x0, x1, x0
ldr x0, [x0]
ldp x29, x30, [sp], 16
hint #0x1d // autiasp
ret
hint #0x19 // paciasp
stp x29, x30, [sp, -16]!
adrp x0, :tlsdesc:_ZN6Thread12_thr_currentE
ldr x1, [x0, #:tlsdesc_lo12:_ZN6Thread12_thr_currentE]
add x0, x0, :tlsdesc_lo12:_ZN6Thread12_thr_currentE
.tlsdesccall _ZN6Thread12_thr_currentE
blr x1
mrs x1, tpidr_el0
add x0, x1, x0
ldr x0, [x0]
ldp x29, x30, [sp], 16
hint #0x1d // autiasp
ret
.size _ZN10JavaThread25aarch64_get_thread_helperEv, .-_ZN10JavaThread25aarch64_get_thread_helperEv
.size _ZN10JavaThread25aarch64_get_thread_helperEv, .-_ZN10JavaThread25aarch64_get_thread_helperEv

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2008, 2022, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2008, 2024, 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
@@ -23,38 +23,46 @@
# NOTE WELL! The _Copy functions are called directly
# from server-compiler-generated code via CallLeafNoFP,
# which means that they *must* either not use floating
# point or use it in the same manner as does the server
# compiler.
# from server-compiler-generated code via CallLeafNoFP,
# which means that they *must* either not use floating
# point or use it in the same manner as does the server
# compiler.
.globl _Copy_conjoint_bytes
.type _Copy_conjoint_bytes, %function
.globl SpinPause
.hidden SpinPause
.type SpinPause, %function
.globl _Copy_arrayof_conjoint_bytes
.type _Copy_arrayof_conjoint_bytes, %function
.globl _Copy_disjoint_words
.type _Copy_disjoint_words, %function
.globl _Copy_conjoint_words
.type _Copy_conjoint_words, %function
.hidden _Copy_arrayof_conjoint_bytes
.type _Copy_arrayof_conjoint_bytes, %function
.globl _Copy_disjoint_words
.hidden _Copy_disjoint_words
.type _Copy_disjoint_words, %function
.globl _Copy_conjoint_words
.hidden _Copy_conjoint_words
.type _Copy_conjoint_words, %function
.globl _Copy_conjoint_jshorts_atomic
.type _Copy_conjoint_jshorts_atomic, %function
.globl _Copy_arrayof_conjoint_jshorts
.type _Copy_arrayof_conjoint_jshorts, %function
.hidden _Copy_conjoint_jshorts_atomic
.type _Copy_conjoint_jshorts_atomic, %function
.globl _Copy_arrayof_conjoint_jshorts
.hidden _Copy_arrayof_conjoint_jshorts
.type _Copy_arrayof_conjoint_jshorts, %function
.globl _Copy_conjoint_jints_atomic
.type _Copy_conjoint_jints_atomic, %function
.hidden _Copy_conjoint_jints_atomic
.type _Copy_conjoint_jints_atomic, %function
.globl _Copy_arrayof_conjoint_jints
.type _Copy_arrayof_conjoint_jints, %function
.globl _Copy_conjoint_jlongs_atomic
.type _Copy_conjoint_jlongs_atomic, %function
.globl _Copy_arrayof_conjoint_jlongs
.type _Copy_arrayof_conjoint_jlongs, %function
.hidden _Copy_arrayof_conjoint_jints
.type _Copy_arrayof_conjoint_jints, %function
.globl _Copy_conjoint_jlongs_atomic
.hidden _Copy_conjoint_jlongs_atomic
.type _Copy_conjoint_jlongs_atomic, %function
.globl _Copy_arrayof_conjoint_jlongs
.hidden _Copy_arrayof_conjoint_jlongs
.type _Copy_arrayof_conjoint_jlongs, %function
from .req r0
to .req r1
.text
.globl SpinPause
.type SpinPause, %function
.text
SpinPause:
bx LR
@@ -70,7 +78,7 @@ _Copy_arrayof_conjoint_bytes:
# size_t count)
_Copy_disjoint_words:
stmdb sp!, {r3 - r9, ip}
cmp r2, #0
beq disjoint_words_finish
@@ -81,17 +89,17 @@ _Copy_disjoint_words:
.align 3
dw_f2b_loop_32:
subs r2, #32
blt dw_f2b_loop_32_finish
blt dw_f2b_loop_32_finish
ldmia from!, {r3 - r9, ip}
nop
pld [from]
pld [from]
stmia to!, {r3 - r9, ip}
bgt dw_f2b_loop_32
dw_f2b_loop_32_finish:
addlts r2, #32
beq disjoint_words_finish
cmp r2, #16
blt disjoint_words_small
blt disjoint_words_small
ldmia from!, {r3 - r6}
subge r2, r2, #16
stmia to!, {r3 - r6}
@@ -116,8 +124,8 @@ disjoint_words_finish:
_Copy_conjoint_words:
stmdb sp!, {r3 - r9, ip}
cmp r2, #0
beq conjoint_words_finish
cmp r2, #0
beq conjoint_words_finish
pld [from, #0]
cmp r2, #12
@@ -129,17 +137,17 @@ _Copy_conjoint_words:
.align 3
cw_f2b_loop_32:
subs r2, #32
blt cw_f2b_loop_32_finish
blt cw_f2b_loop_32_finish
ldmia from!, {r3 - r9, ip}
nop
pld [from]
pld [from]
stmia to!, {r3 - r9, ip}
bgt cw_f2b_loop_32
cw_f2b_loop_32_finish:
addlts r2, #32
beq conjoint_words_finish
cmp r2, #16
blt conjoint_words_small
blt conjoint_words_small
ldmia from!, {r3 - r6}
subge r2, r2, #16
stmia to!, {r3 - r6}
@@ -154,7 +162,7 @@ conjoint_words_small:
strgt r9, [to], #4
b conjoint_words_finish
# Src and dest overlap, copy in a descending order
# Src and dest overlap, copy in a descending order
cw_b2f_copy:
add from, r2
pld [from, #-32]
@@ -162,17 +170,17 @@ cw_b2f_copy:
.align 3
cw_b2f_loop_32:
subs r2, #32
blt cw_b2f_loop_32_finish
blt cw_b2f_loop_32_finish
ldmdb from!, {r3-r9,ip}
nop
pld [from, #-32]
pld [from, #-32]
stmdb to!, {r3-r9,ip}
bgt cw_b2f_loop_32
cw_b2f_loop_32_finish:
addlts r2, #32
beq conjoint_words_finish
cmp r2, #16
blt cw_b2f_copy_small
blt cw_b2f_copy_small
ldmdb from!, {r3 - r6}
subge r2, r2, #16
stmdb to!, {r3 - r6}
@@ -196,8 +204,8 @@ conjoint_words_finish:
_Copy_conjoint_jshorts_atomic:
stmdb sp!, {r3 - r9, ip}
cmp r2, #0
beq conjoint_shorts_finish
cmp r2, #0
beq conjoint_shorts_finish
subs r3, to, from
cmphi r2, r3
@@ -210,11 +218,11 @@ _Copy_conjoint_jshorts_atomic:
ands r3, from, #3
bne cs_f2b_src_u
# Aligned source address
# Aligned source address
.align 3
cs_f2b_loop_32:
subs r2, #32
blt cs_f2b_loop_32_finish
blt cs_f2b_loop_32_finish
ldmia from!, {r3 - r9, ip}
nop
pld [from]
@@ -244,14 +252,14 @@ cs_f2b_4:
strgth r5, [to], #2
b conjoint_shorts_finish
# Destination not aligned
# Destination not aligned
cs_f2b_dest_u:
ldrh r3, [from], #2
subs r2, #2
strh r3, [to], #2
beq conjoint_shorts_finish
# Check to see if source is not aligned ether
# Check to see if source is not aligned ether
ands r3, from, #3
beq cs_f2b_loop_32
@@ -259,11 +267,11 @@ cs_f2b_src_u:
cmp r2, #16
blt cs_f2b_8_u
# Load 2 first bytes to r7 and make src ptr word aligned
# Load 2 first bytes to r7 and make src ptr word aligned
bic from, #3
ldr r7, [from], #4
# Destination aligned, source not
# Destination aligned, source not
mov r8, r2, lsr #4
.align 3
cs_f2b_16_u_loop:
@@ -306,7 +314,7 @@ cs_f2b_4_u:
strgth r5, [to], #2
b conjoint_shorts_finish
# Src and dest overlap, copy in a descending order
# Src and dest overlap, copy in a descending order
cs_b2f_copy:
add from, r2
pld [from, #-32]
@@ -319,7 +327,7 @@ cs_b2f_copy:
.align 3
cs_b2f_loop_32:
subs r2, #32
blt cs_b2f_loop_32_finish
blt cs_b2f_loop_32_finish
ldmdb from!, {r3-r9,ip}
nop
pld [from, #-32]
@@ -359,16 +367,16 @@ cs_b2f_all_copy:
strgth r5, [to, #-2]!
b conjoint_shorts_finish
# Destination not aligned
# Destination not aligned
cs_b2f_dest_u:
ldrh r3, [from, #-2]!
strh r3, [to, #-2]!
sub r2, #2
# Check source alignment as well
# Check source alignment as well
ands r3, from, #3
beq cs_b2f_loop_32
# Source not aligned
# Source not aligned
cs_b2f_src_u:
bic from, #3
.align 3
@@ -393,7 +401,7 @@ cs_b2f_16_loop_u:
cs_b2f_16_loop_u_finished:
addlts r2, #16
ldr r3, [from]
cmp r2, #10
cmp r2, #10
blt cs_b2f_2_u_loop
ldmdb from!, {r4 - r5}
mov r6, r4, lsr #16
@@ -402,7 +410,7 @@ cs_b2f_16_loop_u_finished:
orr r7, r7, r3, lsl #16
stmdb to!, {r6-r7}
sub r2, #8
.align 3
.align 3
cs_b2f_2_u_loop:
subs r2, #2
ldrh r3, [from], #-2
@@ -426,7 +434,7 @@ _Copy_arrayof_conjoint_jshorts:
_Copy_conjoint_jints_atomic:
_Copy_arrayof_conjoint_jints:
swi 0x9f0001
# Support for void Copy::conjoint_jlongs_atomic(jlong* from,
# jlong* to,
# size_t count)
@@ -434,8 +442,8 @@ _Copy_conjoint_jlongs_atomic:
_Copy_arrayof_conjoint_jlongs:
stmdb sp!, {r3 - r9, ip}
cmp r2, #0
beq conjoint_longs_finish
cmp r2, #0
beq conjoint_longs_finish
pld [from, #0]
cmp r2, #24
@@ -447,10 +455,10 @@ _Copy_arrayof_conjoint_jlongs:
.align 3
cl_f2b_loop_32:
subs r2, #32
blt cl_f2b_loop_32_finish
blt cl_f2b_loop_32_finish
ldmia from!, {r3 - r9, ip}
nop
pld [from]
pld [from]
stmia to!, {r3 - r9, ip}
bgt cl_f2b_loop_32
cl_f2b_loop_32_finish:
@@ -458,21 +466,21 @@ cl_f2b_loop_32_finish:
beq conjoint_longs_finish
conjoint_longs_small:
cmp r2, #16
blt cl_f2b_copy_8
bgt cl_f2b_copy_24
blt cl_f2b_copy_8
bgt cl_f2b_copy_24
ldmia from!, {r3 - r6}
stmia to!, {r3 - r6}
b conjoint_longs_finish
b conjoint_longs_finish
cl_f2b_copy_8:
ldmia from!, {r3 - r4}
stmia to!, {r3 - r4}
b conjoint_longs_finish
cl_f2b_copy_24:
ldmia from!, {r3 - r8}
ldmia from!, {r3 - r8}
stmia to!, {r3 - r8}
b conjoint_longs_finish
# Src and dest overlap, copy in a descending order
# Src and dest overlap, copy in a descending order
cl_b2f_copy:
add from, r2
pld [from, #-32]
@@ -480,31 +488,29 @@ cl_b2f_copy:
.align 3
cl_b2f_loop_32:
subs r2, #32
blt cl_b2f_loop_32_finish
blt cl_b2f_loop_32_finish
ldmdb from!, {r3 - r9, ip}
nop
pld [from]
pld [from]
stmdb to!, {r3 - r9, ip}
bgt cl_b2f_loop_32
cl_b2f_loop_32_finish:
addlts r2, #32
beq conjoint_longs_finish
cmp r2, #16
blt cl_b2f_copy_8
bgt cl_b2f_copy_24
blt cl_b2f_copy_8
bgt cl_b2f_copy_24
ldmdb from!, {r3 - r6}
stmdb to!, {r3 - r6}
b conjoint_longs_finish
cl_b2f_copy_8:
ldmdb from!, {r3 - r4}
ldmdb from!, {r3 - r4}
stmdb to!, {r3 - r4}
b conjoint_longs_finish
cl_b2f_copy_24:
ldmdb from!, {r3 - r8}
ldmdb from!, {r3 - r8}
stmdb to!, {r3 - r8}
conjoint_longs_finish:
ldmia sp!, {r3 - r9, ip}
bx lr

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2022 SAP SE. All rights reserved.
* Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2022, 2024, 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
@@ -26,6 +26,11 @@
.globl SafeFetch32_impl
.globl _SafeFetch32_fault
.globl _SafeFetch32_continuation
.hidden SafeFetch32_impl
.hidden _SafeFetch32_fault
.hidden _SafeFetch32_continuation
.type SafeFetch32_impl, %function
# Support for int SafeFetch32(int* address, int defaultval);

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2022 SAP SE. All rights reserved.
* Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2022, 2024, 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
@@ -30,6 +30,13 @@
.globl _SafeFetch32_fault
.globl _SafeFetch32_continuation
.hidden SafeFetchN_impl
.hidden _SafeFetchN_fault
.hidden _SafeFetchN_continuation
.hidden SafeFetch32_impl
.hidden _SafeFetch32_fault
.hidden _SafeFetch32_continuation
# Support for int SafeFetch32(int* address, int defaultval);
#
# r3 : address

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2022 SAP SE. All rights reserved.
* Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2022, 2024, 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
@@ -30,6 +30,13 @@
.globl _SafeFetch32_fault
.globl _SafeFetch32_continuation
.hidden SafeFetchN_impl
.hidden _SafeFetchN_fault
.hidden _SafeFetchN_continuation
.hidden SafeFetch32_impl
.hidden _SafeFetch32_fault
.hidden _SafeFetch32_continuation
# Support for int SafeFetch32(int* address, int defaultval);
#
# x10 (a0) : address

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2022 SAP SE. All rights reserved.
* Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2022, 2024, 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
@@ -30,6 +30,13 @@
.globl _SafeFetch32_fault
.globl _SafeFetch32_continuation
.hidden SafeFetchN_impl
.hidden _SafeFetchN_fault
.hidden _SafeFetchN_continuation
.hidden SafeFetch32_impl
.hidden _SafeFetch32_fault
.hidden _SafeFetch32_continuation
# Support for int SafeFetch32(int* address, int defaultval);
#
# r2 : address

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2004, 2022, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2004, 2024, 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
@@ -21,28 +21,41 @@
# questions.
#
.globl SpinPause
# NOTE WELL! The _Copy functions are called directly
# from server-compiler-generated code via CallLeafNoFP,
# which means that they *must* either not use floating
# point or use it in the same manner as does the server
# compiler.
# from server-compiler-generated code via CallLeafNoFP,
# which means that they *must* either not use floating
# point or use it in the same manner as does the server
# compiler.
.globl _Copy_arrayof_conjoint_bytes
.globl _Copy_conjoint_jshorts_atomic
.globl _Copy_arrayof_conjoint_jshorts
.globl _Copy_arrayof_conjoint_jshorts
.globl _Copy_conjoint_jints_atomic
.globl _Copy_arrayof_conjoint_jints
.globl _Copy_conjoint_jlongs_atomic
.globl _mmx_Copy_arrayof_conjoint_jshorts
.globl _Copy_conjoint_jlongs_atomic
.globl _mmx_Copy_arrayof_conjoint_jshorts
.globl _Atomic_cmpxchg_long
.globl _Atomic_move_long
.text
.hidden SpinPause
.globl SpinPause
.type SpinPause,@function
.hidden _Copy_arrayof_conjoint_bytes
.hidden _Copy_conjoint_jshorts_atomic
.hidden _Copy_arrayof_conjoint_jshorts
.hidden _Copy_conjoint_jints_atomic
.hidden _Copy_arrayof_conjoint_jints
.hidden _Copy_conjoint_jlongs_atomic
.hidden _mmx_Copy_arrayof_conjoint_jshorts
.hidden _Atomic_cmpxchg_long
.hidden _Atomic_move_long
.text
.type SpinPause,@function
.p2align 4,,15
SpinPause:
rep
@@ -55,7 +68,7 @@ SpinPause:
# size_t count)
#
.p2align 4,,15
.type _Copy_arrayof_conjoint_bytes,@function
.type _Copy_arrayof_conjoint_bytes,@function
_Copy_arrayof_conjoint_bytes:
pushl %esi
movl 4+12(%esp),%ecx # count
@@ -115,7 +128,7 @@ acb_CopyLeft:
jbe 2f # <= 32 dwords
rep; smovl
jmp 4f
.space 8
.space 8
2: subl %esi,%edi
.p2align 4,,15
3: movl (%esi),%edx
@@ -131,7 +144,7 @@ acb_CopyLeft:
addl $3,%esi
6: movb (%esi),%dl
movb %dl,(%edi,%esi,1)
subl $1,%esi
subl $1,%esi
subl $1,%ecx
jnz 6b
7: cld
@@ -143,7 +156,7 @@ acb_CopyLeft:
# void* to,
# size_t count)
.p2align 4,,15
.type _Copy_conjoint_jshorts_atomic,@function
.type _Copy_conjoint_jshorts_atomic,@function
_Copy_conjoint_jshorts_atomic:
pushl %esi
movl 4+12(%esp),%ecx # count
@@ -230,7 +243,7 @@ cs_CopyLeft:
# void* to,
# size_t count)
.p2align 4,,15
.type _Copy_arrayof_conjoint_jshorts,@function
.type _Copy_arrayof_conjoint_jshorts,@function
_Copy_arrayof_conjoint_jshorts:
pushl %esi
movl 4+12(%esp),%ecx # count
@@ -307,8 +320,8 @@ acs_CopyLeft:
# Equivalent to
# arrayof_conjoint_jints
.p2align 4,,15
.type _Copy_conjoint_jints_atomic,@function
.type _Copy_arrayof_conjoint_jints,@function
.type _Copy_conjoint_jints_atomic,@function
.type _Copy_arrayof_conjoint_jints,@function
_Copy_conjoint_jints_atomic:
_Copy_arrayof_conjoint_jints:
pushl %esi
@@ -384,7 +397,7 @@ ci_CopyLeft:
# }
*/
.p2align 4,,15
.type _Copy_conjoint_jlongs_atomic,@function
.type _Copy_conjoint_jlongs_atomic,@function
_Copy_conjoint_jlongs_atomic:
movl 4+8(%esp),%ecx # count
movl 4+0(%esp),%eax # from
@@ -413,7 +426,7 @@ cla_CopyLeft:
# void* to,
# size_t count)
.p2align 4,,15
.type _mmx_Copy_arrayof_conjoint_jshorts,@function
.type _mmx_Copy_arrayof_conjoint_jshorts,@function
_mmx_Copy_arrayof_conjoint_jshorts:
pushl %esi
movl 4+12(%esp),%ecx
@@ -465,8 +478,8 @@ mmx_acs_CopyRight:
cmpl $16,%ecx
jge 4b
emms
testl %ecx,%ecx
ja 1b
testl %ecx,%ecx
ja 1b
5: andl $1,%eax
je 7f
6: movw (%esi),%dx
@@ -511,7 +524,7 @@ mmx_acs_CopyLeft:
# jlong exchange_value)
#
.p2align 4,,15
.type _Atomic_cmpxchg_long,@function
.type _Atomic_cmpxchg_long,@function
_Atomic_cmpxchg_long:
# 8(%esp) : return PC
pushl %ebx # 4(%esp) : old %ebx
@@ -530,7 +543,7 @@ _Atomic_cmpxchg_long:
# Support for jlong Atomic::load and Atomic::store.
# void _Atomic_move_long(const volatile jlong* src, volatile jlong* dst)
.p2align 4,,15
.type _Atomic_move_long,@function
.type _Atomic_move_long,@function
_Atomic_move_long:
movl 4(%esp), %eax # src
fildll (%eax)

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
#
# Copyright (c) 2004, 2024, 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
@@ -21,24 +21,34 @@
# questions.
#
.globl SpinPause
# NOTE WELL! The _Copy functions are called directly
# from server-compiler-generated code via CallLeafNoFP,
# which means that they *must* either not use floating
# point or use it in the same manner as does the server
# compiler.
# from server-compiler-generated code via CallLeafNoFP,
# which means that they *must* either not use floating
# point or use it in the same manner as does the server
# compiler.
.globl _Copy_arrayof_conjoint_bytes
.globl _Copy_arrayof_conjoint_jshorts
.globl _Copy_arrayof_conjoint_jshorts
.globl _Copy_conjoint_jshorts_atomic
.globl _Copy_arrayof_conjoint_jints
.globl _Copy_conjoint_jints_atomic
.globl _Copy_arrayof_conjoint_jlongs
.globl _Copy_conjoint_jlongs_atomic
.text
.hidden SpinPause
.hidden _Copy_arrayof_conjoint_bytes
.hidden _Copy_arrayof_conjoint_jshorts
.hidden _Copy_conjoint_jshorts_atomic
.hidden _Copy_arrayof_conjoint_jints
.hidden _Copy_conjoint_jints_atomic
.hidden _Copy_arrayof_conjoint_jlongs
.hidden _Copy_conjoint_jlongs_atomic
.text
.globl SpinPause
.align 16
.type SpinPause,@function
SpinPause:
@@ -55,7 +65,7 @@ SpinPause:
# rdx - count, treated as ssize_t
#
.p2align 4,,15
.type _Copy_arrayof_conjoint_bytes,@function
.type _Copy_arrayof_conjoint_bytes,@function
_Copy_arrayof_conjoint_bytes:
movq %rdx,%r8 # byte count
shrq $3,%rdx # qword count
@@ -63,7 +73,7 @@ _Copy_arrayof_conjoint_bytes:
leaq -1(%rdi,%r8,1),%rax # from + bcount*1 - 1
jbe acb_CopyRight
cmpq %rax,%rsi
jbe acb_CopyLeft
jbe acb_CopyLeft
acb_CopyRight:
leaq -8(%rdi,%rdx,8),%rax # from + qcount*8 - 8
leaq -8(%rsi,%rdx,8),%rcx # to + qcount*8 - 8
@@ -157,8 +167,8 @@ acb_CopyLeft:
# rdx - count, treated as ssize_t
#
.p2align 4,,15
.type _Copy_arrayof_conjoint_jshorts,@function
.type _Copy_conjoint_jshorts_atomic,@function
.type _Copy_arrayof_conjoint_jshorts,@function
.type _Copy_conjoint_jshorts_atomic,@function
_Copy_arrayof_conjoint_jshorts:
_Copy_conjoint_jshorts_atomic:
movq %rdx,%r8 # word count
@@ -167,7 +177,7 @@ _Copy_conjoint_jshorts_atomic:
leaq -2(%rdi,%r8,2),%rax # from + wcount*2 - 2
jbe acs_CopyRight
cmpq %rax,%rsi
jbe acs_CopyLeft
jbe acs_CopyLeft
acs_CopyRight:
leaq -8(%rdi,%rdx,8),%rax # from + qcount*8 - 8
leaq -8(%rsi,%rdx,8),%rcx # to + qcount*8 - 8
@@ -247,8 +257,8 @@ acs_CopyLeft:
# rdx - count, treated as ssize_t
#
.p2align 4,,15
.type _Copy_arrayof_conjoint_jints,@function
.type _Copy_conjoint_jints_atomic,@function
.type _Copy_arrayof_conjoint_jints,@function
.type _Copy_conjoint_jints_atomic,@function
_Copy_arrayof_conjoint_jints:
_Copy_conjoint_jints_atomic:
movq %rdx,%r8 # dword count
@@ -257,7 +267,7 @@ _Copy_conjoint_jints_atomic:
leaq -4(%rdi,%r8,4),%rax # from + dcount*4 - 4
jbe aci_CopyRight
cmpq %rax,%rsi
jbe aci_CopyLeft
jbe aci_CopyLeft
aci_CopyRight:
leaq -8(%rdi,%rdx,8),%rax # from + qcount*8 - 8
leaq -8(%rsi,%rdx,8),%rcx # to + qcount*8 - 8
@@ -326,15 +336,15 @@ aci_CopyLeft:
# rdx - count, treated as ssize_t
#
.p2align 4,,15
.type _Copy_arrayof_conjoint_jlongs,@function
.type _Copy_conjoint_jlongs_atomic,@function
.type _Copy_arrayof_conjoint_jlongs,@function
.type _Copy_conjoint_jlongs_atomic,@function
_Copy_arrayof_conjoint_jlongs:
_Copy_conjoint_jlongs_atomic:
cmpq %rdi,%rsi
leaq -8(%rdi,%rdx,8),%rax # from + count*8 - 8
jbe acl_CopyRight
cmpq %rax,%rsi
jbe acl_CopyLeft
jbe acl_CopyLeft
acl_CopyRight:
leaq -8(%rsi,%rdx,8),%rcx # to + count*8 - 8
negq %rdx

View File

@@ -1,6 +1,6 @@
#
# Copyright (c) 2022 SAP SE. All rights reserved.
# Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2022, 2024, 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
@@ -25,7 +25,11 @@
.globl _SafeFetch32_fault
.globl _SafeFetch32_continuation
.text
.hidden SafeFetch32_impl
.hidden _SafeFetch32_fault
.hidden _SafeFetch32_continuation
.text
# Support for int SafeFetch32(int* address, int defaultval);
#

View File

@@ -1,6 +1,6 @@
#
# Copyright (c) 2022 SAP SE. All rights reserved.
# Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2022, 2024, 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
@@ -28,7 +28,14 @@
.globl _SafeFetch32_continuation
.globl _SafeFetchN_continuation
.text
.hidden SafeFetch32_impl
.hidden SafeFetchN_impl
.hidden _SafeFetch32_fault
.hidden _SafeFetchN_fault
.hidden _SafeFetch32_continuation
.hidden _SafeFetchN_continuation
.text
# Support for int SafeFetch32(int* address, int defaultval);

View File

@@ -1,5 +1,5 @@
//
// Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
// Copyright (c) 1997, 2024, 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
@@ -24,6 +24,7 @@
// archDesc.cpp - Internal format for architecture definition
#include <unordered_set>
#include "adlc.hpp"
static FILE *errfile = stderr;
@@ -684,6 +685,98 @@ bool ArchDesc::verify() {
return true;
}
class MarkUsageFormClosure : public FormClosure {
private:
ArchDesc* _ad;
std::unordered_set<Form*> *_visited;
public:
MarkUsageFormClosure(ArchDesc* ad, std::unordered_set<Form*> *visit_map) {
_ad = ad;
_visited = visit_map;
}
virtual ~MarkUsageFormClosure() = default;
virtual void do_form(Form *form) {
if (_visited->find(form) == _visited->end()) {
_visited->insert(form);
form->forms_do(this);
}
}
virtual void do_form_by_name(const char* name) {
const Form* form = _ad->globalNames()[name];
if (form) {
do_form(const_cast<Form*>(form));
return;
}
RegisterForm* regs = _ad->get_registers();
if (regs->getRegClass(name)) {
do_form(regs->getRegClass(name));
return;
}
}
};
// check unused operands
bool ArchDesc::check_usage() {
std::unordered_set<Form*> visited;
MarkUsageFormClosure callback(this, &visited);
_instructions.reset();
// iterate all instruction to mark used form
InstructForm* instr;
for ( ; (instr = (InstructForm*)_instructions.iter()) != nullptr; ) {
callback.do_form(instr);
}
// these forms are coded in OperandForm::is_user_name_for_sReg
// it may happen no instruction use these operands, like stackSlotP in aarch64,
// but we can not desclare they are useless.
callback.do_form_by_name("stackSlotI");
callback.do_form_by_name("stackSlotP");
callback.do_form_by_name("stackSlotD");
callback.do_form_by_name("stackSlotF");
callback.do_form_by_name("stackSlotL");
// sReg* are initial created by adlc in ArchDesc::initBaseOpTypes()
// In ARM, no definition or usage in adfile, but they are reported as unused
callback.do_form_by_name("sRegI");
callback.do_form_by_name("sRegP");
callback.do_form_by_name("sRegD");
callback.do_form_by_name("sRegF");
callback.do_form_by_name("sRegL");
// special generic vector operands only used in Matcher::pd_specialize_generic_vector_operand
#if defined(AARCH64)
callback.do_form_by_name("vecA");
callback.do_form_by_name("vecD");
callback.do_form_by_name("vecX");
#elif defined(AMD64)
callback.do_form_by_name("vecS");
callback.do_form_by_name("vecD");
callback.do_form_by_name("vecX");
callback.do_form_by_name("vecY");
callback.do_form_by_name("vecZ");
callback.do_form_by_name("legVecS");
callback.do_form_by_name("legVecD");
callback.do_form_by_name("legVecX");
callback.do_form_by_name("legVecY");
callback.do_form_by_name("legVecZ");
#endif
int cnt = 0;
_operands.reset();
OperandForm* operand;
for ( ; (operand = (OperandForm*)_operands.iter()) != nullptr; ) {
if(visited.find(operand) == visited.end() && !operand->ideal_only()) {
fprintf(stderr, "\nWarning: unused operand (%s)", operand->_ident);
cnt++;
}
}
if (cnt) fprintf(stderr, "\n-------Warning: total %d unused operands\n", cnt);
return true;
}
void ArchDesc::dump() {
_pre_header.dump();

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2024, 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
@@ -226,6 +226,7 @@ public:
inline void getForm(EncodeForm **ptr) { *ptr = _encode; }
bool verify();
bool check_usage();
void dump();
// Helper utility that gets MatchList components from inside MatchRule

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2024, 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
@@ -362,6 +362,15 @@ void FormDict::dump() {
_form.print(dumpkey, dumpform);
}
void FormDict::forms_do(FormClosure* f) {;
DictI iter(&_form);
for( ; iter.test(); ++iter ) {
Form* form = (Form*) iter._value;
assert(form != nullptr, "sanity");
f->do_form(form);
}
}
//------------------------------SourceForm-------------------------------------
SourceForm::SourceForm(char* code) : _code(code) { }; // Constructor
SourceForm::~SourceForm() {
@@ -374,3 +383,11 @@ void SourceForm::dump() { // Debug printer
void SourceForm::output(FILE *fp) {
fprintf(fp,"\n//%s\n%s\n",classname(),(_code?_code:""));
}
void FormClosure::do_form(Form* form) {
assert(false, "should not reach here");
}
void FormClosure::do_form_by_name(const char* name) {
assert(false, "should not reach here");
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2024, 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
@@ -58,6 +58,7 @@ class Flag;
class RewriteRule;
class ConstructRule;
class FormatRule;
class FormClosure;
class Peephole;
class EncClass;
class Interface;
@@ -114,6 +115,8 @@ public:
const Form *operator [](const char *name) const; // Do a lookup
void dump();
// iterate child forms recursively
void forms_do(FormClosure *f);
};
// ***** Master Class for ADL Parser Forms *****
@@ -163,6 +166,9 @@ public:
// Write info to output files
virtual void output(FILE *fp) { fprintf(fp,"Form Output"); }
// iterate child forms recursively
virtual void forms_do (FormClosure* f) { return; }
public:
// ADLC types, match the last character on ideal operands and instructions
enum DataType {
@@ -255,6 +261,16 @@ public:
};
class FormClosure {
public:
FormClosure() = default;
virtual ~FormClosure() = default;
virtual void do_form(Form* form);
virtual void do_form_by_name(const char* name);
};
//------------------------------FormList---------------------------------------
class FormList {
private:

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2024, 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
@@ -198,6 +198,20 @@ void RegisterForm::output(FILE *fp) { // Write info to output files
fprintf(fp,"-------------------- end RegisterForm --------------------\n");
}
void RegisterForm::forms_do(FormClosure *f) {
const char *name = nullptr;
if (_current_ac) f->do_form(_current_ac);
for(_rdefs.reset(); (name = _rdefs.iter()) != nullptr;) {
f->do_form((RegDef*)_regDef[name]);
}
for (_rclasses.reset(); (name = _rclasses.iter()) != nullptr;) {
f->do_form((RegClass*)_regClass[name]);
}
for (_aclasses.reset(); (name = _aclasses.iter()) != nullptr;) {
f->do_form((AllocClass*)_allocClass[name]);
}
}
//------------------------------RegDef-----------------------------------------
// Constructor
RegDef::RegDef(char *regname, char *callconv, char *c_conv, char * idealtype, char * encode, char * concrete)
@@ -322,6 +336,13 @@ void RegClass::output(FILE *fp) { // Write info to output files
fprintf(fp,"--- done with entries for reg_class %s\n\n",_classid);
}
void RegClass::forms_do(FormClosure *f) {
const char *name = nullptr;
for( _regDefs.reset(); (name = _regDefs.iter()) != nullptr; ) {
f->do_form((RegDef*)_regDef[name]);
}
}
void RegClass::declare_register_masks(FILE* fp) {
const char* prefix = "";
const char* rc_name_to_upper = toUpper(_classid);
@@ -436,6 +457,14 @@ void AllocClass::output(FILE *fp) { // Write info to output files
fprintf(fp,"--- done with entries for alloc_class %s\n\n",_classid);
}
void AllocClass::forms_do(FormClosure* f) {
const char *name;
for(_regDefs.reset(); (name = _regDefs.iter()) != nullptr;) {
f->do_form((RegDef*)_regDef[name]);
}
return;
}
//==============================Frame Handling=================================
//------------------------------FrameForm--------------------------------------
FrameForm::FrameForm() {
@@ -706,6 +735,15 @@ void Peephole::output(FILE *fp) { // Write info to output files
if( _next ) _next->output(fp);
}
void Peephole::forms_do(FormClosure *f) {
if (_predicate) f->do_form(_predicate);
if (_match) f->do_form(_match);
if (_procedure) f->do_form(_procedure);
if (_constraint) f->do_form(_constraint);
if (_replace) f->do_form(_replace);
return;
}
//----------------------------PeepPredicate------------------------------------
PeepPredicate::PeepPredicate(const char* rule) : _rule(rule) {
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2024, 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
@@ -123,6 +123,7 @@ public:
void dump(); // Debug printer
void output(FILE *fp); // Write info to output files
virtual void forms_do(FormClosure* f);
};
//------------------------------RegDef-----------------------------------------
@@ -199,6 +200,7 @@ public:
void dump(); // Debug printer
void output(FILE *fp); // Write info to output files
virtual void forms_do(FormClosure* f);
virtual bool has_stack_version() {
return _stack_or_reg;
@@ -305,6 +307,11 @@ public:
char* condition_code() {
return _condition_code;
}
virtual void forms_do(FormClosure* f) {
if (_rclasses[0]) f->do_form(_rclasses[0]);
if (_rclasses[1]) f->do_form(_rclasses[1]);
}
};
//------------------------------AllocClass-------------------------------------
@@ -325,6 +332,7 @@ public:
void dump(); // Debug printer
void output(FILE *fp); // Write info to output files
virtual void forms_do(FormClosure* f);
};
@@ -568,6 +576,7 @@ public:
void dump(); // Debug printer
void output(FILE *fp); // Write info to output files
virtual void forms_do(FormClosure* f);
};
class PeepPredicate : public Form {

View File

@@ -1498,6 +1498,24 @@ void InstructForm::output(FILE *fp) {
if (_peephole) _peephole->output(fp);
}
void InstructForm::forms_do(FormClosure *f) {
if (_cisc_spill_alternate) f->do_form(_cisc_spill_alternate);
if (_short_branch_form) f->do_form(_short_branch_form);
_localNames.forms_do(f);
if (_matrule) f->do_form(_matrule);
if (_opcode) f->do_form(_opcode);
if (_insencode) f->do_form(_insencode);
if (_constant) f->do_form(_constant);
if (_attribs) f->do_form(_attribs);
if (_predicate) f->do_form(_predicate);
_effects.forms_do(f);
if (_exprule) f->do_form(_exprule);
if (_rewrule) f->do_form(_rewrule);
if (_format) f->do_form(_format);
if (_peephole) f->do_form(_peephole);
assert(_components.count() == 0, "skip components");
}
void MachNodeForm::dump() {
output(stderr);
}
@@ -1615,6 +1633,14 @@ void EncodeForm::output(FILE *fp) { // Write info to output files
}
fprintf(fp,"-------------------- end EncodeForm --------------------\n");
}
void EncodeForm::forms_do(FormClosure* f) {
const char *name;
for (_eclasses.reset(); (name = _eclasses.iter()) != nullptr;) {
f->do_form((EncClass*)_encClass[name]);
}
}
//------------------------------EncClass---------------------------------------
EncClass::EncClass(const char *name)
: _localNames(cmpstr,hashstr, Form::arena), _name(name) {
@@ -1705,6 +1731,15 @@ void EncClass::output(FILE *fp) {
}
void EncClass::forms_do(FormClosure *f) {
_parameter_type.reset();
const char *type = _parameter_type.iter();
for ( ; type != nullptr ; type = _parameter_type.iter() ) {
f->do_form_by_name(type);
}
_localNames.forms_do(f);
}
//------------------------------Opcode-----------------------------------------
Opcode::Opcode(char *primary, char *secondary, char *tertiary)
: _primary(primary), _secondary(secondary), _tertiary(tertiary) {
@@ -1835,6 +1870,15 @@ void InsEncode::output(FILE *fp) {
fprintf(fp,"\n");
}
void InsEncode::forms_do(FormClosure *f) {
_encoding.reset();
NameAndList *encoding = (NameAndList*)_encoding.iter();
for( ; encoding != nullptr; encoding = (NameAndList*)_encoding.iter() ) {
// just check name, other operands will be checked as instruction parameters
f->do_form_by_name(encoding->name());
}
}
//------------------------------Effect-----------------------------------------
static int effect_lookup(const char *name) {
if (!strcmp(name, "USE")) return Component::USE;
@@ -1968,6 +2012,19 @@ void ExpandRule::output(FILE *fp) { // Write info to output files
}
}
void ExpandRule::forms_do(FormClosure *f) {
NameAndList *expand_instr = nullptr;
// Iterate over the instructions 'node' expands into
for(reset_instructions(); (expand_instr = iter_instructions()) != nullptr; ) {
f->do_form_by_name(expand_instr->name());
}
_newopers.reset();
const char* oper = _newopers.iter();
for(; oper != nullptr; oper = _newopers.iter()) {
f->do_form_by_name(oper);
}
}
//------------------------------RewriteRule------------------------------------
RewriteRule::RewriteRule(char* params, char* block)
: _tempParams(params), _tempBlock(block) { }; // Constructor
@@ -1984,6 +2041,12 @@ void RewriteRule::output(FILE *fp) { // Write info to output files
(_tempBlock?_tempBlock:""));
}
void RewriteRule::forms_do(FormClosure *f) {
if (_condition) f->do_form(_condition);
if (_instrs) f->do_form(_instrs);
if (_opers) f->do_form(_opers);
}
//==============================MachNodes======================================
//------------------------------MachNodeForm-----------------------------------
@@ -2066,6 +2129,13 @@ void OpClassForm::output(FILE *fp) {
fprintf(fp,"\n");
}
void OpClassForm::forms_do(FormClosure* f) {
const char *name;
for(_oplst.reset(); (name = _oplst.iter()) != nullptr;) {
f->do_form_by_name(name);
}
}
//==============================Operands=======================================
//------------------------------OperandForm------------------------------------
@@ -2691,6 +2761,22 @@ void OperandForm::output(FILE *fp) {
if (_format) _format->dump();
}
void OperandForm::forms_do(FormClosure* f) {
if (_matrule) f->do_form(_matrule);
if (_interface) f->do_form(_interface);
if (_attribs) f->do_form(_attribs);
if (_predicate) f->do_form(_predicate);
if (_constraint) f->do_form(_constraint);
if (_construct) f->do_form(_construct);
if (_format) f->do_form(_format);
_localNames.forms_do(f);
const char* opclass = nullptr;
for ( _classes.reset(); (opclass = _classes.iter()) != nullptr; ) {
f->do_form_by_name(opclass);
}
assert(_components.count() == 0, "skip _compnets");
}
//------------------------------Constraint-------------------------------------
Constraint::Constraint(const char *func, const char *arg)
: _func(func), _arg(arg) {
@@ -2712,6 +2798,10 @@ void Constraint::output(FILE *fp) { // Write info to output files
fprintf(fp,"Constraint: %s ( %s )\n", _func, _arg);
}
void Constraint::forms_do(FormClosure *f) {
f->do_form_by_name(_arg);
}
//------------------------------Predicate--------------------------------------
Predicate::Predicate(char *pr)
: _pred(pr) {
@@ -3539,6 +3629,12 @@ void MatchNode::output(FILE *fp) {
}
}
void MatchNode::forms_do(FormClosure *f) {
f->do_form_by_name(_name);
if (_lChild) f->do_form(_lChild);
if (_rChild) f->do_form(_rChild);
}
int MatchNode::needs_ideal_memory_edge(FormDict &globals) const {
static const char *needs_ideal_memory_list[] = {
"StoreI","StoreL","StoreP","StoreN","StoreNKlass","StoreD","StoreF" ,
@@ -3608,6 +3704,7 @@ int InstructForm::needs_base_oop_edge(FormDict &globals) const {
}
//-------------------------cisc spilling methods-------------------------------
// helper routines and methods for detecting cisc-spilling instructions
//-------------------------cisc_spill_merge------------------------------------
@@ -4334,6 +4431,18 @@ void MatchRule::output(FILE *fp) {
fprintf(fp,"\n");
}
void MatchRule::forms_do(FormClosure* f) {
// keep sync with MatchNode::forms_do
f->do_form_by_name(_name);
if (_lChild) f->do_form(_lChild);
if (_rChild) f->do_form(_rChild);
// handle next rule
if (_next) {
f->do_form(_next);
}
}
//------------------------------Attribute--------------------------------------
Attribute::Attribute(char *id, char* val, int type)
: _ident(id), _val(val), _atype(type) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2024, 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
@@ -310,6 +310,7 @@ public:
virtual void dump(); // Debug printer
virtual void output(FILE *fp); // Write to output files
virtual void forms_do(FormClosure *f);
};
//------------------------------EncodeForm-------------------------------------
@@ -333,6 +334,7 @@ public:
void dump(); // Debug printer
void output(FILE *fp); // Write info to output files
virtual void forms_do(FormClosure *f);
};
//------------------------------EncClass---------------------------------------
@@ -377,6 +379,7 @@ public:
bool verify();
void dump();
void output(FILE *fp);
virtual void forms_do(FormClosure* f);
};
//------------------------------MachNode---------------------------------------
@@ -468,6 +471,7 @@ public:
void dump();
void output(FILE *fp);
virtual void forms_do(FormClosure *f);
};
//------------------------------Effect-----------------------------------------
@@ -515,6 +519,7 @@ public:
void dump(); // Debug printer
void output(FILE *fp); // Write info to output files
virtual void forms_do(FormClosure *f);
};
//---------------------------------Flag----------------------------------------
@@ -554,6 +559,7 @@ public:
~RewriteRule(); // Destructor
void dump(); // Debug printer
void output(FILE *fp); // Write info to output files
virtual void forms_do(FormClosure* f);
};
@@ -584,6 +590,7 @@ public:
virtual bool ideal_only() const;
virtual void dump(); // Debug printer
virtual void output(FILE *fp); // Write to output files
virtual void forms_do(FormClosure* f);
};
//------------------------------OperandForm------------------------------------
@@ -711,6 +718,7 @@ public:
virtual void dump(); // Debug printer
virtual void output(FILE *fp); // Write to output files
virtual void forms_do(FormClosure* f);
};
//------------------------------Constraint-------------------------------------
@@ -729,6 +737,7 @@ public:
void dump(); // Debug printer
void output(FILE *fp); // Write info to output files
virtual void forms_do(FormClosure* f);
};
//------------------------------Predicate--------------------------------------
@@ -1014,6 +1023,7 @@ public:
void dump();
void output(FILE *fp);
virtual void forms_do(FormClosure* f);
};
//------------------------------MatchRule--------------------------------------
@@ -1075,6 +1085,7 @@ public:
void dump();
void output_short(FILE *fp);
void output(FILE *fp);
virtual void forms_do(FormClosure* f);
};
//------------------------------Attribute--------------------------------------

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2024, 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
@@ -186,6 +186,9 @@ int main(int argc, char *argv[])
// Verify that the results of the parse are consistent
AD.verify();
// Check defined operands are used
AD.check_usage();
// Prepare to generate the result files:
AD.generateMatchLists();
AD.identify_unique_operands();

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2024, 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
@@ -306,22 +306,22 @@ void IR::eliminate_null_checks() {
}
}
static int sort_pairs(BlockPair** a, BlockPair** b) {
if ((*a)->from() == (*b)->from()) {
return (*a)->to()->block_id() - (*b)->to()->block_id();
} else {
return (*a)->from()->block_id() - (*b)->from()->block_id();
}
}
// The functionality of this class is to insert a new block between
// the 'from' and 'to' block of a critical edge.
// It first collects the block pairs, and then processes them.
//
// Some instructions may introduce more than one edge between two blocks.
// By checking if the current 'to' block sets critical_edge_split_flag
// (all new blocks set this flag) we can avoid repeated processing.
// This is why BlockPair contains the index rather than the original 'to' block.
class CriticalEdgeFinder: public BlockClosure {
BlockPairList blocks;
IR* _ir;
public:
CriticalEdgeFinder(IR* ir): _ir(ir) {}
CriticalEdgeFinder(IR* ir) {
ir->iterate_preorder(this);
}
void block_do(BlockBegin* bb) {
BlockEnd* be = bb->end();
int nos = be->number_of_sux();
@@ -329,20 +329,22 @@ class CriticalEdgeFinder: public BlockClosure {
for (int i = 0; i < nos; i++) {
BlockBegin* sux = be->sux_at(i);
if (sux->number_of_preds() >= 2) {
blocks.append(new BlockPair(bb, sux));
blocks.append(new BlockPair(bb, i));
}
}
}
}
void split_edges() {
BlockPair* last_pair = nullptr;
blocks.sort(sort_pairs);
for (int i = 0; i < blocks.length(); i++) {
BlockPair* pair = blocks.at(i);
if (last_pair != nullptr && pair->is_same(last_pair)) continue;
BlockBegin* from = pair->from();
BlockBegin* to = pair->to();
int index = pair->index();
BlockBegin* to = from->end()->sux_at(index);
if (to->is_set(BlockBegin::critical_edge_split_flag)) {
// inserted
continue;
}
BlockBegin* split = from->insert_block_between(to);
#ifndef PRODUCT
if ((PrintIR || PrintIR1) && Verbose) {
@@ -350,15 +352,12 @@ class CriticalEdgeFinder: public BlockClosure {
from->block_id(), to->block_id(), split->block_id());
}
#endif
last_pair = pair;
}
}
};
void IR::split_critical_edges() {
CriticalEdgeFinder cef(this);
iterate_preorder(&cef);
cef.split_edges();
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2024, 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
@@ -586,6 +586,8 @@ void BlockBegin::substitute_sux(BlockBegin* old_sux, BlockBegin* new_sux) {
// of the inserted block, without recomputing the values of the other blocks
// in the CFG. Therefore the value of "depth_first_number" in BlockBegin becomes meaningless.
BlockBegin* BlockBegin::insert_block_between(BlockBegin* sux) {
assert(!sux->is_set(critical_edge_split_flag), "sanity check");
int bci = sux->bci();
// critical edge splitting may introduce a goto after a if and array
// bound check elimination may insert a predicate between the if and

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2024, 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
@@ -2423,15 +2423,11 @@ LEAF(MemBar, Instruction)
class BlockPair: public CompilationResourceObj {
private:
BlockBegin* _from;
BlockBegin* _to;
int _index; // sux index of 'to' block
public:
BlockPair(BlockBegin* from, BlockBegin* to): _from(from), _to(to) {}
BlockPair(BlockBegin* from, int index): _from(from), _index(index) {}
BlockBegin* from() const { return _from; }
BlockBegin* to() const { return _to; }
bool is_same(BlockBegin* from, BlockBegin* to) const { return _from == from && _to == to; }
bool is_same(BlockPair* p) const { return _from == p->from() && _to == p->to(); }
void set_to(BlockBegin* b) { _to = b; }
void set_from(BlockBegin* b) { _from = b; }
int index() const { return _index; }
};
typedef GrowableArray<BlockPair*> BlockPairList;

View File

@@ -44,7 +44,7 @@
#if INCLUDE_G1GC
#include "gc/g1/g1CollectedHeap.hpp"
#include "gc/g1/heapRegion.hpp"
#include "gc/g1/g1HeapRegion.hpp"
#endif
#if INCLUDE_CDS_JAVA_HEAP

View File

@@ -71,7 +71,7 @@
#include "utilities/ostream.hpp"
#if INCLUDE_G1GC
#include "gc/g1/g1CollectedHeap.hpp"
#include "gc/g1/heapRegion.hpp"
#include "gc/g1/g1HeapRegion.hpp"
#endif
# include <sys/stat.h>

View File

@@ -1327,6 +1327,9 @@ char* MetaspaceShared::reserve_address_space_for_archives(FileMapInfo* static_ma
release_reserved_spaces(total_space_rs, archive_space_rs, class_space_rs);
return nullptr;
}
// NMT: fix up the space tags
MemTracker::record_virtual_memory_type(archive_space_rs.base(), mtClassShared);
MemTracker::record_virtual_memory_type(class_space_rs.base(), mtClass);
} else {
if (use_archive_base_addr && base_address != nullptr) {
total_space_rs = ReservedSpace(total_range_size, archive_space_alignment,
@@ -1356,16 +1359,13 @@ char* MetaspaceShared::reserve_address_space_for_archives(FileMapInfo* static_ma
(size_t)archive_space_alignment);
class_space_rs = total_space_rs.last_part(ccs_begin_offset);
MemTracker::record_virtual_memory_split_reserved(total_space_rs.base(), total_space_rs.size(),
ccs_begin_offset);
ccs_begin_offset, mtClassShared, mtClass);
}
assert(is_aligned(archive_space_rs.base(), archive_space_alignment), "Sanity");
assert(is_aligned(archive_space_rs.size(), archive_space_alignment), "Sanity");
assert(is_aligned(class_space_rs.base(), class_space_alignment), "Sanity");
assert(is_aligned(class_space_rs.size(), class_space_alignment), "Sanity");
// NMT: fix up the space tags
MemTracker::record_virtual_memory_type(archive_space_rs.base(), mtClassShared);
MemTracker::record_virtual_memory_type(class_space_rs.base(), mtClass);
return archive_space_rs.base();

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2023, Red Hat, Inc. and/or its affiliates.
* Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2023, 2024, Red Hat, Inc. and/or its affiliates.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -42,11 +42,16 @@
#include "utilities/ostream.hpp"
#include "utilities/nativeCallStack.hpp"
int CompilationFailureInfo::current_compile_id_or_0() {
ciEnv* env = ciEnv::current();
return (env != nullptr) ? env->compile_id() : 0;
}
CompilationFailureInfo::CompilationFailureInfo(const char* failure_reason) :
_stack(2),
_failure_reason(os::strdup(failure_reason)),
_elapsed_seconds(os::elapsedTime()),
_compile_id(ciEnv::current()->task()->compile_id())
_compile_id(current_compile_id_or_0())
{}
CompilationFailureInfo::~CompilationFailureInfo() {

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2023, Red Hat, Inc. and/or its affiliates.
* Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2023, 2024, Red Hat, Inc. and/or its affiliates.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -40,6 +40,7 @@ class CompilationFailureInfo : public CHeapObj<mtCompiler> {
char* const _failure_reason;
const double _elapsed_seconds;
const int _compile_id;
static int current_compile_id_or_0();
public:
CompilationFailureInfo(const char* failure_reason);
~CompilationFailureInfo();

Some files were not shown because too many files have changed in this diff Show More