Compare commits

..

1507 Commits

Author SHA1 Message Date
Vladimir Lagunov
1594a68190 A fix from another pull request 2025-02-05 22:43:56 +01:00
Vladimir Lagunov
f9f04dd209 JBR-7700 Mimic error messages of java.io 2025-02-05 22:42:31 +01:00
Vladimir Lagunov
b96ca64dca JBR-7700 Cover IoOverNioFileSystem with tests
A new special `ManglingFileSystemProvider` is introduces. It is used as `java.nio.file.spi.DefaultFileSystemProvider` in the new tests. This file system alters file names and file contents, which helps to ensure that operations with `java.io.File` actually use `java.nio.file.FileSystem` inside.
2025-02-05 22:34:00 +01:00
Vladimir Lagunov
57dc8b95d0 JBR-7700 Implement IoOverNioFileSystem and use it by default 2025-02-05 22:34:00 +01:00
Vladimir Lagunov
c7ebd96ef8 JBR-7700 Template for java.io.IoOverNioFileSystem
The new class delegates everything to the default `java.io.FileSystem` and introduces logging.

Also, a few tests were added. The tests help to ensure that the new code in `IoOverNioFileSystem` behaves the same as the default `java.io.FileSystem`.
2025-02-05 18:02:39 +01:00
Vitaly Provodin
a5c089a8ef JBR-8219 revert "8292944: Noisy output when running make help the first time"
This reverts commit fcd5ebc7e8.
2025-02-05 01:03:26 +01:00
Vitaly Provodin
c4b4df537a Update README.md 2025-02-05 01:03:25 +01:00
Maxim Kartashev
bcc2409e64 JBR-8209 javax/swing/JPopupMenu/NestedFocusablePopupTest.java: WLRobotPeer: wakefield extension not present in Wayland instance 2025-02-05 01:03:25 +01:00
Alexey Ushakov
c76f00986a JBR-8201 Vulkan: crash in VKRenderer_MaskFill
Supported fully opaque mask
2025-02-05 01:03:25 +01:00
Vitaly Provodin
bd1364245f Update README.md 2025-02-05 01:03:25 +01:00
Maxim Kartashev
2b05f795ca JBR-8197 Wayland: Robot fails if offset in monitor configuration exists 2025-02-05 01:03:25 +01:00
Roman Shevchenko
04621007ba JBR-8198: substituting empty extension with the "Unix executable" type in the macOS file dialog (#479) 2025-02-05 01:03:25 +01:00
Maxim Kartashev
182f84d1c0 JBR-8066 Wayland: clipboard size is limited to 65000 symbols 2025-02-05 01:03:25 +01:00
Maxim Kartashev
fdc606b96c JBR-8116 Wayland: support RounderCornersManager JBR API 2025-02-05 01:03:25 +01:00
Nikita Gubarkov
c8aeb88c2d Added Clion project setup
(cherry picked from commit db962149ec)
2025-02-05 01:03:25 +01:00
Nikita Gubarkov
0d6cce134d Updated IDEA project setup 2025-02-05 01:03:25 +01:00
Nikita Gubarkov
b53b5874f6 JBR-8112 Revert swing.bufferPerWindow back to false on Windows 2025-02-05 01:03:25 +01:00
Vitaly Provodin
8ed74025bd enabling dtrace-tests: added dtrace keyword
(cherry picked from commit 0b5119ca89)
(cherry picked from commit 1959e4a2a4)
2025-02-05 01:03:25 +01:00
bourgesl
6f13eb3d36 JBR-8159: kill CVDisplayLink zombies (sleep / wake-up with multiple monitors in mirroring) + deal with display link thread shutdown (destroy threads at sleep) and restart when needed 2025-02-05 01:03:25 +01:00
Sergey Shelomentsev
542bfad571 JBR-8046 repack java.base.jmod with correct module hashes after signing 2025-02-05 01:03:25 +01:00
Vitaly Provodin
977c6e353f JBR-8161 Move docker files under jbr-tools 2025-02-05 01:03:25 +01:00
Vitaly Provodin
657c494ac4 update exclude list on results of 2963 test runs 2025-02-05 01:03:24 +01:00
Alexey Ushakov
bf1ef717b3 JBR-8091 X: jb/java/wayland/RobotGet tests thorw java.awt.AWTException: headless environment
Do not run test logic in the headless environment
2025-02-05 01:03:24 +01:00
Maxim Kartashev
99f0598652 JBR-7457 Provide JBR API method to explicitly call gc() 2025-02-05 01:03:24 +01:00
Roman Shevchenko
5b56209be4 JBR-8156 restoring WSL visibility in the folder picker mode 2025-02-05 01:03:24 +01:00
Nikita Tsarev
6dae9f701a JBR-5851: Fix 'DVORAK - QWERTY Cmd' layout 2025-02-05 01:03:24 +01:00
Vitaly Provodin
4d549bd19f Update README.md 2025-02-05 01:03:24 +01:00
Maxim Kartashev
3ccdf90b3a JBR-8133 Runtime crash after jfr drag and drop to IU 2025-02-05 01:03:24 +01:00
Nikita Gubarkov
2f363c2895 JBR-8139 Revert "8346986: Remove ASM from java.base"
This reverts commit 3e989fd0f7.
2025-02-05 01:03:24 +01:00
Alexey Ushakov
6e4f9096b3 JBR-7990 Vulkan: Robot pixel grabbing for Vulkan surfaces
Implemented grabbing pixels via partly supported SurfaceToSwBlit, fixed multi-monitor scenario
2025-02-05 01:03:24 +01:00
Maxim Kartashev
4d8663d10a JBR-3323 Exclude parts of VM code from sanitizer checks
Exclude VM error-reporting code that treats memory as a raw sequence of
bytes from address sanitizer checks. This is needed to only get true
reports when running tests against the --enable-asan build.

(cherry picked from commit 4c2085b5f7)
2025-02-05 01:03:24 +01:00
Vitaly Provodin
b1cfc3b905 Update README.md 2025-02-05 01:03:24 +01:00
Nikita Tsarev
677cec90d5 JBR-8004: Support the context menu key on macOS 2025-02-05 01:03:24 +01:00
Maxim Kartashev
6a4db44460 JBR-8123 NPE because FileSystems.getDefault() is null with -Djava.util.zip.use.nio.for.zip.file.access=true 2025-02-05 01:03:24 +01:00
Vitaly Provodin
193444fbb8 JBR-8104 OL8: enable premier support for docker images 2025-02-05 01:03:23 +01:00
Vitaly Provodin
efb88d2542 JBR-8072 move JBR docker images to registry.jetbrains.team 2025-02-05 01:03:23 +01:00
Vitaly Provodin
c1c34ce046 update exclude list on results of 2925 test runs 2025-02-05 01:03:23 +01:00
Maxim Kartashev
700cbdda2e JBR-6247 Update JBR-specific tests after JDK-8314823
(cherry picked from commit 791448a24d)
2025-02-05 01:03:23 +01:00
Maxim Kartashev
a439f6bb98 JBR-1430 (8195129) Windows: use UTF16 version of Win32 API to load DLL
Also correct library name encoding in exception messages.

with fix for JBR-5300 Change source code and test files to use GPL license

(cherry picked from commit 82a239a61d)
2025-02-05 01:03:23 +01:00
Vitaly Provodin
de58abe271 update exclude list on results of 2910 test runs 2025-02-05 01:03:23 +01:00
Vitaly Provodin
b69ea9b09e JBR-7929 remove java/awt/event/KeyEvent/AcceleratorTes/AcceleratorTest.html
that clashes with another test due to revert of "8315701: [macos] Regression: KeyEvent has different keycode on different keyboard layouts" caused by JBR-6387
2025-02-05 01:03:23 +01:00
Vitaly Provodin
3c0bbbdd95 update exclude list on results of 2898 test runs 2025-02-05 01:03:23 +01:00
Maxim Kartashev
613b56a45a JBR-7988 Wayland: WLPopupLocation test: incorrect size detected 2025-02-05 01:03:23 +01:00
bourgesl
8ecf137f80 JBR-8048: only log system property 'awt.mac.flushBuffers.invokeLater' if manually set 2025-02-05 01:03:23 +01:00
bourgesl
d0fd1cc036 JBR-5497: improved system property (awt.mac.flushBuffers.invokeLater) handling to support false/auto/true modes and log used value at startup 2025-02-05 01:03:23 +01:00
bourgesl
c60c7b26f0 JBR-5497: simple fix to avoid deadlocks on macOS + mirroring displays:
- added more instrumentation on awt threads and AWTThreading.invokeAndWait() to detect and diagnose deadlocks
- enhanced awtLockListener to adopt nanotime for time accuracy + more advanced logging (caller, wait time) with histograms
- major ThreadUtilities performOnMainThread refactoring to observe thread coordination (state, callstacks) in order to avoid deadlocks while the appkit/main thread is waiting (performOnMainThreadWaiting:YES) in conflict with LWCToolkit.invokeLater() blocked in doAWTRunLoop (2nd)
- fixed CPlatformWindow.flushBuffers() to use LWCToolkit.invokeLater() to avoid deadlocks (EDT <-> main) if the the system property '-Dawt.mac.flushBuffers.invokeLater=true'
- use the new CGraphicsDevice.IsMirroring() to enable fix in CPlatformWindow.flushBuffers() too
- removed changes for JBR-5461 + cleanup + simplified awtLock() + keep few more invokeLater() when computer returns from sleep or displayChanged() to avoid deadlocks until solved definitely
- fixed review comments
2025-02-05 01:03:23 +01:00
bourgesl
f64dc6335c JBR-5497: revert JRSUIController changes (performOnMainThreadWaiting:YES) to avoid UI freeze but appkit violations must be fixed in follow-up fix 2025-02-05 01:03:23 +01:00
Vitaly Provodin
c29274775e update exclude list on results of 2865 test runs 2025-02-05 01:03:23 +01:00
Maxim Kartashev
a2901d1ce0 JBR-7889 Wayland: java/awt/Focus/ComponentLostFocusTest.java: class sun.awt.NullComponentPeer cannot be cast to class java.awt.peer.TextFieldPeer 2025-02-05 01:03:22 +01:00
Maxim Kartashev
ad7ac7f124 JBR-7989 Wayland: WLPopupVisibility test is failing if launched with fractional sun.java2d.uiScale
Use ceil when scaling the size, use floor when scaling the location
2025-02-05 01:03:22 +01:00
Vitaly Provodin
53daabfffc JBR-8006 specify path to gcc-toolset-10 2025-02-05 01:03:22 +01:00
Maxim Kartashev
898f325e40 JBR-7993 Menus are not displayed directly underneath main menu if offset in monitor configuration exists 2025-02-05 01:03:22 +01:00
Vladimir Kharitonov
e24bd624a9 JBR-7983 adapt the Dockerfile.oraclelinux to build jcef 2025-02-05 01:03:22 +01:00
Sergey Shelomentsev
0a4d1b7a08 JBR-7919 add tests for Wayland popups 2025-02-05 01:03:22 +01:00
Maxim Kartashev
6716171453 JBR-7972 Wayland: EXTREME lag when scrolling through any type of list in the settings when using WLToolkit
Avoid requesting the Wayland server to change the cursor when the change
is vacuous
2025-02-05 01:03:22 +01:00
Maxim Kartashev
4e0f61fc2b JBR-7969 Wayland: some popups misplaced when maximized with fractional scale 2025-02-05 01:03:22 +01:00
Maxim Kartashev
3b1d4414d4 JBR-7071 Wayland: cursor does not change when hovering over gutter icons 2025-02-05 01:03:22 +01:00
Maxim Kartashev
b4bbee3712 JBR-7879 Wayland: Self-moving quick-doc popup in nightly
- Position popups at the exact offset given; this is achieved by
  using the XDG_POSITIONER_ANCHOR_TOP_LEFT anchor
- Update of popups location is done in sync with all other updates
  that affect the size (like the surface size update)
- Maintain a popup's location relative to the popup's parent, not
  its toplevel window
2025-02-05 01:03:22 +01:00
Sergey Shelomentsev
218660b3c6 JBR-5318 add Github workflow usage for pull requests pre-commit testing
(cherry picked from commit f36aa7f9fa)
2025-02-05 01:03:22 +01:00
Vitaly Provodin
71c9e0d712 update exclude list on results of 2827 test runs 2025-02-05 01:03:22 +01:00
Vitaly Provodin
a5c94eaf6b Update README.md 2025-02-05 01:03:22 +01:00
Sergey Shelomentsev
331529d1c2 JBR-7939 set max wait to 1 min for jetsign client 2025-02-05 01:03:22 +01:00
Nikita Gubarkov
ad0d40b20c JBR-7683 Revert "8185862: AWT Assertion Failure in ::GetDIBits(hBMDC, hBM, 0, 1, 0, gpBitmapInfo, 0) 'awt_Win32GraphicsDevice.cpp', at line 185"
This reverts commit 1ad3ebcf
2025-02-05 01:03:21 +01:00
Vitaly Provodin
c73dc1b888 Update README.md 2025-02-05 01:03:21 +01:00
Vitaly Provodin
f502b5ef0e update exclude list on results of 2777 test runs 2025-02-05 01:03:21 +01:00
Sergey Shelomentsev
2475d44d94 JBR-7867 Notarization scripts: fail build if signing of separate files are failed 2025-02-05 01:03:21 +01:00
Maxim Kartashev
e395cdbac1 JBR-7916 Wayland: tests open-sourced in 2024.09 fail 2025-02-05 01:03:21 +01:00
Vitaly Provodin
216087dcd0 update exclude list on results of 2765 test runs 2025-02-05 01:03:21 +01:00
Dmitrii Morskii
1267ef5138 JBR-7040 implemented FPS counter on D3D 2025-02-05 01:03:21 +01:00
Dmitrii Morskii
dc641d5c67 JBR-7900 Improve logic of detecting toolkit inside registerShutdownHook 2025-02-05 01:03:21 +01:00
Dmitrii Morskii
8fd7bf227d JBR-7051 Improved D3D Toolkit:
-Increased rendering performance
	-Improved text rendering quality
	-Accelerated repainting during window resizing
	-Removed unnecessary fallback to GDI rendering
	-Eliminated unnecessary hardware limitations
2025-02-05 01:03:21 +01:00
Maxim Kartashev
9c63184ea3 JBR-5483 MacOSXWatchService assumes that the default file system is the UnixFileSystem, which might not be the case
(cherry picked from commit 0af640f048)
2025-02-05 01:03:21 +01:00
Maxim Kartashev
f79a53d8b8 JBR-3862 Implement native WatchService on MacOS
The watch service is based on FSEvents API that notifies about file
system changes at a directory level. It is possible to go back to
using the old polling watch service with -Dwatch.service.polling=true.

Features include:
- support for FILE_TREE option (recursive directory watching),
- minimum necessary I/O (no filesystem access more than once
  unless needed),
- one thread ("run loop") per WatchService instance,
- changes are detected by comparing file modification times with
  millisecond precision,
- a directory tree snapshot is taken at the time of WatchKey creation
  and can take a long time (proportional to the number of files).

(cherry picked from commit f91ddf657a)
2025-02-05 01:03:21 +01:00
Maxim Kartashev
35ec7fbd9e JBR-7859 Wayland: Unexpected focus owner set in a Window 2025-02-05 01:03:21 +01:00
Maxim Kartashev
4628d5d3a9 JBR-7851 Wayland: IDEA crashes if Esc is pressed to close Diff window 2025-02-05 01:03:21 +01:00
Maxim Kartashev
754373547f JBR-3572 Wayland: java/awt/Window/WindowTitleVisibleTest/WindowTitleVisibleTestLinuxGnome.java: title bar shown and hidden are the same.
Exclude the test when running under XWayland that doesn't implement
screen capture necessary for the test to function.

(cherry picked from commit 4326028811)
2025-02-05 01:03:21 +01:00
Dmitrii Morskii
f87c409d4c JBR-7838 added getTreeLock to updateCursorImpl 2025-02-05 01:03:21 +01:00
Maxim Kartashev
68237922aa JBR-7760 Pure wayland: incorrect popup scale
(cherry picked from commit d16c50248d)
2025-02-05 01:03:20 +01:00
Sergey Shelomentsev
09ebb06cc6 JBR-7856 use jmod from currently built JDK
(cherry picked from commit 5c90a8d4aa)
2025-02-05 01:03:20 +01:00
Sergey Shelomentsev
dd779827b9 fixup! JBR-7800 Add jnativescan to signing
(cherry picked from commit 3ef8a52e0c)
2025-02-05 01:03:20 +01:00
Nikita Gubarkov
bbca6c90d9 JBR-7846 Vulkan: Fix compilation in Musl Docker container
(cherry picked from commit 79b9f5b71c)
2025-02-05 01:03:20 +01:00
sergey.shelomentsev
cf1a045ec4 JBR-7800 Fix notarization of jbrsdk (sign libs and execs inside jmod files)
(cherry picked from commit dbb42d10f5)
2025-02-05 01:03:20 +01:00
Vitaly Provodin
1605ce29d8 Update README.md
(cherry picked from commit ff4c5dc7b5)
2025-02-05 01:03:20 +01:00
Vitaly Provodin
78e4fe0d8a JBR-6144 enable building JBR with Vulkan
(cherry picked from commit 099698fa19)
2025-02-05 01:03:20 +01:00
Nikita Gubarkov
2e53b271a0 JBR-7840 Vulkan: Fix compilation in Docker container
(cherry picked from commit f678372d66)
2025-02-05 01:03:20 +01:00
Dmitrii Morskii
cc6bfd007d JBR-6754 setting nopixfmt in case of running on Remote Desktop
(cherry picked from commit de5d101cac)
2025-02-05 01:03:20 +01:00
Dmitry Batrak
0dc7aac79f JBR-7833 Wayland: typeahead problem in a popup
(cherry picked from commit 6093b65936)
2025-02-05 01:03:20 +01:00
Maxim Kartashev
e84b462b65 JBR-7811 Wayland: IDE dialogs and popups flash black before opening
(cherry picked from commit 0703011d40)
2025-02-05 01:03:20 +01:00
Sergey Shelomentsev
34be1213d1 JBR-7734 add zip distribution for Windows
(cherry picked from commit da26c98b82)
2025-02-05 01:03:20 +01:00
Maxim Kartashev
5cafca43c3 JBR-7700 Route java.io file system operations via java.nio.file
Use -Djbr.java.io.use.nio=false to undo

(cherry picked from commit ef22b4cc55)
2025-02-05 01:03:20 +01:00
Konstantin Nisht
a653083a38 JBR-7466 Exception on VM startup with -Djava.util.zip.use.nio.for.zip.file.access=true
(cherry picked from commit 79f79bf137)
2025-02-05 01:03:20 +01:00
Konstantin Nisht
15b184762e JBR-7392: Use NIO FS in ZipFile
(cherry picked from commit e21c67095b)
2025-02-05 01:03:19 +01:00
Vitaly Provodin
56c5fd9a02 Update README.md
(cherry picked from commit 0d66d2bf26)
2025-02-05 01:03:19 +01:00
Vitaly Provodin
7ff58de1b7 JBR-7797 build fastdebug without jcef
(cherry picked from commit cb322fe90d)
2025-02-05 01:03:19 +01:00
Maxim Kartashev
2b06028269 JBR-6691 test/jdk/jdk/internal/misc/VM/RuntimeArguments.java fails on Linux
(cherry picked from commit a3ecac8a79)
2025-02-05 01:03:19 +01:00
Maxim Kartashev
07857a014a JBR-7663 Wayland: make gtk-shell1 protocol support optional
(cherry picked from commit 30e6c720b6)
2025-02-05 01:03:19 +01:00
Maxim Kartashev
5a1e7f31ba JBR-7663 Wayland: generate proxy code with wayland-scanner on the fly
(cherry picked from commit d599043b7d)
2025-02-05 01:03:19 +01:00
Maxim Kartashev
0ff43449a9 JBR-7663 Wayland: add wayland-protocols to the docker files
(cherry picked from commit 8d207ee7e7)
2025-02-05 01:03:19 +01:00
Maxim Kartashev
5ee3511aca JBR-7726 X11 toolkit: Dialog buttons rendering black rectangle after hovering
(cherry picked from commit 18e63514c5)
2025-02-05 01:03:19 +01:00
Dmitrii Morskii
8d174e1b3a JBR-7302 added additional emptiness check in getGlyphOutlineBounds
(cherry picked from commit 60fd39e59d)
2025-02-05 01:03:19 +01:00
Nikita Gubarkov
647ec911c2 JBR-7766 Fix VKTexturePool OOM.
(cherry picked from commit 1a806f4f1b)
2025-02-05 01:03:19 +01:00
Nikita Tsarev
26291b9479 JBR-7764: Disable window decorations in test/jb/java/awt/Window/RestoreFromFullScreen.java, so that the test doesn't fail spuriously on some WMs
(cherry picked from commit 80c2a5969d)
2025-02-05 01:03:19 +01:00
Maxim Kartashev
005b472b38 JBR-7749 Settings popup invoked from the main toolbar appears misaligned if fractional scaling set
(cherry picked from commit d41d89e8b4)
2025-02-05 01:03:19 +01:00
Nikita Gubarkov
d346bfdebf JBR-4725 File dialog modality
(cherry picked from commit 2a5b044c95)
2025-02-05 01:03:19 +01:00
Maxim Kartashev
a730774f41 JBR-7544 Wayland: Cannot resize window to more that 3500px vertically
(cherry picked from commit ef3dfff3ae)
2025-02-05 01:03:19 +01:00
Vitaly Provodin
eaf2006905 Update README.md
(cherry picked from commit 7b6bc93034)
2025-02-05 01:03:19 +01:00
Maxim Kartashev
9c16708378 JBR-7748 java/awt/font/JNICheck/FreeTypeScalerJNICheck.java: JNI call made without checking exceptions when required to from CallVoidMethod
(cherry picked from commit ad45f6aec0)
2025-02-05 01:03:18 +01:00
Vitaly Provodin
6c791aeaf3 Update README.md
(cherry picked from commit dd41dbcb7b)
2025-02-05 01:03:18 +01:00
Maxim Kartashev
8a5906d6a2 JBR-7721 Copying from IntelliJ in pure Wayland on ChromeOS confuses UTF-8 and UTF-16
Avoid data flavor without an explicit charset

(cherry picked from commit 86acba5870)
2025-02-05 01:03:18 +01:00
Nikita Tsarev
9aa029e0bc JBR-6324: JBR API for System Shortcuts (macOS)
(cherry picked from commit 22d406a76b)
2025-02-05 01:03:18 +01:00
Nikita Tsarev
4a7bf02d03 JBR-5690: Reload next window shortcut when it changes
(cherry picked from commit be0d27983c)
2025-02-05 01:03:18 +01:00
Nikita Tsarev
e0a9bd26b1 JBR-5726: Report 'Move focus to the previous window in application' system shortcut
(cherry picked from commit 5721bd6908)
2025-02-05 01:03:18 +01:00
Nikita Gubarkov
2998851c65 JBR-7653 Prepare Docker images for Vulkan builds
(cherry picked from commit 249c46bb6b)
2025-02-05 01:03:18 +01:00
Nikita Gubarkov
255e2b7331 JBR-7673 Cleanup docker scripts
(cherry picked from commit 473686a92e)
2025-02-05 01:03:18 +01:00
Nikita Tsarev
d09fcea290 JBR-5448: Return all shortcuts from readSystemHotkeys
(cherry picked from commit bb25ab3424)
2025-02-05 01:03:18 +01:00
Nikita Gubarkov
30a0205969 JBR-7579 Fix SurfaceManager.cacheMap retaining strong references.
(cherry picked from commit b8434796ae)
2025-02-05 01:03:18 +01:00
Alexey Ushakov
6639a8df12 JBR-7724 Add vulkan support to the performance scripts
Implemented -vulkan option

(cherry picked from commit 6f1ecb9b47)
2025-02-05 01:03:18 +01:00
Vitaly Provodin
2848ce85e6 Update README.md
(cherry picked from commit a51b24a7eb)
2025-02-05 01:03:18 +01:00
Nikita Gubarkov
2a8ccaa6bb JBR-7565 Vulkan: Implement clip
(cherry picked from commit 55787a5c2d)
2025-02-05 01:03:18 +01:00
Nikita Gubarkov
d43735d11f JBR-7645 Vulkan: Implement hash table for pipeline sets
(cherry picked from commit d3669c1e75)
2025-02-05 01:03:18 +01:00
Nikita Gubarkov
9eb40bd0fd JBR-7563 Vulkan: Implement MASK_FILL
Mask bytes are copied to texel buffer to be used in shader.
Up to 256KiB (configurable) of mask can be rendered in a single draw call, with no limit on number of MASK_FILL operations in a single batch.

Also added dirty implementation of greyscale-AA DRAW_GLYPH_LIST and FILL_AAPARALLELOGRAM over MASK_FILL.

(cherry picked from commit 4651c3f096)
2025-02-05 01:03:17 +01:00
Nikita Gubarkov
00bc36948c JBR-7564 Vulkan: Fix HIDPI and multi-monitor scenarios
(cherry picked from commit 7f0b10ad23)
2025-02-05 01:03:17 +01:00
Nikita Gubarkov
b8edaaa750 JBR-7575 Vulkan: Implement composites (blending and XOR mode)
- Implemented dynamic pipeline compilation.
- Added 64-bit per pixel format usage in debug mode for testing.
- Now passing colors from Java to Vulkan with straight alpha.

(cherry picked from commit 3d7baad687)
2025-02-05 01:03:17 +01:00
Nikita Gubarkov
3dcd3acc8d JBR-7943 Vulkan: Provide utilities for inspecting image formats 2025-02-05 01:03:17 +01:00
Vitaly Provodin
9c53abcb26 Update README.md
(cherry picked from commit 770c075320)
2025-02-05 01:03:17 +01:00
Nikita Gubarkov
e7f388362f JBR-7574 Vulkan: Implement memory allocator
(cherry picked from commit 0be149c84e)
2025-02-05 01:03:17 +01:00
Nikita Tsarev
807dbddf56 JBR-7524: Workaround for showing window tiling actions when hovering over the maximize button on macOS
(cherry picked from commit 8fb519bec4)
2025-02-05 01:03:17 +01:00
Maxim Kartashev
43091f84c0 JBR-7504 Use accurate event serial number with the clipboard
(cherry picked from commit d935bd156e)
2025-02-05 01:03:17 +01:00
Maxim Kartashev
d4ead255eb JBR-7504 WLToolkit - Middle click paste doesn't work properly when pasting to other applications
(cherry picked from commit b553c722be)
2025-02-05 01:03:17 +01:00
Alexey Ushakov
456097753a JBR-7677 Vulkan: Implement Graphics.drawImage()
Implemented:
 - raster loading and blit primitive
 - transform for VKBlitSwToTextureViaPooledTexture
Used texture pool to get temporary image

(cherry picked from commit bf04a71bce)
2025-02-05 01:03:17 +01:00
Egor Ushakov
d543f68ced JBR-1354 com/sun/tools/attach/PermissionTest.java: access denied ("java.util.PropertyPermission" "sun.tools.attach.tmp.only" "read")
(cherry picked from commit 3a09f6c1db)
(cherry picked from commit 3b2399fc35)
2025-02-05 01:03:17 +01:00
Egor Ushakov
fd48ad5974 JBR-1061 .attach_pid files in the working dir - flag to put .attach file in tmp dir only
(cherry picked from commit 4bd3f7835e)
(cherry picked from commit b7a3a346e6)
2025-02-05 01:03:17 +01:00
Vitaly Provodin
53d29987fe Update README.md
(cherry picked from commit 64f5af4fda)
2025-02-05 01:03:17 +01:00
Nikita Tsarev
ed2cf44285 JBR-7672: Only abort key repeat when the key that is being repeated is released [WLToolkit]
(cherry picked from commit a500b52ecb)
2025-02-05 01:03:17 +01:00
Nikita Tsarev
86cea66436 JBR-7662: Fix key repeat manager sometimes not cancelling properly [WLToolkit]
(cherry picked from commit e1b1116bb9)
2025-02-05 01:03:17 +01:00
Vitaly Provodin
50fba58edb JBR-7511 migrate build platforms to OL8
- remove Vulcan part that causing builds to fail
- modify scripts for building images from Oracle Linux 8
- update jb/build/VerifyDependencies.java to check libraries have no dependency on symbols from glibc version higher than 2.28
- rename Ubuntu2004 docker files
- upgrade wayland up to wayland-devel-1.21.0-1

(cherry picked from commit 2092570840)
2025-02-05 01:03:16 +01:00
bourgesl
776fef2f44 JBR-7616: fixed type (str)
(cherry picked from commit a6569241db)
2025-02-05 01:03:16 +01:00
Nikita Tsarev
580775cf39 JBR-7675: Respect disabling key repeat [WLToolkit]
(cherry picked from commit 723f45aca7)
2025-02-05 01:03:16 +01:00
Vitaly Provodin
508eb0d7cf JBR-7566 apply standard measurement scripts to Render
(cherry picked from commit be24b3e8ed)
2025-02-05 01:03:16 +01:00
Vitaly Provodin
b34934653e JBR-7567 apply standard measurement scripts to Dacapo
(cherry picked from commit 289121d0ea)
2025-02-05 01:03:16 +01:00
bourgesl
7357709f00 JBR-7616: added ThreadUtilities.lwc_plog(env, formatMsg, ...) to use LWCToolkit's PlatformLogger instead of NSlog (only as fallback now) used by MTLRenderQueue, updated MTLUtils to share mtlDstTypeToStr(op)
(cherry picked from commit 8d240740ce)
2025-02-05 01:03:16 +01:00
Vitaly Provodin
08f2e5d49f Update README.md
(cherry picked from commit f3fc7649fb)
2025-02-05 01:03:16 +01:00
Vitaly Provodin
8d1f68aeff Update README.md
(cherry picked from commit 12dd44c724)
2025-02-05 01:03:16 +01:00
Nikita Gubarkov
9a5a1df47f JBR-7572 Bring back VKBuffer functions
(cherry picked from commit 90e516f24c)
2025-02-05 01:03:16 +01:00
Nikita Gubarkov
c11403f329 JBR-7644 Vulkan: Move barrier state tracking from surface into image
(cherry picked from commit 76dbad4387)
2025-02-05 01:03:16 +01:00
Nikita Gubarkov
ed008bf8ad JBR-7572 Vulkan: Implement vertex buffer pool
Track and reuse vertex buffers, no need to allocate and bind a new buffer on each draw.

(cherry picked from commit e607e789c2)
2025-02-05 01:03:16 +01:00
Vitaly Provodin
0f6247037a Update README.md
(cherry picked from commit 62d575dfe4)
2025-02-05 01:03:16 +01:00
Nikita Gubarkov
eff509f929 JBR-7556 Check negative glyphID in HBShaper
(cherry picked from commit 76852278f4)
2025-02-05 01:03:16 +01:00
bourgesl
901f24bf79 JBR-7616: improved MTLRenderQueue exception handling
(cherry picked from commit ea57bf75e7)
2025-02-05 01:03:16 +01:00
Maxim Kartashev
eea8a0ef36 JBR-7600 Provide ability to add messages to fatal error log
Use JNU_LOG_EVENT(env, msg, ...) to save a message in the internal
JVM ring buffer that gets printed out to the Events section
of the fatal error log if JVM crashed.

(cherry picked from commit 7a6184d309)
2025-02-05 01:03:16 +01:00
Nikita Provotorov
f7fdcaa9bd JBR-5673: Wayland: support touch scrolling.
- Adding information to WLPointerEvent about wl_pointer::axis* events along the X axis;
- Introducing 'WLComponentPeer#convertPointerEventToMWEParameters' - a routine for converting WLPointerEvent parameters to parameters required for MouseWheelEvent s;
- Handling both X and Y axes within the WLPointerEvent dispatching routine.

(cherry picked from commit 6afbc34d4b)
(cherry picked from commit 8b091f52d1)
2025-02-05 01:03:15 +01:00
Nikita Provotorov
037765d340 JBR-7459: Wayland: touchpad scrolling is too sensitive.
- Remaking the mapping of wl_pointer::axis events values to MouseWheelEvent rotations to eliminate the touchpad scrolling behavior "the more slowly the fingers move, the more pixels are scrolled";
- Accumulating the fraction parts of wl_pointer::axis events values to improve the accuracy of touchpad scrolling;
- Distinguishing between wheel scrolling and touchpad scrolling to fine-tune MouseWheelEvent parameters for each of these cases.

(cherry picked from commit 874d5698bc)
(cherry picked from commit cb41fa53f0)
2025-02-05 01:03:15 +01:00
Vitaly Provodin
15bd2c5282 Update README.md
(cherry picked from commit 29f3f9f229)
2025-02-05 01:03:15 +01:00
Sergei Tachenov
eafeccd44b JBR-7586 Fix title click ungrab when an active user component is clicked
Swing requires that clicking frame decorations should cause the window
to be ungrabbed. However, if a custom title is used, and that title contains
user-provided components, then clicking such components should not
cause the window to be ungrabbed, otherwise a menu located in a custom
title behaves incorrectly.

Fix by using the same logic as for the native actions, such as moving the window.
If the native actions are allowed, then ungrabbing is allowed as well.
Otherwise, do not ungrab, let the component behave like it's located in the client area.

The fix is supplemented with a new regression test "test/jdk/jb/javax/swing/CustomTitleBar/JMenuClickToCloseTest.java".

(cherry picked from commit f82c018914)
2025-02-05 01:03:15 +01:00
Nikita Tsarev
8abfcf8b88 JBR-7594 Check for LWCToolkit in JBR TextInput API
(cherry picked from commit 3c1fd1c3e6)
2025-02-05 01:03:15 +01:00
Sergei Tachenov
a68b150802 JBR-7484 Update the cursor on mouse entered/exited
AppKit resets the cursor on native mouse entered/exited events. Depending on the order of events, it may end up setting the wrong cursor. So update it forcibly on such events.

(cherry picked from commit 2de56405aa)
2025-02-05 01:03:15 +01:00
Sergei Tachenov
81b53b71f2 JBR-7481 Work around mouse entered/exited bug
To fix missing mouse entered/exited events when
using rounded corners, we keep track of mouse moved events. When a mouse moved event is detected, and the current peer under the cursor belongs to a different window, we send fake mouse entered/exit events to the old and new windows. We also filter late mouse exited events.

The workaround is enabled by default with the VM option "awt.mac.enableMouseEnteredExitedWorkaround" to disable it in case something breaks.

About the test:
Use the robot to find the points when the mouse
entered event is sent to the popup when the mouse
enters through a rounded corner, and the similar
point for entering the outer window when exiting
through such a corner.

Once the points are found, move the mouse back
and forth to that point, but not beyond.
The correct behavior is that when the mouse
enters the popup, a mouse exited event is sent
to the outer frame and vice versa.
Therefore, every mouse entered/exited event
should be received exactly once.

Use reflection to set the rounded corners,
as JBR API isn't available in tests.

(cherry picked from commit 0b5beaf2eb)
2025-02-05 01:03:15 +01:00
Vitaly Provodin
72c720fdf2 Update README.md
(cherry picked from commit 170a7cfa7f)
2025-02-05 01:03:15 +01:00
Alexey Ushakov
24b2fc5ea4 JBR-7588 Metal: Reuse MTLContext for all GCs of the same GPU
Implemented reference counting for shared MTLContext objects. Supported multiple display links per MTLContext. Also, works for macOS version < 10.13

(cherry picked from commit c6aa7f18e5)
2025-02-05 01:03:15 +01:00
Nikita Gubarkov
ccd7dfeb28 JBR-5973 Vulkan: Fix validation errors (#452)
- Added proper synchronization and image layout transitions.
- Refactored VKRenderer to hold per-device rendering context. Isolated surface rendering contexts.
- Implemented reusing of command buffers and semaphores
- Fixed surface resize, made surface initialization more robust.
- Added on-demand pipeline creation for actual surface formats.
- Added missing destruction logic.
- Added macros for easy checking of return codes, logging with source code location.
- Moved implementation details out of headers where possible. Stripped dead code.
- Implemented consistent OOM strategy from dynamic arrays and ring buffers.

(cherry picked from commit 91aafbe5d2)
2025-02-05 01:03:15 +01:00
Maxim Kartashev
f93932865d JBR-5615 added missing part for WLToolkit
(cherry picked from commit f407b957f2)
2025-02-05 01:03:15 +01:00
Dominik Matta
4f534e8edc JBR-6763 Wayland: application crashes when popup closed
Certain Wayland compositors (wlroots) invalidate xdg_surface after window with popup loses focus. Subsequent attempts to
commit the popup window fail with protocol error "xdg_surface has never been configured".

Handle popup_done event by hiding the popup window. Also emit WINDOW_CLOSING event as otherwise focus remains on the popup parent.

Co-authored-by: Maxim Kartashёv <maxim@kartashev.spb.ru>
(cherry picked from commit 873a085de4)
2025-02-05 01:03:15 +01:00
Maxim Kartashev
881124d2af JBR-6468 Wayland: java/awt/datatransfer/MimeFormatsTest.java fails by timeout
Excluded the test from jdk_awt_wayland as it can't be made to work
under Wayland.

(cherry picked from commit 7a3077ded9)
2025-02-05 01:03:15 +01:00
Maxim Kartashev
96f0710e54 Added proper copyright headers
(cherry picked from commit 0d5aea938e)
2025-02-05 01:03:15 +01:00
Nikita Gubarkov
38d1225a4a Fix WindowMoveService on Wayland
(cherry picked from commit 00f213d0ff)
2025-02-05 01:03:14 +01:00
Nikita Gubarkov
7a41e664de JBR-7570 Implemented ring buffer. Added lazy implicit initialization for dynamic arrays. (#451)
(cherry picked from commit 7b89fe2311)
2025-02-05 01:03:14 +01:00
Nikita Gubarkov
36dad223f5 JBR-7568 Vulkan: Refactor VKLogicalDevice into VKDevice (#449)
* Renamed VKLogicalDevice to VKDevice for conformance and convenience.
* Refactored device->device to device->handle for clarity.

(cherry picked from commit aba56fd3a9)
2025-02-05 01:03:14 +01:00
Nikita Gubarkov
fb0827b0b9 JBR-7569 Removed VMA-Hpp (#450)
(cherry picked from commit 3867557192)
2025-02-05 01:03:14 +01:00
Dmitrii Morskii
31041c223c JBR-7126 add more possible names for cursor arrow icon
(cherry picked from commit 95e391166d)
2025-02-05 01:03:14 +01:00
Maxim Kartashёv
6d1c91564a JBR-7016 IDEA 2024.2 Wayland: UI Crash when selecting Code and pressing Alt+Enter
(cherry picked from commit 35776b5975)
2025-02-05 01:03:14 +01:00
Maxim Kartashёv
a514ffeafc JBR-7493 Wayland: can't start in maximized state on WSL
(cherry picked from commit 18e39cafa0)
2025-02-05 01:03:14 +01:00
Maxim Kartashёv
8f962f3041 JBR-7516 Wayland: DamageList_AddList: Assertion `list != add' failed
(cherry picked from commit 674b7d1dac)
2025-02-05 01:03:14 +01:00
Maxim Kartashёv
0b193b34d2 JBR-7501 Wayland: SurfaceData.flush() method is mis-used
(cherry picked from commit 1299f0f6c6)
2025-02-05 01:03:14 +01:00
Nikita Tsarev
41ab7262aa JBR-7478: Fix wrong timestamps on KEY_TYPED events [WLToolkit]
(cherry picked from commit c47edfa7c7)
2025-02-05 01:03:14 +01:00
lbourges
59ad49c6d7 JBR-7461: Implement VKTexturePool for the linux vulkan pipeline:
- based on common AccelTexturePool
 - new VKTexturePool instance in VKLogicalDevice
 - fixed SIGSEGV in VKImage dispose
 - store device in TPI
 - indentation fixes
 - merged with latest changes for JBR-7460
 - use (ATexturePoolLock_init)(void)
 - fixed logs in lock implementations + fixed indentation
 - fixed MTLTexturePool to pre-processor conditions (not runtime) on USE_ACCEL_TEXTURE_POOL

(cherry picked from commit 5515b0fbfc)
2025-02-05 01:03:14 +01:00
Maxim Kartashёv
b4917da19b JBR-7313 Wayland: error: xdg_surface buffer does not match the configured maximized state
(cherry picked from commit 4bb0306175)
2025-02-05 01:03:14 +01:00
Maxim Kartashev
598f615909 JBR-7397 Wayland: make certain interfaces optional
(cherry picked from commit a1dcba231a)
2025-02-05 01:03:14 +01:00
Maxim Kartashev
a552d05a29 JBR-7397 CLion 2024.2-EAP/Wayland crashes on startup with Miriway
Check if all non-optional interfaces are supported before actually
starting to run

(cherry picked from commit 632a0ace4c)
2025-02-05 01:03:14 +01:00
Alexey Ushakov
0b2d8a7569 JBR-7452 Vulkan: Reuse VkRenderPass for multiple renderers (#428)
Moved shared VkRenderPass to the logical device

(cherry picked from commit 3d782ed0f0)
2025-02-05 01:03:14 +01:00
Alexey Ushakov
46e34d51bb JBR-7420 Vulkan: Implement DRAW_PARALLELOGRAM primitive for flat color rendering (#426)
Refactored rendering code. Provided common implementation for fill and draw operations.

(cherry picked from commit 902f65c6ae)
2025-02-05 01:03:13 +01:00
Nikita Gubarkov
5e71781e24 JBR-7419 Refactor Vulkan code
- Separate instance and device-specific function tables
- Avoid using device from global context when possible
- Set up debug logger

(cherry picked from commit af4eb8b758)
2025-02-05 01:03:13 +01:00
Maxim Kartashёv
194e32989a JBR-7390 Wayland: need better headless exception message
(cherry picked from commit b68c0ecc6f)
2025-02-05 01:03:13 +01:00
Maxim Kartashёv
3314adc81f JBR-7259 Find Usages popup can't be resized under Wayland
Popup's positioner size has to be in sync with popup's buffer size

(cherry picked from commit 5d67a135e4)
2025-02-05 01:03:13 +01:00
Maxim Kartashёv
e38358a728 JBR-7254 Impossible to copy/paste files in Project tree
(cherry picked from commit 762cd2b23e)
2025-02-05 01:03:13 +01:00
Maxim Kartashev
62e5b825c2 JBR-7290 Wayland: window permanently looses focus after invoking Go To Line dialog
(cherry picked from commit c381634aff)
2025-02-05 01:03:13 +01:00
Alexey Ushakov
1d672b5816 JBR-7308 Vulkan: Build failure in vulkan enabled builds
Added missing header (jni_util.h)

(cherry picked from commit 02fb3aee06)
2025-02-05 01:03:13 +01:00
Alexey Ushakov
717ae79a05 JBR-7305 Vulkan: Implement FILL_SPANS primitive for flat color rendering
Implemented flat color shape rendering

(cherry picked from commit 6f84d82d1d)
2025-02-05 01:03:13 +01:00
Nikita Gubarkov
763c42669a JBR-7307 Add stub for VKInstance.initNative with disabled Vulkan.
(cherry picked from commit e834ce867f)
2025-02-05 01:03:13 +01:00
Nikita Gubarkov
7244939ab8 JBR-7237 Fix cyclic dependency of Wayland and Vulkan initialization (#396)
(cherry picked from commit cde482c1fd)
2025-02-05 01:03:13 +01:00
Maxim Kartashёv
cea6628318 JBR-7072 Wayland: clicks on items of floating context menus are ignored (#405)
JBR-7072 Wayland: clicks on items of floating context menus are ignored

(cherry picked from commit 4083b43591)
2025-02-05 01:03:13 +01:00
Alexey Ushakov
7025c24d17 JBR-7256 Vulkan: Implement FILL_PARALLELOGRAM primitive for flat color rendering
(cherry picked from commit 57dc1a9e23)
2025-02-05 01:03:13 +01:00
Maxim Kartashev
b9f8a0edd0 JBR-7237 Separate display connect from WLToolkit initialization
(cherry picked from commit 768d46d049)
2025-02-05 01:03:13 +01:00
Maxim Kartashev
e7f7b2fb2f JBR-7202 wayland: memory leak when resizing windows
(cherry picked from commit 64660b0c00)
2025-02-05 01:03:13 +01:00
Maxim Kartashev
ab830a927d JBR-7206 Wayland: Stylepad demo flickers when resizing on KDE
(cherry picked from commit 996d4f7490)
2025-02-05 01:03:12 +01:00
Alexey Ushakov
6bbcd88b46 JBR-6543 Vulkan: migrate current code to pure c (#267)
JBR-6543 Vulkan: migrate current code to pure c

Replaced C++ vulkan rendering with C one

(cherry picked from commit 85e44bf973)
2025-02-05 01:03:12 +01:00
Maxim Kartashev
755467958a JBR-7209 Wayland: modernize window decorations
(cherry picked from commit d3496bc966)
2025-02-05 01:03:12 +01:00
Maxim Kartashev
ac28e2eedd JBR-7201 Wayland: update copyright in files generated by wayland-scanner
(cherry picked from commit 33a7167108)
2025-02-05 01:03:12 +01:00
Maxim Kartashev
73d6ee78fc JBR-7198 Wayland: jvm crashes under KDE
Do not copy the buffer if the drawing buffer has not been resized yet as
the size will not match that of the show buffer.
Also, properly guard against the size change by another thread while
copying.

(cherry picked from commit 8ff1d3c6aa)
2025-02-05 01:03:12 +01:00
Maxim Kartashev
60932435da JBR-7158 Wayland: scale with wp_viewport instead of buffer scale
(cherry picked from commit 8227e43343)
2025-02-05 01:03:12 +01:00
Maxim Kartashev
d713266667 JBR-7028 Implement FPS counter on Linux
Use -Dawt.window.counters to enable.
To output counters per second to stdout/stderr,
use -Dawt.window.counters=stdout or =stderr.

A counter by the name swing.RepaintManager.updateWindows
is always available for Swing applications, but it does not
accurately correspond to frames per second.

Toolkit-dependent counters provide much better accuracy.
On Wayland with memory buffers as the backend two are available:
java2d.native.frames - frames delivered to the Wayland server
java2d.native.framesDropped - fully formed frames that were not
delivered to the Wayland server

(cherry picked from commit 639a7b4a5e)
2025-02-05 01:03:12 +01:00
Maxim Kartashev
b9472cbdd3 JBR-7047 Deadlock on git fetch on Wayland
(cherry picked from commit eabaada5bc)
2025-02-05 01:03:12 +01:00
Maxim Kartashev
8941fcc068 JBR-6576 Wayland: exception when double-clicking dialog title bar
(cherry picked from commit e42b74780b)
2025-02-05 01:03:12 +01:00
Maxim Kartashev
bfe5c6c587 JBR-7058 Wayland: IDE hang on the popup appearance
Clean up the damage list when resizing a surface.
Additionally, clamp the damaged area before copying to its current
actual size in order to safeguard against invalid external input.

(cherry picked from commit 392a016333)
2025-02-05 01:03:12 +01:00
tsarn
7b5d54be6a JBR-7063: Make .getKeyChar() report chars in KEY_PRESSED/KEY_RELEASED events for compatibility [WLToolkit] (#371)
(cherry picked from commit bc5bdd2b9e)
2025-02-05 01:03:12 +01:00
tsarn
729a8c5127 JBR-6848: Support extra mouse buttons for navigation [WLToolkit]
(cherry picked from commit 2fb530835d)
2025-02-05 01:03:12 +01:00
tsarn
916f985a01 JBR-6434: Fix pointer leave also resetting the keyboard modifiers [WLToolkit] (#370)
(cherry picked from commit bae7c40fa5)
2025-02-05 01:03:12 +01:00
tsarn
3bd56fcf0f JBR-7044: Reset clickCount on mouse moves [WLToolkit]
(cherry picked from commit 0dc57e183c)
2025-02-05 01:03:12 +01:00
Maxim Kartashev
46f99887ca JBR-7010 Wayland: Swing window resizing is not smooth enough
(cherry picked from commit 724bdfbabb)
2025-02-05 01:03:12 +01:00
Maxim Kartashev
6934cbd0f5 JBR-6926 Wayland: fonts are aliased/grainy on first start
(cherry picked from commit 9ee13ff658)
2025-02-05 01:03:11 +01:00
Maxim Kartashev
fb6520c0c3 JBR-6920 Wayland: some IDEA popups positioned incorrectly
(cherry picked from commit e28d2bacc7)
2025-02-05 01:03:11 +01:00
Maxim Kartashev
c24cb13a91 JBR-6895 Wayland: cursor changes to resize at edges even when window is maximized
(cherry picked from commit a634a8b345)
2025-02-05 01:03:11 +01:00
Maxim Kartashev
2889fe4e8d JBR-6884 SIGSEGV in Java_sun_java2d_wl_WLSMSurfaceData_pixelsAt
(cherry picked from commit 5b883749de)
2025-02-05 01:03:11 +01:00
Maxim Kartashev
383028facb JBR-6448 Wayland: IDEA window looks pixelated after monitors scale was changed
(cherry picked from commit 3318c2260b)
2025-02-05 01:03:11 +01:00
Maxim Kartashev
9a4ba65e82 JBR-6814 Wayland: support sun.java2d.uiScale property
(cherry picked from commit 2d420bfd59)
2025-02-05 01:03:11 +01:00
Alexey Ushakov
73dad5c9b6 JBR-6787 WLToolkit/wsl: crash in WLComponentPeer.setCursor
Added check for unavailable cursor pData

(cherry picked from commit b24e4bce02)
2025-02-05 01:03:11 +01:00
Maxim Kartashev
9fc1ffcd03 JBR-6783 MouseEvent/MenuDragMouseEventAbsoluteCoordsTest/MenuDragMouseEventAbsoluteCoordsTest.java: Found one Java-level deadlock
(cherry picked from commit 4e391051bd)
2025-02-05 01:03:11 +01:00
Maxim Kartashev
6b032d6639 JBR-6504 Wayland: optional Robot capability to peek at current window's pixels
(cherry picked from commit 4e1bac1d8e)
2025-02-05 01:03:11 +01:00
Maxim Kartashev
6b3a4b52c5 JBR-6519 Linux: SIGSEGV at [libwayland] wl_proxy_get_version
Guard against passing NULL to libwayland

(cherry picked from commit 74ab4ac224)
2025-02-05 01:03:11 +01:00
Maxim Kartashev
3ed83e24c3 JBR-6736 libwakefield crashes weston
(cherry picked from commit 6777dcb2f7)
2025-02-05 01:03:11 +01:00
Maxim Kartashev
ee783d497a JBR-6722 OutOfMemoryError: Failed to allocate Wayland surface buffer
(cherry picked from commit 8ccf0e158f)
2025-02-05 01:03:11 +01:00
Maxim Kartashev
7c4d84ac79 JBR-6617 Wayland: java/awt/Frame/HugeFrame/HugeFrame.java crashes JVM
(cherry picked from commit 1d9a2193c9)
2025-02-05 01:03:11 +01:00
Maxim Kartashev
16bb7d0747 JBR-6598 Wayland: window gets un-maximized after switching
When the size of the buffer changes, cancel the frame callback
and make sure that the next surface commit happens with the new buffer.

(cherry picked from commit acb2a54349)
2025-02-05 01:03:11 +01:00
Maxim Kartashev
b50a29e5b5 JBR-6469 Wayland: java/awt/image/ColorModel/DrawCustomColorModel.java throws UnsupportedOperationException
(cherry picked from commit 40da67b44e)
2025-02-05 01:03:11 +01:00
Maxim Kartashev
872bcdbfd8 JBR-6467 Wayland: java/awt/GraphicsConfiguration/NormalizingTransformTest/NormalizingTransformTest.java fails
(cherry picked from commit 14339b83cd)
2025-02-05 01:03:10 +01:00
Maxim Kartashev
c059dc1d1d JBR-6547 WLToolkit: no app icon in GNOME
Allow to associate the application's window with .desktop file with icon
and other info with -Dawt.app.id=... (DBus application name similar to
WM_CLASS in X

(cherry picked from commit 5901915afb)
2025-02-05 01:03:10 +01:00
Maxim Kartashev
aab11b4b39 JBR-6559 Wayland: popups may stop working after a while
Cancel the frame callback when hiding a window.

(cherry picked from commit fd4ba3f752)
2025-02-05 01:03:10 +01:00
Maxim Kartashev
d2916c0fe5 JBR-6452 Wayland: avoid copying entire surface buffers
(cherry picked from commit b13bcec55b)
2025-02-05 01:03:10 +01:00
Maxim Kartashev
4c3826aed5 JBR-6452 Wayland: measure and improve surface buffer management
Improved rendering performance by
* reducing memory copy and making it more efficient,
* tying the next frame display to the frame event from Wayland,
  which dramatically reduces load for very quick Swing apps,
* limiting the number of buffers to 2.

(cherry picked from commit e625eeca1e)
2025-02-05 01:03:10 +01:00
Dmitrii Morskii
3fb610c20b JBR-6372 Wayland:
-correctly positioning SplashScreen on multiple monitors;
-correctly correctly handles cases of SplashScreen with gif with transparent parts;
-refactoring;

(cherry picked from commit 7d750cfbcf)
2025-02-05 01:03:10 +01:00
Alexey Ushakov
00137a1fc2 JBR-6445 Prepare RepaintManager code for displaySync=false
Refactored AWTAccessor code

(cherry picked from commit acbd18f361)
2025-02-05 01:03:10 +01:00
Dmitry Batrak
c99236e0bb JBR-5961 Wayland: can't switch between projects using menu
fix activation not working on Ubuntu 23 (mutter 45.2), after a mouse button has been pressed in the originally active window

(cherry picked from commit 07fa18103e)
2025-02-05 01:03:10 +01:00
Maxim Kartashev
14d9f04011 JBR-6416 Wayland: IDEA maximize button out of sync sometimes
(cherry picked from commit 6122875478)
2025-02-05 01:03:10 +01:00
Maxim Kartashev
659670b25e JBR-6391 Wayland: memory indicator tooltip flickers
(cherry picked from commit e84bddb1ba)
2025-02-05 01:03:10 +01:00
Dmitrii Morskii
688a7f7191 JBR-6213 Wayland: removed blurring on cursor on multiple monitors with different scales
(cherry picked from commit fa7844da7c)
2025-02-05 01:03:10 +01:00
Maxim Kartashev
620921a3e6 JBR-6276 Wayland: WLToolkit logs too much
Changed the logging level for such messages to FINE

(cherry picked from commit e946179554)
2025-02-05 01:03:10 +01:00
Maxim Kartashev
cbd9b2a58b JBR-6316 Wayland: WLSMSurfaceData.getReplacement() throws UOE
Also fixed the keyboard repeat manager so that it does not prevent
application from shutting down.
Also improved fullscreen support.

(cherry picked from commit a36c9604b1)
2025-02-05 01:03:10 +01:00
Maxim Kartashev
cd53b6d90f JBR-6321 Wayland: popup windows do not respect screen bounds
(cherry picked from commit b8b08a36aa)
2025-02-05 01:03:10 +01:00
Maxim Kartashev
310244f580 JBR-6313 Wayland: pasting from clipboard doesn't always work
Also added a flush-to-server command following each Wayland request

(cherry picked from commit 58d2d421e0)
2025-02-05 01:03:09 +01:00
Maxim Kartashev
dfe659da2e JBR-6276 Wayland: WLToolkit logs too much
(cherry picked from commit fee20da837)
2025-02-05 01:03:09 +01:00
Nikita Tsarev
35f0ee8075 JBR-5678: Refactor Wayland keyboard support
(cherry picked from commit 070ec5bb8c)
2025-02-05 01:03:09 +01:00
Dmitrii Morskii
302d935c3f JBR-5965 Wayland: implement SplashScreen
(cherry picked from commit c0247eae4f)
2025-02-05 01:03:09 +01:00
Maxim Kartashev
fd2ec37c51 JBR-6253 Wayland: can't run in weston because of xdg_wm_base version 3
(cherry picked from commit 79ddf65b83)
2025-02-05 01:03:09 +01:00
Maxim Kartashev
ca8abea2b9 JBR-6212 Wayland: app does not terminate upon Wayland protocol error
(cherry picked from commit 5ad4f8a06d)
2025-02-05 01:03:09 +01:00
Maxim Kartashev
3726bc6e6a JBR-6209 Wayland: popup windows cannot be moved
(cherry picked from commit 0aecd427d2)
2025-02-05 01:03:09 +01:00
Maxim Kartashev
c53792178a JBR-5977 Wayland: make undecorated windows natively resizeable
(cherry picked from commit fc735db0dc)
2025-02-05 01:03:09 +01:00
Maxim Kartashev
4d4ed8b07f JBR-6207 Wayland: many popup windows positioned incorrectly
When popup's parent is also its top-level window, use that instead of
null

(cherry picked from commit 47d484b60f)
2025-02-05 01:03:09 +01:00
Maxim Kartashev
91ece342f2 JBR-6183 Wayland: clipboard-related exception in headless environment
(cherry picked from commit e302f472f2)
2025-02-05 01:03:09 +01:00
Nikita Gubarkov
141a404c1e JBR-6144 Build JBR with Vulkan support
1. Update dockerfile to checkout Vulkan headers
2. Fix --with-vulkan-include configure option

(cherry picked from commit 67c8c4dc1a)
2025-02-05 01:03:09 +01:00
Alexey Ushakov
ce6060e7fa JBR-6158 Cannot build jbr21 with wayland toolkit on wsl2
Added --with-wayland-lib option to provide custom library path

(cherry picked from commit cdc2b1b7a0)
2025-02-05 01:03:09 +01:00
Maxim Kartashev
64dc7844ce JBR-5857 Wayland: implement clipboard support
(cherry picked from commit c155acb7f5)
2025-02-05 01:03:09 +01:00
Dmitry Batrak
3fffc08065 JBR-6145 [Wayland toolkit] Popup windows aren't focusable
A partial solution. Cases not still covered:
* Alt+tab from the app and back should keep popup focused if it was focused initially
* Mouse clicks between popup and owner should transfer focus as expected

(cherry picked from commit 903231dc50)
2025-02-05 01:03:09 +01:00
Maxim Kartashev
102a142ca3 JBR-6138 Wayland: utilize gtk_shell1 protocol to mark dialogs as modal
(cherry picked from commit ba60bfa1f4)
2025-02-05 01:03:09 +01:00
Maxim Kartashev
9a3828a689 JBR-6117 Wayland: JVM shutdown hang
(cherry picked from commit 20b2eeb0cc)
2025-02-05 01:03:08 +01:00
Dmitry Batrak
1d181d96c7 JBR-5961 Wayland: can't switch between projects using menu
prevent using a pointer to destroyed surface

(cherry picked from commit ba1b5cec5f)
2025-02-05 01:03:08 +01:00
Dmitry Batrak
d8e88c1c73 JBR-5961 Wayland: can't switch between projects using menu
fix typo

(cherry picked from commit 1ee3c83ef0)
2025-02-05 01:03:08 +01:00
Dmitry Batrak
98d19b2b25 JBR-5961 Wayland: can't switch between projects using menu
support Window.toFront in Wayland toolkit

(cherry picked from commit b42043930f)
2025-02-05 01:03:08 +01:00
Maxim Kartashev
676758b8b2 JBR-6071 Alpine Linux compilation: error: implicit declaration of function 'pthread_getname_np'
(cherry picked from commit 72722dac36)
2025-02-05 01:03:08 +01:00
Maxim Kartashev
33efc6ba16 JBR-5989 Wayland: jdk_awt_wayland test group
(cherry picked from commit 05ad0c35dd)
2025-02-05 01:03:08 +01:00
Maxim Kartashev
1a2c1eb672 JBR-6025 Wayland: miscellaneous small improvements
(cherry picked from commit 9dfeaac204)
2025-02-05 01:03:08 +01:00
Alexey Ushakov
714f0a66de JBR-6045 WLToolkit(Vulkan): Add options to select physical device
Changed access to _name field, minor corrections in verbose print

(cherry picked from commit 36407e978c)
2025-02-05 01:03:08 +01:00
Alexey Ushakov
7a7226e873 JBR-6045 WLToolkit(Vulkan): Add options to select physical device
Implemented -Dsun.java2d.vulkan=True and -Dsun.java2d.vulkan.deviceNumber=n VM options

(cherry picked from commit 7ea0f44a6f)
2025-02-05 01:03:08 +01:00
Maxim Kartashev
a873261d80 JBR-6036 Wayland: Cannot invoke "java.awt.Component.getWidth()" because "popupParent" is null
Not all POPUP Window's have their parent set. And only those who do
shall be treated as popups in the Wayland's sense.

(cherry picked from commit 86080923bb)
2025-02-05 01:03:08 +01:00
Nikita Gubarkov
aad99be49d JBR-5973 Implement rendering of no-AA shapes with Vulkan pipeline
Get rid of maxTextureSize in Vulkan code. This concept was introduced to fix macOS-specific bugs and don't map well to Vulkan implementation, as this value is tied to specific device and texture format, so get rid of it for now and see whether we need it at all.

Refactored native surface data hierarchy. There was a C-style "inheritance" model with VKSDOps having an SurfaceDataOps as its first member and conversions back and forth between them. And then also privOps - pointer to the platform-specific part (WLVK). This was refactored into plain inheritance: SurfaceDataOps -> VKSurfaceData -> VKSwapchainSurfaceData -> WLVKSurfaceData

State management, synchronization & layout transition. Now using dynamic rendering and synchronization2 extensions.
Each device has a single timeline semaphore (basically 64-bit counter), monotonically increasing as device executes our commands, allowing us to track the state of the submitted batches and reuse resources which are no longer in use.

Split command recording into primary and secondary command buffers.
This allows us to record commands "in the past", before current render pass started, which gives possibility for some heavy optimizations:
1. When we suddenly need some texture in the middle of the render pass - no need to stop render pass in order to insert necessary synchronization - we can do it as if we knew it beforehand.
2. When we draw something and then clear the surface - just erase all commands inside current render pass we recorded earlier, so the actual drawing will never happen.

Shaders are compiled with glslc or glslangValidator and bytecode is inlined directly into libawt_wlawt

Memory management via VMA, vertex buffer pool, shader push constants.

Other refactoring.

(cherry picked from commit 9ceaebbb60)
2025-02-05 01:03:08 +01:00
Alexey Ushakov
a710f29d56 JBR-6032 WLToolkit: Uninitialized WLComponentPeer sends paint requests
Protected surfaceAssigned from MT access

(cherry picked from commit e5a3802293)
2025-02-05 01:03:08 +01:00
Alexey Ushakov
78c42832e4 JBR-6032 WLToolkit: Uninitialized WLComponentPeer sends paint requests
Skip sending paint events for not configured peers

(cherry picked from commit 145d6405e4)
2025-02-05 01:03:08 +01:00
Maxim Kartashev
6fa9545ded JBR-5968 Wayland: support PERPIXEL_TRANSLUCENT
(cherry picked from commit 35bb2d2489)
2025-02-05 01:03:08 +01:00
Nikita Tsarev
0da93496ae JBR-5963: Fix RobotKeyboard test and implement getLockingKeyState
(cherry picked from commit 8210596700)
2025-02-05 01:03:07 +01:00
Maxim Kartashev
3092e98436 JBR-5962 Wayland: fix the main event loop to allow for secondary queues
Return READ_RESULT_FINISHED_NO_EVENTS from WLToolkit.readEvents() in
case of poll returning with no new data (i.e. via timeout).

(cherry picked from commit 2b68207e79)
2025-02-05 01:03:07 +01:00
Nikita Tsarev
8b077b43a0 Regenerate wakefield-client-protocol using an older wayland-scanner to temporarily fix build problems
(cherry picked from commit 7310c73a94)
2025-02-05 01:03:07 +01:00
Nikita Tsarev
f67e2611df JBR-5676: Support emulating input events in Wakefield
(cherry picked from commit 6544d9d976)
2025-02-05 01:03:07 +01:00
Nikita Tsarev
17c54cb91f JBR-5900: Fix deadlock when enabling the Wakefield extension
(cherry picked from commit f1712ababd)
2025-02-05 01:03:07 +01:00
Nikita Tsarev
8ef7cdaea1 JBR-5896: Fix WLToolkit being instantiated twice
(cherry picked from commit 1bdfdc275d)
2025-02-05 01:03:07 +01:00
Maxim Kartashev
47266fd897 JBR-5861 Wayland: minimum necessary stubs to run IDEA
(cherry picked from commit d8dbfd7249)
2025-02-05 01:03:07 +01:00
Alexey Ushakov
2ea8fd22d3 JBR-5645 Provide basic classes for Vulkan rendering pipeline
Implemented shared classes for cross-platform vulkan implementation and some support for wayland toolkit

(cherry picked from commit 9ea3d2d0b1)
2025-02-05 01:03:07 +01:00
Maxim Kartashev
7a41216188 JBR-5661 Wayland: implement heavy-weight popup windows
(cherry picked from commit abdfb7231b)
2025-02-05 01:03:07 +01:00
Maxim Kartashev
073a5580c5 JBR-5666 Wayland: WLToolkit doesn't work with weston
Multiple Wayland buffers support.

(cherry picked from commit 4541c118ff)
2025-02-05 01:03:07 +01:00
Maxim Kartashev
294340140f JBR-5658 Wayland: incorrect scaling of window content
The buffer scale is changed atomically with the size.
WLGraphicsConfig made immutable and is re-created when scaling changes.
WLGraphicsDevice is also re-created when its position changes.

(cherry picked from commit 2d0d950d5b)
2025-02-05 01:03:07 +01:00
Maxim Kartashev
856c00d6e4 JBR-5657 Wayland: sometimes there's a deadlock at the start
Don't exit from toolkit initialization until all the necessary
information has been received from the Wayland server.

(cherry picked from commit 453aa66d79)
2025-02-05 01:03:07 +01:00
Maxim Kartashev
7c02a01a2a JBR-5655 java/awt/Toolkit/Wayland/WaylandToolkit.java: WLToolkit not found
WLToolkit made operational in headless mode

(cherry picked from commit 5679e134a7)
2025-02-05 01:03:07 +01:00
Maxim Kartashev
a6df8a107e Wayland: fix AWT initialization on macOS
(cherry picked from commit 382e6c6989)
2025-02-05 01:03:07 +01:00
Maxim Kartashev
80a01a2eb2 Wayland: fixed build errors on macOS
(cherry picked from commit 82fe989dd7)
2025-02-05 01:03:06 +01:00
Maxim Kartashev
58a62136a6 Wayland: fixed build errors with older versions of Wayland
(cherry picked from commit d6150b8c8b)
2025-02-05 01:03:06 +01:00
Alexey Ushakov
1e4b4f8126 Initial version of WLToolkit and Vulkan support
Co-authored-by: Dmitry Batrak <Dmitry.Batrak@jetbrains.com>
Co-authored-by: Nikita Gubarkov <nikita.gubarkov@jetbrains.com>
Co-authored-by: Maxim Kartashev <maxim.kartashev@jetbrains.com>
(cherry picked from commit 2e26de3c45)
2025-02-05 01:03:06 +01:00
Vitaly Provodin
063fa45c29 Update README.md
(cherry picked from commit 49c5e7dd3a)
2025-02-05 01:03:06 +01:00
Vitaly Provodin
45811a85ab JBR-7532 upgrade alpine up to 3.14, specify versions of installing packages, and deploy the latest available jdk20 (same as in jbr21)
(cherry picked from commit 794eab0e1f)
2025-02-05 01:03:06 +01:00
Vitaly Provodin
5de22f71c3 JBR-7456 add regression test checking if implementations of all available the random number generator algorithms can be instantiated, including the default one
(cherry picked from commit 3950e80ba1)
2025-02-05 01:03:06 +01:00
Nikita Tsarev
cda6338d54 JBR-7529: Explicitly check for press-and-hold in performKeyEquivalent
(cherry picked from commit 9fadadf039)
2025-02-05 01:03:06 +01:00
Vitaly Provodin
0afaea59a5 JBR-7517 build JBR artefacts with CDS archives
(cherry picked from commit 0b5462b3ec)
2025-02-05 01:03:06 +01:00
Vitaly Provodin
d890190fc7 Update README.md
(cherry picked from commit d27df085c7)
2025-02-05 01:03:06 +01:00
bourgesl
e49cf8b741 JBR-7460: fixed (macos) MTLTexturePool GC implementation: minor syntax updates from JBR-7461
(cherry picked from commit 713162c6b5)
2025-02-05 01:03:06 +01:00
Nikita Tsarev
08feb34296 JBR-7426: Fix cancelling press-and-hold causing some future key events being swallowed
(cherry picked from commit a07d5e4a60)
2025-02-05 01:03:06 +01:00
bourgesl
edb2ab2a2e JBR-7460: fixed (macos) MTLTexturePool GC implementation to release texture memory more promptly (regular young GC freeing not reused textures since 15s) + unified API with new generic AccelTexturePool (C) to be shared with the coming vulkan pipeline (linux)
(cherry picked from commit ea12ccdf5e)
2025-02-05 01:03:06 +01:00
Dmitrii Morskii
744e8f1f6d JBR-6772 handled case with adding new timers after VM was suspended
(cherry picked from commit 1dd81b186b)
2025-02-05 01:03:06 +01:00
Maxim Kartashёv
c58ce0b966 JBR-5956 Provide more details on assertion failure
Use JNU_RUNTIME_ASSERT(env, cond, msg) defined in jni_util.h
to crash JVM when 'cond' is not true with the given message
and source location information in the fatal error log.

(cherry picked from commit fd9bf2c37a)
2025-02-05 01:03:06 +01:00
Sergey Shelomentsev
e809bc57f1 Update jbr-api version to 1.0.2
(cherry picked from commit 9c4a2ac50a)
2025-02-05 01:03:05 +01:00
Stanislav Dombrovsky
8e8e5544fc Fix rendering of HTML list dots + better vertical align for them.
(cherry picked from commit fa4a404533ba1ef638fe523adc74391aee8a3ebf)

(cherry picked from commit 9f079c66e9)
(cherry picked from commit baf2f0b73f)
2025-02-05 01:03:05 +01:00
Nikita Tsarev
6020864717 JBR-6588: JBR API for inspecting certain properties of KeyEvents
(cherry picked from commit cf2abf34d7)
2025-02-05 01:03:05 +01:00
Nikita Tsarev
28a58c8285 JBR-7449: Fix press-and-hold cancel keys not being swallowed by JBR
(cherry picked from commit a0dbdff2b0)
2025-02-05 01:03:05 +01:00
Dmitrii Morskii
ae5a5b8c4e JBR-7438 tune updateCursorImmediately method
(cherry picked from commit 49b1001c2c)
2025-02-05 01:03:05 +01:00
Alexey Ushakov
1de71fd154 JBR-6545 java/awt/Mixing/AWT_Mixing/JProgressPaneOverlapping.java fails by time out (sun.java2d.metal.MTLLayer.blitTexture)
Moved test frame by some offset to avoid interaction with mac menu bar

(cherry picked from commit 7d3688ab93)
2025-02-05 01:03:05 +01:00
Artem Bochkarev
a4d35593c7 JBR-5405: supported BufImgSurfaceData
(cherry picked from commit 3c2d26f834)
2025-02-05 01:03:05 +01:00
Maxim Kartashev
6b5e4e098e JBR-6830 Poor performance with KDE Plasma 6 X11
Use -Dwatch.desktop.geometry=false as a workaround until the KWin issue
is fixed

(cherry picked from commit d90f0e524b)
2025-02-05 01:03:05 +01:00
Artem Bochkarev
3dab586fd6 JBR-4430 Fixed execution permissions on Linux
(cherry picked from commit f3896017f0)
2025-02-05 01:03:05 +01:00
Vitaly Provodin
89319da074 update exclude list on results of 21.0.3_b517.1 test runs
(cherry picked from commit 88a92ef655)
2025-02-05 01:03:05 +01:00
Vitaly Provodin
7e7649fd3c Update README.md
(cherry picked from commit 4d2ddff1f8)
2025-02-05 01:03:05 +01:00
bourgesl
f8e324a55b JBR-4530: make opengl & metal handle colorMatching on non-SRGB profile consistently (controlled by the system property 'sun.java2d.osx.colorMatching') + updated MacOSLayerColorTest to test color matching setting on OpenGL & Metal pipelines
(cherry picked from commit 2db47e604e)
2025-02-05 01:03:05 +01:00
Vitaly Provodin
94acb555f7 Update README.md
(cherry picked from commit 2edeae7740)
2025-02-05 01:03:05 +01:00
Vitaly Provodin
7fefcf37f3 JBR-6696: fix drawableId usage + revert PrinterJob changes (non-appkit thread)
(cherry picked from commit 5229c513e3)
2025-02-05 01:03:05 +01:00
Vitaly Provodin
e441b53756 Update README.md
(cherry picked from commit c6583bd7fc)
2025-02-05 01:03:05 +01:00
Vitaly Provodin
64985d6589 Update README.md
(cherry picked from commit db562b31b0)
2025-02-05 01:03:04 +01:00
bourgesl
043c88d410 JBR-6696: added MTLContext CVDisplayLink checks, improved MTLLayer drawable lifecycle, hardened appkit main thread usage with ThreadUtilities instrumentation to monitor all performOnMainThread usages and report high latency tasks in LWCToolkit platform logger (use system property 'sun.awt.mac.mainThreadLatency=xx' in milliseconds), fixed few MainThread violations (PrinterView init)
(cherry picked from commit 975b4b8cc9)
2025-02-05 01:03:04 +01:00
Alexey Ushakov
d34c8ae24d JBR-5063 macOS: SIGILL at [libsystem_kernel] __kill in java.lang.IllegalStateException: Error - unable to initialize Metal after recreation of graphics device. Cannot load metal library...
Add fallback to MTLCreateSystemDefaultDevice for main display

(cherry picked from commit e523e30250)
2025-02-05 01:03:04 +01:00
Nikita Tsarev
1dbb382c06 JBR-6764: Add null check on hostAdapterLocator
(cherry picked from commit 7396316337)
2025-02-05 01:03:04 +01:00
Sergey Shelomentsev
cde8adffff JBR-4912 test moved from JBR repository
(cherry picked from commit 4732942427)
2025-02-05 01:03:04 +01:00
Nikita Provotorov
17c8ef1bc5 JBR-7157: Alt+Shift+Enter sends KEY_TYPED Event.
JBR-7336 Any keyboard shortcut with Alt produces a Windows system sound.

* X11 Linux part: disable posting KEY_TYPED events for VK_ENTER if any modifier except { Shift, Control, Lock, Mode Switch (a.k.a. AltGr), NumLock } is being pressed.
* Windows part: begin ignoring WM_SYSCHAR messages as MSDN instructs.
* Add a regression test.

(cherry picked from commit d732718ef7)
2025-02-05 01:03:04 +01:00
Nikita Tsarev
558b18f7c8 JBR-6764: Work around IMEs breaking on macOS due to macOS JavaRuntimeSupport not reporting the correct locale in IMEs once after application startup
(cherry picked from commit d982095f1c)
2025-02-05 01:03:04 +01:00
Vitaly Provodin
a0a0996a3e Update README.md
(cherry picked from commit ca6ad3d091)
2025-02-05 01:03:04 +01:00
Artem Bochkarev
32451b08bc JBR-5405: implementation of direct raster loading for VolatileImage
(cherry picked from commit d963035445)
2025-02-05 01:03:04 +01:00
Vitaly Provodin
ae4a12bf1a update exclude list on results of 21.0.3_b479 test runs
(cherry picked from commit 3c65d18f2e)
2025-02-05 01:03:04 +01:00
Vitaly Provodin
31fb8e9a39 fixup! JBR-7263 introduce /othervm for the tests specifying -Djetbrains.runtime.api.extendRegistry=true
(cherry picked from commit b85f46318a)
2025-02-05 01:03:04 +01:00
bourgesl
b1f6fd9a53 JBR-7170: fixed NPE if peer is null
(cherry picked from commit a786741193)
2025-02-05 01:03:04 +01:00
Sergey Shelomentsev
3b4c579e27 Set jbr-api version to 1.0.0
(cherry picked from commit fa825aee1d)
2025-02-05 01:03:04 +01:00
Nikita Tsarev
c9830a4fb3 JBR-7133: JBR API for IME replacement range on macOS
(cherry picked from commit b807d0f946)
2025-02-05 01:03:04 +01:00
Vitaly Provodin
df66f68b3f update exclude lists removing lines related to fixed issues
(cherry picked from commit 4526475115)
2025-02-05 01:03:03 +01:00
Vitaly Provodin
e1ee1e507c Update README.md
(cherry picked from commit 48e2248486)
2025-02-05 01:03:03 +01:00
Maxim Kartashev
6c157f1254 JBR-5761 Make error printing more robust during early stages of VM initialization
(cherry picked from commit 84d95894e4)
2025-02-05 01:03:03 +01:00
bourgesl
0edfbdc003 JBR-7170: added explicit @available for addPresentedHandler()
(cherry picked from commit 7973a4cff4)
2025-02-05 01:03:03 +01:00
bourgesl
45ae2649b9 JBR-7170: implement FPS counters for metal using callbacks from MTLLayer presentHandler
(cherry picked from commit cf06dcc383)
2025-02-05 01:03:03 +01:00
Nikita Gubarkov
d8d326e5f2 JBR-5615 add sun.java2d.logDisplays VM option
It prints to stdout whenever display configuration is changed.

(cherry picked from commit 8eec3188c6)
2025-02-05 01:03:03 +01:00
Nikita Gubarkov
acbb682990 JBR-6357 JBR API v3
JBR API frontend is moved into a separate repository.
Rewritten proxy generation, bridges removed, invokedynamic is used instead.
Mapping is now specified using annotations.
Support for extension methods.
Support for arrays and generics.
Added JBR API implementation version.

JBR-7232 Refactor deriveFontWithFeatures & JBRFileDialog JBR API

(cherry picked from commit a4804efa96)
2025-02-05 01:03:03 +01:00
Roman Shevchenko
f017ca086a JBR-7194: extension-based filters in native file dialogs
(cherry picked from commit cf5d136b3e)
2025-02-05 01:03:03 +01:00
Nikita Tsarev
481d18acf2 JBR-7134: Fix InputMethodTests on macOS
(cherry picked from commit 7a970238af)
2025-02-05 01:03:03 +01:00
Vitaly Provodin
2d90892e19 Update README.md
(cherry picked from commit 6514818b3b)
2025-02-05 01:03:03 +01:00
Dmitrii Morskii
841b9ac9a5 JBR-7128 Use the correct WmSize event type for JFrame moved to another monitor
author: Sergei Tachenov
(cherry picked from commit 01f1c7e15d)
2025-02-05 01:03:03 +01:00
Vitaly Provodin
44d99ea7cc Update README.md
(cherry picked from commit 6242827cd1)
2025-02-05 01:03:03 +01:00
Vitaly Provodin
f174febd6a update exclude list on results of 21.0.3_b453.2 test runs
(cherry picked from commit 1bc34d2a51)
2025-02-05 01:03:03 +01:00
Sergey Shelomentsev
8d9d7ecdd3 JBR-7117 Set initial display mode after test execution
(cherry picked from commit e4530745c2)
2025-02-05 01:03:03 +01:00
Vitaly Provodin
e88e54df7e Update README.md
(cherry picked from commit 0e705dc638)
2025-02-05 01:03:02 +01:00
Maxim Kartashev
7d10777c0e JBR-7028 Implement FPS counter on Linux
Use -Dawt.window.counters to enable.
To output counters per second to stdout/stderr,
use -Dawt.window.counters=stdout or =stderr.

A counter by the name swing.RepaintManager.updateWindows
is always available for Swing applications, but it does not
accurately correspond to frames per second.

Toolkit-dependent counters provide much better accuracy.
On Wayland with memory buffers as the backend two are available:
java2d.native.frames - frames delivered to the Wayland server
java2d.native.framesDropped - fully formed frames that were not
delivered to the Wayland server

(cherry picked from commit 872e73ed1e)
2025-02-05 01:03:02 +01:00
Vitaly Provodin
978b0cb368 Update README.md
(cherry picked from commit 9ace20e1e1)
2025-02-05 01:03:02 +01:00
Dmitry Drobotov
3ad9461514 JBR-6808 Don't create AccessibleJTreeNode for the tree root if it's not visible
* This fixes an issue with AccessibleJTreeNode#getBounds, which adjusts the node's bounds according to the parent node. For nodes whose parent is the invisible root, getBounds was returning null, and it caused issues with assistive technology like macOS Accessibility Zoom.
* Additionally, NVDA will now report correct tree depth levels because the root node won't add to the levels count (JDK-8249806).

(cherry picked from commit f7c47bf3cf)
(cherry picked from commit e785e9e7c9)
2025-02-05 01:03:02 +01:00
Vitaly Provodin
54c37eccbe Update README.md
(cherry picked from commit a66b19eb93)
2025-02-05 01:03:02 +01:00
Vitaly Provodin
25659dd7ef Update README.md
(cherry picked from commit 68a09733c8)
2025-02-05 01:03:02 +01:00
Vitaly Provodin
b5139b4473 update exclude list on results of 21.0.3_b446.1 test runs
(cherry picked from commit a0edd1e725)
2025-02-05 01:03:02 +01:00
Nikita Provotorov
f05c9c5cc8 JBR-6456 Sudden keyboard death on Linux using iBus.
Add a workaround for the iBus's bug which leads to the issue.

(cherry picked from commit b8e9dbf8c9)
(cherry picked from commit 7355948065)
2025-02-05 01:03:02 +01:00
Nikita Tsarev
0438808489 JBR-7119: respect replacementRange in IME events on macOS
(cherry picked from commit 09c31a6242)
2025-02-05 01:03:02 +01:00
Dmitrii Morskii
87ba9228d2 JBR-6376: implement detecting of OS theme on linux
(cherry picked from commit d8aaa3da47)
2025-02-05 01:03:02 +01:00
Dmitrii Morskii
2d1dfb6666 Revert "JBR-6372: implement detecting of OS theme on linux"
This reverts commit a657e4e2cbce139f2c5b53c7fb5f30d81f99e311.

(cherry picked from commit c626c9f220)
2025-02-05 01:03:02 +01:00
Nikita Gubarkov
54f3ad4b0b JBR-7046 Tolerate subpixelResolution=0 in Metal and OGL
(cherry picked from commit 28d0f00899)
2025-02-05 01:03:02 +01:00
Maxim Kartashev
0962202098 JBR-5611 Window header is visible but body not on Linux Ubuntu with external display
(cherry picked from commit 96494dd000)
2025-02-05 01:03:02 +01:00
Nikita Gubarkov
b0b20e15de JBR-7020 Reorder LCD glyph cache freeing and validation
1. As we started committing the command buffer on glyph cache flush, this invalidates the current encoder. We need to `MTLTR_ValidateGlyphCache` after the flush, not before.
2. There's no reason to maintain separate glyph cache invalidation logic for this singe case (which is a no-op in reality), so just free the cache instead.

(cherry picked from commit 891a9c6c52)
2025-02-05 01:03:02 +01:00
Nikita Tsarev
450d310dff Disable flappy KeyCodesTest assertions, see JBR-6888
(cherry picked from commit 7f5dd368e3)
2025-02-05 01:03:02 +01:00
Sergei Tachenov
1f8e1cd8b0 JBR-6984 Fix BoxLayout/NPECheckRequests test
It was initially written and tested on Linux, but it turns out that
on other systems validate() can be called in between init() and start()
calls, which would break the test even though BoxLayout isn't broken.

(cherry picked from commit 6cc237583b)
2025-02-05 01:03:01 +01:00
Ajit Ghaisas
6edf9799e4 update exclude list on results of main.2176 test runs
(cherry picked from commit 82a97445bd)
2025-02-05 01:03:01 +01:00
Vitaly Provodin
25314386ce introduce jbMuslProblemList.txt exclude list
(cherry picked from commit 17c6238051)
2025-02-05 01:03:01 +01:00
Vitaly Provodin
1c937605f3 update exclude list on results of 21.0.2_b427.6 test runs
(cherry picked from commit e768c854cf)
2025-02-05 01:03:01 +01:00
Sergei Tachenov
d4d5a507f4 JBR-6771 BoxLayout throws mysterious NPEs due to previous exceptions
The checkRequests method only does layout initialization
if it isn't initialized already. However, when an exception
is thrown during the initialization, the layout may end up
in a half-initialized state.

Fix this by using the field that is initialized the last to check
if the layout is initialized. If that field is null, it may mean
that the layout isn't initialized or that the last attempt
failed midway. Then we try again. This attempt can,
of course, break for the same reason as the previous one,
but in that case we'll at least get a stack trace pointing
to a real cause of the error and not some mysterious NPE
that seems to be impossible from the logic.

The bug is that if we add a component that throws an exception
in one of its methods called by BoxLayout, then the layout may
end up in a half-initialized state that would mistakenly be considered
fully initialized. Then it would try to access some fields
and throw NPE with a stack trace that tells exactly nothing
about what went wrong and where.

This test checks for the presence of this bug by adding a broken
component to a BoxLayout and then un-breaking this component
and checking that an exception is thrown even though the component
is no longer broken.

(cherry picked from commit 8f5eb72836)
2025-02-05 01:03:01 +01:00
Maxim Kartashev
607c8b0696 JBR-6769 Make it possible to get info whether IDE is running in a virtual env
Added system property intellij.os.virtualization with possible values
"none", "Xen", "KVM", "VMWare", "HyperV"

(cherry picked from commit 92e4311f13)
2025-02-05 01:03:01 +01:00
Nikita Gubarkov
cc0c596c67 JBR-6927 Safe asynchronous destruction of Metal graphics config.
(cherry picked from commit eee433fe5e)
2025-02-05 01:03:01 +01:00
Nikita Gubarkov
6f7416c522 Fix Windows AWT compilation errors
Frame, Window, FileDialog, CustomTitleBar

(cherry picked from commit 2ada4a575b)
2025-02-05 01:03:01 +01:00
Vitaly Provodin
9679524b5d Update README.md
(cherry picked from commit 0ea55b1641)
2025-02-05 01:03:01 +01:00
Vitaly Provodin
bb0bf8e679 JBR-6639 Docker images for JBR/JCEF testing
(cherry picked from commit 1342899218)
2025-02-05 01:03:01 +01:00
Vitaly Provodin
aa3eb05937 JBR-6915 add the option -w into mkimages scripts
(cherry picked from commit 56bb878275)
2025-02-05 01:03:01 +01:00
Alexey Ushakov
8d726ef33c JBR-6911 IDE crashes (EXC_BAD_ACCESS) after disconnecting the secondary display if a markdown file is opened (macOS Sonoma 14.4.1)
Corrected invalid usage of dealloc method, fixed memory leaks.

(cherry picked from commit 8697cfb660)
2025-02-05 01:03:01 +01:00
Dmitrii Morskii
01e04e052b JBR-6171 removing deadlock related to calling getCurrentServerTime
(cherry picked from commit 5fa4617d38)
2025-02-05 01:03:01 +01:00
Maxim Kartashev
40e6379291 JBR-6847 Improve locking performance on Windows
Use -XX:+UnlockExperimentalVMOptions -XX:-UseCriticalSection
to revert to the old behavior

(cherry picked from commit 72ffacf34a)
2025-02-05 01:03:01 +01:00
Vitaly Provodin
5765893d8f update exclude list on results of 21.0.2_b417.1 test runs
(cherry picked from commit b77ac8db98)
2025-02-05 01:03:00 +01:00
Dmitrii Morskii
132819aeae JBR-6372: implement detecting of OS theme on linux
(cherry picked from commit 1d47383016)
2025-02-05 01:03:00 +01:00
Vitaly Provodin
7b7b4429e5 JBR-1668: minor fixes - temporary fix for compilation issue SystemHotkey.m:74:29: error: format string is not a string literal
(cherry picked from commit b6234f5aa7)
2025-02-05 01:03:00 +01:00
Nikita Gubarkov
d09b4240f0 JBR-6723 Deal with integer overflow in DrawGlyphList with enabled subpixelResolution
(cherry picked from commit 8b34ae396c)
2025-02-05 01:03:00 +01:00
Vitaly Provodin
6d1a23980f Update README.md
(cherry picked from commit bdae8e43fb)
2025-02-05 01:03:00 +01:00
Nikita Provotorov
8f7ca506a1 JBR-3112 Linux: Last character issue with Korean.
- Ignores the IM text returned from XmbLookupString/XwcLookupString if the KeyPress event which XmbResetIC was called with was synthetic and the first after a call of XmbResetIC/XwcResetIC.
- Only for the new mode introduced in JBR-2460 (-Djb.awt.newXimClient.preferBelowTheSpot=true): cancel text composing on each mouse press, so that preedit text stops following the caret if it's moving in response to mouse clicks.

(cherry picked from commit 43a9a3a17a)
(cherry picked from commit 156e5d9b65)
(cherry picked from commit 59f0ca804f)
2025-02-05 01:03:00 +01:00
Dmitrii Morskii
35c8d2c7d4 JBR-6541 Added ability to get supported features and stylistic sets for font
(cherry picked from commit 170e743a13)
2025-02-05 01:03:00 +01:00
Nikita Tsarev
1b31696bd5 increase delay in InputMethodTest
(cherry picked from commit 8048ea52f7)
2025-02-05 01:03:00 +01:00
Nikita Tsarev
15fdd36be9 JBR-6704: Fix extra IME events when a ctrl shortcut causes window focus switch [macOS]
(cherry picked from commit 4d851790cd)
2025-02-05 01:03:00 +01:00
Nikita Tsarev
df746071a1 JBR-6331: Fix some memory safety issues in macOS keyboards
(cherry picked from commit 0f9ba8771f)
2025-02-05 01:03:00 +01:00
Nikita Tsarev
20f749f967 JBR-6028: Check before attempting to switch to a layout that might not exist in KeyCodesTest
(cherry picked from commit 421dd1fa69)
2025-02-05 01:03:00 +01:00
Nikita Tsarev
305e3c7d77 InputMethodTest: fix certain IMEs not being added properly
(cherry picked from commit 621a5e37d6)
2025-02-05 01:03:00 +01:00
Nikita Tsarev
2c2f7f249d JBR-5379: Ignore input events only on permament focus loss
(cherry picked from commit ca8aebd211)
2025-02-05 01:03:00 +01:00
Nikita Tsarev
9b9cd71b62 JBR-5630: vmoption to change dead key reporting behavior on macOS
(cherry picked from commit aeb6569d4c)
2025-02-05 01:03:00 +01:00
Nikita Tsarev
20962b9a86 JBR-5469: Fix NextAppWinKey behavior with certain keys
(cherry picked from commit 9a1d6d1813)
2025-02-05 01:03:00 +01:00
Nikita Tsarev
54c286c6ea JBR-5558: macOS keyboard rewrite 2
(cherry picked from commit 81f3819f4e)
2025-02-05 01:02:59 +01:00
Nikita Tsarev
bf1c63abf2 JBR-5295: Fix wrong keycodes for non-letter keys that lack a corresponding VK_ constant on macOS
(cherry picked from commit 3c42e56d93)
2025-02-05 01:02:59 +01:00
Nikita Tsarev
86695c2fcb JBR-5254: Fix Caps Lock not working properly on certain Chinese IMs
with fix for JBR-5300 Change source code and test files to use GPL license

(cherry picked from commit be64a4f3d0)
2025-02-05 01:02:59 +01:00
Nikita Tsarev
e4b935eb0d Revert "8230926: [macosx] Two apostrophes are entered instead of one with "U.S. International - PC" layout"
This reverts commit 5049cad2b0.

After JBR-5173 this workaround is no longer necessary

(cherry picked from commit fbb7ba8c0b)
2025-02-05 01:02:59 +01:00
Nikita Tsarev
9f6768d3b5 JBR-5233 Setup/teardown necessary keyboard layouts in macOS keyboard tests
(cherry picked from commit 1fa48463f2)
2025-02-05 01:02:59 +01:00
Nikita Tsarev
ecb8c01c94 JBR-5173 macOS keyboard support rewrite
with fix for JBR-5300 Change source code and test files to use GPL license

(cherry picked from commit 88c281a243)
2025-02-05 01:02:59 +01:00
Nikita Tsarev
92c050658b Revert "macOS national keyboard support"
This reverts commit 21bffd06bc.

(cherry picked from commit 7806ef7ff3)
2025-02-05 01:02:59 +01:00
Nikita Provotorov
e2236538c7 JBR-5107, JBR-5114: SIGILL/OOM from Java_sun_lwawt_macosx_LWCToolkit_getKeyboardLayoutNativeId.
A theoretical fix, it should:
- Catch any NSException (as it was initially expected);
- Probably fix possible memory leaks (by moving the layoutId var inside autoreleasepool).

(cherry picked from commit ae9520ce4f)
2025-02-05 01:02:59 +01:00
Nikita Tsarev
70201ceff9 JBR-4990: Undo changes to ExtendedKeyCodes
(cherry picked from commit 823086623e)
2025-02-05 01:02:59 +01:00
Nikita Tsarev
eaf5c2fee3 JBR-3860: Fix shortcut behavior when Shift is the only modifier
(cherry picked from commit e419730031)
2025-02-05 01:02:59 +01:00
Nikita Tsarev
c56588850d JBR-4990: Fix regression tests for national keyboard layouts on macOS
(cherry picked from commit 5835150f63)
2025-02-05 01:02:59 +01:00
Vitaly Provodin
a0b8948753 update exclude list on results of 21.0.2_b393.7 test runs
(cherry picked from commit a396e62035)
2025-02-05 01:02:59 +01:00
Nikita Gubarkov
4c5d2c6761 JBR-6723 flush vertex cache and command buffer before freeing glyph cache. (#334)
(cherry picked from commit 1faccf3995)
2025-02-05 01:02:59 +01:00
Alexey Ushakov
9cd8855de4 JBR-6785 wsl: update build scripts for linux target
Added explicit platform target

(cherry picked from commit 3b96e66202)
2025-02-05 01:02:59 +01:00
Vitaly Provodin
31d9ea4d13 Update README.md
(cherry picked from commit 74b00b6c2f)
2025-02-05 01:02:58 +01:00
Vitaly Provodin
21cdb10629 Update README.md
(cherry picked from commit 163ce4ecce)
2025-02-05 01:02:58 +01:00
Maxim Kartashev
cc2f30f661 JBR-6742 Record resident set size in JVM fatal error log
(cherry picked from commit 5cc72b464b)
2025-02-05 01:02:58 +01:00
Alexey Ushakov
2236469809 JBR-6522 macOS: SIGSEGV at [libawt_lwawt.dylib+0x8eaa8] MTLGC_DestroyMTLGraphicsConfig
Fix of MT access to shared data in MTLGraphicsConfigInfo

(cherry picked from commit ecc46c6004)
2025-02-05 01:02:58 +01:00
Dmitry Drobotov
49b430ec9d JBR-6593 Fix UI freezes with JAWS announcements
* Execute AccessibleAnnouncer.nativeAnnounce on a background thread on Windows to fix UI freezes. IntelliJ calls this method from EDT, but it doesn't need to run on EDT because on Windows it simply calls screen readers API without interacting with UI components. Additionally, when using a background thread, the JAWS SayString method, which previously could have been running for multiple seconds, is now executed immediately as expected, but the root cause of previous delays is unclear.
* In JawsAnnouncer, initialize COM library with the multithreaded model to allow executing it from different threads. Now COM is initialized and uninitialized on every call of the method as required by the [documentation](https://learn.microsoft.com/en-us/windows/win32/learnwin32/initializing-the-com-library): "Each thread that uses a COM interface must make a separate call to this function. For every successful call to CoInitializeEx, you must call CoUninitialize before the thread exits". IJawsApi COM object is still static and reused by different threads, which is allowed with a multithreaded concurrency model. It shouldn't cause issues because it has no state and only forwards calls to JAWS.

(cherry picked from commit 8cc4cd5cfd)
(cherry picked from commit d7d8d9b8e4)
(cherry picked from commit 8bfd24f89f)
2025-02-05 01:02:58 +01:00
Vitaly Provodin
c6cbf6e9e0 update exclude list linux-x86 failures
(cherry picked from commit 264bcf41f9)
2025-02-05 01:02:58 +01:00
Vitaly Provodin
49ab0f1b0c update exclude list on results of 22_b2075 test runs
(cherry picked from commit 37a71238b2)
2025-02-05 01:02:58 +01:00
Vitaly Provodin
b42b739efe update exclude list - remove failures no having tickets
(cherry picked from commit 4d11023858)
2025-02-05 01:02:58 +01:00
Nikita Provotorov
c8e301c9be JBR-3697: Letter-based command mode actions are not triggered when using Chinese input method.
Fixes different platform-specific issues with disabling/enabling input methods support via java.awt.Component#enableInputMethods(boolean):
* Windows: disabling used to require to deactivate and then activate back the app window to be performed completely ;
* macOS: disabling used to leave the input method window visible (however, it wasn't affecting the input) ;
* Linux: with fcitx5 IMF (may not be reproduced with iBus) disabling and then enabling back the input method support used to reset the used input source (keyboard layout) to a default one. It's done via disabling the current XIM when the input method support is disabled instead of disposing it .

(cherry picked from commit 2933ea89f0)

The patch also contains the fix for "JBR-6711: java/awt/LightweightDispatcher/LWDispatcherMemoryLeakTest.java: JButton JPanel not collected."

It unsets its references to tracked components thus not preventing GC from collecting them.

(cherry picked from commit e9aab98a6c)
(cherry picked from commit 13284aa508)
2025-02-05 01:02:58 +01:00
Dmitry Drobotov
523ad1632a JBR-6325 Implement keyboard focus tracking for macOS Accessibility Zoom
* Call UAZoomChangeFocus function when the keyboard focus is changed or when an accessible selection event is fired. Zoom viewport fill follow the accessible frame of the newly focused component, and if it has a selected child, its frame will be passed as part that needs to be highlighted.
* Fix an exception in ComboBoxAccessibility.accessibilitySelectedChildren when its selection is nil. This happens when a combo box doesn't have a selected item, and it this case Zoom wouldn't be able to follow the combo box location.
* Move the native handler of CAccessibility.focusChanged method from the legacy JavaComponentAccessibility to the new CommonComponentAccessibility class. It calls a class method (like a static method in Java), so there is no difference in which specific class it's located, but it allows to write the new code in the appropriate class.

(cherry picked from commit 75b06421ff)
(cherry picked from commit d0f47ced65)
2025-02-05 01:02:58 +01:00
Vitaly Provodin
99a4f244f7 Update README.md
(cherry picked from commit b93b6a39fc)
2025-02-05 01:02:58 +01:00
Dmitrii Morskii
9078fb271e JBR-5500 Handled situation of processing WM_ENDSESSION in process of closing application
(cherry picked from commit c87b70ad46)
2025-02-05 01:02:58 +01:00
Vitaly Provodin
d935557924 Update README.md
(cherry picked from commit 588d57f140)
2025-02-05 01:02:58 +01:00
Dmitry Drobotov
96d468e95e JBR-6472 Add default value in CAccessibility.isComboBoxEditable to avoid NPE
(cherry picked from commit 93937603b3)
(cherry picked from commit 6a70aebb6b)
2025-02-05 01:02:58 +01:00
Alexey Ushakov
0cadeff5d0 JBR-6612 Provide standard scripts for performance measurements
run_rp.sh - additional checks

(cherry picked from commit e1cf099c09)
2025-02-05 01:02:58 +01:00
Maxim Kartashev
c28da3e4b1 JBR-6246 Do not overwrite CDS archives after created with jlink
(cherry picked from commit 457e760872)
2025-02-05 01:02:57 +01:00
Alexey Ushakov
4d0fe34ad3 JBR-6612 Provide standard scripts for performance measurements
Initial implementation for linux and macOS

(cherry picked from commit fe09bf671b)
2025-02-05 01:02:57 +01:00
Nikita Tsarev
dd6d8b375f JBR-6297: Don't check for NSInputManager wantsToHandleMouseEvents in mouseDown by default
(cherry picked from commit c08268def6)
2025-02-05 01:02:57 +01:00
Maxim Kartashev
7896f20270 Update README.md with up-to-date build instructions
(cherry picked from commit 695d0a0577)
2025-02-05 01:02:57 +01:00
Vitaly Provodin
4226d4cfb4 Update README.md
(cherry picked from commit 22f4dd6d4a)
2025-02-05 01:02:57 +01:00
Vitaly Provodin
dfc918666f Update README.md
(cherry picked from commit c6cc4d76c1)
2025-02-05 01:02:57 +01:00
Alexey Ushakov
45eef9a80f JBR-6522 macOS: SIGSEGV at [libawt_lwawt.dylib+0x8eaa8] MTLGC_DestroyMTLGraphicsConfig
Performing flush of pending rendering operation before destroying MTLGraphicsConfig

(cherry picked from commit b25bd3ac13)
2025-02-05 01:02:57 +01:00
Nikita Gubarkov
6f7db65fe6 JBR-4618 Force window size update after display reconfiguration
- Re-create all GraphicsDevices on displayChanged()

(cherry picked from commit a59d4903b2)
2025-02-05 01:02:57 +01:00
Dmitrii Morskii
8a408bb72d JBR-6671 added option 'freetype.font.rendering'
(cherry picked from commit a24c5bbcdb)
2025-02-05 01:02:57 +01:00
Dmitrii Morskii
0c43b6973a Revert "JBR-6346 update Inter font version"
This reverts commit 7712e529330674b83e39c8e81701db32436d42dc.

(cherry picked from commit 1752433479)
2025-02-05 01:02:57 +01:00
bourgesl
37fc64f014 Revert "JBR-6522: ensure thread-safety in MTLGC_DestroyMTLGraphicsConfig (pthread_mutex_t)"
This reverts commit e7e3638c52.

(cherry picked from commit a2ee33a45a)
2025-02-05 01:02:57 +01:00
bourgesl
9a6d17a6e4 JBR-6522: ensure thread-safety in MTLGC_DestroyMTLGraphicsConfig (pthread_mutex_t)
(cherry picked from commit 3ddc59a433)
2025-02-05 01:02:57 +01:00
Vitaly Provodin
b12e7ab475 JBR-6649 add synchronization for creating UI
(cherry picked from commit 9618df8e14)
2025-02-05 01:02:57 +01:00
Nikita Gubarkov
68f9a06cbc JBR-6651 Exclude keycap emoji from EmojiVariation test.
(cherry picked from commit bb1926d974)
2025-02-05 01:02:57 +01:00
Vitaly Provodin
e02311f5ac update exclude list on results of 22_b2014 test runs
(cherry picked from commit 99eb375cfd)
2025-02-05 01:02:56 +01:00
Vitaly Provodin
e0372e21ae JBR-6620 restore displayMode to the state that was before running the test
(cherry picked from commit 285d3d3860)
2025-02-05 01:02:56 +01:00
Dmitrii Morskii
82bf7eccdb JBR-6346 update Inter font version
(cherry picked from commit 30820c33ba)
2025-02-05 01:02:56 +01:00
Vitaly Provodin
6833397d24 Update README.md
(cherry picked from commit 4fef254b44)
2025-02-05 01:02:56 +01:00
Vitaly Provodin
bd7527aee2 remove resolved issues from exclude list
(cherry picked from commit 1bdef4e67a)
2025-02-05 01:02:56 +01:00
Vitaly Provodin
12a2738b84 Update README.md
(cherry picked from commit 888e8bda45)
2025-02-05 01:02:56 +01:00
Dmitrii Morskii
45b01f5c38 JBR-6604 supported case when fonts directory is missing
(cherry picked from commit a622888816)
2025-02-05 01:02:56 +01:00
Aleksey Shipilev
7a612985e3 update exclude list on results of main.2003 test runs
(cherry picked from commit 2f441c0a3b)
2025-02-05 01:02:56 +01:00
Vitaly Provodin
10e438f5f1 JBR-6591 specify values for the configure options --with-vendor-url and --with-vendor-bug-url
(cherry picked from commit b7f236be6b)
2025-02-05 01:02:56 +01:00
Maxim Kartashev
cc015855b1 JBR-4173 Tier1 test failures in jdk/javadoc/doclet/testModules
Introduction of JBR API changed the order of modules appearing in Java
Doc. This commit updates the corresponding tests to match the current
output with JBR API.

(cherry picked from commit 939184e2a6)
2025-02-05 01:02:56 +01:00
Dmitry Batrak
8dddeb519b JBR-6449 Introduce FontMetricsAccessor into JBR API
JBRE-MR-368

(cherry picked from commits f0d5a907ac, 5befaea6af, ea2c4bfc83, 04601189604827c115a5a3b36aa268ba5c39ef3dб 20468cf28b)

(cherry picked from commit bb67fc186a)
2025-02-05 01:02:56 +01:00
Vitaly Provodin
9a6aa016ce JBR-6558 synchronize drawing and the test checking
(cherry picked from commit a8f38d8682)
2025-02-05 01:02:56 +01:00
Vitaly Provodin
27ca4a25e2 JBR-6556 add saving screenshots for analysis of test failures
(cherry picked from commit 9330ab5416)
2025-02-05 01:02:56 +01:00
Vitaly Provodin
49ca855653 update exclude list on results of 21.0.1_b334 test runs
(cherry picked from commit f4c811c548)
2025-02-05 01:02:56 +01:00
Dmitrii
59d2254339 JBR-3098 move repaintPeer event from AppKit thread to EDT on macos
(cherry picked from commit 11d3e5414f)
2025-02-05 01:02:55 +01:00
Nikita Gubarkov
bce7bd8447 JBR-6264 Improved coordinate conversion in XWayland mode
(cherry picked from commit 9c96ecd2f7)
2025-02-05 01:02:55 +01:00
bourgesl
49466f7870 JBR-6505: removed extra setNeedDisplay() in startRedrawIfNeeded() to restore JavaDraw performance (more frames rendered than real vsync FPS)
(cherry picked from commit d046741a56)
2025-02-05 01:02:55 +01:00
Vitaly Provodin
f1292f0ea5 update exclude list on results of 21.0.1_b331.1 test runs
(cherry picked from commit 4d755ad656)
2025-02-05 01:02:55 +01:00
Vitaly Provodin
a1dd6caba9 JBR-5863 add verbose mode thata saves the captured image
(cherry picked from commit b83c0ddca7)
2025-02-05 01:02:55 +01:00
Vitaly Provodin
9332f75580 JBR-6493 add jtreg test
(cherry picked from commit 96ee046fdc)
2025-02-05 01:02:55 +01:00
Vitaly Provodin
732c972c45 update exclude list on results of 23_b1960 test runs
(cherry picked from commit f36606576d)
2025-02-05 01:02:55 +01:00
Dmitrii Morskii
89e69e5d40 Revert "JBR-6346 update Inter font version"
This reverts commit 9aa690a94e.

(cherry picked from commit c97c8eb5fd)
2025-02-05 01:02:55 +01:00
bourgesl
d05a6d21a5 JBR-6241: RenderPerf 23.12: remove older RenderPerfTest in src
(cherry picked from commit eeae9a1cb2)
2025-02-05 01:02:55 +01:00
Vitaly Provodin
87ec35c713 JBR-6454 add synchronization at disposing windows
(cherry picked from commit 48bc9affc9)
2025-02-05 01:02:55 +01:00
bourgesl
c046b5b938 JBR-6377: fixed MTLLayer.redrawCount = 1 to avoid extra redraws with multiple windows
(cherry picked from commit 52610b9bf2)
2025-02-05 01:02:55 +01:00
Maxim Kartashev
84b14c9ab4 JBR-6340 Popups displayed shifted after moving IDE to another monitor via shortcut with auto-maximize enabled in Mutter
Windows no longer change their "native" size when moved between monitors
with different scale on Linux. Use -Dresize.with.scale=true to revert
that.

(cherry picked from commit 637d67cbfe)
2025-02-05 01:02:55 +01:00
Nikita Gubarkov
6944955f2a JBR-5837 retrieve up-to-date default screen device in FullscreenWindowProps test.
Calling setDisplayMode() or setFullScreenWindow() may cause display reconfiguration.

(cherry picked from commit 5e26eb9730)
2025-02-05 01:02:55 +01:00
Alexey Ushakov
c455e54a91 JBR-6433 Rounded corners of popups disappear after a while
Removed opacity from CAMetalLayer for layers with rounded corners

(cherry picked from commit e9bf36f41a)
2025-02-05 01:02:55 +01:00
Alexey Ushakov
5c65001667 JBR-5621 Test failures with -Dsun.java2d.metal.displaySync=false
Created intermediate buffer in the MTLLayer
Implemented frame separation of window updates for AWT and Swing
Remove frame delays as they greatly affect throughput
Fixed test/jdk/sun/java2d/GdiRendering/ClipShapeRendering.java
Resolved crash on multi-GPU systems

(cherry picked from commit 20bf935c82)
2025-02-05 01:02:55 +01:00
Dmitrii Morskii
ab549f1fc8 JBR-6346 update Inter font version
(cherry picked from commit 37ac0f2c3d)
2025-02-05 01:02:54 +01:00
Nikita Provotorov
3b293ab894 JBR-4687: Japanese IME input window hides what is being typed.
Uses CFS_EXCLUDE instead of CFS_CANDIDATEPOS in the ::ImmSetCandidateWindow() native API, which is more powerful and allows to take into account the issue's case.

(cherry picked from commit 0afe6c37bb)
(cherry picked from commit fa3d03b373)
2025-02-05 01:02:54 +01:00
Vitaly Provodin
ce4915526e JBR-6404 synchronize drawing and the test checking
(cherry picked from commit e763bb96ea)
2025-02-05 01:02:54 +01:00
Vitaly Provodin
34bb05435d JBR-3902 create jbr_all test group
(cherry picked from commit 104bd3086a)
2025-02-05 01:02:54 +01:00
Maxim Kartashev
5e94ce8e42 JBR-6002 Linux: maximized window goes fullscreen after being moved between monitors
(cherry picked from commit 83c4c0364698f5bfb682d715bbe4ac70d50f11b3)
(cherry picked from commit 41dde53a30)
2025-02-05 01:02:54 +01:00
ngubarkov
2abc2283ba JBR-5605 ignore empty client area when syncing bounds in XDecoratedPeer.
(cherry picked from commit d2301edbd0de04747817a2d382f587056d954627)
(cherry picked from commit b694ce0e9a)
2025-02-05 01:02:54 +01:00
ngubarkov
7e1643eb84 JBR-5438 Fix window bounds in XWM#setShellResizable
(cherry picked from commit 0aee99ac703f3b360277293e6e7a2e1aadfaba33)
(cherry picked from commit 637e8e473e)
2025-02-05 01:02:54 +01:00
ngubarkov
51158aac51 JBR-5265 Workaround incorrect position of content window in queryXLocation.
(cherry picked from commit 26684fd4c761dcd2a4c93673d7732095a2050c9b)
(cherry picked from commit 4f44486d15)
2025-02-05 01:02:54 +01:00
ngubarkov
a4608db2c5 JBR-5417 Fix flickering in multi-monitor setups on Linux.
(cherry picked from commit 9b813e21c361e9e4b97c52bdd8eccef0030a7763)
(cherry picked from commit d0fa8194dd)
2025-02-05 01:02:54 +01:00
Dmitry Batrak
52880ef646 JBR-5095 Incorrect initial window's location under GNOME
(cherry picked from commit 6995ce47fd)

with fix for JBR-5189 Can't exit fullscreen mode on ubuntu 22.10

(cherry picked from commit b933660cf1)
(cherry picked from commit f4ea24e18d8e6f4cb0420e30344a5cd3f000c021)
(cherry picked from commit 0ee3854a3a)
2025-02-05 01:02:54 +01:00
Sergey Shelomentsev
f0b7ed36c0 JBR-6354 fix custom title bar tests to avoid failure in MacOS 14 fullscreen mode
- moved common logic to a separate part
- moved parts of tests to swing package

(cherry picked from commit 80b6e4ba8cad4c19b0f306ccd64dad9c085a8bab)
(cherry picked from commit 22d1e57928)
2025-02-05 01:02:54 +01:00
Nikita Provotorov
b131e5fceb JBR-6125: macOS14 java/awt/Window/Grab/GrabTest.java Frame can't be focused.
Fixes a data race in the test.

(cherry picked from commit ca5562225a)
(cherry picked from commit 1ba73c8aaf430ca4c6e8302d1bcee8681aa8584d)
(cherry picked from commit cfbb5e642e)
2025-02-05 01:02:54 +01:00
Vitaly Provodin
cda6a6e3fe update exclude list on results of 22_b1930 test runs
(cherry picked from commit def4d8ad64e4b1fea76ace0d9014c1a063e44891)
(cherry picked from commit 32327c3f64)
2025-02-05 01:02:54 +01:00
Vladimir Kharitonov
44d9fbbae1 RDCT-766 add libwayland-cursor.so to ResolveSymbolsTestMinEnv
(cherry picked from commit 9626cc17447b96e8b4a16908f349e682525e3090)
(cherry picked from commit 09d1ab6ca20b51a46dad120ac044346bb2a8d48e)
(cherry picked from commit b3d3fc5bc0)
2025-02-05 01:02:54 +01:00
Vladimir Kharitonov
cc00ef7754 JBR-6272 add resolve symbols tests
(cherry picked from commit a4acdf005c53b1765ad356a740d4569db70e8b02)
(cherry picked from commit 9178b241d5d706c7628d5ebfac0fff8b54029b97)
(cherry picked from commit 262cccdd23)
2025-02-05 01:02:53 +01:00
Vitaly Provodin
921486502d JBR-6246 add (re)generating cds archives at jlink step
(cherry picked from commit 5f1b08c70d)
2025-02-05 01:02:53 +01:00
Nikita Gubarkov
9202b50550 Emoji PR sync (experimental)
- Removed font fallback hacks.
- Changed composite font glyph code encoding scheme, refactored to use Font2D instead of PhysicalFont.
- New Emoji logical font type with 2 underlying physical fonts.
- Removed getGlyphVectorOutline - it's unused and broken.
- Got rid of charsToGlyphs[NS] boilerplate.
- Moved emoji tests to separate directory.

(cherry picked from commit 485bdd1d1a)
2025-02-05 01:02:53 +01:00
Sergey Shelomentsev
9becb7b266 Don't trigger workflow on push
(cherry picked from commit d900720a03)
2025-02-05 01:02:53 +01:00
Dmitrii Morskii
45db887691 JBR-5724: fixed serialization and backward compatibility of Font
(cherry picked from commit 120cac9145)
2025-02-05 01:02:53 +01:00
Alexander Lobas
8d5c873ced JBR-4834 JBR-5139 Rounded corners on Mac OS and Windows: support custom border color
(cherry picked from commit 936f47d811)
2025-02-05 01:02:53 +01:00
Dmitrii Morskii
2fb5fc0ab5 JBR-6044 handle absence of fontConfig library in setupRenderingFontHints
(cherry picked from commit 6d41e07ffa)
2025-02-05 01:02:53 +01:00
Dmitrii Morskii
aa9197d4c2 JBR-6041 started using correct type inside FcPatternGetValueFuncType
(cherry picked from commit fc2b096811)
2025-02-05 01:02:53 +01:00
Dmitrii Morskii
7f95696937 JBR-6018 removed incorrect test testFeaturesZeroFrac
(cherry picked from commit e387761828)
2025-02-05 01:02:53 +01:00
Dmitrii
47ab2fd816 JBR-5502: optimize stringWidth & charsWidth methods of FontDesignMetrics
(cherry picked from commit b9eb40284f)
2025-02-05 01:02:53 +01:00
Dmitrii Morskii
53253a1b8f JBR-5844: fixed other part of issue. Added missing implementation of native methods in fontconfigmanager
(cherry picked from commit dbd70b4401)
2025-02-05 01:02:53 +01:00
Alexey Ushakov
971a84c60c 8311917: MAP_FAILED definition seems to be obsolete in src/java.desktop/unix/native/common/awt/fontpath.c
Reviewed-by: prr
(cherry picked from commit f2b83e89a0)
2025-02-05 01:02:53 +01:00
Dmitrii Morskii
8cc51f7e86 JBR-5844: fix case with non-scalable face
(cherry picked from commit 490080a315)
2025-02-05 01:02:53 +01:00
Dmitrii Morskii
59fb00ba3c JBR-5804: refactoring of freetypeScaler and moving fontconfig's logic in separate file
(cherry picked from commit 4700386a2e)
2025-02-05 01:02:53 +01:00
Dmitrii
10d6d14b8a JBR-5246 add OpenType's features support
(cherry picked from commit a2900b0bd9)
2025-02-05 01:02:52 +01:00
Dmitry Batrak
97754906c3 JBR-5751 java/awt/Focus/RowToleranceTransitivityTest.java: Focus got stuck while traversing.
(cherry picked from commit d56b4b045d)
2025-02-05 01:02:52 +01:00
Vitaly Provodin
28e7e6002a JBR-5286 make windows-aarch64 building script identical to the same script in jbr17
(cherry picked from commit a451d19108)
2025-02-05 01:02:52 +01:00
Vitaly Provodin
ba55f2524f update jetbrains.api hash and API version
(cherry picked from commit 2a53bf894c)
2025-02-05 01:02:52 +01:00
Vitaly Provodin
1c6fe465b7 Revert "JBR-5724: fixed serialization and backward compatibility of Font"
This reverts commit c5cc5b4dedbdf73871f14db92afaac15fd985d86.

(cherry picked from commit 34ed77394f)
2025-02-05 01:02:52 +01:00
Vitaly Provodin
a0bd41ff0e JBR-6246 add default CDS archives into jbrsdk distributions
(cherry picked from commit f103a46a4d)
2025-02-05 01:02:52 +01:00
Dmitry Drobotov
40da9e48a6 JBR-4479 Add text caret tracking for macOS Accessibility Zoom
(cherry picked from commit 0dfbf34b37)
(cherry picked from commit 29ce00912d)
2025-02-05 01:02:52 +01:00
Dmitry Drobotov
117037c920 JBR-6194 Fix VoiceOver reading old JComboBox value after changing it
1. Remove `value == nil` check in ComboBoxAccessiblity.accessibilityValue to fix the issue with not updated value of combo box. With `value == nil` check, the value was not reassigned on every get request of `accessibilityValue`, but only on get `accessibilitySelectedChildren`. When changing focus by Tab, only get `accessibilityValue` is called, and because `value` is already not nil, an old value was returned.

2. Set combo box role to NSAccessibilityPopUpButtonRole if it's not editable. Setting role to popup button fixes the bug when combo box value was not updated when using VO cursor navigation. Native MacOS non-editable combo boxes and non-editable HTML <select> elements also have the "popup button" role instead of "combo box", so the role should become more clear. Popup button role additionally enables opening the combo box menu with VO+Space shortcut, and changes VO instructions to be more appropriate when combo box is focused.

3. Add test for VoiceOver-specific issues of JComboBox.

(cherry picked from commit 8982db51d7)
(cherry picked from commit aebfb1439e)
2025-02-05 01:02:52 +01:00
Vitaly Provodin
8a5cd13a49 Update README.md
(cherry picked from commit 053f3acae4)
2025-02-05 01:02:52 +01:00
Maxim Kartashev
eda13e56df JBR-6220 javax/swing/GraphicsConfigNotifier/StalePreferredSize.java became failing by time out on Linux
(cherry picked from commit 3f78590707)
2025-02-05 01:02:52 +01:00
Maxim Kartashev
ca27c7fe4c JBR-6142 Impossible to move/resize IDE window after restart if several projects were initially opened on secondary monitor
Announce to Mutter that we are "client-decorated" when a Frame is
undecorated by setting _GTK_FRAME_EXTENTS to all zeroes.
This prevents Mutter from applying certain harmful heuristics.

(cherry picked from commit c5a34ea526)
2025-02-05 01:02:52 +01:00
Maxim Kartashev
39e55ea746 JBR-5971 Wayland: support WindowMove JBR API
Updated the XToolkit implementation to match API changes required for
WLToolkit

(cherry picked from commit 7492c11138)
2025-02-05 01:02:52 +01:00
Maxim Kartashev
b96003193a JBR-5777 isWindowMoveSupported() doesn't work with non-default GraphicsEnvironment
Co-authored-by: Nikita Gubarkov <nikita.gubarkov@jetbrains.com>
(cherry picked from commit 4496757a35)
2025-02-05 01:02:52 +01:00
Maxim Kartashev
871093cad8 JBR-5637 Linux: implement window position change with WM help
Introduced JBR.isWindowMoveSupported() and
JBR.getWindowMove().startMovingTogetherWithMouse()

(cherry picked from commit 747bc94e8f)
2025-02-05 01:02:52 +01:00
Maxim Kartashev
2fcb6ef946 JBR-5084 Add ability to log additional data to jstack output
The data can be provided via this JBR API call:
JBR.getJstack().includeInfoFrom(Supplier<String>)

(cherry picked from commit 5244ec31f9)
2025-02-05 01:02:51 +01:00
Alexander Lobas
bda7696c5e JBR-5546 Iterating open windows with cmd backtick on Mac forces minimized windows to un-minimize
(cherry picked from commit ffb74e32a0)
2025-02-05 01:02:51 +01:00
Alexander Lobas
08bcf7eaae JBR-5478 IDEA window doesn't fit the screen properly on turning off/on an external monitor
(cherry picked from commit 24930c2624)
2025-02-05 01:02:51 +01:00
Alexander Lobas
a038608ece JBR-5384 New UI: window header is hard to resize on the top edge, top/right corner
(cherry picked from commit c4dd01c027)
2025-02-05 01:02:51 +01:00
Alexander Lobas
d0d6b217d0 JBR-5174 Opening project as tabs in Mac OS (version2)
JBR-5023 Configure TabbingIdentifier during create native window
JBR-5256 IDEA window resizes to zero height when exit full-screen mode with new window controls enabled
JBR-5197 Window control buttons are not visible in full-screen mode in dark themes when IDE window is focused
JBR-5175 jb/java/awt/Window/FullScreenTwoFrames.java: -[AWTWindow resetWindowFullScreeControls]: unrecognized selector sent to instance 0x60000232d5f0
JBR-5499 Window control buttons bugfix
JBR-4462 BigSur: project tab does not gain focus when click it after focusing another app

(cherry picked from commit 4aa2061ab6)
2025-02-05 01:02:51 +01:00
Dmitry Batrak
981fb9b696 JBR-5300 Change source code and test files to use GPL license
fix copyright profile in generated IDE project

(cherry picked from commit 43ebbe3cd1)
(cherry picked from commit 39d49c5abe)
2025-02-05 01:02:51 +01:00
Nikita Gubarkov
6bd3576b5e JBR-5124 Rewrite custom decorations support
JBR API v0.0.8
Added new WindowDecorations API, deprecated old CustomWindowDecoration.

JBR-4641 JBR-4630 Fix client area calculation with custom decorations on Windows.

- Window insets are rounded up, which causes visible & unusable border in fullscreen on some scales, round down instead.

- Clipping in Swing components sometimes cuts what it shouldn't, fixed.

(cherry picked from commit 03d850e722)
2025-02-05 01:02:51 +01:00
Vitaly Provodin
613c9fdfe5 update exclude list on results of 21.0.1_b293.1 test runs
(cherry picked from commit a247590ca0)
2025-02-05 01:02:51 +01:00
Nikita Provotorov
11da84dc12 JBR-6282: java/awt/TextArea/TextAreaEditing/TextAreaEditing.java intermittently fails due to deadlock.
Makes the test invoke any UI-operation on EDT only (since AWT doesn't guarantee thread-safety of UI operations, see more at https://mail.openjdk.org/pipermail/client-libs-dev/2023-November/016172.html).

(cherry picked from commit 8dbb889509)
(cherry picked from commit 559ec0c370)
2025-02-05 01:02:51 +01:00
Maxim Kartashev
728e2c91c6 JBR-6291 runtime/cds/appcds/dynamicArchive/TestDynamicDumpAtOom.java: Attempting to acquire lock OOMEStacks_lock/safepoint out of order
(cherry picked from commit c8c8881be4)
2025-02-05 01:02:51 +01:00
Alexander Lobas
6c69a5b5f4 JBR-5409 "No Print Service Found" Error when saving to PDF
(cherry picked from commit 9c9859ba1a)
2025-02-05 01:02:51 +01:00
Alexey Ushakov
fb06145af8 JBR-6281 Remove MTLEvent sync from Metal rendering code
Removed sync code

(cherry picked from commit 660d97005c)
2025-02-05 01:02:51 +01:00
Nikita Provotorov
24a709ec16 JBR-2460: Wrong position of input window and no input preview with fcitx and ubuntu 13.04.
This patch makes the fix of JBR-1573 (which caused JBR-4394) disabled by default, because it's incompatible with the native below-the-spot mode (a.k.a. over-the-spot in the X11's terminology).

(cherry picked from commit 3fe2a97aa0)
(cherry picked from commit fc3ce96788)
2025-02-05 01:02:51 +01:00
Nikita Provotorov
590cc980dd JBR-2460: Wrong position of input window and no input preview with fcitx and ubuntu 13.04.
- introduces and integrates jbNewXimClient: a new implementation of XIC creation routine (it's mostly refactoring and generalizing of AWT's existed code). Enabled by default and can be disabled via a new system property -Djb.awt.newXimClient.enabled=false ;
- introduces support of the X11's native over-the-spot input method style (it's almost the same as AWT's below-the-spot mode, but the input method's windows are drawn externally, not by AWT). Enabled by default and can be disabled via a new system property -Djb.awt.newXimClient.enabled=false. Doesn't work if -Djb.awt.newXimClient.enabled=false is set ;
- introduces sun.awt.X11.XInputMethod.ClientComponentCaretPositionTracker class that tracks all kind of events for the current client component that can lead to the caret position changing ;
- makes the XInputMethod class to update the input window's position (whenever the ClientComponentCaretPositionTracker discovers that's necessary) by setting the X11's XNSpotLocation property .

Check out the branch nprovotorov/backups/JBR-2460_wrong-position-of-input-window-and-no-input-preview for more granular patches.

(cherry picked from commit c57030a2ef)
(cherry picked from commit 56d9759667)
2025-02-05 01:02:51 +01:00
Maxim Kartashev
6d3dca0a3b JBR-6193 Impossible to resize snapped IDE when native header is turned off
Drop the maximized state right before the resize operation for
undecorated windows.

Also fixes setExtendedState() to work when changing snapped window's state
(MAXIMIZED_HORIZ or MAXIMIZED_VERT) to NORMAL.

(cherry picked from commit a9a227c5ab)
2025-02-05 01:02:51 +01:00
Nikita Provotorov
5aa9e342b8 JBR-5980: Pasting from clipboard not working reliably in Windows.
(also contains the fix of JBR-6267 Image retreived from the Clipboard is not the same image that was set to the Clipboard)

- Adds a way to disable caching of the data placed into the clipboard. The behavior is controlled by the system property "awt.windows.clipboard.cache.disabled" (=false by default) ;
- Whenever the app gets focus additionally checks if another app has modified the clipboard. The behavior is controlled by the system property "awt.windows.clipboard.extraOwnershipChecksEnabled" (=true by default) .

(cherry picked from commit e6f4a25b1a)
2025-02-05 01:02:50 +01:00
Nikita Provotorov
9ae799b328 JBR-5980: Pasting from clipboard not working reliably in Windows.
Marks the native flag AwtClipboard::isGettingOwnership as volatile and adds memory barriers around it to avoid inconsistencies of CPU caches.

(cherry picked from commit 51d2b31b28)
2025-02-05 01:02:50 +01:00
Vitaly Provodin
7979221a9e JBR-6255 improve calculation JDK_BUILD_NUMBER
(cherry picked from commit 186d1c3229)
2025-02-05 01:02:50 +01:00
Nikita Gubarkov
dbf5ed13bc JBR-5274 recreate CGraphicsDevice if it was changed.
- AWT code heavily relies on reference comparison when updating graphics devices & configurations, so we need to actually re-create CGraphicsDevice if it was changed.

- Also do not rely on graphicsConfig.getDefaultTransform() when firing `graphicsContextScaleTransform` property change, as graphics devices are mutable and returned default transform may change over time, e.g. when device is invalidated.

(cherry picked from commit f9ad92a71c)
2025-02-05 01:02:50 +01:00
Alexey Ushakov
18d37718f2 JBR-5025 Reduce latency during display reconfiguration in Metal
Moved metal load library checks to CGraphicsEnvironment

(cherry picked from commit eeee663bb4)
2025-02-05 01:02:50 +01:00
Alexey Ushakov
0799341191 JBR-4666 java.lang.InternalError: Error - unable to initialize Metal after recreation of graphics device.
Reverted fix of the JRE-359 (CGraphicsEnvironment.getDefaultScreenDevice() returns null)
Logged exception after first attempt to create graphics device

(cherry picked from commit 345fd320c7)
2025-02-05 01:02:50 +01:00
Alexey Ushakov
f4c9ebcdc2 JBR-4588 macOS: SIGILL at [libsystem_kernel] __kill in CCE: class sun.java2d.opengl.CGLGraphicsConfig cannot be cast to class sun.java2d.metal.MTLGraphicsConfig
Prevent fall back to OpenGL if Metal has been used before
Added more diagnostics.

(cherry picked from commit 4002007cc2)
2025-02-05 01:02:50 +01:00
Vitaly Provodin
832b007eb5 Update README.md
(cherry picked from commit 74f354be28)
2025-02-05 01:02:50 +01:00
Vladimir Kharitonov
e22fc527d1 JBR-6239 sign frameworks in cef_server.app
(cherry picked from commit 8f6ae7a89c)
2025-02-05 01:02:50 +01:00
Maxim Kartashev
c190f6e1d0 JBR-4020 Test ObsoleteFlagErrorMessage fails after +IgnoreUnrecognizedVMOptions has become the default
(cherry picked from commit ae5963a094)
(cherry picked from commit 5b27cdbd14)
2025-02-05 01:02:50 +01:00
Maxim Kartashev
ba8acd0cea JBR-5722 vmTestbase/vm/gc/compact/Compact_TwoFields_InternedStrings: SIGSEGV at Symbol::as_klass_external_name(char*, int)
Do not use print_native_stack() when recording OOME stacks as it is
designed to be used only in the context of a fatal error reporting where
induced crashes are tolerated.

(cherry picked from commit 6a87945cc5)
2025-02-05 01:02:50 +01:00
Alexey Ushakov
a43810895f JBR-5741 broken build in main because of hotspot changes (JDK-8309613)
Added missing parameter

(cherry picked from commit c4c6d022f8)
2025-02-05 01:02:50 +01:00
Maxim Kartashev
d082eac9d9 JBR-5480 Include more information in OOME crash reports
(cherry picked from commit 44f8dc85da)
2025-02-05 01:02:50 +01:00
Maxim Kartashev
33dceea732 JBR-5466 jb/hotspot/JNIRefsInCrashLog.java: 'hs_err_42.txt' missing from stdout/stderr
(cherry picked from commit e511c26794)
2025-02-05 01:02:50 +01:00
Maxim Kartashev
17ed67a785 JBR-5431 Include memory used by JNI references into crash reports
(cherry picked from commit 9a6eb0b730)
2025-02-05 01:02:49 +01:00
Vitaly Provodin
ddc729c6e2 Update README.md
(cherry picked from commit 66c66543bb)
2025-02-05 01:02:49 +01:00
bourgesl
b90a9c299a JBR-5638: improved renderer performance for simple rectangular area (see BBoxAATileGenerator), added new statistics in Renderer
(cherry picked from commit dd4f818488)
2025-02-05 01:02:49 +01:00
Nikita Tsarev
0544f29fe3 JBR-6215: Override XToolkit's default nonintuitive behavior when translating F13-F24 keys
(cherry picked from commit 413b679eda)
2025-02-05 01:02:49 +01:00
Konstantin Bulenkov
d499561f40 JBR-6214 [fwp jbr21] IDEA-299292 Use Inter semibold instead of Inter bold
Replaced Inter bold with semi-bold fonts

(cherry picked from commit 1ca726da46)
2025-02-05 01:02:49 +01:00
Nikita Gubarkov
3d3bd10f1b JBR-6208 Extended glyph cache for Metal
(cherry picked from commit 6878613df0)
2025-02-05 01:02:49 +01:00
Vitaly Provodin
64dfaa6c63 JBR-6181 add Linux executables with bundled FreeType
(cherry picked from commit 12449b3de5)
2025-02-05 01:02:49 +01:00
Vitaly Provodin
88c191ba71 Update README.md
(cherry picked from commit cff858e253)
2025-02-05 01:02:49 +01:00
Alexey Ushakov
aa43b9a0e6 JBR-4983 MacOS Ventura - External monitor lagging
Restored REDRAW_INC to 2. Enabled the fix by default only for M2 and spans displays property enabled (Displays have separate spaces OFF)

(cherry picked from commit 19728e911b)
2025-02-05 01:02:49 +01:00
Dmitrii Morskii
63b911b880 JBR-6135 removed dependence on process reading TTF in fixed size chunks
(cherry picked from commit 7c4721fa68)
2025-02-05 01:02:49 +01:00
Alexey Ushakov
7881a6a4da JBR-6132 Crash in [MTLLayer blitTexture] when MTL_DEBUG_LAYER enabled
Blit operation should not be performed on textures with MTLTextureUsageRenderTarget only, so changing framebufferOnly to NO

(cherry picked from commit 5fb47ffc78)
2025-02-05 01:02:49 +01:00
Vitaly Provodin
297043ce0a Update README.md
(cherry picked from commit 7d1bcef8cd)
2025-02-05 01:02:49 +01:00
Nikita Provotorov
141391444d JBR-5984: IM's candidate window is placed under popup windows.
- Implements the optional method [NSTextInputClient windowLevel] to tell the macOS IM subsystem correct level of the window;
- Adds a regression test ImWindowIsPlacedUnderPopup5984.java.

(cherry picked from commit 5a91aae9c2)
(cherry picked from commit 2f310561ba)
2025-02-05 01:02:49 +01:00
Vitaly Provodin
0fcfd105d5 JBR-6130 add VK_TAB release action
(cherry picked from commit e16990eb93)
2025-02-05 01:02:49 +01:00
Alexey Ushakov
0de65ad3a3 JBR-4983 MacOS Ventura - External monitor lagging
Added extra redraw request

(cherry picked from commit bd436709f5)
2025-02-05 01:02:49 +01:00
ghostflyby
51a3c1c49d JBR-6124 Fix macOS services writing text back to textfield
(cherry picked from commit 51bde60b42)
2025-02-05 01:02:48 +01:00
Sergey Shelomentsev
92b490f2ad exclude FocusTraversalOrderTest
(cherry picked from commit f7004afdb1)
2025-02-05 01:02:48 +01:00
Sergey Shelomentsev
e698049719 JBR-6060 add focus traversal order test
(cherry picked from commit 40dec50c3a)
2025-02-05 01:02:48 +01:00
Nikita Gubarkov
5f41f54b0c JBR-6016 doPrivileged for JBR API internal services.
(cherry picked from commit 06290bfd1e)
2025-02-05 01:02:48 +01:00
Vitaly Provodin
e2ef87829b JBR-6008 Update JetBrains Mono fonts to v2.304
(cherry picked from commit 676a270ac1)
2025-02-05 01:02:48 +01:00
Vitaly Provodin
66d823b5d9 Update README.md
(cherry picked from commit 0400cd7f9b)
2025-02-05 01:02:48 +01:00
Dmitry Batrak
0e12f65e6c JBR-3353 Sibling popup window is shown below dialog on macOS
(cherry picked from commit 4c6f3e4510)
(cherry picked from commit 73678a99d5)
2025-02-05 01:02:48 +01:00
Dmitry Batrak
6f91033367 JBR-5953 If hieroglyph typing isn't finalised, focusing another component inserts the composed text there
(cherry picked from commit 5dedf0e367)
2025-02-05 01:02:48 +01:00
Dmitry Batrak
493f347750 JBR-5946 Allow to disable painting of composed text in Swing text components using TextLayout.draw
(cherry picked from commit 3ac357417b)
2025-02-05 01:02:48 +01:00
Dmitry Batrak
e5f1fa0c01 JBR-5823 IDEA crashes when '-Dmain.thread.as.edt=true' vmoption is set and VoiceOver is enabled
done as part of JBR-4993 Support using 'main' thread as EDT on macOS

(cherry picked from commit 55598693c3)
(cherry picked from commit c7b9f1aa68)
2025-02-05 01:02:48 +01:00
ngubarkov
d343a40f28 JBR-5240 Fix XToolkit#getScreenInsets in Xinerama mode.
(cherry picked from commit 5df3fc666d)
2025-02-05 01:02:48 +01:00
ngubarkov
e6546ab53b JBR-5316 Fix fractional scaling HIDPI.
(cherry picked from commit acb62617d7)
2025-02-05 01:02:48 +01:00
Nikita Gubarkov
bb80572a71 JBR-5186 Make MouseInfo.getPointerInfo more robust
Do not search for the containing monitor in MouseInfo.getPointerInfo, this must be handled by peers (yes, this goes against the spec of MouseInfoPeer.fillPointWithCoords).

JBR-5268 Fix coordinates conversion in XMouseInfoPeer.fillPointWithCoords

(cherry picked from commit ae135f2126)
2025-02-05 01:02:48 +01:00
Nikita Gubarkov
b535b1ecea IDEA-141456 Multimonitor HIDPI support for Linux
(cherry picked from commit 980c18ae92)
2025-02-05 01:02:48 +01:00
Dmitrii Morskii
8f8e8d3d09 JBR-5724: fixed serialization and backward compatibility of Font
(cherry picked from commit e3da733724)
2025-02-05 01:02:47 +01:00
Dmitrii Morskii
82022cba0e JBR-5259: fixed Canvas mispositioning after dragging JFrame to a monitor with different scale
(cherry picked from commit de62b80ef2)
2025-02-05 01:02:47 +01:00
Vitaly Provodin
73e43a6361 Update README.md
(cherry picked from commit b438d74f39)
2025-02-05 01:02:47 +01:00
Maxim Kartashev
631e26f297 JBR-5815 javax/swing/AbstractButton/6711682/bug6711682.java: Row #2 checkbox is not selected
Fixed the test to use proper cell coordinates when clicking.

(cherry picked from commit ed01142e8b)
2025-02-05 01:02:47 +01:00
Alexey Ushakov
f3909f2192 JBR-5807 java/awt/Frame/FrameVisible/FrameContentAppearanceTest.java: Failed: OpenGL 26 image rendering failure(s)
Added synchronisation for rendering and appearance

(cherry picked from commit d02635f65b)
2025-02-05 01:02:47 +01:00
bourgesl
dadca6a85e JBR-5625: disable color-matching (colorspace = nil) in MTLLayer by default (see new system property 'sun.java2d.metal.colorMatching=true/false') + added new MetalLayerColorTest
Use CGColorSpaceCopyName() available since macOS 10.6 in MTLLayer

Use sun.java2d.metal.colorMatching=true by default (current metal behaviour)

(cherry picked from commit ec5c99bfb6)
2025-02-05 01:02:47 +01:00
Nikita Provotorov
668f6856f2 JBR-5762 Sometimes naturally generated MOUSE_DRAGGED events don't contain the pressed button's modifier.
Enforce keeping the pressed button in the modifiers for MOUSE_DRAGGED events. This is under a (default enabled) system property "awt.mac.enforceMouseModifiersForMouseDragged".

(cherry picked from commit fb12990a98)
(cherry picked from commit 6a972e8ca7)
2025-02-05 01:02:47 +01:00
Dmitrii Morskii
3e1f382f2a JBR-5548 fix BadSerializationTest
(cherry picked from commit 90d867d08b)
2025-02-05 01:02:47 +01:00
Vitaly Provodin
88866ce657 Update README.md
(cherry picked from commit 8efb8ded38)
2025-02-05 01:02:47 +01:00
Sergey Shelomentsev
fcf5dc702b JBR-5746 wait for menu visibility of fail the test
add mouse events logging

(cherry picked from commit 5a05bd2046)
2025-02-05 01:02:47 +01:00
Dmitry Batrak
8f44f6497d JBR-5720 Wrong modifiers are reported for mouse middle and right buttons' release/clicked events
(cherry picked from commit afa0283f16)
2025-02-05 01:02:47 +01:00
Dmitry Batrak
a46d5465ce JBR-5684 Focus state is broken after closing of modal dialog in an inactive application
(cherry picked from commit 2f2fe7a11c)
2025-02-05 01:02:47 +01:00
Vitaly Provodin
fc59abc78b update exclude list
(cherry picked from commit 36f380d4b4)
2025-02-05 01:02:47 +01:00
Vitaly Provodin
8ffa8879c8 Update README.md
(cherry picked from commit b4071ba08d)
2025-02-05 01:02:47 +01:00
Alexey Ushakov
320ec394c2 JBR-5151 Test failures caused by -Dsun.java2d.metal.displaySync=false
Removed display sync from window layer, provide layer content updates only when necessary

(cherry picked from commit 77cb9bcec0)
2025-02-05 01:02:46 +01:00
Dmitrii Morskii
2490347def JBR-1775: improved logic for choosing newer font between system and bundled ones
(cherry picked from commit 41cbdf720c)
2025-02-05 01:02:46 +01:00
Sergey Shelomentsev
f5577f1920 JBR-2870 add resression test for JPopupMenu
- verify that the popup menu is usable if overlaps WM's dock panel of the bottom of screen

(cherry picked from commit 962eb42ed2)
2025-02-05 01:02:46 +01:00
Vitaly Provodin
b8e03b0daf Update README.md
(cherry picked from commit 15fdca4193)
2025-02-05 01:02:46 +01:00
Alexey Ushakov
569ee12884 JBR-5693 Debug build failure in main branch
Corrected printf format and muted unused-function option for keycode_cache.c

(cherry picked from commit 87a01c930d)
2025-02-05 01:02:46 +01:00
Alexey Ushakov
013446e4db JBR-5704 displaySyncOFF: javax/swing/JDialog/Transparency/TransparencyTest.java: JDialog transparency lost upon iconify/deiconify sequence
Corrected startRedraw method to call setNeedsDisplay in displaySync=false mode

(cherry picked from commit 0ddd7e8301)
2025-02-05 01:02:46 +01:00
Sergey Shelomentsev
5438c90462 JBR-5670 restore initial display mode after test execution
restore original display mode

(cherry picked from commit d098ad1f77)
2025-02-05 01:02:46 +01:00
Sergey Shelomentsev
d2e963995e JBR-4880 Fix DeadKeySystemAssertionDialog to avoid receiving key event out of the window
(cherry picked from commit 5467dea09b)
2025-02-05 01:02:46 +01:00
Vladislav Rassokhin
bb337f3944 JBR-5600 Reduce noise in signing scripts output
(cherry picked from commit bc145d39be)
2025-02-05 01:02:46 +01:00
Vladislav Rassokhin
590a7f02c0 JBR-5600 Sign frameworks as whole, verify framework signature before full app sign
(cherry picked from commit 2fecc58be2)
2025-02-05 01:02:46 +01:00
Nikita Provotorov
271e8088bd JBR-5668: The implementation of a11y announcing for macOS crashes with -Xcheck:jni.
- Create a global reference of the passed to EDT accessible object (the local reference) to use it in the AppKit thread ;
- Enable -Xcheck:jni in the tests ;
- Make the tests handle the problematic case .

(cherry picked from commit cba981df4b)
(cherry picked from commit f3a038c849)
2025-02-05 01:02:46 +01:00
Vladislav Rassokhin
2d1ca4104e tools/mac/scripts: minor improvements
* don't move into itself
* use `PKG_NAME` variable instead of `${APP_NAME}.pkg`
* cleanup sign.sh
* add `SCRIPT_VERBOSE` env variable to control `set -x`

(cherry picked from commit 28514c3d00)
2025-02-05 01:02:46 +01:00
Vladislav Rassokhin
4535e02be6 JBR-5600 Staple .pkg with signature
(cherry picked from commit 6555023fd3)
2025-02-05 01:02:46 +01:00
Vladislav Rassokhin
32bbda291e JBR-5600 Notarize macOS binaries using notarytool
(cherry picked from commit 7916ed31b7)
2025-02-05 01:02:46 +01:00
Vladislav Rassokhin
b3582137d3 JBR-5600 Sign macOS binaries using jet-sign
(cherry picked from commit 95ef69df13)
2025-02-05 01:02:46 +01:00
Sergey Shelomentsev
c5872311f2 JBR-5579 Update mouse location checks, set window always on top for ActionListenerTest
(cherry picked from commit b867b1c395)
2025-02-05 01:02:45 +01:00
Sergey Shelomentsev
b6644434be JBR-5551 update hit tests on custom title bar
- set windows always on top
- verify mouse location before clicking

(cherry picked from commit 005de74127)
2025-02-05 01:02:45 +01:00
Sergey Shelomentsev
8e0edf42c2 JBR-5577 fix MouseEventsOnClientArea test
- add Swing/AWT specific Task runners
- split MouseEventsOnClientArea to separate AWT/Swing tests
- use CountDownLatch for tracking mouse events

(cherry picked from commit c6a43fe84f)
2025-02-05 01:02:45 +01:00
Sergey Shelomentsev
26c0cb16ad remove jb/java/awt/Window/ZOrderOnModalDialogActivation.java
(cherry picked from commit 9b6037dee3)
2025-02-05 01:02:45 +01:00
Sergey Shelomentsev
9ff916c51c JBR-4494 pass ui scale options for child process
(cherry picked from commit e32e657c55)
2025-02-05 01:02:45 +01:00
Maxim Kartashev
2cb3080996 JBR-5656 Builds of JDK 21 are reproducible by default
(cherry picked from commit 0d663a139acf3d5cdb19b33494ab9f6273c4ebfa)
(cherry picked from commit f086917fa7)
2025-02-05 01:02:45 +01:00
bourgesl
6866f39483 JBR-5651: Improved MTLVertexCache to merge consecutive full-tiles ie use 1 larger quad instead of many quads per row, full-tile is only using 1x1 pixel (full), applied to color, gradient & texture paints + fixed clang warnings
(cherry picked from commit 6de22f0db9)
2025-02-05 01:02:45 +01:00
Alexey Ushakov
70e3e6f76e JBR-5649 Flickering in multi-monitor configuration
Provided corrected initial value for currentDisplayID

(cherry picked from commit c0f779b7e6)
2025-02-05 01:02:45 +01:00
Vitaly Provodin
1a8cd613e7 JBR-5627 add regression test AsyncProfilerRunnerTest
(cherry picked from commit ce37138a4a)
2025-02-05 01:02:45 +01:00
Maxim Kartashev
37f5c8ad1b JBR-5631 Refactor Dockerfile for x64 builds
(cherry picked from commit 3bb93255e9)
2025-02-05 01:02:45 +01:00
Vitaly Provodin
a5dc6a8e5a JBR-5603 build aarch64 Linux from arm64v8/centos:7 and check glibc to be not higher 2.17
(cherry picked from commit f6be01d68c)
2025-02-05 01:02:45 +01:00
Alexey Ushakov
6fbc69e630 JBR-5580 J2DBench: ~15% drop performance  because of non optimal synchronization in metal (MBP 16'' x64)
Replaced NSMutableArray with NSMutableSet, removed unnecessary __block modifier.

(cherry picked from commit fd940831a2)
2025-02-05 01:02:45 +01:00
Sergey Shelomentsev
3e217e19f7 update a11y exclude list
(cherry picked from commit 5641f7141f)
2025-02-05 01:02:45 +01:00
Alexey Ushakov
bedfa42c87 JBR-5580 J2DBench: ~15% drop performance because of non optimal synchronization in metal (MBP 16'' x64)
Removed NSLock and moved all operations to the AppKit thread

(cherry picked from commit e2fcfaf249)
2025-02-05 01:02:45 +01:00
bourgesl
0cbae5bcdb JBR-5170: improved color maskFill performance: using a new MaskColorBuffer and a specific shader (vert_txt_col)
fix crash in J2DDemo with advanced paints + artefacts with texture background

(cherry picked from commit 2fc32d6082)
2025-02-05 01:02:45 +01:00
Alexey Ushakov
87aeb6b8ed JBR-5559 SwingMark performance drop after removing additional command queue
Added command queue and provided synchronization between the command queues

(cherry picked from commit 6b76f79eee)
2025-02-05 01:02:44 +01:00
Nikita Provotorov
2bcee6bc0e JBR-5536: Crash on macOS bad JNI lookup in Java_sun_swing_AccessibleAnnouncer_nativeAnnounce
Stop using the JNIEnv instance bound to EDT in the AppKit thread.

(cherry picked from commit 0f49341f4d)
(cherry picked from commit cdca8e74b7)
2025-02-05 01:02:44 +01:00
Alexey Ushakov
e140f2f243 JBR-4883 macOS: SIGSEGV at MTLVertexCache_FlushGlyphVertexCache
Use separate glyph cache for each MTLContext instance. Refactored MTLGlyphCache

(cherry picked from commit 845a30560e)
2025-02-05 01:02:44 +01:00
Alexey Ushakov
b55524a35e JBR-5193 Do not use extra commandQueue in metal pipeline
Removed extra command queue

(cherry picked from commit a235903851)
2025-02-05 01:02:44 +01:00
Alexey Ushakov
478c871795 JBR-4959 [macOS Ventura] Screen flickering after OS update when IDE is full screen
This includes displaySync changes as well as fixes for JBR-5157 and JBR-5321.

(cherry picked from commit e7df6f3745)
2025-02-05 01:02:44 +01:00
Vitaly Provodin
afea9b0c14 Update README.md
(cherry picked from commit aa1d64ca93)
2025-02-05 01:02:44 +01:00
Maxim Kartashev
7200bcf69d jb/branchdiff.py is a lot faster
(cherry picked from commit 5c3726555d)
2025-02-05 01:02:44 +01:00
Sergey Shelomentsev
a34b3c8c73 JBR-5505 update exclude list for a11y testing on Windows
(cherry picked from commit 12330ba916)
2025-02-05 01:02:44 +01:00
Sergey Shelomentsev
0148f10995 JBR-5397 update exclude list for a11y testing on MacOS
(cherry picked from commit 688b16a796)
2025-02-05 01:02:44 +01:00
Sergey Shelomentsev
90e0593eb0 JBR-5441 fix wait for idle
(cherry picked from commit 8b5945f834)
2025-02-05 01:02:44 +01:00
Maxim Kartashev
706454260e jb/branchdiff.py to warn if it can't differentiate between commits
(cherry picked from commit 3504702f9c)
2025-02-05 01:02:44 +01:00
Sergey Shelomentsev
4e0f6f74ec JBR-5440 fix calculations for double click location
(cherry picked from commit e468d39869)
2025-02-05 01:02:44 +01:00
Artem Bochkarev
6c8da8ee19 JBR-5426 write JCEF version info inside release file
(cherry picked from commit 59701eefa3)
2025-02-05 01:02:44 +01:00
Maxim Kartashev
368878a793 JBR-5445 JBRApiTest test fails on development builds
(cherry picked from commit d9d941f9c5)
2025-02-05 01:02:44 +01:00
Sergey Shelomentsev
d14992da4b JBR-5433 add typing latency text for JTextArea
(cherry picked from commit c6706f1794)
2025-02-05 01:02:44 +01:00
Vitaly Provodin
31bfd1f679 JBR-5432 increase setAutoDelay for Robot
(cherry picked from commit 17b10df182)
2025-02-05 01:02:43 +01:00
Maxim Kartashev
f1143f7092 JBR-5230 Wanted: an ability to use Unix Domain sockets with overridden default NIO file system
(cherry picked from commit 946a7ca9ec)
2025-02-05 01:02:43 +01:00
Sergey Shelomentsev
5ba5aedbf6 fixup! JBR-4875 set proper OS to run ComboBoxTransparentTittleBarTest
(cherry picked from commit 611dcc6475)
2025-02-05 01:02:43 +01:00
Sergey Shelomentsev
f75484862c fix controls width calculation
(cherry picked from commit b88d26c9dd)
2025-02-05 01:02:43 +01:00
Sergey Shelomentsev
9b47c2a9f8 split ActionListenerTest
(cherry picked from commit 36f13b0158)
2025-02-05 01:02:43 +01:00
Sergey Shelomentsev
4f35d56030 JBR-5345 native controls detection and scale fixes
(cherry picked from commit e191789794)
2025-02-05 01:02:43 +01:00
Maxim Kartashev
160c69ebf0 README.md: spelled out JBR distinctive features
(cherry picked from commit 51e9900c8b)
2025-02-05 01:02:43 +01:00
Vitaly Provodin
560266ad55 update exclude list on results of 21_b28.1 test runs
(cherry picked from commit 4619c5ed7f)
2025-02-05 01:02:43 +01:00
Alexey Ushakov
f51ccb5f06 JBR-5330 Blank Welcome screen after moving to another display
Initialize currentDisplayID on AWTWindow creation

(cherry picked from commit c5ea4e48ac)
2025-02-05 01:02:43 +01:00
Nikita Tsarev
df004a73f7 JBR-5369: Update failing tests list in response to macOS keyboard support rewrite
(cherry picked from commit a9313e2d06)
2025-02-05 01:02:43 +01:00
Vitaly Provodin
8452b2a84d Update README.md
(cherry picked from commit ed3d57cf10)
2025-02-05 01:02:43 +01:00
Vitaly Provodin
51f07d413e update exclude list on results of 21_b24.2 test runs
(cherry picked from commit 3276006be9)
2025-02-05 01:02:43 +01:00
Vitaly Provodin
22cad9c8e1 Update README.md
(cherry picked from commit 552fa7c32e)
2025-02-05 01:02:43 +01:00
Sergey Shelomentsev
a109ba7a6c JBR-5350 Separate test for Mac OS
(cherry picked from commit dc4a094f03)
2025-02-05 01:02:43 +01:00
Sergey Shelomentsev
2796874588 JBR-5346 run MaximizedCustomDecorationsTest on windows/mac only
(cherry picked from commit c47b6f4880)
2025-02-05 01:02:43 +01:00
Sergey Shelomentsev
44e0f04a4f JBR-5350 fix FrameNativeControlTest checks on MacOS
(cherry picked from commit f8f1c8625e)
2025-02-05 01:02:42 +01:00
Sergey Shelomentsev
16f5abc99a JBR-5344 fix incorrectly specified VM options
(cherry picked from commit 2f101dbf8a)
2025-02-05 01:02:42 +01:00
Vitaly Provodin
2c2520ca60 Update README.md
(cherry picked from commit 952295b14d)
2025-02-05 01:02:42 +01:00
Vitaly Provodin
dfa2b49137 update exclude list on results of 17.0.6_b855.1 test runs
(cherry picked from commit b018988c02)
2025-02-05 01:02:42 +01:00
Sergey Shelomentsev
60e26aebd9 JBR-5313 fix broken custom decoration tests on Windows
(cherry picked from commit c6e21bdbad)
2025-02-05 01:02:42 +01:00
Sergey Shelomentsev
edacc284d8 JBR-5253 Use new JBR API for custom decorations
(cherry picked from commit fdead3d90a)
2025-02-05 01:02:42 +01:00
Vitaly Provodin
d679b7cd88 JBR-5300 move jbr-api.jar into test artefact
(cherry picked from commit f199d6c98a)
2025-02-05 01:02:42 +01:00
Vitaly Provodin
9cb00bbb04 update exclude list on results of 17.0.6_b837.3 test runs
(cherry picked from commit 415267181c)
2025-02-05 01:02:42 +01:00
Maxim Kartashev
9ffc5bc9f1 JBR-4544 Enable OpenGL pipeline by default for Wayland sessions
The OpenGL pipeline is enabled only if all of the following is true:
- WAYLAND is detected,
- VMWare virtualization is detected,
- rendering pipeline is not a software one (llvmpipe).
As a side effect, a system property 'jbr.virtualization.information'
is set to the value of detected virtualization type. The value is the
same as provided by JFR.

(cherry picked from commit f6acd65d32)
2025-02-05 01:02:42 +01:00
Sergey Shelomentsev
7800856f76 set version for building jbr-api
(cherry picked from commit 6a0113fd07)
2025-02-05 01:02:42 +01:00
Sergey Shelomentsev
88b258e072 get rid of build-jbr-api scripts
(cherry picked from commit 1c8496e757)
2025-02-05 01:02:42 +01:00
Vitaly Provodin
7a92b43901 clean up exclude lists
(cherry picked from commit de6d9f328f)
2025-02-05 01:02:42 +01:00
Sergey Shelomentsev
c38972150b JBR-5194 add regressions tests for custom decorations support
with fix for JBR-5300 Change source code and test files to use GPL license

(cherry picked from commit 5fc82006c4)
2025-02-05 01:02:42 +01:00
Sergey Shelomentsev
cebdca6e10 build jbr-api as a part of bundle build
(cherry picked from commit 45efe7fdd5)
2025-02-05 01:02:42 +01:00
Vitaly Provodin
870891a1a4 Update README.md
(cherry picked from commit dd24017389)
2025-02-05 01:02:41 +01:00
Vitaly Provodin
ed8b55c114 Update README.md
(cherry picked from commit 45d7501c9f)
2025-02-05 01:02:41 +01:00
Artem Semenov
6429e2fd34 JBR-5289 If the label has the role of a hyperlink, VO still pronounces it as plain text (#215)
(cherry picked from commit 675ca2f02e)
2025-02-05 01:02:41 +01:00
Alexey Ushakov
29136f21cc JBR-5279 restore saving jbr native symbols bin/server/jvm.pdb
(cherry picked from commit 887b9dbcac)
2025-02-05 01:02:41 +01:00
Sergey Shelomentsev
c6b83a9b6c JBR-4875 update test to use new JBR API window custom decorations
(cherry picked from commit df92d71389)
2025-02-05 01:02:41 +01:00
Vitaly Provodin
45b4b5db15 Update README.md
(cherry picked from commit 373482ffc4)
2025-02-05 01:02:41 +01:00
Artem Semenov
c19a2eabae JBR-5269 Announcement priorities not set correctly (#214)
(cherry picked from commit c34aa6fc6f)
2025-02-05 01:02:41 +01:00
Vitaly Provodin
86ae32fa3e Update README.md
(cherry picked from commit 3631c19265)
2025-02-05 01:02:41 +01:00
Artem Semenov
0c72795af2 JBR-5248 exception in accessible announcing
(cherry picked from commit a4e0f6018f)
2025-02-05 01:02:41 +01:00
Vitaly Provodin
739e37a40c update exclude list on results of 21_b9 test runs
(cherry picked from commit 9f04c32c10)
2025-02-05 01:02:41 +01:00
Vitaly Provodin
af962cd973 JBR-5217 enable NVDA support in Windows builds
(cherry picked from commit afc5710f21)
2025-02-05 01:02:41 +01:00
Vitaly Provodin
c5146e47a8 Update README.md
(cherry picked from commit df4fd03fba)
2025-02-05 01:02:41 +01:00
AMPivovarov
201ff3b86a JBR-5213 JBR API v0.0.9 - add GraphicsUtils (#208)
* relax type constraints in BltBufferStrategy.getDrawGraphics

(cherry picked from commit 715b615d88)
2025-02-05 01:02:41 +01:00
Artem Semenov
99228e7d23 JBR-5221 Add announcing to JBRAPI
(cherry picked from commit 7189d50b76)
2025-02-05 01:02:41 +01:00
Vitaly Provodin
667c21a8cd update exclude list on results of 21_b8 test runs
(cherry picked from commit 17d5e3895b)
2025-02-05 01:02:41 +01:00
Artem Semenov
ba203d4d97 JBR-4170 Implement API for announcing
(cherry picked from commit d7f14bf793)
2025-02-05 01:02:40 +01:00
Vitaly Provodin
4d91e3fc20 update exclude list on results of 21_b7 test runs
(cherry picked from commit e40cdc800e)
2025-02-05 01:02:40 +01:00
Vitaly Provodin
eac6ba04eb update exclude list on results of stability checking runs due to 8253184
(cherry picked from commit 166924f5ed)
2025-02-05 01:02:40 +01:00
Artem Bochkarev
9a4fb48262 JBR-3575 use flag processEvents in LWCToolkit.invokeAndWait
(cherry picked from commit dcf9ff3315)
2025-02-05 01:02:40 +01:00
Vitaly Provodin
04c53efaf8 exclude several tests from runs on machines with enabled VoiceOver
(cherry picked from commit 8040e574e4)
2025-02-05 01:02:40 +01:00
Anton Tarasov
9610ab600d JBR-4355 javax/swing/GraphicsConfigNotifier/StalePreferredSize.java: # C [libobjc.A.dylib+0x90ff] objc_release+0x1f
(cherry picked from commit c0b2b59d4a)
(cherry picked from commit 0691a5230c)
2025-02-05 01:02:40 +01:00
Anton Tarasov
8550ab09f2 JBR-4362 [mac] system menu opens with duplicated items
(cherry picked from commit e32defe49d)
(cherry picked from commit 2d1e14f01d)
2025-02-05 01:02:40 +01:00
Anton Tarasov
9b38fc6661 JBR-4328 remove LWCToolkit.unsafeNonblockingExecute
(cherry picked from commit 9a3f31a6c4)
(cherry picked from commit f9a02266a0)
2025-02-05 01:02:40 +01:00
Anton Tarasov
05847b9756 JBR-4134 PyCharm is slow and unusable on MacBook Pro with M1
(cherry picked from commit 36190505f5)

with fix for JBR-5300 Change source code and test files to use GPL license

(cherry picked from commit cebc6ed818)
2025-02-05 01:02:40 +01:00
Anton Tarasov
4d2860cd52 JBR-4284 Sub items of main menu options are not displayed
A regression of JBR-4208 LWCToolkit.invokeAndWait should not stuck on invocation loss

(cherry picked from commit c464e4748e)
(cherry picked from commit 42d07c4f0c)
2025-02-05 01:02:40 +01:00
Anton Tarasov
8d7a653f29 JBR-4119 UI freezes at sun.lwawt.macosx.CAccessibility.getChildrenAndRoles
(cherry picked from commit 6ba79774d8)
(cherry picked from commit e1623dc301)
2025-02-05 01:02:40 +01:00
Anton Tarasov
59881779d1 JBR-4106 PyCharm hangs with 100% CPU usage on one core
with fix for JBR-5300 Change source code and test files to use GPL license

(cherry picked from commit 9deef18d46)
2025-02-05 01:02:40 +01:00
Anton Tarasov
38ccf6314c JBR-4208 LWCToolkit.invokeAndWait should not stuck on invocation loss
including JBR-4543 (NPE: IdeEventQueue.lambda$getNextEvent$0)

(cherry picked from commit b16d847947)
2025-02-05 01:02:40 +01:00
Anton Tarasov
9031d0775c JBR-3413 use timeout in CAccessibility.invokeAndWait
(cherry picked from commit e7009db076)

with fix for JBR-5300 Change source code and test files to use GPL license

(cherry picked from commit bd9d4cf182)
2025-02-05 01:02:40 +01:00
Vitaly Provodin
a5cee78983 update exclude list on results of 21_b1447 test runs
(cherry picked from commit 3502c53a16)
2025-02-05 01:02:40 +01:00
Vitaly Provodin
d575e05513 Update README.md
(cherry picked from commit fcbfb32b13)
2025-02-05 01:02:39 +01:00
Vitaly Provodin
8e0db7ee44 update exclude list on results of main.1441 test runs
(cherry picked from commit 7194b34979)
2025-02-05 01:02:39 +01:00
Alexey Ushakov
08c079aed0 JBR-5112 Large bold square whitespaces after waking up the laptop / connecting display
Clear primary surface data of VolatileSurfaceManager on display change event

(cherry picked from commit de708896a6)
2025-02-05 01:02:39 +01:00
Artem Semenov
04053d0548 JBR-5118 VoiceOver does not speak the label associated with the combobox (#194)
JBR-5118 VoiceOver does not speak the label associated with the combobox

(cherry picked from commit b6fc471cd0)
2025-02-05 01:02:39 +01:00
Artem Semenov
581405bef8 JBR-4235 Context menu not readable after opening on Mac OS
(cherry picked from commit 83d6b20711)
2025-02-05 01:02:39 +01:00
Artem Semenov
1bdaf7d463 JBR-4012 On Idea Vo often speeks selected element of tables, lists, and trees.
(cherry picked from commit 47783c1c85)
2025-02-05 01:02:39 +01:00
Artem Semenov
4a01bc4791 JBR-3868 Combobox list is not voiced of VoiceOver
(cherry picked from commit 1f777d72ea)
2025-02-05 01:02:39 +01:00
Alexey Ushakov
3d88ad4dfa JBR-5041 macOS: SIGSEGV at [libawt_lwawt] getRenderEncoder:(dstOps == NULL)
Protected code from using NULL dstOps

(cherry picked from commit 44c76b8b99)
2025-02-05 01:02:39 +01:00
Alexey Ushakov
e75d930089 JBR-4856 macOS: SIGSEGV at [libawt_lwawt] MTLTR_DrawGlyphList
Clear glyph caches after switching contexts. Keep encoders in sync with graphics devices. Minor refactoring

(cherry picked from commit e2ed6bf8dd)
2025-02-05 01:02:39 +01:00
Dmitry Batrak
9d131de125 JBR-5109 New frame doesn't get focused sometimes if it's shown right after popup is closed
(cherry picked from commit 693d317c0c)
(cherry picked from commit 6a153c09a8)
2025-02-05 01:02:39 +01:00
Vitaly Provodin
f19919c157 Update README.md
(cherry picked from commit 0a469f5069)
2025-02-05 01:02:39 +01:00
Alexey Ushakov
3879448092 JBR-4959 [macOS Ventura] Screen flickering after OS update when IDE is full screen
Do not fire deliverChangeBackingProperties notification for the view if there is no change between layer and window scales. Also, do not fire displayChanged for display profile only changes.

(cherry picked from commit 87c092d4ec)
2025-02-05 01:02:39 +01:00
Nikita Provotorov
9ee6608b3f JBR-5075: macOS: KEY_PRESSED event for "Cmd N" is not emitted if used as a JMenuItem accelerator and apple.laf.useScreenMenuBar=true.
- Improves the fix of JBR-3544 to allow "Cmd N" and "Ctrl N" to reach AWT if they're actually the ones which were pressed.
- Adds a regression test.

(cherry picked from commit 61a1b70d73)
(cherry picked from commit c3f068760d)
2025-02-05 01:02:39 +01:00
Victor Kropp
d85a83fee9 Update README.md
Mention Toolbox App in the list of applications built on JetBrains Runtime.

(cherry picked from commit cfa9789515)
(cherry picked from commit acc1a29a25)
2025-02-05 01:02:39 +01:00
Nikita Provotorov
9bb92afb2a Update README.md
Replaced jbr-dev to main and other minor fixes.

(cherry picked from commit 91bea99984)
2025-02-05 01:02:38 +01:00
Vitaly Provodin
86e62a0dd8 update exclude list on results of 17.0.5_b721.3 test runs
(cherry picked from commit 652e397e29)
2025-02-05 01:02:38 +01:00
Alexey Ushakov
e9e50b6386 JBR-5073 [Double-Monitor] java/awt/Window/LocationAtScreenCorner/LocationAtScreenCorner.java: Wrong location
Added check for nil displayID of the window

(cherry picked from commit 6a834fb5e7)
2025-02-05 01:02:38 +01:00
Vitaly Provodin
b78ed443a0 update exclude list on results of 17.0.5_b712.2 test runs
(cherry picked from commit ef68a82141)
2025-02-05 01:02:38 +01:00
Vitaly Provodin
323c12bd6b JBR-4956 reduce width of screenshot by one pixel to exclude caret
(cherry picked from commit dd36d60415)
2025-02-05 01:02:38 +01:00
ngubarkov
de128cf85c JBR-4840 cache screen resolution in XToolkit
(cherry picked from commit b0c0a6ff75)
2025-02-05 01:02:38 +01:00
Alexey Ushakov
4db658fcb7 JBR-4959 [macOS Ventura] Screen flickering after OS update when IDE is full screen
Moving NSWindowDidChangeScreenNotification handler to AWTWindow

fixup! JBR-4959 [macOS Ventura] Screen flickering after OS update when IDE is full screen

(cherry picked from commit 3f5ad0610a)
2025-02-05 01:02:38 +01:00
Dmitry Batrak
046716cae0 JBR-5045 Invisible component can break focus cycle
(cherry picked from commit 0f57a27879)
(cherry picked from commit 8309d820fd)
2025-02-05 01:02:38 +01:00
Vitaly Provodin
5a9b7b19f5 Update README.md
(cherry picked from commit 1fb0b4f098)
2025-02-05 01:02:38 +01:00
Vitaly Provodin
7bbe0bbe18 Update README.md
(cherry picked from commit a8862ab989)
2025-02-05 01:02:38 +01:00
Vitaly Provodin
af1951059d update exclude list on results of 17.0.5_b691.6 test runs
(cherry picked from commit 668a433320)
2025-02-05 01:02:38 +01:00
Vitaly Provodin
6f8d8f4c7c Update README.md
(cherry picked from commit 2cdd0386c3)
2025-02-05 01:02:38 +01:00
Alexey Ushakov
fa1a512c19 JBR-4959 [macOS Ventura] Screen flickering after OS update when IDE is full screen
Replace multiple CHANGE_SCREEN notifications fired around the same time with just one

(cherry picked from commit cd6ca71ea8)
2025-02-05 01:02:38 +01:00
Dmitry Batrak
a21bc81f54 JBR-4988 Transient Z-order violations on macOS
(cherry picked from commit bcba97511c)
(cherry picked from commit 3ff06e954d)
2025-02-05 01:02:38 +01:00
Vitaly Provodin
e2729e0727 JBR-4947 update alpine x64 image up to 3.14
(cherry picked from commit 88f2d7010f)
2025-02-05 01:02:38 +01:00
Vitaly Provodin
070f4866a5 update exclude list on results of 17.0.5_b469.67 test runs
(cherry picked from commit 5ab3a9bf5f)
2025-02-05 01:02:37 +01:00
Vitaly Provodin
e503587080 Update README.md
(cherry picked from commit 61d47b2fd3)
2025-02-05 01:02:37 +01:00
Alexey Ushakov
217b03f6f4 JBR-4950 src\java.desktop\windows\native\libawt\windows\awt_FileDialog.cpp: warning C4267: '+=': conversion from 'size_t' to 'UINT', possible loss of data
Added casts to resolve warnings

(cherry picked from commit f5c1a03bf5)
2025-02-05 01:02:37 +01:00
Vitaly Provodin
b982ec634b update Commit and Full testing exclude list on results of jbr17.668 test runs
(cherry picked from commit e7e823a0a3)
2025-02-05 01:02:37 +01:00
Maxim Kartashev
30983a46cb JBR-4951 In function 'convert_to_java_array': error: comparison of integer expressions of different signedness
(cherry picked from commit 4293e2832c)
2025-02-05 01:02:37 +01:00
Vitaly Provodin
c733a2ae37 JBR-4089 add modules sun.awt sun.awt.image sun.java2d
(cherry picked from commit 2cae8fb09c)
2025-02-05 01:02:37 +01:00
Vitaly Provodin
60f142fd86 update exclude list for Commit testing
(cherry picked from commit c037eec3ac)
2025-02-05 01:02:37 +01:00
Vitaly Provodin
f3e7e489a3 exclude tests failing because of JBR-4933, JBR-4934
(cherry picked from commit 6f78d1b02c)
2025-02-05 01:02:37 +01:00
Alexey Ushakov
348cfeb851 JBR-4731 SIGILL caused by NPE Cannot invoke "java.awt.GraphicsConfiguration.getDevice()" because "config" is null
Handled null device in platform window

(cherry picked from commit 9e52c15ec7)
2025-02-05 01:02:37 +01:00
Maxim Kartashev
24686c6697 Move JBR README.md to .github/
(cherry picked from commit b69b12f489)
2025-02-05 01:02:37 +01:00
Svyatoslav Vlasov
d86075d424 Add ProjectorUtils to jbr-api (#181)
* Add ProjectorUtils to jbr-api

Co-authored-by: Sviatoslav Vlasov <Sviatoslav.Vlasov@jetbrains.com>
(cherry picked from commit c8ccc83a6e)
2025-02-05 01:02:37 +01:00
Nikita Tsarev
d616594e79 JBR-3941 Make apple.awt.captureNextAppWinKey default to false
(cherry picked from commit ea29fc8942)
2025-02-05 01:02:37 +01:00
Vitaly Provodin
5d13777951 JBR-4912 jb/java/api/frontend/CustomTitleBarDoubleClick.java intermittently throws java.awt.AWTError
(cherry picked from commit ff7ca451fe)
2025-02-05 01:02:37 +01:00
Maxim Kartashev
946e84ec98 exclude java/awt/dnd/AcceptDropMultipleTimes/AcceptDropMultipleTimes.java due to JBR-4880 on windows
(cherry picked from commit 2d98733ab5)
2025-02-05 01:02:37 +01:00
Alexey Ushakov
8a019384fc JBR-4710 macOS: SIGSEGV at sun.java2d.metal.MTLLayer.blitTexture
Added check for disposed texture in the MTLLayer

(cherry picked from commit c27d8a7c5e)
2025-02-05 01:02:37 +01:00
Nikita Gubarkov
e82a61f012 JBR-4890 Fix variation selectors font fallback on macOS
If font for a given variation selector not found, try without variation selector

(cherry picked from commit 7505b502d7)
2025-02-05 01:02:36 +01:00
Artem Bochkarev
6b22bdc87e JBR-4907 remove custom view for osx system menu items
Just revert "JBR-3131: support custom view for system menu items"

(cherry picked from commit 548345c202)
2025-02-05 01:02:36 +01:00
Vitaly Provodin
d57a9396dd exclude java/awt/FullScreen/AltTabCrashTest/AltTabCrashTest.java due to JBR-4905 on windows&linux
(cherry picked from commit 8150b0e5e7)
2025-02-05 01:02:36 +01:00
Alexey Ushakov
44b56c7566 JBR-4897 Reconnecting multiscreen monitor displays blank IDE
Handled NSWindowDidChangeScreenNotification, resolved race condition in window peer displayChanged listener

(cherry picked from commit 1e697c8623)
2025-02-05 01:02:36 +01:00
Vitaly Provodin
36e2ead79d exclude jb/java/jcef/HandleJSQueryTest3314.sh due to JBR-4866 on linux
(cherry picked from commit d619e3320a)
2025-02-05 01:02:36 +01:00
Vitaly Provodin
c761d6febf exclude some tests due to JBR-4880 on windows
(cherry picked from commit 1a9fb2cfa2)
2025-02-05 01:02:36 +01:00
Vitaly Provodin
4129c6883e exclude javax/swing/JInternalFrame/8020708/bug8020708.java due to JBR-4879 on windows
(cherry picked from commit 85ba459fae)
2025-02-05 01:02:36 +01:00
Vitaly Provodin
af70ae2242 exclude java/awt tests which do not close child processes/windows
(cherry picked from commit 3cf2b36323)
2025-02-05 01:02:36 +01:00
Vitaly Provodin
8e0784994e exclude java/awt/FullScreen/NoResizeEventOnDMChangeTest/NoResizeEventOnDMChangeTest.java and java/awt/FullScreen/UninitializedDisplayModeChangeTest/UninitializedDisplayModeChangeTest.java due to 7188711 on linux-all
j

(cherry picked from commit 0b3f6caedd)
2025-02-05 01:02:36 +01:00
Maxim Kartashev
eaed463a62 JBR-4877 WARNING: JNI local refs: 33, exceeds capacity: 32
(cherry picked from commit a10770c49d)
2025-02-05 01:02:36 +01:00
Artem Bochkarev
e1b5c69dfc JBR-4876 remove test duplicates
Since next jcef tests were moved into junit suite (inside jcef repository):
 HandleJSQueryTest
 JCEFStartupTest
 LoadPageWithoutUI
 MouseEventAfterHideAndShowBrowserTest
 MouseEventScenario
 MouseEventTest

(cherry picked from commit bd1d06d0bc)
2025-02-05 01:02:36 +01:00
Vitaly Provodin
49cd277a44 JBR-4875 jb/javax/swing/JComboBox/ComboBoxTransparentTittleBarTest.java checks dragging JFrame with Combobox
(cherry picked from commit 8d5472c900)
2025-02-05 01:02:36 +01:00
Dmitry Batrak
555b337a58 JBR-4871 Closed project leaked via KeyboardFocusManager#newFocusOwner
(cherry picked from commit 50c0ce58d3)
(cherry picked from commit 46a0f0d75b)
2025-02-05 01:02:36 +01:00
Maxim Kartashev
4e085b90d2 JBR-4839 Report if wrong shared library is detected at run time
(cherry picked from commit e8c1913562)
2025-02-05 01:02:36 +01:00
Maxim Kartashev
e6e04cc2ff JBR-4848 Cannot invoke "javax.swing.JTextField.getCaret()" because the return value of "java.lang.ref.WeakReference.get()" is null
(cherry picked from commit 7fae4cd2d1)
2025-02-05 01:02:36 +01:00
Alexey Ushakov
f34c0fd7db JBR-4590 macOS: SIGSEGV at [libawt_lwawt] MTLTR_DrawGlyphList
Invalidate glyph cache cell info after switching MTLContext

(cherry picked from commit 664528713e)
2025-02-05 01:02:35 +01:00
Nikita Gubarkov
c3539c5b3e JBR-4815 force hinting for non-antialiased text
(cherry picked from commit 6c3517ae9d)
2025-02-05 01:02:35 +01:00
Maxim Kartashev
9c285c0371 jb/branchdiff.py script to help with release branches
(cherry picked from commit a03f10e9b7)
2025-02-05 01:02:35 +01:00
Nikita Gubarkov
ea0a86c712 JBR-3677 check AppleActionOnDoubleClick property for custom window decorations on macOS
with fix for JBR-5300 Change source code and test files to use GPL license

(cherry picked from commit d71c4b3950)
2025-02-05 01:02:35 +01:00
Alexander Lobas
9451cc3ff1 JBR-4787 Rounded corners for native windows
with fix for JBR-5300 Change source code and test files to use GPL license

(cherry picked from commit 5b4dd9e1ce)
2025-02-05 01:02:35 +01:00
Vitaly Provodin
d52da52cf9 updated JTreg exclude list
(cherry picked from commit 03fba5ebf2)
2025-02-05 01:02:35 +01:00
Alexey Ushakov
985cfb449a JBR-4696 macOS: NPE in -[AWTView viewDidChangeBackingProperties]
Added null pointer checks

(cherry picked from commit b0374bdccf)
2025-02-05 01:02:35 +01:00
MonoBot
6f6ddc6c4b JBR-4809 Update the bundled JetBrains Mono font version
Fonts release 2.242

(cherry picked from commit 641424a3e3)
(cherry picked from commit ab5066f90f)
2025-02-05 01:02:35 +01:00
Alexey Ushakov
7219811f90 JBR-4680 idea window flickers while changing the screen brightness
Update insets in separate notification

(cherry picked from commit e7936d9958)
2025-02-05 01:02:35 +01:00
Maxim Kartashev
a116d6df2d JBR-4562 JBR-4610 Generate hs_err file on SIGABRT
Supported on Linux and MacOS only.
Controlled by -Djbr.catch.SIGABRT=true option; off by default.

with fix for JBR-5300 Change source code and test files to use GPL license

(cherry picked from commit 987ce225b9)
2025-02-05 01:02:35 +01:00
Maxim Kartashev
1b11ed14c3 JBR-4626 MacOS aarch64: SIGSEGV at RenderCache.get / ScaledBlit.getFromCache
Avoid C2-compiled loop crashes by replacing the handcrafted MRU cache
with a more modern LinkedHashMap-based one.

(cherry picked from commit 2f63acf3eb)
2025-02-05 01:02:35 +01:00
Nikita Gubarkov
7c2171952d Allow registering multiple implementations for JBR API services
This greatly reduces boilerplate when dealing with platform-specific code, one can specify multiple target implementation classes, one per platform. First found will be used.

Also added JBRApi.ServiceNotAvailableException to give services ability to validate any custom condition they want.

(cherry picked from commit 02cf2548d5)
2025-02-05 01:02:35 +01:00
Denis Fokin
82912dad6c JBR-4788 "Activate window by mouse hover" Windows option isn't supported by JBR 17
backport JBR-1991 (Focus problems in Windows with X-Mouse style focus) from JBR 11

(cherry picked from commit c8ad353f45)
(cherry picked from commit a52ed88377)
(cherry picked from commit 37c6d0b417)
2025-02-05 01:02:35 +01:00
Alexey Ushakov
796c53efea JBR-4784 Extra allocations of MTLRenderPipelineDescriptor affects performance in metal pipeline
Remove extra allocations

(cherry picked from commit e1fe3a3807)
2025-02-05 01:02:34 +01:00
Alexey Ushakov
db43ebbd54 JBR-4774 macOS: SIGILL at [libsystem_kernel] __kill in NPE / VolatileSurfaceManager.displayChanged / __displaycb_handle_block_invoke
Guarded against multiple displayChanged() notifications

(cherry picked from commit 165c9aa3aa)
2025-02-05 01:02:34 +01:00
Dmitry Batrak
67cdb216a8 JBR-4782 Synergy keyboard/mouse input: window disabled after bringing IntelliJ into focus
(cherry picked from commit f863a14b19)
(cherry picked from commit 34ec3053ab)
2025-02-05 01:02:34 +01:00
Alexey Ushakov
f23420e7e9 JBR-4363 Changes in fonts rendering between JBR11 and JBR17
Do not use hinting for generating outlines

(cherry picked from commit 7bb3a76942)
2025-02-05 01:02:34 +01:00
Alexey Ushakov
f7ed71eff5 JBR-3100 Exception in NSApplicationAWT: java.lang.NullPointerException at java.desktop/sun.lwawt.LWComponentPeer.windowToLocal
Added null check

(cherry picked from commit 0c23ef45ba)
2025-02-05 01:02:34 +01:00
Alexey Ushakov
727a7f44c1 JBR-4774 macOS: SIGILL at [libsystem_kernel] __kill in NPE / VolatileSurfaceManager.displayChanged / __displaycb_handle_block_invoke
Added null check

(cherry picked from commit 73f025e9e5)
2025-02-05 01:02:34 +01:00
Alexey Ushakov
cce7b5c95b JBR-3102 Exception in NSApplicationAWT: Invalid parameter not satisfying: !isnan(newOrigin.y)
Handled NAN values with some defaults

(cherry picked from commit f1aed3db71)
2025-02-05 01:02:34 +01:00
Vladislav Rassokhin
44e6a670ea JBR-4263 Improve check_jbr_size.sh
* Fix shellcheck inspections
* Don't silently fail if TOKEN is incorrect

(cherry picked from commit e0ab03ce52)
2025-02-05 01:02:34 +01:00
Maxim Kartashev
2dd64b95ea JBR API v0.0.4
JBR-4746 Added jetbrains.api.verifyBytecode VM option for generated bytecode verification

JBR-4753 Added JBR API for custom desktop actions

Added jetbrains.api.verbose system property for easier JBR API troubleshooting

Also fixed dependency scanning optimization by allowing search in known proxy interfaces outside com.jetbrains

JBR-3511 Way to customize implementation of java.awt.Desktop.browse()

Provided Desktop.setDesktopActionsHandler() and DesktopActionsHandler
interface, which methods will be invoked instead of the standard actions
provided that DesktopActionsHandler.isSupported() is true for the
corresponding action.

(cherry picked from commit 92b84906df)
2025-02-05 01:02:34 +01:00
Maxim Kartashev
82acda290a JBR-3101 Exception in NSApplicationAWT: java.lang.NullPointerException at java.desktop/sun.lwawt.macosx.CPlatformComponent.setBounds
After CPlatformComponent.setBounds() was changed to allow for platformWindow.getPeer() == null, a few exceptions appeared that suggest platformWindow can also be null. This commit safeguards against this situation as well.

It seems that this can only be the case if the instance is created from outside of JDK, so Objects.requireNonNull() may help to catch the perpetrator.

(cherry picked from commit 5da08dcd3a)
2025-02-05 01:02:34 +01:00
Dmitry Batrak
5803b524ca JBR-4720 Focus state is broken after certain operations when VoiceOver is enabled
(cherry picked from commit dc1b49b5a6)
(cherry picked from commit 51df5fbf67)
2025-02-05 01:02:34 +01:00
Dmitry Batrak
a4abc5522a JBR-4673 Focus moves to another application on file dialog closing
(cherry picked from commit 7468974488)
(cherry picked from commit 72a74312b7)
2025-02-05 01:02:34 +01:00
Dmitry Batrak
89c1e3ec8e JBR-4665 Focus 'jitter' on window showing in WSLg
(cherry picked from commit 9b32c2a577)
(cherry picked from commit 2952a2eeb4)
2025-02-05 01:02:34 +01:00
Nikita Gubarkov
1088965039 JBR-2523 JBR-2917 Fix emoji, ZWJ and font fallback
Implement rendering of colored outlines and bitmap glyphs in OutlineTextRenderer
Add Segoe UI Emoji to font fallback on Windows
Require layout for some emoji-related unicodes
Fix variation selectors and ZWJ

(cherry picked from commit 53059331b1)
2025-02-05 01:02:34 +01:00
Alexey Ushakov
ffd459336f JBR-2210 IDEA fails to start (JVM crashes) when using the -Dfile.encoding=UTF-8in IDEA's vmoptions file
Returning devanagari subset back for ja.UTF-8 to get non-null font name from WFontConfiguration.getTextComponentFontName(). It is a regression from JDK-8208179.

(cherry picked from commit b51254a975)
(cherry picked from commit 0588b3a885)
2025-02-05 01:02:34 +01:00
Dmitry Batrak
05c8d41021 JBR-1987 Korean/Thai characters not printed properly in annotation tooltip (e.g. spellchecker)
This changes the fonts JDK uses for font fallback on Windows. These used to be DokChampa (for Thai) and Batang/Gulim/Gulim (for Korean).
Those fonts are not available by default on Windows 10, user needs to install supplementary font language packs to get them.
Now the following fonts will be used - Tahoma (for Thai) and Malgun Gothic (for Korean). They are available by default
on Windows 7, 8 and 10.

port from JBR 11 to JBR 15 (cherry picked from commit 850653192b)

cherry picked from commit 2bf43a57ab

Kept only Thai-related changes - Korean-related issues are now fixed in OpenJDK as per JDK-8190907

(cherry picked from commit 56139b5800)
2025-02-05 01:02:33 +01:00
artem.bochkarev
c707d77503 JBR-4581 JCEF tests fail due to compilation errors
The problem was in commit "JBR-4512 windows: include pdb-files into jbrsdk": rsync can replace file lib/modules.
rsync is replaced with cp

(cherry picked from commit 6cd310aaa8)
2025-02-05 01:02:33 +01:00
Vitaly Provodin
6a1f597c39 exclude sun/java2d/DirectX/RenderingToCachedGraphicsTest/RenderingToCachedGraphicsTest.java on linux-all due to 8252812
(cherry picked from commit 336230c628)
2025-02-05 01:02:33 +01:00
Vitaly Provodin
d555a562e0 exclude sanity/client/SwingSet/src/ColorChooserDemoTest.java on windows-all due to 8278582
(cherry picked from commit 07e8b19419)
2025-02-05 01:02:33 +01:00
Alexey Ushakov
5bb8c1b32c JBR-4636 Some JWindow tests failed due to wrong scaling
Take into account custom scale via sun.java2d.uiScale

(cherry picked from commit 5a91de055f)
2025-02-05 01:02:33 +01:00
Nikita Gubarkov
ad7221c9ef 8289189: Fix ./configure on WSL1
(cherry picked from commit 617ed45c5c)
2025-02-05 01:02:33 +01:00
Alexey Ushakov
1538a00f65 JBR-4619 Window content scale wrong after disconnecting external display / waking OS from sleep
Use viewDidChangeBackingProperties notification to adjust a window layer scale

(cherry picked from commit abb34d2295)
2025-02-05 01:02:33 +01:00
Vitaly Provodin
e23ad4a840 exclude vmTestbase/vm/jit/LongTransitions due to 8271615 on macOS
(cherry picked from commit 66e8a68de9)
2025-02-05 01:02:33 +01:00
Maxim Kartashev
c3b3843fba JBR-4602 Unexpected NoSuchFileException running Rider test
This reverts commits for JBR-3680, JBR-4118, and JBR-4485.

(cherry picked from commit 5a165aa533)
2025-02-05 01:02:33 +01:00
Nikita Gubarkov
38c9e7868a JBR-4373 Add mapping for .NewYork-* and .SFArabic-* system fonts
(cherry picked from commit e34f1abedc)
2025-02-05 01:02:33 +01:00
Alexander Lobas
f541b2f885 JBR-4563 Rounded corners for native Window on Mac OS (#156)
* JBR-4563 Rounded corners for native Window on Mac OS

(cherry picked from commit 740a086a00)
2025-02-05 01:02:33 +01:00
Alexander Lobas
01cceaa9d9 JBR-4563 Rounded corners for native Window on Mac OS
(cherry picked from commit 4aecaafa7c)
2025-02-05 01:02:33 +01:00
Alexander Lobas
7648a84286 JBR-4305 (#119)
* IDEA-283934 Top panel (toolbar, Editor tabs) hides under the Mac menu in full-screen mode

* IDEA-283934 Top panel (toolbar, Editor tabs) hides under the Mac menu in full-screen mode

* JBR-4305 IDEA-283934 Top panel (toolbar, Editor tabs) hides under the Mac menu in full-screen mode

* JBR-4305 IDEA-283934 Top panel (toolbar, Editor tabs) hides under the Mac menu in full-screen mode

(cherry picked from commit e91239081a)
2025-02-05 01:02:33 +01:00
Alexey Ushakov
f116201ac1 JBR-4591 macOS: SIGILL at [libsystem_kernel] __kill in -[__NSMallocBlock__ removeFromSuperview]: unrecognized selector sent to instance
Verified if windowDragView is present

(cherry picked from commit c45d897c4b)
2025-02-05 01:02:33 +01:00
Artem Bochkarev
07ef808a03 JBR-4475: fixed browsers numeration in test
theoretically it can cause 2 requests with the same query_id: "cef_query_2" (when first browser finishes loading after the creation of second one)

(cherry picked from commit e95de19533)
2025-02-05 01:02:33 +01:00
Artem Bochkarev
fd3a12c366 JBR-4456: fixed HandleJSQueryTest
first invocation of dispatch(WindowEvent.WINDOW_CLOSING) calls System.exit() internally (because of setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE))

(cherry picked from commit 0f9afa7fbc)
2025-02-05 01:02:32 +01:00
Vitaly Provodin
2420bb326c exclude javax/swing/JToolBar/4529206/bug4529206.java due to 8288707 on linux
(cherry picked from commit 8bc1905696)
2025-02-05 01:02:32 +01:00
Maxim Kartashev
da1d0b3276 JBR-3101 Exception in NSApplicationAWT: java.lang.NullPointerException at java.desktop/sun.lwawt.macosx.CPlatformComponent.setBounds
CWarningWindow doesn't have a peer, so accomodated for that in
CPlatformComponent.setBounds().

(cherry picked from commit f098902457)
2025-02-05 01:02:32 +01:00
Maxim Kartashev
1657e44e16 JBR-4485 Windows: EXCEPTION_ACCESS_VIOLATION at sun.nio.fs.WindowsDirectoryStream$WindowsDirectoryIterator.readNextEntry
As a precaution, range-check the offset returned by WinAPI before
using it to read raw memory with Unsafe.

(cherry picked from commit cfc743741a)
2025-02-05 01:02:32 +01:00
Vitaly Provodin
f7ec741912 JBR-4570 improve synchronization and increase waiting time
(cherry picked from commit d7b11a1925)
2025-02-05 01:02:32 +01:00
Dmitry Batrak
50e5066f45 JBR-4552 Windows revert back after initial move/resize in Cygwin/X
(cherry picked from commit 6dc194e089)
(cherry picked from commit 9c2eccb07c)
2025-02-05 01:02:32 +01:00
Manuel Unterhofer
bfc5de0093 FL-11598 Fix accidental reset of window configuration for custom decoration on macOS
This also aligns the handling of the style mask with how the other settings are applied: It uses a client property now. This property is now also applied directly on peer initialization so that there is no need to re-apply, and the window directly appears in the correct configuration.

(cherry picked from commit 4f254fac9d)
2025-02-05 01:02:32 +01:00
Nikita Provotorov
37ab739b36 JBR-4394, IDEA-246833: refactoring and blocking the fix of JBR-1573 to recreate IMs and ICs during preediting.
(cherry picked from commits 7a36587db8d3d5a63c5691243cd5bf56733c06e6, 321a4a3f83)

(cherry picked from commit be5f54fc99)
2025-02-05 01:02:32 +01:00
Nikita Provotorov
2b378d703a JBR-4394, IDEA-246833: fixup of JBR-2444.
(cherry picked from commit ef262dc8bb)
(cherry picked from commit b026461771)
2025-02-05 01:02:32 +01:00
Dmitry Batrak
3a86b596d3 JBR-4537 Popup windows shown for a background window cause app icon to blink in taskbar on KDE
(cherry picked from commit 704ffcc0ee)
2025-02-05 01:02:32 +01:00
Dmitry Batrak
29d6fd4b2f JBR-4535 Popup windows disappear on mouse hover when 'Focus strictly under mouse' policy is used in KDE
(cherry picked from commit a70a83e7fe)
2025-02-05 01:02:32 +01:00
Alexey Ushakov
c1d024e54a JBR-3828 restore details for Java exceptions in crash dumps handled by ObjC
Added exception.toString() to jbr_err_* log

(cherry picked from commit 478bd6cdd7)

Added java stack of the exception to jbr_err_* log

(cherry picked from commit e97f728e93)

Also return the static string "OutOfMemoryError" in case of that
exception has been thrown in order to avoid crashing while reporting an
exception in an out-of-memory situation.

(cherry picked from commit b64f2a86ad)
2025-02-05 01:02:32 +01:00
Vitaly Provodin
1671480bb3 exclude jb/java/awt/Window/ZOrderOnModalDialogActivation.java from S2 runs on Windows and Linux
(cherry picked from commit c1cb686198)
2025-02-05 01:02:32 +01:00
Vitaly Provodin
abe78a9df0 exclude javax/swing/plaf/nimbus/TestNimbusOverride.java on windows due to 8253184
(cherry picked from commit 5c6f2241db)
2025-02-05 01:02:32 +01:00
Vitaly Provodin
edda461538 exclude java/awt/Graphics2D/DrawString/DrawRotatedStringUsingRotatedFont.java on linux-aarch64 only due to 8266283
(cherry picked from commit cc5f59a5ed)
2025-02-05 01:02:31 +01:00
Artem Bochkarev
f2929e4abe JBR-4473: fixed native part of SystemHotkeyReader
(cherry picked from commit 4d96436851)
2025-02-05 01:02:31 +01:00
Dmitry Batrak
fd8f03ecf5 JBR-1740 Menu remains open when application loses focus
(cherry picked from commit f987d22cd2)
(cherry picked from commit 4a7913c9e6)
2025-02-05 01:02:31 +01:00
Vitaly Provodin
9da9287323 exclude Frame/RestoreToOppositeScreen/RestoreToOppositeScreen.java from S2 runs due to 8286840
(cherry picked from commit 811db62fec)
2025-02-05 01:02:31 +01:00
Vitaly Provodin
4d966775db exclude java/awt/Mouse/GetMousePositionTest/GetMousePositionWithPopup.java due to 8282232
(cherry picked from commit 17d6d1047e)
2025-02-05 01:02:31 +01:00
Maxim Kartashev
757dd0dce4 JBR-4471 Linux: popup appears on wrong screen after desktop scale change
When screen scale changes, the cached screen bounds must be explicitly
updated. Call resetBoundsCache() whenever X11GraphicsDevice.scale has
changed.

(cherry picked from commit 1bb3b2fa32)
2025-02-05 01:02:31 +01:00
Manuel Unterhofer
89b0f74284 Merge fullscreen handlers for transparent title bar into existing ones
(cherry picked from commit a992612585)
2025-02-05 01:02:31 +01:00
Manuel Unterhofer
a98e639910 FL-11420 Fix view hierarchy restoration for full-screen mode on macOS
(cherry picked from commit f708ad2c57)
2025-02-05 01:02:31 +01:00
Nikita Gubarkov
2b8c946e65 JBR-4364 Port macOS native file dialog patches
IDEA-146669 Enable Mac native file dialogs
IDEA-159507 Mac native dialogs: multiple open dialogs are possible
JBR-1784 File dialogs aren't themed on macOS
JBR-1752 Floating windows overlap modal dialogs
JBR-2005: don't set appearance of file chooser if OSX version < 10.14
JBR-4546 Focus is not returned back to IDE after closing "Open" dialog

(cherry picked from commit e5646125e4)
2025-02-05 01:02:31 +01:00
Dmitry Batrak
d588c28fd5 JBR-4463 Activating app-modal dialog brings all app windows to front
(cherry picked from commit 2b05925276)

includes fix for JBR-4642 regression: "focus follows mouse" broken for modals, I need to click into them

(cherry picked from commits c55bf03680, ec748f84fb)

includes fix for JBR-4957 regression: "Modal dialog is hidden by sibling popup on Linux"

(cherry picked from commit ea8da3cbe5)

includes fix for JBR-4968: jb/java/awt/Window/ModalDialogAndPopup.java intermittently fails by TimeoutException

(cherry picked from commit 2e9ab0cb06)
(cherry picked from commit 72b9219964)
2025-02-05 01:02:31 +01:00
Maxim Kartashev
6e234c64a1 JBR-4464 Error building latest jbr-dev after JDK-8285730
(cherry picked from commit 8b0ae02f8d)
2025-02-05 01:02:31 +01:00
Maxim Kartashev
63ad1473e6 JBR-4118 NIO methods fail on Google Drive's virtual volume
If NtQueryDirectoryFile() failed with STATUS_INVALID_PARAMETER,
try again asking for less information with the FileDirectoryInformation
option as "information class". This option works on a mounted
Google Drive, but it doesn't provide file ids, which speed
up file listing. So it is used only as a fall-back solution.

(cherry picked from commit 82693aa985)
(cherry picked from commit 732a5c9ad6)
2025-02-05 01:02:31 +01:00
Maxim Kartashev
3acc4d098e JBR-3680 Cherry-pick Google's NIO patches to get faster file listing
Fix regression introduced by Google's NIO patches:
- do not attempt to get the next entry after the directory stream has
been closed already,
- fix FaultyFileSystem that is used in StreamTest.java to throw
the right exception even when getFileAttributeView() is used instead of
readAttributes(),
- removed unnecessary type cast that caused a compilation warning.

Added a test for walking a directory with a non-latin name.

(cherry picked from commit 152a4e886d)
(cherry picked from commit f5638a96b9)
2025-02-05 01:02:31 +01:00
Renaud Paquay
433ac44290 JBR-3680 Improve performance of WindowsDirectoryStream
Use `NtQueryDirectoryInformation` instead of `FindFirst/FindNext` to
retrieve the list of entries of a directory.

`NtQueryDirectionInformation` has 2 main benefits over
`FindFist`/`FindNext`:

* Performance is about 40% faster

* Each retrieved entry retrieved contains a 64-bit `FileId` in addition
  to the usual attributes, ensuring that returned `java.nio.Path`
  instances hold onto a `BasicFileAttributes` instance that exposes a
  non-null `java.nio.file.attribute.BasicFileAttributes.fileKey()`.

This change also requires creating a new WindowsFileKey class, similar
to UnixFileKey class, so that
`java.nio.file.attribute.BasicFileAttributes.fileKey()` can return an
Object instance that can be used to compare files for equality.

With this change, the Windows implementation of Files.walkFileTree is
about 40% faster when the FOLLOW_LINKS option is not used, and about
2.5x faster when the FOLLOW_LINKS option is used.

When the FOLLOW_LINKS option is used, most calls to
`Files.isSameFile`, which is expensive as it requires 2 file I/O
operations, are avoided because the Path entries returned by the
new WindowsDirectoryStream implementation now contain a non-null
BasicFileAttributes.fileKey(). The remaining calls to
`Files.isSameFile` are performed when Files.walkFileTree need
to compare the initial directory with other entries.

Change-Id: Id79d89d477a6d5dcf151c63a9d6072c6f7ef43b2

(AKA JBR-3680 Cherry-pick Google's NIO patches to get faster file listing)

(cherry picked from commit 7c2d7541ba)
(cherry picked from commit 7a4078bf29)
2025-02-05 01:02:31 +01:00
Maxim Kartashev
baa6ac92cd JBR-3498 Windows: exception when trying to delete a directory with a trailing space
Allow Windows Path to have a trailing space despite Windows naming conventions
discouraging it. Many programs - including Explorer - successfully work
with such files or directories.

(cherry picked from commit 64a468280c)
2025-02-05 01:02:31 +01:00
Dmitry Batrak
f7e9d4d76a JBR-1518 JBR 11 does not support chain of popups on Linux
(cherry picked from commit 849356ee01)
(cherry picked from commit b85be77543)
2025-02-05 01:02:30 +01:00
Dmitry Batrak
3ea019c646 JBR-4306 Robot doesn't work as expected in some cases on macOS
(cherry picked from commits 7d69734465, 0f33031484, 3b5ded0d02)

(cherry picked from commit 4557795f2e)
2025-02-05 01:02:30 +01:00
Ryan Osial
22dc8cec22 Cache results of font-config pattern search for reuse
(cherry picked from commit 432f637904)
(cherry picked from commit 17bc232f6f)
(cherry picked from commit ee3a5cdda9)
2025-02-05 01:02:30 +01:00
Maxim Kartashev
83bf0c4592 JBR-3948 Linux: SIGSEGV at [libawt_xawt] Java_sun_awt_X11_XInputMethod_createXICNative
The crashes begin with the call to getDefaultConfig() in
createStatusWindow() returning garbage. With 8280468 fixed, there aren't
many reasons left for it to do so; it must be that the argument to the
call (the screen number) is out of range.

This change eliminates the possibilities to get an absolutely incorrect
screen number by checking the return values of several Xlib functions,
which, when fail, will leave their outgoing arguments uninitialized.
This, in turn, can lead to reading some random memory resulting in
equally random screen number that is later being fed to
getDefaultConfig().

Although on modern systems with Xinerama there should really be no
screen other than zero, as the last resort, this number is also
range-checked in getDefaultConfig() itself.

(cherry picked from commit dec75d7601)
2025-02-05 01:02:30 +01:00
Anton Tarasov
c14ac82adf JBR-4389 [update_1] IDEA UI font becomes too large after disconnecting the external monitor / sleep
(cherry picked from commit 74c977e942)
2025-02-05 01:02:30 +01:00
Anton Tarasov
39d6f9efd6 JBR-4389 IDEA UI font becomes too large after disconnecting the external monitor / sleep
(cherry picked from commit 1288c65208)
2025-02-05 01:02:30 +01:00
Dmitry Batrak
12e0c0a592 remove duplicate bundled JetBrains Mono bold italic font
following JBR-4402

(cherry picked from commit b7e5d3cfcf)
(cherry picked from commit ac765d3d2c)
2025-02-05 01:02:30 +01:00
Dmitry Batrak
6267da196d JBR-4402 The wrong text is rendered in editor
(cherry picked from commit 8c1de95991)
2025-02-05 01:02:30 +01:00
Vitaly Provodin
519378763f JBR-4297 add a regression test
(cherry picked from commit 8e94fff6aa)
(cherry picked from commit 8eb5ce4b34)
2025-02-05 01:02:30 +01:00
Konstantin Bulenkov
49d0736f33 Update JetBrains Mono font to 2.225
(cherry picked from commit 84c7519c7e)
2025-02-05 01:02:30 +01:00
Alexey Ushakov
018cc6df4a JBR-4363 Changes in fonts rendering between JBR11 and JBR17
Resolved merge artifact after applying IDEA-57233 fix

(cherry picked from commit 0e2c16e0f0)
2025-02-05 01:02:30 +01:00
Alexey Ushakov
c0d7d0a611 JBR-3843 IDE text is misaligned vertically when using Consolas font
Use usWinAscent/usWinDescent for metrics on Windows

(cherry picked from commit 4aed6ab51d)
2025-02-05 01:02:30 +01:00
Alexey Ushakov
1ce19d4709 JBR-1110 [JDK11] java/awt/font/Outline/OutlineInvarianceTest.java: Failed for font java.awt.Font[family=Dialog,name=MS Gothic,style=bold,size=30]
Replaced FT_LOAD_NO_HINTING mode for non AA rendering with FT_LOAD_TARGET_LIGHT

(cherry picked from commit 3368768244)
(cherry picked from commit 62b8fd828f)
2025-02-05 01:02:30 +01:00
Alexey Ushakov
527c95c24e JBR-2000 RM 2019.3.1 font rendering regression, normal text is heavier
Added -Djava2d.font.loadFontConfig=bundled to force loading bundled font.conf

(cherry picked from commit 788e078f64)
(cherry picked from commit 052b5d72a2)
2025-02-05 01:02:30 +01:00
Dmitry Batrak
56da9b6497 JBR-4346 [Xfce] Windows are moved unexpectedly between workspaces when modal dialog is shown
(cherry picked from commits ad299f1e74, 800220af16)

(cherry picked from commit d0a2903730)
2025-02-05 01:02:29 +01:00
Alexey Ushakov
008f59eb3a JBR-3827 SIGILL at [libsystem_kernel] __kill in Java Exception at -[CDragSource convertData:]
Added check for drag source

(cherry picked from commit a2b6100b57)
2025-02-05 01:02:29 +01:00
Alexey Ushakov
83e585f54d JBR-3366 SIGILL at [libsystem_kernel] __kill in NSWindowStyleMaskFullScreen cleared on a window outside of a full screen transition
Wrapped the native exception and added logging

JBR-4882 Unable to exit fullscreen mode after Presentation mode was entered (and exited) on macOS

(cherry picked from commit d57e8b631b)
(cherry picked from commit 5bfbdd28f2)
2025-02-05 01:02:29 +01:00
Alexey Ushakov
7c07809c8a JBR-3365 SIGILL at [libsystem_kernel] __kill in java.lang.RuntimeException: Failed to convert, no screen / primaryScreen
Wrapped the native exception and added logging

(cherry picked from commit 6b8308d149)
2025-02-05 01:02:29 +01:00
Dmitry Batrak
53703c3460 JBR-3751 Window content isn't rendered with some window managers on Linux
(cherry picked from commit 8d22e4dcb0)

includes fix for JBR-5046 Incorrect initial window's location in Xfce

(cherry picked from commits 234e705134, 02bc54f864)

includes fix for JBR-5458 Exception at dialog closing

(cherry picked from commit acde759572)
(cherry picked from commit c138965be0)
2025-02-05 01:02:29 +01:00
Vitaly Provodin
0a5fe0a1f4 JBR-4294 split desktop tests to more groups for Commit testing
(cherry picked from commit e2360b07b9)
2025-02-05 01:02:29 +01:00
Dmitry Batrak
bb5b7d3c31 JBR-4281 Window losing focus isn't detected in some cases on macOS
(cherry picked from commit 363650bbf4)

with JBR-4638 Regression: Unable to enter emoji in editor via Emoji & Symbols on macOS

(cherry picked from commit 8b9a00915d)

with JBR-4652 With multiple projects open non-fullscreen, right-click on Dock icon to select the project from the context menu doesn't switch to that project

(cherry picked from commit e34677587d)

with JBR-5134 Input methods can't be dynamically disabled on a focused JComponent

(cherry picked from commit 0a3f4b206d)
(cherry picked from commit 0307ccab3b)
2025-02-05 01:02:29 +01:00
greg
08c1946ca1 macOS: add methods to setup transparent titlebar with custom height (#100)
* macOS: add methods to setup transparent titlebar with custom height

* make windowTransparentTitleBarHeight CPlatfromWindow property

* add windowTransparentTitleBarHeight test

* Prevent mouseUp events on the transparent header on macOS when the window is being dragged

Co-authored-by: Manuel Unterhofer <manuel.unterhofer@jetbrains.com>

Custom macOS window decorations via JBR API

JBR-4460 Fix window drag with custom decorations on macOS

JBR-4553 Add logging to setUpTransparentTitleBar and resetTitleBar

(cherry picked from commit f5552eed4d)
2025-02-05 01:02:29 +01:00
Denis Fokin
3c46ccd400 JBR-4038 [JBR17] Force Touch events are not supported on macOS
Added missing files and handlers from JBR11

(cherry picked from commit 0a82277650)
2025-02-05 01:02:29 +01:00
Alexey Ushakov
d0136bed30 JBR-3901 jbr-dev compile problem
Added transient keyword

(cherry picked from commit 8bd487eca9)
2025-02-05 01:02:29 +01:00
Alexander Lobas
24487d3936 JBR-2893 Big Sur: Add support of opening project as tabs IDEA-257932 Big Sur: IDEA hangs after closing a project tab after exiting and entering full screen
Converted JNF to JNIUtilites

(cherry picked from commit f02e31a440)
(cherry-picked from commit a84736ebcc)
(cherry picked from commit e33f506e48)
2025-02-05 01:02:29 +01:00
Dmitry Batrak
419598389f JBR-3676 WINDOW_ACTIVATED/DEACTIVATED events sent to a frame when child window closes on macOS
(cherry-picked from commit 824f9ebec3)

(cherry picked from commit 41b9f9cf1c)
2025-02-05 01:02:29 +01:00
Dmitry Batrak
11d13f09c8 JBR-3611, JBR-3633, JBR-3666, JBR-3663, JBR-3671, JBR-3673, JBR-4181, JBR-4186, JBR-4893 Interoperability with macOS desktop spaces
(cherry-picked from commits 43fdd6cd26, 75335543f2, a156c6b9bf, 9fdc75969b, 1dcc612a81, 93588d0738, 94a3885bbe, c040e05703, 67b6cd871f, 9040fd56cd, 6349b86b7f)

(cherry picked from commit 4fb4d51b89)
2025-02-05 01:02:29 +01:00
Dmitry Batrak
e2f8e9b5e3 refactor nativeCreateNSWindow call wrapping
as part of JBR-3017

(cherry picked from commit eeef67a335)
(cherry picked from commit 1bb0bf3f82)
2025-02-05 01:02:29 +01:00
Dmitry Batrak
5fbcb38d57 remove excessive wrapping with AccessController (AWTThreading does it internally now)
as part of JBR-3017

(cherry picked from commit f1dd523ba8)
(cherry picked from commit f2449217c1)
2025-02-05 01:02:29 +01:00
Dmitry Batrak
9034287a34 JBR-2971 Log more information about window creation and property changes
(cherry picked from commit 9d86b4d235)
(cherry picked from commit e93eeba9c2)
2025-02-05 01:02:28 +01:00
Dmitry Batrak
026e4da407 JBR-2533 Popup is not focused on click when switching from another application on macOS
(cherry picked from commits d9ff151211, 67b174dc8c, 72b0add80c, 21af1eba85, 2f1d317d87, 6dd334f9f0, cd863bac0d, 010f6fc951, 25e087d269, parts of 7d5ac56b6c, cd6dd5c3cf, e8bbd8ffdd, abfc3e2e79, 50933cd23e)

with fix for JBR-3640 (java/awt/Modal/ModalFocusTransferTests/FocusTransferDWFAppModalTest.java: window Open button lost focus when it should not) and JBR-3979 (Focus is not transferred to parent window)

with fix for JBR-5300 Change source code and test files to use GPL license

with fix for JBR-2651 jb/java/awt/Focus/PopupIncomingFocusTest.java intermittently fails by java.util.concurrent.TimeoutException

(cherry picked from commit 56795d5d06)
2025-02-05 01:02:28 +01:00
Nikita Provotorov
4a3834d778 JBR-4271: JBR17 and dev built without --with-vendor-name parameter have invalid value of the java.vm.vendor property.
Changes the default JBR's vendor from "Oracle Corporation" to "JetBrains s.r.o.".

(cherry picked from commit 0cb7b4565c)
(cherry picked from commit 62b01f9f56)
2025-02-05 01:02:28 +01:00
Nikita Gubarkov
defa0e1387 JBR API v0.0.3
JBR-4228 report HTMINBUTTON, HTMAXBUTTON, HTCLOSE, HTMENU, HTCAPTION targets via JBR API & handle corresponding non-client mouse events for windows with custom decoration

(cherry picked from commit cacbbdc041)
2025-02-05 01:02:28 +01:00
Alexey Ushakov
9c7cf1e5ab JBR-4224 java/awt/image/VolatileImage/GradientPaints.java: Number of mismatches (300000) exceeds limit (54000) with tolerance=5
Updated reg test to handle contentLost event

(cherry picked from commit e6dc0c5b8f)
2025-02-05 01:02:28 +01:00
Vitaly Provodin
bf0cda7746 exclude javax/swing/border/TestTitledBorderLeak.java on windows due to 8213531
(cherry picked from commit c32cf1fe07)
2025-02-05 01:02:28 +01:00
Ivan Lopatin
70e92cfa7e Scale2: exclude java/awt/SplashScreen/MultiResolutionSplash/MultiResolutionSplashTest.java due to 8279190 on macosx-all
(cherry picked from commit 58854d5467)
2025-02-05 01:02:28 +01:00
Nikita Provotorov
252ad9f5aa JBR-3299: The test /jb/sun/awt/macos/NationalLayoutTest/Layout_ABC.java fails on MacOS.
Fixes the Layout_*.java tests by giving them to know the <Ctrl + key> combinations can generate KEY_TYPED event.

(cherry picked from commit eae5198b20)
(cherry picked from commit 072ae64f96)
2025-02-05 01:02:28 +01:00
Vitaly Provodin
daa51bc27d exclude java/awt/Frame/FrameSetSizeStressTest/FrameSetSizeStressTest.java on Wayland
sun/security/pkcs11/Signature/TestDSAKeyLength.java                                 8279941 linux-all

(cherry picked from commit ddd0a7409d)
2025-02-05 01:02:28 +01:00
Alexey Ushakov
d7d649b9b7 JBR-4112 macOS: SIGILL at [libsystem_kernel] __kill in OOME: Java heap space at java.awt.image.DataBufferInt.<init>
Reg test update: replace management api with jfr

(cherry picked from commit 5a0d365094)
2025-02-05 01:02:28 +01:00
Nikita Provotorov
929bd97308 JBR-4207, IDEA-287559: IDEA incorrectly handles AltGr key modifier.
This commit reverts the fix of JDK-8041928 and disables its regression tests.

(cherry picked from commit ba5209ec06)
(cherry picked from commit 19b7745ce3)
2025-02-05 01:02:28 +01:00
Nikita Provotorov
e364ad5ace JBR-4207, IDEA-287559: IDEA incorrectly handles AltGr key modifier.
Renames the test AltGrMustGenerateAltGrModifierTest3838.java to AltGrMustGenerateAltGrModifierTest4207.java.

(cherry picked from commit ed60a9c2bd)
(cherry picked from commit cbacbf6d4e)
2025-02-05 01:02:28 +01:00
Vitaly Provodin
92eefee876 exclude sun/security/pkcs11/Signature/TestDSAKeyLength.java on Ubuntu 21.04 due to 8279941
(cherry picked from commit c3d8e648a6)
2025-02-05 01:02:28 +01:00
Anton Tarasov
405e7d747c JBR-4204 provide an option to disable a11y support on macOS
(cherry picked from commit ee3c56abdc)
(cherry picked from commit e2419baf87)
2025-02-05 01:02:28 +01:00
Vitaly Provodin
c4f4066d0f exclude two swing tests on Windows due to JBR-4197
(cherry picked from commit 3a99f6b99d)
2025-02-05 01:02:27 +01:00
Alexey Ushakov
a7f65db1eb JBR-4112 macOS: SIGILL at [libsystem_kernel] __kill in OOME: Java heap space at java.awt.image.DataBufferInt.<init>
Removed double allocation of surface data

(cherry picked from commit 041285b65c)
2025-02-05 01:02:27 +01:00
Alexey Ushakov
79025f8d7c JBR-4187 java/awt/GraphicsDevice/DisplayModes/UnknownRefrshRateTest.java.UnknownRefrshRateTest fails on mac
Constrained display modes count used by the test

(cherry picked from commit d757e23958)
2025-02-05 01:02:27 +01:00
Alexey Ushakov
af8f02e16d JBR-4177 libc++abi: terminating with uncaught exception of type NSException
Added check for AppContext

(cherry picked from commit 54c83d2ef6)
2025-02-05 01:02:27 +01:00
Alexey Ushakov
964eef88c2 JBR-4174 java/awt/FullScreen/FullScreenInsets/FullScreenInsets.java fails on mac aarch64
Hide cursor to fix OGL&Metal Robot issue (it reads cursor image). Added tolerance to fix Metal Robot inaccuracy.

(cherry picked from commit a66693cc92)
2025-02-05 01:02:27 +01:00
Artem Semenov
6fae1c439c JBR-4167 [JCK] AccassibleJTree tests fail on Ubuntu
(cherry picked from commit 40e8687667)
2025-02-05 01:02:27 +01:00
Alexey Ushakov
681ada91e9 JBR-4164 IDEs cannot be launched via launch configuration
Moved execution of displayChanged() to EDT

(cherry picked from commit b6f91a9c10)
2025-02-05 01:02:27 +01:00
Vitaly Provodin
fb9b33d31b JBR-4169 add jdk.javadoc into JBR
(cherry picked from commit 861742faf1)
2025-02-05 01:02:27 +01:00
Alexey Ushakov
eb235c7653 JBR-4150 IDE regularly locks up at sun.lwawt.macosx.LWCToolkit.getScreenInsets
Restored caching screen insets. Added handling of dock resize.

(cherry picked from commit e3d7c52e93)
2025-02-05 01:02:27 +01:00
Vitaly Provodin
ec8b51fc21 exclude java/awt/Focus/ActualFocusedWindowTest/ActualFocusedWindowBlockingTest.java on Wayland configs due to 8279256
(cherry picked from commit 9d17b66630)
2025-02-05 01:02:27 +01:00
Vitaly Provodin
5d7ee022a5 exclude java/awt/SplashScreen/MultiResolutionSplash/MultiResolutionSplashTest.java on Scale2 configs due to 8279190
(cherry picked from commit 0949bd7a8a)
2025-02-05 01:02:27 +01:00
Vitaly Provodin
f9583d6212 exclude java/awt/FullScreen/UninitializedDisplayModeChangeTest/UninitializedDisplayModeChangeTest.java due to 827361
(cherry picked from commit b98807e58f)
2025-02-05 01:02:27 +01:00
Vitaly Provodin
259e4888b5 add exclude list for Wayland failures
(cherry picked from commit 2b7bdfe3d5)
2025-02-05 01:02:27 +01:00
Vitaly Provodin
d549e1ef12 exclude javax/swing/plaf/basic/BasicComboPopup/JComboBoxPopupLocation /JComboBoxPopupLocation.java on macOS due to 8194945
(cherry picked from commit 86f21becde)
2025-02-05 01:02:27 +01:00
Vitaly Provodin
ddf23623c6 exclude sun/java2d/SunGraphics2D/EmptyClipRenderingTest.java on windows due to 8144029
(cherry picked from commit f3f6365d05)
2025-02-05 01:02:27 +01:00
Maxim Kartashev
12dd287bc1 JBR-3948 Linux: SIGSEGV at [libawt_xawt] Java_sun_awt_X11_XInputMethod_createXICNative
The problem: the crashes occur in createStatusWindow() when calls like
adata->AwtColorMatch() end up going to 0x0 pc or some random inaccessible
memory. The only reason for that seems to be the
getDefaultConfig(screen) returning either NULL or garbage. That, in turn, probably
happens because of the wrong screen number provided. Before JBR-3623 was
fixed, awt_numScreens could've changed between the time the screen
number was chosen and the getDefaultConfig() call. After JBR-3623 was
fixed, this change is protected with the AWT lock, which this code
holds.
The fix: obtain the screen number via the Xlib API rather than the
ad-hoc loop though the root windows and return NULL if
getDefaultConfig() doesn't return useable data.

(cherry picked from commit 3d23e8d6a5)
(cherry picked from commit 924f5bab8a)
2025-02-05 01:02:26 +01:00
Vitaly Provodin
689aab7bce add exclude list for Scale2 test runs
(cherry picked from commit 45ddfe3353)
2025-02-05 01:02:26 +01:00
Vitaly Provodin
b7d223e44a exclude java/awt/SplashScreen/MultiResolutionSplash/MultiResolutionSplashTest.java due to 8134231
(cherry picked from commit defd9f66a7)
2025-02-05 01:02:26 +01:00
Alexey Ushakov
5b8130377c JBR-3773 M1 java/awt/Window/WindowAppearanceTest/WindowAppearanceTest.java: : Incorrect color java.awt.Color[r=75,g=74,b=72]at (140,5)
Added more variants of colors for unfocused and focused titles

(cherry picked from commit 93e508a98f)
2025-02-05 01:02:26 +01:00
Artem Semenov
b7ef66d110 JBR-3775 Optimize the algorithm for obtaining tree elements
(cherry picked from commit 01dbe66b3e)
2025-02-05 01:02:26 +01:00
Nikita Gubarkov
4f8ff3ae55 JBR API v0.0.2
Added file dialog customization via JBR API & fixed bugs in windows common item dialog

with fix for JBR-5300 Change source code and test files to use GPL license

(cherry picked from commit 45c562e366)
2025-02-05 01:02:26 +01:00
Vitaly Provodin
e79f5bbd23 JBR-3931 add the module jdk.unsupported.desktop into jbr
(cherry picked from commit 32def2fd42)
(cherry picked from commit d8fd2c9664)
2025-02-05 01:02:26 +01:00
Alexey Ushakov
64b4fab279 JBR-4111 [JBR17] Make possible to select files and directories independently
Implemented apple.awt.fileDialogForFiles property

(cherry picked from commit 67ea24d06e)
2025-02-05 01:02:26 +01:00
Vitaly Provodin
058f604622 enable fixed tests to regular runs
(cherry picked from commit ae87bdb09a)
2025-02-05 01:02:26 +01:00
Vitaly Provodin
21597b66f4 exclude javax/swing tests on mac-aarch64 due to 8277816
(cherry picked from commit a39f9150c3)
2025-02-05 01:02:26 +01:00
Aleksandr Veselov
f7b55d2970 JBR-4107 A11y: macOS - wrong frame position if window is not on primary screen
(cherry picked from commit 6006b52f33)
2025-02-05 01:02:26 +01:00
Alexey Ushakov
071380a044 JBR-4060 [JBR17+Metal] Flickering on button's shadow
Removed unnecessary global flag. Optimized mask cache texture clearing code.

(cherry picked from commit 4496acc610)
2025-02-05 01:02:26 +01:00
Alexey Ushakov
d9b4c55cba JBR-3954 Transparent text color rendering (needed for experimental UI)
Performed conversion from ARGB_PRE to ARGB in the grayscale text shader

(cherry picked from commit 8339ec581f)
2025-02-05 01:02:26 +01:00
Alexey Ushakov
8d2d382b23 JBR-3872 [JBR17+Metal] Wrong color for scrollbars and inlay hints
Corrected typo in setTxtUniforms and fixed alpha blending in frag_gmc_text shader

(cherry picked from commit 3276a2f8ea)
2025-02-05 01:02:26 +01:00
Alexey Ushakov
46892e2738 JBR-3820 Gamma correction for grayscale text in Metal rendering pipeline
Implemented gamma correction using the same approach that we did for OGL grayscale text rendering (OGLTextRenderer.c)
Optimized shader performance

(cherry picked from commit 5b290231ac)
2025-02-05 01:02:26 +01:00
Alexey Ushakov
5ea108b09e JBR-4104 jbr-dev compilation failure
Corrected suppress warnings

(cherry picked from commit 3ff69f1653)
2025-02-05 01:02:25 +01:00
Dmitry Batrak
a5eafa0eed JBR-4084 Default font '. AppleSystemUIFont' does not have bold weight on Chinese characters
(cherry picked from commit 4fde082d53)
(cherry picked from commit dc1806aa60)
2025-02-05 01:02:25 +01:00
Maxim Kartashev
bcb4f1043e JBR-3899 SIGSEGV at [libjvm] _ZN23JfrNetworkInterfaceName11on_rotationEv
Prevent JfrNetworkInterfaceName::on_rotation() to dereference a
potentially NULL pointer.

(cherry picked from commit b2a9372d70)
(cherry picked from commit 23ca382acc)
2025-02-05 01:02:25 +01:00
Dmitry Batrak
2b543cf701 JBR-4021 Unexpected focus event order on window showing
(cherry picked from commit 2a398ebb24)

includes fix for JBR-4131 Popup doesn't get focus if created from context menu

(cherry picked from commit 685562aafc)
(cherry picked from commit bb25c734db)
2025-02-05 01:02:25 +01:00
Maxim Kartashev
64f0212260 JBR-3923 Internal Error in c1_Instruction.cpp
Make C1 hotspot compiler bail out during CFG construction if there's a
cycle in the graph that isn't a natural loop and that has led to an
unexpected state of stack/locals like missing a phi function.

This is a temporary measure that lets hotspot continue working
even after encountering such bytecode patterns. The full solution
will probably involve more sophisticated CFG checks.

(cherry picked from commit aa0b61cb75)
(cherry picked from commit f7a8581991)
2025-02-05 01:02:25 +01:00
Vitaly Provodin
50d8cbecae exclude tests spontaneously creating windows during test execution
(cherry picked from commit 0dc17f51ed)
2025-02-05 01:02:25 +01:00
Maxim Kartashev
9e35cd96b4 JBR-2755 IDE UI became slow via remote X Server connection from Windows
When XGetImage() calls become slow in a remote X11 session, fake
XGetImage() with client-side XCreateImage() that is filled with some
background color. The color is chosen from several top left corner
pixels of the "slow" images obtained with XGetImage().

This feature activates in a remote X11 session only and is
controlled with -Dremote.x11.workaround={true|false|auto}.

(cherry picked from commit 99e8557c5b)
2025-02-05 01:02:25 +01:00
Alexey Ushakov
2abbd617d2 JBR-3924 CMD+Tilda does not switch app windows
Introduced vm property to disable capturing of next app window shortcut

(cherry picked from commit 15c52c44ee)
2025-02-05 01:02:25 +01:00
Nikita Gubarkov
8c3e6c3263 JBR-2917 Added emoji support for Windows
JBR-3951 Pass real glyph type from native code instead of guessing it by rowBytes & width

(cherry picked from commit 1a7a1db798)
2025-02-05 01:02:25 +01:00
Pavel
29556c2873 JBR-3926 make AwtComponent transparent for hit events by default
* JBR-3926 make AwtComponent transparent for hit events by default

* [WIP] pass hittest event to frame only if custom decoration is enabled and frame ready to handle it
(cherry picked from commit c0e26ff5d5)
(cherry picked from commit e7a31e309e)
2025-02-05 01:02:25 +01:00
Maxim Kartashev
7a86e9604a JBR-3896 Abysmally slow input and UI performance since upgrade to IU-213.4928.7 from previous 2021.3 EAP version
The slowness was the result of XWM.getInsetsFromExtents() repeated
attempts to acquire frame extents from a property that under Sway is
simply unavailable. Each attempt added at least 20ms to every re-draw.

Prior to (repeatedly) checking for NET_FRAME_EXTENTS property of a
window, check that the property is supported by the window manager.

(cherry picked from commit b40cc1c791)
(cherry picked from commit dc29a24175)
2025-02-05 01:02:25 +01:00
Dmitry Batrak
1ac845562d log LWCToolkit invokeAndWait requests
as part of JBR-3017, to make investigation of similar issues simpler in the future

(cherry-picked from commit a7fd723e43)

(cherry picked from commit d8ca0763a5)
2025-02-05 01:02:25 +01:00
Alexey Ushakov
2a063a1a39 JRE-202 Deadlock in CGLGraphicsConfig.getCGLConfigInfo
Added processing system events while waiting for OGLRenderQueue.lock
Moved getCGLConfigInfo logic execution to AppKit thread so, awt lock is
 taken on one thread

(cherry picked from commit d1c8bf03e1bd41cb075aa73cc39558103af7fe1a)
(cherry picked from commit 6bf9f31986be64acf3755b34568802f9960a66ec)
(cherry picked from commit 4e21d67e0369bffac45662c63699b39946218a7a)
(cherry picked from commit 62b62e33cf)
2025-02-05 01:02:25 +01:00
Alexey Ushakov
ad97f526ea JRE-193 UI freeze and 12/second thread dumps
Moved CStrikeDisposer dispose code to AppKit

(cherry picked from commit 28774d6878)
(cherry picked from commit 7cfc13be5c)
2025-02-05 01:02:24 +01:00
Alexander Lobas
d4f887cbdb JBR-3660 PhpStorm 2021.2 crashes on selecting iCloud Drive directory in Open dialog
(cherry picked from commit f5434bcaaf)
(cherry picked from commit 58f6991df8)
2025-02-05 01:02:24 +01:00
Alexander Lobas
46d918bd26 JBR-3629 SIGILL at [libsystem_kernel] __kill NPE at com.intellij.openapi.options.SchemeImportUtil$1.isFileSelectable / -[CFileDialog askFilenameFilter:]
(cherry picked from commit 86c13ecaed)
(cherry picked from commit adf18476b9)
2025-02-05 01:02:24 +01:00
Alexander Lobas
2f96a0b443 JBR-3443 Native file dialog on OSX enable filename filter by VM option
(cherry-picked from commit f10e324538)

(cherry picked from commit 7ad92e4703)
2025-02-05 01:02:24 +01:00
Alexander Lobas
75cd796dad JBR-3442 Native file dialog on OSX (for open file) doesn't allow pasting path
(cherry-picked from commit 7d8cc524ca)

(cherry picked from commit 5aca0df07c)
2025-02-05 01:02:24 +01:00
Maxim Kartashev
e590a80f1d Revert "JBR-2755 IDE UI became slow via remote X Server connection from Windows"
This reverts commit cd9138844da770ae60806fd7dbc1e85c773882a8.

(cherry picked from commit ec6f644c12)
2025-02-05 01:02:24 +01:00
Konstantin Aleev
57f36d0026 fix memory leaks in AccessibleJTree
(cherry picked from commit 561a7b8def)
(cherry picked from commit 6aa0951e7f)
2025-02-05 01:02:24 +01:00
Maxim Kartashev
d957349972 JBR-3835 Cropped messages in all Message Dialogs in Idea on Ubuntu 18.04.5 LTS with swing alerts enabled
The _NET_FRAME_EXTENTS property that is used to obtain the initial
insets of a dialog window does not immediately get its value and may be
returned as 0 if queried too soon after the window creation.

In order to avoid (incorrect) guessing of dialog's insets, make 3
attempts at getting the insets with a small but increasing pause
in between them.

(cherry picked from commit 8134ec069d)
2025-02-05 01:02:24 +01:00
Maxim Kartashev
8ba87ebfa2 Revert "JBR-3835 Cropped messages in all Message Dialogs in Idea on Ubuntu 18.04.5 LTS with swing alerts enabled"
This reverts commit 8e7aed70976ec0f90c736d86b9cd3e9cf09ff6d4.

(cherry picked from commit 502a08cafb)
2025-02-05 01:02:24 +01:00
Nikita Provotorov
7840e60ef5 JBR-3838 AltGr on Polish keyboard triggers Ctrl+Alt shortcut.
Add regression test.

(cherry picked from commit 8df43eef4b)

with fix for JBR-5300 Change source code and test files to use GPL license

(cherry picked from commit 0763e18e1b)
2025-02-05 01:02:24 +01:00
Maxim Kartashev
1046b98723 JBR-3835 Cropped messages in all Message Dialogs in Idea on Ubuntu 18.04.5 LTS with swing alerts enabled
The _NET_FRAME_EXTENTS property that is used to obtain the initial
insets of a dialog window does not immediately get its value and may be
returned as 0 if queried too soon after the window creation.

In order to avoid (incorrect) guessing of dialog's insets, add an
artificial delay if getInsets() is called too soon.

(cherry picked from commit d358fcc774)
2025-02-05 01:02:24 +01:00
Alexey Ushakov
bb4e29ebab JBR-3820 Gamma correction for grayscale text in Metal rendering pipeline
Added regression test to compare OGL and Metal text rendering

(cherry picked from commit 1ef2bce278)
2025-02-05 01:02:24 +01:00
Artem Bochkarev
053c490785 JBR-1762: request focus of immediate parent when dispose popup
because requesting focus for frame-parent causes to close whole popup chain

(cherry picked from commit 7a2ccfc521)

JBR-1762: fixed review comments

(cherry picked from commit 0efbe5d9b9)
(cherry picked from commit e539e4d29c)
2025-02-05 01:02:24 +01:00
Dmitry Batrak
0bb8796747 JBR-2759 Typeahead issue on Linux
(cherry picked from commits 76bdaf1131, b20c56ff3e, c9609330f2, a170b4e4ae)

(cherry picked from commit 281e6abf47)
2025-02-05 01:02:24 +01:00
Artem Bochkarev
ace6587167 JBR-1762: request focus of immediate parent when dispose popup
because requesting focus for frame-parent causes to close whole popup chain

(cherry picked from commit 7a2ccfc521)

JBR-1762: fixed review comments

(cherry picked from commit 0efbe5d9b9)
(cherry picked from commit 614eea4fd3)
2025-02-05 01:02:24 +01:00
Renaud Paquay
0f57e62a95 Add BasicWithKeyFileAttributeView interface
This new interface is similar to `BasicFileAttributeView` except it
gives implementations a hint that the fileKey() should be acquired
even at some performance cost.

`FileTreeWalker` uses this new interface to request a file key
in addition to regular file attributes so that file equality can
be efficiently performed when checking for loops during file
tree traversal.

This makes `FileTreeWalker` about 2x faster when traversing non
trivial file system trees with the FOLLOW_LINKS option.

Change-Id: I8de047c8fc241dbab9ad57c5e361118a3a94893d

(AKA JBR-3680 Cherry-pick Google's NIO patches to get faster file listing)

(cherry picked from commit 6d1c3f06c4)
(cherry picked from commit c5ac3d69ba)
2025-02-05 01:02:23 +01:00
Ivan Migalev
7e8e4180fe JBR-3785: don't touch the active keyboard layout on input method activation / deactivation.
origin PR: github.com/JetBrains/JetBrainsRuntime/pull/78.

(cherry picked from commit 2f772fd1a2)
(cherry picked from commit c96000f501)
2025-02-05 01:02:23 +01:00
Dmitry Batrak
7f5e71441f JBR-3779 Unexpected Alt+Tab behaviour for Java frames on Cinnamon DE
(cherry picked from commit 0bf13985d5)
(cherry picked from commit 3853438e52)
2025-02-05 01:02:23 +01:00
Maxim Kartashev
a57fa9ec46 JBR-3772 java/beans/PropertyEditor/TestFontClass.java: access denied ("java.util.PropertyPermission" "sun.awt.x11.trace" "read")
Instead of using System.getProperty() directly, wrap the call into
GetPropertyAction and use AccessController to execute it.

(cherry picked from commit 4fefc6244b)
2025-02-05 01:02:23 +01:00
Dmitry Batrak
c2e57cf03d JBR-3504 a11y focus is set on the wrong element when opening popups
(cherry-picked from commit a69e12e0d2)

(cherry picked from commit e06081f5ab)
2025-02-05 01:02:23 +01:00
Maxim Kartashev
634e755260 JBR-3665 Typing is slow in remote X session
Only call XGetKeyboardMapping() once for all valid codes and cache the
resulting table. Use the cache on the subsequent calls to
keycodeToKeysym().

(cherry picked from commit 0ae3056c25)
2025-02-05 01:02:23 +01:00
Maxim Kartashev
4757641b63 JBR-2273 JBR musl port
Detect if we're running on a musl-based system by checking for the presence
of the libgcompat.so glibc compatibility library in the process' map.
If so, java is re-started with LD_LIBRARY_PATH set to point to the right
directory with libjvm.so. This works around the problem with the musl
dynamic library loader.

(based on commit 13a904ddb5)

(cherry picked from commit 51b5fe1b0c)
2025-02-05 01:02:23 +01:00
Alexey Ushakov
d07f487d1f Added support for otf into the build scripts. Updated prebuild maps.
Applied code from jbr-dev

(cherry picked from commit 9c23814897)
2025-02-05 01:02:23 +01:00
Konstantin Bulenkov
40979f90cd bundle Inter font
(cherry picked from commit 9f54e5ce48)
2025-02-05 01:02:23 +01:00
Maxim Kartashev
6ae37f0b5a JBR-3664 Logging for communications with X server
Introduced logging controlled with -Dsun.awt.x11.trace.
Currently, only looks at the AWT lock and reports methods holding it
sorted by average hold time.

(based on commit 792a58ea0e)
(based on commit 770b4dc9c1)

(cherry picked from commit 1ec3990980)
2025-02-05 01:02:23 +01:00
Dmitry Batrak
53da5ddc49 JBR-3726 Modal windows 'disappear' on minimize in KDE
(cherry picked from commits d9baf2d9db, 9c2841028f, 5c4fd9ceaf, f0ed32fca4)

(cherry picked from commit 21a64a69e4)
2025-02-05 01:02:23 +01:00
Maxim Kartashev
605acf766c JBR-3542 Fix -Xcheck:jni warnings
Fixes warnings coming from JBR-specific code in addition to those fixed
by 8269223.

(cherry picked from commit b2aa21b742)
2025-02-05 01:02:23 +01:00
Dmitry Batrak
f7f0322133 JBR-3706 Toggling full screen mode for two frames doesn't work on macOS if invoked without delay
(cherry picked from commit 28cfc4815f)
(cherry picked from commit ec4f29297e)
2025-02-05 01:02:23 +01:00
Dmitry Batrak
acf612e3d7 JBR-3686 Background window steals focus when converted to full screen on macOS
(cherry-picked from commit 07a5b9672e)

with fix for JBR-6436 crash in jb/java/awt/Focus/FullScreenFocusStealing.java and jb/java/awt/Window/FullScreenTwoFrames.java

(cherry picked from commit 98b3ac5221)

with fix for JBR-6569 macOS: SIGILL at [libsystem_kernel] __kill in This decoder will only decode classes that adopt NSSecureCoding. Class 'AWTView' does not adopt it.

(cherry picked from commit 7af653070f)
(cherry picked from commit db11bf6776)
2025-02-05 01:02:23 +01:00
Dmitry Batrak
ec7fcf93a9 JBR-3662, JBR-3672 Focus jumps to another project tab after closing modal dialog
(cherry picked from commit bfd01081c3, 2a71dc5981)
(cherry picked from commit 3fc47af69e)
2025-02-05 01:02:22 +01:00
Nikita Gubarkov
6472e7a5de JBR-3648 Replace CacheCellInfo usages with MTLCacheCellInfo in metal rendering code
(cherry picked from commit 7a94f7ea07)
2025-02-05 01:02:22 +01:00
Dmitry Batrak
beadaba95a JBR-3642 java/awt/Window/8159168/SetShapeTest.java fails on macOS-x64 & macOS-aarch64
make sure jb/java/awt/Focus/Typeahead* tests still pass

includes fixes for JBR-3786 javax/swing/plaf/aqua/CustomComboBoxFocusTest.java fails on MacOS by timeout
(cherry picked from commit f5c5388fb5)

and JBR-4113 java/awt/KeyboardFocusmanager/TypeAhead/TestDialogTypeAhead.java fails by time out on macOS

(cherry picked from commit d8d4c55a61)
(cherry picked from commit 9f6fa55673)
2025-02-05 01:02:22 +01:00
Anton Tarasov
8498c60b5e JBR-1834 [linux] runtime hidpi switch is broken
(cherry picked from commit eaa04303a7)
(cherry picked from commit 2df217d6fe)
2025-02-05 01:02:22 +01:00
Anton Tarasov
eb4e45fa0c JBR-1429 Scale is huge due to GDK_SCALE
(cherry-picked from commit 1c3477df2e)

(cherry picked from commit 3ac8aeea3d)
2025-02-05 01:02:22 +01:00
Anton Tarasov
15706e5899 JBR-1365 force IDE-managed HiDPI on Linux for fractional scales
(cherry picked from commit f092ff3962)
(cherry picked from commit ae72b9e01d)
2025-02-05 01:02:22 +01:00
Anton Tarasov
da56872b8b Allow HiDPI mode on Linux
(cherry picked from commit e192da4f83)
2025-02-05 01:02:22 +01:00
Anton Tarasov
d6c75dc9ae JRE-489 -Dswing.bufferPerWindow is fractional scale unfriendly
(cherry picked from commit 67fb7a274c)
2025-02-05 01:02:22 +01:00
Anton Tarasov
eb66bfdaab JRE-310 check for Windows8.1 when enabling ui scale
Was "don't fallback on fractional scale" in JBSDK9.

(cherry picked from commit 28dfae88e6)
2025-02-05 01:02:22 +01:00
Vitaly.Provodin
50d29df82d add 32-sizes for native data types
(cherry picked from commit 3a79870da8)
(cherry picked from commit 15f6d3290b)
2025-02-05 01:02:22 +01:00
Nikita Gubarkov
ad65b48169 Added JBR-specific .idea project files
(cherry picked from commit 6b34834621)
2025-02-05 01:02:22 +01:00
Alexey Ushakov
12bb59ce9a JBR-3344 "Exit Full Screen" action doesn't work, the only way is mouse click on window's native "green" button.
Restored JBR-1931 fix partially reverted by JBR-1718

(cherry picked from commit c0be778e20)
(cherry picked from commit dbe6f4490f)
2025-02-05 01:02:22 +01:00
Anton Tarasov
23e15559c6 JBR-3337 jb/java/jcef/HandleJSQueryTest3314.sh: fails on macOS-aarch64 with "JS Query was not handled in 2nd opened browser"
(cherry picked from commit 8678f41971)
(cherry picked from commit d2260dd67c)
2025-02-05 01:02:22 +01:00
Anton Tarasov
5d34aeadc9 JBR-3545 Window.setMinimumSize does not respect DPI scaling
(cherry picked from commit 9b4f72ad18)
(cherry picked from commit f3f87f5f27)
2025-02-05 01:02:22 +01:00
Denis Fokin
2c9ab8d9eb JRE-408 JBR-3515 fix NullPointerException in MetalRootPaneUI.installWindowListeners
(cherry picked from commit 584d554af529cff445b0f09bc2d57be55e138b7a)
(cherry picked from commit 6a42bb54bd)
(cherry picked from commit 1bf4975a43)
2025-02-05 01:02:22 +01:00
Elena Sayapina
5a58204174 JBR-2657 [TESTBUG] ChainOfPopupsFocusTest misbehaving on Windows
- changed open popup shortcut from Ctrl+N to Ctrl+M, so no new explorer windows appear if desktop gets focused by error
- added a click on the main test frame, so it gets focus when running from background cygwin process on Windows, otherwise it just flashes on the taskbar

(cherry picked from commit eda8e4d50e)
(cherry picked from commit 1c729008ce)
2025-02-05 01:02:21 +01:00
Denis Konoplev
fbdefc120b EA-252361: Check window for null
(cherry picked from commit 23a7dbd486)
(cherry picked from commit aa4d6f14dc)
2025-02-05 01:02:21 +01:00
Artem Bochkarev
c0b5f5f75e JBR-3131: support custom view for system menu items
(cherry picked from commit 78d509ac0f)
(cherry picked from commit ca05fefb28)
2025-02-05 01:02:21 +01:00
Artem Bochkarev
029295ee95 JBR-3127: set NSWindowAllowsImplicitFullScreen=NO
fixed JBR-3127 Modal dialogs invoked from modal or floating dialogs are opened in full screen

(cherry picked from commit 0b8ff1a7e6)

JBR-3127: add possibility to load NSJavaVirtualMachine

JavaVM framework is deprecated but this class is still checked by AppKit, see https://youtrack.jetbrains.com/issue/JBR-3127#focus=Comments-27-4684465.0-0

(cherry picked from commit be6a2c4f0c)
(cherry picked from commit d690d68315)
2025-02-05 01:02:21 +01:00
Nikita Gubarkov
2a72f7869e JBR-3376 Added check for -1 glyph info pointer in OGLTextRenderer.c
(cherry picked from commit 40ea728335)
2025-02-05 01:02:21 +01:00
Dmitry Batrak
7f56c0d44f JBR-3024 Popups are shown with 1x1 size sometimes
test case only

(cherry picked part of commit ee298f5287)

with fix for JBR-5300 Change source code and test files to use GPL license

(cherry picked from commit b7d165e486)
2025-02-05 01:02:21 +01:00
Vitaly Provodin
3d823a3919 JBR-3314 add regression test
(cherry picked from commit c81adfed61)
(cherry picked from commit e4c3db3a2c)
2025-02-05 01:02:21 +01:00
Ivan Migalev
b506d5cb28 JBR-3227 Reload type of required native file dialogs each time a file dialog is requested
(cherry picked from commit 26dd87ab7c)
(cherry picked from commit 847d757a76)
2025-02-05 01:02:21 +01:00
Ivan Migalev
25e21c666e JBR-3068 Update path selector behavior when sun.awt.windows.useCommonItemDialog is enabled
(cherry picked from commit 442bb7eecc)
(cherry picked from commit 6177142c3a)
2025-02-05 01:02:21 +01:00
Alexey Ushakov
6c52056273 JBR-2996 M1 warnings: CoreText note: Client requested name “.SFCompact-Black”, it will get Times-Roman rather than the intended font
Cached system fonts family names

(cherry picked from commit 56629e4c90)
(cherry picked from commit 998e7b685a)
2025-02-05 01:02:21 +01:00
Alexey Ushakov
f122c08d19 JBR-3023 Gray idea frame after project open with ide.mac.transparentTitleBarAppearance.
Initiate move/resize event on first appearance of window having FULL_WINDOW_CONTENT property set

(cherry picked from commit a6ea081ba2)
(cherry picked from commit dd6877af04)
2025-02-05 01:02:21 +01:00
Dmitry Batrak
f36c6ed12f JBR-3017 Focus issue in presence of third-party accessibility tool
use the new invocation approach for 'makeKeyAndOrderFront' as well, as it can also cause synchronous back-calls to accessibility subsystem, and change the global call order unexpectedly

this commit fixes TypeaheadSetVisibleTest and TypeaheadToFrontTest, when they are run with AltTab active

Guard against possible deadlocks, if UI-related methods are invoked not on EDT.
Sample deadlock scenario:
* Application thread attempts to show the window, this involves calling CWrapper.NSWindow.makeKeyAndOrderFront under AWT tree lock, which blocks till 'makeKeyAndOrderFront' completes on AppKit thread
* AppKit thread, while executing 'makeKeyAndOrderFront' performs 'back-call' to CAccessibility.getFocusOwner, which waits for execution on EDT
* EDT performs some activity requiring AWT tree lock (e.g. processing of PaintEvent)

(cherry picked from commits e3aaff5db4, 09941119e1)

(cherry picked from commit 513767dce6)
2025-02-05 01:02:21 +01:00
Dmitry Batrak
ea18fcdc85 JBR-3072 Deadlock on nested dialog hiding
(cherry picked from commits 99242748ee, ad1595b5c2)

with fix for JBR-5300 Change source code and test files to use GPL license

(cherry picked from commit 9eacb21298)
2025-02-05 01:02:21 +01:00
Dmitry Batrak
d743410b20 fix occasional freezes of JBR-3017 reproducer after the fix
(cherry picked from commit 7e6db54f77)
(cherry picked from commit 2b7f78f50e)
2025-02-05 01:02:21 +01:00
Dmitry Batrak
cd8d6e1880 JBR-2819 Create API to determine typographic family/subfamily for available fonts
(cherry picked from commit 89e519a4ef)
(cherry picked from commit 21129ca270)
2025-02-05 01:02:21 +01:00
Nikita Gubarkov
1221d2c722 JBR-2924 Do not try to create native italic font when we're going to make it fake italic
(cherry picked from commit cf05cb1a19)
2025-02-05 01:02:20 +01:00
Nikita Gubarkov
a990f1df97 JBR-3982 Fixed non-antialiased text rendering on macOS
JBR-3269 Disabled subpixel antialiasing for macOS Mojave and newer

(cherry picked from commit e10f69072e)
2025-02-05 01:02:20 +01:00
Dmitry Batrak
77208bb113 JBR-3017 Focus issue in presence of third-party accessibility tool
(cherry picked from commit 88ead5d9e3)
(cherry picked from commit 97753f15b6)
2025-02-05 01:02:20 +01:00
Vitaly Provodin
76014e5482 JBR-1718 add a regression test
(cherry picked from commit 84ff4eab21)

with fix for JBR-5300 Change source code and test files to use GPL license

(cherry picked from commit 6b02027600)
2025-02-05 01:02:20 +01:00
Elena Sayapina
da0ee9cf3f JBR-2890 [TESTUPDATE] Enable jcef tests on macOS aarch64 platform
(cherry picked from commit 1714d7b627)
(cherry picked from commit 54e74d75d0)
2025-02-05 01:02:20 +01:00
Nikita Gubarkov
a4845c30d1 Added JBR API
with fix for JBR-5300 Change source code and test files to use GPL license

(cherry picked from commit 2ce0a876c5)
2025-02-05 01:02:20 +01:00
Artem Bochkarev
3bfe83df8a JBR-2562: fixed invokation of parent method
(cherry picked from commit 93cbab2f2d)

JBR-2562: suppress exceptions from [NSWindow _changeJustMain]

temporary workaround to prevent crashes

(cherry picked from commit dd055b5970)
(cherry picked from commit 55eba1d802)
2025-02-05 01:02:20 +01:00
Mikhail Grishchenko
4df2811a88 JBR-2890 Disable jcef tests on 32-bit and aarch64 platforms
(cherry picked from commit d34d6528fe)
(cherry picked from commit 793add3ff1)
2025-02-05 01:02:20 +01:00
Alexey Ushakov
8fab97677c JBR-2879 Big Sur: Opening project in new window results in opening project in another tab
Disabled Tabbing mode for all NSWindows

(cherry picked from commit 8cb0377a31)
(cherry picked from commit 545eddda9f)
2025-02-05 01:02:20 +01:00
Nikita Gubarkov
94d1f572af JBR-2910 Implemented extended glyph cache for macOS
JBR-3976 Fixed text spacing & emoji scaling on macOS

JBR-3638 Adjust subpixel glyph positions for correct rounding in CStrike#getGlyphImageBounds

(cherry picked from commit 4590e49b61)
2025-02-05 01:02:20 +01:00
Alexey Ushakov
01032fd84f JBR-2617 Text with opacity renders black
Implemented alpha blending in grayscale text rendering (UX-1320)
Corrected bright text thickness (smooth on), bright and dark text thickness (smooth off)
Added JVM properties for fine tuning

(cherry picked from commit c30306f779)
(cherry picked from commit c95adeb8f2)
(cherry picked from commit 269c9580fb)
(cherry picked from commit 55c7be5fe9)
(cherry picked from commit e28ff71e97)
(cherry picked from commit 6fb9aaf291)
2025-02-05 01:02:20 +01:00
Alexey Ushakov
02c82e31d4 JBR-2521 Ugly font in all 2020.2 EAPs on macOS
Provide gamma correction for both light and dark text

(cherry picked from commit 5953202a7e)
(cherry picked from commit 1b426cc66c)
2025-02-05 01:02:20 +01:00
Alexey Ushakov
f26de41025 JBR-2591 Repainting is broken (was: Icons in tree list widgets became dark)
Save current blend mode before cached grayscale rendering

(cherry picked from commit 7beb75ccec)
(cherry picked from commit ed52fde57d)
(cherry picked from commit 1a46cd70af)
2025-02-05 01:02:20 +01:00
Alexey Ushakov
5151a24a1c JBR-1986 Enabling fractional metrics causes visual artifacts in font rendering on macOS 10.14+
Disable subpixel positioning for macOS 10.13+ if legacy LCD rendering is disabled

(cherry picked from commit dbd24232e4)
(cherry picked from commit 9fbf990e83)
2025-02-05 01:02:20 +01:00
Vitaly Provodin
125f75d399 exclude bug7154030 on macosx-aarch64 due to 8268284
(cherry picked from commit 253f1246e5)
2025-02-05 01:02:20 +01:00
Vitaly Provodin
bb3271d85c exclude SharedMemoryPixmapsTest on macosx-all due to 8221451
(cherry picked from commit d929111f7a)
2025-02-05 01:02:19 +01:00
Vyacheslav Moklev
448f5b8b77 JBR-2442 fix memory leak of fileBuffer
fix was suggested by Nikita Gubarkov

(cherry picked from commit a166fb65e1)
2025-02-05 01:02:19 +01:00
Sergey Malenkov
f911291f0a EA-235126 - CME: HighlightableComponent.getPreferredSize
(cherry picked from commit 523d80cafd)
(cherry picked from commit 31c4452397)
2025-02-05 01:02:19 +01:00
Kirill Kirichenko
2139035ff9 JBR-2667 Post review: rename win.darkTheme.on to win.lightTheme.on and reversed the logic
(cherry picked from commit eeab5252e6)
(cherry picked from commit b539e1d0de)
2025-02-05 01:02:19 +01:00
Kirill Kirichenko
76f638503e JBR-2667 Add new AWT desktop property for light/dark theme detection on Windows 10
(cherry picked from commit 0e4ad056dd)
(cherry picked from commit e5dfcc4417)
2025-02-05 01:02:19 +01:00
Alexey Ushakov
0121967172 JBR-2593 Wide ligatures not rendered in Grayscale mode
Added missing flush of cached vertices

(cherry picked from commit ad409b4370)
(cherry picked from commit bf011ac521)
2025-02-05 01:02:19 +01:00
Nikita Gubarkov
ea1a1d0d6a JBR-2910 Implemented extended glyph cache for Linux
(cherry picked from commit d488f716e7)
2025-02-05 01:02:19 +01:00
Nikita Gubarkov
2d474986da JBR-2910 Implemented extended glyph cache for Windows
(cherry picked from commit 7f75d75933)
2025-02-05 01:02:19 +01:00
Nikita Gubarkov
8947d1a14a JBR-2614 Fixed LCD glyph width to include both left & right padding, so that rowBytes = width * 3
(cherry picked from commit afb52a160d)
2025-02-05 01:02:19 +01:00
Alexey Ushakov
5df1292ce2 JBR-2463 Font rendering problem on macOS Mojave
Use adjusted advances for glyphs

(cherry picked from commit 1af5dd4aae)
(cherry picked from commit bd6dae9ddf)
2025-02-05 01:02:19 +01:00
Denis Konoplev
c3fbb42cdd JBR-3544: Generate popup invoked instead of New in this directory.
- A fix
- A regression test (cherry picked from commit 7995574c09)

(cherry picked from commit 01915e4224)
2025-02-05 01:02:19 +01:00
Vitaly Provodin
7382dc0100 JBR-2545 Clean up the list of ignored Render tests
(cherry picked from commit f7b4c42e1d)
(cherry picked from commit 32b8d67527)
2025-02-05 01:02:19 +01:00
Jayathirth D V
afd494c630 8241490: Add large text performance tests in RenderPerfTest
(cherry picked from commit 803ee2f2b5)
(cherry picked from commit bbe57208d2)
2025-02-05 01:02:19 +01:00
Alexey Ushakov
36a531d3f7 8230657: Create fine grained render perf test for metal pipeline
Converted gradle JUnit test to plain java for ant and gnumake

To run the tests:
cd src/demo/share/java2d/RenderPerfTest

ant run
or
java -jar dist/RenderPerfTest.jar
or
java -jar dist/RenderPerfTest.jar testWhiteTextBubblesGray

(cherry picked from commit 356121b18f)
(cherry picked from commit 8bd8d2d132)
(cherry picked from commit 448aad87bc)
2025-02-05 01:02:19 +01:00
Konstantin Bulenkov
b5df606ca2 Update FiraCode to 5.2
(cherry picked from commit 71e2a8d8ad)
(cherry picked from commit 0582e90d58)
2025-02-05 01:02:19 +01:00
Alexey Ushakov
83e3ced869 JBR-1929 Improve rendering of San Francisco font of macOS Catalina
Reverting gamma correction because of rendering artifacts in the light theme

This reverts commit 5016db51

(cherry picked from commit c1d644a004)
(cherry picked from commit ade5b22a83)
2025-02-05 01:02:18 +01:00
Alexey Ushakov
7dc923690e JBR-1929 Improve rendering of San Francisco font of macOS Catalina
Added gamma correction to match grayscale rendering with subpixel one

(cherry picked from commit 5016db518a)
(cherry picked from commit b15896e838)
2025-02-05 01:02:18 +01:00
Alexey Ushakov
5a37801db3 JBR-2463 Font rendering problem on macOS Mojave
Use adjusted advances for glyphs

(cherry picked from commit 1af5dd4aae)
(cherry picked from commit df670fc276)
2025-02-05 01:02:18 +01:00
Anton Tarasov
df42f2b4ca revert: JBR-1434 "New file dialog" popup remains above all windows on switching application
java.awt.peer.WindowPeer.isLightweightDialog() method does not exist.

(cherry picked from commit 7d8aeaf7de)
(cherry picked from commit e233ff9b94)
2025-02-05 01:02:18 +01:00
Anton Tarasov
5ac68cf690 JBR-2872 improve: JBR-2866 JCEF: Markdown editor steals focus from a different frame
(cherry picked from commit bad748e3d0)
(cherry picked from commit ef2a05eac1)
2025-02-05 01:02:18 +01:00
Anton Tarasov
4c44d30a95 JBR-2866 JCEF: Markdown editor steals focus from a different frame
with fix for JBR-5300 Change source code and test files to use GPL license

(cherry picked from commit 6d852e3252)
2025-02-05 01:02:18 +01:00
Anton Tarasov
e33b745d1b JBR-2645 enable CefBrowser.close(true) in jcef reg tests
(cherry picked from commit 492c217125)
(cherry picked from commit 8975bde92c)
2025-02-05 01:02:18 +01:00
Anton Tarasov
a772913666 JBR-2259 WebSite isn't loaded with .loadUrl method if browser isn't shown in UI
(cherry picked from commit 57bbddf071)
(cherry picked from commit 94b56fdeb5)
2025-02-05 01:02:18 +01:00
Anton Tarasov
a50c6cfdcd JBR-2557 use com.jetbrains.cef.JCefAppConfig in JCEF tests
(cherry picked from commit e30a309f92)
(cherry picked from commit 441ee96ec5)
2025-02-05 01:02:18 +01:00
Anton Tarasov
321644588a JBR-2489 Git branch operations (switch to another branch, rebase) sometimes crash WebStorm 202.5428.27
(cherry picked from commit 81d2156fb1)
(cherry picked from commit 01299cb102)
2025-02-05 01:02:18 +01:00
Anton Tarasov
0572ec1a26 JBR-2282 [jcef] update to JCEF/80.0.4+g74f7b0c+chromium-80.0.3987.122
(cherry picked from commit a5adc725df)
(cherry picked from commit fcf31daa22)
2025-02-05 01:02:18 +01:00
Anton Tarasov
6ab9b0fabb JBR-2305 jcef: jb/java/jcef/JCEFStartupTest.java throws java.lang.ExceptionInInitializerError
(cherry picked from commit f0385f01ec)
(cherry picked from commit c7d407e0a6)
2025-02-05 01:02:18 +01:00
Anton Tarasov
7b81488059 JBR-2306 jcef: jb/java/jcef/JCEFStartupTest.java unexpectedly exits with the exit code: 0
(cherry picked from commit ff7d7bd43c)
(cherry picked from commit d72901625f)
2025-02-05 01:02:18 +01:00
Anton Tarasov
170d8fed72 JBR-2299 [mac] jcef requests for "chromium safe storage" keychain access
(cherry picked from commit dd1334a352)
(cherry picked from commit 2ebe5709c0)
2025-02-05 01:02:18 +01:00
Anton Tarasov
27265ef260 JBR-2222 Crash during closing IDE
(cherry picked from commit d0c367b31f)
(cherry picked from commit bf36d7873b)
2025-02-05 01:02:18 +01:00
Anton Tarasov
0fb3b8ea33 JBR-2287 [jcef] add CefBrowser wrapper to jtreg tests
(cherry picked from commit fa961d1769)
(cherry picked from commit 74ccb86095)
2025-02-05 01:02:17 +01:00
Anton Tarasov
0deaea00e0 JBR-2169 AWTThreading: remove tracked invocation event from completion listener
(cherry picked from commit a855f3b835)
(cherry picked from commit c54371231c)
2025-02-05 01:02:17 +01:00
Anton Tarasov
51aefe0697 JBR-2159 Native crash in thread AWT-EventQueue-0 when trying to push commit
(cherry picked from commit bba297b4a4)
(cherry picked from commit 38b9cf19c0)
2025-02-05 01:02:17 +01:00
Anton Tarasov
de24ee6551 JBR-2148 JCEF: JBR bundle has invalid app structure
(cherry picked from commit f45f84d7ed)
(cherry picked from commit b610a7c4f9)
2025-02-05 01:02:17 +01:00
Anton Tarasov
801be2b361 JBR-2146 improve InvokeOnToolkitHelper to cover more generic case
(cherry picked from commit 37db252ad7)
2025-02-05 01:02:17 +01:00
Anton Tarasov
434e5692d0 JBR-2139 Idea freeze on dynamic plugin unloading
(cherry picked from commit e57bae4f66)
(cherry picked from commit 647f198b17)
2025-02-05 01:02:17 +01:00
Anton Tarasov
57109376f8 JBR-2099 jb/java/jcef/JCEFStartupTest.java fails on Windows, Linux
(cherry picked from commit 3dfb0aa16a)
(cherry picked from commit 3750608e62)
2025-02-05 01:02:17 +01:00
Anton Tarasov
4e06175ff4 JBR-2093 create reg test for JCEF startup
(cherry picked from commit e8c2761f5b)
(cherry picked from commit 17cfb8e0d8)
2025-02-05 01:02:17 +01:00
Anton Tarasov
c0bff35ed5 JBR-2082 Revealing taskbar does not work when "Automatically hide the taskbar"
(cherry picked from commit b31a41fb2f)
(cherry picked from commit d2d4e58c13)
2025-02-05 01:02:17 +01:00
Mikhail Grishchenko
3a3b5fad30 JBR-2639, JBR-2412 [jcef] Tests that checks mouse events
JBR-2412 [windows] mouse listener does not work for jcef

(cherry picked from commit 66ad6472ae)
(cherry picked from commit 04246aac57)
(cherry picked from commit b7cde4fd05)
(cherry picked from commit d325b98b54)
2025-02-05 01:02:17 +01:00
Mikhail Grishchenko
f34eed1157 JBR-2639 [win] jcef does not recognize vertical mouse wheel events
added regression test

(cherry picked from commit e8e4741bb0)
(cherry picked from commit 8428d1c853)
2025-02-05 01:02:17 +01:00
Mikhail Grishchenko
830e56afa9 JBR-2412 [windows] mouse listener does not work for jcef
added regression test

(cherry picked from commit d1479872f2)
(cherry picked from commit 9e5032e328)
2025-02-05 01:02:17 +01:00
Elena Sayapina
822bf3ab74 JBR-2630 Typing speed in IDE editor was dropped after switching to 11.0.8
Introduced sun.awt.osx.RobotSafeDelayMillis property to control macOS specific safe delay for Robot methods.
50 ms safe delay was initially hardcoded in 3862142d (JDK-8242174: [macos] The NestedModelessDialogTest test make the macOS unstable) which affected performance tests execution.

(cherry picked from commit 5f691bb788)
(cherry picked from commit cfc90ce2c5)
2025-02-05 01:02:17 +01:00
Mikhail Grishchenko
e840837621 JBR-2430 [jcef] Added Regression test
Checks that JS Query is handled in 2nd opened browser

(cherry picked from commit 404ff84565)

Refactoring + changed EDT awaiting method

(cherry picked from commit dc24658b31)
(cherry picked from commit f191726147)
2025-02-05 01:02:17 +01:00
Vitaly Provodin
ef3307c1b1 exclude the new printer test 8262731
(cherry picked from commit c5ff1e3025)
2025-02-05 01:02:17 +01:00
Alexey Ushakov
ecf0b85c85 JBR-2419 Improve performance of CStrike.getNativeGlyphOutlineBounds
Do not pass the result via java object. Use more straight api.

(cherry picked from commit 9f91fe91f5)
(cherry picked from commit c0fd2daf5c)
(cherry picked from commit 1bfd5ad21c)
2025-02-05 01:02:16 +01:00
Alexey Ushakov
5e020ed2ad JBR-2382 Provide detailed stack trace in crash dumps for unhandled ObjC exceptions
Used user home dir for jbr_err files. Removed logging with reportException method

(cherry picked from commit 2c8cdb221b)

JBR-2382 Provide detailed stack trace in crash dumps for unhandled ObjC exceptions

Used process workdir for jbr_err files. Added one more logging to reportException method

(cherry picked from commit 95a47810d5)

JBR-2382 Provide detailed stack trace in crash dumps for unhandled ObjC exceptions

Generate jbr_err_pidXX.log file with detailed stack trace of the exception

(cherry picked from commit 4c42f75021)
(cherry picked from commit 9ed5cac63d)
2025-02-05 01:02:16 +01:00
Artem Bochkarev
681a33285c JBR-2253: unset LD_PRELOAD just after VM loaded
workaround for JBR-2253 Preload libjsig.so to fix JNA crashes

(cherry picked from commit 127a2deddf)
(cherry picked from commit 915f700d26)
2025-02-05 01:02:16 +01:00
Kirill Kirichenko
afc2a7f15e JBR-1874 Cursor not changing from 'default' to 'text'. Additional fix after reopening.
(cherry picked from commit 5a29d4ade9)
(cherry picked from commit da44860f22)
2025-02-05 01:02:16 +01:00
Elena Sayapina
0113601371 JBR-2585 [TESTBUG] TouchScreenEvent tests affect tests simulating mouse actions
- added workaround for JBR-2585
- added README.md about manual test run
- made an update to close LinuxTouchScreenDevice properly
- added an error exit from linux shell script if sudo password is empty or chown fails

(cherry picked from commit 4deb3bbe61)
(cherry picked from commit a13b014719)
2025-02-05 01:02:16 +01:00
Elena Sayapina
ea58a3590e IDEA-165950 [TESTUPDATE] National keyboard layouts support
Update regression test after the following commits:

02fad83c: Remove public constants from KeyEvent
f4227faf: Impossible to assign cmd+ß shortcuts
(cherry picked from commit 264802cf4b)
(cherry picked from commit 679b5d8cd3)
2025-02-05 01:02:16 +01:00
Elena Sayapina
1cb8666d4c JBR-2328 [TESTBUG] Regression test java/awt/keyboard/AllKeyCode/AllKeyCode.java is not correct
(cherry picked from commit 861f73c393)
(cherry picked from commit bfab6a9364)
(cherry picked from commit e9fa7a0882)
(cherry picked from commit a199826fae)
2025-02-05 01:02:16 +01:00
Mikhail Grishchenko
cbbd4ab0db JBR-2259 WebSite isn't loaded with .loadUrl method if browser isn't shown in UI
Added reproducer

(cherry picked from commit e875bf72c9)
(cherry picked from commit 9aa75b7679)
2025-02-05 01:02:16 +01:00
Denis Konoplev
9725e5d310 JBR-2490 Add option to work with Surface Pen
(cherry picked from commit 5acc7680a1)
(cherry picked from commit b604023cef)
2025-02-05 01:02:16 +01:00
Denis Konoplev
d67b20cc3e JBR-2669: set unicode for both keyCode and extendedKeyCode
(cherry picked from commit ba3f14c83a)
(cherry picked from commit 544176fbce)
2025-02-05 01:02:16 +01:00
Denis Konoplev
94ecfb6cde JBR-2554: Proper unicode values in KeyEvent.keyCode
(cherry picked from commit 703d77a927)
(cherry picked from commit 63bdac9bbf)
2025-02-05 01:02:16 +01:00
Denis Konoplev
5790095cbd JBR-215: Remove SystemInfo
(cherry picked from commit 9adf77a512)
(cherry picked from commit 6a6761d365)
2025-02-05 01:02:16 +01:00
Denis Konoplev
dedb7d58f2 JBR-215: Separate LatinNonAlphaNumKeycodes option
(cherry picked from commit caf366f6f3)
(cherry picked from commit ed143f6d73)
2025-02-05 01:02:16 +01:00
Denis Konoplev
43865a142c JBR-215: Windows non-alphanumeric shortcuts
(cherry picked from commit 4f60efebe2)
(cherry picked from commit b5fd23e498)
2025-02-05 01:02:16 +01:00
Denis Konoplev
502a1a3f62 JBR-2280: Fix regression. Mode compatible with old option.
(cherry picked from commit a3e3c23cb1)
(cherry picked from commit 8c15ab819c)
2025-02-05 01:02:15 +01:00
Denis Fokin
a109834ddf macOS national keyboard support
(cherry picked from commit 83356eb0bb)
(cherry picked from commit c8a36e1804)
2025-02-05 01:02:15 +01:00
Nikita Gubarkov
5718e9cbd6 JBR-6387 Revert "8315701: [macos] Regression: KeyEvent has different keycode on different keyboard layouts"
(cherry picked from commit efd4acd419)
2025-02-05 01:02:15 +01:00
Sergey Malenkov
d7b2705537 JBR-1929 FractionalMetricsSupport
(cherry picked from commit bbdc159762)
(cherry picked from commit 9fad8b07f1)
2025-02-05 01:02:15 +01:00
Mikhail Grishchenko
3c7cf594ad JBR-2256 JEditorPane with test/html type and zero margins is not shown
Updated reproducer

(cherry picked from commit 529a188b8b)

JBR-2256 JEditorPane with test/html type and zero margins is not shown

Added reproducer

(cherry picked from commit 41578a40b5)

with fix for JBR-5300 Change source code and test files to use GPL license

(cherry picked from commit 775801a875)
2025-02-05 01:02:15 +01:00
Mikhail Grishchenko
6a84ab0648 JBR-2210 IDEA fails to start (JVM crashes) when using the -Dfile.encoding=UTF-8in IDEA's vmoptions file
Added regression test

(cherry picked from commit 4e1f5a43b3)

with fix for JBR-5300 Change source code and test files to use GPL license

(cherry picked from commit f7cf514da2)
2025-02-05 01:02:15 +01:00
Mikhail Grishchenko
9b8677a58e JBR-1414 [Test] downscale frames to run on low-dpi screens
(cherry picked from commit b46e74fe6f)
(cherry picked from commit 844b3e1d5f)
2025-02-05 01:02:15 +01:00
Elena Sayapina
aaa54d9835 JBR-1905 [TESBUG] java/awt/TextArea/DisposeTest/TestDispose.java: frame is not disposed
- java/awt/TextArea/DisposeTest/TestDispose.java, java/awt/TextField/DisposeTest/TestDispose.java: fixed test frame disposal
- java/awt/Frame/DisposeStressTest/DisposeStressTest.java: decreased test timeout from 2h to 10 min, added minor diagnostic logging

(cherry picked from commit 7f025f4e16)
(cherry picked from commit dda7f3d871)
(cherry picked from commit bc09aadadb)
(cherry picked from commit 0905abecf5)
2025-02-05 01:02:15 +01:00
Alexey Ushakov
03126a21a4 JBR-2135 Use CoreText api to select the font with the most recent version
Added a property to force loading bundled fonts: -Djava2d.font.noVersionCheck=true

(cherry picked from commit cbb148dff4)
(cherry picked from commit db7e53e67d)
2025-02-05 01:02:15 +01:00
Alexey Ushakov
2787a72db5 JBR-2137 JetBrainsMono fonts update to v1.0.3
(cherry picked from commit a6e441828a)
(cherry picked from commit b25c90ba53)
2025-02-05 01:02:15 +01:00
Mikhail Grishchenko
bbced9a323 JBR-1414: Added regression test for dnd with HiDPI scaling
(cherry picked from commit 1f4ab12fbb)

with fix for JBR-5300 Change source code and test files to use GPL license

(cherry picked from commit ba00bacb9f)
2025-02-05 01:02:15 +01:00
Elena Sayapina
ee8db185bf JBR-2041 [TEST] Added new regression test (Touchscreen devices support)
(cherry picked from commit 2d587b3728)
(cherry picked from commit 92606f2c7f)
(cherry picked from commit 05af375909)
(cherry picked from commit 0f895bf1b2)
(cherry picked from commit 08aa0852b7)

with fix for JBR-5300 Change source code and test files to use GPL license

(cherry picked from commit 9bd62fade9)
2025-02-05 01:02:15 +01:00
Konstantin Bulenkov
61f492e54c Update JetBrains Mono to 1.0.2
(cherry picked from commit 6f4a13e46f)
(cherry picked from commit b14bfd3ac9)
2025-02-05 01:02:15 +01:00
Ivan Migalev
da95bf0c1f Extract the DWM colorization parameters from registry (JBR-2070)
(cherry picked from commit 0330cab60b)
(cherry picked from commit 6525a8b70d)
2025-02-05 01:02:15 +01:00
Ivan Migalev
2b9632abd5 Refresh desktop properties on WM_DWMCOLORIZATIONCOLORCHANGED (JBR-2070)
(cherry picked from commit 06086f4a7e)
(cherry picked from commit afd04d7c5b)
2025-02-05 01:02:15 +01:00
Ivan Migalev
83fdf14db8 Fix a possible resource leak in ColorizationColorAffectsBorders
(cherry picked from commit 0c911b6ffe)
(cherry picked from commit ffbaf5e1d1)
2025-02-05 01:02:14 +01:00
Elena Sayapina
bca003fba4 JBR-2086 JetBrainsMono fonts update to v1.0.1
(cherry picked from commit a4b373e631)
(cherry picked from commit 462fef3916)
2025-02-05 01:02:14 +01:00
Konstantin Bulenkov
fdf25b9925 JetBrains Mono 1.0
(cherry picked from commit d514f7a982)
(cherry picked from commit 56ee3ef459)
2025-02-05 01:02:14 +01:00
Denis Konoplev
945b732c9a JBR-3444: Return NullSurfaceData when gc == null
(cherry picked from commit 01ad15e61c)
(cherry picked from commit 2a7a828ec8)
2025-02-05 01:02:14 +01:00
Denis Konoplev
1383982ef9 JBR-1995: Last character issue with korean
Fix for JTextComponent

(cherry picked from commit a7c8b0b535)
(cherry picked from commit 48410e5865)
2025-02-05 01:02:14 +01:00
Denis Konoplev
c9dd761a13 JBR-2891: Post PhaseEvents in the begin and end of Magnify and Rotate
(cherry picked from commit c811c295c2)
(cherry picked from commit fe18b612dc)
2025-02-05 01:02:14 +01:00
Denis Konoplev
181f65e7f6 JBR-2444: Turn on IM workaround by default
(cherry picked from commit 15c4ce1d3e)
(cherry picked from commit fe0c4e5b9e)
2025-02-05 01:02:14 +01:00
Denis Konoplev
eac08e30ba Fix build: add import & fix jwhen
(cherry picked from commit 3551c2a4c0)
2025-02-05 01:02:14 +01:00
Denis Konoplev
19ae2a9521 JBR-2795: Add explicit conversion
(cherry picked from commit bf3e1c0c31)
(cherry picked from commit 5f07df3034)
2025-02-05 01:02:14 +01:00
Denis Konoplev
5a4d66cf3c IDEA-237231: Correct signarute mask
(cherry picked from commit 6974131eec)
(cherry picked from commit af2154f8b1)
2025-02-05 01:02:14 +01:00
Denis Konoplev
9644aa238a IDEA-237231: Possible fix for pen interraction
(cherry picked from commit 33a8c95d39)
(cherry picked from commit 58fbc3f800)
2025-02-05 01:02:14 +01:00
Denis Konoplev
be5914d875 JBR-2041: Project view tap fix, recovery? constants & logging
(cherry picked from commit 1e904db3b0)
(cherry picked from commit 5c62dbdbca)
2025-02-05 01:02:14 +01:00
Denis Konoplev
2a6cd649ce IDEA-229135: Fling animation stop on tap
(cherry picked from commit 7ce0f79561)
(cherry picked from commit 01f0f774b4)
2025-02-05 01:02:14 +01:00
Denis Konoplev
57ec05bac1 Windows touch screen support
(cherry picked from commit cab3f28907)
(cherry picked from commit ce0e4aff62)
2025-02-05 01:02:14 +01:00
Denis Konoplev
19270368c0 Turn off multitouch
(cherry picked from commit a2576ffa9a)
(cherry picked from commit 41eaa75d27)
2025-02-05 01:02:14 +01:00
Denis Konoplev
1176ecba70 Check XInput extension && touch inertia
(cherry picked from commit cca7fb97f4)
(cherry picked from commit edcb7310d3)
2025-02-05 01:02:13 +01:00
Denis Konoplev
31485e9950 Touch scroll handling
(cherry picked from commit 6dcec3dc31)
(cherry picked from commit c585901afe)
2025-02-05 01:02:13 +01:00
Denis Konoplev
529d3b49ba XI2 Constants
(cherry picked from commit 588cd6ee73)
(cherry picked from commit 2e4a8ba10b)
2025-02-05 01:02:13 +01:00
Denis Konoplev
51576fd885 XLibWrapper XI2 functions
(cherry picked from commit d6bd1bfa2b)
(cherry picked from commit 7edf395b3b)
2025-02-05 01:02:13 +01:00
Denis Konoplev
b78695f3c2 X11 native get put double
(cherry picked from commit f101bc1108)
(cherry picked from commit 344fe36ceb)
2025-02-05 01:02:13 +01:00
Denis Konoplev
ad80894394 Native data types
(cherry picked from commit 9504574dbb)
(cherry picked from commit 5967b3f41b)
2025-02-05 01:02:13 +01:00
Denis Konoplev
dfadb3d1dd XI2 headers in xlib wrapper generator
(cherry picked from commit ef108067a1)
(cherry picked from commit 1397389026)
2025-02-05 01:02:13 +01:00
Denis Konoplev
8f73dc097b Revert "Turn off multitouch"
This reverts commit 90ea3bf57e4c687e9d9bf0a37f2f64c82a81f4eb.

(cherry picked from commit b154b46eb0)
2025-02-05 01:02:13 +01:00
Denis Konoplev
2ea04d349f Turn off multitouch
(cherry picked from commit a2576ffa9a)
(cherry picked from commit 960e154377)
2025-02-05 01:02:13 +01:00
Alexey Ushakov
e689595f66 JBR-1962 Allow to change font config
Replaced several privileged blocks with just one

(cherry picked from commit faa8d3d258)
(cherry picked from commit 2ffadb5f9a)
2025-02-05 01:02:13 +01:00
Vitaly Provodin
ffcc47da6f JBR-572: Regression test on the crash caused by the fix
(cherry picked from commit 6cc380ffb5)
(cherry picked from commit 958e25ed21)
(cherry picked from commit a7de601d5f)

with fix for JBR-5300 Change source code and test files to use GPL license

(cherry picked from commit 32a3948437)
2025-02-05 01:02:13 +01:00
Dennis Ushakov
4de624d6d0 JBR-1863, JBR-1868 correct advances on Catalina
(cherry picked from commit bff05a1a97)
2025-02-05 01:02:13 +01:00
Dennis Ushakov
c9b74fc3db JBR-1850: on macOS fonts should be sorted by weight to ensure proper population of the families
(cherry picked from commit 59974ca04c)
2025-02-05 01:02:13 +01:00
Dennis Ushakov
bffd9d25b1 faster font family loading & lazy font family population
1. NSFont.familyName is faster than loading allFamilyNames
2. Prebuilt list of system fonts
3. Cleanup San Francisco family loading
4. Avoid calling expensive native getWidth on font when creating font family, load styles only when they would be used.

(cherry picked from commit db44a8c70e)
2025-02-05 01:02:13 +01:00
Dennis Ushakov
75d2f22c7e JBR-1756 use CoreText for all font rendering on Catalina
(cherry picked from commit a4f42cd091)
2025-02-05 01:02:12 +01:00
Nikita Gubarkov
2ce2185198 JBR-410 Added emoji support for Linux
(cherry picked from commit a98fac2c53)
2025-02-05 01:02:12 +01:00
Alexey Ushakov
3fda986da0 JBR-1997 JetBrainsMono fonts update to v0.22
(cherry picked from commit 41f4fddd34)
(cherry picked from commit f5302a02f4)
(cherry picked from commit 5d7fd2e1e5)
(cherry picked from commit 6d27bc749b)
2025-02-05 01:02:12 +01:00
Anton Tarasov
79c1fe5574 JRE-729 [windows] unreasonable IME activity consumes CPU
(cherry picked from commit caf8462e09)
2025-02-05 01:02:12 +01:00
Dmitry Batrak
0cf478d4e0 JBR-3119 Application's panel in KDE taskbar blinks when popup window is shown
this re-fixes JBR-2934 in a different way

(cherry picked from commit 63134e091b)
(cherry picked from commit d805bf045f)
2025-02-05 01:02:12 +01:00
Dmitry Batrak
3562f70de0 JBR-3038 Unexpected windows z-order change on workspace switch
(cherry picked from commit ddda860f42)
(cherry picked from commit f4b23f8be1)
2025-02-05 01:02:12 +01:00
Dmitry Batrak
7058f71de5 JBR-3035 The Confirm Exit pop-up window remains hidden behind a window of another application
(cherry picked from commit 470c3bd1b5)
(cherry picked from commit 64e4203555)
2025-02-05 01:02:12 +01:00
Dmitry Batrak
cbf9c03723 JBR-2934 Serious usability issue with GoLand 2020.3 caused by JBR
(cherry picked from commit 95be4351d4)
(cherry picked from commit 79d0b926b2)
2025-02-05 01:02:12 +01:00
Dmitry Batrak
74d2f70f2c JBR-2977 Opening a recent project in a new window doesn't bring this window to the front
(cherry picked from commit 2d9fb9e7b8)

with fix for JBR-5300 Change source code and test files to use GPL license

(cherry picked from commit 27f390cf9a)
2025-02-05 01:02:12 +01:00
Dmitry Batrak
23ec54e23a JBR-2698 setAutoRequestFocus(false) breaks focus logic under i3 window manager on Linux
(cherry picked from commit ebcdeb7d80)
(cherry picked from commit 6d26292983)
2025-02-05 01:02:12 +01:00
Dmitry Batrak
81431313b4 JBR-2696 Log focus API invocations with stack traces
(cherry picked from commits 0f038754e5, a507cab6d3)

(cherry picked from commit a494c76a27)
2025-02-05 01:02:12 +01:00
Dmitry Batrak
3251054675 JBR-2496 Prevent JVM stealing focus from other applications on Linux (JBR-2497, JBR-2499, JBR-2503, JBR-2652)
(cherry picked from commits 87525d1d2a, 66381f0dec, 8a789e04e9, 665ebc5d47, 98a9219c23)

with fix for JBR-5300 Change source code and test files to use GPL license

(cherry picked from commit 42aad68ab4)
2025-02-05 01:02:12 +01:00
Alexey Ushakov
23607e8385 JBR-3509 Extend JDK-8267521 (Post JEP 411 refactoring: maximum covering > 50K) to JBR specific changes
Marked all the usages of SecurityManager related api

(cherry picked from commit a783b841ac)
2025-02-05 01:02:12 +01:00
Artem Bochkarev
f17c191bab JBR-1851: check NSArray length
and make more exception-safe
and minor optimization for logging (cache jobjects)

(cherry picked from commit 5839539379)
(cherry picked from commit 23a3321d6d)
2025-02-05 01:02:12 +01:00
Artem Bochkarev
c57056c4c8 JBR-1841: allow deferred disabling of InputMethods-support
(cherry picked from commit 969255904b)
(cherry picked from commit f8513bcad9)
2025-02-05 01:02:12 +01:00
Artem Bochkarev
50248545c5 JBR-1668: add hardcoded default values for preferences node NSServicesStatus
(cherry picked from commit 8445f53d85)
(cherry picked from commit 2e3a5fe508)
2025-02-05 01:02:11 +01:00
Artem Bochkarev
54c8538ad9 JBR-1515: obtain shortcut from OS to check inside AWTView.performKeyEquivalent
(cherry picked from commit 30d479fbd4)

JBR-4899 Activate Previous Window doesn't work sometimes

(cherry picked from commit 63cb726f3c)
(cherry picked from commit ddeeb4c813)
2025-02-05 01:02:11 +01:00
Artem Bochkarev
f2f1e283f6 JBR-1668: add hardcoded descriptions of system actions
and minor fixes

fix memory management

(cherry picked from commit 15f7368309)
(cherry picked from commit 5aec21a5cd)
2025-02-05 01:02:11 +01:00
Elena Sayapina
1e266f7ea9 JBR-1417 [TEST] Added new regression test (JBR 11 does not support chain of popups)
(cherry picked from commit 41e89505be)
(cherry picked from commit 9fe5c778d9)
(cherry picked from commit 6ea9530d9f)
(cherry picked from commit d757108517)
(cherry picked from commit b99c1e7b5c)

with fix for JBR-5300 Change source code and test files to use GPL license

(cherry picked from commit 9745d7d7dc)
2025-02-05 01:02:11 +01:00
Alexey Ushakov
49afb92d1c JBR-1690 Bundle new fonts
Test correction
Restored RenderUtil.java
Removed obsolete golden images
(cherry picked from commits:
aa13c8b4ea
943b1472c7
cab6dd5087
7997c7a5ee
cab6dd5087
7997c7a5ee
d3731df79d)

with fix for JBR-5300 Change source code and test files to use GPL license

(cherry picked from commit a9a049709c)
2025-02-05 01:02:11 +01:00
Dmitry Batrak
ee9870ec38 IDEA-257525 Unable to show Chinese when using IDEA mac ARM version
The proposed solution is to use a 'normal' font as a base for 'San Francisco' font fallback.
Most of its fallback components/candidates (provided by the OS) are expected to be normal
fonts as well, and so the resulting coverage of Unicode character repertoire should be much better.

(cherry picked from commits 9b7113a6cf, 92b00d50b5, 53489fab27)

(cherry picked from commit 7b14db7f6b)
2025-02-05 01:02:11 +01:00
Dmitry Batrak
bbd89f661e JRE-469 Console with emoji output becomes slow
The fix consists of two parts:
* Making CCharToGlyphMapper remember that a particular character cannot be displayed (isn't mapped to glyph with given font). Checking this repeatedly in native code is very slow.
* Make CCompositeGlyphMapper remember the results of char-to-glyph mapping, this was missing in previous implementation. This reuses caching code in CompositeGlyphMapper, extending the range of characters for which the results are cached to include Supplementary Multilingual Plane (most emoji characters belong to it).

port commit 4e0ccde2 from JBR 9

port from JBR 11 to JBR 15 (cherry picked from commit 394e055ae6)

cherry picked from commit 0db7e948af

(cherry picked from commit 7721393e5b)
2025-02-05 01:02:11 +01:00
Dmitry Batrak
2ab1882ae4 reimplement JDK-7162125 to fix JDK-8147002
port commit ba38e5c4 from JBR 9

port from JBR 11 to JBR 15(cherry picked from commit a949f9d220)

cherry-picked from commit f309844f75

with fix for JBR-5300 Change source code and test files to use GPL license

(cherry picked from commit f9942d50a8)
2025-02-05 01:02:11 +01:00
Artem Bochkarev
a4216d9fb5 JBR-1771: fixed compilation errors (macosx-x86_64-normal-server-fastdebug)
(cherry picked from commit 1acada7cac)
(cherry picked from commit c1751ca98d)
2025-02-05 01:02:11 +01:00
Artem Bochkarev
905758698f JBR-1668: minor fixes
fixed review comments

(cherry picked from commit 9dbcf194c9)
(cherry picked from commit 8276f81a13)
2025-02-05 01:02:11 +01:00
Vitaly Provodin
91673d4eff JBR-1618: fixed misprint, added saving screenshots in case of failure
(cherry picked from commit e4a3889cf0)
(cherry picked from commit 3959ac1680)
2025-02-05 01:02:11 +01:00
Alexey Ushakov
d77c8e6d8a JBR-1624 Fonts rendering is broken in the 2019.2 EAP (Fira Code)
Corrected lookup for bold fonts

(cherry picked from commit 114b8af38f)
(cherry picked from commit fa0816c404)
2025-02-05 01:02:11 +01:00
Alexey Ushakov
ba6fe9c5d3 JBR-1399 Improve font discovery and loading by introducing font cache
Added unit test

(cherry picked from commit b4f5bf8bd3)
(cherry picked from commit a0eb49776a)
2025-02-05 01:02:11 +01:00
Elena Sayapina
458f86c497 IDEA-165950 [TEST] Added new regression test (National keyboard layouts support)
(cherry picked from commit 0900a705bc)

with fix for JBR-5300 Change source code and test files to use GPL license

(cherry picked from commit 0981cb572a)
2025-02-05 01:02:11 +01:00
Artem Bochkarev
d6d94a31f6 JBR-1668: read system keyboard shortcuts
initial support for OS X

(cherry picked from commit 6bbe7102e2)
(cherry picked from commit ccd8116bf3)
2025-02-05 01:02:11 +01:00
Artem Bochkarev
c2d6300a79 JBR-1573: restore current input context after cleanup
(cherry picked from commit b7acd7f6f6)
(cherry picked from commit 9dbdd24cc3)
2025-02-05 01:02:10 +01:00
Alexey Ushakov
4a11be34b7 JBR-1624 Fonts rendering is broken in the 2019.2 EAP (Fira Code)
Restored old behaviour of registerFontsInDir as it does not affect idea bundled fonts

(cherry picked from commit cef29e8100)
(cherry picked from commit e3a1cdae23)
2025-02-05 01:02:10 +01:00
Alexey Ushakov
681feefb85 JBR-1874 Cursor not changing from 'default' to 'text'
Prevent OS from changing cursor

(cherry picked from commit 94a4eb7002)
(cherry picked from commit c640e06d25)
2025-02-05 01:02:10 +01:00
Alexey Ushakov
c12255422d JBR-1778 Font in editor incorrect (always italics)
Added -it pattern into italic detection code
Added some more patterns to bold and italic detection code
'Anka/Coder' font support

(cherry picked from commit 5119eeee12)
(cherry picked from commit ec241e4a0a)
(cherry picked from commit 251068294e)
(cherry picked from commit 08ae9ff034)
(cherry picked from commit b472b89fba)
2025-02-05 01:02:10 +01:00
Alexey Ushakov
57bb257a29 JBR-1699 Use platform font rendering for bundled fonts on MacOS
Use different family for specific font faces. Refactoring

JBR-3071 Remove naming workaround for Fira Code

(cherry picked from commits c423003bd4, aee4b48d20)

(cherry picked from commit 8838b708be)
2025-02-05 01:02:10 +01:00
Alexey Ushakov
60dcbf384e JBR-1624 Fonts rendering is broken in the 2019.2 EAP (Fira Code)
Lower priority for idea bundled fonts to pickup platform ones
(if installed)

(cherry picked from commit e838103a24)
(cherry picked from commit 181c757ebe)
2025-02-05 01:02:10 +01:00
Alexey Ushakov
9c818ad58c JBR-1885 JetBrainsMono fonts update to v0.19
Updated the fonts to v0.19. Bundled italic fonts

(cherry picked from commit 7f032e3fe7)
(cherry picked from commit a7b4c9449a)
(cherry picked from commit 9c9cea0871)
2025-02-05 01:02:10 +01:00
Alexey Ushakov
c4e7dc5188 JBR-1624 Fonts rendering is broken in the 2019.2 EAP (Fira Code)
Lower priority for idea bundled fonts to pickup platform ones
(if installed)

(cherry picked from commit e838103a24)
(cherry picked from commit 517bd6d449)
2025-02-05 01:02:10 +01:00
Alexey Ushakov
406ca4038b JBR-1699 Use platform font rendering for bundled fonts on MacOS
Used CFont instead of TrueTypeFont for bundled fonts on mac
Use different family for specific font faces. Refactoring

(cherry picked from commit 8c86ad3e96)
(cherry picked from commit c423003bd4)
(cherry picked from commit bcae402dc8)
(cherry picked from commit e53374aab3)
2025-02-05 01:02:10 +01:00
Alexey Ushakov
c663219df4 JBR-1690 Bundle new fonts
Update family name for JetBrainsMono-Thin

(cherry picked from commit 0d2326ff34)
(cherry picked from commit 83843f9124)
(cherry picked from commit 2a2e1cfb36)
(cherry picked from commit 76abb69262)
(cherry picked from commit 1350ceb04b)
2025-02-05 01:02:10 +01:00
Alexey Ushakov
6d05532eff JBR-1645 javax/swing/JTextArea/TestTabSize.java: Tab width calculation wrong
Corrected idea font filter

(cherry picked from commit 62f9d1f46a)
(cherry picked from commit 3dab43f987)
2025-02-05 01:02:10 +01:00
Artem Bochkarev
5ed80a8bbe JBR-1573: workaround for 'Sudden keyboard death on Ubuntu 18'
recreate instance of system InputMethod when starts filter all events

(cherry picked from commit 3ad94911af)

(cherry picked from commit c8533a1219)
(cherry picked from commit 42c5f07276)
2025-02-05 01:02:10 +01:00
Alexey Ushakov
546df2543c JBR-1399 Improve font discovery and loading by introducing font cache
Bundle IDEA fonts to improve startup performance

(cherry picked from commit 350a3fdef3)
(cherry picked from commit 4ad45a0c84)
2025-02-05 01:02:10 +01:00
Artem Bochkarev
1e93b4a095 JBR-1541: activate menu in completion handler of modal dialog
(cherry picked from commit e57384c1d6)
(cherry picked from commit b38f01f5e4)
2025-02-05 01:02:10 +01:00
Alexey Ushakov
f8145f8df3 JBR-1314 Font difference in pycharm 2019.1 on Ubuntu
Removed disabling hints on MAX_FCSIZE_LTL_DISABLED font size

(cherry picked from commit 2b99dfed40)
(cherry picked from commit 4cf33c4d27)
2025-02-05 01:02:09 +01:00
Alexey Ushakov
8131360692 JBR-1412 [fwp to JBR11] JBR-1393 RubyMine is hanging after log in (macOS)
Modified version of JBR8 fix

(cherry picked from commit 434166fe63)
(cherry picked from commit db7cdf1d90)
2025-02-05 01:02:09 +01:00
Alexey Ushakov
a36098821c JBR-1394 JBR11 does not support LCD text on Mac
Enable LCD rendering for transparent destinations

(cherry picked from commit 207c6b92ff)
(cherry picked from commit 2254451953)
2025-02-05 01:02:09 +01:00
Elena Sayapina
8cfeffbe54 JBR-1372: [TESTBUG] JDialog1054.java, MoveFocusShortcutTest.java regression tests need update
(cherry picked from commit a5948894bf)
(cherry picked from commit dcc2be2a53)
2025-02-05 01:02:09 +01:00
Maxim Kartashev
8d8401bd4c JBR-2755 IDE UI became slow via remote X Server connection from Windows
When XGetImage() calls become slow in a remote X11 session, fake
XGetImage() with client-side XCreateImage() that is filled with some
background color. The color is chosen from several top left corner
pixels of the "slow" images obtained with XGetImage().

This feature activates in a remote X11 session only and is
controlled with -Dremote.x11.workaround={true|false|auto}.

(cherry picked from commit 76decaa4ef)
2025-02-05 01:02:09 +01:00
Vyacheslav Moklev
a4337149d4 Fix const pointer after JDK-8225032 fix
(cherry picked from commit dc3ae1cafa)
2025-02-05 01:02:09 +01:00
Vyacheslav Moklev
33bdee86c5 Fix compilation on windows platform: awt_ole.h must be included before awt.h
(cherry picked from commit 6fdcfedd0e)
2025-02-05 01:02:09 +01:00
Vyacheslav Moklev
7edc406dc0 JBR-1269 Common Item Dialog does not appear on Alt+Tab or click in windows toolbar
JBR-1270 Common Item Dialog does not have an icon

Select a proper window handle

(cherry picked from commit 92fb89e3e3)
2025-02-05 01:02:09 +01:00
Vyacheslav Moklev
55fcb88d5d JBR-1271 Wrong parent of native windows dialogs
Set a proper parent to a dialog window

(cherry picked from commit 803ba97361)
2025-02-05 01:02:09 +01:00
Vyacheslav Moklev
a69a3156ad JBR-1273 Common Item Dialog does not open when wrong path to directory is passed
Handle set directory / set file properly

(cherry picked from commit b96492f7de)
2025-02-05 01:02:09 +01:00
Vyacheslav Moklev
6ef3f7c56f JBR-1274 Common Item Dialog sometimes crash the process
Prevent from freeing memory with CoTaskMemFree twice

(cherry picked from commit 8e5e04a798)
2025-02-05 01:02:09 +01:00
Vyacheslav Moklev
9450f9c440 JBR-1257 CommonItemDialog modal window has no owner
Fix modality for Common Item Dialog

squash! JBR-1257 CommonItemDialog modal window has no owner

JBR-2478 java/awt/Modal/FileDialog/FileDialogNonModal7Test.java: DummyButton on Dialog did not gain focus when clicked

revert part of JBR-1271, that's related to 'old' file dialogs

(cherry picked from commit 8bc4787c11)
2025-02-05 01:02:09 +01:00
Vyacheslav Moklev
740a78227b JBR-1258 CommonItemDialog ignores directory to open
Fix parsing of directory path / file path

(cherry picked from commit b09a8aace1)
2025-02-05 01:02:09 +01:00
Vyacheslav Moklev
7b976911b7 JRE-1216 Implement Windows native file dialogs with the new Common Item Dialog API
Add implementation of file dialogs with the new Common Items Dialog API

(cherry picked from commit e2fb4ced09)
2025-02-05 01:02:09 +01:00
Alexey Ushakov
0404a9125b JBR-1144 [JDK11] [macos] Held down key is not deleted when press backspace after accent menu popup (Mojave)
Handled both Delete and ForwardDelete keys

(cherry picked from commit e3ba0bd651)
(cherry picked from commit 64cabb0dc7)
2025-02-05 01:02:09 +01:00
Alexey Ushakov
2f96a1388b JBR-1144 [JDK11] [macos] Held down key is not deleted when press backspace after accent menu popup (Mojave)
Handled backspace separately

(cherry picked from commit 81916a92af)
(cherry picked from commit 60ae63de08)
2025-02-05 01:02:08 +01:00
Elena Sayapina
389aed7e97 JBR-1102: [TESTBUG] java/awt/Paint/ComponentIsNotDrawnAfterRemoveAddTest/ComponentIsNotDrawnAfterRemoveAddTest.java: 'paint' method of 60 components was not called
(cherry picked from commit dc7abebe17)
(cherry picked from commit c8d631a142)
(cherry picked from commit a133cd791e)
2025-02-05 01:02:08 +01:00
Elena Sayapina
deb291ee3b JBR-998: [TEST] Added new regression test (Input freezes after MacOS key-selector on Mojave)
(cherry picked from commit 3d898a8024)
(cherry picked from commit f368f0f101)

with fix for JBR-5300 Change source code and test files to use GPL license

(cherry picked from commit 362b7d402d)
2025-02-05 01:02:08 +01:00
Elena Sayapina
7618a905ed JBR-318: [TEST] Added new regression test (Cmd+` doesn't work after update to JDK 152_*)
(cherry picked from commit 0be0a018b5)
(cherry picked from commit 5bb4c2a1d6)

with fix for JBR-5300 Change source code and test files to use GPL license

(cherry picked from commit 7fa8aa1568)
2025-02-05 01:02:08 +01:00
Elena Sayapina
4b1286f4bb JBR-1054: [TEST] Added new regression test (Weird non-modal dialog above modal dialog behaviour)
(cherry picked from commit b808be6a6a)
(cherry picked from commit 48b7dd874f)

with fix for JBR-5300 Change source code and test files to use GPL license

(cherry picked from commit a39264214b)
2025-02-05 01:02:08 +01:00
Vitaly Provodin
6f0f31e9f6 JRE-1117 J2DBench: introduced result reader for TC's charts (follow up)
separated printing values fo TC charts and values for comparisons

(cherry picked from commit bbdbe17e2a)
(cherry picked from commit 3e5dcf6aeb)
2025-02-05 01:02:08 +01:00
Vitaly Provodin
57b593d7b4 JRE-1117 J2DBench: introduced result reader for TC's charts
(cherry picked from commit 422fa59643)
(cherry picked from commit 43b5f7f8b0)
2025-02-05 01:02:08 +01:00
Alexey Ushakov
b4aca9e439 JRE-60 Editor font is distorted on Kubuntu Linux 16.04 with HiDPI
Override FC_HINT_SLIGHT only for small font sizes

(cherry picked from commit 0e1d23c807)
(cherry picked from commit 56e10e7d27)
2025-02-05 01:02:08 +01:00
Alexey Ushakov
8e0a6c2b97 JRE-471 Crash on macOS Sierra after Sleep
Replaced [NSScreen screens] 'objectAtIndex' with 'firstObject' to get nil instead of NSRangeException. Added nil checks

(cherry picked from commit d6b98511262055c01522d9ec8024253af7e91564)
(cherry picked from commit cef970e1ba)
(cherry picked from commit 9f34bb4ee4)
2025-02-05 01:02:08 +01:00
Alexey Ushakov
a08e6a0919 JRE-608 J2DBench metrics: up to 20x degradation
Increased rendering queue buffer up to 6.4 MB

(cherry picked from commit 9ef00f00a7fb6e14835393f8d3944157c6800727)
(cherry picked from commit 2a61e9e997a880a60c5acb361849205170501b91)
(cherry picked from commit 68ca9f00ded004c970b94bd047a04b9f09237047)
(cherry picked from commit 2fe5289178)
(cherry picked from commit 560a65654e)
2025-02-05 01:02:08 +01:00
Alexey Ushakov
a681a4d9b5 JRE-1028 fwport(9): JRE-1008 Do not use LCD shader on macOS 10.14+ in font rendering
Disable LCD text shader on macOS 10.14+ if LCD rendering is not explicitly specified

(cherry picked from commit dffea9d701)
(cherry picked from commit 1628d6120e)
2025-02-05 01:02:08 +01:00
Konstantin Bulenkov
b0339ca9c6 update icons
(cherry picked from commit dfe387ff5037deda29d8d522cba6cc5370796ff4)
(cherry picked from commit de1e4a9d71)
(cherry picked from commit 0b33efa7d1)
2025-02-05 01:02:08 +01:00
Vitaly Provodin
d425c0fb71 Update README.md
(cherry picked from commit eacef38934)
2025-02-05 01:02:08 +01:00
Vitaly Provodin
36e515c2f2 Regression test on https://bugs.openjdk.java.net/browse/JDK-8139176
JBR-5008 remove extra file jb/java/awt/font/DrawTest.java from colliding group

(cherry picked from commit 6f1c0a6)
(cherry picked from commit 63130fd461)

add regression test on https://bugs.openjdk.java.net/browse/JDK-8139176

(cherry picked from commit 380c17456c)

(cherry picked from commit 6f1c0a6)
(cherry picked from commit 63130fd461)
(cherry picked from commit 33bbc7d54d)
2025-02-05 01:02:08 +01:00
Vitaly Provodin
1da2f23778 not for upstream: added disposing frames in order to provide the test with the chance on the second run
(cherry picked from commit 8170635)
(cherry picked from commit 7fc924f065)
(cherry picked from commit a2f9387697)
2025-02-05 01:02:08 +01:00
Vitaly Provodin
d41ca5bac6 JRE-9: added regression test
(cherry picked from commit 4ffb665)
(cherry picked from commit 00a29ad129)

with fix for JBR-5300 Change source code and test files to use GPL license

(cherry picked from commit 05ad949ded)
2025-02-05 01:02:07 +01:00
Sergey Malenkov
7f18491c3e JRE-100 Scroll with inertia (Mac os) should only work in the initial component
(cherry picked from commit e79502c708)
(cherry picked from commit 223a74bfeb)
2025-02-05 01:02:07 +01:00
Sergey Malenkov
f20edb0934 IDEA-161965 ignore dragged event that does not change mouse location Sierra is more sensit
(cherry picked from commit ef490fa465)
(cherry picked from commit 3722edc9f2)
2025-02-05 01:02:07 +01:00
Dmitry Batrak
fd5fc93dc5 JBR-3339 Window requests focus on horizontal scroll (on Linux)
(cherry picked from commit 8d74e8e30b)
(cherry picked from commit 88edabdd60)
2025-02-05 01:02:07 +01:00
Anton Tarasov
4d95dc0022 JRE-166 [macOS] deadlock with JFXPanel
(cherry picked from commit a9dbb6990fac0c659297487a261ba9170e5fb3ad)

(cherry picked from commit 8a44e1bb37)
(cherry picked from commit 9a280dc79e)
2025-02-05 01:02:07 +01:00
Alexey Ushakov
2321ee3b8b 8265445: Introduce the new client property for mac: apple.awt.windowAppearance
Implemented apple.awt.windowAppearance client property

(cherry picked from commit ba60f7bd8f)
2025-02-05 01:02:07 +01:00
Anton Tarasov
ecccd2c5c1 JBR-3306 jbr-dev warnings: incompatible pointer to integer conversion returning 'void *' from a function with result type 'jlong'
(cherry picked from commit 046409cd7f)
2025-02-05 01:02:07 +01:00
Dmitry Batrak
14b4ec1937 JBR-2498 Fix unexpected window raising under Mutter WM
re-implement the fix, so that ChildAlwaysOnTopTest isn't failing

(cherry picked from commit bf826251fa)
2025-02-05 01:02:07 +01:00
Alexey Ushakov
e1cfa15545 JBR-3327 [jbr-dev] Adjust mac window appearance according to AppleInterfaceStyle property
Set window appearance according to AppleInterfaceStyle default

(cherry picked from commit ffe5b5a504)
2025-02-05 01:02:07 +01:00
Alexey Ushakov
f82f03f775 JRE-238 [736] java.awt.AWTError: access denied ("java.lang.RuntimePermission" "canInvokeInSystemThreadGroup")
Moved task execution on AppKit to the privileged block. Minor refactoring

(cherry picked from commit 5dbb88471115c9e4a536ae37d0e6794de9e5ac9c)
(cherry picked from commit fd2f9a1166)
2025-02-05 01:02:07 +01:00
Alexey Ushakov
2782ba6f78 JRE-359 CGraphicsEnvironment.getDefaultScreenDevice() returns null
Moved CG api calls to AppKit thread

(cherry picked from commit fd0210f035199e8612097a2c1d42b90cfd2111f8)
(cherry picked from commit 5e99e376d9dfe477401121878704630c3c13f9f7)

(cherry picked from commit 6d73b25130)
(cherry picked from commit 9519ac1e6e)
2025-02-05 01:02:07 +01:00
Dmitry Batrak
35610609b4 JBR-2973 Copy/Move dialog not in the focus on drag-n-drop to Project Tool window from external application
(cherry picked from commit 20fe78b650)
(cherry picked from commit 9f6b9baaa8)
2025-02-05 01:02:07 +01:00
Alexey Ushakov
d441fb9507 JRE-444 CPlatformWindow.nativeGetTopmostPlatformWindowUnderMouse is slow
Replaced number of CGWindowListCopyWindowInfo for each window layer with [NSWindow windowNumberAtPoint: belowWindowWithWindowNumber:]

(cherry picked from commit 2a143af4d62340acdfd9c94d876f684385febbc8)
(cherry picked from commit 6fc369e8bf)
(cherry picked from commit 91b0084667)
2025-02-05 01:02:07 +01:00
Alexey Ushakov
0620cdce79 JRE-482 Java_sun_font_CStrike_getNativeGlyphOutline takes too much time in scrolling
Replaced glyph outlines with bounding boxes for glyph boundaries calculation for most common usages. Also, skipped unnecessary OGL flushes in OGL rendering queue

(cherry picked from commit c58dc052af48887338a38beb0c721eddca3af481)
(cherry picked from commit 7f6be7cfb907bbf1c3572b911df5690fa3039fde)
(cherry picked from commit c68913d82c0ba4b4c509179123f0a4bf7971f857)
(cherry picked from commit 9cfa04c93ad416a8177d9e7ca410850bd3ff880f)
(cherry picked from commit 0e930841704e4e98ecc0c888b144245e74218799)
(cherry picked from commit 8ffc190fbdb059d5a24842115c0bc3ade8b351b9)
(cherry picked from commit 0f7c26186a)

with fix for JBR-5300 Change source code and test files to use GPL license

(cherry picked from commit e20819c77b)
2025-02-05 01:02:07 +01:00
Alexey Ushakov
36f1082582 JBR-3316 Reimplement CThreading functionality on top of OpenJDK17 sourcebase
Adopted CThreading related code to OpenJDK17 source base

(cherry picked from commit 5dfb30ae68b2c54d58c98a9195709c031f823581)
(cherry picked from commit 94163bd69f64616836523e81567aa1141480d841)
(cherry picked from commit baca50b430)
2025-02-05 01:02:06 +01:00
Alexey Ushakov
cca578c1a3 JBR-3304 jbr-dev warnings: 'getPhysFontName' defined but not used [-Werror=unused-function]
Removed unused code

(cherry picked from commit 6781f2646f)
2025-02-05 01:02:06 +01:00
Vitaly Provodin
0679e9db55 exclude javax/swing/JTabbedPane/4624207/bug4624207.java failing on windows due to 8197552
(cherry picked from commit 3f8f2e8928)
2025-02-05 01:02:06 +01:00
Alexey Ushakov
46b0c9c381 JRE-366 Add support for Awesome WM
Added detection of Awesome WM and handled similar to Sawfish WM

(cherry picked from commit 6742077ed198975949af567e8ef543f853397351)
(cherry picked from commit 2847be73c6)
(cherry picked from commit 916a2ab66f)
2025-02-05 01:02:06 +01:00
Alexey Ushakov
5a4084fcde JRE-353 Fedora 25 + XMonad rendering issues
Added support for Xmonad WM

(cherry picked from commit c690c3c7fdf1390e6b1a8d388ff752a09391ae3c)
(cherry picked from commit 6851dc3441)
(cherry picked from commit e290bf8a0c)
2025-02-05 01:02:06 +01:00
Denis Konoplev
78b5ca0437 8264143: Change uint8_t to unsigned char
(cherry picked from commit 9d01b82f64)
2025-02-05 01:02:06 +01:00
Dmitry Batrak
9bf0fc249a JBR-3255 Applying 'incline' transform might change character's advance
(cherry picked from commit b37f7cfdb1)
(cherry picked from commit 2bd6c80390)
2025-02-05 01:02:06 +01:00
Dmitry Batrak
b104c5eafb JBR-3215 'deriveFont(float)' can return a different font (not just change the size)
(cherry picked from commit 8eafcaab24)
(cherry picked from commit 3f4065786d)
2025-02-05 01:02:06 +01:00
Dmitry Batrak
99bd6aa732 JBR-3157 Maximized window with custom decorations isn't focused on showing
(cherry picked from commit 62b04983f2)

with fix for JBR-5300 Change source code and test files to use GPL license

(cherry picked from commit e4f68d461c)
2025-02-05 01:02:06 +01:00
Dmitry Batrak
53d9be5ba7 JBR-1752 Floating windows overlap modal dialogs
(cherry picked from commit 0161050077)

with fix for JBR-5300 Change source code and test files to use GPL license

(cherry picked from commit 8b2f0315d1)
2025-02-05 01:02:06 +01:00
Dmitry Batrak
dee46f3b8e JBR-3054 Focus is not returned to frame after closing of second-level popup on Windows
(cherry picked from commit 0c2b6e1c04)

with fix for JBR-5300 Change source code and test files to use GPL license

(cherry picked from commit 8c6ecf33f1)
2025-02-05 01:02:06 +01:00
Dmitry Batrak
2f98f145fe JBR-2702 Tooltips display through other applications on hover
(cherry picked from commits 11732c2469, 0ed7deabaa)

with fix for JBR-5300 Change source code and test files to use GPL license

(cherry picked from commit cc952f4053)
2025-02-05 01:02:06 +01:00
Dmitry Batrak
a7219791e9 added RobotSmokeTest
this test failing in jtreg launch most probably indicates either some problem with the environment (e.g. some windows left open from previously launched processes) or with java.awt.Robot implementation

(cherry picked from commit 1d525a2d2f)

with fix for JBR-5300 Change source code and test files to use GPL license

(cherry picked from commit 9c3043a557)
2025-02-05 01:02:06 +01:00
Dmitry Batrak
8af21c514f JBR-2847 Always dispatch KEY_TYPED event to the same component as KEY_PRESSED event
also fixes JBR-2834, IDEA-254466, IDEA-254466
squashed with fixes for JBR-3291, JBR-3307, JBR-3598

(cherry picked from commits e94f6057a4, ba6b9c085e, 2ccf6b65a7, 3b0708af7d, 3674766d65)

(cherry picked from commit d7383ededb)
2025-02-05 01:02:06 +01:00
Dmitry Batrak
a5871206b6 JBR-2712 Typeahead mechanism doesn't work on Windows
(cherry picked from commits 1a9838082e, f5b6222835, acd7e3b2da, cd6dd5c3cf8556f97f3113cb7d615a92393b57bf(partially), e8bbd8ffdd90f57cd12d7d7e89188be97ee4be0b(partially), 37901295e1, cafb374afc, 12034dcf61)

includes fix for JBR-4974 jb/java/awt/Focus/ModalDialogFromMenuTest.java intermittently clicks at tittle bar

Pause before getting the coordinates of the component to be clicked on,
not right before the click itself.

with fix for JBR-5300 Change source code and test files to use GPL license

(cherry picked from commit 7855e07658)
2025-02-05 01:02:06 +01:00
Denis Konoplev
b5dacd0ea3 8264143: Lanai: RenderPerfTest.BgrSwBlitImage has artefacts on apple M1
Add stdint include to fix x64 build

(cherry picked from commit 0dc04385a3)
2025-02-05 01:02:05 +01:00
Dmitry Batrak
e842dd9000 JBR-2498 Fix unexpected window raising under Mutter WM
(cherry picked from commit 73b45fb899)
(cherry picked from commit bc8dec8fc1)
2025-02-05 01:02:05 +01:00
Dmitry Batrak
e72367a18f JBR-2248 Support text wrapping in a <pre> tag in JEditorPane
port from JBR 11 to JBR 15 (cherry picked from commit ff2e915371)

cherry picked from commit 6a30c56138

(cherry picked from commit add6c7e2c9)
2025-02-05 01:02:05 +01:00
Dmitry Batrak
68c0f9253c JBR-2234 Support CSS setting overflow-wrap:anywhere in JEditorPane
port from JBR 11 to JBR 15 (cherry picked from commits b6583d0a71, 6003abc15f)

cherry picked from commit 93ad4f06dd

also includes JBR-4006 [JCK] javax.swing.text.html.CSS$Attribute.OVERFLOW_WRAP field breaks public API
(cherry picked from commit f20a3d8679)
and JBR-4007 [JCK] javax.swing.text.GlyphView.calcBreakSpots method breaks public API
(cherry picked from commit 1002eff4f3)
(cherry picked from commit f603f9e837)
2025-02-05 01:02:05 +01:00
Dmitry Batrak
ca820fe3e3 JBR-2050 Issue with keycap emojis
port from JBR 11 to JBR 15 (cherry picked from commit ae91e1d7f1)

cherry picked from commit d3018a1837

(cherry picked from commit 17afbc7882)
2025-02-05 01:02:05 +01:00
Dmitry Batrak
75f6821ded JBR-1714 Italic text is displayed using incorrect glyphs on Windows
port from JBR 11 to JBR 15 (cherry picked from commits 46e4cdfcbd, 9cc5cbc99b)

cherry picked from commit 6769b27e53

(cherry picked from commit eccee72823)
2025-02-05 01:02:05 +01:00
Dmitry Batrak
5c62622c44 JBR-1689 Incorrect painting of long strings on linux
port from JBR 11 to JBR 15 (cherry picked from commits e12c1d6f0d, 0429e74e9d)

cherry picked from commit e43cfd198f

(cherry picked from commit 0b3c19d1c4)
2025-02-05 01:02:05 +01:00
Dmitry Batrak
f99d5e6cfe JBR-1248 Exception caused by broken font
port from JBR 11 to JBR 15 (cherry picked from commit 4efa7eab3e)

cherry picked from commit 6e1c514c6c

(cherry picked from commit 452fbf01a5)
2025-02-05 01:02:05 +01:00
Dmitry Batrak
faffacac33 JBR-1245 [JDK 11] There are different letter spacings in some controls
port from JBR 11 to JBR 15 (cherry picked from commit a26b70568a)

cherry picked from commit e2637199e9

(cherry picked from commit ca316d6bc0)
2025-02-05 01:02:05 +01:00
Dmitry Batrak
667f899f9d JRE-927 Unexpected wrapping of bidirectional text in JEditorPane on HiDPI screens
port commit 11a5a4a2 from JBR 9

port from JBR 11 to JBR 15 (cherry picked from commit 65a5e450d5)

cherry picked from commit 47ff31ae82

(cherry picked from commit c4426e7ff2)
2025-02-05 01:02:05 +01:00
Dmitry Batrak
bc167bfb8d JRE-774 Don't paste BOM from clipboard on Mac
port commit ea9b75b3 from JBR 9

port from JBR 11 to JBR 15 (cherry picked from commit c6fed2cf58)

cherry picked from commit a5e25d1ef9

(cherry picked from commit a105a6e802)
2025-02-05 01:02:05 +01:00
Dmitry Batrak
8654e674c1 JRE-847 Box drawing characters have different widths with Monospaced font on Windows
port commit 778cef18 from JBR 9

port from JBR 11 to JBR 15 (cherry picked from commit 9caaac4a5a)

cherry picked from commit eea293f4a4

(cherry picked from commit 7b9b29493d)
2025-02-05 01:02:05 +01:00
Dmitry Batrak
cc862b523d JRE-748 Strange dots with fractional metrics turned on
port commit 82e7c82d from JBR 9

port from JBR 11 to JBR 15 (cherry picked from commit e9bd5f5dad)

cherry picked from commit e0475e9ba2

(cherry picked from commit 714ba79a84)
2025-02-05 01:02:05 +01:00
Dmitry Batrak
76c5205d04 JRE-593 Wrong italic font rendering for Source Code Pro
port commit 1f6bd200 from JBR 9

port from JBR 11 to JBR 15 (cherry picked from commit 32ce109355)

cherry picked from commit 087ff34c2e

(cherry picked from commit 86fa2a9c9b)
2025-02-05 01:02:05 +01:00
Dmitry Batrak
574311214e JRE-430 Font fallback sometimes doesn't work in Swing text components
port commit fc8003ad from JBR 9

port from JBR 11 to JBR 15 (cherry picked from commit 5b814d6b34)

cherry picked from commits b871188f44, 0a9f16dc90, 9cc82c39d9

(cherry picked from commit df8821d745)
2025-02-05 01:02:05 +01:00
Alexey Ushakov
862070ee2d JRE-303 2017.1.1 update breaks linux fonts
Corrected rendering hints for Non-AA text rendering

(cherry picked from commit b923aa7a0729a10ea47d3438622d659fbead44c9)
(cherry picked from commit b6bdd04e41)
(cherry picked from commit 8b12cf08ee)
2025-02-05 01:02:04 +01:00
Alexey Ushakov
e2ba260f98 JRE-205 Font is wrong and without anti aliasing in 2017.1 EAP
Added property to disable bundled font config:
  java2d.font.loadFontConf=false
Do not load custom font.conf by default

Moved hints adjusting logic from code to bundled font.conf file
Applied correction only for regular fonts with platform sizes less than 12
Some fonts are not corrected at all: Consolas, Noto Sans Mono
Used family name instead of physical one in requests to Fontconfig
Removed redundant call to FcConfigBuildFonts
Added privileged access to the properties (JRE-235,JRE-235)

(cherry picked from commit 4d4c915047077ebd966b0e3be056566d56ba11a4)
(cherry picked from commit 9d6f325f72482405264852f3ee2636f5fedaeaf0)
(cherry picked from commit e7e3372bf8db539c0f6bc85db9f1093f8fa4c380)
(cherry picked from commit 3e724caed2f199be50d25d1ecb20b7819c86be2e)
(cherry picked from commit d372b35963c096a32331b05b257e26841ace5d94)
(cherry picked from commit 18a5f5de03eb107f89dca138a44b9aab2151235c)
(cherry picked from commit 9ba320efef0539f75aa93fd1b5dd80266c954d0a)
(cherry picked from commit b8c38f419972af61291953f7f452c1698f7a1624)
(cherry picked from commit debba0128e200be60adc9a339d5985590ef4e230)
(cherry picked from commit 2fa17b1bd7d6524e4b5fa4d0b3ce2bf02a8fcc78)
(cherry picked from commit 09b4f61db0d4f5beea0e16ce9136c99e2185c10b)
(cherry picked from commit 3b6782dd742f9c74a9535145db2f9f7ffaccf7c8)
(cherry picked from commit f1b68149528c13a22fa64468c130b1405bf3d081)
(cherry picked from commit db5cf5a2b9cb454630fb86783c2d58cd5446cba6)
(cherry picked from commit 32140948578bc3c2a0c5f8adb537660421efe5e7)
(cherry picked from commit b978e3d0b131ed642774c5a14a649e13f764c20b)

(cherry picked from commit c75c1ef8b2)

(cherry picked from commit a29f19e6a2)
(cherry picked from commit c38c46744f)
2025-02-05 01:02:04 +01:00
Dmitry Batrak
4e6f198c62 an option to disable native rendering for rotated text (following JRE-19)
port commit ccc1ded6 from JBR 9

port from JBR 11 to JBR 15 (cherry picked from commit 72fb9ff7c4)

cherry picked from commit a5bd092449

(cherry picked from commit 52ebd26933)
2025-02-05 01:02:04 +01:00
Dmitry Batrak
d1a9f34cd9 JRE-11 Support text rendering via DirectWrite API on Windows
(cherry picked from commit 6605d4a525)
2025-02-05 01:02:04 +01:00
Dmitry Batrak
71d0cc9c8a IDEA-150876 OpenJDK fonts for toolwindow names look worse than Oracles's
don't apply FreeType-returned glyph advance for rotated glyphs rendered by GDI

This seems to produce a better looking text (more evenly spaced). Fractional metrics won't be respected by this code, but we can address this later if needed.

port commits c9debd5e, ed78cd00, 4c7e1619, 7aa0429c, 7bd6c17c from JBR 9

port from JBR 11 to JBR 15 (cherry picked from commits d6b588bdab, dbc15fb84e)

cherry picked from commit 2c0d6150d0

(cherry picked from commit 12f2233f94)
2025-02-05 01:02:04 +01:00
Vitaly Provodin
026f299d9b JRE-186 added regression test (Modal dialogs (Messages) shouldn't popup IDEA when another application is active)
(cherry picked from commit 236bd38d1b)

with fix for JBR-5300 Change source code and test files to use GPL license

(cherry picked from commit 45b52492a9)
2025-02-05 01:02:04 +01:00
Vitaly Provodin
13f4801fa8 JRE-269 added regression (JLabel doesn't scale <code>text</code> HTML fragments.)
(cherry picked from commit 1f4ad38d23)

with fix for JBR-5300 Change source code and test files to use GPL license

(cherry picked from commit b2f584b10a)
2025-02-05 01:02:04 +01:00
Alexey Ushakov
ade7fa34fe JRE-307 Wrong dpi reported on Wayland
(cherry picked from commit 15693661cc)

with fix for JBR-5300 Change source code and test files to use GPL license

(cherry picked from commit ae4c4c017d)
2025-02-05 01:02:04 +01:00
Vitaly Provodin
c63ed481c9 JRE-392 added regression (Tip of the day is not hidden while another modal window is shown)
(cherry picked from commit c7b0ac686f)

with fix for JBR-5300 Change source code and test files to use GPL license

(cherry picked from commit e8e81b7509)
2025-02-05 01:02:04 +01:00
Vitaly Provodin
d8b122756a JRE-394 added regression test (System getenv doesn't return env var set in JNI code)
(cherry picked from commit 3a7b3c67b0)

with fix for JBR-5300 Change source code and test files to use GPL license

(cherry picked from commit 7439fd115a)
2025-02-05 01:02:04 +01:00
Vitaly Provodin
df444c014b JRE-401 added regression test (AppCode freezes during autocomplete and other operations)
(cherry picked from commit cb4453b1d1)

with fix for JBR-5300 Change source code and test files to use GPL license

(cherry picked from commit dde86b1e6c)
2025-02-05 01:02:04 +01:00
Vitaly Provodin
bee1bf3538 JRE-422 added new regression test (AWTView deliverJavaMouseEvent leaks jEvent)
(cherry picked from commit 37dc13c603)

with fix for JBR-5300 Change source code and test files to use GPL license

(cherry picked from commit a5e094dd07)
2025-02-05 01:02:04 +01:00
Vitaly Provodin
290b8302db JRE-430 added new regression test (Font fallback sometimes doesn't work in Swing text components)
(cherry picked from commit d04debc847)

with fix for JBR-5300 Change source code and test files to use GPL license

(cherry picked from commit 5a47f2a66c)
2025-02-05 01:02:04 +01:00
Vitaly Provodin
eedb44f849 JRE-457 added new regression test (OGLTR_DisableGlyphModeState is slow)
(cherry picked from commit 3a43f4557f)

with fix for JBR-5300 Change source code and test files to use GPL license

(cherry picked from commit f534b029e2)
2025-02-05 01:02:04 +01:00
Vitaly Provodin
09bbb0b426 JRE-458 added new regression test (Insufficient and inconsistent permissions on some files in Linux build)
(cherry picked from commit 82adbe9c25)
(cherry picked from commit 15998f29c1)
2025-02-05 01:02:03 +01:00
Vitaly Provodin
6efd0522b6 JRE-467 added new regression test (Wrong rendering of variation sequences)
(cherry picked from commit 0026095202)

with fix for JBR-5300 Change source code and test files to use GPL license

(cherry picked from commit 1d0be02755)
2025-02-05 01:02:03 +01:00
Vitaly Provodin
e34b57a196 JRE-468 added new regression test (Idea freezes on project loading)
(cherry picked from commit 1ce8c3ce82)

with fix for JBR-5300 Change source code and test files to use GPL license

(cherry picked from commit 0200338c3c)
2025-02-05 01:02:03 +01:00
Vitaly Provodin
965475f63d JRE-501 added new regression test (Live resize is jerky for heavy java applications on Mac)
(cherry picked from commit c4a1277c1b)

with fix for JBR-5300 Change source code and test files to use GPL license

(cherry picked from commit 39bd5023d4)
2025-02-05 01:02:03 +01:00
Vitaly Provodin
c1750ac1c6 JRE-638 added new regression test (enable unlimited cryptographic policy by default)
(cherry picked from commit 4a14c6f15a)

with fix for JBR-5300 Change source code and test files to use GPL license

(cherry picked from commit 4643b6a354)
2025-02-05 01:02:03 +01:00
Vitaly Provodin
5eb0a4bea8 JRE-705 added new regression test (Z-order of child windows is broken on Mac OS)
(cherry picked from commit 82cd480619)

with fix for JBR-5300 Change source code and test files to use GPL license

(cherry picked from commit 84c0444389)
2025-02-05 01:02:03 +01:00
Vitaly Provodin
b0bfd16c0a JRE-624 CThreading isAppKit() fails to detect main app thread if it was renamed
(cherry picked from commit c8f248a936)

with fix for JBR-5300 Change source code and test files to use GPL license

(cherry picked from commit 9aa93e5907)
2025-02-05 01:02:03 +01:00
Alexey Ushakov
52abacd4cc IDEA-166173 IntelliJ freezes when returning from sleep
Fixed deadlock by removing unnecessary getScreenResolution call

(cherry picked from commit cec93cf1fd)
(cherry picked from commit 0d37ce45c8)
2025-02-05 01:02:03 +01:00
Alexey Ushakov
fe7084260d Added missing fontconfig defines
(cherry picked from commit 2ac273a456)
(cherry picked from commit d922d7dfaf)
2025-02-05 01:02:03 +01:00
Alexey Ushakov
e3ce23c001 JRE-43 Font.getFamily() does not work in headless mode
Removed unused code

(cherry picked from commit 5b523f049e)
(cherry picked from commit 3535055ecd)
2025-02-05 01:02:03 +01:00
Alexey Ushakov
3da4c73d53 JRE-43 Font.getFamily() does not work in headless mode
Bundled Droid fonts to fallback in headless mode

(cherry picked from commit 5b523f049e)
(cherry picked from commit b65e0d7cb7)
2025-02-05 01:02:03 +01:00
Alexey Ushakov
6d507e8134 JRE-15 Greyscale text is too dark comparing with subpixel AA
Adjusted default value for greyscale text rendering in freetype

(cherry picked from commit f80497c4f0)
(cherry picked from commit 67e3b05916)
2025-02-05 01:02:03 +01:00
Alexey Ushakov
89beec07e7 IDEA-155347 On Ubuntu with High DPI tooltip font is too thick when the tooltip is fading in and out
Handled missing FC_RGBA_NONE value

(cherry picked from commit 44fcbdabf8)
(cherry picked from commit a9ca78b413)
2025-02-05 01:02:03 +01:00
Alexey Ushakov
e4fb225b0c IDEA-149882 Issue with fonts in Ubuntu 12.04
Provided fallback to default font rendering settings if libfontconfig unable to
match font pattern

(cherry picked from commit d93a5f1598)
(cherry picked from commit ebaea7e146)
2025-02-05 01:02:03 +01:00
Alexey Ushakov
b1fed30bd7 IDEA-151619 CLion EAP fails to start with missing symbol: FT_Library_setLcdFilter
Skip FT_Library_setLcdFilter call if the symbol is not there
Cache negative FT_Library_setLcdFilter symbol lookup result
Used RTLD_DEFAULT handler for process symbols lookup

(cherry picked from commit e6f0055704)
(cherry picked from commit dfbc7d7cc2)
2025-02-05 01:02:03 +01:00
Alexey Ushakov
7dbfb184bb JRE-29 fontconfig lib crashes CLion on OSX
Disabled fontconfig usage on OSX

(cherry picked from commit 431e14429c)
(cherry picked from commit 534d184416)
2025-02-05 01:02:02 +01:00
Vitaly Provodin
cfbba67e41 exclude tests spontaneously creating windows during test execution
(cherry picked from commit bd278194b9)
2025-02-05 01:02:02 +01:00
Alexey Ushakov
465369e618 JRE-48 built-in jre renders fonts abnormally heavier (normal text looks bold) than the oracle jre
Disable FT_LOAD_TARGET_LIGHT for fonts with FC_AUTOHINT=false (this target implicitly enables  FC_AUTOHINT)
Reused setupLoadRenderFlags for all rendering cases

(cherry picked from commit f3f2667a4c)
(cherry picked from commit e5a81a300f)
2025-02-05 01:02:02 +01:00
Alexey Ushakov
88e278e022 Added logging for freetypeScaler via env variable OPENJDK_LOG_FFS=yes
and for screen resolution in freetypeScaler

(cherry picked from commit 091d74a791)
(cherry picked from commit 7243173610)
2025-02-05 01:02:02 +01:00
Alexey Ushakov
72f375aa04 JRE-34 IDE Crashes During Startup
Added validation of dpi settings coming from xserver

(cherry picked from commit b1c49c3b27)
(cherry picked from commit 3e57837094)
2025-02-05 01:02:02 +01:00
Anton Tarasov
4962beb193 JBR-2031 [mac] jcef deadlocks with a11y on start
(cherry picked from commit 4f44b37f08)
(cherry picked from commit 8a4a781393)
2025-02-05 01:02:02 +01:00
Alexey Ushakov
f63fc4129e JRE-1083 [JDK11] Test com/sun/java/accessibility/util/8051626/Bug8051626.java fails on macOS on JB JDK11b
Wrapped SelectorPerformer invocation into privileged action

(cherry picked from commit 48e7b547ae)
(cherry picked from commit e420b10a4a)
2025-02-05 01:02:02 +01:00
Anton Tarasov
95ba7b16ed JBR-2019 provide getWindowHandle method for jcef
(cherry picked from commit 7ae706b629)
(cherry picked from commit d0b855df14)
2025-02-05 01:02:02 +01:00
Anton Tarasov
d506682d58 JBR-1976 [jcef] need mouse-transparent window on Windows
(cherry picked from commit b60fac96b4)
(cherry picked from commit e68503823b)
2025-02-05 01:02:02 +01:00
Anton Tarasov
9364115b4b JBR-1824 export NSWindow::setIgnoresMouseEvents to java internal API
(cherry picked from commit 4399dc382c)
(cherry picked from commit 99d8964d90)
2025-02-05 01:02:02 +01:00
Anton Tarasov
060006757c JBR-1802 com/sun/java/accessibility/util/8051626/Bug8051626.java: access denied ("java.lang.RuntimePermission" "getClassLoader")
(cherry picked from commit eae772aca9)
(cherry picked from commit d944e5907a)
2025-02-05 01:02:02 +01:00
Anton Tarasov
5b3a2eb12e JBR-1795 Project opened from Welcome screen goes to backgound after loading
(cherry picked from commit 322526458a)
(cherry picked from commit 2ee33311dd)
2025-02-05 01:02:02 +01:00
Anton Tarasov
ed3146de6f JBR-1609 Jupyter Notebook eventually causes IDEA to become unresponsive on Mac OSX
(cherry picked from commit 8ae0be8eb6)
(cherry picked from commit 812158fb5b)
2025-02-05 01:02:02 +01:00
Anton Tarasov
9bd813701e JBR-1786 Weird white border for IDE window
(cherry picked from commit 4b09614a0e)
(cherry picked from commit 8366197c01)
2025-02-05 01:02:02 +01:00
Vyacheslav Moklev
886a2f6e2c JBR-1552 Invalid screen bounds in full screen mode
Check is window is not in undecorated state

(cherry picked from commit 5547701e2c)
(cherry picked from commit d5fa62913e)
2025-02-05 01:02:02 +01:00
Vyacheslav Moklev
df4465959a JBR-1509 Client area size is wrong in Borderless mode
Fix client area size

(cherry picked from commit 00d32e58dc)
(cherry picked from commit f78449b302)
2025-02-05 01:02:01 +01:00
Anton Tarasov
9868cd799f JBR-1770 [windows] frame does not open as maximized
(cherry picked from commit d9dfc3c6c5)
(cherry picked from commit 7525d41946)
2025-02-05 01:02:01 +01:00
Anton Tarasov
2a85fdf1a5 JBR-1693 difficult to input Japanese text with "Fast" Key Repeat
(cherry picked from commit 12de3e287e)
(cherry picked from commit bfa95fd66e)
2025-02-05 01:02:01 +01:00
Anton Tarasov
cf1beb8c28 JBR-1669 IDE-managed HiDPI mode is broken
(cherry picked from commit 461b0b5cd4)
(cherry picked from commit 3049d42f8c)
2025-02-05 01:02:01 +01:00
Anton Tarasov
3c3988ab00 JBR-1650 propagate custom decoration title bar height to native
(cherry picked from commit f6fc65d014)
(cherry picked from commit 34032b2ced)
2025-02-05 01:02:01 +01:00
Anton Tarasov
9d9fe3aa18 JBR-1629 Maximized window cut at the right and bottom
(cherry picked from commit 9e768377db)
(cherry picked from commit 0532e6c2aa)
2025-02-05 01:02:01 +01:00
Anton Tarasov
51718e3d5d JBR-1492 Not able to start Intellij Idea 2017.2.5 with modified vmoptions
(cherry picked from commit e7ca6db66b)
(cherry picked from commit 88694a6148)
2025-02-05 01:02:01 +01:00
Anton Tarasov
997501cf74 JBR-1427 pycharm jupyter preview stuck and no response when click on preview.
(cherry picked from commit 1746b04686)
(cherry picked from commit 3c3c2ffa90)
2025-02-05 01:02:01 +01:00
Anton Tarasov
504ae92510 IDEA-210154 Borderless UI: Top frame of IDEA window is blue
(cherry picked from commit 2dd4163bc4)
(cherry picked from commit 2f4e023df0)
2025-02-05 01:02:01 +01:00
Anton Tarasov
86eecc9384 JBR-1351 Borderless UI: Bold frame around IDEA window appears on non-HiDPI display
(cherry picked from commit 06d35de069)
(cherry picked from commit 0bfcc28a7a)
2025-02-05 01:02:01 +01:00
Anton Tarasov
dd19a1f070 JBR-1313 wrong insets for non-resizable custom-decorated frame
(cherry picked from commit 9179718cb6)
(cherry picked from commit 05f934ea20)
2025-02-05 01:02:01 +01:00
Anton Tarasov
84b830753f JBR-1293 do not modify client bounds when custom-decorated frame is set undecorated
(cherry picked from commit cb188edaab)
(cherry picked from commit 2cecea407d)
2025-02-05 01:02:01 +01:00
Anton Tarasov
d16452c11b JBR-1278 allow native border and shadow for custom decoration mode
(cherry picked from commit ec106a58a3)
2025-02-05 01:02:01 +01:00
Anton Tarasov
48a19a4fe9 JRE-1232 forwardport: JRE-1228 support custom frame decoration
(cherry picked from commit d2820524a1)
(cherry picked from commit 1ebd6a000b)
2025-02-05 01:02:01 +01:00
Anton Tarasov
7938cdd285 JRE-1162 [jdk11] support on-the-fly DPI change on linux
(cherry picked from commit c06c4c69d3)
(cherry picked from commit 5138201282)
2025-02-05 01:02:01 +01:00
Anton Tarasov
9ef9d15443 JRE-1142 [jdk11] hidpi is not detected since Ubuntu 18.04
(cherry picked from commit be4f8c0d9d)
(cherry picked from commit 96b07c6c65)
2025-02-05 01:02:00 +01:00
Anton Tarasov
ac20cbf266 JRE-1111 [JDK11] java/beans/Beans/TypoInBeanDescription.java crashes at libawt_xawt.so+0x4a30d
(cherry picked from commit b89e6aed0b)
(cherry picked from commit 924b6a8bb7)
2025-02-05 01:02:00 +01:00
Anton Tarasov
85733757d9 fix JNI_OnUnload definition
(cherry picked from the commit  3571e39071)

(cherry picked from commit 1019d8f0f2)
(cherry picked from commit 4fae6cb785)
2025-02-05 01:02:00 +01:00
Anton Tarasov
b022578f17 JRE-981 IM workaround does not work anymore
forward port of 2d7c29b in JetBrains/jdk8u_jdk

(cherry picked from commit f3ccc53e02)
(cherry picked from commit 362eaede04)
2025-02-05 01:02:00 +01:00
Anton Tarasov
fcd0dd8c50 JRE-938 [windows] Frame.setMaximizedBounds not hidpi-aware
(cherry picked from commit cc97899923320e1fa17f5e44975c4a0f0ba51014)
(cherry picked from commit ccfe65be7f)
(cherry picked from commit b86054beb6)
2025-02-05 01:02:00 +01:00
Anton Tarasov
7860bfdc3a JRE-907 macOS: add ability to check for scaled display mode
(cherry picked from commit e496262aa1)
(cherry picked from commit e07eaabe47)
2025-02-05 01:02:00 +01:00
Anton Tarasov
56bdcf8884 JRE-934 Diff viewer errors are not visible on HiDPI Linux
(cherry picked from commit 641a09dd52)
(cherry picked from commit c37bfae963)
2025-02-05 01:02:00 +01:00
Anton Tarasov
ed916a40f4 [jdk9] HiDPI scale is not detected on some linux desktops
(cherry picked from commit 9279d80110)
(cherry picked from commit 57f7da037b)
2025-02-05 01:02:00 +01:00
Anton Tarasov
e9838c14ac JRE-681 [windows] direct drawing into frame graphics may have wrong translate
(cherry picked from commit 6ea1d45fd1)
(cherry picked from commit 60bb53f919)
2025-02-05 01:02:00 +01:00
Anton Tarasov
23597cb959 Read org.gnome.desktop.interface/scaling-factor
(cherry picked from commit 277357ae73)
(cherry picked from commit d4f290861b)
2025-02-05 01:02:00 +01:00
Anton Tarasov
394e294b3f Revert "8239894: Xserver crashes when the wrong high refresh rate is used"
This code is needed for "Read org.gnome.desktop.interface/scaling-factor".
Keep it until "JDK-8260270 Implement the HiDPI scale factor reading" is fixed.

This reverts commit a7c2ebc7

(cherry picked from commit a249b989e1)
2025-02-05 01:02:00 +01:00
Anton Tarasov
8af0e93b1d Do not scale base font in HiDPI mode on Linux
(cherry picked from commit 6fb2c36529)
(cherry picked from commit b2e47f1be3)
2025-02-05 01:02:00 +01:00
Anton Tarasov
2eb710eb5a JRE-772 swing returns incorrect FRC when AA is off
(cherry picked from commit a161897d908aa10da6306c06452c5d6317fed2f0)
(cherry picked from commit 2bf5a7ca5c)
(cherry picked from commit 2caa4e3c14)
2025-02-05 01:02:00 +01:00
Anton Tarasov
54ac2166e6 JRE-681 [windows] direct drawing into frame graphics may have wrong translate
(cherry picked from commit ab6dee4c1fc453ad3cb5adb69fc243e550d184ae)

(cherry picked from commit 6ea1d45fd1)
(cherry picked from commit 556d3c5905)
2025-02-05 01:02:00 +01:00
Anton Tarasov
22773fa1aa JRE-665 Navigate Class/File/Symbol, Find in Path popup windows don't pick characters from input method
(cherry picked from commit 676f305b2b3b278e305bd4d9bde4269f27b3d676)
(cherry picked from commit 6ce31e0a32)
(cherry picked from commit b327688b89)
2025-02-05 01:01:59 +01:00
Anton Tarasov
be99080b4c JRE-616 [linux] notify when dpi correction factor is applied to fonts
(cherry picked from commit f57d41f3118bfd773c99ce32d58cfae16931be6a)
(cherry picked from commit 6246abc72f)
(cherry picked from commit 717349c595)
2025-02-05 01:01:59 +01:00
Anton Tarasov
827071ff01 JRE-612 [windows] icon in frame title is not dpi-aware
(cherry picked from commit dec04385177a2abb677add909d3b94f94c62a14e)

(cherry picked from commit 38466cbab0)
(cherry picked from commit 81662b38f5)
2025-02-05 01:01:59 +01:00
Anton Tarasov
cb3b00626a JRE-604 [fps] frame's client area is one pixel beneath frame's borders
Adopted.

(cherry picked from commit ef2870ee38)
(cherry picked from commit 021c8d8b7b)
2025-02-05 01:01:59 +01:00
Anton Tarasov
0e40e332c8 JRE-596 [windows] popup positioning is broken with JRE-573
Adopted: moved to AwtWindow::Reshape

(cherry picked from commit c5cc28d85d)
(cherry picked from commit 496c7d90d2)
2025-02-05 01:01:59 +01:00
Anton Tarasov
85b0fc9471 JRE-577 Goland 18 displays out of memory
(cherry picked from commit 2daaf21e420d4af15d3b1bfeb3f896074bea1e61)

(cherry picked from commit 9ea2011948)

with fix for JBR-5300 Change source code and test files to use GPL license

(cherry picked from commit b6b83ff41f)
2025-02-05 01:01:59 +01:00
Anton Tarasov
1d932be484 JRE-573 [windows] window client area bounds mismatch
Apply only WmEraseBkgnd

(cherry picked from commit afa68f7ad6440303c6417be3f675b1c4644b6014)

(cherry picked from commit 0651b45e13)
(cherry picked from commit cfeb8ba435)
2025-02-05 01:01:59 +01:00
Anton Tarasov
1be009209b JRE-382 Three AWT-tests become hanging starting since master-875
(cherry picked from commit 7d492101db8fcbb3d285fd8e9669f74b0e0fce8f)
(cherry picked from commit b965f85c1b)
(cherry picked from commit 5b61c2f72a)
2025-02-05 01:01:59 +01:00
Anton Tarasov
fafb7dd643 JRE-373 [macos] nativeCreateNSWindow deadlocks with a11y
(cherry picked from commit 72c77a992bbf1b95b82ffc08cb2f4f3bc36b3657)

(cherry picked from commit aa09fa2c85)
(cherry picked from commit 9b32557ad4)
2025-02-05 01:01:59 +01:00
Anton Tarasov
d698b8f88c IDEA-172422 Popup at the wrong place on the second monitor (new hidpi)
Adopted: moved to AwtWindow::Reshape

(cherry picked from commit 11a0911d65)
(cherry picked from commit 4c8e3a54b3)
2025-02-05 01:01:59 +01:00
Anton Tarasov
2389d4d1a1 JRE-309 [windows] on-screen position of a component is not pixel-perfect in user space in JRE-HiDPI mode
Adopted: moved to AwtWindow::Reshape

(cherry picked from commit 985908cf10)
(cherry picked from commit f9ff12884e)
2025-02-05 01:01:59 +01:00
Anton Tarasov
5070049d36 JRE-269 JLabel doesn't scale <code>text</code> HTML fragments.
(cherry picked from commit 9ef72b6c3a477e4225f9b98e30fa9190613520e4)
(cherry picked from commit c17bc728ee)
(cherry picked from commit 99735071ff)
2025-02-05 01:01:59 +01:00
Anton Tarasov
7597109df2 JRE-225 [macos] IDEA hangs on attempt to call getDefaultScreenDevice() from EDT
(cherry picked from commit 76aba25)

(cherry picked from commit df11dcc97bb5556ac5d0299b773a512b4f0bb5bb)
(cherry picked from commit aeea6c1ca3)
(cherry picked from commit 3fbb520b07)
2025-02-05 01:01:59 +01:00
Anton Tarasov
ba019444bc JRE-210 JEditorPane may return wrong preferred size as it moves b/w monitors of different scale
(cherry picked from commit 6c3087e6bda32ae9b095e069d8bea614502f5c03)
(cherry picked from commit adb3a4be16)

with fix for JBR-5300 Change source code and test files to use GPL license

(cherry picked from commit 5b987c7a94)
2025-02-05 01:01:59 +01:00
Anton Tarasov
51c6ce8637 JRE-119 [suppress updateGC() for WFileDialogPeer/WPrintDialogPeer]
updateGC() is called from WWindowPeer.<init> though it's not applicable to the named dialogs
as they don't have native AwtWindow peer required for the method.

(cherry picked from commit 72ed9f653177e273b811cfe70c2dba102a8636e4)
(cherry picked from commit cec49aaa38)
(cherry picked from commit a279dd9e1c)
2025-02-05 01:01:59 +01:00
Anton Tarasov
6ff603edad JRE-119 [use default "sun.java2d.dpiaware=true" to be dpi-aware on Window 7]
This lets awt_Win32GraphicsEnv.cpp SetProcessDPIAwareProperty() call Win7 specific ::SetProcessDPIAware() API func.

(cherry picked from commit 5e7a766090810d839f4352d06fc2812499d766f8)
(cherry picked from commit 7d1d43bfa1)
(cherry picked from commit 2351382562)
2025-02-05 01:01:58 +01:00
Anton Tarasov
3aa16e6191 JRE-119 [Dynamically set DPI-awareness level to enable backward compatible HiDPI behavior]
Adopted: rely on java.manifest

(cherry picked from commit d00cfa4dc62a14a4cf89df9d4c4899970c9fc9e8)

Adopted

(cherry picked from commit 60be76b725)
(cherry picked from commit 8ec82c766b)
2025-02-05 01:01:58 +01:00
Anton Tarasov
dd62331de8 JRE-119 [ask if ui scale is enabled natively]
(cherry picked from commit 801f45875fd8699edcbda5896210cec191062261)
(cherry picked from commit 20edebdefa)
(cherry picked from commit 9ac3479114)
2025-02-05 01:01:58 +01:00
Anton Tarasov
da2202de34 IDEA-153474 let JDK detect Xft.dpi value on non-GTK Linux DEs
Use the GTK method:

https://developer.gnome.org/gobject/stable/gobject-The-Base-Object-Type.html#g-object-get

to retrieve "gtk-xft-dpi" integer property of the X settings.

Add the property to JDK's GtkEngine & gtk2-interface.
Then read the property via GtkEngine from GTK LaF when "gnome.Xft/dpi" is undefined. It's assumed GTK LaF is forcedly installed.

(cherry picked from commit e05fc391ae0a3cc389e836441f882c0cf6ab3b99)
(cherry picked from commit fd615a5b45)
(cherry picked from commit adc80251ad)
2025-02-05 01:01:58 +01:00
Anton Tarasov
b105825671 IDEA-148854: AppCode crashes randomly every 15 mins or so
(cherry picked from commit 02f9a5fbb4924ff67c8a04c15e490acfcc750003)
(cherry picked from commit b8f4b4a9ed)
(cherry picked from commit b3961bee9d)
2025-02-05 01:01:58 +01:00
Vitaly Provodin
5f351d6e61 updated JTreg exclude list
(cherry picked from commit 418fb32e7f)
2025-02-05 01:01:58 +01:00
Alexey Ushakov
ae01d94829 IDEA-57233, IDEA-152816, IDEA-152454 Editor font antialising/appearance problems on Linux
Used desktop DPI instead of hard-coded 72
Compensated increased glyph bitmap size by adjusting font size
Added LCD filter for sub-pixel rendering
Use fontconfig library to provide right rendering options for fonts
Corrected sizes passed to fontconfig library and hinting disabling policy
Added logging and versioned fontconfig lib loading
Resolved font rendering problem in lenses
fix text rendering issues (text cutoff and incorrect rendering in editor fragment components)
FcMatchFont-type pattern substitutions shouldn't be invoked before specific font is selected - it can apply unrelated rules
port commit e21cd635 from JBR 9
partially rollback JBR-363 fix, to apply corresponding change from OpenJDK 12

(cherry picked from commit 5d704a963b)
(cherry picked from commit 3d7ac30072)
(cherry picked from commit 0456745afb)
(cherry picked from commit 3d7ac30072)
(cherry picked from commit 4c8351fecf)
(cherry picked from commit 5faebc73d5)
(cherry picked from commit d1ed8ab118)
(cherry picked from commit 20487c7515)
2025-02-05 01:01:58 +01:00
Vitaly Provodin
8611481a8a JBR-3398 remove the Experimental AOT and JIT Compiler (JEP 410)
(cherry picked from commit df63a5e6ad)
2025-02-05 01:01:58 +01:00
Alexey Ushakov
70b9e2b3d9 JBR-2807: JDK15: update modules.list to resolve jbr build failure
removed nashorn modules

(cherry picked from commit c56a18eaf9)
2025-02-05 01:01:58 +01:00
Vitaly Provodin
6d9cb5538e JBR-2130 remove module jdk.pack
(cherry picked from commit 9acab72161)
2025-02-05 01:01:58 +01:00
Vitaly Provodin
2b8ad20826 JBR-4810 add VERSION_PATCH into version number string
(cherry picked from commit 401a12b6b9)
2025-02-05 01:01:58 +01:00
Vitaly Provodin
0fd222fb30 JBR-4754 make root directory with the same name as archive name
(cherry picked from commit 97a17c9a36)
2025-02-05 01:01:58 +01:00
Nikita Provotorov
940963ffa2 JBR-2074 Windows 10 AArch64 support: make the build scripts use custom build-jdk.
(cherry picked from commit 3d9869c702)
2025-02-05 01:01:58 +01:00
Nikita Provotorov
6bcb03308c JBR-2074 Windows 10 AArch64 support: build fixes.
(cherry picked from commit a873008261)
2025-02-05 01:01:58 +01:00
Vitaly Provodin
f515c53fc6 JBR-4567 replace comma with point in RenderPerf scores
(cherry picked from commit 5b91efd8c0)
2025-02-05 01:01:58 +01:00
Vitaly Provodin
b06c885819 JBR-4520 set file permissions after signing
(cherry picked from commit 64259b866c)
2025-02-05 01:01:57 +01:00
Vitaly Provodin
ab15461837 JBR-4512 windows: include pdb-files into jbrsdk
(cherry picked from commit 606ad057d3)
2025-02-05 01:01:57 +01:00
Vitaly Provodin
68284da1e3 JBR-4087 add version info into the name of root directory in JBR tar.gz-distributions
(cherry picked from commit 45eeae64ee)
2025-02-05 01:01:57 +01:00
Vitaly Provodin
ac75f3d785 JBR-4511 remove --disable options from configure mac-aarch64 builds & unify configure for x64 and aarch64
(cherry picked from commit b387b2213e)
2025-02-05 01:01:57 +01:00
Maxim Kartashev
601170ce37 JBR-4064 Windows: update build scripts to produce more deterministic output
Passed the configure script options necessary to enable reproducible builds
on Windows. With this options, the resulting jars are reproducible, but
native executables and libraries aren't.

(cherry picked from commit c1da1fa0d6)
2025-02-05 01:01:57 +01:00
Vladislav Rassokhin
4d8316a3b0 JBR-4451 Make bash scripts safer
(cherry picked from commit 4f048b9790)
2025-02-05 01:01:57 +01:00
Vitaly Provodin
668a69e172 JBR-4487 enable Linux 32 builds
(cherry picked from commit 38dbda93d0)
2025-02-05 01:01:57 +01:00
Vitaly Provodin
37b8d19ac3 JBR-4458 enable JBR17 windows 32 bit builds
(cherry picked from commit d3e65953e7)
2025-02-05 01:01:57 +01:00
Vitaly Provodin
238d80d64d JBR-4272 generate and save debug symbols for JBR on macos/linux
(cherry picked from commit ef34e66dbf)
2025-02-05 01:01:57 +01:00
Vitaly Provodin
a256eda9ed JBR-4053 integrate DCEVM patches as usual commits
(cherry picked from commit 45672abcad)
2025-02-05 01:01:57 +01:00
Vitaly Provodin
98a1ebbcca JBR-4370 create a test checking all JBR artifacts exist - add exit code
(cherry picked from commit 4dce25a5db)
2025-02-05 01:01:57 +01:00
Nikita Provotorov
76e86a41ab JBR-2074 Windows 10 AArch64 support: add build and pack scripts.
(cherry picked from commit e33c77a615)
2025-02-05 01:01:57 +01:00
Vladimir Kempik
2f2a211d36 JBR-4452: Update crash report message with JBR youtrack link
instead of bugreport.java.com

(cherry picked from commit c52914a035)
2025-02-05 01:01:57 +01:00
Vitaly Provodin
971d46c6e9 JBR-4437 add sources to JBRSDK distributions for Windows and Linux
(cherry picked from commit 0399594195)
2025-02-05 01:01:57 +01:00
Vitaly Provodin
af3cac2933 JBR-4437 add sources to JBRSDK distributions
(cherry picked from commit a13a015597)
2025-02-05 01:01:57 +01:00
Anton Tarasov
d2df9426f4 JBR-3906 JBR for Linux aarch64 with JCEF is missing, is there any support plan?
(cherry picked from commit d47bc61b0e)
2025-02-05 01:01:56 +01:00
Vitaly Provodin
98c00e3e79 JBR-4188 add script comparing performance results
add exec permissions && fix misprint in checking if headers exist

move the script comparing performance results from jdk8u_test

(cherry picked from commit 924e7baadd)
2025-02-05 01:01:56 +01:00
Vladimir Kempik
ae37740de7 JBR-4283: Provide native JBR builds for alpine Linux-aarch64
(cherry picked from commit 925f02d3c5)
2025-02-05 01:01:56 +01:00
Vladimir Kempik
1961148ebe JBR-4242:Provide native JBR builds for alpine Linux
(cherry picked from commit c62e05e7ac)
2025-02-05 01:01:56 +01:00
Maxim Kartashev
b6e37899a8 JBR-3917 Problem using windows certificate store (trustStoreType=Windows-ROOT not recognized)
(cherry picked from commit 65abc7b029)
2025-02-05 01:01:56 +01:00
Maxim Kartashev
8ed5004d8e JBR-4145 Make builds independent from build directory
Supplied the --disable-absolute-path-in-output option to the configure script
when building JBR.

(cherry picked from commit 5aa22bb901)
2025-02-05 01:01:56 +01:00
Vitaly Provodin
4729ba2ddc JBR-4154 extract version info from sources & JBR-4099 make test-image on jbrsdk_jcef step
(cherry picked from commit f22a76949b)
2025-02-05 01:01:56 +01:00
Vitaly Provodin
b56eabdcb9 JBR-4067 fix misprint with applying obsolete exclude_jcef_module.patch
(cherry picked from commit 106349f0fe)
2025-02-05 01:01:56 +01:00
Vitaly Provodin
d2924b95c7 JBR-3756 remove JNF from mac-aarch64 binaries
(cherry picked from commit 011d461c99)
2025-02-05 01:01:56 +01:00
Vitaly Provodin
6a5b2d7b7f JBR-4082 create JBR & JBRSDK installer packages
(cherry picked from commit a2e1fe0fa4)
2025-02-05 01:01:56 +01:00
Maxim Kartashev
1738299e06 JBR-4061 Specify build user for the build
(cherry picked from commit 66713adb61)
2025-02-05 01:01:56 +01:00
Maxim Kartashev
ccf8da70ac JBR-4063 macOS: update build scripts to produce more deterministic output
Make mkimages.sh produce more deterministic .tar.gz archives on MacOS.
NB: build notarization is not in the scope of this change.

(cherry picked from commit e1a1b6814d)
(cherry picked from commit 43f7ebddec)
2025-02-05 01:01:56 +01:00
Maxim Kartashev
0d9c5d62b3 JBR-4033 Linux: update build scripts to produce more deterministic output
This commits achieves almost the same build output with the same build
input on Linux. Exceptions are:
- class files timestamps differ in jrt-fs.jar (for all output),
- class files timestamps differ in all the jmod files (for
  jbrsdk...tar.gz).
NB: jbrsdk...test...tar.gz does not need to be deterministic.

This was achieved mainly by
- setting several environment variables (SOURCE_DATE_EPOCH, TZ),
- providing the necessary options to the configure script,
- setting the timestamp of all files that make up the resulting
  archive to SORUCE_DATE_EPOCH and normalizing the list of said
  files before archiving.

(cherry picked from commit ffded82734)
(cherry picked from commit 38ec30a58d)
2025-02-05 01:01:56 +01:00
Maxim Kartashev
03261706cd JBR-4059 Create Dockerfile for building on AArch64 Linux
(cherry picked from commit 249614a30b)
2025-02-05 01:01:56 +01:00
Vitaly Provodin
8278e2cfca JBR-3905 add incremental JBR building
(cherry picked from commit 54f28cde44)
2025-02-05 01:01:56 +01:00
Vitaly Provodin
dcd89b3872 JBR-3904 fix the image directory name of macos builds
(cherry picked from commit cf13b7c46e)
2025-02-05 01:01:55 +01:00
Vitaly Provodin
2cb4f54167 configure BOOT_JDK to use JDK 17
(cherry picked from commit d815b82649)
2025-02-05 01:01:55 +01:00
Anton Tarasov
d0fa77bc48 JBR-3655 jbr-dev build fails to find jcef modules on Windows
(cherry picked from commit f63fd1c8ec)
2025-02-05 01:01:55 +01:00
Maxim Kartashev
1a46344d0b JBR-3645 Tool to support keeping JBR in sync with OpenJDK
(cherry picked from commit 21c43f48cf)
2025-02-05 01:01:55 +01:00
Vitaly Provodin
6c59ccf8c7 JBR-3639 add jbrsdk tarballs for dcevm, jcef builds
(cherry picked from commit 0117d49591)
2025-02-05 01:01:55 +01:00
Anton Tarasov
5b5ce84d83 JBR-3627 include jmods in jbrsdk bundle for jbr-dev
(cherry picked from commit f54c836685)
2025-02-05 01:01:55 +01:00
Vitaly.Provodin
68a0f9d253 add dockerfile for x86
(cherry picked from commit 8fb2341ea8)
(cherry picked from commit cfbafa6c73)
2025-02-05 01:01:55 +01:00
Vitaly Provodin
0e64dd43e6 JBR-1505 add jdk.jcmd module into JBR
(cherry picked from commit c40b9c8b9e)
(cherry picked from commit 5362ff99a2)
2025-02-05 01:01:55 +01:00
Vitaly Provodin
09dbac06f0 JBR-2957 notarize JBR and JBRSDK as APPL
(cherry picked from commit 0e7f9ce4ca)
(cherry picked from commit 3f4aee8c63)
2025-02-05 01:01:55 +01:00
Vitaly Provodin
6367088625 JBR-667 add shenandoahgc feature
(cherry picked from commit e15dad04)
(cherry picked from commit 0845bb7308)
2025-02-05 01:01:55 +01:00
Vitaly Provodin
8b57d50e1d configure BOOT_JDK to use JDK 16
(cherry picked from commit 3e34330003)
2025-02-05 01:01:55 +01:00
Anton Tarasov
f15753732c Add build.gradle
(cherry picked from commit 9d01f893b6)
2025-02-05 01:01:55 +01:00
Vitaly Provodin
ed8ed5b3d5 JBR-3401 enable macos-aarhc64 builds
(cherry picked from commit d2c40f66f8)
2025-02-05 01:01:55 +01:00
Vitaly Provodin
9dc574f838 JBR-3305 remove the option --disable-warnings-as-errors from configure
(cherry picked from commit 301fcb2df1)
2025-02-05 01:01:55 +01:00
Vitaly Provodin
8de75f0abe JBR-2922 add JCEF to jbrsdk binaries
& fix a misprint in get_mods_list

JBR-2922 add JCEF to jbrsdk binaries

& fix a misprint in get_mods_list

(cherry picked from commit 6fa3e775ab)
2025-02-05 01:01:55 +01:00
Vitaly Provodin
bc25c29635 JBR-2912 add JBR 15 builds with DCEVM
(cherry picked from commit 95416c501a)
2025-02-05 01:01:55 +01:00
Vitaly Provodin
b5d653da69 JBR-2864 initial commit of DCEVM patches reworked for 15
(cherry picked from commit a592f63537)
2025-02-05 01:01:54 +01:00
Vitaly Provodin
6fe6b44302 JBR-2812 remove --with-import-modules from configure for aarch64
(cherry picked from commit 49fa98391a)
2025-02-05 01:01:54 +01:00
Anton Tarasov
dce1c681a3 JBR-2812 bundle jcef in jmod format instead of modular-sdk
Build test-image with non-jcef build target

(cherry picked from commit 9edee0e476)
2025-02-05 01:01:54 +01:00
Vitaly Provodin
dc7d55c11d JBR-2787 fix copying jcef files into jbr/jbrsdk binaries
(cherry picked from commit a4269d0907)
2025-02-05 01:01:54 +01:00
Vitaly Provodin
804e58ac86 JBR-2758 refactor building scripts to apply patches adding required modules instead of excluding
Add jogl and gluegen modules to support jcef osr mode

(cherry picked from commit e2cf692ec5)
2025-02-05 01:01:54 +01:00
Anton Tarasov
b79e70f6bb JBR-2016 add jcef module and export packages to it
(cherry picked from commit cf997f71c6)
(cherry picked from commit cad125e01d)
2025-02-05 01:01:54 +01:00
Vitaly Provodin
e5a47c0aa2 JBR-2473 modify building scripts to add dcevm clauses, add git config to docker image
(cherry picked from commit 2620c62848)
(cherry picked from commit d9797240fc)
2025-02-05 01:01:54 +01:00
Vitaly Provodin
dcdf7acf7f JBR-2395 eliminate JavaFX from JBR
(cherry picked from commit cd7e539561)
2025-02-05 01:01:54 +01:00
Vitaly Provodin
ce83044b18 JBR-2409 fix prameters for configure
(cherry picked from commit f309357fba)
2025-02-05 01:01:54 +01:00
Vitaly Provodin
058d5a7597 JDK14: exclude dependencies on jcef in x86, fastdebug builds
(cherry picked from commit 14e98eaf94)
2025-02-05 01:01:54 +01:00
Vitaly Provodin
caab3cbbc8 JBR-2396 fix CONF names
(cherry picked from commit 34cd854326)
2025-02-05 01:01:54 +01:00
Vitaly Provodin
3d0acb5f0c JBR-2394 replace --disable-debug-symbols with --with-native-debug-symbols=none
(cherry picked from commit 79ff0cb7b3)
2025-02-05 01:01:54 +01:00
Vitaly Provodin
b3cdf766af add exec permitions to configure
(cherry picked from commit bf2e441e09)
2025-02-05 01:01:54 +01:00
Vitaly Provodin
c641b7ded3 split checkout before building JBR+JFX or JBR+JCEF on two separate commands
(cherry picked from commit b7030bae8e)
2025-02-05 01:01:54 +01:00
Vitaly Provodin
2cf979dd83 change BOOT_JDK, fix target names
(cherry picked from commit 6a778fa6ea)
2025-02-05 01:01:54 +01:00
Vitaly Provodin
edbfd37291 JBR-2291 add vendor info into bundles
(cherry picked from commit 026fcaaf2b)
2025-02-05 01:01:53 +01:00
Vitaly Provodin
2a1588155f JBR-2324 address new layout in mac jcef 80.0.4+g74f7b0c+chromium-80.0.3987.122
(cherry picked from commit 6f45378ed9)
2025-02-05 01:01:53 +01:00
Vitaly Provodin
c48de425c7 JBR-2320 add jdk.attach module into JBR
(cherry picked from commit a1884561bd)
2025-02-05 01:01:53 +01:00
Vitaly Provodin
2be0ca7384 JBR-2217 provide JCEF-only (no JavaFX) bundle for master/202 branches
(cherry picked from commit d5fef466f4)
2025-02-05 01:01:53 +01:00
Vitaly Provodin
0e9e73c4f0 JBR-2212 add scripts for linux_x86, linux_aarch64, linux_x64_fastdebug, osx_fastdebug, windows_x86
(cherry picked from commit 211b306949)
2025-02-05 01:01:53 +01:00
Vitaly Provodin
35d9e84981 JBR-1643 fix intermittent fialures of Windows builds at make/Init.gmk:304
combine images and test-image into one make invocation

(cherry picked from commit ad32f648b5)
2025-02-05 01:01:53 +01:00
Vitaly Provodin
1c8ce0f769 JBR-2181 create two separate JBR bundles with JFX and JFX+JCEF
(cherry picked from commit a26a1dcef0)
2025-02-05 01:01:53 +01:00
Vitaly Provodin
46ad7f6abb JBR-2148 modify signapp&build scripts to match to the new layout
(cherry picked from commit 7cdd4cbf4a)
2025-02-05 01:01:53 +01:00
Vitaly Provodin
85cf0199e0 JBR-2084 modify scripts to sign Contents/MacOS/libjli.dylib as a a normal file
(cherry picked from commit 47ac942dfb)
2025-02-05 01:01:53 +01:00
Vitaly Provodin
4db760b4e7 JBR-1821 notarize JBR bundles as a standalone app
(cherry picked from commit 96e733ed79)
2025-02-05 01:01:53 +01:00
Vitaly Provodin
bf073fc7d3 JBR-2162 move building scripts from TC to JBR repo
(cherry picked from commit 6f4774c0d4)
2025-02-05 01:01:53 +01:00
Anton Tarasov
1e919c29c7 JBR-2016 add jcef module and export some sun.* packages to it
(cherry picked from commit 193da0eff7)
2025-02-05 01:01:53 +01:00
Vitaly Provodin
7bf9bec72c JBR-2014 add jdk.hotspot.agent module to jbr
(cherry picked from commit b352fa1b54)
2025-02-05 01:01:53 +01:00
Vitaly Provodin
04a24b785e JBR-1286 add jdk.compiler into JBR
(cherry picked from commit 245db892cd)
2025-02-05 01:01:53 +01:00
Vitaly Provodin
d7f9cb1e54 JBR-1199 add JBR modules list for jlink
(cherry picked from commit ff8dc6567f)
2025-02-05 01:01:53 +01:00
Vitaly Provodin
710369577a Update docker script to create jdk15 build env
(cherry picked from commit cd5b1b94e7)
2025-02-05 01:01:52 +01:00
Vitaly Provodin
399b5207ca JBR-3045 add pressing ESC to close the dialog after test completion
(cherry picked from commit 44d8b28b0b)
(cherry picked from commit c98106b4b0)
2025-02-05 01:01:52 +01:00
Vitaly Provodin
ffe198aa7e JBR-3040 press the button END at the beggining in order to avoid text selection
(cherry picked from commit 1c2bf33db2)
(cherry picked from commit aeab9ef42c)
2025-02-05 01:01:52 +01:00
Vitaly.Provodin
7d0b1cbb1e updated JTreg exclude list
(cherry picked from commit 6d1cee2181)
2025-02-05 01:01:52 +01:00
Ben Perez
9d23de58d1 8184352: Remove Sun provider information from KeyPairGenerator javadoc
Reviewed-by: mullan
2025-02-04 23:13:16 +00:00
Brent Christian
d222c186a6 8349107: Remove RMI finalizers
Reviewed-by: rriggs, vklang, djelinski, smarks
2025-02-04 22:37:31 +00:00
Satyen Subramaniam
bad39b6d88 8348610: GenShen: TestShenandoahEvacuationInformationEvent failed with setRegions >= regionsFreed: expected 1 >= 57
Reviewed-by: wkemper, phh
2025-02-04 17:19:19 +00:00
Justin Lu
250ff86dc8 8349000: Performance improvement for Currency.isPastCutoverDate(String)
Reviewed-by: naoto, aturbanov
2025-02-04 17:07:01 +00:00
Jamil Nimeh
ee4caa4180 8349106: Change ChaCha20 intrinsic to use quarter-round parallel implementation on aarch64
Reviewed-by: aph
2025-02-04 16:28:04 +00:00
Ioi Lam
b985347c23 8348349: Refactor CDSConfig::is_dumping_heap()
Reviewed-by: ccheung, matsaave
2025-02-04 16:08:00 +00:00
Per Minborg
beb43e2633 8349343: Add missing copyright messages in FFM benchmarks
Reviewed-by: jvernee
2025-02-04 14:10:42 +00:00
Fei Yang
e91a6ec49c 8347489: RISC-V: Misaligned memory access with COH
Reviewed-by: mli, vkempik
2025-02-04 14:03:07 +00:00
Volkan Yazici
d699aba26f 8349135: Add tests for HttpRequest.Builder.copy()
Reviewed-by: jpai, dfuchs
2025-02-04 13:56:25 +00:00
Per Minborg
81126c20cb 8349238: Some more FFM benchmarks are broken
Reviewed-by: mcimadamore
2025-02-04 11:00:54 +00:00
Matthias Baesken
beae8843b9 8349150: Support precompiled headers on AIX
Reviewed-by: jkern, erikj
2025-02-04 08:10:49 +00:00
Christian Hagedorn
c545a3e028 8346774: Use Predicate classes instead of Node classes
Reviewed-by: epeter, kvn
2025-02-04 07:33:34 +00:00
Amit Kumar
7ea176d79c 8349193: compiler/intrinsics/TestContinuationPinningAndEA.java missing @requires vm.continuations
Reviewed-by: chagedorn
2025-02-04 03:05:00 +00:00
Coleen Phillimore
9b49597244 8334320: Replace vmTestbase/metaspace/share/TriggerUnloadingWithWhiteBox.java with ClassUnloadCommon from testlibrary
Reviewed-by: dholmes, lmesnik
2025-02-03 22:48:28 +00:00
Ben Perez
43979fb1be 8347428: Avoid using secret-key in specifications
Reviewed-by: mullan
2025-02-03 22:14:38 +00:00
Jaikiran Pai
618c5eb27b 8349183: [BACKOUT] Optimization for StringBuilder append boolean & null
8349239: [BACKOUT] Reuse StringLatin1::putCharsAt and StringUTF16::putCharsAt

Reviewed-by: redestad, liach
2025-02-03 18:21:33 +00:00
Tom Rodriguez
bb837d2f9b 8342775: [Graal] java/util/concurrent/locks/Lock/OOMEInAQS.java fails OOME thrown from the UncaughtExceptionHandler
Reviewed-by: jpai, dholmes
2025-02-03 17:04:55 +00:00
SendaoYan
a57c9b101a 8349184: [JMH] jdk.incubator.vector.ColumnFilterBenchmark.filterDoubleColumn fails on linux-aarch64
Reviewed-by: haosun, aph
2025-02-03 14:25:47 +00:00
Coleen Phillimore
d330421d28 8337548: Parallel class loading can pass is_superclass true for interfaces
Reviewed-by: iklam
2025-02-03 13:55:00 +00:00
Hamlin Li
3f1d9b5735 8348575: SpinLockT is typedef'ed but unused
Reviewed-by: dholmes
2025-02-03 12:33:31 +00:00
Alexander Zvegintsev
6f4fc82149 8348675: TrayIcon tests fail in Ubuntu 24.10 Wayland
Reviewed-by: aivanov, dnguyen
2025-02-03 11:14:14 +00:00
Aggelos Biboudis
9aa6d09bf7 8326485: Assertion due to Type.addMetadata adding annotations to already-annotated type
Reviewed-by: jlahoda
2025-02-03 09:08:25 +00:00
SendaoYan
2cce5eeb09 8349142: [JMH] compiler.MergeLoadBench.getCharBV fails
Reviewed-by: liach
2025-02-02 02:46:16 +00:00
Aleksey Shipilev
305bbdae7f 8348402: PerfDataManager stalls shutdown for 1ms
Reviewed-by: dholmes, pchilanomate, coleenp
2025-02-01 14:06:48 +00:00
anass baya
651ac3cc0f 6899304: java.awt.Toolkit.getScreenInsets(GraphicsConfiguration) returns incorrect values
Reviewed-by: aivanov, honkar, prr, serb
2025-01-31 18:30:01 +00:00
Naoto Sato
2d6045a26f 8301875: java.util.TimeZone.getSystemTimeZoneID uses C library default file mode
Reviewed-by: jlu, joehw
2025-01-31 17:12:00 +00:00
Rajan Halade
13d852a0b8 8349017: Update ML tests to verify against ACVP 1.1.0.38 version
Reviewed-by: weijun
2025-01-31 16:56:38 +00:00
Jorn Vernee
137ad5d03c 8348976: MemorySegment::reinretpret should be force inlined
Reviewed-by: liach
2025-01-31 16:49:21 +00:00
Jorn Vernee
77647421c5 8348909: [BACKOUT] Implement a better allocator for downcalls
Reviewed-by: shade, liach
2025-01-31 16:49:03 +00:00
Magnus Ihse Bursie
fcd5ebc7e8 8292944: Noisy output when running make help the first time
Reviewed-by: erikj
2025-01-31 14:35:42 +00:00
Magnus Ihse Bursie
bba6a8f0c1 8349143: All make control variables need special propagation
Reviewed-by: erikj
2025-01-31 14:29:35 +00:00
Daniel Lundén
ee87d187d1 8348658: [AArch64] The node limit in compiler/codegen/TestMatcherClone.java is too strict
Co-authored-by: Aleksey Shipilev <shade@openjdk.org>
Reviewed-by: shade, kvn
2025-01-31 14:09:15 +00:00
Sorna Sarathi N
a414a591dd 8344983: [PPC64] Rename ConditionRegisters
Reviewed-by: rrich, mdoerr
2025-01-31 14:06:22 +00:00
Magnus Ihse Bursie
5878e45ae0 8348998: Split out PreInit.gmk from Init.gmk
Reviewed-by: erikj
2025-01-31 13:48:09 +00:00
Erik Gahlin
8f7e6e2dbc 8348430: Update jfr tests to allow execution with different vm flags
Reviewed-by: mgronlun
2025-01-31 08:55:52 +00:00
Tobias Hartmann
c3923fbb9a 8349130: Problem list TestCodeEntryAlignment.java
Reviewed-by: chagedorn
2025-01-31 08:22:11 +00:00
Matthias Baesken
669f8c0c07 8349039: Adjust exception No type named <ThreadType> in database
Reviewed-by: kevinw, cjplummer
2025-01-31 08:11:30 +00:00
Jan Lahoda
5a45de5e1e 8347989: Trees.getScope may crash for not-yet attributed source
Reviewed-by: asotona
2025-01-31 07:56:13 +00:00
SendaoYan
2df9d5bc2f 8349040: Test compiler/inlining/LateInlinePrinting.java fails after JDK-8319850
Reviewed-by: mbaesken, thartmann
2025-01-31 06:40:26 +00:00
Ioi Lam
03f5c33b53 8349122: -XX:+AOTClassLinking is not compatible with jdwp
Reviewed-by: jrose, kvn
2025-01-31 05:37:38 +00:00
naveen.n.narayanan
0d30b869d8 8344581: [TESTBUG] java/awt/Robot/ScreenCaptureRobotTest.java failing on macOS
Reviewed-by: aivanov, azvegint, abhiscxk
2025-01-31 05:14:57 +00:00
Ioi Lam
cdc84acdcc 8348890: Fix docs for -XX:AOT* options in java man page
Reviewed-by: jrose
2025-01-31 01:56:05 +00:00
Nizar Benalla
8986cb2772 8331873: Improve/expand info in New API In on Help page
Co-authored-by: Jonathan Gibbons <jjg@openjdk.org>
Reviewed-by: liach, hannesw
2025-01-31 01:16:54 +00:00
Harshitha Onkar
d589a82d08 8349101: Problemlist HeadlessMalfunctionTest.java
Reviewed-by: dholmes
2025-01-30 21:11:34 +00:00
Justin Lu
f05c53c2c4 8347949: Currency method to stream available Currencies
Reviewed-by: naoto, liach, rriggs
2025-01-30 17:55:47 +00:00
Andrey Turbanov
cc775b1620 8348648: Unnecessary Hashtable usage in javax.swing.text.html.CSS.LengthUnit
Reviewed-by: aivanov, azvegint, serb
2025-01-30 17:48:11 +00:00
William Kemper
06ebb170ba 8349002: GenShen: Deadlock during shutdown
Reviewed-by: shade
2025-01-30 17:01:41 +00:00
Ioi Lam
1ac2d6e0fb 8349009: JVM fails to start when AOTClassLinking is used with unverifiable old classes
Reviewed-by: jrose, kvn
2025-01-30 16:21:57 +00:00
Zhengyu Gu
0cae888046 8349003: NativeCallStack::print_on() output is unreadable
Reviewed-by: stuefe, dholmes
2025-01-30 16:14:43 +00:00
Shaojin Wen
fdfb68c8d0 8344168: Change Unsafe base offset from int to long
Reviewed-by: liach
2025-01-30 15:57:13 +00:00
Andrew Dinn
5d5b294b0a 8349070: Fix riscv and ppc build errors caused by JDK-8343767
Reviewed-by: mdoerr, fyang, jwaters
2025-01-30 15:29:13 +00:00
Shaojin Wen
3f8a875497 8348880: Replace ConcurrentMap with AtomicReferenceArray for ZoneOffset.QUARTER_CACHE
Reviewed-by: naoto, liach
2025-01-30 15:13:13 +00:00
Jorn Vernee
fac63d4383 8348668: Prevent first resource cleanup in confined arena from escaping
Reviewed-by: liach
2025-01-30 14:55:37 +00:00
Casper Norrbin
2efb6aaadb 8345314: Add a red–black tree as a utility data structure
Reviewed-by: aboldtch, jsjolen, stuefe
2025-01-30 12:34:29 +00:00
Andrew Dinn
a937f6db30 8343767: Enumerate StubGen blobs, stubs and entries and generate code from declarations
Reviewed-by: vlivanov, mdoerr
2025-01-30 11:46:39 +00:00
Michal Karm Babacek
1858dc1410 8336382: Fix error reporting in loading AWT
Reviewed-by: prr, aivanov, serb
2025-01-30 11:12:44 +00:00
Nizar Benalla
22069ff42b 8348975: Broken links in the JDK 24 JavaDoc API documentation, build 33
Reviewed-by: liach
2025-01-30 10:10:49 +00:00
Stefan Karlsson
f81772a49e 8348647: CDS dumping commits 3GB when large pages are used
Reviewed-by: aboldtch, iklam
2025-01-30 09:47:45 +00:00
Serguei Spitsyn
fb0f2d25d2 8300708: Some nsk jvmti tests fail with virtual thread wrapper due to jvmti missing some virtual thread support
Reviewed-by: cjplummer, lmesnik
2025-01-30 09:11:13 +00:00
SendaoYan
bb528d5ad6 8348567: [ASAN] Memory access partially overflows by NativeCallStack
Reviewed-by: jsjolen, dholmes
2025-01-30 08:55:40 +00:00
Joachim Kern
e0c2cb48b3 8348663: [AIX] clang pollutes the burned-in library search paths of the generated executables
Reviewed-by: ihse, clanger, mbaesken
2025-01-30 08:36:05 +00:00
Axel Boldt-Christmas
14136f8b11 8347564: ZGC: Crash in DependencyContext::clean_unloading_dependents
Reviewed-by: eosterlund, stefank, vlivanov
2025-01-30 08:33:16 +00:00
Matthias Baesken
04c24f18d5 8347779: sun/tools/jhsdb/HeapDumpTestWithActiveProcess.java fails with Unable to deduce type of thread from address
Reviewed-by: cjplummer, kevinw
2025-01-30 08:23:04 +00:00
Alexander Zvegintsev
d985b31cbb 8342096: Popup menus that request focus are not shown on Linux with Wayland
Reviewed-by: aivanov, honkar
2025-01-29 22:09:01 +00:00
Jiangli Zhou
cbe9ec530f 8348905: Add support to specify the JDK for compiling Jtreg tests
Reviewed-by: erikj
2025-01-29 17:52:43 +00:00
Vladimir Kozlov
6b581d22e1 8347997: assert(false) failed: EA: missing memory path
Reviewed-by: thartmann, chagedorn
2025-01-29 17:24:10 +00:00
Theo Weidmann
4662363e86 8348687: [BACKOUT] C2: Non-fluid StringBuilder pattern bails out in OptoStringConcat
Reviewed-by: chagedorn, shade
2025-01-29 16:57:00 +00:00
Ioi Lam
d266ca965d 8348752: Enable -XX:+AOTClassLinking by default when -XX:AOTMode is specified
Reviewed-by: shade, heidinga
2025-01-29 16:52:10 +00:00
Shaojin Wen
cbc89a7ac6 8348898: Remove unused OctalDigits to clean up code
Reviewed-by: liach
2025-01-29 16:24:01 +00:00
Theo Weidmann
96fefed37f 8319850: PrintInlining should print which methods are late inlines
Reviewed-by: chagedorn, kvn, jsjolen, dlong
2025-01-29 15:14:40 +00:00
Prasanta Sadhukhan
51cce6e612 8318577: Windows Look-and-Feel JProgressBarUI does not render correctly on 2x UI scale
Reviewed-by: tr
2025-01-29 14:37:14 +00:00
Guoxiong Li
6bfae3acc1 8333386: TestAbortOnVMOperationTimeout test fails for client VM
Reviewed-by: ayang, tschatzl
2025-01-29 14:36:55 +00:00
Shaojin Wen
f98d9a3301 8348870: Eliminate array bound checks in DecimalDigits
Reviewed-by: liach, rgiulietti
2025-01-29 13:07:19 +00:00
Matthias Baesken
fe6d9ab951 8348582: Set -fstack-protector when building with clang
Reviewed-by: jkern, erikj
2025-01-29 13:04:44 +00:00
Theo Weidmann
fff97d6d9a 8343938: TestStressBailout triggers "Should not be locked when freed" assert
Reviewed-by: kvn, thartmann
2025-01-29 08:59:19 +00:00
Kevin Walls
69ec45348a 8347985: Deprecate java.management Permission classes for removal
Reviewed-by: sspitsyn, rriggs
2025-01-29 08:42:06 +00:00
Stefan Karlsson
3af4cfc52d 8348180: Remove mention of include of precompiled.hpp from the HotSpot Style Guide
Reviewed-by: dholmes, eosterlund
2025-01-29 08:36:23 +00:00
Matthias Baesken
168a471fd0 8348830: LIBFONTMANAGER optimization is always HIGHEST
Reviewed-by: erikj, prr, serb
2025-01-29 08:22:42 +00:00
Tobias Hartmann
55c3e78f4e 8348631: Crash in PredictedCallGenerator::generate after JDK-8347006
Reviewed-by: kvn, epeter
2025-01-29 07:13:11 +00:00
Chris Plummer
98a93e1151 8348800: Many serviceability/sa tests failing after JDK-8348239
Reviewed-by: shade, kevinw, lmesnik
2025-01-28 23:29:59 +00:00
Alexey Semenyuk
5e81fa6a1f 8348892: Properly fix compilation error for zip_util.c on Windows
Reviewed-by: kcr, jiangli
2025-01-28 23:06:13 +00:00
Justin Lu
3a564ed101 8347955: TimeZone methods to stream the available timezone IDs
Reviewed-by: naoto, rriggs
2025-01-28 21:31:46 +00:00
Jiangli Zhou
1efae9a41e 8348888: tier1 closed build failure on Windows after JDK-8348348
Reviewed-by: kcr, liach, asemenyuk
2025-01-28 20:24:16 +00:00
Daniel Gredler
c018a604f6 8344637: Fix Page8 of manual test java/awt/print/PrinterJob/PrintTextTest.java on Linux and Windows
Reviewed-by: honkar, prr
2025-01-28 20:02:48 +00:00
Cesar Soares Lucas
c3c3888762 8336760: [JVMCI] -XX:+PrintCompilation should also print "hosted" JVMCI compilations
Reviewed-by: dnsimon, kvn
2025-01-28 19:18:59 +00:00
Cesar Soares Lucas
9f4d3de442 8347718: Unexpected NullPointerException in C2 compiled code due to ReduceAllocationMerges
Reviewed-by: kvn, thartmann
2025-01-28 19:17:15 +00:00
Justin Lu
a224f12cb7 8348205: Improve cutover time selection when building available currencies set
Reviewed-by: naoto, rriggs
2025-01-28 17:40:20 +00:00
Jiangli Zhou
81032560f7 8348348: Remove unnecessary #ifdef STATIC_BUILD around DEF_STATIC_JNI_OnLoad from zip_util.c
Reviewed-by: sgehwolf
2025-01-28 16:42:13 +00:00
Alexey Semenyuk
fb066caea8 8347272: [ubsan] JvmLauncher.cpp:262:52: runtime error: applying non-zero offset 40 to null pointer
Reviewed-by: almatvee, mbaesken
2025-01-28 13:51:04 +00:00
Zhengyu Gu
5fec999474 8339668: Parallel: Adopt PartialArrayState to consolidate marking stack in Full GC
Co-authored-by: Thomas Schatzl <tschatzl@openjdk.org>
Reviewed-by: tschatzl, ayang
2025-01-28 13:29:37 +00:00
Dhamoder Nalla
2bef5b4a87 8348323: Corrupted timezone string in JVM crash log
Reviewed-by: dholmes, amitkumar, kevinw
2025-01-28 11:32:00 +00:00
Nizar Benalla
3a8680e919 8347058: When automatically translating the page to pt-br, all CSS styling disappears
Reviewed-by: hannesw, liach
2025-01-28 11:13:54 +00:00
Joachim Kern
a4942a2f7a 8348286: [AIX] clang 17 introduces new warning Wtentative-Definitions which produces Build errors
Reviewed-by: ihse, azvegint
2025-01-28 10:25:36 +00:00
Volkan Yazici
558255ae70 8328919: Add BodyHandlers / BodySubscribers methods to handle excessive server input
Reviewed-by: jpai
2025-01-28 10:22:55 +00:00
Theo Weidmann
1f74caa7da 8348401: [IR Framework] PrintTimes should not require verbose
Reviewed-by: kvn, chagedorn
2025-01-28 09:41:12 +00:00
Kevin Walls
f71541c93b 8344976: Remove the jmx.invoke.getters compatibility property
Reviewed-by: cjplummer, dfuchs, sspitsyn
2025-01-28 09:22:50 +00:00
Robbin Ehn
2537a05c06 8348384: RISC-V: Disable auto-enable Vector on buggy kernels
Reviewed-by: fyang, mli, luhenry
2025-01-28 07:35:30 +00:00
Ioi Lam
46f48e4e3d 8348515: Add docs for -XX:AOT* options in java man pages
Reviewed-by: adinn, kvn
2025-01-28 00:12:57 +00:00
Calvin Cheung
1916a7773f 8346923: MetaspaceShared base calculation may cause overflow in align_up
Reviewed-by: iklam, matsaave
2025-01-27 22:41:55 +00:00
Chris Plummer
21feef3280 8348239: SA does not know about DeoptimizeObjectsALotThread
Reviewed-by: kevinw, dlong, dholmes, lmesnik
2025-01-27 19:45:50 +00:00
Matthias Ernst
8cc1304542 8287788: Implement a better allocator for downcalls
Reviewed-by: jvernee
2025-01-27 19:40:26 +00:00
Weijun Wang
039e73fcdb 8346736: Java Security Standard Algorithm Names spec should include key algorithm names
Reviewed-by: mullan, hchao
2025-01-27 18:21:51 +00:00
Weijun Wang
aba60a9274 8189441: Define algorithm names for keys derived from KeyAgreement
Reviewed-by: mullan
2025-01-27 18:09:17 +00:00
Gennadiy Krivoshein
03106eb2d3 8344119: CUPSPrinter does not respect PostScript printer definition specification in case of reading ImageableArea values from PPD files
Reviewed-by: prr, psadhukhan
2025-01-27 18:05:19 +00:00
Albert Mingkun Yang
ad01dfb670 8346920: Serial: Support allocation in old generation when heap is almost full
Reviewed-by: tschatzl, gli, sjohanss
2025-01-27 14:57:49 +00:00
Chen Liang
1d8ccb8920 8342465: Improve API documentation for java.lang.classfile
Reviewed-by: asotona, darcy
2025-01-27 14:03:35 +00:00
Magnus Ihse Bursie
7d6055a786 8348429: Update cross-compilation devkits to Fedora 41/gcc 13.2
Reviewed-by: erikj
2025-01-27 13:11:03 +00:00
Magnus Ihse Bursie
f1e07974a0 8348586: Optionally silence make warnings about non-control variables
Reviewed-by: mcimadamore, erikj
2025-01-27 13:10:43 +00:00
Eirik Bjørsnøs
ffeb9b5aff 8342807: Update links in java.base to use https://
Reviewed-by: rriggs, ihse, jkern
2025-01-27 12:46:43 +00:00
Martin Doerr
afcc2b03af 8348562: ZGC: segmentation fault due to missing node type check in barrier elision analysis
Reviewed-by: rcastanedalo, rrich
2025-01-27 10:11:53 +00:00
Theo Weidmann
175e58b2e3 8332980: [IR Framework] Add option to measure IR rule processing time
Reviewed-by: kvn, chagedorn
2025-01-27 08:19:55 +00:00
Matthias Baesken
b8c68c0e8c 8348207: Linux PPC64 PCH build broken after JDK-8347909
Co-authored-by: Stefan Karlsson <stefank@openjdk.org>
Reviewed-by: clanger, erikj, mdoerr
2025-01-27 08:14:33 +00:00
Matthias Baesken
70eec9001a 8338303: Linux ppc64le with toolchain clang - detection failure in early JVM startup
Reviewed-by: mdoerr, erikj, ihse
2025-01-27 07:35:40 +00:00
Robbin Ehn
a1fd5f4e88 8348554: Enhance Linux kernel version checks
Reviewed-by: shade, fyang
2025-01-27 07:13:00 +00:00
Koushik Thirupattur
002679ac9f 8347065: Add missing @spec tags for Java Security Standard Algorithm Names
Reviewed-by: weijun
2025-01-25 19:06:47 +00:00
Leonid Mesnik
99002e4f9d 8318098: Update jfr tests to replace keyword jfr with vm.flagless
Reviewed-by: mgronlun
2025-01-25 18:59:20 +00:00
Archie Cobbs
5431668cb9 8348212: Need to add warn() step to JavacTaskImpl after JDK-8344148
Reviewed-by: mcimadamore
2025-01-25 18:02:18 +00:00
Alan Bateman
1d2eb2fbae 8299504: Resolve uses and provides at run time if the service is optional and missing
Co-authored-by: Alan Bateman <alanb@openjdk.org>
Co-authored-by: Alex Buckley <abuckley@openjdk.org>
Reviewed-by: sundar
2025-01-25 07:25:24 +00:00
Shaojin Wen
f446cefee0 8343962: [REDO] Move getChars to DecimalDigits
Reviewed-by: redestad, rgiulietti
2025-01-25 03:12:56 +00:00
William Kemper
7c0985fc32 8348420: Shenandoah: Check is_reserved before using ReservedSpace instances
Reviewed-by: ysr
2025-01-24 23:34:57 +00:00
Jamil Nimeh
f8e81d2339 8347506: Compatible OCSP readtimeout property with OCSP timeout
Reviewed-by: mullan, hchao
2025-01-24 23:06:57 +00:00
Mark Powers
907350e9e8 8346587: Distrust TLS server certificates anchored by Camerfirma Root CAs
Reviewed-by: mullan
2025-01-24 23:05:34 +00:00
Justin Lu
dec93675ab 8347498: JDK 24 RDP2 L10n resource files update
Reviewed-by: sgehwolf, dnguyen, naoto, joehw, asemenyuk
2025-01-24 21:43:19 +00:00
Andrey Turbanov
bef5f56544 8291027: Some of TimeZone methods marked 'synchronized' unnecessarily
Reviewed-by: liach, naoto, jlu
2025-01-24 20:13:17 +00:00
Eirik Bjørsnøs
8e8f800071 8344943: Mark not subclassable classes final in java.base exported classes
Reviewed-by: weijun, liach, djelinski
2025-01-24 19:29:05 +00:00
Volker Simonis
76f792b552 8348203: [JVMCI] Make eager JVMCI initialization observable in the debugger
Reviewed-by: dnsimon
2025-01-24 15:37:47 +00:00
Sonia Zaldana Calles
909cef5198 8339891: Several sun/security/ssl/SSLSessionImpl/* tests override test.java.opts
Reviewed-by: lmesnik
2025-01-24 14:36:05 +00:00
Andrey Turbanov
56a1877989 8348170: Unnecessary Hashtable usage in CSS.styleConstantToCssMap
Reviewed-by: azvegint, aivanov
2025-01-24 14:06:08 +00:00
Eirik Bjørsnøs
9768f60a94 8345249: Apply some conservative cleanups in FileURLConnection
Reviewed-by: jpai, djelinski
2025-01-24 13:00:28 +00:00
Guoxiong Li
c5a69b620a 8331723: Serial: Remove the unused parameter of the method SerialHeap::gc_prologue
Co-authored-by: nanxiaotao <nxtchongchong@163.com>
Reviewed-by: ayang
2025-01-24 12:47:25 +00:00
Robbin Ehn
9c55e2538c 8347981: RISC-V: Add Zfa zli imm loads
Reviewed-by: fyang, luhenry
2025-01-24 11:46:54 +00:00
Sean Coffey
e20bd018c4 8344361: Restore null return for invalid services from legacy providers
Reviewed-by: valeriep
2025-01-24 10:40:36 +00:00
Andrew Haley
5a0bdd04e0 8346890: AArch64: Type profile counters generate suboptimal code
Reviewed-by: shade, adinn
2025-01-24 10:38:43 +00:00
Martin Doerr
4a375e5b88 8344232: [PPC64] secondary_super_cache does not scale well: C1 and interpreter
Reviewed-by: rrich, amitkumar
2025-01-24 09:50:06 +00:00
Stefan Karlsson
0df9dcb6aa 8346572: Check is_reserved() before using ReservedSpace instances
Reviewed-by: tschatzl, wkemper, ayang, ysr
2025-01-24 09:23:29 +00:00
Kevin Walls
a09f06d538 8348265: RMIConnectionImpl: Remove Subject.callAs on MarshalledObject
Reviewed-by: rriggs
2025-01-24 08:39:37 +00:00
Jan Lahoda
0395593a8a 8346751: Internal java compiler error with type annotations in constants expression in constant fields
Reviewed-by: vromero
2025-01-24 08:12:50 +00:00
Adam Sotona
2daafe49c7 8348283: java.lang.classfile.components.snippets.PackageSnippets shipped in java.base.jmod
Reviewed-by: liach
2025-01-24 07:25:08 +00:00
anass baya
50ca450417 8340784: Remove PassFailJFrame constructor with screenshots
Reviewed-by: aivanov, azvegint
2025-01-24 07:01:03 +00:00
Alexander Zvegintsev
416d46947c 8347008: beancontext package spec does not clearly explain why the API is deprecated
Reviewed-by: aivanov, prr
2025-01-24 05:41:12 +00:00
Joe Wang
471d63c91f 8343609: Broken links in java.xml
Reviewed-by: naoto, lancea, iris
2025-01-24 00:29:49 +00:00
1271 changed files with 27137 additions and 15207 deletions

2
.github/README.md vendored
View File

@@ -24,7 +24,7 @@ can be found on the [releases page](https://github.com/JetBrains/JetBrainsRuntim
| IDE Version | Latest JBR | Date Released |
|-------------|---------------------------------------------------------------------------------------------------------|---------------|
| 2025.1 | [21.0.5-b792.48](https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jbr-release-21.0.5b792.48) | 20-Jan-2025 |
| 2025.1 | [21.0.6-b872.80](https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jbr-release-21.0.6b872.80) | 03-Feb-2025 |
| 2024.3 | [21.0.5-b631.28](https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jbr-release-21.0.5b631.28) | 26-Nov-2024 |
| 2024.2 | [21.0.4-b509.30](https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jbr-release-21.0.5b509.30) | 26-Nov-2024 |
| 2024.1 | [21.0.2-b346.3](https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jbr-release-21.0.2b346.3) | 30-Jan-2024 |

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2012, 2025, 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,8 +24,9 @@
#
###
### This file is just a very small wrapper needed to run the real make/Init.gmk.
### It also performs some sanity checks on make.
### This file is just a very small wrapper which will include make/PreInit.gmk,
### where the real work is done. This wrapper also performs some sanity checks
### on make that must be done before we can include another file.
###
# The shell code below will be executed on /usr/bin/make on Solaris, but not in GNU Make.
@@ -60,5 +61,5 @@ else
endif
topdir := $(strip $(patsubst %/, %, $(dir $(makefile_path))))
# ... and then we can include the real makefile
include $(topdir)/make/Init.gmk
# ... and then we can include the real makefile to bootstrap the build
include $(topdir)/make/PreInit.gmk

View File

@@ -127,7 +127,7 @@ if [ "$VERBOSE" = true ] ; then
echo "Will generate IDEA project files in \"$IDEA_OUTPUT\" for project \"$TOPLEVEL_DIR\""
fi
cd $TOP ; make idea-gen-config MAKEOVERRIDES= TOPLEVEL_DIR="$TOPLEVEL_DIR" \
cd $TOP ; make idea-gen-config ALLOW=TOPLEVEL_DIR,IDEA_OUTPUT_PARENT,IDEA_OUTPUT,MODULES TOPLEVEL_DIR="$TOPLEVEL_DIR" \
IDEA_OUTPUT_PARENT="$IDEA_OUTPUT_PARENT" IDEA_OUTPUT="$IDEA_OUTPUT" MODULES="$*" $CONF_ARG || exit 1
cd $SCRIPT_DIR

View File

@@ -217,10 +217,10 @@ file as the first include line. Declarations needed by other files
should be put in the .hpp file, and not in the .inline.hpp file. This
rule exists to resolve problems with circular dependencies between
.inline.hpp files.</p></li>
<li><p>All .cpp files include precompiled.hpp as the first include
line.</p></li>
<li><p>precompiled.hpp is just a build time optimization, so don't rely
on it to resolve include problems.</p></li>
<li><p>Some build configurations use precompiled headers to speed up the
build times. The precompiled headers are included in the precompiled.hpp
file. Note that precompiled.hpp is just a build time optimization, so
don't rely on it to resolve include problems.</p></li>
<li><p>Keep the include lines alphabetically sorted.</p></li>
<li><p>Put conditional inclusions (<code>#if ...</code>) at the end of
the include list.</p></li>

View File

@@ -150,10 +150,10 @@ the first include line. Declarations needed by other files should be put
in the .hpp file, and not in the .inline.hpp file. This rule exists to
resolve problems with circular dependencies between .inline.hpp files.
* All .cpp files include precompiled.hpp as the first include line.
* precompiled.hpp is just a build time optimization, so don't rely on
it to resolve include problems.
* Some build configurations use precompiled headers to speed up the
build times. The precompiled headers are included in the precompiled.hpp
file. Note that precompiled.hpp is just a build time optimization, so
don't rely on it to resolve include problems.
* Keep the include lines alphabetically sorted.

View File

@@ -55,8 +55,10 @@ done
log "Signing jmod files"
JMODS_DIR="$APPLICATION_PATH/Contents/Home/jmods"
JMOD_EXE="$APPLICATION_PATH/Contents/Home/bin/jmod"
JMOD_EXE="$BOOT_JDK/bin/jmod"
if [ -d "$JMODS_DIR" ]; then
log "processing jmods"
for jmod_file in "$JMODS_DIR"/*.jmod; do
log "Processing $jmod_file"
@@ -64,16 +66,16 @@ if [ -d "$JMODS_DIR" ]; then
rm -rf "$TMP_DIR"
mkdir "$TMP_DIR"
log "Unzipping $jmod_file"
log "Unzipping $jmod_file"
$JMOD_EXE extract --dir "$TMP_DIR" "$jmod_file" >/dev/null
log "Removing $jmod_file"
rm -f "$jmod_file"
log "Signing dylibs in $TMP_DIR"
find "$TMP_DIR" \
-type f \( -name "*.dylib" -o -name "*.so"-o -perm +111 -o -name jarsigner -o -name jnativescan -o -name jdeps -o -name jpackageapplauncher -o -name jspawnhelper -o -name jar -o -name javap -o -name jdeprscan -o -name jfr -o -name rmiregistry -o -name java -o -name jhsdb -o -name jstatd -o -name jstatd -o -name jpackage -o -name keytool -o -name jmod -o -name jlink -o -name jimage -o -name jstack -o -name jcmd -o -name jps -o -name jmap -o -name jstat -o -name jinfo -o -name jshell -o -name jwebserver -o -name javac -o -name serialver -o -name jrunscript -o -name jdb -o -name jconsole -o -name javadoc \) \
-exec sh -c '"$1" --timestamp -v -s "$2" --options=runtime --force --entitlements "$3" "$4" || exit 1' sh "$SIGN_UTILITY" "$JB_DEVELOPER_CERT" "$SCRIPT_DIR/entitlements.xml" {} \;
log "Removing $jmod_file"
rm -f "$jmod_file"
cmd="$JMOD_EXE create --class-path $TMP_DIR/classes"
# Check each directory and add to the command if it exists
@@ -84,6 +86,8 @@ if [ -d "$JMODS_DIR" ]; then
[ -d "$TMP_DIR/legal" ] && cmd="$cmd --legal-notices $TMP_DIR/legal"
[ -d "$TMP_DIR/man" ] && cmd="$cmd --man-pages $TMP_DIR/man"
log "Creating jmod file"
log "$cmd"
# Add the output file
cmd="$cmd $jmod_file"
@@ -93,6 +97,41 @@ if [ -d "$JMODS_DIR" ]; then
log "Removing $TMP_DIR"
rm -rf "$TMP_DIR"
done
log "Repack java.base.jmod with new hashes of modules"
hash_modules=$($JMOD_EXE describe $JMODS_DIR/java.base.jmod | grep hashes | awk '{print $2}' | tr '\n' '|' | sed s/\|$//) || exit $?
TMP_DIR="$JMODS_DIR/tmp"
rm -rf "$TMP_DIR"
mkdir "$TMP_DIR"
jmod_file="$JMODS_DIR/java.base.jmod"
log "Unzipping $jmod_file"
$JMOD_EXE extract --dir "$TMP_DIR" "$jmod_file" >/dev/null
log "Removing java.base.jmod"
rm -f "$jmod_file"
cmd="$JMOD_EXE create --class-path $TMP_DIR/classes --hash-modules \"$hash_modules\" --module-path $JMODS_DIR"
# Check each directory and add to the command if it exists
[ -d "$TMP_DIR/bin" ] && cmd="$cmd --cmds $TMP_DIR/bin"
[ -d "$TMP_DIR/conf" ] && cmd="$cmd --config $TMP_DIR/conf"
[ -d "$TMP_DIR/lib" ] && cmd="$cmd --libs $TMP_DIR/lib"
[ -d "$TMP_DIR/include" ] && cmd="$cmd --header-files $TMP_DIR/include"
[ -d "$TMP_DIR/legal" ] && cmd="$cmd --legal-notices $TMP_DIR/legal"
[ -d "$TMP_DIR/man" ] && cmd="$cmd --man-pages $TMP_DIR/man"
log "Creating jmod file"
log "$cmd"
# Add the output file
cmd="$cmd $jmod_file"
# Execute the command
eval $cmd
log "Removing $TMP_DIR"
rm -rf "$TMP_DIR"
else
echo "Directory '$JMODS_DIR' does not exist. Skipping signing of jmod files."
fi

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2012, 2025, 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
@@ -108,6 +108,7 @@ help:
$(info $(_) MICRO="OPT1=x;OPT2=y" # Control the MICRO test harness, use 'make test-only MICRO=help' to list)
$(info $(_) TEST_OPTS="OPT1=x;..." # Generic control of all test harnesses)
$(info $(_) TEST_VM_OPTS="ARG ..." # Same as setting TEST_OPTS to VM_OPTIONS="ARG ...")
$(info $(_) ALLOW="FOO,BAR" # Do not warn that FOO and BAR are non-control variables)
$(info )
$(if $(all_confs), $(info Available configurations in $(build_dir):) $(foreach var,$(all_confs),$(info * $(var))), \
$(info No configurations were found in $(build_dir).) $(info Run 'bash configure' to create a configuration.))

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2012, 2025, 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,9 +24,11 @@
#
################################################################################
# This is the bootstrapping part of the build. This file is included from the
# top level Makefile, and is responsible for launching the Main.gmk file with
# the proper make and the proper make arguments.
# Init.gmk sits between PreInit.gmk and Main.gmk when bootstrapping the build.
# It is called from PreInit.gmk, and its main responsibility is to launch
# Main.gmk with the proper make and the proper make arguments.
# PreMain.gmk has provided us with a proper SPEC. This allows us to use the
# value of $(MAKE) for all further make calls.
################################################################################
# This must be the first rule
@@ -37,249 +39,68 @@ default:
# serially, regardless of -j.
.NOTPARALLEL:
ifeq ($(HAS_SPEC), )
##############################################################################
# This is the default mode. We have not been recursively called with a SPEC.
##############################################################################
include $(SPEC)
# Include our helper functions.
include $(topdir)/make/InitSupport.gmk
include $(TOPDIR)/make/common/MakeBase.gmk
# Here are "global" targets, i.e. targets that can be executed without having
# a configuration. This will define ALL_GLOBAL_TARGETS.
include $(topdir)/make/Global.gmk
# Our helper functions.
include $(TOPDIR)/make/InitSupport.gmk
include $(TOPDIR)/make/common/LogUtils.gmk
# Targets provided by Init.gmk.
ALL_INIT_TARGETS := print-modules print-targets print-configuration \
print-tests reconfigure pre-compare-build post-compare-build
# Parse COMPARE_BUILD (for makefile development)
$(eval $(call ParseCompareBuild))
# CALLED_TARGETS is the list of targets that the user provided,
# or "default" if unspecified.
CALLED_TARGETS := $(if $(MAKECMDGOALS), $(MAKECMDGOALS), default)
# Setup reproducible build environment
$(eval $(call SetupReproducibleBuild))
# Extract non-global targets that require a spec file.
CALLED_SPEC_TARGETS := $(filter-out $(ALL_GLOBAL_TARGETS), $(CALLED_TARGETS))
# If we have only global targets, or if we are called with -qp (assuming an
# external part, e.g. bash completion, is trying to understand our targets),
# we will skip SPEC location and the sanity checks.
ifeq ($(CALLED_SPEC_TARGETS), )
ONLY_GLOBAL_TARGETS := true
endif
ifeq ($(findstring p, $(MAKEFLAGS))$(findstring q, $(MAKEFLAGS)), pq)
ONLY_GLOBAL_TARGETS := true
endif
ifeq ($(ONLY_GLOBAL_TARGETS), true)
############################################################################
# We have only global targets, or are called with -pq.
############################################################################
ifeq ($(wildcard $(SPEC)), )
# If we have no SPEC provided, we will just make a "best effort" target list.
# First try to grab any available pre-existing main-targets.gmk.
main_targets_file := $(firstword $(wildcard $(build_dir)/*/make-support/main-targets.gmk))
ifneq ($(main_targets_file), )
# Extract the SPEC that corresponds to this main-targets.gmk file.
SPEC := $(patsubst %/make-support/main-targets.gmk, %/spec.gmk, $(main_targets_file))
else
# None found, pick an arbitrary SPEC for which to generate a file
SPEC := $(firstword $(all_spec_files))
endif
endif
ifneq ($(wildcard $(SPEC)), )
$(eval $(call DefineMainTargets, LAZY, $(SPEC)))
else
# If we have no configurations we can not provide any main targets.
ALL_MAIN_TARGETS :=
endif
ALL_TARGETS := $(sort $(ALL_GLOBAL_TARGETS) $(ALL_MAIN_TARGETS) $(ALL_INIT_TARGETS))
# Just list all our targets.
$(ALL_TARGETS):
.PHONY: $(ALL_TARGETS)
else
############################################################################
# This is the normal case, we have been called from the command line by the
# user and we need to call ourself back with a proper SPEC.
# We have at least one non-global target, so we need to find a spec file.
############################################################################
# Basic checks on environment and command line.
$(eval $(call CheckControlVariables))
$(eval $(call CheckDeprecatedEnvironment))
$(eval $(call CheckInvalidMakeFlags))
# Check that CONF_CHECK is valid.
$(eval $(call ParseConfCheckOption))
# Check that the LOG given is valid, and set LOG_LEVEL, LOG_NOFILE, MAKE_LOG_VARS and MAKE_LOG_FLAGS.
# If no LOG= was given on command line, but we have a non-standard default
# value, use that instead and re-parse log level.
ifeq ($(LOG), )
ifneq ($(DEFAULT_LOG), )
override LOG := $(DEFAULT_LOG)
$(eval $(call ParseLogLevel))
# After this SPECS contain 1..N spec files (otherwise ParseConfAndSpec fails).
$(eval $(call ParseConfAndSpec))
# Extract main targets from Main.gmk using the spec(s) provided. In theory,
# with multiple specs, we should find the intersection of targets provided
# by all specs, but we approximate this by an arbitrary spec from the list.
# This will setup ALL_MAIN_TARGETS.
$(eval $(call DefineMainTargets, FORCE, $(firstword $(SPECS))))
# Separate called targets depending on type.
INIT_TARGETS := $(filter $(ALL_INIT_TARGETS), $(CALLED_SPEC_TARGETS))
MAIN_TARGETS := $(filter $(ALL_MAIN_TARGETS), $(CALLED_SPEC_TARGETS))
SEQUENTIAL_TARGETS := $(filter dist-clean clean%, $(MAIN_TARGETS))
PARALLEL_TARGETS := $(filter-out $(SEQUENTIAL_TARGETS), $(MAIN_TARGETS))
# The spec files depend on the autoconf source code. This check makes sure
# the configuration is up to date after changes to configure.
$(SPECS): $(wildcard $(topdir)/make/autoconf/*) \
$(if $(CUSTOM_CONFIG_DIR), $(wildcard $(CUSTOM_CONFIG_DIR)/*)) \
$(addprefix $(topdir)/make/conf/, version-numbers.conf branding.conf) \
$(if $(CUSTOM_CONF_DIR), $(wildcard $(addprefix $(CUSTOM_CONF_DIR)/, \
version-numbers.conf branding.conf)))
ifeq ($(CONF_CHECK), fail)
@echo Error: The configuration is not up to date for \
"'$(lastword $(subst /, , $(dir $@)))'."
$(call PrintConfCheckFailed)
@exit 2
else ifeq ($(CONF_CHECK), auto)
@echo Note: The configuration is not up to date for \
"'$(lastword $(subst /, , $(dir $@)))'."
@( cd $(topdir) && \
$(MAKE) $(MFLAGS) $(MAKE_LOG_FLAGS) -r -R -f $(topdir)/make/Init.gmk \
SPEC=$@ HAS_SPEC=true ACTUAL_TOPDIR=$(topdir) \
reconfigure )
else ifeq ($(CONF_CHECK), ignore)
# Do nothing
endif
# Do not let make delete spec files even if aborted while doing a reconfigure
.PRECIOUS: $(SPECS)
# Unless reconfigure is explicitly called, let all main targets depend on
# the spec files to be up to date.
ifeq ($(findstring reconfigure, $(INIT_TARGETS)), )
$(MAIN_TARGETS): $(SPECS)
endif
make-info:
ifneq ($(findstring $(LOG_LEVEL), info debug trace), )
$(info Running make as '$(strip $(MAKE) $(MFLAGS) \
$(COMMAND_LINE_VARIABLES) $(MAKECMDGOALS))')
endif
MAKE_INIT_WITH_SPEC_ARGUMENTS := ACTUAL_TOPDIR=$(topdir) \
USER_MAKE_VARS="$(USER_MAKE_VARS)" MAKE_LOG_FLAGS=$(MAKE_LOG_FLAGS) \
$(MAKE_LOG_VARS) \
INIT_TARGETS="$(INIT_TARGETS)" \
SEQUENTIAL_TARGETS="$(SEQUENTIAL_TARGETS)" \
PARALLEL_TARGETS="$(PARALLEL_TARGETS)"
# Now the init and main targets will be called, once for each SPEC. The
# recipe will be run once for every target specified, but we only want to
# execute the recipe a single time, hence the TARGET_DONE with a dummy
# command if true.
# The COMPARE_BUILD part implements special support for makefile development.
$(ALL_INIT_TARGETS) $(ALL_MAIN_TARGETS): make-info
@$(if $(TARGET_DONE), \
true \
, \
( cd $(topdir) && \
$(foreach spec, $(SPECS), \
$(MAKE) $(MFLAGS) $(MAKE_LOG_FLAGS) -r -R -j 1 -f $(topdir)/make/Init.gmk \
SPEC=$(spec) HAS_SPEC=true $(MAKE_INIT_WITH_SPEC_ARGUMENTS) \
main && \
$(if $(and $(COMPARE_BUILD), $(PARALLEL_TARGETS)), \
$(MAKE) $(MFLAGS) $(MAKE_LOG_FLAGS) -r -R -f $(topdir)/make/Init.gmk \
SPEC=$(spec) HAS_SPEC=true ACTUAL_TOPDIR=$(topdir) \
COMPARE_BUILD="$(COMPARE_BUILD)" pre-compare-build && \
$(MAKE) $(MFLAGS) $(MAKE_LOG_FLAGS) -r -R -j 1 -f $(topdir)/make/Init.gmk \
SPEC=$(spec) HAS_SPEC=true $(MAKE_INIT_WITH_SPEC_ARGUMENTS) \
COMPARE_BUILD="$(COMPARE_BUILD):NODRYRUN=true" main && \
$(MAKE) $(MFLAGS) $(MAKE_LOG_FLAGS) -r -R -f $(topdir)/make/Init.gmk \
SPEC=$(spec) HAS_SPEC=true ACTUAL_TOPDIR=$(topdir) \
COMPARE_BUILD="$(COMPARE_BUILD):NODRYRUN=true" post-compare-build && \
) \
) true ) \
$(eval TARGET_DONE=true) \
)
.PHONY: $(ALL_MAIN_TARGETS) $(ALL_INIT_TARGETS)
endif # $(ONLY_GLOBAL_TARGETS)!=true
else # HAS_SPEC=true
##############################################################################
# Now we have a spec. This part provides the "main" target that acts as a
# trampoline to call the Main.gmk with the value of $(MAKE) found in the spec
# file.
##############################################################################
include $(SPEC)
# Our helper functions.
include $(TOPDIR)/make/InitSupport.gmk
# Parse COMPARE_BUILD (for makefile development)
$(eval $(call ParseCompareBuild))
# Setup reproducible build environment
$(eval $(call SetupReproducibleBuild))
# If no LOG= was given on command line, but we have a non-standard default
# value, use that instead and re-parse log level.
ifeq ($(LOG), )
ifneq ($(DEFAULT_LOG), )
override LOG := $(DEFAULT_LOG)
$(eval $(call ParseLogLevel))
endif
endif
endif
ifeq ($(LOG_NOFILE), true)
# Disable build log if LOG=[level,]nofile was given
override BUILD_LOG_PIPE :=
override BUILD_LOG_PIPE_SIMPLE :=
endif
ifeq ($(LOG_NOFILE), true)
# Disable build log if LOG=[level,]nofile was given
override BUILD_LOG_PIPE :=
override BUILD_LOG_PIPE_SIMPLE :=
endif
ifeq ($(filter dist-clean, $(SEQUENTIAL_TARGETS)), dist-clean)
# We can't have a log file if we're about to remove it.
override BUILD_LOG_PIPE :=
override BUILD_LOG_PIPE_SIMPLE :=
endif
ifeq ($(filter dist-clean, $(SEQUENTIAL_TARGETS)), dist-clean)
# We can't have a log file if we're about to remove it.
override BUILD_LOG_PIPE :=
override BUILD_LOG_PIPE_SIMPLE :=
endif
ifeq ($(OUTPUT_SYNC_SUPPORTED), true)
OUTPUT_SYNC_FLAG := -O$(OUTPUT_SYNC)
endif
ifeq ($(OUTPUT_SYNC_SUPPORTED), true)
OUTPUT_SYNC_FLAG := -O$(OUTPUT_SYNC)
endif
##############################################################################
# Init targets
##############################################################################
##############################################################################
# Init targets. These are handled fully, here and now.
##############################################################################
print-modules:
print-modules:
( cd $(TOPDIR) && \
$(MAKE) $(MAKE_ARGS) -j 1 -f make/Main.gmk $(USER_MAKE_VARS) \
NO_RECIPES=true print-modules )
print-targets:
print-targets:
( cd $(TOPDIR) && \
$(MAKE) $(MAKE_ARGS) -j 1 -f make/Main.gmk $(USER_MAKE_VARS) \
NO_RECIPES=true print-targets )
print-tests:
print-tests:
( cd $(TOPDIR) && \
$(MAKE) $(MAKE_ARGS) -j 1 -f make/Main.gmk $(USER_MAKE_VARS) \
NO_RECIPES=true print-tests )
print-configuration:
$(ECHO) $(CONFIGURE_COMMAND_LINE)
print-configuration:
$(ECHO) $(CONFIGURE_COMMAND_LINE)
reconfigure:
reconfigure:
ifneq ($(REAL_CONFIGURE_COMMAND_EXEC_FULL), )
$(ECHO) "Re-running configure using original command line '$(REAL_CONFIGURE_COMMAND_EXEC_SHORT) $(REAL_CONFIGURE_COMMAND_LINE)'"
$(eval RECONFIGURE_COMMAND := $(REAL_CONFIGURE_COMMAND_EXEC_FULL) $(REAL_CONFIGURE_COMMAND_LINE))
@@ -295,25 +116,27 @@ else # HAS_SPEC=true
CUSTOM_CONFIG_DIR="$(CUSTOM_CONFIG_DIR)" \
$(RECONFIGURE_COMMAND) )
##############################################################################
# The main target, for delegating into Main.gmk
##############################################################################
.PHONY: print-modules print-targets print-tests print-configuration reconfigure
MAIN_TARGETS := $(SEQUENTIAL_TARGETS) $(PARALLEL_TARGETS) $(COMPARE_BUILD_MAKE)
# If building the default target, add what they are to the description.
DESCRIPTION_TARGETS := $(strip $(MAIN_TARGETS))
ifeq ($(DESCRIPTION_TARGETS), default)
DESCRIPTION_TARGETS += ($(DEFAULT_MAKE_TARGET))
endif
TARGET_DESCRIPTION := target$(if $(word 2, $(MAIN_TARGETS)),s) \
'$(strip $(DESCRIPTION_TARGETS))' in configuration '$(CONF_NAME)'
##############################################################################
# The main target. This will delegate all other targets into Main.gmk.
##############################################################################
# MAKEOVERRIDES is automatically set and propagated by Make to sub-Make calls.
# We need to clear it of the init-specific variables. The user-specified
# variables are explicitly propagated using $(USER_MAKE_VARS).
main: MAKEOVERRIDES :=
MAIN_TARGETS := $(SEQUENTIAL_TARGETS) $(PARALLEL_TARGETS) $(COMPARE_BUILD_MAKE)
# If building the default target, add what they are to the description.
DESCRIPTION_TARGETS := $(strip $(MAIN_TARGETS))
ifeq ($(DESCRIPTION_TARGETS), default)
DESCRIPTION_TARGETS += ($(DEFAULT_MAKE_TARGET))
endif
TARGET_DESCRIPTION := target$(if $(word 2, $(MAIN_TARGETS)),s) \
'$(strip $(DESCRIPTION_TARGETS))' in configuration '$(CONF_NAME)'
main: $(INIT_TARGETS)
# MAKEOVERRIDES is automatically set and propagated by Make to sub-Make calls.
# We need to clear it of the init-specific variables. The user-specified
# variables are explicitly propagated using $(USER_MAKE_VARS).
main: MAKEOVERRIDES :=
main: $(INIT_TARGETS)
ifneq ($(SEQUENTIAL_TARGETS)$(PARALLEL_TARGETS), )
$(call RotateLogFiles)
$(PRINTF) "Building $(TARGET_DESCRIPTION)\n" $(BUILD_LOG_PIPE_SIMPLE)
@@ -333,7 +156,7 @@ else # HAS_SPEC=true
# treat it as NOT using jobs at all.
( cd $(TOPDIR) && \
$(NICE) $(MAKE) $(MAKE_ARGS) $(OUTPUT_SYNC_FLAG) \
$(if $(JOBS), -j $(JOBS)) \
$(if $(JOBS), -j $(JOBS)) \
-f make/Main.gmk $(USER_MAKE_VARS) \
$(PARALLEL_TARGETS) $(COMPARE_BUILD_MAKE) $(BUILD_LOG_PIPE) || \
( exitcode=$$? && \
@@ -353,7 +176,7 @@ else # HAS_SPEC=true
$(call ReportProfileTimes)
endif
on-failure:
on-failure:
$(call CleanupJavacServer)
$(call StopGlobalTimer)
$(call ReportBuildTimes)
@@ -365,15 +188,14 @@ else # HAS_SPEC=true
$(call CleanupCompareBuild)
endif
# Support targets for COMPARE_BUILD, used for makefile development
pre-compare-build:
# Support targets for COMPARE_BUILD, used for makefile development
pre-compare-build:
$(call WaitForJavacServerFinish)
$(call PrepareCompareBuild)
post-compare-build:
post-compare-build:
$(call WaitForJavacServerFinish)
$(call CleanupCompareBuild)
$(call CompareBuildDoComparison)
.PHONY: print-targets print-modules reconfigure main on-failure
endif
.PHONY: main on-failure pre-compare-build post-compare-build

View File

@@ -25,389 +25,108 @@
################################################################################
# This file contains helper functions for Init.gmk.
# It is divided in two parts, depending on if a SPEC is present or not
# (HAS_SPEC is true or not).
################################################################################
ifndef _INITSUPPORT_GMK
_INITSUPPORT_GMK := 1
# Define basic logging setup
BUILD_LOG := $(OUTPUTDIR)/build.log
BUILD_PROFILE_LOG := $(OUTPUTDIR)/build-profile.log
ifeq ($(HAS_SPEC), )
BUILD_LOG_PIPE := > >($(TEE) -a $(BUILD_LOG)) 2> >($(TEE) -a $(BUILD_LOG) >&2) && wait
# Use this for simple echo/printf commands that are never expected to print
# to stderr.
BUILD_LOG_PIPE_SIMPLE := | $(TEE) -a $(BUILD_LOG)
# COMMA is defined in spec.gmk, but that is not included yet
COMMA := ,
ifneq ($(CUSTOM_ROOT), )
topdir = $(CUSTOM_ROOT)
else
topdir = $(TOPDIR)
endif
# Include the corresponding closed file, if present.
ifneq ($(CUSTOM_MAKE_DIR), )
-include $(CUSTOM_MAKE_DIR)/InitSupport.gmk
# Setup the build environment to match the requested specification on
# level of reproducible builds
define SetupReproducibleBuild
ifeq ($$(SOURCE_DATE), updated)
# For static values of SOURCE_DATE (not "updated"), these are set in spec.gmk
export SOURCE_DATE_EPOCH := $$(shell $$(DATE) +"%s")
export SOURCE_DATE_ISO_8601 := $$(call EpochToISO8601, $$(SOURCE_DATE_EPOCH))
endif
endef
##############################################################################
# Helper functions for the initial part of Init.gmk, before the spec file is
# loaded. Most of these functions provide parsing and setting up make options
# from the command-line.
##############################################################################
# Parse COMPARE_BUILD into COMPARE_BUILD_*
# Syntax: COMPARE_BUILD=CONF=<configure options>:PATCH=<patch file>:
# MAKE=<make targets>:COMP_OPTS=<compare script options>:
# COMP_DIR=<compare script base dir>|<default>:
# FAIL=<bool>
# If neither CONF or PATCH is given, assume <default> means CONF if it
# begins with "--", otherwise assume it means PATCH.
# MAKE and COMP_OPTS can only be used with CONF and/or PATCH specified.
# If any value contains "+", it will be replaced by space.
# FAIL can be set to false to have the return value of compare be ignored.
define ParseCompareBuild
ifneq ($$(COMPARE_BUILD), )
COMPARE_BUILD_OUTPUTDIR := $(topdir)/build/compare-build/$(CONF_NAME)
COMPARE_BUILD_FAIL := true
# Make control variables, handled by Init.gmk
INIT_CONTROL_VARIABLES += LOG CONF CONF_NAME SPEC JOBS TEST_JOBS CONF_CHECK \
COMPARE_BUILD JTREG GTEST MICRO TEST_OPTS TEST_VM_OPTS TEST_DEPS
# All known make control variables
MAKE_CONTROL_VARIABLES := $(INIT_CONTROL_VARIABLES) TEST JDK_FILTER SPEC_FILTER
# Define a simple reverse function.
# Should maybe move to MakeBase.gmk, but we can't include that file now.
reverse = \
$(if $(strip $(1)), $(call reverse, $(wordlist 2, $(words $(1)), $(1)))) \
$(firstword $(1))
# The variable MAKEOVERRIDES contains variable assignments from the command
# line, but in reverse order to what the user entered.
# The '§' <=> '\ 'dance is needed to keep values with space in them connected.
COMMAND_LINE_VARIABLES := $(subst §,\ , $(call reverse, $(subst \ ,§,$(MAKEOVERRIDES))))
# A list like FOO="val1" BAR="val2" containing all user-supplied make
# variables that we should propagate.
# The '§' <=> '\ 'dance is needed to keep values with space in them connected.
USER_MAKE_VARS := $(subst §,\ , $(filter-out $(addsuffix =%, $(INIT_CONTROL_VARIABLES)), \
$(subst \ ,§,$(MAKEOVERRIDES))))
# Setup information about available configurations, if any.
ifneq ($(CUSTOM_ROOT), )
build_dir = $(CUSTOM_ROOT)/build
else
build_dir = $(topdir)/build
endif
all_spec_files = $(wildcard $(build_dir)/*/spec.gmk)
# Extract the configuration names from the path
all_confs = $(patsubst %/spec.gmk, %, $(patsubst $(build_dir)/%, %, $(all_spec_files)))
# Check for unknown command-line variables
define CheckControlVariables
command_line_variables := $$(strip $$(foreach var, \
$$(subst \ ,_,$$(MAKEOVERRIDES)), \
$$(firstword $$(subst =, , $$(var)))))
unknown_command_line_variables := $$(strip \
$$(filter-out $$(MAKE_CONTROL_VARIABLES), $$(command_line_variables)))
ifneq ($$(unknown_command_line_variables), )
$$(info Note: Command line contains non-control variables:)
$$(foreach var, $$(unknown_command_line_variables), $$(info * $$(var)=$$($$(var))))
$$(info Make sure it is not mistyped, and that you intend to override this variable.)
$$(info 'make help' will list known control variables.)
$$(info )
endif
endef
# Check for deprecated ALT_ variables
define CheckDeprecatedEnvironment
defined_alt_variables := $$(filter ALT_%, $$(.VARIABLES))
ifneq ($$(defined_alt_variables), )
$$(info Warning: You have the following ALT_ variables set:)
$$(foreach var, $$(defined_alt_variables), $$(info * $$(var)=$$($$(var))))
$$(info ALT_ variables are deprecated, and may result in a failed build.)
$$(info Please clean your environment.)
$$(info )
endif
endef
# Check for invalid make flags like -j
define CheckInvalidMakeFlags
# This is a trick to get this rule to execute before any other rules
# MAKEFLAGS only indicate -j if read in a recipe (!)
$$(topdir)/make/Init.gmk: .FORCE
$$(if $$(findstring --jobserver, $$(MAKEFLAGS)), \
$$(info Error: 'make -jN' is not supported, use 'make JOBS=N') \
$$(error Cannot continue) \
)
.FORCE:
.PHONY: .FORCE
endef
# Check that the CONF_CHECK option is valid and set up handling
define ParseConfCheckOption
ifeq ($$(CONF_CHECK), )
# Default behavior is fail
CONF_CHECK := fail
else ifneq ($$(filter-out auto fail ignore, $$(CONF_CHECK)), )
$$(info Error: CONF_CHECK must be one of: auto, fail or ignore.)
$$(error Cannot continue)
endif
endef
define ParseConfAndSpec
ifneq ($$(origin SPEC), undefined)
# We have been given a SPEC, check that it works out properly
ifneq ($$(origin CONF), undefined)
# We also have a CONF argument. We can't have both.
$$(info Error: Cannot use CONF=$$(CONF) and SPEC=$$(SPEC) at the same time. Choose one.)
$$(error Cannot continue)
endif
ifneq ($$(origin CONF_NAME), undefined)
# We also have a CONF_NAME argument. We can't have both.
$$(info Error: Cannot use CONF_NAME=$$(CONF_NAME) and SPEC=$$(SPEC) at the same time. Choose one.)
$$(error Cannot continue)
endif
ifeq ($$(wildcard $$(SPEC)), )
$$(info Error: Cannot locate spec.gmk, given by SPEC=$$(SPEC).)
$$(error Cannot continue)
endif
ifeq ($$(filter /%, $$(SPEC)), )
# If given with relative path, make it absolute
SPECS := $$(CURDIR)/$$(strip $$(SPEC))
else
SPECS := $$(SPEC)
endif
# For now, unset this SPEC variable.
override SPEC :=
ifneq ($$(findstring :, $$(COMPARE_BUILD)), )
$$(foreach part, $$(subst :, , $$(COMPARE_BUILD)), \
$$(if $$(filter PATCH=%, $$(part)), \
$$(eval COMPARE_BUILD_PATCH = $$(strip $$(patsubst PATCH=%, %, $$(part)))) \
) \
$$(if $$(filter CONF=%, $$(part)), \
$$(eval COMPARE_BUILD_CONF = $$(strip $$(subst +, , $$(patsubst CONF=%, %, $$(part))))) \
) \
$$(if $$(filter MAKE=%, $$(part)), \
$$(eval COMPARE_BUILD_MAKE = $$(strip $$(subst +, , $$(patsubst MAKE=%, %, $$(part))))) \
) \
$$(if $$(filter COMP_OPTS=%, $$(part)), \
$$(eval COMPARE_BUILD_COMP_OPTS = $$(strip $$(subst +, , $$(patsubst COMP_OPTS=%, %, $$(part))))) \
) \
$$(if $$(filter COMP_DIR=%, $$(part)), \
$$(eval COMPARE_BUILD_COMP_DIR = $$(strip $$(subst +, , $$(patsubst COMP_DIR=%, %, $$(part))))) \
) \
$$(if $$(filter FAIL=%, $$(part)), \
$$(eval COMPARE_BUILD_FAIL = $$(strip $$(subst +, , $$(patsubst FAIL=%, %, $$(part))))) \
) \
$$(if $$(filter NODRYRUN=%, $$(part)), \
$$(eval COMPARE_BUILD_NODRYRUN = $$(strip $$(subst +, , $$(patsubst NODRYRUN=%, %, $$(part))))) \
) \
)
else
# Use spec.gmk files in the build output directory
ifeq ($$(all_spec_files), )
ifneq ($(CUSTOM_ROOT), )
$$(info Error: No configurations found for $$(CUSTOM_ROOT).)
else
$$(info Error: No configurations found for $$(topdir).)
endif
$$(info Please run 'bash configure' to create a configuration.)
$$(info )
$$(error Cannot continue)
endif
ifneq ($$(origin CONF_NAME), undefined)
ifneq ($$(origin CONF), undefined)
# We also have a CONF argument. We can't have both.
$$(info Error: Cannot use CONF=$$(CONF) and CONF_NAME=$$(CONF_NAME) at the same time. Choose one.)
$$(error Cannot continue)
endif
matching_conf := $$(strip $$(filter $$(CONF_NAME), $$(all_confs)))
ifeq ($$(matching_conf), )
$$(info Error: No configurations found matching CONF_NAME=$$(CONF_NAME).)
$$(info Available configurations in $$(build_dir):)
$$(foreach var, $$(all_confs), $$(info * $$(var)))
$$(error Cannot continue)
else ifneq ($$(words $$(matching_conf)), 1)
$$(info Error: Matching more than one configuration CONF_NAME=$$(CONF_NAME).)
$$(info Available configurations in $$(build_dir):)
$$(foreach var, $$(all_confs), $$(info * $$(var)))
$$(error Cannot continue)
else
$$(info Building configuration '$$(matching_conf)' (matching CONF_NAME=$$(CONF_NAME)))
endif
# Create a SPEC definition. This will contain the path to exactly one spec file.
SPECS := $$(build_dir)/$$(matching_conf)/spec.gmk
else ifneq ($$(origin CONF), undefined)
# User have given a CONF= argument.
ifeq ($$(CONF), )
# If given CONF=, match all configurations
matching_confs := $$(strip $$(all_confs))
else
# Otherwise select those that contain the given CONF string
ifeq ($$(patsubst !%,,$$(CONF)), )
# A CONF starting with ! means we should negate the search term
matching_confs := $$(strip $$(foreach var, $$(all_confs), \
$$(if $$(findstring $$(subst !,,$$(CONF)), $$(var)), ,$$(var))))
else
matching_confs := $$(strip $$(foreach var, $$(all_confs), \
$$(if $$(findstring $$(CONF), $$(var)), $$(var))))
endif
ifneq ($$(filter $$(CONF), $$(matching_confs)), )
ifneq ($$(word 2, $$(matching_confs)), )
# Don't repeat this output on make restarts caused by including
# generated files.
ifeq ($$(MAKE_RESTARTS), )
$$(info Using exact match for CONF=$$(CONF) (other matches are possible))
endif
endif
# If we found an exact match, use that
matching_confs := $$(CONF)
endif
endif
ifeq ($$(matching_confs), )
$$(info Error: No configurations found matching CONF=$$(CONF).)
$$(info Available configurations in $$(build_dir):)
$$(foreach var, $$(all_confs), $$(info * $$(var)))
$$(error Cannot continue)
else
# Don't repeat this output on make restarts caused by including
# generated files.
ifeq ($$(MAKE_RESTARTS), )
ifeq ($$(words $$(matching_confs)), 1)
ifneq ($$(findstring $$(LOG_LEVEL), info debug trace), )
$$(info Building configuration '$$(matching_confs)' (matching CONF=$$(CONF)))
endif
else
$$(info Building these configurations (matching CONF=$$(CONF)):)
$$(foreach var, $$(matching_confs), $$(info * $$(var)))
endif
endif
endif
# Create a SPEC definition. This will contain the path to one or more spec.gmk files.
SPECS := $$(addsuffix /spec.gmk, $$(addprefix $$(build_dir)/, $$(matching_confs)))
# Separate handling for single field case, to allow for spaces in values.
ifneq ($$(filter PATCH=%, $$(COMPARE_BUILD)), )
COMPARE_BUILD_PATCH = $$(strip $$(patsubst PATCH=%, %, $$(COMPARE_BUILD)))
else ifneq ($$(filter CONF=%, $$(COMPARE_BUILD)), )
COMPARE_BUILD_CONF = $$(strip $$(subst +, , $$(patsubst CONF=%, %, $$(COMPARE_BUILD))))
else ifneq ($$(filter --%, $$(COMPARE_BUILD)), )
# Assume CONF if value begins with --
COMPARE_BUILD_CONF = $$(strip $$(subst +, , $$(COMPARE_BUILD)))
else
# No CONF or SPEC given, check the available configurations
ifneq ($$(words $$(all_spec_files)), 1)
$$(info Error: No CONF given, but more than one configuration found.)
$$(info Available configurations in $$(build_dir):)
$$(foreach var, $$(all_confs), $$(info * $$(var)))
$$(info Please retry building with CONF=<config pattern> (or SPEC=<spec file>).)
$$(info )
$$(error Cannot continue)
# Otherwise assume patch file
COMPARE_BUILD_PATCH = $$(strip $$(COMPARE_BUILD))
endif
endif
ifneq ($$(COMPARE_BUILD_PATCH), )
ifneq ($$(wildcard $$(topdir)/$$(COMPARE_BUILD_PATCH)), )
# Assume relative path, if file exists
COMPARE_BUILD_PATCH := $$(wildcard $$(topdir)/$$(COMPARE_BUILD_PATCH))
else ifeq ($$(wildcard $$(COMPARE_BUILD_PATCH)), )
$$(error Patch file $$(COMPARE_BUILD_PATCH) does not exist)
endif
ifneq ($$(COMPARE_BUILD_NODRYRUN), true)
PATCH_DRY_RUN := $$(shell cd $$(topdir) && $$(PATCH) --dry-run -p1 < $$(COMPARE_BUILD_PATCH) > /dev/null 2>&1 || $$(ECHO) FAILED)
ifeq ($$(PATCH_DRY_RUN), FAILED)
$$(error Patch file $$(COMPARE_BUILD_PATCH) does not apply cleanly)
endif
# We found exactly one configuration, use it
SPECS := $$(strip $$(all_spec_files))
endif
endif
endef
# Extract main targets from Main.gmk using the spec provided in $2.
#
# Param 1: FORCE = force generation of main-targets.gmk or LAZY = do not force.
# Param 2: The SPEC file to use.
define DefineMainTargets
# We will start by making sure the main-targets.gmk file is removed, if
# make has not been restarted. By the -include, we will trigger the
# rule for generating the file (which is never there since we removed it),
# thus generating it fresh, and make will restart, incrementing the restart
# count.
main_targets_file := $$(dir $(strip $2))make-support/main-targets.gmk
ifeq ($$(MAKE_RESTARTS), )
# Only do this if make has not been restarted, and if we do not force it.
ifeq ($(strip $1), FORCE)
$$(shell rm -f $$(main_targets_file))
endif
ifneq ($$(COMPARE_BUILD_FAIL), true)
COMPARE_BUILD_IGNORE_RESULT := || true
endif
$$(main_targets_file):
@( cd $$(topdir) && \
$$(MAKE) $$(MAKE_LOG_FLAGS) -r -R -f $$(topdir)/make/Main.gmk \
-I $$(topdir)/make/common SPEC=$(strip $2) NO_RECIPES=true \
$$(MAKE_LOG_VARS) \
create-main-targets-include )
# Now include main-targets.gmk. This will define ALL_MAIN_TARGETS.
-include $$(main_targets_file)
endef
define PrintConfCheckFailed
@echo ' '
@echo "Please rerun configure! Easiest way to do this is by running"
@echo "'make reconfigure'."
@echo "This behavior may also be changed using CONF_CHECK=<ignore|auto>."
@echo ' '
endef
else # $(HAS_SPEC)=true
##############################################################################
# Helper functions for the 'main' target. These functions assume a single,
# proper and existing SPEC is included.
##############################################################################
include $(TOPDIR)/make/common/MakeBase.gmk
# Define basic logging setup
BUILD_LOG := $(OUTPUTDIR)/build.log
BUILD_PROFILE_LOG := $(OUTPUTDIR)/build-profile.log
BUILD_LOG_PIPE := > >($(TEE) -a $(BUILD_LOG)) 2> >($(TEE) -a $(BUILD_LOG) >&2) && wait
# Use this for simple echo/printf commands that are never expected to print
# to stderr.
BUILD_LOG_PIPE_SIMPLE := | $(TEE) -a $(BUILD_LOG)
ifneq ($(CUSTOM_ROOT), )
topdir = $(CUSTOM_ROOT)
else
topdir = $(TOPDIR)
endif
endef
# Setup the build environment to match the requested specification on
# level of reproducible builds
define SetupReproducibleBuild
ifeq ($$(SOURCE_DATE), updated)
# For static values of SOURCE_DATE (not "updated"), these are set in spec.gmk
export SOURCE_DATE_EPOCH := $$(shell $$(DATE) +"%s")
export SOURCE_DATE_ISO_8601 := $$(call EpochToISO8601, $$(SOURCE_DATE_EPOCH))
endif
endef
# Parse COMPARE_BUILD into COMPARE_BUILD_*
# Syntax: COMPARE_BUILD=CONF=<configure options>:PATCH=<patch file>:
# MAKE=<make targets>:COMP_OPTS=<compare script options>:
# COMP_DIR=<compare script base dir>|<default>:
# FAIL=<bool>
# If neither CONF or PATCH is given, assume <default> means CONF if it
# begins with "--", otherwise assume it means PATCH.
# MAKE and COMP_OPTS can only be used with CONF and/or PATCH specified.
# If any value contains "+", it will be replaced by space.
# FAIL can be set to false to have the return value of compare be ignored.
define ParseCompareBuild
ifneq ($$(COMPARE_BUILD), )
COMPARE_BUILD_OUTPUTDIR := $(topdir)/build/compare-build/$(CONF_NAME)
COMPARE_BUILD_FAIL := true
ifneq ($$(findstring :, $$(COMPARE_BUILD)), )
$$(foreach part, $$(subst :, , $$(COMPARE_BUILD)), \
$$(if $$(filter PATCH=%, $$(part)), \
$$(eval COMPARE_BUILD_PATCH = $$(strip $$(patsubst PATCH=%, %, $$(part)))) \
) \
$$(if $$(filter CONF=%, $$(part)), \
$$(eval COMPARE_BUILD_CONF = $$(strip $$(subst +, , $$(patsubst CONF=%, %, $$(part))))) \
) \
$$(if $$(filter MAKE=%, $$(part)), \
$$(eval COMPARE_BUILD_MAKE = $$(strip $$(subst +, , $$(patsubst MAKE=%, %, $$(part))))) \
) \
$$(if $$(filter COMP_OPTS=%, $$(part)), \
$$(eval COMPARE_BUILD_COMP_OPTS = $$(strip $$(subst +, , $$(patsubst COMP_OPTS=%, %, $$(part))))) \
) \
$$(if $$(filter COMP_DIR=%, $$(part)), \
$$(eval COMPARE_BUILD_COMP_DIR = $$(strip $$(subst +, , $$(patsubst COMP_DIR=%, %, $$(part))))) \
) \
$$(if $$(filter FAIL=%, $$(part)), \
$$(eval COMPARE_BUILD_FAIL = $$(strip $$(subst +, , $$(patsubst FAIL=%, %, $$(part))))) \
) \
$$(if $$(filter NODRYRUN=%, $$(part)), \
$$(eval COMPARE_BUILD_NODRYRUN = $$(strip $$(subst +, , $$(patsubst NODRYRUN=%, %, $$(part))))) \
) \
)
else
# Separate handling for single field case, to allow for spaces in values.
ifneq ($$(filter PATCH=%, $$(COMPARE_BUILD)), )
COMPARE_BUILD_PATCH = $$(strip $$(patsubst PATCH=%, %, $$(COMPARE_BUILD)))
else ifneq ($$(filter CONF=%, $$(COMPARE_BUILD)), )
COMPARE_BUILD_CONF = $$(strip $$(subst +, , $$(patsubst CONF=%, %, $$(COMPARE_BUILD))))
else ifneq ($$(filter --%, $$(COMPARE_BUILD)), )
# Assume CONF if value begins with --
COMPARE_BUILD_CONF = $$(strip $$(subst +, , $$(COMPARE_BUILD)))
else
# Otherwise assume patch file
COMPARE_BUILD_PATCH = $$(strip $$(COMPARE_BUILD))
endif
endif
ifneq ($$(COMPARE_BUILD_PATCH), )
ifneq ($$(wildcard $$(topdir)/$$(COMPARE_BUILD_PATCH)), )
# Assume relative path, if file exists
COMPARE_BUILD_PATCH := $$(wildcard $$(topdir)/$$(COMPARE_BUILD_PATCH))
else ifeq ($$(wildcard $$(COMPARE_BUILD_PATCH)), )
$$(error Patch file $$(COMPARE_BUILD_PATCH) does not exist)
endif
ifneq ($$(COMPARE_BUILD_NODRYRUN), true)
PATCH_DRY_RUN := $$(shell cd $$(topdir) && $$(PATCH) --dry-run -p1 < $$(COMPARE_BUILD_PATCH) > /dev/null 2>&1 || $$(ECHO) FAILED)
ifeq ($$(PATCH_DRY_RUN), FAILED)
$$(error Patch file $$(COMPARE_BUILD_PATCH) does not apply cleanly)
endif
endif
endif
ifneq ($$(COMPARE_BUILD_FAIL), true)
COMPARE_BUILD_IGNORE_RESULT := || true
endif
endif
endef
# Prepare for a comparison rebuild
define PrepareCompareBuild
# Prepare for a comparison rebuild
define PrepareCompareBuild
$(ECHO) "Preparing for comparison rebuild"
# Apply patch, if any
$(if $(COMPARE_BUILD_PATCH), cd $(topdir) && $(PATCH) -p1 < $(COMPARE_BUILD_PATCH))
@@ -425,10 +144,10 @@ else # $(HAS_SPEC)=true
# must be done after patching.
( cd $(CONFIGURE_START_DIR) && PATH="$(ORIGINAL_PATH)" \
$(BASH) $(topdir)/configure $(CONFIGURE_COMMAND_LINE) $(COMPARE_BUILD_CONF))
endef
endef
# Cleanup after a compare build
define CleanupCompareBuild
# Cleanup after a compare build
define CleanupCompareBuild
# 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)
@@ -437,10 +156,10 @@ else # $(HAS_SPEC)=true
$(MV) $(OUTPUTDIR) $(COMPARE_BUILD_OUTPUTDIR)
$(MV) $(topdir)/build/.compare-build-temp/$(CONF_NAME) $(OUTPUTDIR)
$(RM) -r $(topdir)/build/.compare-build-temp
endef
endef
# Do the actual comparison of two builds
define CompareBuildDoComparison
# Do the actual comparison of two builds
define CompareBuildDoComparison
# Compare first and second build. Ignore any error code from compare.sh.
$(ECHO) "Comparing between comparison rebuild (this/new) and baseline (other/old)"
$(if $(COMPARE_BUILD_COMP_DIR), \
@@ -450,9 +169,9 @@ else # $(HAS_SPEC)=true
+(cd $(COMPARE_BUILD_OUTPUTDIR) && ./compare.sh --diffs $(COMPARE_BUILD_COMP_OPTS) \
-o $(OUTPUTDIR) $(COMPARE_BUILD_IGNORE_RESULT)) \
)
endef
endef
define PrintFailureReports
define PrintFailureReports
$(if $(filter none, $(LOG_REPORT)), , \
$(RM) $(MAKESUPPORT_OUTPUTDIR)/failure-summary.log ; \
$(if $(wildcard $(MAKESUPPORT_OUTPUTDIR)/failure-logs/*.log), \
@@ -474,9 +193,9 @@ else # $(HAS_SPEC)=true
) >> $(MAKESUPPORT_OUTPUTDIR)/failure-summary.log \
) \
)
endef
endef
define PrintBuildLogFailures
define PrintBuildLogFailures
$(if $(filter none, $(LOG_REPORT)), , \
if $(GREP) -q "recipe for target .* failed" $(BUILD_LOG) 2> /dev/null; then \
$(PRINTF) "\n=== Make failed targets repeated here ===\n" ; \
@@ -489,96 +208,96 @@ else # $(HAS_SPEC)=true
fi >> $(MAKESUPPORT_OUTPUTDIR)/failure-summary.log ; \
$(CAT) $(MAKESUPPORT_OUTPUTDIR)/failure-summary.log \
)
endef
endef
define RotateLogFiles
define RotateLogFiles
$(RM) $(BUILD_LOG).old 2> /dev/null && \
$(MV) $(BUILD_LOG) $(BUILD_LOG).old 2> /dev/null || true
$(if $(findstring true, $(LOG_PROFILE_TIMES_FILE)), \
$(RM) $(BUILD_PROFILE_LOG).old 2> /dev/null && \
$(MV) $(BUILD_PROFILE_LOG) $(BUILD_PROFILE_LOG).old 2> /dev/null || true \
)
endef
endef
# Failure logs are only supported for "parallel" main targets, not the
# (trivial) sequential make targets (such as clean and reconfigure),
# since the failure-logs directory creation will conflict with clean.
# We also make sure the javatmp directory exists, which is needed if a java
# process (like javac) is using java.io.tmpdir.
define PrepareFailureLogs
# Failure logs are only supported for "parallel" main targets, not the
# (trivial) sequential make targets (such as clean and reconfigure),
# since the failure-logs directory creation will conflict with clean.
# We also make sure the javatmp directory exists, which is needed if a java
# process (like javac) is using java.io.tmpdir.
define PrepareFailureLogs
$(RM) -r $(MAKESUPPORT_OUTPUTDIR)/failure-logs 2> /dev/null && \
$(MKDIR) -p $(MAKESUPPORT_OUTPUTDIR)/failure-logs
$(MKDIR) -p $(JAVA_TMP_DIR)
$(RM) $(MAKESUPPORT_OUTPUTDIR)/exit-with-error 2> /dev/null
endef
endef
# Remove any javac server logs and port files. This
# prevents a new make run to reuse the previous servers.
define PrepareJavacServer
# Remove any javac server logs and port files. This
# prevents a new make run to reuse the previous servers.
define PrepareJavacServer
$(if $(JAVAC_SERVER_DIR), \
$(RM) -r $(JAVAC_SERVER_DIR) 2> /dev/null && \
$(MKDIR) -p $(JAVAC_SERVER_DIR) \
)
endef
endef
define CleanupJavacServer
define CleanupJavacServer
[ -f $(JAVAC_SERVER_DIR)/server.port ] && $(ECHO) Stopping javac server && \
$(TOUCH) $(JAVAC_SERVER_DIR)/server.port.stop; true
endef
endef
ifeq ($(call isBuildOs, windows), true)
# On windows we need to synchronize with the javac server to be able to
# move or remove the build output directory. Since we have no proper
# synchronization process, wait for a while and hope it helps. This is only
# used by build comparisons.
ifeq ($(call isBuildOs, windows), true)
# On windows we need to synchronize with the javac server to be able to
# move or remove the build output directory. Since we have no proper
# synchronization process, wait for a while and hope it helps. This is only
# used by build comparisons.
define WaitForJavacServerFinish
$(if $(JAVAC_SERVER_DIR), \
sleep 5 \
)
endef
else
define WaitForJavacServerFinish
endef
endif
endef
else
define WaitForJavacServerFinish
endef
endif
##############################################################################
# Functions for timers
##############################################################################
##############################################################################
# Functions for timers
##############################################################################
# Store the build times in this directory.
BUILDTIMESDIR = $(OUTPUTDIR)/make-support/build-times
# Store the build times in this directory.
BUILDTIMESDIR = $(OUTPUTDIR)/make-support/build-times
# Record starting time for build of a sub repository.
define RecordStartTime
# Record starting time for build of a sub repository.
define RecordStartTime
$(DATE) '+%Y %m %d %H %M %S' | $(AWK) '{ print $$1,$$2,$$3,$$4,$$5,$$6,($$4*3600+$$5*60+$$6) }' > $(BUILDTIMESDIR)/build_time_start_$(strip $1) && \
$(DATE) '+%Y-%m-%d %H:%M:%S' > $(BUILDTIMESDIR)/build_time_start_$(strip $1)_human_readable
endef
endef
# Record ending time and calculate the difference and store it in a
# easy to read format. Handles builds that cross midnight. Expects
# that a build will never take 24 hours or more.
define RecordEndTime
# Record ending time and calculate the difference and store it in a
# easy to read format. Handles builds that cross midnight. Expects
# that a build will never take 24 hours or more.
define RecordEndTime
$(DATE) '+%Y %m %d %H %M %S' | $(AWK) '{ print $$1,$$2,$$3,$$4,$$5,$$6,($$4*3600+$$5*60+$$6) }' > $(BUILDTIMESDIR)/build_time_end_$(strip $1)
$(DATE) '+%Y-%m-%d %H:%M:%S' > $(BUILDTIMESDIR)/build_time_end_$(strip $1)_human_readable
$(ECHO) `$(CAT) $(BUILDTIMESDIR)/build_time_start_$(strip $1)` `$(CAT) $(BUILDTIMESDIR)/build_time_end_$(strip $1)` $1 | \
$(AWK) '{ F=$$7; T=$$14; if (F > T) { T+=3600*24 }; D=T-F; H=int(D/3600); \
M=int((D-H*3600)/60); S=D-H*3600-M*60; printf("%02d:%02d:%02d %s\n",H,M,S,$$15); }' \
> $(BUILDTIMESDIR)/build_time_diff_$(strip $1)
endef
endef
define StartGlobalTimer
define StartGlobalTimer
$(RM) -r $(BUILDTIMESDIR) 2> /dev/null && \
$(MKDIR) -p $(BUILDTIMESDIR) && \
$(call RecordStartTime,TOTAL)
endef
endef
define StopGlobalTimer
define StopGlobalTimer
$(call RecordEndTime,TOTAL)
endef
endef
# Find all build_time_* files and print their contents in a list sorted
# on the name of the sub repository.
define ReportBuildTimes
# Find all build_time_* files and print their contents in a list sorted
# on the name of the sub repository.
define ReportBuildTimes
$(PRINTF) $(LOG_INFO) -- \
"----- Build times -------\nStart %s\nEnd %s\n%s\n%s\n-------------------------\n" \
"`$(CAT) $(BUILDTIMESDIR)/build_time_start_TOTAL_human_readable`" \
@@ -587,119 +306,15 @@ else # $(HAS_SPEC)=true
$(XARGS) $(CAT) | $(SORT) -k 2`" \
"`$(CAT) $(BUILDTIMESDIR)/build_time_diff_TOTAL`" \
$(BUILD_LOG_PIPE_SIMPLE)
endef
define ReportProfileTimes
$(if $(findstring true, $(LOG_PROFILE_TIMES_LOG)), \
[ ! -f $(BUILD_PROFILE_LOG) ] || \
{ $(ECHO) Begin $(notdir $(BUILD_PROFILE_LOG)) && \
$(CAT) $(BUILD_PROFILE_LOG) && \
$(ECHO) End $(notdir $(BUILD_PROFILE_LOG)); \
} \
$(BUILD_LOG_PIPE_SIMPLE)
)
endef
endif # HAS_SPEC
# Look for a given option in the LOG variable, and if found, set a variable
# and remove the option from the LOG variable
# $1: The option to look for
# $2: The variable to set to "true" if the option is found
define ParseLogOption
ifneq ($$(findstring $1, $$(LOG)), )
override $2 := true
# First try to remove ",<option>" if it exists, otherwise just remove "<option>"
LOG_STRIPPED := $$(subst $1,, $$(subst $$(COMMA)$$(strip $1),, $$(LOG)))
# We might have ended up with a leading comma. Remove it. Need override
# since LOG is set from the command line.
override LOG := $$(strip $$(patsubst $$(COMMA)%, %, $$(LOG_STRIPPED)))
endif
endef
# Look for a given option with an assignment in the LOG variable, and if found,
# set a variable to that value and remove the option from the LOG variable
# $1: The option to look for
# $2: The variable to set to the value of the option, if found
define ParseLogValue
ifneq ($$(findstring $1=, $$(LOG)), )
# Make words of out comma-separated list and find the one with opt=val
value := $$(strip $$(subst $$(strip $1)=,, $$(filter $$(strip $1)=%, $$(subst $$(COMMA), , $$(LOG)))))
override $2 := $$(value)
# First try to remove ",<option>" if it exists, otherwise just remove "<option>"
LOG_STRIPPED := $$(subst $$(strip $1)=$$(value),, \
$$(subst $$(COMMA)$$(strip $1)=$$(value),, $$(LOG)))
# We might have ended up with a leading comma. Remove it. Need override
# since LOG is set from the command line.
override LOG := $$(strip $$(patsubst $$(COMMA)%, %, $$(LOG_STRIPPED)))
endif
define ReportProfileTimes
$(if $(findstring true, $(LOG_PROFILE_TIMES_LOG)), \
[ ! -f $(BUILD_PROFILE_LOG) ] || \
{ $(ECHO) Begin $(notdir $(BUILD_PROFILE_LOG)) && \
$(CAT) $(BUILD_PROFILE_LOG) && \
$(ECHO) End $(notdir $(BUILD_PROFILE_LOG)); \
} \
$(BUILD_LOG_PIPE_SIMPLE)
)
endef
define ParseLogLevel
# Catch old-style VERBOSE= command lines.
ifneq ($$(origin VERBOSE), undefined)
$$(info Error: VERBOSE is deprecated. Use LOG=<warn|info|debug|trace> instead.)
$$(error Cannot continue)
endif
# Setup logging according to LOG
# If "nofile" is present, do not log to a file
$$(eval $$(call ParseLogOption, nofile, LOG_NOFILE))
# If "cmdline" is present, print all executes "important" command lines.
$$(eval $$(call ParseLogOption, cmdlines, LOG_CMDLINES))
# If "report" is present, use non-standard reporting options at build failure.
$$(eval $$(call ParseLogValue, report, LOG_REPORT))
ifneq ($$(LOG_REPORT), )
ifeq ($$(filter $$(LOG_REPORT), none all default), )
$$(info Error: LOG=report has invalid value: $$(LOG_REPORT).)
$$(info Valid values: LOG=report=<none>|<all>|<default>)
$$(error Cannot continue)
endif
endif
# If "profile-to-log" is present, write shell times in build log
$$(eval $$(call ParseLogOption, profile-to-log, LOG_PROFILE_TIMES_LOG))
# If "profile" is present, write shell times in separate log file
# IMPORTANT: $(ParseLogOption profile-to-log) should go first. Otherwise
# parsing of 'LOG=debug,profile-to-log,nofile' ends up in the following error:
# Error: LOG contains unknown option or log level: debug-to-log.
$$(eval $$(call ParseLogOption, profile, LOG_PROFILE_TIMES_FILE))
# Treat LOG=profile-to-log as if it were LOG=profile,profile-to-log
LOG_PROFILE_TIMES_FILE := $$(firstword $$(LOG_PROFILE_TIMES_FILE) $$(LOG_PROFILE_TIMES_LOG))
override LOG_LEVEL := $$(LOG)
ifeq ($$(LOG_LEVEL), )
# Set LOG to "warn" as default if not set
override LOG_LEVEL := warn
endif
ifeq ($$(LOG_LEVEL), warn)
override MAKE_LOG_FLAGS := -s
else ifeq ($$(LOG_LEVEL), info)
override MAKE_LOG_FLAGS := -s
else ifeq ($$(LOG_LEVEL), debug)
override MAKE_LOG_FLAGS :=
else ifeq ($$(LOG_LEVEL), trace)
override MAKE_LOG_FLAGS :=
else
$$(info Error: LOG contains unknown option or log level: $$(LOG).)
$$(info LOG can be <level>[,<opt>[...]] where <opt> is nofile | cmdlines | profile | profile-to-log)
$$(info and <level> is warn | info | debug | trace)
$$(error Cannot continue)
endif
endef
MAKE_LOG_VARS = $(foreach v, \
LOG_LEVEL LOG_NOFILE LOG_CMDLINES LOG_REPORT LOG_PROFILE_TIMES_LOG \
LOG_PROFILE_TIMES_FILE, \
$v=$($v) \
)
endif # _INITSUPPORT_GMK

215
make/PreInit.gmk Normal file
View File

@@ -0,0 +1,215 @@
#
# Copyright (c) 2012, 2025, 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 is the earliest part of the build bootstrap process (not counting
# Makefile that includes it). Its main responsibility is to figure out what
# configuration to use and pick up the corresponding SPEC file. It will then
# call Init.gmk with this SPEC for further bootstrapping.
################################################################################
# This must be the first rule
default:
.PHONY: default
# Inclusion of this pseudo-target will cause make to execute this file
# serially, regardless of -j.
.NOTPARALLEL:
# Include our helper functions.
include $(topdir)/make/PreInitSupport.gmk
include $(topdir)/make/common/LogUtils.gmk
# Here are "global" targets, i.e. targets that can be executed without having
# a configuration. This will define ALL_GLOBAL_TARGETS.
include $(topdir)/make/Global.gmk
# CALLED_TARGETS is the list of targets that the user provided,
# or "default" if unspecified.
CALLED_TARGETS := $(if $(MAKECMDGOALS), $(MAKECMDGOALS), default)
# Extract non-global targets that require a spec file.
CALLED_SPEC_TARGETS := $(filter-out $(ALL_GLOBAL_TARGETS), $(CALLED_TARGETS))
# If we have only global targets, or if we are called with -qp (assuming an
# external part, e.g. bash completion, is trying to understand our targets),
# we will skip SPEC location and the sanity checks.
ifeq ($(CALLED_SPEC_TARGETS), )
SKIP_SPEC := true
endif
ifeq ($(findstring p, $(MAKEFLAGS))$(findstring q, $(MAKEFLAGS)), pq)
SKIP_SPEC := true
endif
ifneq ($(SKIP_SPEC), true)
############################################################################
# This is the common case: we have been called from the command line by the
# user with a target that should be delegated to Main.gmk, so we need to
# figure out a proper SPEC and call Init.gmk with it.
############################################################################
# Basic checks on environment and command line.
$(eval $(call CheckControlVariables))
$(eval $(call CheckDeprecatedEnvironment))
$(eval $(call CheckInvalidMakeFlags))
# Check that CONF_CHECK is valid.
$(eval $(call ParseConfCheckOption))
# Check that the LOG given is valid, and set LOG_LEVEL, LOG_NOFILE, MAKE_LOG_VARS and MAKE_LOG_FLAGS.
$(eval $(call ParseLogLevel))
# After this SPECS contain 1..N spec files (otherwise ParseConfAndSpec fails).
$(eval $(call ParseConfAndSpec))
# Extract main targets from Main.gmk using the spec(s) provided. In theory,
# with multiple specs, we should find the intersection of targets provided
# by all specs, but we approximate this by an arbitrary spec from the list.
# This will setup ALL_MAIN_TARGETS.
$(eval $(call DefineMainTargets, FORCE, $(firstword $(SPECS))))
# Targets provided by Init.gmk.
ALL_INIT_TARGETS := print-modules print-targets print-configuration \
print-tests reconfigure pre-compare-build post-compare-build
# Separate called targets depending on type.
INIT_TARGETS := $(filter $(ALL_INIT_TARGETS), $(CALLED_SPEC_TARGETS))
MAIN_TARGETS := $(filter $(ALL_MAIN_TARGETS), $(CALLED_SPEC_TARGETS))
SEQUENTIAL_TARGETS := $(filter dist-clean clean%, $(MAIN_TARGETS))
PARALLEL_TARGETS := $(filter-out $(SEQUENTIAL_TARGETS), $(MAIN_TARGETS))
# The spec files depend on the autoconf source code. This check makes sure
# the configuration is up to date after changes to configure.
$(SPECS): $(wildcard $(topdir)/make/autoconf/*) \
$(if $(CUSTOM_CONFIG_DIR), $(wildcard $(CUSTOM_CONFIG_DIR)/*)) \
$(addprefix $(topdir)/make/conf/, version-numbers.conf branding.conf) \
$(if $(CUSTOM_CONF_DIR), $(wildcard $(addprefix $(CUSTOM_CONF_DIR)/, \
version-numbers.conf branding.conf)))
ifeq ($(CONF_CHECK), fail)
@echo Error: The configuration is not up to date for \
"'$(lastword $(subst /, , $(dir $@)))'."
$(call PrintConfCheckFailed)
@exit 2
else ifeq ($(CONF_CHECK), auto)
@echo Note: The configuration is not up to date for \
"'$(lastword $(subst /, , $(dir $@)))'."
@( cd $(topdir) && \
$(MAKE) $(MFLAGS) $(MAKE_LOG_FLAGS) -r -R -f $(topdir)/make/Init.gmk \
SPEC=$@ HAS_SPEC=true ACTUAL_TOPDIR=$(topdir) \
reconfigure )
else ifeq ($(CONF_CHECK), ignore)
# Do nothing
endif
# Do not let make delete spec files even if aborted while doing a reconfigure
.PRECIOUS: $(SPECS)
# Unless reconfigure is explicitly called, let all main targets depend on
# the spec files to be up to date.
ifeq ($(findstring reconfigure, $(INIT_TARGETS)), )
$(MAIN_TARGETS): $(SPECS)
endif
make-info:
ifneq ($(findstring $(LOG_LEVEL), info debug trace), )
$(info Running make as '$(strip $(MAKE) $(MFLAGS) \
$(COMMAND_LINE_VARIABLES) $(MAKECMDGOALS))')
endif
MAKE_INIT_WITH_SPEC_ARGUMENTS := ACTUAL_TOPDIR=$(topdir) \
USER_MAKE_VARS="$(USER_MAKE_VARS)" MAKE_LOG_FLAGS=$(MAKE_LOG_FLAGS) \
$(MAKE_LOG_VARS) \
INIT_TARGETS="$(INIT_TARGETS)" \
SEQUENTIAL_TARGETS="$(SEQUENTIAL_TARGETS)" \
PARALLEL_TARGETS="$(PARALLEL_TARGETS)"
# Now the init and main targets will be called, once for each SPEC. The
# recipe will be run once for every target specified, but we only want to
# execute the recipe a single time, hence the TARGET_DONE with a dummy
# command if true.
# The COMPARE_BUILD part implements special support for makefile development.
$(ALL_INIT_TARGETS) $(ALL_MAIN_TARGETS): make-info
@$(if $(TARGET_DONE), \
true \
, \
( cd $(topdir) && \
$(foreach spec, $(SPECS), \
$(MAKE) $(MFLAGS) $(MAKE_LOG_FLAGS) -r -R -j 1 -f $(topdir)/make/Init.gmk \
SPEC=$(spec) HAS_SPEC=true $(MAKE_INIT_WITH_SPEC_ARGUMENTS) \
main && \
$(if $(and $(COMPARE_BUILD), $(PARALLEL_TARGETS)), \
$(MAKE) $(MFLAGS) $(MAKE_LOG_FLAGS) -r -R -f $(topdir)/make/Init.gmk \
SPEC=$(spec) HAS_SPEC=true ACTUAL_TOPDIR=$(topdir) \
COMPARE_BUILD="$(COMPARE_BUILD)" pre-compare-build && \
$(MAKE) $(MFLAGS) $(MAKE_LOG_FLAGS) -r -R -j 1 -f $(topdir)/make/Init.gmk \
SPEC=$(spec) HAS_SPEC=true $(MAKE_INIT_WITH_SPEC_ARGUMENTS) \
COMPARE_BUILD="$(COMPARE_BUILD):NODRYRUN=true" main && \
$(MAKE) $(MFLAGS) $(MAKE_LOG_FLAGS) -r -R -f $(topdir)/make/Init.gmk \
SPEC=$(spec) HAS_SPEC=true ACTUAL_TOPDIR=$(topdir) \
COMPARE_BUILD="$(COMPARE_BUILD):NODRYRUN=true" post-compare-build && \
) \
) true ) \
$(eval TARGET_DONE=true) \
)
.PHONY: $(ALL_MAIN_TARGETS) $(ALL_INIT_TARGETS)
else # SKIP_SPEC=true
############################################################################
# We have only global targets, or are called with -pq (from command
# completion). In this case we might not even have a configuration at all, but
# still need to handle the situation gracefully even if there is no SPEC file.
############################################################################
ifeq ($(wildcard $(SPEC)), )
# If we have no SPEC provided, we will just make a "best effort" target list.
# First try to grab any available pre-existing main-targets.gmk.
main_targets_file := $(firstword $(wildcard $(build_dir)/*/make-support/main-targets.gmk))
ifneq ($(main_targets_file), )
# Extract the SPEC that corresponds to this main-targets.gmk file.
SPEC := $(patsubst %/make-support/main-targets.gmk, %/spec.gmk, $(main_targets_file))
else
# None found, pick an arbitrary SPEC for which to generate a file
SPEC := $(firstword $(all_spec_files))
endif
endif
ifneq ($(wildcard $(SPEC)), )
$(eval $(call DefineMainTargets, LAZY, $(SPEC)))
else
# If we have no configurations we can not provide any main targets.
ALL_MAIN_TARGETS :=
endif
ALL_TARGETS := $(sort $(ALL_GLOBAL_TARGETS) $(ALL_MAIN_TARGETS) $(ALL_INIT_TARGETS))
# Just list all our targets.
$(ALL_TARGETS):
.PHONY: $(ALL_TARGETS)
endif # $(SKIP_SPEC)!=true

297
make/PreInitSupport.gmk Normal file
View File

@@ -0,0 +1,297 @@
#
# Copyright (c) 2011, 2025, 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.
#
##############################################################################
# Helper functions for PreInit.gmk, the initial part of initialization before
# the SPEC file is loaded. Most of these functions provide parsing and setting
# up make options from the command-line.
##############################################################################
# COMMA is defined in spec.gmk, but that is not included yet
COMMA := ,
# Include the corresponding closed file, if present.
ifneq ($(CUSTOM_MAKE_DIR), )
-include $(CUSTOM_MAKE_DIR)/InitSupport.gmk
endif
# Essential control variables that are handled by PreInit.gmk or Init.gmk
INIT_CONTROL_VARIABLES := LOG CONF CONF_NAME SPEC JOBS CONF_CHECK ALLOW \
COMPARE_BUILD
# All known make control variables; these are handled in other makefiles
MAKE_CONTROL_VARIABLES += JDK_FILTER SPEC_FILTER \
TEST TEST_JOBS JTREG GTEST MICRO TEST_OPTS TEST_VM_OPTS TEST_DEPS
ALL_CONTROL_VARIABLES := $(INIT_CONTROL_VARIABLES) $(MAKE_CONTROL_VARIABLES)
# Define a simple reverse function.
# Should maybe move to MakeBase.gmk, but we can't include that file now.
reverse = \
$(if $(strip $(1)), $(call reverse, $(wordlist 2, $(words $(1)), $(1)))) \
$(firstword $(1))
# The variable MAKEOVERRIDES contains variable assignments from the command
# line, but in reverse order to what the user entered.
# The '§' <=> '\ 'dance is needed to keep values with space in them connected.
COMMAND_LINE_VARIABLES := $(subst §,\ , $(call reverse, $(subst \ ,§,$(MAKEOVERRIDES))))
# A list like FOO="val1" BAR="val2" containing all user-supplied make
# variables that we should propagate.
# The '§' <=> '\ 'dance is needed to keep values with space in them connected.
# This explicit propagation is needed to avoid problems with characters that needs
# escaping.
USER_MAKE_VARS := $(subst §,\ , $(filter-out $(addsuffix =%, $(ALL_CONTROL_VARIABLES)), \
$(subst \ ,§,$(MAKEOVERRIDES))))
# Setup information about available configurations, if any.
ifneq ($(CUSTOM_ROOT), )
build_dir = $(CUSTOM_ROOT)/build
else
build_dir = $(topdir)/build
endif
all_spec_files = $(wildcard $(build_dir)/*/spec.gmk)
# Extract the configuration names from the path
all_confs = $(patsubst %/spec.gmk, %, $(patsubst $(build_dir)/%, %, $(all_spec_files)))
# Check for unknown command-line variables
define CheckControlVariables
command_line_variables := $$(strip $$(foreach var, \
$$(subst \ ,_,$$(MAKEOVERRIDES)), \
$$(firstword $$(subst =, , $$(var)))))
allowed_command_line_variables := $$(strip $$(subst $$(COMMA), , $$(ALLOW)))
unknown_command_line_variables := $$(strip \
$$(filter-out $$(ALL_CONTROL_VARIABLES) $$(allowed_command_line_variables), \
$$(command_line_variables)))
ifneq ($$(unknown_command_line_variables), )
$$(info Note: Command line contains non-control variables:)
$$(foreach var, $$(unknown_command_line_variables), $$(info * $$(var)=$$($$(var))))
$$(info Make sure it is not mistyped, and that you intend to override this variable.)
$$(info 'make help' will list known control variables.)
$$(info )
endif
endef
# Check for deprecated ALT_ variables
define CheckDeprecatedEnvironment
defined_alt_variables := $$(filter ALT_%, $$(.VARIABLES))
ifneq ($$(defined_alt_variables), )
$$(info Warning: You have the following ALT_ variables set:)
$$(foreach var, $$(defined_alt_variables), $$(info * $$(var)=$$($$(var))))
$$(info ALT_ variables are deprecated, and may result in a failed build.)
$$(info Please clean your environment.)
$$(info )
endif
endef
# Check for invalid make flags like -j
define CheckInvalidMakeFlags
# This is a trick to get this rule to execute before any other rules
# MAKEFLAGS only indicate -j if read in a recipe (!)
$$(topdir)/make/PreInit.gmk: .FORCE
$$(if $$(findstring --jobserver, $$(MAKEFLAGS)), \
$$(info Error: 'make -jN' is not supported, use 'make JOBS=N') \
$$(error Cannot continue) \
)
.FORCE:
.PHONY: .FORCE
endef
# Check that the CONF_CHECK option is valid and set up handling
define ParseConfCheckOption
ifeq ($$(CONF_CHECK), )
# Default behavior is fail
CONF_CHECK := fail
else ifneq ($$(filter-out auto fail ignore, $$(CONF_CHECK)), )
$$(info Error: CONF_CHECK must be one of: auto, fail or ignore.)
$$(error Cannot continue)
endif
endef
define ParseConfAndSpec
ifneq ($$(origin SPEC), undefined)
# We have been given a SPEC, check that it works out properly
ifneq ($$(origin CONF), undefined)
# We also have a CONF argument. We can't have both.
$$(info Error: Cannot use CONF=$$(CONF) and SPEC=$$(SPEC) at the same time. Choose one.)
$$(error Cannot continue)
endif
ifneq ($$(origin CONF_NAME), undefined)
# We also have a CONF_NAME argument. We can't have both.
$$(info Error: Cannot use CONF_NAME=$$(CONF_NAME) and SPEC=$$(SPEC) at the same time. Choose one.)
$$(error Cannot continue)
endif
ifeq ($$(wildcard $$(SPEC)), )
$$(info Error: Cannot locate spec.gmk, given by SPEC=$$(SPEC).)
$$(error Cannot continue)
endif
ifeq ($$(filter /%, $$(SPEC)), )
# If given with relative path, make it absolute
SPECS := $$(CURDIR)/$$(strip $$(SPEC))
else
SPECS := $$(SPEC)
endif
# For now, unset this SPEC variable.
override SPEC :=
else
# Use spec.gmk files in the build output directory
ifeq ($$(all_spec_files), )
ifneq ($(CUSTOM_ROOT), )
$$(info Error: No configurations found for $$(CUSTOM_ROOT).)
else
$$(info Error: No configurations found for $$(topdir).)
endif
$$(info Please run 'bash configure' to create a configuration.)
$$(info )
$$(error Cannot continue)
endif
ifneq ($$(origin CONF_NAME), undefined)
ifneq ($$(origin CONF), undefined)
# We also have a CONF argument. We can't have both.
$$(info Error: Cannot use CONF=$$(CONF) and CONF_NAME=$$(CONF_NAME) at the same time. Choose one.)
$$(error Cannot continue)
endif
matching_conf := $$(strip $$(filter $$(CONF_NAME), $$(all_confs)))
ifeq ($$(matching_conf), )
$$(info Error: No configurations found matching CONF_NAME=$$(CONF_NAME).)
$$(info Available configurations in $$(build_dir):)
$$(foreach var, $$(all_confs), $$(info * $$(var)))
$$(error Cannot continue)
else ifneq ($$(words $$(matching_conf)), 1)
$$(info Error: Matching more than one configuration CONF_NAME=$$(CONF_NAME).)
$$(info Available configurations in $$(build_dir):)
$$(foreach var, $$(all_confs), $$(info * $$(var)))
$$(error Cannot continue)
else
$$(info Building configuration '$$(matching_conf)' (matching CONF_NAME=$$(CONF_NAME)))
endif
# Create a SPEC definition. This will contain the path to exactly one spec file.
SPECS := $$(build_dir)/$$(matching_conf)/spec.gmk
else ifneq ($$(origin CONF), undefined)
# User have given a CONF= argument.
ifeq ($$(CONF), )
# If given CONF=, match all configurations
matching_confs := $$(strip $$(all_confs))
else
# Otherwise select those that contain the given CONF string
ifeq ($$(patsubst !%,,$$(CONF)), )
# A CONF starting with ! means we should negate the search term
matching_confs := $$(strip $$(foreach var, $$(all_confs), \
$$(if $$(findstring $$(subst !,,$$(CONF)), $$(var)), ,$$(var))))
else
matching_confs := $$(strip $$(foreach var, $$(all_confs), \
$$(if $$(findstring $$(CONF), $$(var)), $$(var))))
endif
ifneq ($$(filter $$(CONF), $$(matching_confs)), )
ifneq ($$(word 2, $$(matching_confs)), )
# Don't repeat this output on make restarts caused by including
# generated files.
ifeq ($$(MAKE_RESTARTS), )
$$(info Using exact match for CONF=$$(CONF) (other matches are possible))
endif
endif
# If we found an exact match, use that
matching_confs := $$(CONF)
endif
endif
ifeq ($$(matching_confs), )
$$(info Error: No configurations found matching CONF=$$(CONF).)
$$(info Available configurations in $$(build_dir):)
$$(foreach var, $$(all_confs), $$(info * $$(var)))
$$(error Cannot continue)
else
# Don't repeat this output on make restarts caused by including
# generated files.
ifeq ($$(MAKE_RESTARTS), )
ifeq ($$(words $$(matching_confs)), 1)
ifneq ($$(findstring $$(LOG_LEVEL), info debug trace), )
$$(info Building configuration '$$(matching_confs)' (matching CONF=$$(CONF)))
endif
else
$$(info Building these configurations (matching CONF=$$(CONF)):)
$$(foreach var, $$(matching_confs), $$(info * $$(var)))
endif
endif
endif
# Create a SPEC definition. This will contain the path to one or more spec.gmk files.
SPECS := $$(addsuffix /spec.gmk, $$(addprefix $$(build_dir)/, $$(matching_confs)))
else
# No CONF or SPEC given, check the available configurations
ifneq ($$(words $$(all_spec_files)), 1)
$$(info Error: No CONF given, but more than one configuration found.)
$$(info Available configurations in $$(build_dir):)
$$(foreach var, $$(all_confs), $$(info * $$(var)))
$$(info Please retry building with CONF=<config pattern> (or SPEC=<spec file>).)
$$(info )
$$(error Cannot continue)
endif
# We found exactly one configuration, use it
SPECS := $$(strip $$(all_spec_files))
endif
endif
endef
# Extract main targets from Main.gmk using the spec provided in $2.
#
# Param 1: FORCE = force generation of main-targets.gmk or LAZY = do not force.
# Param 2: The SPEC file to use.
define DefineMainTargets
# We will start by making sure the main-targets.gmk file is removed, if
# make has not been restarted. By the -include, we will trigger the
# rule for generating the file (which is never there since we removed it),
# thus generating it fresh, and make will restart, incrementing the restart
# count.
main_targets_file := $$(dir $(strip $2))make-support/main-targets.gmk
ifeq ($$(MAKE_RESTARTS), )
# Only do this if make has not been restarted, and if we do not force it.
ifeq ($(strip $1), FORCE)
$$(shell rm -f $$(main_targets_file))
endif
endif
$$(main_targets_file):
@( cd $$(topdir) && \
$$(MAKE) $$(MAKE_LOG_FLAGS) -r -R -f $$(topdir)/make/Main.gmk \
-I $$(topdir)/make/common SPEC=$(strip $2) NO_RECIPES=true \
$$(MAKE_LOG_VARS) \
create-main-targets-include )
# Now include main-targets.gmk. This will define ALL_MAIN_TARGETS.
-include $$(main_targets_file)
endef
define PrintConfCheckFailed
@echo ' '
@echo "Please rerun configure! Easiest way to do this is by running"
@echo "'make reconfigure'."
@echo "This behavior may also be changed using CONF_CHECK=<ignore|auto>."
@echo ' '
endef

View File

@@ -78,6 +78,9 @@ $(eval $(call IncludeCustomExtension, RunTests.gmk))
# This is the JDK that we will test
JDK_UNDER_TEST := $(JDK_IMAGE_DIR)
# The JDK used to compile jtreg test code. By default it is the same as
# JDK_UNDER_TEST.
JDK_FOR_COMPILE := $(JDK_IMAGE_DIR)
TEST_RESULTS_DIR := $(OUTPUTDIR)/test-results
TEST_SUPPORT_DIR := $(OUTPUTDIR)/test-support
@@ -979,6 +982,7 @@ define SetupRunJtregTestBody
$$(JTREG_JAVA) $$($1_JTREG_LAUNCHER_OPTIONS) \
-Dprogram=jtreg -jar $$(JT_HOME)/lib/jtreg.jar \
$$($1_JTREG_BASIC_OPTIONS) \
-compilejdk:$$(JDK_FOR_COMPILE) \
-testjdk:$$(JDK_UNDER_TEST) \
-dir:$$(JTREG_TOPDIR) \
-reportDir:$$($1_TEST_RESULTS_DIR) \

View File

@@ -24,7 +24,7 @@
#
################################################################################
# Initial bootstrapping, copied and stripped down from Makefile and Init.gmk
# Initial bootstrapping, copied and stripped down from Makefile and PreInit.gmk.
################################################################################
# In Cygwin, the MAKE variable gets prepended with the current directory if the
@@ -136,7 +136,8 @@ $(eval $(call SetupVariable,JIB_JAR,OPTIONAL))
# wrapper. This is required so we can include MakeBase which is needed for
# CreateNewSpec.
HAS_SPEC :=
include $(TOPDIR)/make/InitSupport.gmk
include $(TOPDIR)/make/PreInitSupport.gmk
include $(TOPDIR)/make/common/LogUtils.gmk
$(eval $(call CheckDeprecatedEnvironment))
$(eval $(call CheckInvalidMakeFlags))

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2025, 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
@@ -624,4 +624,10 @@ AC_DEFUN_ONCE([BASIC_POST_CONFIG_OUTPUT],
# Make the compare script executable
$CHMOD +x $OUTPUTDIR/compare.sh
# Copy the linker wrapper script for clang on AIX and make it executable
if test "x$TOOLCHAIN_TYPE" = xclang && test "x$OPENJDK_TARGET_OS" = xaix; then
$CP -f "$TOPDIR/make/scripts/aix/ld.sh" "$OUTPUTDIR/ld.sh"
$CHMOD +x "$OUTPUTDIR/ld.sh"
fi
])

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2025, 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
@@ -235,9 +235,10 @@ AC_DEFUN([FLAGS_SETUP_WARNINGS],
CFLAGS_WARNINGS_ARE_ERRORS="-Werror"
# Additional warnings that are not activated by -Wall and -Wextra
WARNINGS_ENABLE_ADDITIONAL="-Wpointer-arith -Wreturn-type -Wsign-compare \
-Wtrampolines -Wundef -Wunused-const-variable=1 -Wunused-function \
-Wunused-result -Wunused-value -Wtype-limits -Wuninitialized"
WARNINGS_ENABLE_ADDITIONAL="-Winvalid-pch -Wpointer-arith -Wreturn-type \
-Wsign-compare -Wtrampolines -Wtype-limits -Wundef -Wuninitialized \
-Wunused-const-variable=1 -Wunused-function -Wunused-result \
-Wunused-value"
WARNINGS_ENABLE_ADDITIONAL_CXX="-Woverloaded-virtual -Wreorder"
WARNINGS_ENABLE_ALL_CFLAGS="-Wall -Wextra -Wformat=2 $WARNINGS_ENABLE_ADDITIONAL"
WARNINGS_ENABLE_ALL_CXXFLAGS="$WARNINGS_ENABLE_ALL_CFLAGS $WARNINGS_ENABLE_ADDITIONAL_CXX"
@@ -277,7 +278,7 @@ AC_DEFUN([FLAGS_SETUP_WARNINGS],
AC_DEFUN([FLAGS_SETUP_QUALITY_CHECKS],
[
# bounds, memory and behavior checking options
if test "x$TOOLCHAIN_TYPE" = xgcc; then
if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then
case $DEBUG_LEVEL in
release )
# no adjustment
@@ -516,12 +517,6 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
-fvisibility=hidden -fno-strict-aliasing -fno-omit-frame-pointer"
fi
if test "x$TOOLCHAIN_TYPE" = xclang && test "x$OPENJDK_TARGET_OS" = xaix; then
# clang compiler on aix needs -ffunction-sections
TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -ffunction-sections -ftls-model -fno-math-errno -fstack-protector"
TOOLCHAIN_CFLAGS_JDK="-ffunction-sections -fsigned-char -fstack-protector"
fi
if test "x$TOOLCHAIN_TYPE" = xgcc; then
TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -fstack-protector"
TOOLCHAIN_CFLAGS_JDK="-fvisibility=hidden -pipe -fstack-protector"
@@ -541,7 +536,7 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
# Restrict the debug information created by Clang to avoid
# too big object files and speed the build up a little bit
# (see http://llvm.org/bugs/show_bug.cgi?id=7554)
TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -flimit-debug-info"
TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -flimit-debug-info -fstack-protector"
# In principle the stack alignment below is cpu- and ABI-dependent and
# should agree with values of StackAlignmentInBytes in various
@@ -559,7 +554,13 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
TOOLCHAIN_CFLAGS_JDK="-pipe"
TOOLCHAIN_CFLAGS_JDK_CONLY="-fno-strict-aliasing" # technically NOT for CXX
fi
TOOLCHAIN_CFLAGS_JDK="$TOOLCHAIN_CFLAGS_JDK -fvisibility=hidden"
if test "x$OPENJDK_TARGET_OS" = xaix; then
TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -ffunction-sections -ftls-model -fno-math-errno"
TOOLCHAIN_CFLAGS_JDK="-ffunction-sections -fsigned-char"
fi
TOOLCHAIN_CFLAGS_JDK="$TOOLCHAIN_CFLAGS_JDK -fvisibility=hidden -fstack-protector"
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
# The -utf-8 option sets source and execution character sets to UTF-8 to enable correct
@@ -736,6 +737,11 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
# for all archs except arm and ppc, prevent gcc to omit frame pointer
$1_CFLAGS_CPU_JDK="${$1_CFLAGS_CPU_JDK} -fno-omit-frame-pointer"
fi
if test "x$FLAGS_CPU" = xppc64le; then
# Little endian machine uses ELFv2 ABI.
# Use Power8, this is the first CPU to support PPC64 LE with ELFv2 ABI.
$1_CFLAGS_CPU_JVM="${$1_CFLAGS_CPU_JVM} -DABI_ELFv2 -mcpu=power8 -mtune=power8"
fi
fi
if test "x$OPENJDK_TARGET_OS" = xaix; then
$1_CFLAGS_CPU="-mcpu=pwr8"

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2025, 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
@@ -79,7 +79,7 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
fi
if test "x$OPENJDK_TARGET_OS" = xaix; then
BASIC_LDFLAGS="-Wl,-b64 -Wl,-brtl -Wl,-bnorwexec -Wl,-bnolibpath -Wl,-bnoexpall \
-Wl,-bernotok -Wl,-bdatapsize:64k -Wl,-btextpsize:64k -Wl,-bstackpsize:64k"
-Wl,-bernotok -Wl,-bdatapsize:64k -Wl,-btextpsize:64k -Wl,-bstackpsize:64k -fuse-ld=$OUTPUTDIR/ld.sh"
BASIC_LDFLAGS_JVM_ONLY="$BASIC_LDFLAGS_JVM_ONLY -Wl,-lC_r -Wl,-bbigtoc"
fi

127
make/common/LogUtils.gmk Normal file
View File

@@ -0,0 +1,127 @@
#
# Copyright (c) 2011, 2025, 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 helper functions for logging.
################################################################################
# Look for a given option in the LOG variable, and if found, set a variable
# and remove the option from the LOG variable
# $1: The option to look for
# $2: The variable to set to "true" if the option is found
define ParseLogOption
ifneq ($$(findstring $1, $$(LOG)), )
override $2 := true
# First try to remove ",<option>" if it exists, otherwise just remove "<option>"
LOG_STRIPPED := $$(subst $1,, $$(subst $$(COMMA)$$(strip $1),, $$(LOG)))
# We might have ended up with a leading comma. Remove it. Need override
# since LOG is set from the command line.
override LOG := $$(strip $$(patsubst $$(COMMA)%, %, $$(LOG_STRIPPED)))
endif
endef
# Look for a given option with an assignment in the LOG variable, and if found,
# set a variable to that value and remove the option from the LOG variable
# $1: The option to look for
# $2: The variable to set to the value of the option, if found
define ParseLogValue
ifneq ($$(findstring $1=, $$(LOG)), )
# Make words of out comma-separated list and find the one with opt=val
value := $$(strip $$(subst $$(strip $1)=,, $$(filter $$(strip $1)=%, $$(subst $$(COMMA), , $$(LOG)))))
override $2 := $$(value)
# First try to remove ",<option>" if it exists, otherwise just remove "<option>"
LOG_STRIPPED := $$(subst $$(strip $1)=$$(value),, \
$$(subst $$(COMMA)$$(strip $1)=$$(value),, $$(LOG)))
# We might have ended up with a leading comma. Remove it. Need override
# since LOG is set from the command line.
override LOG := $$(strip $$(patsubst $$(COMMA)%, %, $$(LOG_STRIPPED)))
endif
endef
define ParseLogLevel
# Catch old-style VERBOSE= command lines.
ifneq ($$(origin VERBOSE), undefined)
$$(info Error: VERBOSE is deprecated. Use LOG=<warn|info|debug|trace> instead.)
$$(error Cannot continue)
endif
# Setup logging according to LOG
# If "nofile" is present, do not log to a file
$$(eval $$(call ParseLogOption, nofile, LOG_NOFILE))
# If "cmdline" is present, print all executes "important" command lines.
$$(eval $$(call ParseLogOption, cmdlines, LOG_CMDLINES))
# If "report" is present, use non-standard reporting options at build failure.
$$(eval $$(call ParseLogValue, report, LOG_REPORT))
ifneq ($$(LOG_REPORT), )
ifeq ($$(filter $$(LOG_REPORT), none all default), )
$$(info Error: LOG=report has invalid value: $$(LOG_REPORT).)
$$(info Valid values: LOG=report=<none>|<all>|<default>)
$$(error Cannot continue)
endif
endif
# If "profile-to-log" is present, write shell times in build log
$$(eval $$(call ParseLogOption, profile-to-log, LOG_PROFILE_TIMES_LOG))
# If "profile" is present, write shell times in separate log file
# IMPORTANT: $(ParseLogOption profile-to-log) should go first. Otherwise
# parsing of 'LOG=debug,profile-to-log,nofile' ends up in the following error:
# Error: LOG contains unknown option or log level: debug-to-log.
$$(eval $$(call ParseLogOption, profile, LOG_PROFILE_TIMES_FILE))
# Treat LOG=profile-to-log as if it were LOG=profile,profile-to-log
LOG_PROFILE_TIMES_FILE := $$(firstword $$(LOG_PROFILE_TIMES_FILE) $$(LOG_PROFILE_TIMES_LOG))
override LOG_LEVEL := $$(LOG)
ifeq ($$(LOG_LEVEL), )
# Set LOG to "warn" as default if not set
override LOG_LEVEL := warn
endif
ifeq ($$(LOG_LEVEL), warn)
override MAKE_LOG_FLAGS := -s
else ifeq ($$(LOG_LEVEL), info)
override MAKE_LOG_FLAGS := -s
else ifeq ($$(LOG_LEVEL), debug)
override MAKE_LOG_FLAGS :=
else ifeq ($$(LOG_LEVEL), trace)
override MAKE_LOG_FLAGS :=
else
$$(info Error: LOG contains unknown option or log level: $$(LOG).)
$$(info LOG can be <level>[,<opt>[...]] where <opt> is nofile | cmdlines | profile | profile-to-log)
$$(info and <level> is warn | info | debug | trace)
$$(error Cannot continue)
endif
endef
MAKE_LOG_VARS = $(foreach v, \
LOG_LEVEL LOG_NOFILE LOG_CMDLINES LOG_REPORT LOG_PROFILE_TIMES_LOG \
LOG_PROFILE_TIMES_FILE, \
$v=$($v) \
)

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2014, 2025, 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
@@ -92,7 +92,7 @@ SRC_SUBDIRS += share/classes
SPEC_SUBDIRS += share/specs
MAN_SUBDIRS += share/man
MAN_SUBDIRS += share/man windows/man
# Find all module-info.java files for the current build target platform and
# configuration.

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2025, 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
@@ -1092,9 +1092,9 @@ var getJibProfilesDependencies = function (input, common) {
windows_x64: "VS2022-17.6.5+1.0",
linux_aarch64: "gcc13.2.0-OL7.6+1.0",
linux_arm: "gcc8.2.0-Fedora27+1.0",
linux_ppc64le: "gcc8.2.0-Fedora27+1.0",
linux_s390x: "gcc8.2.0-Fedora27+1.0",
linux_riscv64: "gcc11.3.0-Fedora_rawhide_68692+1.1"
linux_ppc64le: "gcc13.2.0-Fedora_41+1.0",
linux_s390x: "gcc13.2.0-Fedora_41+1.0",
linux_riscv64: "gcc13.2.0-Fedora_41+1.0"
};
var devkit_platform = (input.target_cpu == "x86"

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2013, 2025, 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
@@ -63,18 +63,14 @@ ifeq ($(BASE_OS), OL)
LINUX_VERSION := OL6.4
endif
else ifeq ($(BASE_OS), Fedora)
DEFAULT_OS_VERSION := 41
ifeq ($(BASE_OS_VERSION), )
BASE_OS_VERSION := $(DEFAULT_OS_VERSION)
endif
ifeq ($(ARCH), riscv64)
DEFAULT_OS_VERSION := rawhide/68692
ifeq ($(BASE_OS_VERSION), )
BASE_OS_VERSION := $(DEFAULT_OS_VERSION)
endif
BASE_URL := http://fedora.riscv.rocks/repos-dist/$(BASE_OS_VERSION)/$(ARCH)/Packages/
BASE_URL := http://fedora.riscv.rocks/repos-dist/f$(BASE_OS_VERSION)/latest/$(ARCH)/Packages/
else
DEFAULT_OS_VERSION := 27
LATEST_ARCHIVED_OS_VERSION := 35
ifeq ($(BASE_OS_VERSION), )
BASE_OS_VERSION := $(DEFAULT_OS_VERSION)
endif
ifeq ($(filter x86_64 armhfp, $(ARCH)), )
FEDORA_TYPE := fedora-secondary
else
@@ -203,7 +199,7 @@ RPM_LIST := \
glibc glibc-headers glibc-devel \
cups-libs cups-devel \
libX11 libX11-devel \
xorg-x11-proto-devel \
libxcb xorg-x11-proto-devel \
alsa-lib alsa-lib-devel \
libXext libXext-devel \
libXtst libXtst-devel \
@@ -441,8 +437,9 @@ $(gcc) \
# wants.
$(BUILDDIR)/$(binutils_ver)/Makefile : CONFIG += --enable-64-bit-bfd --libdir=$(PREFIX)/$(word 1,$(LIBDIRS))
ifneq ($(ARCH), riscv64)
# gold is not available for riscv64 for some reason,
ifeq ($(filter $(ARCH), s390x riscv64 ppc64le), )
# gold compiles but cannot link properly on s390x @ gcc 13.2 and Fedore 41
# gold is not available for riscv64 and ppc64le,
# and subsequent linking will fail if we try to enable it.
LINKER_CONFIG := --enable-gold=default
endif

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2013, 2025, 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
@@ -125,9 +125,7 @@ else ifeq ($(call And, $(call isTargetOs, linux) $(call isTargetCpu, aarch64)),
endif
endif
ifeq ($(call isTargetOs, linux macosx windows), true)
JVM_PRECOMPILED_HEADER := $(TOPDIR)/src/hotspot/share/precompiled/precompiled.hpp
endif
JVM_PRECOMPILED_HEADER := $(TOPDIR)/src/hotspot/share/precompiled/precompiled.hpp
ifeq ($(call isTargetCpu, x86), true)
JVM_EXCLUDE_PATTERNS += x86_64

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2013, 2025, 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
@@ -52,15 +52,23 @@ ifneq ($(FDLIBM_CFLAGS), )
endif
ifeq ($(call isTargetOs, linux), true)
BUILD_LIBJVM_sharedRuntimeTrig.cpp_CXXFLAGS := -DNO_PCH $(FDLIBM_CFLAGS) $(LIBJVM_FDLIBM_COPY_OPT_FLAG)
BUILD_LIBJVM_sharedRuntimeTrans.cpp_CXXFLAGS := -DNO_PCH $(FDLIBM_CFLAGS) $(LIBJVM_FDLIBM_COPY_OPT_FLAG)
BUILD_LIBJVM_sharedRuntimeTrig.cpp_CXXFLAGS := $(FDLIBM_CFLAGS) $(LIBJVM_FDLIBM_COPY_OPT_FLAG)
BUILD_LIBJVM_sharedRuntimeTrans.cpp_CXXFLAGS := $(FDLIBM_CFLAGS) $(LIBJVM_FDLIBM_COPY_OPT_FLAG)
ifeq ($(TOOLCHAIN_TYPE), clang)
JVM_PRECOMPILED_HEADER_EXCLUDE := \
sharedRuntimeTrig.cpp \
sharedRuntimeTrans.cpp \
sharedRuntimeTrig.cpp \
sharedRuntimeTrans.cpp \
$(OPT_SPEED_SRC) \
#
#
endif
ifeq ($(call isTargetCpu, ppc64le)+$(TOOLCHAIN_TYPE), true+gcc)
JVM_PRECOMPILED_HEADER_EXCLUDE := \
sharedRuntimeTrig.cpp \
sharedRuntimeTrans.cpp \
$(OPT_SPEED_SRC) \
#
endif
ifeq ($(call isTargetCpu, x86), true)
@@ -110,11 +118,7 @@ else ifeq ($(call isTargetOs, macosx), true)
endif
else ifeq ($(call isTargetOs, aix), true)
ifeq ($(TOOLCHAIN_TYPE), clang)
BUILD_LIBJVM_synchronizer.cpp_CXXFLAGS := -fno-inline
else
BUILD_LIBJVM_synchronizer.cpp_CXXFLAGS := -qnoinline
endif
BUILD_LIBJVM_synchronizer.cpp_CXXFLAGS := -fno-inline
BUILD_LIBJVM_sharedRuntimeTrans.cpp_CXXFLAGS := $(CXX_O_FLAG_NONE)
# Disable aggressive optimizations for functions in sharedRuntimeTrig.cpp
# and sharedRuntimeTrans.cpp on ppc64.
@@ -138,6 +142,13 @@ else ifeq ($(call isTargetOs, aix), true)
# Disable ELF decoder on AIX (AIX uses XCOFF).
JVM_EXCLUDE_PATTERNS += elf
JVM_PRECOMPILED_HEADER_EXCLUDE := \
sharedRuntimeTrig.cpp \
sharedRuntimeTrans.cpp \
synchronizer.cpp \
$(OPT_SPEED_SRC) \
#
else ifeq ($(call isTargetOs, windows), true)
JVM_PRECOMPILED_HEADER_EXCLUDE := \
bytecodeInterpreter.cpp \

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2025, 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
@@ -393,8 +393,6 @@ else
LIBFONTMANAGER_JDK_LIBS += libfreetype
endif
LIBFONTMANAGER_OPTIMIZATION := HIGHEST
ifneq ($(filter $(TOOLCHAIN_TYPE), gcc clang), )
# gcc (and to an extent clang) is particularly bad at optimizing these files,
# causing a massive spike in compile time. We don't care about these
@@ -405,7 +403,6 @@ endif
ifeq ($(call isTargetOs, windows), true)
LIBFONTMANAGER_EXCLUDE_FILES += X11FontScaler.c X11TextRenderer.c
LIBFONTMANAGER_OPTIMIZATION := HIGHEST
else ifeq ($(call isTargetOs, macosx), true)
LIBFONTMANAGER_EXCLUDE_FILES += X11FontScaler.c X11TextRenderer.c \
lcdglyph.c lcdglyphDW.cpp
@@ -426,7 +423,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBFONTMANAGER, \
AccelGlyphCache.c, \
CFLAGS := $(LIBFONTMANAGER_CFLAGS), \
CXXFLAGS := $(LIBFONTMANAGER_CFLAGS), \
OPTIMIZATION := $(LIBFONTMANAGER_OPTIMIZATION), \
OPTIMIZATION := HIGHEST, \
CFLAGS_windows = -DCC_NOEX, \
EXTRA_HEADER_DIRS := $(LIBFONTMANAGER_EXTRA_HEADER_DIRS), \
EXTRA_SRC := $(LIBFONTMANAGER_EXTRA_SRC), \

27
make/scripts/aix/ld.sh Normal file
View File

@@ -0,0 +1,27 @@
#!/bin/bash
#
# Copyright (c) 2025 SAP SE. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# 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.
#
unset LIBPATH
exec /usr/bin/ld "$@"

View File

@@ -1217,15 +1217,24 @@ void LIR_Assembler::emit_alloc_array(LIR_OpAllocArray* op) {
void LIR_Assembler::type_profile_helper(Register mdo,
ciMethodData *md, ciProfileData *data,
Register recv, Label* update_done) {
// Given a profile data offset, generate an Address which points to
// the corresponding slot in mdo->data().
// Clobbers rscratch2.
auto slot_at = [=](ByteSize offset) -> Address {
return __ form_address(rscratch2, mdo,
md->byte_offset_of_slot(data, offset),
LogBytesPerWord);
};
for (uint i = 0; i < ReceiverTypeData::row_limit(); i++) {
Label next_test;
// See if the receiver is receiver[n].
__ lea(rscratch2, Address(mdo, md->byte_offset_of_slot(data, ReceiverTypeData::receiver_offset(i))));
__ ldr(rscratch1, Address(rscratch2));
__ ldr(rscratch1, slot_at(ReceiverTypeData::receiver_offset(i)));
__ cmp(recv, rscratch1);
__ br(Assembler::NE, next_test);
Address data_addr(mdo, md->byte_offset_of_slot(data, ReceiverTypeData::receiver_count_offset(i)));
__ addptr(data_addr, DataLayout::counter_increment);
__ addptr(slot_at(ReceiverTypeData::receiver_count_offset(i)),
DataLayout::counter_increment);
__ b(*update_done);
__ bind(next_test);
}
@@ -1233,15 +1242,12 @@ void LIR_Assembler::type_profile_helper(Register mdo,
// Didn't find receiver; find next empty slot and fill it in
for (uint i = 0; i < ReceiverTypeData::row_limit(); i++) {
Label next_test;
__ lea(rscratch2,
Address(mdo, md->byte_offset_of_slot(data, ReceiverTypeData::receiver_offset(i))));
Address recv_addr(rscratch2);
Address recv_addr(slot_at(ReceiverTypeData::receiver_offset(i)));
__ ldr(rscratch1, recv_addr);
__ cbnz(rscratch1, next_test);
__ str(recv, recv_addr);
__ mov(rscratch1, DataLayout::counter_increment);
__ lea(rscratch2, Address(mdo, md->byte_offset_of_slot(data, ReceiverTypeData::receiver_count_offset(i))));
__ str(rscratch1, Address(rscratch2));
__ str(rscratch1, slot_at(ReceiverTypeData::receiver_count_offset(i)));
__ b(*update_done);
__ bind(next_test);
}
@@ -1413,8 +1419,7 @@ void LIR_Assembler::emit_opTypeCheck(LIR_OpTypeCheck* op) {
// Object is null; update MDO and exit
Address data_addr
= __ form_address(rscratch2, mdo,
md->byte_offset_of_slot(data, DataLayout::flags_offset()),
0);
md->byte_offset_of_slot(data, DataLayout::flags_offset()), 0);
__ ldrb(rscratch1, data_addr);
__ orr(rscratch1, rscratch1, BitData::null_seen_byte_constant());
__ strb(rscratch1, data_addr);
@@ -2565,10 +2570,12 @@ void LIR_Assembler::emit_profile_call(LIR_OpProfileCall* op) {
for (i = 0; i < VirtualCallData::row_limit(); i++) {
ciKlass* receiver = vc_data->receiver(i);
if (receiver == nullptr) {
Address recv_addr(mdo, md->byte_offset_of_slot(data, VirtualCallData::receiver_offset(i)));
__ mov_metadata(rscratch1, known_klass->constant_encoding());
__ lea(rscratch2, recv_addr);
__ str(rscratch1, Address(rscratch2));
Address recv_addr =
__ form_address(rscratch2, mdo,
md->byte_offset_of_slot(data, VirtualCallData::receiver_offset(i)),
LogBytesPerWord);
__ str(rscratch1, recv_addr);
Address data_addr(mdo, md->byte_offset_of_slot(data, VirtualCallData::receiver_count_offset(i)));
__ addptr(data_addr, DataLayout::counter_increment);
return;

View File

@@ -1173,7 +1173,10 @@ public:
// Arithmetics
// Clobber: rscratch1, rscratch2
void addptr(const Address &dst, int32_t src);
// Clobber: rscratch1
void cmpptr(Register src1, Address src2);
void cmpoop(Register obj1, Register obj2);

View File

@@ -0,0 +1,140 @@
/*
* Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2025, Red Hat, Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#ifndef CPU_AARCH64_STUBDECLARATIONS_HPP
#define CPU_AARCH64_STUBDECLARATIONS_HPP
#define STUBGEN_INITIAL_BLOBS_ARCH_DO(do_stub, \
do_arch_blob, \
do_arch_entry, \
do_arch_entry_init) \
do_arch_blob(initial, 10000) \
#define STUBGEN_CONTINUATION_BLOBS_ARCH_DO(do_stub, \
do_arch_blob, \
do_arch_entry, \
do_arch_entry_init) \
do_arch_blob(continuation, 2000) \
#define STUBGEN_COMPILER_BLOBS_ARCH_DO(do_stub, \
do_arch_blob, \
do_arch_entry, \
do_arch_entry_init) \
do_arch_blob(compiler, 30000 ZGC_ONLY(+10000)) \
do_stub(compiler, vector_iota_indices) \
do_arch_entry(aarch64, compiler, vector_iota_indices, \
vector_iota_indices, vector_iota_indices) \
do_stub(compiler, large_array_equals) \
do_arch_entry(aarch64, compiler, large_array_equals, \
large_array_equals, large_array_equals) \
do_stub(compiler, large_arrays_hashcode_boolean) \
do_arch_entry(aarch64, compiler, large_arrays_hashcode_boolean, \
large_arrays_hashcode_boolean, \
large_arrays_hashcode_boolean) \
do_stub(compiler, large_arrays_hashcode_byte) \
do_arch_entry(aarch64, compiler, large_arrays_hashcode_byte, \
large_arrays_hashcode_byte, \
large_arrays_hashcode_byte) \
do_stub(compiler, large_arrays_hashcode_char) \
do_arch_entry(aarch64, compiler, large_arrays_hashcode_char, \
large_arrays_hashcode_char, \
large_arrays_hashcode_char) \
do_stub(compiler, large_arrays_hashcode_short) \
do_arch_entry(aarch64, compiler, large_arrays_hashcode_short, \
large_arrays_hashcode_short, \
large_arrays_hashcode_short) \
do_stub(compiler, large_arrays_hashcode_int) \
do_arch_entry(aarch64, compiler, large_arrays_hashcode_int, \
large_arrays_hashcode_int, \
large_arrays_hashcode_int) \
do_stub(compiler, large_byte_array_inflate) \
do_arch_entry(aarch64, compiler, large_byte_array_inflate, \
large_byte_array_inflate, large_byte_array_inflate) \
do_stub(compiler, count_positives) \
do_arch_entry(aarch64, compiler, count_positives, count_positives, \
count_positives) \
do_stub(compiler, count_positives_long) \
do_arch_entry(aarch64, compiler, count_positives_long, \
count_positives_long, count_positives_long) \
do_stub(compiler, compare_long_string_LL) \
do_arch_entry(aarch64, compiler, compare_long_string_LL, \
compare_long_string_LL, compare_long_string_LL) \
do_stub(compiler, compare_long_string_UU) \
do_arch_entry(aarch64, compiler, compare_long_string_UU, \
compare_long_string_UU, compare_long_string_UU) \
do_stub(compiler, compare_long_string_LU) \
do_arch_entry(aarch64, compiler, compare_long_string_LU, \
compare_long_string_LU, compare_long_string_LU) \
do_stub(compiler, compare_long_string_UL) \
do_arch_entry(aarch64, compiler, compare_long_string_UL, \
compare_long_string_UL, compare_long_string_UL) \
do_stub(compiler, string_indexof_linear_ll) \
do_arch_entry(aarch64, compiler, string_indexof_linear_ll, \
string_indexof_linear_ll, string_indexof_linear_ll) \
do_stub(compiler, string_indexof_linear_uu) \
do_arch_entry(aarch64, compiler, string_indexof_linear_uu, \
string_indexof_linear_uu, string_indexof_linear_uu) \
do_stub(compiler, string_indexof_linear_ul) \
do_arch_entry(aarch64, compiler, string_indexof_linear_ul, \
string_indexof_linear_ul, string_indexof_linear_ul) \
/* this uses the entry for ghash_processBlocks */ \
do_stub(compiler, ghash_processBlocks_wide) \
#define STUBGEN_FINAL_BLOBS_ARCH_DO(do_stub, \
do_arch_blob, \
do_arch_entry, \
do_arch_entry_init) \
do_arch_blob(final, 20000 ZGC_ONLY(+100000)) \
do_stub(final, copy_byte_f) \
do_arch_entry(aarch64, final, copy_byte_f, copy_byte_f, \
copy_byte_f) \
do_stub(final, copy_byte_b) \
do_arch_entry(aarch64, final, copy_byte_b, copy_byte_b, \
copy_byte_b) \
do_stub(final, copy_oop_f) \
do_arch_entry(aarch64, final, copy_oop_f, copy_oop_f, copy_oop_f) \
do_stub(final, copy_oop_b) \
do_arch_entry(aarch64, final, copy_oop_b, copy_oop_b, copy_oop_b) \
do_stub(final, copy_oop_uninit_f) \
do_arch_entry(aarch64, final, copy_oop_uninit_f, copy_oop_uninit_f, \
copy_oop_uninit_f) \
do_stub(final, copy_oop_uninit_b) \
do_arch_entry(aarch64, final, copy_oop_uninit_b, copy_oop_uninit_b, \
copy_oop_uninit_b) \
do_stub(final, zero_blocks) \
do_arch_entry(aarch64, final, zero_blocks, zero_blocks, \
zero_blocks) \
do_stub(final, spin_wait) \
do_arch_entry_init(aarch64, final, spin_wait, spin_wait, \
spin_wait, empty_spin_wait) \
/* stub only -- entries are not stored in StubRoutines::aarch64 */ \
/* n.b. these are not the same as the generic atomic stubs */ \
do_stub(final, atomic_entry_points) \
#endif // CPU_AARCH64_STUBDECLARATIONS_HPP

File diff suppressed because it is too large Load Diff

View File

@@ -29,40 +29,22 @@
#include "runtime/stubRoutines.hpp"
#include "utilities/globalDefinitions.hpp"
// Implementation of the platform-specific part of StubRoutines - for
// a description of how to extend it, see the stubRoutines.hpp file.
address StubRoutines::aarch64::_get_previous_sp_entry = nullptr;
address StubRoutines::aarch64::_f2i_fixup = nullptr;
address StubRoutines::aarch64::_f2l_fixup = nullptr;
address StubRoutines::aarch64::_d2i_fixup = nullptr;
address StubRoutines::aarch64::_d2l_fixup = nullptr;
address StubRoutines::aarch64::_vector_iota_indices = nullptr;
address StubRoutines::aarch64::_float_sign_mask = nullptr;
address StubRoutines::aarch64::_float_sign_flip = nullptr;
address StubRoutines::aarch64::_double_sign_mask = nullptr;
address StubRoutines::aarch64::_double_sign_flip = nullptr;
address StubRoutines::aarch64::_zero_blocks = nullptr;
address StubRoutines::aarch64::_count_positives = nullptr;
address StubRoutines::aarch64::_count_positives_long = nullptr;
address StubRoutines::aarch64::_large_array_equals = nullptr;
address StubRoutines::aarch64::_large_arrays_hashcode_boolean = nullptr;
address StubRoutines::aarch64::_large_arrays_hashcode_byte = nullptr;
address StubRoutines::aarch64::_large_arrays_hashcode_char = nullptr;
address StubRoutines::aarch64::_large_arrays_hashcode_int = nullptr;
address StubRoutines::aarch64::_large_arrays_hashcode_short = nullptr;
address StubRoutines::aarch64::_compare_long_string_LL = nullptr;
address StubRoutines::aarch64::_compare_long_string_UU = nullptr;
address StubRoutines::aarch64::_compare_long_string_LU = nullptr;
address StubRoutines::aarch64::_compare_long_string_UL = nullptr;
address StubRoutines::aarch64::_string_indexof_linear_ll = nullptr;
address StubRoutines::aarch64::_string_indexof_linear_uu = nullptr;
address StubRoutines::aarch64::_string_indexof_linear_ul = nullptr;
address StubRoutines::aarch64::_large_byte_array_inflate = nullptr;
// function used as default for spin_wait stub
static void empty_spin_wait() { }
address StubRoutines::aarch64::_spin_wait = CAST_FROM_FN_PTR(address, empty_spin_wait);
// define fields for arch-specific entries
#define DEFINE_ARCH_ENTRY(arch, blob_name, stub_name, field_name, getter_name) \
address StubRoutines:: arch :: STUB_FIELD_NAME(field_name) = nullptr;
#define DEFINE_ARCH_ENTRY_INIT(arch, blob_name, stub_name, field_name, getter_name, init_function) \
address StubRoutines:: arch :: STUB_FIELD_NAME(field_name) = CAST_FROM_FN_PTR(address, init_function);
STUBGEN_ARCH_ENTRIES_DO(DEFINE_ARCH_ENTRY, DEFINE_ARCH_ENTRY_INIT)
#undef DEFINE_ARCH_ENTRY_INIT
#undef DEFINE_ARCH_ENTRY
bool StubRoutines::aarch64::_completed = false;

View File

@@ -34,134 +34,66 @@ static bool returns_to_call_stub(address return_pc) {
return return_pc == _call_stub_return_address;
}
// emit enum used to size per-blob code buffers
#define DEFINE_BLOB_SIZE(blob_name, size) \
_ ## blob_name ## _code_size = size,
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 = 30000 ZGC_ONLY(+10000),
_final_stubs_code_size = 20000 ZGC_ONLY(+100000)
STUBGEN_ARCH_BLOBS_DO(DEFINE_BLOB_SIZE)
};
#undef DEFINE_BLOB_SIZE
class aarch64 {
friend class StubGenerator;
#if INCLUDE_JVMCI
friend class JVMCIVMStructs;
#endif
private:
static address _get_previous_sp_entry;
// declare fields for arch-specific entries
static address _f2i_fixup;
static address _f2l_fixup;
static address _d2i_fixup;
static address _d2l_fixup;
#define DECLARE_ARCH_ENTRY(arch, blob_name, stub_name, field_name, getter_name) \
static address STUB_FIELD_NAME(field_name) ;
static address _vector_iota_indices;
static address _float_sign_mask;
static address _float_sign_flip;
static address _double_sign_mask;
static address _double_sign_flip;
#define DECLARE_ARCH_ENTRY_INIT(arch, blob_name, stub_name, field_name, getter_name, init_function) \
DECLARE_ARCH_ENTRY(arch, blob_name, stub_name, field_name, getter_name)
static address _zero_blocks;
private:
STUBGEN_ARCH_ENTRIES_DO(DECLARE_ARCH_ENTRY, DECLARE_ARCH_ENTRY_INIT)
static address _large_array_equals;
static address _large_arrays_hashcode_boolean;
static address _large_arrays_hashcode_byte;
static address _large_arrays_hashcode_char;
static address _large_arrays_hashcode_int;
static address _large_arrays_hashcode_short;
static address _compare_long_string_LL;
static address _compare_long_string_LU;
static address _compare_long_string_UL;
static address _compare_long_string_UU;
static address _string_indexof_linear_ll;
static address _string_indexof_linear_uu;
static address _string_indexof_linear_ul;
static address _large_byte_array_inflate;
static address _spin_wait;
#undef DECLARE_ARCH_ENTRY_INIT
#undef DECLARE_ARCH_ENTRY
static bool _completed;
public:
static address _count_positives;
static address _count_positives_long;
// declare getters for arch-specific entries
static address get_previous_sp_entry()
{
return _get_previous_sp_entry;
}
#define DEFINE_ARCH_ENTRY_GETTER(arch, blob_name, stub_name, field_name, getter_name) \
static address getter_name() { return STUB_FIELD_NAME(field_name) ; }
static address f2i_fixup()
{
return _f2i_fixup;
}
#define DEFINE_ARCH_ENTRY_GETTER_INIT(arch, blob_name, stub_name, field_name, getter_name, init_function) \
DEFINE_ARCH_ENTRY_GETTER(arch, blob_name, stub_name, field_name, getter_name)
static address f2l_fixup()
{
return _f2l_fixup;
}
STUBGEN_ARCH_ENTRIES_DO(DEFINE_ARCH_ENTRY_GETTER, DEFINE_ARCH_ENTRY_GETTER_INIT)
static address d2i_fixup()
{
return _d2i_fixup;
}
static address d2l_fixup()
{
return _d2l_fixup;
}
static address vector_iota_indices() {
return _vector_iota_indices;
}
static address float_sign_mask()
{
return _float_sign_mask;
}
static address float_sign_flip()
{
return _float_sign_flip;
}
static address double_sign_mask()
{
return _double_sign_mask;
}
static address double_sign_flip()
{
return _double_sign_flip;
}
static address zero_blocks() {
return _zero_blocks;
}
static address count_positives() {
return _count_positives;
}
static address count_positives_long() {
return _count_positives_long;
}
static address large_array_equals() {
return _large_array_equals;
}
#undef DEFINE_ARCH_ENTRY_GETTER_INIT
#undef DEFINE_ARCH_ENTRY_GETTER
static address large_arrays_hashcode(BasicType eltype) {
switch (eltype) {
case T_BOOLEAN:
return _large_arrays_hashcode_boolean;
return large_arrays_hashcode_boolean();
case T_BYTE:
return _large_arrays_hashcode_byte;
return large_arrays_hashcode_byte();
case T_CHAR:
return _large_arrays_hashcode_char;
return large_arrays_hashcode_char();
case T_SHORT:
return _large_arrays_hashcode_short;
return large_arrays_hashcode_short();
case T_INT:
return _large_arrays_hashcode_int;
return large_arrays_hashcode_int();
default:
ShouldNotReachHere();
}
@@ -169,42 +101,6 @@ class aarch64 {
return nullptr;
}
static address compare_long_string_LL() {
return _compare_long_string_LL;
}
static address compare_long_string_LU() {
return _compare_long_string_LU;
}
static address compare_long_string_UL() {
return _compare_long_string_UL;
}
static address compare_long_string_UU() {
return _compare_long_string_UU;
}
static address string_indexof_linear_ul() {
return _string_indexof_linear_ul;
}
static address string_indexof_linear_ll() {
return _string_indexof_linear_ll;
}
static address string_indexof_linear_uu() {
return _string_indexof_linear_uu;
}
static address large_byte_array_inflate() {
return _large_byte_array_inflate;
}
static address spin_wait() {
return _spin_wait;
}
static bool complete() {
return _completed;
}

View File

@@ -0,0 +1,68 @@
/*
* Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2025, Red Hat, Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#ifndef CPU_ARM_STUBDECLARATIONS_HPP
#define CPU_ARM_STUBDECLARATIONS_HPP
#define STUBGEN_INITIAL_BLOBS_ARCH_DO(do_stub, \
do_arch_blob, \
do_arch_entry, \
do_arch_entry_init) \
do_arch_blob(initial, 9000) \
do_stub(initial, idiv_irem) \
do_arch_entry(Arm, initial, idiv_irem, \
idiv_irem_entry, idiv_irem_entry) \
do_stub(initial, atomic_load_long) \
do_arch_entry(Arm, initial, atomic_load_long, \
atomic_load_long_entry, atomic_load_long_entry) \
do_stub(initial, atomic_store_long) \
do_arch_entry(Arm, initial, atomic_load_long, \
atomic_store_long_entry, atomic_store_long_entry) \
#define STUBGEN_CONTINUATION_BLOBS_ARCH_DO(do_stub, \
do_arch_blob, \
do_arch_entry, \
do_arch_entry_init) \
do_arch_blob(continuation, 2000) \
#define STUBGEN_COMPILER_BLOBS_ARCH_DO(do_stub, \
do_arch_blob, \
do_arch_entry, \
do_arch_entry_init) \
do_arch_blob(compiler, 22000) \
do_stub(compiler, partial_subtype_check) \
do_arch_entry(Arm, compiler, partial_subtype_check, \
partial_subtype_check, partial_subtype_check) \
#define STUBGEN_FINAL_BLOBS_ARCH_DO(do_stub, \
do_arch_blob, \
do_arch_entry, \
do_arch_entry_init) \
do_arch_blob(final, 22000) \
#endif // CPU_ARM_STUBDECLARATIONS_HPP

View File

@@ -172,7 +172,8 @@ class StubGenerator: public StubCodeGenerator {
private:
address generate_call_stub(address& return_address) {
StubCodeMark mark(this, "StubRoutines", "call_stub");
StubGenStubId stub_id = StubGenStubId::call_stub_id;
StubCodeMark mark(this, stub_id);
address start = __ pc();
@@ -251,7 +252,8 @@ class StubGenerator: public StubCodeGenerator {
// (in) Rexception_obj: exception oop
address generate_catch_exception() {
StubCodeMark mark(this, "StubRoutines", "catch_exception");
StubGenStubId stub_id = StubGenStubId::catch_exception_id;
StubCodeMark mark(this, stub_id);
address start = __ pc();
__ str(Rexception_obj, Address(Rthread, Thread::pending_exception_offset()));
@@ -263,7 +265,8 @@ class StubGenerator: public StubCodeGenerator {
// (in) Rexception_pc: return address
address generate_forward_exception() {
StubCodeMark mark(this, "StubRoutines", "forward exception");
StubGenStubId stub_id = StubGenStubId::forward_exception_id;
StubCodeMark mark(this, stub_id);
address start = __ pc();
__ mov(c_rarg0, Rthread);
@@ -312,6 +315,8 @@ class StubGenerator: public StubCodeGenerator {
Register tmp = LR;
assert(dividend == remainder, "must be");
StubGenStubId stub_id = StubGenStubId::idiv_irem_id;
StubCodeMark mark(this, stub_id);
address start = __ pc();
// Check for special cases: divisor <= 0 or dividend < 0
@@ -453,7 +458,8 @@ class StubGenerator: public StubCodeGenerator {
address generate_atomic_add() {
address start;
StubCodeMark mark(this, "StubRoutines", "atomic_add");
StubGenStubId stub_id = StubGenStubId::atomic_add_id;
StubCodeMark mark(this, stub_id);
Label retry;
start = __ pc();
Register addval = R0;
@@ -504,7 +510,8 @@ class StubGenerator: public StubCodeGenerator {
address generate_atomic_xchg() {
address start;
StubCodeMark mark(this, "StubRoutines", "atomic_xchg");
StubGenStubId stub_id = StubGenStubId::atomic_xchg_id;
StubCodeMark mark(this, stub_id);
start = __ pc();
Register newval = R0;
Register dest = R1;
@@ -554,7 +561,8 @@ class StubGenerator: public StubCodeGenerator {
address generate_atomic_cmpxchg() {
address start;
StubCodeMark mark(this, "StubRoutines", "atomic_cmpxchg");
StubGenStubId stub_id = StubGenStubId::atomic_cmpxchg_id;
StubCodeMark mark(this, stub_id);
start = __ pc();
Register cmp = R0;
Register newval = R1;
@@ -592,7 +600,8 @@ class StubGenerator: public StubCodeGenerator {
address generate_atomic_cmpxchg_long() {
address start;
StubCodeMark mark(this, "StubRoutines", "atomic_cmpxchg_long");
StubGenStubId stub_id = StubGenStubId::atomic_cmpxchg_long_id;
StubCodeMark mark(this, stub_id);
start = __ pc();
Register cmp_lo = R0;
Register cmp_hi = R1;
@@ -629,7 +638,8 @@ class StubGenerator: public StubCodeGenerator {
address generate_atomic_load_long() {
address start;
StubCodeMark mark(this, "StubRoutines", "atomic_load_long");
StubGenStubId stub_id = StubGenStubId::atomic_load_long_id;
StubCodeMark mark(this, stub_id);
start = __ pc();
Register result_lo = R0;
Register result_hi = R1;
@@ -653,7 +663,8 @@ class StubGenerator: public StubCodeGenerator {
address generate_atomic_store_long() {
address start;
StubCodeMark mark(this, "StubRoutines", "atomic_store_long");
StubGenStubId stub_id = StubGenStubId::atomic_store_long_id;
StubCodeMark mark(this, stub_id);
start = __ pc();
Register newval_lo = R0;
Register newval_hi = R1;
@@ -695,7 +706,8 @@ class StubGenerator: public StubCodeGenerator {
// raddr: LR, blown by call
address generate_partial_subtype_check() {
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", "partial_subtype_check");
StubGenStubId stub_id = StubGenStubId::partial_subtype_check_id;
StubCodeMark mark(this, stub_id);
address start = __ pc();
// based on SPARC check_klass_subtype_[fast|slow]_path (without CompressedOops)
@@ -784,7 +796,8 @@ class StubGenerator: public StubCodeGenerator {
// Non-destructive plausibility checks for oops
address generate_verify_oop() {
StubCodeMark mark(this, "StubRoutines", "verify_oop");
StubGenStubId stub_id = StubGenStubId::verify_oop_id;
StubCodeMark mark(this, stub_id);
address start = __ pc();
// Incoming arguments:
@@ -1985,6 +1998,23 @@ class StubGenerator: public StubCodeGenerator {
return start_pc;
}
/* Internal development flag */
/* enabled by defining TEST_C2_GENERIC_ARRAYCOPY */
// With this flag, the C2 stubs are tested by generating calls to
// generic_arraycopy instead of Runtime1::arraycopy
// Runtime1::arraycopy return a status in R0 (0 if OK, else ~copied)
// and the result is tested to see whether the arraycopy stub should
// be called.
// When we test arraycopy this way, we must generate extra code in the
// arraycopy methods callable from C2 generic_arraycopy to set the
// status to 0 for those who always succeed (calling the slow path stub might
// lead to errors since the copy has already been performed).
static const bool set_status;
//
// Generate stub for primitive array copy. If "aligned" is true, the
// "from" and "to" addresses are assumed to be heapword aligned.
@@ -1997,9 +2027,109 @@ class StubGenerator: public StubCodeGenerator {
// to: R1
// count: R2 treated as signed 32-bit int
//
address generate_primitive_copy(bool aligned, const char * name, bool status, int bytes_per_count, bool disjoint, address nooverlap_target = nullptr) {
address generate_primitive_copy(StubGenStubId stub_id, address nooverlap_target = nullptr) {
bool aligned;
bool status;
int bytes_per_count;
bool disjoint;
switch (stub_id) {
case jbyte_disjoint_arraycopy_id:
aligned = false;
status = true;
bytes_per_count = 1;
disjoint = true;
break;
case jshort_disjoint_arraycopy_id:
aligned = false;
status = true;
bytes_per_count = 2;
disjoint = true;
break;
case jint_disjoint_arraycopy_id:
aligned = false;
status = true;
bytes_per_count = 4;
disjoint = true;
break;
case jlong_disjoint_arraycopy_id:
aligned = false;
status = true;
bytes_per_count = 8;
disjoint = true;
break;
case arrayof_jbyte_disjoint_arraycopy_id:
aligned = true;
status = set_status;
bytes_per_count = 1;
disjoint = true;
break;
case arrayof_jshort_disjoint_arraycopy_id:
aligned = true;
status = set_status;
bytes_per_count = 2;
disjoint = true;
break;
case arrayof_jint_disjoint_arraycopy_id:
aligned = true;
status = set_status;
bytes_per_count = 4;
disjoint = true;
break;
case arrayof_jlong_disjoint_arraycopy_id:
aligned = false;
status = set_status;
bytes_per_count = 8;
disjoint = true;
break;
case jbyte_arraycopy_id:
aligned = false;
status = true;
bytes_per_count = 1;
disjoint = false;
break;
case jshort_arraycopy_id:
aligned = false;
status = true;
bytes_per_count = 2;
disjoint = false;
break;
case jint_arraycopy_id:
aligned = false;
status = true;
bytes_per_count = 4;
disjoint = false;
break;
case jlong_arraycopy_id:
aligned = false;
status = true;
bytes_per_count = 8;
disjoint = false;
break;
case arrayof_jbyte_arraycopy_id:
aligned = true;
status = set_status;
bytes_per_count = 1;
disjoint = false;
break;
case arrayof_jshort_arraycopy_id:
aligned = true;
status = set_status;
bytes_per_count = 2;
disjoint = false;
break;
case arrayof_jint_arraycopy_id:
aligned = true;
status = set_status;
bytes_per_count = 4;
disjoint = false;
break;
default:
ShouldNotReachHere();
}
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", name);
StubCodeMark mark(this, stub_id);
address start = __ pc();
const Register from = R0; // source array address
@@ -2171,9 +2301,38 @@ class StubGenerator: public StubCodeGenerator {
// to: R1
// count: R2 treated as signed 32-bit int
//
address generate_oop_copy(bool aligned, const char * name, bool status, bool disjoint, address nooverlap_target = nullptr) {
address generate_oop_copy(StubGenStubId stub_id, address nooverlap_target = nullptr) {
bool aligned;
bool status;
bool disjoint;
switch (stub_id) {
case oop_disjoint_arraycopy_id:
aligned = false;
status = true;
disjoint = true;
break;
case arrayof_oop_disjoint_arraycopy_id:
aligned = true;
status = set_status;
disjoint = true;
break;
case oop_arraycopy_id:
aligned = false;
status = true;
disjoint = false;
break;
case arrayof_oop_arraycopy_id:
aligned = true;
status = set_status;
disjoint = false;
break;
default:
ShouldNotReachHere();
}
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", name);
StubCodeMark mark(this, stub_id);
address start = __ pc();
Register from = R0;
@@ -2308,7 +2467,7 @@ class StubGenerator: public StubCodeGenerator {
// Examines the alignment of the operands and dispatches
// to a long, int, short, or byte copy loop.
//
address generate_unsafe_copy(const char* name) {
address generate_unsafe_copy() {
const Register R0_from = R0; // source array address
const Register R1_to = R1; // destination array address
@@ -2317,7 +2476,8 @@ class StubGenerator: public StubCodeGenerator {
const Register R3_bits = R3; // test copy of low bits
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", name);
StubGenStubId stub_id = StubGenStubId::unsafe_arraycopy_id;
StubCodeMark mark(this, stub_id);
address start = __ pc();
const Register tmp = Rtemp;
@@ -2442,9 +2602,10 @@ class StubGenerator: public StubCodeGenerator {
// ckval: R4 (super_klass)
// ret: R0 zero for success; (-1^K) where K is partial transfer count (32-bit)
//
address generate_checkcast_copy(const char * name) {
address generate_checkcast_copy() {
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", name);
StubGenStubId stub_id = StubGenStubId::checkcast_arraycopy_id;
StubCodeMark mark(this, stub_id);
address start = __ pc();
const Register from = R0; // source array address
@@ -2595,7 +2756,7 @@ class StubGenerator: public StubCodeGenerator {
// R0 == 0 - success
// R0 < 0 - need to call System.arraycopy
//
address generate_generic_copy(const char *name) {
address generate_generic_copy() {
Label L_failed, L_objArray;
// Input registers
@@ -2611,7 +2772,8 @@ class StubGenerator: public StubCodeGenerator {
const Register R8_temp = R8;
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", name);
StubGenStubId stub_id = StubGenStubId::generic_arraycopy_id;
StubCodeMark mark(this, stub_id);
address start = __ pc();
__ zap_high_non_significant_bits(R1);
@@ -2842,72 +3004,55 @@ class StubGenerator: public StubCodeGenerator {
// Note: the disjoint stubs must be generated first, some of
// the conjoint stubs use them.
bool status = false; // non failing C2 stubs need not return a status in R0
#ifdef TEST_C2_GENERIC_ARRAYCOPY /* Internal development flag */
// With this flag, the C2 stubs are tested by generating calls to
// generic_arraycopy instead of Runtime1::arraycopy
// Runtime1::arraycopy return a status in R0 (0 if OK, else ~copied)
// and the result is tested to see whether the arraycopy stub should
// be called.
// When we test arraycopy this way, we must generate extra code in the
// arraycopy methods callable from C2 generic_arraycopy to set the
// status to 0 for those who always succeed (calling the slow path stub might
// lead to errors since the copy has already been performed).
status = true; // generate a status compatible with C1 calls
#endif
address ucm_common_error_exit = generate_unsafecopy_common_error_exit();
UnsafeMemoryAccess::set_common_exit_stub_pc(ucm_common_error_exit);
// these need always status in case they are called from generic_arraycopy
StubRoutines::_jbyte_disjoint_arraycopy = generate_primitive_copy(false, "jbyte_disjoint_arraycopy", true, 1, true);
StubRoutines::_jshort_disjoint_arraycopy = generate_primitive_copy(false, "jshort_disjoint_arraycopy", true, 2, true);
StubRoutines::_jint_disjoint_arraycopy = generate_primitive_copy(false, "jint_disjoint_arraycopy", true, 4, true);
StubRoutines::_jlong_disjoint_arraycopy = generate_primitive_copy(false, "jlong_disjoint_arraycopy", true, 8, true);
StubRoutines::_oop_disjoint_arraycopy = generate_oop_copy (false, "oop_disjoint_arraycopy", true, true);
StubRoutines::_jbyte_disjoint_arraycopy = generate_primitive_copy(StubGenStubId::jbyte_disjoint_arraycopy_id);
StubRoutines::_jshort_disjoint_arraycopy = generate_primitive_copy(StubGenStubId::jshort_disjoint_arraycopy_id);
StubRoutines::_jint_disjoint_arraycopy = generate_primitive_copy(StubGenStubId::jint_disjoint_arraycopy_id);
StubRoutines::_jlong_disjoint_arraycopy = generate_primitive_copy(StubGenStubId::jlong_disjoint_arraycopy_id);
StubRoutines::_oop_disjoint_arraycopy = generate_oop_copy (StubGenStubId::oop_disjoint_arraycopy_id);
StubRoutines::_arrayof_jbyte_disjoint_arraycopy = generate_primitive_copy(true, "arrayof_jbyte_disjoint_arraycopy", status, 1, true);
StubRoutines::_arrayof_jshort_disjoint_arraycopy = generate_primitive_copy(true, "arrayof_jshort_disjoint_arraycopy",status, 2, true);
StubRoutines::_arrayof_jint_disjoint_arraycopy = generate_primitive_copy(true, "arrayof_jint_disjoint_arraycopy", status, 4, true);
StubRoutines::_arrayof_jlong_disjoint_arraycopy = generate_primitive_copy(true, "arrayof_jlong_disjoint_arraycopy", status, 8, true);
StubRoutines::_arrayof_oop_disjoint_arraycopy = generate_oop_copy (true, "arrayof_oop_disjoint_arraycopy", status, true);
StubRoutines::_arrayof_jbyte_disjoint_arraycopy = generate_primitive_copy(StubGenStubId::arrayof_jbyte_disjoint_arraycopy_id);
StubRoutines::_arrayof_jshort_disjoint_arraycopy = generate_primitive_copy(StubGenStubId::arrayof_jshort_disjoint_arraycopy_id);
StubRoutines::_arrayof_jint_disjoint_arraycopy = generate_primitive_copy(StubGenStubId::arrayof_jint_disjoint_arraycopy_id);
StubRoutines::_arrayof_jlong_disjoint_arraycopy = generate_primitive_copy(StubGenStubId::arrayof_jlong_disjoint_arraycopy_id);
StubRoutines::_arrayof_oop_disjoint_arraycopy = generate_oop_copy (StubGenStubId::arrayof_oop_disjoint_arraycopy_id);
// these need always status in case they are called from generic_arraycopy
StubRoutines::_jbyte_arraycopy = generate_primitive_copy(false, "jbyte_arraycopy", true, 1, false, StubRoutines::_jbyte_disjoint_arraycopy);
StubRoutines::_jshort_arraycopy = generate_primitive_copy(false, "jshort_arraycopy", true, 2, false, StubRoutines::_jshort_disjoint_arraycopy);
StubRoutines::_jint_arraycopy = generate_primitive_copy(false, "jint_arraycopy", true, 4, false, StubRoutines::_jint_disjoint_arraycopy);
StubRoutines::_jlong_arraycopy = generate_primitive_copy(false, "jlong_arraycopy", true, 8, false, StubRoutines::_jlong_disjoint_arraycopy);
StubRoutines::_oop_arraycopy = generate_oop_copy (false, "oop_arraycopy", true, false, StubRoutines::_oop_disjoint_arraycopy);
StubRoutines::_jbyte_arraycopy = generate_primitive_copy(StubGenStubId::jbyte_arraycopy_id, StubRoutines::_jbyte_disjoint_arraycopy);
StubRoutines::_jshort_arraycopy = generate_primitive_copy(StubGenStubId::jshort_arraycopy_id, StubRoutines::_jshort_disjoint_arraycopy);
StubRoutines::_jint_arraycopy = generate_primitive_copy(StubGenStubId::jint_arraycopy_id, StubRoutines::_jint_disjoint_arraycopy);
StubRoutines::_jlong_arraycopy = generate_primitive_copy(StubGenStubId::jlong_arraycopy_id, StubRoutines::_jlong_disjoint_arraycopy);
StubRoutines::_oop_arraycopy = generate_oop_copy (StubGenStubId::oop_arraycopy_id, StubRoutines::_oop_disjoint_arraycopy);
StubRoutines::_arrayof_jbyte_arraycopy = generate_primitive_copy(true, "arrayof_jbyte_arraycopy", status, 1, false, StubRoutines::_arrayof_jbyte_disjoint_arraycopy);
StubRoutines::_arrayof_jshort_arraycopy = generate_primitive_copy(true, "arrayof_jshort_arraycopy", status, 2, false, StubRoutines::_arrayof_jshort_disjoint_arraycopy);
StubRoutines::_arrayof_jbyte_arraycopy = generate_primitive_copy(StubGenStubId::arrayof_jbyte_arraycopy_id, StubRoutines::_arrayof_jbyte_disjoint_arraycopy);
StubRoutines::_arrayof_jshort_arraycopy = generate_primitive_copy(StubGenStubId::arrayof_jshort_arraycopy_id, StubRoutines::_arrayof_jshort_disjoint_arraycopy);
#ifdef _LP64
// since sizeof(jint) < sizeof(HeapWord), there's a different flavor:
StubRoutines::_arrayof_jint_arraycopy = generate_primitive_copy(true, "arrayof_jint_arraycopy", status, 4, false, StubRoutines::_arrayof_jint_disjoint_arraycopy);
StubRoutines::_arrayof_jint_arraycopy = generate_primitive_copy(StubGenStubId::arrayof_jint_arraycopy_id, StubRoutines::_arrayof_jint_disjoint_arraycopy);
#else
StubRoutines::_arrayof_jint_arraycopy = StubRoutines::_jint_arraycopy;
#endif
if (BytesPerHeapOop < HeapWordSize) {
StubRoutines::_arrayof_oop_arraycopy = generate_oop_copy (true, "arrayof_oop_arraycopy", status, false, StubRoutines::_arrayof_oop_disjoint_arraycopy);
StubRoutines::_arrayof_oop_arraycopy = generate_oop_copy (StubGenStubId::arrayof_oop_arraycopy_id, StubRoutines::_arrayof_oop_disjoint_arraycopy);
} else {
StubRoutines::_arrayof_oop_arraycopy = StubRoutines::_oop_arraycopy;
}
StubRoutines::_arrayof_jlong_arraycopy = StubRoutines::_jlong_arraycopy;
StubRoutines::_checkcast_arraycopy = generate_checkcast_copy("checkcast_arraycopy");
StubRoutines::_unsafe_arraycopy = generate_unsafe_copy("unsafe_arraycopy");
StubRoutines::_generic_arraycopy = generate_generic_copy("generic_arraycopy");
StubRoutines::_checkcast_arraycopy = generate_checkcast_copy();
StubRoutines::_unsafe_arraycopy = generate_unsafe_copy();
StubRoutines::_generic_arraycopy = generate_generic_copy();
}
address generate_method_entry_barrier() {
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", "nmethod_entry_barrier");
StubGenStubId stub_id = StubGenStubId::method_entry_barrier_id;
StubCodeMark mark(this, stub_id);
Label deoptimize_label;
@@ -2960,22 +3105,22 @@ class StubGenerator: public StubCodeGenerator {
#undef __
#define __ masm->
address generate_cont_thaw(const char* label, Continuation::thaw_kind kind) {
address generate_cont_thaw(StubGenStubId stub_id) {
if (!Continuations::enabled()) return nullptr;
Unimplemented();
return nullptr;
}
address generate_cont_thaw() {
return generate_cont_thaw("Cont thaw", Continuation::thaw_top);
return generate_cont_thaw(StubGenStubId::cont_thaw_id);
}
address generate_cont_returnBarrier() {
return generate_cont_thaw("Cont thaw return barrier", Continuation::thaw_return_barrier);
return generate_cont_thaw(StubGenStubId::cont_returnBarrier_id);
}
address generate_cont_returnBarrier_exception() {
return generate_cont_thaw("Cont thaw return barrier exception", Continuation::thaw_return_barrier_exception);
return generate_cont_thaw(StubGenStubId::cont_returnBarrierExc_id);
}
//---------------------------------------------------------------------------
@@ -3007,8 +3152,8 @@ class StubGenerator: public StubCodeGenerator {
StubRoutines::_atomic_xchg_entry = generate_atomic_xchg();
StubRoutines::_atomic_cmpxchg_entry = generate_atomic_cmpxchg();
StubRoutines::_atomic_cmpxchg_long_entry = generate_atomic_cmpxchg_long();
StubRoutines::_atomic_load_long_entry = generate_atomic_load_long();
StubRoutines::_atomic_store_long_entry = generate_atomic_store_long();
StubRoutines::Arm::_atomic_load_long_entry = generate_atomic_load_long();
StubRoutines::Arm::_atomic_store_long_entry = generate_atomic_store_long();
}
@@ -3058,27 +3203,36 @@ class StubGenerator: public StubCodeGenerator {
}
public:
StubGenerator(CodeBuffer* code, StubsKind kind) : StubCodeGenerator(code) {
switch(kind) {
case Initial_stubs:
StubGenerator(CodeBuffer* code, StubGenBlobId blob_id) : StubCodeGenerator(code, blob_id) {
switch(blob_id) {
case initial_id:
generate_initial_stubs();
break;
case Continuation_stubs:
case continuation_id:
generate_continuation_stubs();
break;
case Compiler_stubs:
case compiler_id:
generate_compiler_stubs();
break;
case Final_stubs:
case final_id:
generate_final_stubs();
break;
default:
fatal("unexpected stubs kind: %d", kind);
fatal("unexpected blob id: %d", blob_id);
break;
};
}
}; // end class declaration
void StubGenerator_generate(CodeBuffer* code, StubCodeGenerator::StubsKind kind) {
StubGenerator g(code, kind);
void StubGenerator_generate(CodeBuffer* code, StubGenBlobId blob_id) {
StubGenerator g(code, blob_id);
}
// implementation of internal development flag
#ifdef TEST_C2_GENERIC_ARRAYCOPY
const bool StubGenerator::set_status = true; // generate a status compatible with C1 calls
#else
const bool StubGenerator::set_status = false; // non failing C2 stubs need not return a status in R0
#endif

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
@@ -119,7 +119,8 @@ void aes_init() {
address generate_aescrypt_encryptBlock() {
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", "aesencryptBlock");
StubGenStubId stub_id = StubGenStubId::aescrypt_encryptBlock_id;
StubCodeMark mark(this, stub_id);
address start = __ pc();
@@ -316,7 +317,8 @@ address generate_aescrypt_encryptBlock() {
address generate_aescrypt_decryptBlock() {
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", "aesdecryptBlock");
StubGenStubId stub_id = StubGenStubId::aescrypt_decryptBlock_id;
StubCodeMark mark(this, stub_id);
address start = __ pc();
@@ -536,7 +538,8 @@ address generate_cipherBlockChaining_encryptAESCrypt() {
// [sp+4] Transposition Box reference
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", "cipherBlockChaining_encryptAESCrypt");
StubGenStubId stub_id = StubGenStubId::cipherBlockChaining_encryptAESCrypt_id;
StubCodeMark mark(this, stub_id);
address start = __ pc();
@@ -601,7 +604,8 @@ address generate_cipherBlockChaining_encryptAESCrypt() {
address generate_cipherBlockChaining_decryptAESCrypt() {
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", "cipherBlockChaining_decryptAESCrypt");
StubGenStubId stub_id = StubGenStubId::cipherBlockChaining_decryptAESCrypt_id;
StubCodeMark mark(this, stub_id);
address start = __ pc();

View File

@@ -26,9 +26,13 @@
#include "runtime/frame.inline.hpp"
#include "runtime/stubRoutines.hpp"
address StubRoutines::Arm::_idiv_irem_entry = nullptr;
#define DEFINE_ARCH_ENTRY(arch, blob_name, stub_name, field_name, getter_name) \
address StubRoutines:: arch :: STUB_FIELD_NAME(field_name) = nullptr;
address StubRoutines::Arm::_partial_subtype_check = nullptr;
#define DEFINE_ARCH_ENTRY_INIT(arch, blob_name, stub_name, field_name, getter_name, init_function) \
address StubRoutines:: arch :: STUB_FIELD_NAME(field_name) = CAST_FROM_FN_PTR(address, init_function);
address StubRoutines::_atomic_load_long_entry = nullptr;
address StubRoutines::_atomic_store_long_entry = nullptr;
STUBGEN_ARCH_ENTRIES_DO(DEFINE_ARCH_ENTRY, DEFINE_ARCH_ENTRY_INIT)
#undef DEFINE_ARCH_ENTRY_INIT
#undef DEFINE_ARCH_ENTRY

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2023, 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
@@ -29,38 +29,53 @@
// definition. See stubRoutines.hpp for a description on how to
// extend it.
// emit enum used to size per-blob code buffers
#define DEFINE_BLOB_SIZE(blob_name, size) \
_ ## blob_name ## _code_size = size,
enum platform_dependent_constants {
// simply increase sizes if too small (assembler will crash if too small)
_initial_stubs_code_size = 9000,
_continuation_stubs_code_size = 2000,
_compiler_stubs_code_size = 22000,
_final_stubs_code_size = 22000
STUBGEN_ARCH_BLOBS_DO(DEFINE_BLOB_SIZE)
};
#undef DEFINE_BLOB_SIZE
public:
static bool returns_to_call_stub(address return_pc) {
return return_pc == _call_stub_return_address;
}
class Arm {
friend class StubGenerator;
friend class VMStructs;
private:
#define DECLARE_ARCH_ENTRY(arch, blob_name, stub_name, field_name, getter_name) \
static address STUB_FIELD_NAME(field_name) ;
static address _idiv_irem_entry;
static address _partial_subtype_check;
#define DECLARE_ARCH_ENTRY_INIT(arch, blob_name, stub_name, field_name, getter_name, init_function) \
DECLARE_ARCH_ENTRY(arch, blob_name, stub_name, field_name, getter_name)
public:
private:
STUBGEN_ARCH_ENTRIES_DO(DECLARE_ARCH_ENTRY, DECLARE_ARCH_ENTRY_INIT)
#undef DECLARE_ARCH_ENTRY_INIT
#undef DECLARE_ARCH_ENTRY
public:
// declare getters for arch-specific entries
#define DEFINE_ARCH_ENTRY_GETTER(arch, blob_name, stub_name, field_name, getter_name) \
static address getter_name() { return STUB_FIELD_NAME(field_name) ; }
#define DEFINE_ARCH_ENTRY_GETTER_INIT(arch, blob_name, stub_name, field_name, getter_name, init_function) \
DEFINE_ARCH_ENTRY_GETTER(arch, blob_name, stub_name, field_name, getter_name)
STUBGEN_ARCH_ENTRIES_DO(DEFINE_ARCH_ENTRY_GETTER, DEFINE_ARCH_ENTRY_GETTER_INIT)
#undef DEFINE_ARCH_ENTRY_GETTER_INIT
#undef DEFINE_ARCH_ENTRY_GETTER
static address idiv_irem_entry() { return _idiv_irem_entry; }
static address partial_subtype_check() { return _partial_subtype_check; }
};
static bool returns_to_call_stub(address return_pc) {
return return_pc == _call_stub_return_address;
}
static address _atomic_load_long_entry;
static address _atomic_store_long_entry;
static address atomic_load_long_entry() { return _atomic_load_long_entry; }
static address atomic_store_long_entry() { return _atomic_store_long_entry; }
#endif // CPU_ARM_STUBROUTINES_ARM_HPP

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2024 SAP SE. All rights reserved.
* Copyright (c) 2012, 2025 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -562,20 +562,20 @@ void Assembler::test_asm() {
li( R3, -4711);
// PPC 1, section 3.3.9, Fixed-Point Compare Instructions
cmpi( CCR7, 0, R27, 4711);
cmp( CCR0, 1, R14, R11);
cmpli( CCR5, 1, R17, 45);
cmpl( CCR3, 0, R9, R10);
cmpi( CR7, 0, R27, 4711);
cmp( CR0, 1, R14, R11);
cmpli( CR5, 1, R17, 45);
cmpl( CR3, 0, R9, R10);
cmpwi( CCR7, R27, 4711);
cmpw( CCR0, R14, R11);
cmplwi( CCR5, R17, 45);
cmplw( CCR3, R9, R10);
cmpwi( CR7, R27, 4711);
cmpw( CR0, R14, R11);
cmplwi( CR5, R17, 45);
cmplw( CR3, R9, R10);
cmpdi( CCR7, R27, 4711);
cmpd( CCR0, R14, R11);
cmpldi( CCR5, R17, 45);
cmpld( CCR3, R9, R10);
cmpdi( CR7, R27, 4711);
cmpd( CR0, R14, R11);
cmpldi( CR5, R17, 45);
cmpld( CR3, R9, R10);
// PPC 1, section 3.3.11, Fixed-Point Logical Instructions
andi_( R4, R5, 0xff);
@@ -715,23 +715,23 @@ void Assembler::test_asm() {
bcctr( 4, 6, 0);
bcctrl(4, 6, 0);
blt(CCR0, lbl2);
bgt(CCR1, lbl2);
beq(CCR2, lbl2);
bso(CCR3, lbl2);
bge(CCR4, lbl2);
ble(CCR5, lbl2);
bne(CCR6, lbl2);
bns(CCR7, lbl2);
blt(CR0, lbl2);
bgt(CR1, lbl2);
beq(CR2, lbl2);
bso(CR3, lbl2);
bge(CR4, lbl2);
ble(CR5, lbl2);
bne(CR6, lbl2);
bns(CR7, lbl2);
bltl(CCR0, lbl2);
bgtl(CCR1, lbl2);
beql(CCR2, lbl2);
bsol(CCR3, lbl2);
bgel(CCR4, lbl2);
blel(CCR5, lbl2);
bnel(CCR6, lbl2);
bnsl(CCR7, lbl2);
bltl(CR0, lbl2);
bgtl(CR1, lbl2);
beql(CR2, lbl2);
bsol(CR3, lbl2);
bgel(CR4, lbl2);
blel(CR5, lbl2);
bnel(CR6, lbl2);
bnsl(CR7, lbl2);
blr();
sync();
@@ -794,7 +794,7 @@ void Assembler::test_asm() {
fcfid( F22, F23);
// PPC 1, section 4.6.7 Floating-Point Compare Instructions
fcmpu( CCR7, F24, F25);
fcmpu( CR7, F24, F25);
tty->print_cr("\ntest_asm disassembly (0x%lx 0x%lx):", p2i(code()->insts_begin()), p2i(code()->insts_end()));
code()->decode();

View File

@@ -294,6 +294,8 @@ class Assembler : public AbstractAssembler {
CLRRWI_OPCODE = RLWINM_OPCODE,
CLRLWI_OPCODE = RLWINM_OPCODE,
RLWNM_OPCODE = (23u << OPCODE_SHIFT),
RLWIMI_OPCODE = (20u << OPCODE_SHIFT),
SLW_OPCODE = (31u << OPCODE_SHIFT | 24u << 1),
@@ -424,6 +426,9 @@ class Assembler : public AbstractAssembler {
RLDIC_OPCODE = (30u << OPCODE_SHIFT | 2u << XO_27_29_SHIFT), // MD-FORM
RLDIMI_OPCODE = (30u << OPCODE_SHIFT | 3u << XO_27_29_SHIFT), // MD-FORM
RLDCL_OPCODE = (30u << OPCODE_SHIFT | 8u << 1),
RLDCR_OPCODE = (30u << OPCODE_SHIFT | 9u << 1),
SRADI_OPCODE = (31u << OPCODE_SHIFT | 413u << XO_21_29_SHIFT), // XS-FORM
SLD_OPCODE = (31u << OPCODE_SHIFT | 27u << 1), // X-FORM
@@ -1696,6 +1701,14 @@ class Assembler : public AbstractAssembler {
inline void insrdi( Register a, Register s, int n, int b);
inline void insrwi( Register a, Register s, int n, int b);
// Rotate variable
inline void rlwnm( Register a, Register s, Register b, int mb, int me);
inline void rlwnm_(Register a, Register s, Register b, int mb, int me);
inline void rldcl( Register a, Register s, Register b, int mb);
inline void rldcl_(Register a, Register s, Register b, int mb);
inline void rldcr( Register a, Register s, Register b, int me);
inline void rldcr_(Register a, Register s, Register b, int me);
// PPC 1, section 3.3.2 Fixed-Point Load Instructions
// 4 bytes
inline void lwzx( Register d, Register s1, Register s2);

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2024 SAP SE. All rights reserved.
* Copyright (c) 2002, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2025 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -246,9 +246,9 @@ inline void Assembler::nop() { Assembler::ori(R0, R
// NOP for FP and BR units (different versions to allow them to be in one group)
inline void Assembler::fpnop0() { Assembler::fmr(F30, F30); }
inline void Assembler::fpnop1() { Assembler::fmr(F31, F31); }
inline void Assembler::brnop0() { Assembler::mcrf(CCR2, CCR2); }
inline void Assembler::brnop1() { Assembler::mcrf(CCR3, CCR3); }
inline void Assembler::brnop2() { Assembler::mcrf(CCR4, CCR4); }
inline void Assembler::brnop0() { Assembler::mcrf(CR2, CR2); }
inline void Assembler::brnop1() { Assembler::mcrf(CR3, CR3); }
inline void Assembler::brnop2() { Assembler::mcrf(CR4, CR4); }
inline void Assembler::mr( Register d, Register s) { Assembler::orr(d, s, s); }
inline void Assembler::ori_opt( Register d, int ui16) { if (ui16!=0) Assembler::ori( d, d, ui16); }
@@ -303,7 +303,7 @@ inline void Assembler::clrlsldi_(Register a, Register s, int clrl6, int shl6) {
inline void Assembler::extrdi( Register a, Register s, int n, int b){ Assembler::rldicl(a, s, b+n, 64-n); }
// testbit with condition register.
inline void Assembler::testbitdi(ConditionRegister cr, Register a, Register s, int ui6) {
if (cr == CCR0) {
if (cr == CR0) {
Assembler::rldicr_(a, s, 63-ui6, 0);
} else {
Assembler::rldicr(a, s, 63-ui6, 0);
@@ -336,6 +336,13 @@ inline void Assembler::rldimi_( Register a, Register s, int sh6, int mb6)
inline void Assembler::insrdi( Register a, Register s, int n, int b) { Assembler::rldimi(a, s, 64-(b+n), b); }
inline void Assembler::insrwi( Register a, Register s, int n, int b) { Assembler::rlwimi(a, s, 32-(b+n), b, b+n-1); }
inline void Assembler::rlwnm( Register a, Register s, Register b, int mb, int me) { emit_int32(RLWNM_OPCODE | rta(a) | rs(s) | rb(b) | mb2125(mb) | me2630(me) | rc(0)); }
inline void Assembler::rlwnm_(Register a, Register s, Register b, int mb, int me) { emit_int32(RLWNM_OPCODE | rta(a) | rs(s) | rb(b) | mb2125(mb) | me2630(me) | rc(1)); }
inline void Assembler::rldcl( Register a, Register s, Register b, int mb) { emit_int32(RLDCL_OPCODE | rta(a) | rs(s) | rb(b) | mb2126(mb) | rc(0)); }
inline void Assembler::rldcl_( Register a, Register s, Register b, int mb) { emit_int32(RLDCL_OPCODE | rta(a) | rs(s) | rb(b) | mb2126(mb) | rc(1)); }
inline void Assembler::rldcr( Register a, Register s, Register b, int me) { emit_int32(RLDCR_OPCODE | rta(a) | rs(s) | rb(b) | me2126(me) | rc(0)); }
inline void Assembler::rldcr_( Register a, Register s, Register b, int me) { emit_int32(RLDCR_OPCODE | rta(a) | rs(s) | rb(b) | me2126(me) | rc(1)); }
// PPC 1, section 3.3.2 Fixed-Point Load Instructions
inline void Assembler::lwzx( Register d, Register s1, Register s2) { emit_int32(LWZX_OPCODE | rt(d) | ra0mem(s1) | rb(s2));}
inline void Assembler::lwz( Register d, Address &a) {

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 1999, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2024 SAP SE. All rights reserved.
* Copyright (c) 2012, 2025 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -367,9 +367,9 @@ void PatchingStub::emit_code(LIR_Assembler* ce) {
__ mr(R0, _obj); // spill
__ ld(_obj, java_lang_Class::klass_offset(), _obj);
__ ld(_obj, in_bytes(InstanceKlass::init_thread_offset()), _obj);
__ cmpd(CCR0, _obj, R16_thread);
__ cmpd(CR0, _obj, R16_thread);
__ mr(_obj, R0); // restore
__ bne(CCR0, call_patch);
__ bne(CR0, call_patch);
// Load_klass patches may execute the patched code before it's
// copied back into place so we need to jump back into the main

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2000, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2024 SAP SE. All rights reserved.
* Copyright (c) 2012, 2025 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -48,7 +48,7 @@
#define __ _masm->
const ConditionRegister LIR_Assembler::BOOL_RESULT = CCR5;
const ConditionRegister LIR_Assembler::BOOL_RESULT = CR5;
bool LIR_Assembler::is_small_constant(LIR_Opr opr) {
@@ -156,8 +156,8 @@ void LIR_Assembler::osr_entry() {
{
Label L;
__ ld(R0, slot_offset + 1*BytesPerWord, OSR_buf);
__ cmpdi(CCR0, R0, 0);
__ bne(CCR0, L);
__ cmpdi(CR0, R0, 0);
__ bne(CR0, L);
__ stop("locked object is null");
__ bind(L);
}
@@ -410,11 +410,11 @@ void LIR_Assembler::arithmetic_idiv(LIR_Code code, LIR_Opr left, LIR_Opr right,
Label regular, done;
if (is_int) {
__ cmpwi(CCR0, Rdivisor, -1);
__ cmpwi(CR0, Rdivisor, -1);
} else {
__ cmpdi(CCR0, Rdivisor, -1);
__ cmpdi(CR0, Rdivisor, -1);
}
__ bne(CCR0, regular);
__ bne(CR0, regular);
if (code == lir_idiv) {
__ neg(Rresult, Rdividend);
__ b(done);
@@ -597,14 +597,14 @@ void LIR_Assembler::emit_opConvert(LIR_OpConvert* op) {
Address addr = dst_in_memory ? frame_map()->address_for_slot(dst->double_stack_ix()) : Address();
Label L;
// Result must be 0 if value is NaN; test by comparing value to itself.
__ fcmpu(CCR0, rsrc, rsrc);
__ fcmpu(CR0, rsrc, rsrc);
if (dst_in_memory) {
__ li(R0, 0); // 0 in case of NAN
__ std(R0, addr);
} else {
__ li(dst->as_register(), 0);
}
__ bso(CCR0, L);
__ bso(CR0, L);
__ fctiwz(rsrc, rsrc); // USE_KILL
if (dst_in_memory) {
__ stfd(rsrc, addr.disp(), addr.base());
@@ -621,14 +621,14 @@ void LIR_Assembler::emit_opConvert(LIR_OpConvert* op) {
Address addr = dst_in_memory ? frame_map()->address_for_slot(dst->double_stack_ix()) : Address();
Label L;
// Result must be 0 if value is NaN; test by comparing value to itself.
__ fcmpu(CCR0, rsrc, rsrc);
__ fcmpu(CR0, rsrc, rsrc);
if (dst_in_memory) {
__ li(R0, 0); // 0 in case of NAN
__ std(R0, addr);
} else {
__ li(dst->as_register_lo(), 0);
}
__ bso(CCR0, L);
__ bso(CR0, L);
__ fctidz(rsrc, rsrc); // USE_KILL
if (dst_in_memory) {
__ stfd(rsrc, addr.disp(), addr.base());
@@ -1530,15 +1530,15 @@ void LIR_Assembler::comp_fl2i(LIR_Code code, LIR_Opr left, LIR_Opr right, LIR_Op
if (code == lir_cmp_fd2i || code == lir_ucmp_fd2i) {
bool is_unordered_less = (code == lir_ucmp_fd2i);
if (left->is_single_fpu()) {
__ fcmpu(CCR0, left->as_float_reg(), right->as_float_reg());
__ fcmpu(CR0, left->as_float_reg(), right->as_float_reg());
} else if (left->is_double_fpu()) {
__ fcmpu(CCR0, left->as_double_reg(), right->as_double_reg());
__ fcmpu(CR0, left->as_double_reg(), right->as_double_reg());
} else {
ShouldNotReachHere();
}
__ set_cmpu3(Rdst, is_unordered_less); // is_unordered_less ? -1 : 1
} else if (code == lir_cmp_l2i) {
__ cmpd(CCR0, left->as_register_lo(), right->as_register_lo());
__ cmpd(CR0, left->as_register_lo(), right->as_register_lo());
__ set_cmp3(Rdst); // set result as follows: <: -1, =: 0, >: 1
} else {
ShouldNotReachHere();
@@ -1893,8 +1893,8 @@ void LIR_Assembler::emit_arraycopy(LIR_OpArrayCopy* op) {
__ add(src_pos, tmp, src_pos);
__ add(dst_pos, tmp, dst_pos);
__ cmpwi(CCR0, R3_RET, 0);
__ bc_far_optimized(Assembler::bcondCRbiIs1, __ bi0(CCR0, Assembler::less), *stub->entry());
__ cmpwi(CR0, R3_RET, 0);
__ bc_far_optimized(Assembler::bcondCRbiIs1, __ bi0(CR0, Assembler::less), *stub->entry());
__ bind(*stub->continuation());
return;
}
@@ -1910,12 +1910,12 @@ void LIR_Assembler::emit_arraycopy(LIR_OpArrayCopy* op) {
// Use only one conditional branch for simple checks.
if (simple_check_flag_set) {
ConditionRegister combined_check = CCR1, tmp_check = CCR1;
ConditionRegister combined_check = CR1, tmp_check = CR1;
// Make sure src and dst are non-null.
if (flags & LIR_OpArrayCopy::src_null_check) {
__ cmpdi(combined_check, src, 0);
tmp_check = CCR0;
tmp_check = CR0;
}
if (flags & LIR_OpArrayCopy::dst_null_check) {
@@ -1923,13 +1923,13 @@ void LIR_Assembler::emit_arraycopy(LIR_OpArrayCopy* op) {
if (tmp_check != combined_check) {
__ cror(combined_check, Assembler::equal, tmp_check, Assembler::equal);
}
tmp_check = CCR0;
tmp_check = CR0;
}
// Clear combined_check.eq if not already used.
if (tmp_check == combined_check) {
__ crandc(combined_check, Assembler::equal, combined_check, Assembler::equal);
tmp_check = CCR0;
tmp_check = CR0;
}
if (flags & LIR_OpArrayCopy::src_pos_positive_check) {
@@ -1960,15 +1960,15 @@ void LIR_Assembler::emit_arraycopy(LIR_OpArrayCopy* op) {
if (!(flags & LIR_OpArrayCopy::dst_objarray)) {
__ load_klass(tmp, dst);
__ lwz(tmp2, in_bytes(Klass::layout_helper_offset()), tmp);
__ cmpwi(CCR0, tmp2, Klass::_lh_neutral_value);
__ bge(CCR0, slow);
__ cmpwi(CR0, tmp2, Klass::_lh_neutral_value);
__ bge(CR0, slow);
}
if (!(flags & LIR_OpArrayCopy::src_objarray)) {
__ load_klass(tmp, src);
__ lwz(tmp2, in_bytes(Klass::layout_helper_offset()), tmp);
__ cmpwi(CCR0, tmp2, Klass::_lh_neutral_value);
__ bge(CCR0, slow);
__ cmpwi(CR0, tmp2, Klass::_lh_neutral_value);
__ bge(CR0, slow);
}
}
@@ -1979,16 +1979,16 @@ void LIR_Assembler::emit_arraycopy(LIR_OpArrayCopy* op) {
if (flags & LIR_OpArrayCopy::src_range_check) {
__ lwz(tmp2, arrayOopDesc::length_offset_in_bytes(), src);
__ add(tmp, length, src_pos);
__ cmpld(CCR0, tmp2, tmp);
__ ble(CCR0, slow);
__ cmpld(CR0, tmp2, tmp);
__ ble(CR0, slow);
}
__ extsw(dst_pos, dst_pos);
if (flags & LIR_OpArrayCopy::dst_range_check) {
__ lwz(tmp2, arrayOopDesc::length_offset_in_bytes(), dst);
__ add(tmp, length, dst_pos);
__ cmpld(CCR0, tmp2, tmp);
__ ble(CCR0, slow);
__ cmpld(CR0, tmp2, tmp);
__ ble(CR0, slow);
}
int shift = shift_amount(basic_type);
@@ -2003,8 +2003,8 @@ void LIR_Assembler::emit_arraycopy(LIR_OpArrayCopy* op) {
// We don't know the array types are compatible.
if (basic_type != T_OBJECT) {
// Simple test for basic type arrays.
__ cmp_klasses_from_objects(CCR0, src, dst, tmp, tmp2);
__ beq(CCR0, cont);
__ cmp_klasses_from_objects(CR0, src, dst, tmp, tmp2);
__ beq(CR0, cont);
} else {
// For object arrays, if src is a sub class of dst then we can
// safely do the copy.
@@ -2024,7 +2024,7 @@ void LIR_Assembler::emit_arraycopy(LIR_OpArrayCopy* op) {
__ calculate_address_from_global_toc(tmp, slow_stc, true, true, false);
__ mtctr(tmp);
__ bctrl(); // sets CR0
__ beq(CCR0, cont);
__ beq(CR0, cont);
if (copyfunc_addr != nullptr) { // Use stub if available.
__ bind(copyfunc);
@@ -2044,8 +2044,8 @@ void LIR_Assembler::emit_arraycopy(LIR_OpArrayCopy* op) {
jint objArray_lh = Klass::array_layout_helper(T_OBJECT);
__ load_const_optimized(tmp, objArray_lh);
__ cmpw(CCR0, tmp, tmp2);
__ bne(CCR0, slow);
__ cmpw(CR0, tmp, tmp2);
__ bne(CR0, slow);
}
Register src_ptr = R3_ARG1;
@@ -2080,8 +2080,8 @@ void LIR_Assembler::emit_arraycopy(LIR_OpArrayCopy* op) {
#ifndef PRODUCT
if (PrintC1Statistics) {
Label failed;
__ cmpwi(CCR0, R3_RET, 0);
__ bne(CCR0, failed);
__ cmpwi(CR0, R3_RET, 0);
__ bne(CR0, failed);
address counter = (address)&Runtime1::_arraycopy_checkcast_cnt;
int simm16_offs = __ load_const_optimized(tmp, counter, tmp2, true);
__ lwz(R11_scratch1, simm16_offs, tmp);
@@ -2092,8 +2092,8 @@ void LIR_Assembler::emit_arraycopy(LIR_OpArrayCopy* op) {
#endif
__ nand(tmp, R3_RET, R3_RET);
__ cmpwi(CCR0, R3_RET, 0);
__ beq(CCR0, *stub->continuation());
__ cmpwi(CR0, R3_RET, 0);
__ beq(CR0, *stub->continuation());
#ifndef PRODUCT
if (PrintC1Statistics) {
@@ -2126,15 +2126,15 @@ void LIR_Assembler::emit_arraycopy(LIR_OpArrayCopy* op) {
// but not necessarily exactly of type default_type.
Label known_ok, halt;
metadata2reg(default_type->constant_encoding(), tmp);
__ cmp_klass(CCR0, dst, tmp, R11_scratch1, R12_scratch2);
__ cmp_klass(CR0, dst, tmp, R11_scratch1, R12_scratch2);
if (basic_type != T_OBJECT) {
__ bne(CCR0, halt);
__ cmp_klass(CCR0, src, tmp, R11_scratch1, R12_scratch2);
__ beq(CCR0, known_ok);
__ bne(CR0, halt);
__ cmp_klass(CR0, src, tmp, R11_scratch1, R12_scratch2);
__ beq(CR0, known_ok);
} else {
__ beq(CCR0, known_ok);
__ cmpw(CCR0, src, dst);
__ beq(CCR0, known_ok);
__ beq(CR0, known_ok);
__ cmpw(CR0, src, dst);
__ beq(CR0, known_ok);
}
__ bind(halt);
__ stop("incorrect type information in arraycopy");
@@ -2269,8 +2269,8 @@ void LIR_Assembler::emit_alloc_obj(LIR_OpAllocObj* op) {
__ lbz(op->tmp1()->as_register(),
in_bytes(InstanceKlass::init_state_offset()), op->klass()->as_register());
// acquire barrier included in membar_storestore() which follows the allocation immediately.
__ cmpwi(CCR0, op->tmp1()->as_register(), InstanceKlass::fully_initialized);
__ bc_far_optimized(Assembler::bcondCRbiIs0, __ bi0(CCR0, Assembler::equal), *op->stub()->entry());
__ cmpwi(CR0, op->tmp1()->as_register(), InstanceKlass::fully_initialized);
__ bc_far_optimized(Assembler::bcondCRbiIs0, __ bi0(CR0, Assembler::equal), *op->stub()->entry());
}
__ allocate_object(op->obj()->as_register(),
op->tmp1()->as_register(),
@@ -2317,8 +2317,8 @@ void LIR_Assembler::type_profile_helper(Register mdo, int mdo_offset_bias,
// See if the receiver is receiver[n].
__ ld(tmp1, md->byte_offset_of_slot(data, ReceiverTypeData::receiver_offset(i)) - mdo_offset_bias, mdo);
__ verify_klass_ptr(tmp1);
__ cmpd(CCR0, recv, tmp1);
__ bne(CCR0, next_test);
__ cmpd(CR0, recv, tmp1);
__ bne(CR0, next_test);
__ ld(tmp1, md->byte_offset_of_slot(data, ReceiverTypeData::receiver_count_offset(i)) - mdo_offset_bias, mdo);
__ addi(tmp1, tmp1, DataLayout::counter_increment);
@@ -2332,8 +2332,8 @@ void LIR_Assembler::type_profile_helper(Register mdo, int mdo_offset_bias,
for (i = 0; i < VirtualCallData::row_limit(); i++) {
Label next_test;
__ ld(tmp1, md->byte_offset_of_slot(data, ReceiverTypeData::receiver_offset(i)) - mdo_offset_bias, mdo);
__ cmpdi(CCR0, tmp1, 0);
__ bne(CCR0, next_test);
__ cmpdi(CR0, tmp1, 0);
__ bne(CR0, next_test);
__ li(tmp1, DataLayout::counter_increment);
__ std(recv, md->byte_offset_of_slot(data, ReceiverTypeData::receiver_offset(i)) - mdo_offset_bias, mdo);
__ std(tmp1, md->byte_offset_of_slot(data, ReceiverTypeData::receiver_count_offset(i)) - mdo_offset_bias, mdo);
@@ -2394,8 +2394,8 @@ void LIR_Assembler::emit_typecheck_helper(LIR_OpTypeCheck *op, Label* success, L
Label not_null;
metadata2reg(md->constant_encoding(), mdo);
__ add_const_optimized(mdo, mdo, mdo_offset_bias, R0);
__ cmpdi(CCR0, obj, 0);
__ bne(CCR0, not_null);
__ cmpdi(CR0, obj, 0);
__ bne(CR0, not_null);
__ lbz(data_val, md->byte_offset_of_slot(data, DataLayout::flags_offset()) - mdo_offset_bias, mdo);
__ ori(data_val, data_val, BitData::null_seen_byte_constant());
__ stb(data_val, md->byte_offset_of_slot(data, DataLayout::flags_offset()) - mdo_offset_bias, mdo);
@@ -2412,8 +2412,8 @@ void LIR_Assembler::emit_typecheck_helper(LIR_OpTypeCheck *op, Label* success, L
__ std(Rtmp1, slot_offset, mdo);
__ bind(update_done);
} else {
__ cmpdi(CCR0, obj, 0);
__ beq(CCR0, *obj_is_null);
__ cmpdi(CR0, obj, 0);
__ beq(CR0, *obj_is_null);
}
// get object class
@@ -2427,8 +2427,8 @@ void LIR_Assembler::emit_typecheck_helper(LIR_OpTypeCheck *op, Label* success, L
if (op->fast_check()) {
assert_different_registers(klass_RInfo, k_RInfo);
__ cmpd(CCR0, k_RInfo, klass_RInfo);
__ beq(CCR0, *success);
__ cmpd(CR0, k_RInfo, klass_RInfo);
__ beq(CR0, *success);
// Fall through to failure case.
} else {
bool need_slow_path = true;
@@ -2462,7 +2462,7 @@ void LIR_Assembler::emit_typecheck_helper(LIR_OpTypeCheck *op, Label* success, L
__ mtctr(original_Rtmp1);
__ bctrl(); // sets CR0
if (keep_obj_alive) { __ mr(obj, dst); }
__ beq(CCR0, *success);
__ beq(CR0, *success);
// Fall through to failure case.
}
}
@@ -2501,8 +2501,8 @@ void LIR_Assembler::emit_opTypeCheck(LIR_OpTypeCheck* op) {
Register data_val = Rtmp1;
metadata2reg(md->constant_encoding(), mdo);
__ add_const_optimized(mdo, mdo, mdo_offset_bias, R0);
__ cmpdi(CCR0, value, 0);
__ bne(CCR0, not_null);
__ cmpdi(CR0, value, 0);
__ bne(CR0, not_null);
__ lbz(data_val, md->byte_offset_of_slot(data, DataLayout::flags_offset()) - mdo_offset_bias, mdo);
__ ori(data_val, data_val, BitData::null_seen_byte_constant());
__ stb(data_val, md->byte_offset_of_slot(data, DataLayout::flags_offset()) - mdo_offset_bias, mdo);
@@ -2519,8 +2519,8 @@ void LIR_Assembler::emit_opTypeCheck(LIR_OpTypeCheck* op) {
__ std(Rtmp1, slot_offset, mdo);
__ bind(update_done);
} else {
__ cmpdi(CCR0, value, 0);
__ beq(CCR0, done);
__ cmpdi(CR0, value, 0);
__ beq(CR0, done);
}
if (!os::zero_page_read_protected() || !ImplicitNullChecks) {
explicit_null_check(array, op->info_for_exception());
@@ -2543,7 +2543,7 @@ void LIR_Assembler::emit_opTypeCheck(LIR_OpTypeCheck* op) {
__ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(slow_path));
__ mtctr(R0);
__ bctrl(); // sets CR0
__ beq(CCR0, done);
__ beq(CR0, done);
__ bind(failure);
__ b(*stub->entry());
@@ -3024,9 +3024,9 @@ void LIR_Assembler::atomic_op(LIR_Code code, LIR_Opr src, LIR_Opr data, LIR_Opr
}
if (UseStaticBranchPredictionInCompareAndSwapPPC64) {
__ bne_predict_not_taken(CCR0, Lretry);
__ bne_predict_not_taken(CR0, Lretry);
} else {
__ bne( CCR0, Lretry);
__ bne( CR0, Lretry);
}
if (UseCompressedOops && data->is_oop()) {
@@ -3063,8 +3063,8 @@ void LIR_Assembler::emit_profile_type(LIR_OpProfileType* op) {
if (do_null) {
if (!TypeEntries::was_null_seen(current_klass)) {
__ cmpdi(CCR0, obj, 0);
__ bne(CCR0, Lupdate);
__ cmpdi(CR0, obj, 0);
__ bne(CR0, Lupdate);
__ ld(R0, index_or_disp(mdo_addr), mdo_addr->base()->as_pointer_register());
__ ori(R0, R0, TypeEntries::null_seen);
if (do_update) {
@@ -3074,14 +3074,14 @@ void LIR_Assembler::emit_profile_type(LIR_OpProfileType* op) {
}
} else {
if (do_update) {
__ cmpdi(CCR0, obj, 0);
__ beq(CCR0, Ldone);
__ cmpdi(CR0, obj, 0);
__ beq(CR0, Ldone);
}
}
#ifdef ASSERT
} else {
__ cmpdi(CCR0, obj, 0);
__ bne(CCR0, Lupdate);
__ cmpdi(CR0, obj, 0);
__ bne(CR0, Lupdate);
__ stop("unexpected null obj");
#endif
}
@@ -3097,8 +3097,8 @@ void LIR_Assembler::emit_profile_type(LIR_OpProfileType* op) {
klass_reg_used = true;
__ load_klass(klass, obj);
metadata2reg(exact_klass->constant_encoding(), R0);
__ cmpd(CCR0, klass, R0);
__ beq(CCR0, ok);
__ cmpd(CR0, klass, R0);
__ beq(CR0, ok);
__ stop("exact klass and actual klass differ");
__ bind(ok);
}
@@ -3118,20 +3118,20 @@ void LIR_Assembler::emit_profile_type(LIR_OpProfileType* op) {
// Like InterpreterMacroAssembler::profile_obj_type
__ clrrdi(R0, tmp, exact_log2(-TypeEntries::type_klass_mask));
// Basically same as andi(R0, tmp, TypeEntries::type_klass_mask);
__ cmpd(CCR1, R0, klass);
__ cmpd(CR1, R0, klass);
// Klass seen before, nothing to do (regardless of unknown bit).
//beq(CCR1, do_nothing);
//beq(CR1, do_nothing);
__ andi_(R0, tmp, TypeEntries::type_unknown);
// Already unknown. Nothing to do anymore.
//bne(CCR0, do_nothing);
__ crorc(CCR0, Assembler::equal, CCR1, Assembler::equal); // cr0 eq = cr1 eq or cr0 ne
__ beq(CCR0, Lnext);
//bne(CR0, do_nothing);
__ crorc(CR0, Assembler::equal, CR1, Assembler::equal); // cr0 eq = cr1 eq or cr0 ne
__ beq(CR0, Lnext);
if (TypeEntries::is_type_none(current_klass)) {
__ clrrdi_(R0, tmp, exact_log2(-TypeEntries::type_mask));
__ orr(R0, klass, tmp); // Combine klass and null_seen bit (only used if (tmp & type_mask)==0).
__ beq(CCR0, Ldo_update); // First time here. Set profile type.
__ beq(CR0, Ldo_update); // First time here. Set profile type.
}
} else {
@@ -3141,7 +3141,7 @@ void LIR_Assembler::emit_profile_type(LIR_OpProfileType* op) {
__ ld(tmp, index_or_disp(mdo_addr), mdo_addr->base()->as_pointer_register());
__ andi_(R0, tmp, TypeEntries::type_unknown);
// Already unknown. Nothing to do anymore.
__ bne(CCR0, Lnext);
__ bne(CR0, Lnext);
}
// Different than before. Cannot keep accurate profile.
@@ -3157,14 +3157,14 @@ void LIR_Assembler::emit_profile_type(LIR_OpProfileType* op) {
__ clrrdi(R0, tmp, exact_log2(-TypeEntries::type_klass_mask));
// Basically same as andi(R0, tmp, TypeEntries::type_klass_mask);
__ cmpd(CCR1, R0, klass);
__ cmpd(CR1, R0, klass);
// Klass seen before, nothing to do (regardless of unknown bit).
__ beq(CCR1, Lnext);
__ beq(CR1, Lnext);
#ifdef ASSERT
{
Label ok;
__ clrrdi_(R0, tmp, exact_log2(-TypeEntries::type_mask));
__ beq(CCR0, ok); // First time here.
__ beq(CR0, ok); // First time here.
__ stop("unexpected profiling mismatch");
__ bind(ok);
@@ -3178,7 +3178,7 @@ void LIR_Assembler::emit_profile_type(LIR_OpProfileType* op) {
// Already unknown. Nothing to do anymore.
__ andi_(R0, tmp, TypeEntries::type_unknown);
__ bne(CCR0, Lnext);
__ bne(CR0, Lnext);
// Different than before. Cannot keep accurate profile.
__ ori(R0, tmp, TypeEntries::type_unknown);

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 1999, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2024 SAP SE. All rights reserved.
* Copyright (c) 2012, 2025 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -86,8 +86,8 @@ void C1_MacroAssembler::lock_object(Register Rmark, Register Roop, Register Rbox
if (DiagnoseSyncOnValueBasedClasses != 0) {
load_klass(Rscratch, Roop);
lbz(Rscratch, in_bytes(Klass::misc_flags_offset()), Rscratch);
testbitdi(CCR0, R0, Rscratch, exact_log2(KlassFlags::_misc_is_value_based_class));
bne(CCR0, slow_int);
testbitdi(CR0, R0, Rscratch, exact_log2(KlassFlags::_misc_is_value_based_class));
bne(CR0, slow_int);
}
if (LockingMode == LM_LIGHTWEIGHT) {
@@ -101,7 +101,7 @@ void C1_MacroAssembler::lock_object(Register Rmark, Register Roop, Register Rbox
// Compare object markWord with Rmark and if equal exchange Rscratch with object markWord.
assert(oopDesc::mark_offset_in_bytes() == 0, "cas must take a zero displacement");
cmpxchgd(/*flag=*/CCR0,
cmpxchgd(/*flag=*/CR0,
/*current_value=*/Rscratch,
/*compare_value=*/Rmark,
/*exchange_value=*/Rbox,
@@ -128,7 +128,7 @@ void C1_MacroAssembler::lock_object(Register Rmark, Register Roop, Register Rbox
load_const_optimized(R0, (~(os::vm_page_size()-1) | markWord::lock_mask_in_place));
and_(R0/*==0?*/, Rscratch, R0);
std(R0/*==0, perhaps*/, BasicLock::displaced_header_offset_in_bytes(), Rbox);
bne(CCR0, slow_int);
bne(CR0, slow_int);
}
bind(done);
@@ -149,8 +149,8 @@ void C1_MacroAssembler::unlock_object(Register Rmark, Register Roop, Register Rb
if (LockingMode != LM_LIGHTWEIGHT) {
// Test first if it is a fast recursive unlock.
ld(Rmark, BasicLock::displaced_header_offset_in_bytes(), Rbox);
cmpdi(CCR0, Rmark, 0);
beq(CCR0, done);
cmpdi(CR0, Rmark, 0);
beq(CR0, done);
}
// Load object.
@@ -162,7 +162,7 @@ void C1_MacroAssembler::unlock_object(Register Rmark, Register Roop, Register Rb
} else if (LockingMode == LM_LEGACY) {
// Check if it is still a light weight lock, this is is true if we see
// the stack address of the basicLock in the markWord of the object.
cmpxchgd(/*flag=*/CCR0,
cmpxchgd(/*flag=*/CR0,
/*current_value=*/R0,
/*compare_value=*/Rbox,
/*exchange_value=*/Rmark,
@@ -285,9 +285,9 @@ void C1_MacroAssembler::initialize_object(
{
lwz(t1, in_bytes(Klass::layout_helper_offset()), klass);
if (var_size_in_bytes != noreg) {
cmpw(CCR0, t1, var_size_in_bytes);
cmpw(CR0, t1, var_size_in_bytes);
} else {
cmpwi(CCR0, t1, con_size_in_bytes);
cmpwi(CR0, t1, con_size_in_bytes);
}
asm_assert_eq("bad size in initialize_object");
}
@@ -340,8 +340,8 @@ void C1_MacroAssembler::allocate_array(
if (max_tlab < max_length) { max_length = max_tlab; }
}
load_const_optimized(t1, max_length);
cmpld(CCR0, len, t1);
bc_far_optimized(Assembler::bcondCRbiIs1, bi0(CCR0, Assembler::greater), slow_case);
cmpld(CR0, len, t1);
bc_far_optimized(Assembler::bcondCRbiIs1, bi0(CR0, Assembler::greater), slow_case);
// compute array size
// note: If 0 <= len <= max_length, len*elt_size + header + alignment is
@@ -399,8 +399,8 @@ void C1_MacroAssembler::verify_stack_oop(int stack_offset) {
void C1_MacroAssembler::verify_not_null_oop(Register r) {
Label not_null;
cmpdi(CCR0, r, 0);
bne(CCR0, not_null);
cmpdi(CR0, r, 0);
bne(CR0, not_null);
stop("non-null oop required");
bind(not_null);
verify_oop(r, FILE_AND_LINE);
@@ -414,7 +414,7 @@ void C1_MacroAssembler::null_check(Register r, Label* Lnull) {
} else { // explicit
//const address exception_entry = Runtime1::entry_for(C1StubId::throw_null_pointer_exception_id);
assert(Lnull != nullptr, "must have Label for explicit check");
cmpdi(CCR0, r, 0);
bc_far_optimized(Assembler::bcondCRbiIs1, bi0(CCR0, Assembler::equal), *Lnull);
cmpdi(CR0, r, 0);
bc_far_optimized(Assembler::bcondCRbiIs1, bi0(CR0, Assembler::equal), *Lnull);
}
}

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 1999, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2023 SAP SE. All rights reserved.
* Copyright (c) 2012, 2025 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -69,14 +69,14 @@ int StubAssembler::call_RT(Register oop_result1, Register metadata_result,
// Check for pending exceptions.
{
ld(R0, in_bytes(Thread::pending_exception_offset()), R16_thread);
cmpdi(CCR0, R0, 0);
cmpdi(CR0, R0, 0);
// This used to conditionally jump to forward_exception however it is
// possible if we relocate that the branch will not reach. So we must jump
// around so we can always reach.
Label ok;
beq(CCR0, ok);
beq(CR0, ok);
// Make sure that the vm_results are cleared.
if (oop_result1->is_valid() || metadata_result->is_valid()) {
@@ -368,7 +368,7 @@ OopMapSet* Runtime1::generate_patching(StubAssembler* sasm, address target) {
int call_offset = __ call_RT(noreg, noreg, target);
OopMapSet* oop_maps = new OopMapSet();
oop_maps->add_gc_map(call_offset, oop_map);
__ cmpdi(CCR0, R3_RET, 0);
__ cmpdi(CR0, R3_RET, 0);
// Re-execute the patched instruction or, if the nmethod was deoptmized,
// return to the deoptimization handler entry that will cause re-execution
@@ -382,7 +382,7 @@ OopMapSet* Runtime1::generate_patching(StubAssembler* sasm, address target) {
restore_live_registers(sasm, noreg, noreg);
// Return if patching routine returned 0.
__ bclr(Assembler::bcondCRbiIs1, Assembler::bi0(CCR0, Assembler::equal), Assembler::bhintbhBCLRisReturn);
__ bclr(Assembler::bcondCRbiIs1, Assembler::bi0(CR0, Assembler::equal), Assembler::bhintbhBCLRisReturn);
address stub = deopt_blob->unpack_with_reexecution();
//__ load_const_optimized(R0, stub);
@@ -448,8 +448,8 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
Label ok;
__ lwz(R0, in_bytes(Klass::layout_helper_offset()), R4_ARG2);
__ srawi(R0, R0, Klass::_lh_array_tag_shift);
__ cmpwi(CCR0, R0, tag);
__ beq(CCR0, ok);
__ cmpwi(CR0, R0, tag);
__ beq(CR0, ok);
__ stop("assert(is an array klass)");
__ should_not_reach_here();
__ bind(ok);
@@ -485,9 +485,9 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
// Load the klass and check the has finalizer flag.
__ load_klass(t, R3_ARG1);
__ lbz(t, in_bytes(Klass::misc_flags_offset()), t);
__ testbitdi(CCR0, R0, t, exact_log2(KlassFlags::_misc_has_finalizer));
__ testbitdi(CR0, R0, t, exact_log2(KlassFlags::_misc_has_finalizer));
// Return if has_finalizer bit == 0 (CR0.eq).
__ bclr(Assembler::bcondCRbiIs1, Assembler::bi0(CCR0, Assembler::equal), Assembler::bhintbhBCLRisReturn);
__ bclr(Assembler::bcondCRbiIs1, Assembler::bi0(CR0, Assembler::equal), Assembler::bhintbhBCLRisReturn);
__ mflr(R0);
__ std(R0, _abi0(lr), R1_SP);
@@ -602,10 +602,9 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
{ // Support for uint StubRoutine::partial_subtype_check( Klass sub, Klass super );
const Register sub_klass = R5,
super_klass = R4,
temp1_reg = R6,
temp2_reg = R0;
__ check_klass_subtype_slow_path(sub_klass, super_klass, temp1_reg, temp2_reg); // returns with CR0.eq if successful
__ crandc(CCR0, Assembler::equal, CCR0, Assembler::equal); // failed: CR0.ne
temp1_reg = R6;
__ check_klass_subtype_slow_path(sub_klass, super_klass, temp1_reg, noreg);
// Result is in CR0.
__ blr();
}
break;
@@ -806,10 +805,10 @@ OopMapSet* Runtime1::generate_handle_exception(C1StubId id, StubAssembler* sasm)
// Check that fields in JavaThread for exception oop and issuing pc are
// empty before writing to them.
__ ld(R0, in_bytes(JavaThread::exception_oop_offset()), R16_thread);
__ cmpdi(CCR0, R0, 0);
__ cmpdi(CR0, R0, 0);
__ asm_assert_eq("exception oop already set");
__ ld(R0, in_bytes(JavaThread::exception_pc_offset() ), R16_thread);
__ cmpdi(CCR0, R0, 0);
__ cmpdi(CR0, R0, 0);
__ asm_assert_eq("exception pc already set");
#endif

View File

@@ -70,7 +70,7 @@ void C2_MacroAssembler::string_compress_16(Register src, Register dst, Register
// Check if cnt >= 8 (= 16 bytes)
lis(tmp1, byte_mask); // tmp1 = 0x00FF00FF00FF00FF (non ascii case)
srwi_(tmp2, cnt, 3);
beq(CCR0, Lslow);
beq(CR0, Lslow);
ori(tmp1, tmp1, byte_mask);
rldimi(tmp1, tmp1, 32, 0);
mtctr(tmp2);
@@ -87,7 +87,7 @@ void C2_MacroAssembler::string_compress_16(Register src, Register dst, Register
rldimi(tmp4, tmp4, 2*8, 2*8); // _4_6_7_7
andc_(tmp0, tmp0, tmp1);
bne(CCR0, Lfailure); // Not latin1/ascii.
bne(CR0, Lfailure); // Not latin1/ascii.
addi(src, src, 16);
rlwimi(tmp3, tmp2, 0*8, 24, 31);// _____1_3
@@ -115,8 +115,8 @@ void C2_MacroAssembler::string_compress(Register src, Register dst, Register cnt
bind(Lloop);
lhz(tmp, 0, src);
cmplwi(CCR0, tmp, byte_mask);
bgt(CCR0, Lfailure); // Not latin1/ascii.
cmplwi(CR0, tmp, byte_mask);
bgt(CR0, Lfailure); // Not latin1/ascii.
addi(src, src, 2);
stb(tmp, 0, dst);
addi(dst, dst, 1);
@@ -130,7 +130,7 @@ void C2_MacroAssembler::encode_iso_array(Register src, Register dst, Register le
string_compress_16(src, dst, len, tmp1, tmp2, tmp3, tmp4, tmp5, Lfailure1, ascii);
rldicl_(result, len, 0, 64-3); // Remaining characters.
beq(CCR0, Ldone);
beq(CR0, Ldone);
bind(Lslow);
string_compress(src, dst, result, tmp2, Lfailure2, ascii);
li(result, 0);
@@ -140,7 +140,7 @@ void C2_MacroAssembler::encode_iso_array(Register src, Register dst, Register le
mr(result, len);
mfctr(tmp1);
rldimi_(result, tmp1, 3, 0); // Remaining characters.
beq(CCR0, Ldone);
beq(CR0, Ldone);
b(Lslow);
bind(Lfailure2);
@@ -159,7 +159,7 @@ void C2_MacroAssembler::string_inflate_16(Register src, Register dst, Register c
// Check if cnt >= 8
srwi_(tmp2, cnt, 3);
beq(CCR0, Lslow);
beq(CR0, Lslow);
lis(tmp1, 0xFF); // tmp1 = 0x00FF00FF
ori(tmp1, tmp1, 0xFF);
mtctr(tmp2);
@@ -235,10 +235,10 @@ void C2_MacroAssembler::string_compare(Register str1, Register str2,
subf_(diff, cnt2, cnt1); // diff = cnt1 - cnt2
// if (diff > 0) { cnt1 = cnt2; }
if (VM_Version::has_isel()) {
isel(cnt1, CCR0, Assembler::greater, /*invert*/ false, cnt2);
isel(cnt1, CR0, Assembler::greater, /*invert*/ false, cnt2);
} else {
Label Lskip;
blt(CCR0, Lskip);
blt(CR0, Lskip);
mr(cnt1, cnt2);
bind(Lskip);
}
@@ -254,7 +254,7 @@ void C2_MacroAssembler::string_compare(Register str1, Register str2,
Label Lfastloop, Lskipfast;
srwi_(tmp0, cnt1, log2_chars_per_iter);
beq(CCR0, Lskipfast);
beq(CR0, Lskipfast);
rldicl(cnt2, cnt1, 0, 64 - log2_chars_per_iter); // Remaining characters.
li(cnt1, 1 << log2_chars_per_iter); // Initialize for failure case: Rescan characters from current iteration.
mtctr(tmp0);
@@ -262,8 +262,8 @@ void C2_MacroAssembler::string_compare(Register str1, Register str2,
bind(Lfastloop);
ld(chr1, 0, str1);
ld(chr2, 0, str2);
cmpd(CCR0, chr1, chr2);
bne(CCR0, Lslow);
cmpd(CR0, chr1, chr2);
bne(CR0, Lslow);
addi(str1, str1, stride1);
addi(str2, str2, stride2);
bdnz(Lfastloop);
@@ -272,8 +272,8 @@ void C2_MacroAssembler::string_compare(Register str1, Register str2,
}
// Loop which searches the first difference character by character.
cmpwi(CCR0, cnt1, 0);
beq(CCR0, Lreturn_diff);
cmpwi(CR0, cnt1, 0);
beq(CR0, Lreturn_diff);
bind(Lslow);
mtctr(cnt1);
@@ -289,7 +289,7 @@ void C2_MacroAssembler::string_compare(Register str1, Register str2,
if (stride1 == 1) { lbz(chr1, 0, str1); } else { lhz(chr1, 0, str1); }
if (stride2 == 1) { lbz(chr2, 0, str2); } else { lhz(chr2, 0, str2); }
subf_(result, chr2, chr1); // result = chr1 - chr2
bne(CCR0, Ldone);
bne(CR0, Ldone);
addi(str1, str1, stride1);
addi(str2, str2, stride2);
bdnz(Lloop);
@@ -317,23 +317,23 @@ void C2_MacroAssembler::array_equals(bool is_array_equ, Register ary1, Register
const int base_offset = arrayOopDesc::base_offset_in_bytes(is_byte ? T_BYTE : T_CHAR);
// Return true if the same array.
cmpd(CCR0, ary1, ary2);
beq(CCR0, Lskiploop);
cmpd(CR0, ary1, ary2);
beq(CR0, Lskiploop);
// Return false if one of them is null.
cmpdi(CCR0, ary1, 0);
cmpdi(CCR1, ary2, 0);
cmpdi(CR0, ary1, 0);
cmpdi(CR1, ary2, 0);
li(result, 0);
cror(CCR0, Assembler::equal, CCR1, Assembler::equal);
beq(CCR0, Ldone);
cror(CR0, Assembler::equal, CR1, Assembler::equal);
beq(CR0, Ldone);
// Load the lengths of arrays.
lwz(limit, length_offset, ary1);
lwz(tmp0, length_offset, ary2);
// Return false if the two arrays are not equal length.
cmpw(CCR0, limit, tmp0);
bne(CCR0, Ldone);
cmpw(CR0, limit, tmp0);
bne(CR0, Ldone);
// Load array addresses.
addi(ary1, ary1, base_offset);
@@ -351,7 +351,7 @@ void C2_MacroAssembler::array_equals(bool is_array_equ, Register ary1, Register
const int log2_chars_per_iter = is_byte ? 3 : 2;
srwi_(tmp0, limit, log2_chars_per_iter + (limit_needs_shift ? 1 : 0));
beq(CCR0, Lskipfast);
beq(CR0, Lskipfast);
mtctr(tmp0);
bind(Lfastloop);
@@ -359,13 +359,13 @@ void C2_MacroAssembler::array_equals(bool is_array_equ, Register ary1, Register
ld(chr2, 0, ary2);
addi(ary1, ary1, 8);
addi(ary2, ary2, 8);
cmpd(CCR0, chr1, chr2);
bne(CCR0, Ldone);
cmpd(CR0, chr1, chr2);
bne(CR0, Ldone);
bdnz(Lfastloop);
bind(Lskipfast);
rldicl_(limit, limit, limit_needs_shift ? 64 - 1 : 0, 64 - log2_chars_per_iter); // Remaining characters.
beq(CCR0, Lskiploop);
beq(CR0, Lskiploop);
mtctr(limit);
// Character by character.
@@ -381,8 +381,8 @@ void C2_MacroAssembler::array_equals(bool is_array_equ, Register ary1, Register
addi(ary1, ary1, 2);
addi(ary2, ary2, 2);
}
cmpw(CCR0, chr1, chr2);
bne(CCR0, Ldone);
cmpw(CR0, chr1, chr2);
bne(CR0, Ldone);
bdnz(Lloop);
bind(Lskiploop);
@@ -414,9 +414,9 @@ void C2_MacroAssembler::string_indexof(Register result, Register haystack, Regis
clrldi(haycnt, haycnt, 32); // Ensure positive int is valid as 64 bit value.
addi(addr, haystack, -h_csize); // Accesses use pre-increment.
if (needlecntval == 0) { // variable needlecnt
cmpwi(CCR6, needlecnt, 2);
cmpwi(CR6, needlecnt, 2);
clrldi(needlecnt, needlecnt, 32); // Ensure positive int is valid as 64 bit value.
blt(CCR6, L_TooShort); // Variable needlecnt: handle short needle separately.
blt(CR6, L_TooShort); // Variable needlecnt: handle short needle separately.
}
if (n_csize == 2) { lwz(n_start, 0, needle); } else { lhz(n_start, 0, needle); } // Load first 2 characters of needle.
@@ -447,7 +447,7 @@ void C2_MacroAssembler::string_indexof(Register result, Register haystack, Regis
subf(addr_diff, addr, last_addr); // Difference between already checked address and last address to check.
addi(addr, addr, h_csize); // This is the new address we want to use for comparing.
srdi_(ch2, addr_diff, h_csize);
beq(CCR0, L_FinalCheck); // 2 characters left?
beq(CR0, L_FinalCheck); // 2 characters left?
mtctr(ch2); // num of characters / 2
bind(L_InnerLoop); // Main work horse (2x unrolled search loop)
if (h_csize == 2) { // Load 2 characters of haystack (ignore alignment).
@@ -457,18 +457,18 @@ void C2_MacroAssembler::string_indexof(Register result, Register haystack, Regis
lhz(ch1, 0, addr);
lhz(ch2, 1, addr);
}
cmpw(CCR0, ch1, n_start); // Compare 2 characters (1 would be sufficient but try to reduce branches to CompLoop).
cmpw(CCR1, ch2, n_start);
beq(CCR0, L_Comp1); // Did we find the needle start?
beq(CCR1, L_Comp2);
cmpw(CR0, ch1, n_start); // Compare 2 characters (1 would be sufficient but try to reduce branches to CompLoop).
cmpw(CR1, ch2, n_start);
beq(CR0, L_Comp1); // Did we find the needle start?
beq(CR1, L_Comp2);
addi(addr, addr, 2 * h_csize);
bdnz(L_InnerLoop);
bind(L_FinalCheck);
andi_(addr_diff, addr_diff, h_csize); // Remaining characters not covered by InnerLoop: (num of characters) & 1.
beq(CCR0, L_NotFound);
beq(CR0, L_NotFound);
if (h_csize == 2) { lwz(ch1, 0, addr); } else { lhz(ch1, 0, addr); } // One position left at which we have to compare.
cmpw(CCR1, ch1, n_start);
beq(CCR1, L_Comp1);
cmpw(CR1, ch1, n_start);
beq(CR1, L_Comp1);
bind(L_NotFound);
li(result, -1); // not found
b(L_End);
@@ -483,8 +483,8 @@ void C2_MacroAssembler::string_indexof(Register result, Register haystack, Regis
if (n_csize == 2) { lhz(n_start, 0, needle); } else { lbz(n_start, 0, needle); } // First character of needle
bind(L_OneCharLoop);
if (h_csize == 2) { lhzu(ch1, 2, addr); } else { lbzu(ch1, 1, addr); }
cmpw(CCR1, ch1, n_start);
beq(CCR1, L_Found); // Did we find the one character needle?
cmpw(CR1, ch1, n_start);
beq(CR1, L_Found); // Did we find the one character needle?
bdnz(L_OneCharLoop);
li(result, -1); // Not found.
b(L_End);
@@ -500,7 +500,7 @@ void C2_MacroAssembler::string_indexof(Register result, Register haystack, Regis
bind(L_Comp1); // Addr points to possible needle start.
if (needlecntval != 2) { // Const needlecnt==2?
if (needlecntval != 3) {
if (needlecntval == 0) { beq(CCR6, L_Found); } // Variable needlecnt==2?
if (needlecntval == 0) { beq(CR6, L_Found); } // Variable needlecnt==2?
Register n_ind = tmp4,
h_ind = n_ind;
li(n_ind, 2 * n_csize); // First 2 characters are already compared, use index 2.
@@ -513,15 +513,15 @@ void C2_MacroAssembler::string_indexof(Register result, Register haystack, Regis
}
if (n_csize == 2) { lhzx(ch2, needle, n_ind); } else { lbzx(ch2, needle, n_ind); }
if (h_csize == 2) { lhzx(ch1, addr, h_ind); } else { lbzx(ch1, addr, h_ind); }
cmpw(CCR1, ch1, ch2);
bne(CCR1, L_OuterLoop);
cmpw(CR1, ch1, ch2);
bne(CR1, L_OuterLoop);
addi(n_ind, n_ind, n_csize);
bdnz(L_CompLoop);
} else { // No loop required if there's only one needle character left.
if (n_csize == 2) { lhz(ch2, 2 * 2, needle); } else { lbz(ch2, 2 * 1, needle); }
if (h_csize == 2) { lhz(ch1, 2 * 2, addr); } else { lbz(ch1, 2 * 1, addr); }
cmpw(CCR1, ch1, ch2);
bne(CCR1, L_OuterLoop);
cmpw(CR1, ch1, ch2);
bne(CR1, L_OuterLoop);
}
}
// Return index ...
@@ -545,7 +545,7 @@ void C2_MacroAssembler::string_indexof_char(Register result, Register haystack,
//4:
srwi_(tmp2, haycnt, 1); // Shift right by exact_log2(UNROLL_FACTOR).
mr(addr, haystack);
beq(CCR0, L_FinalCheck);
beq(CR0, L_FinalCheck);
mtctr(tmp2); // Move to count register.
//8:
bind(L_InnerLoop); // Main work horse (2x unrolled search loop).
@@ -556,19 +556,19 @@ void C2_MacroAssembler::string_indexof_char(Register result, Register haystack,
lbz(ch1, 0, addr);
lbz(ch2, 1, addr);
}
(needle != R0) ? cmpw(CCR0, ch1, needle) : cmplwi(CCR0, ch1, (unsigned int)needleChar);
(needle != R0) ? cmpw(CCR1, ch2, needle) : cmplwi(CCR1, ch2, (unsigned int)needleChar);
beq(CCR0, L_Found1); // Did we find the needle?
beq(CCR1, L_Found2);
(needle != R0) ? cmpw(CR0, ch1, needle) : cmplwi(CR0, ch1, (unsigned int)needleChar);
(needle != R0) ? cmpw(CR1, ch2, needle) : cmplwi(CR1, ch2, (unsigned int)needleChar);
beq(CR0, L_Found1); // Did we find the needle?
beq(CR1, L_Found2);
addi(addr, addr, 2 * h_csize);
bdnz(L_InnerLoop);
//16:
bind(L_FinalCheck);
andi_(R0, haycnt, 1);
beq(CCR0, L_NotFound);
beq(CR0, L_NotFound);
if (!is_byte) { lhz(ch1, 0, addr); } else { lbz(ch1, 0, addr); } // One position left at which we have to compare.
(needle != R0) ? cmpw(CCR1, ch1, needle) : cmplwi(CCR1, ch1, (unsigned int)needleChar);
beq(CCR1, L_Found1);
(needle != R0) ? cmpw(CR1, ch1, needle) : cmplwi(CR1, ch1, (unsigned int)needleChar);
beq(CR1, L_Found1);
//21:
bind(L_NotFound);
li(result, -1); // Not found.
@@ -594,7 +594,7 @@ void C2_MacroAssembler::count_positives(Register src, Register cnt, Register res
lis(tmp1, (int)(short)0x8080); // tmp1 = 0x8080808080808080
srwi_(tmp2, cnt, 4);
mr(result, src); // Use result reg to point to the current position.
beq(CCR0, Lslow);
beq(CR0, Lslow);
ori(tmp1, tmp1, 0x8080);
rldimi(tmp1, tmp1, 32, 0);
mtctr(tmp2);
@@ -607,19 +607,19 @@ void C2_MacroAssembler::count_positives(Register src, Register cnt, Register res
orr(tmp0, tmp2, tmp0);
and_(tmp0, tmp0, tmp1);
bne(CCR0, Lslow); // Found negative byte.
bne(CR0, Lslow); // Found negative byte.
addi(result, result, 16);
bdnz(Lfastloop);
bind(Lslow); // Fallback to slow version.
subf(tmp0, src, result); // Bytes known positive.
subf_(tmp0, tmp0, cnt); // Remaining Bytes.
beq(CCR0, Ldone);
beq(CR0, Ldone);
mtctr(tmp0);
bind(Lloop);
lbz(tmp0, 0, result);
andi_(tmp0, tmp0, 0x80);
bne(CCR0, Ldone); // Found negative byte.
bne(CR0, Ldone); // Found negative byte.
addi(result, result, 1);
bdnz(Lloop);

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, 2024 SAP SE. All rights reserved.
* Copyright (c) 2020, 2025 SAP SE. All rights reserved.
* Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -282,8 +282,8 @@ void DowncallLinker::StubGenerator::generate() {
__ safepoint_poll(L_safepoint_poll_slow_path, tmp, true /* at_return */, false /* in_nmethod */);
__ lwz(tmp, in_bytes(JavaThread::suspend_flags_offset()), R16_thread);
__ cmpwi(CCR0, tmp, 0);
__ bne(CCR0, L_safepoint_poll_slow_path);
__ cmpwi(CR0, tmp, 0);
__ bne(CR0, L_safepoint_poll_slow_path);
__ bind(L_after_safepoint_poll);
// change thread state
@@ -293,8 +293,8 @@ void DowncallLinker::StubGenerator::generate() {
__ block_comment("reguard stack check");
__ lwz(tmp, in_bytes(JavaThread::stack_guard_state_offset()), R16_thread);
__ cmpwi(CCR0, tmp, StackOverflow::stack_guard_yellow_reserved_disabled);
__ beq(CCR0, L_reguard);
__ cmpwi(CR0, tmp, StackOverflow::stack_guard_yellow_reserved_disabled);
__ beq(CR0, L_reguard);
__ bind(L_after_reguard);
__ reset_last_Java_frame();

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2024 SAP SE. All rights reserved.
* Copyright (c) 2018, 2025 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -51,7 +51,7 @@ static void generate_marking_inactive_test(MacroAssembler* masm) {
int active_offset = in_bytes(G1ThreadLocalData::satb_mark_queue_active_offset());
assert(in_bytes(SATBMarkQueue::byte_width_of_active()) == 1, "Assumption");
__ lbz(R0, active_offset, R16_thread); // tmp1 := *(mark queue active address)
__ cmpwi(CCR0, R0, 0);
__ cmpwi(CR0, R0, 0);
}
void G1BarrierSetAssembler::gen_write_ref_array_pre_barrier(MacroAssembler* masm, DecoratorSet decorators,
@@ -68,7 +68,7 @@ void G1BarrierSetAssembler::gen_write_ref_array_pre_barrier(MacroAssembler* masm
// Is marking active?
generate_marking_inactive_test(masm);
__ beq(CCR0, filtered);
__ beq(CR0, filtered);
__ save_LR(R0);
__ push_frame(frame_size, R0);
@@ -118,8 +118,8 @@ static void generate_queue_insertion(MacroAssembler* masm, ByteSize index_offset
// Can we store a value in the given thread's buffer?
// (The index field is typed as size_t.)
__ ld(temp, in_bytes(index_offset), R16_thread); // temp := *(index address)
__ cmpdi(CCR0, temp, 0); // jump to runtime if index == 0 (full buffer)
__ beq(CCR0, runtime);
__ cmpdi(CR0, temp, 0); // jump to runtime if index == 0 (full buffer)
__ beq(CR0, runtime);
// The buffer is not full, store value into it.
__ ld(R0, in_bytes(buffer_offset), R16_thread); // R0 := buffer address
__ addi(temp, temp, -wordSize); // temp := next index
@@ -154,7 +154,7 @@ void G1BarrierSetAssembler::g1_write_barrier_pre(MacroAssembler* masm, Decorator
Label runtime, filtered;
generate_marking_inactive_test(masm);
__ beq(CCR0, filtered);
__ beq(CR0, filtered);
// Do we need to load the previous value?
if (!preloaded) {
@@ -171,12 +171,12 @@ void G1BarrierSetAssembler::g1_write_barrier_pre(MacroAssembler* masm, Decorator
// Is the previous value null?
if (preloaded && not_null) {
#ifdef ASSERT
__ cmpdi(CCR0, pre_val, 0);
__ cmpdi(CR0, pre_val, 0);
__ asm_assert_ne("null oop not allowed (G1 pre)"); // Checked by caller.
#endif
} else {
__ cmpdi(CCR0, pre_val, 0);
__ beq(CCR0, filtered);
__ cmpdi(CR0, pre_val, 0);
__ beq(CR0, filtered);
}
if (!preloaded && UseCompressedOops) {
@@ -240,14 +240,14 @@ static Address generate_card_young_test(MacroAssembler* masm, const Register sto
__ load_const_optimized(tmp1, (address)(ct->card_table()->byte_map_base()), tmp2);
__ srdi(tmp2, store_addr, CardTable::card_shift()); // tmp1 := card address relative to card table base
__ lbzx(R0, tmp1, tmp2); // tmp1 := card address
__ cmpwi(CCR0, R0, (int)G1CardTable::g1_young_card_val());
__ cmpwi(CR0, R0, (int)G1CardTable::g1_young_card_val());
return Address(tmp1, tmp2); // return card address
}
static void generate_card_dirty_test(MacroAssembler* masm, Address card_addr) {
__ membar(Assembler::StoreLoad); // Must reload after StoreLoad membar due to concurrent refinement
__ lbzx(R0, card_addr.base(), card_addr.index()); // tmp2 := card
__ cmpwi(CCR0, R0, (int)G1CardTable::dirty_card_val()); // tmp2 := card == dirty_card_val?
__ cmpwi(CR0, R0, (int)G1CardTable::dirty_card_val()); // tmp2 := card == dirty_card_val?
}
void G1BarrierSetAssembler::g1_write_barrier_post(MacroAssembler* masm, DecoratorSet decorators,
@@ -262,24 +262,24 @@ void G1BarrierSetAssembler::g1_write_barrier_post(MacroAssembler* masm, Decorato
CardTableBarrierSet* ct = barrier_set_cast<CardTableBarrierSet>(BarrierSet::barrier_set());
generate_region_crossing_test(masm, store_addr, new_val);
__ beq(CCR0, filtered);
__ beq(CR0, filtered);
// Crosses regions, storing null?
if (not_null) {
#ifdef ASSERT
__ cmpdi(CCR0, new_val, 0);
__ cmpdi(CR0, new_val, 0);
__ asm_assert_ne("null oop not allowed (G1 post)"); // Checked by caller.
#endif
} else {
__ cmpdi(CCR0, new_val, 0);
__ beq(CCR0, filtered);
__ cmpdi(CR0, new_val, 0);
__ beq(CR0, filtered);
}
Address card_addr = generate_card_young_test(masm, store_addr, tmp1, tmp2);
__ beq(CCR0, filtered);
__ beq(CR0, filtered);
generate_card_dirty_test(masm, card_addr);
__ beq(CCR0, filtered);
__ beq(CR0, filtered);
__ li(R0, (int)G1CardTable::dirty_card_val());
__ stbx(R0, card_addr.base(), card_addr.index()); // *(card address) := dirty_card_val
@@ -371,14 +371,14 @@ void G1BarrierSetAssembler::resolve_jobject(MacroAssembler* masm, Register value
Register tmp1, Register tmp2,
MacroAssembler::PreservationLevel preservation_level) {
Label done, not_weak;
__ cmpdi(CCR0, value, 0);
__ beq(CCR0, done); // Use null as-is.
__ cmpdi(CR0, value, 0);
__ beq(CR0, done); // Use null as-is.
__ clrrdi(tmp1, value, JNIHandles::tag_size);
__ andi_(tmp2, value, JNIHandles::TypeTag::weak_global);
__ ld(value, 0, tmp1); // Resolve (untagged) jobject.
__ beq(CCR0, not_weak); // Test for jweak tag.
__ beq(CR0, not_weak); // Test for jweak tag.
__ verify_oop(value, FILE_AND_LINE);
g1_write_barrier_pre(masm, IN_NATIVE | ON_PHANTOM_OOP_REF,
noreg, noreg, value,
@@ -409,7 +409,7 @@ void G1BarrierSetAssembler::g1_write_barrier_pre_c2(MacroAssembler* masm,
stub->initialize_registers(obj, pre_val, R16_thread, tmp1, tmp2);
generate_marking_inactive_test(masm);
__ bc_far_optimized(Assembler::bcondCRbiIs0, __ bi0(CCR0, Assembler::equal), *stub->entry());
__ bc_far_optimized(Assembler::bcondCRbiIs0, __ bi0(CR0, Assembler::equal), *stub->entry());
__ bind(*stub->continuation());
}
@@ -433,8 +433,8 @@ void G1BarrierSetAssembler::generate_c2_pre_barrier_stub(MacroAssembler* masm,
__ ld(pre_val, 0, obj);
}
}
__ cmpdi(CCR0, pre_val, 0);
__ bc_far_optimized(Assembler::bcondCRbiIs1, __ bi0(CCR0, Assembler::equal), *stub->continuation());
__ cmpdi(CR0, pre_val, 0);
__ bc_far_optimized(Assembler::bcondCRbiIs1, __ bi0(CR0, Assembler::equal), *stub->continuation());
Register pre_val_decoded = pre_val;
if (UseCompressedOops) {
@@ -472,25 +472,25 @@ void G1BarrierSetAssembler::g1_write_barrier_post_c2(MacroAssembler* masm,
if (null_check_required && CompressedOops::base() != nullptr) {
// We prefer doing the null check after the region crossing check.
// Only compressed oop modes with base != null require a null check here.
__ cmpwi(CCR0, new_val, 0);
__ beq(CCR0, *stub->continuation());
__ cmpwi(CR0, new_val, 0);
__ beq(CR0, *stub->continuation());
null_check_required = false;
}
new_val_decoded = __ decode_heap_oop_not_null(tmp2, new_val);
}
generate_region_crossing_test(masm, store_addr, new_val_decoded);
__ beq(CCR0, *stub->continuation());
__ beq(CR0, *stub->continuation());
// crosses regions, storing null?
if (null_check_required) {
__ cmpdi(CCR0, new_val_decoded, 0);
__ beq(CCR0, *stub->continuation());
__ cmpdi(CR0, new_val_decoded, 0);
__ beq(CR0, *stub->continuation());
}
Address card_addr = generate_card_young_test(masm, store_addr, tmp1, tmp2);
assert(card_addr.base() == tmp1 && card_addr.index() == tmp2, "needed by post barrier stub");
__ bc_far_optimized(Assembler::bcondCRbiIs0, __ bi0(CCR0, Assembler::equal), *stub->entry());
__ bc_far_optimized(Assembler::bcondCRbiIs0, __ bi0(CR0, Assembler::equal), *stub->entry());
__ bind(*stub->continuation());
}
@@ -504,7 +504,7 @@ void G1BarrierSetAssembler::generate_c2_post_barrier_stub(MacroAssembler* masm,
__ bind(*stub->entry());
generate_card_dirty_test(masm, card_addr);
__ bc_far_optimized(Assembler::bcondCRbiIs1, __ bi0(CCR0, Assembler::equal), *stub->continuation());
__ bc_far_optimized(Assembler::bcondCRbiIs1, __ bi0(CR0, Assembler::equal), *stub->continuation());
__ li(R0, (int)G1CardTable::dirty_card_val());
__ stbx(R0, card_addr.base(), card_addr.index()); // *(card address) := dirty_card_val
@@ -546,8 +546,8 @@ void G1BarrierSetAssembler::gen_pre_barrier_stub(LIR_Assembler* ce, G1PreBarrier
ce->mem2reg(stub->addr(), stub->pre_val(), T_OBJECT, stub->patch_code(), stub->info(), false /*wide*/);
}
__ cmpdi(CCR0, pre_val_reg, 0);
__ bc_far_optimized(Assembler::bcondCRbiIs1, __ bi0(CCR0, Assembler::equal), *stub->continuation());
__ cmpdi(CR0, pre_val_reg, 0);
__ bc_far_optimized(Assembler::bcondCRbiIs1, __ bi0(CR0, Assembler::equal), *stub->continuation());
address c_code = bs->pre_barrier_c1_runtime_code_blob()->code_begin();
//__ load_const_optimized(R0, c_code);
@@ -567,8 +567,8 @@ void G1BarrierSetAssembler::gen_post_barrier_stub(LIR_Assembler* ce, G1PostBarri
Register addr_reg = stub->addr()->as_pointer_register();
Register new_val_reg = stub->new_val()->as_register();
__ cmpdi(CCR0, new_val_reg, 0);
__ bc_far_optimized(Assembler::bcondCRbiIs1, __ bi0(CCR0, Assembler::equal), *stub->continuation());
__ cmpdi(CR0, new_val_reg, 0);
__ bc_far_optimized(Assembler::bcondCRbiIs1, __ bi0(CR0, Assembler::equal), *stub->continuation());
address c_code = bs->post_barrier_c1_runtime_code_blob()->code_begin();
//__ load_const_optimized(R0, c_code);
@@ -604,7 +604,7 @@ void G1BarrierSetAssembler::generate_c1_pre_barrier_runtime_stub(StubAssembler*
// Is marking still active?
generate_marking_inactive_test(sasm);
__ beq(CCR0, marking_not_active);
__ beq(CR0, marking_not_active);
__ bind(restart);
// Load the index into the SATB buffer. SATBMarkQueue::_index is a
@@ -612,8 +612,8 @@ void G1BarrierSetAssembler::generate_c1_pre_barrier_runtime_stub(StubAssembler*
__ ld(tmp, satb_q_index_byte_offset, R16_thread);
// index == 0?
__ cmpdi(CCR0, tmp, 0);
__ beq(CCR0, refill);
__ cmpdi(CR0, tmp, 0);
__ beq(CR0, refill);
__ ld(tmp2, satb_q_buf_byte_offset, R16_thread);
__ ld(pre_val, -8, R1_SP); // Load from stack.
@@ -666,15 +666,15 @@ void G1BarrierSetAssembler::generate_c1_post_barrier_runtime_stub(StubAssembler*
__ lbz(tmp, 0, addr); // tmp := [addr + cardtable]
// Return if young card.
__ cmpwi(CCR0, tmp, G1CardTable::g1_young_card_val());
__ beq(CCR0, ret);
__ cmpwi(CR0, tmp, G1CardTable::g1_young_card_val());
__ beq(CR0, ret);
// Return if sequential consistent value is already dirty.
__ membar(Assembler::StoreLoad);
__ lbz(tmp, 0, addr); // tmp := [addr + cardtable]
__ cmpwi(CCR0, tmp, G1CardTable::dirty_card_val());
__ beq(CCR0, ret);
__ cmpwi(CR0, tmp, G1CardTable::dirty_card_val());
__ beq(CR0, ret);
// Not dirty.
@@ -692,8 +692,8 @@ void G1BarrierSetAssembler::generate_c1_post_barrier_runtime_stub(StubAssembler*
__ ld(tmp2, dirty_card_q_index_byte_offset, R16_thread);
// index == 0?
__ cmpdi(CCR0, tmp2, 0);
__ beq(CCR0, refill);
__ cmpdi(CR0, tmp2, 0);
__ beq(CR0, refill);
__ ld(tmp, dirty_card_q_buf_byte_offset, R16_thread);
__ addi(tmp2, tmp2, -oopSize);

View File

@@ -1,6 +1,6 @@
//
// Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
// Copyright (c) 2024 SAP SE. All rights reserved.
// Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved.
// Copyright (c) 2025 SAP SE. All rights reserved.
// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
//
// This code is free software; you can redistribute it and/or modify it
@@ -164,7 +164,7 @@ instruct g1CompareAndExchangeP(iRegPdst res, indirect mem, iRegPsrc oldval, iReg
format %{ "cmpxchgd $newval, $mem" %}
ins_encode %{
Label no_update;
__ cmpxchgd(CCR0, $res$$Register, $oldval$$Register, $newval$$Register, $mem$$Register,
__ cmpxchgd(CR0, $res$$Register, $oldval$$Register, $newval$$Register, $mem$$Register,
MacroAssembler::MemBarNone, MacroAssembler::cmpxchgx_hint_atomic_update(),
noreg, &no_update, true);
// Pass oldval to SATB which is the only value which can get overwritten.
@@ -194,7 +194,7 @@ instruct g1CompareAndExchangeP_acq(iRegPdst res, indirect mem, iRegPsrc oldval,
format %{ "cmpxchgd acq $newval, $mem" %}
ins_encode %{
Label no_update;
__ cmpxchgd(CCR0, $res$$Register, $oldval$$Register, $newval$$Register, $mem$$Register,
__ cmpxchgd(CR0, $res$$Register, $oldval$$Register, $newval$$Register, $mem$$Register,
MacroAssembler::MemBarNone, MacroAssembler::cmpxchgx_hint_atomic_update(),
noreg, &no_update, true);
// Pass oldval to SATB which is the only value which can get overwritten.
@@ -230,7 +230,7 @@ instruct g1CompareAndExchangeN(iRegNdst res, indirect mem, iRegNsrc oldval, iReg
format %{ "cmpxchgw $newval, $mem" %}
ins_encode %{
Label no_update;
__ cmpxchgw(CCR0, $res$$Register, $oldval$$Register, $newval$$Register, $mem$$Register,
__ cmpxchgw(CR0, $res$$Register, $oldval$$Register, $newval$$Register, $mem$$Register,
MacroAssembler::MemBarNone, MacroAssembler::cmpxchgx_hint_atomic_update(),
noreg, &no_update, true);
// Pass oldval to SATB which is the only value which can get overwritten.
@@ -261,7 +261,7 @@ instruct g1CompareAndExchangeN_acq(iRegNdst res, indirect mem, iRegNsrc oldval,
format %{ "cmpxchgw acq $newval, $mem" %}
ins_encode %{
Label no_update;
__ cmpxchgw(CCR0, $res$$Register, $oldval$$Register, $newval$$Register, $mem$$Register,
__ cmpxchgw(CR0, $res$$Register, $oldval$$Register, $newval$$Register, $mem$$Register,
MacroAssembler::MemBarNone, MacroAssembler::cmpxchgx_hint_atomic_update(),
noreg, &no_update, true);
// Pass oldval to SATB which is the only value which can get overwritten.
@@ -299,7 +299,7 @@ instruct g1CompareAndSwapP(iRegIdst res, indirect mem, iRegPsrc oldval, iRegPsrc
ins_encode %{
Label no_update;
__ li($res$$Register, 0);
__ cmpxchgd(CCR0, R0, $oldval$$Register, $newval$$Register, $mem$$Register,
__ cmpxchgd(CR0, R0, $oldval$$Register, $newval$$Register, $mem$$Register,
MacroAssembler::MemBarNone, MacroAssembler::cmpxchgx_hint_atomic_update(),
noreg, &no_update, true);
// Pass oldval to SATB which is the only value which can get overwritten.
@@ -332,7 +332,7 @@ instruct g1CompareAndSwapP_acq(iRegIdst res, indirect mem, iRegPsrc oldval, iReg
ins_encode %{
Label no_update;
__ li($res$$Register, 0);
__ cmpxchgd(CCR0, R0, $oldval$$Register, $newval$$Register, $mem$$Register,
__ cmpxchgd(CR0, R0, $oldval$$Register, $newval$$Register, $mem$$Register,
MacroAssembler::MemBarNone, MacroAssembler::cmpxchgx_hint_atomic_update(),
noreg, &no_update, true);
// Pass oldval to SATB which is the only value which can get overwritten.
@@ -371,7 +371,7 @@ instruct g1CompareAndSwapN(iRegIdst res, indirect mem, iRegNsrc oldval, iRegNsrc
ins_encode %{
Label no_update;
__ li($res$$Register, 0);
__ cmpxchgw(CCR0, R0, $oldval$$Register, $newval$$Register, $mem$$Register,
__ cmpxchgw(CR0, R0, $oldval$$Register, $newval$$Register, $mem$$Register,
MacroAssembler::MemBarNone, MacroAssembler::cmpxchgx_hint_atomic_update(),
noreg, &no_update, true);
// Pass oldval to SATB which is the only value which can get overwritten.
@@ -405,7 +405,7 @@ instruct g1CompareAndSwapN_acq(iRegIdst res, indirect mem, iRegNsrc oldval, iReg
ins_encode %{
Label no_update;
__ li($res$$Register, 0);
__ cmpxchgw(CCR0, R0, $oldval$$Register, $newval$$Register, $mem$$Register,
__ cmpxchgw(CR0, R0, $oldval$$Register, $newval$$Register, $mem$$Register,
MacroAssembler::MemBarNone, MacroAssembler::cmpxchgx_hint_atomic_update(),
noreg, &no_update, true);
// Pass oldval to SATB which is the only value which can get overwritten.
@@ -445,7 +445,7 @@ instruct weakG1CompareAndSwapP(iRegIdst res, indirect mem, iRegPsrc oldval, iReg
ins_encode %{
Label no_update;
__ li($res$$Register, 0);
__ cmpxchgd(CCR0, R0, $oldval$$Register, $newval$$Register, $mem$$Register,
__ cmpxchgd(CR0, R0, $oldval$$Register, $newval$$Register, $mem$$Register,
MacroAssembler::MemBarNone, MacroAssembler::cmpxchgx_hint_atomic_update(),
noreg, &no_update, true, true);
// Pass oldval to SATB which is the only value which can get overwritten.
@@ -478,7 +478,7 @@ instruct weakG1CompareAndSwapP_acq(iRegIdst res, indirect mem, iRegPsrc oldval,
ins_encode %{
Label no_update;
__ li($res$$Register, 0);
__ cmpxchgd(CCR0, R0, $oldval$$Register, $newval$$Register, $mem$$Register,
__ cmpxchgd(CR0, R0, $oldval$$Register, $newval$$Register, $mem$$Register,
MacroAssembler::MemBarNone, MacroAssembler::cmpxchgx_hint_atomic_update(),
noreg, &no_update, true, true);
// Pass oldval to SATB which is the only value which can get overwritten.
@@ -517,7 +517,7 @@ instruct weakG1CompareAndSwapN(iRegIdst res, indirect mem, iRegNsrc oldval, iReg
ins_encode %{
Label no_update;
__ li($res$$Register, 0);
__ cmpxchgw(CCR0, R0, $oldval$$Register, $newval$$Register, $mem$$Register,
__ cmpxchgw(CR0, R0, $oldval$$Register, $newval$$Register, $mem$$Register,
MacroAssembler::MemBarNone, MacroAssembler::cmpxchgx_hint_atomic_update(),
noreg, &no_update, true, true);
// Pass oldval to SATB which is the only value which can get overwritten.
@@ -551,7 +551,7 @@ instruct weakG1CompareAndSwapN_acq(iRegIdst res, indirect mem, iRegNsrc oldval,
ins_encode %{
Label no_update;
__ li($res$$Register, 0);
__ cmpxchgw(CCR0, R0, $oldval$$Register, $newval$$Register, $mem$$Register,
__ cmpxchgw(CR0, R0, $oldval$$Register, $newval$$Register, $mem$$Register,
MacroAssembler::MemBarNone, MacroAssembler::cmpxchgx_hint_atomic_update(),
noreg, &no_update, true, true);
// Pass oldval to SATB which is the only value which can get overwritten.

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2022 SAP SE. All rights reserved.
* Copyright (c) 2018, 2025 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -89,8 +89,8 @@ void BarrierSetAssembler::load_at(MacroAssembler* masm, DecoratorSet decorators,
if (UseCompressedOops && in_heap) {
if (L_handle_null != nullptr) { // Label provided.
__ lwz(dst, ind_or_offs, base);
__ cmpwi(CCR0, dst, 0);
__ beq(CCR0, *L_handle_null);
__ cmpwi(CR0, dst, 0);
__ beq(CR0, *L_handle_null);
__ decode_heap_oop_not_null(dst);
} else if (not_null) { // Guaranteed to be not null.
Register narrowOop = (tmp1 != noreg && CompressedOops::base_disjoint()) ? tmp1 : dst;
@@ -103,8 +103,8 @@ void BarrierSetAssembler::load_at(MacroAssembler* masm, DecoratorSet decorators,
} else {
__ ld(dst, ind_or_offs, base);
if (L_handle_null != nullptr) {
__ cmpdi(CCR0, dst, 0);
__ beq(CCR0, *L_handle_null);
__ cmpdi(CR0, dst, 0);
__ beq(CR0, *L_handle_null);
}
}
break;
@@ -118,11 +118,11 @@ void BarrierSetAssembler::resolve_jobject(MacroAssembler* masm, Register value,
Register tmp1, Register tmp2,
MacroAssembler::PreservationLevel preservation_level) {
Label done, tagged, weak_tagged, verify;
__ cmpdi(CCR0, value, 0);
__ beq(CCR0, done); // Use null as-is.
__ cmpdi(CR0, value, 0);
__ beq(CR0, done); // Use null as-is.
__ andi_(tmp1, value, JNIHandles::tag_mask);
__ bne(CCR0, tagged); // Test for tag.
__ bne(CR0, tagged); // Test for tag.
__ access_load_at(T_OBJECT, IN_NATIVE | AS_RAW, // no uncoloring
value, (intptr_t)0, value, tmp1, tmp2, preservation_level);
@@ -131,7 +131,7 @@ void BarrierSetAssembler::resolve_jobject(MacroAssembler* masm, Register value,
__ bind(tagged);
__ andi_(tmp1, value, JNIHandles::TypeTag::weak_global);
__ clrrdi(value, value, JNIHandles::tag_size); // Untag.
__ bne(CCR0, weak_tagged); // Test for jweak tag.
__ bne(CR0, weak_tagged); // Test for jweak tag.
__ access_load_at(T_OBJECT, IN_NATIVE,
value, (intptr_t)0, value, tmp1, tmp2, preservation_level);
@@ -152,14 +152,14 @@ void BarrierSetAssembler::resolve_global_jobject(MacroAssembler* masm, Register
MacroAssembler::PreservationLevel preservation_level) {
Label done;
__ cmpdi(CCR0, value, 0);
__ beq(CCR0, done); // Use null as-is.
__ cmpdi(CR0, value, 0);
__ beq(CR0, done); // Use null as-is.
#ifdef ASSERT
{
Label valid_global_tag;
__ andi_(tmp1, value, JNIHandles::TypeTag::global);
__ bne(CCR0, valid_global_tag); // Test for global tag.
__ bne(CR0, valid_global_tag); // Test for global tag.
__ stop("non global jobject using resolve_global_jobject");
__ bind(valid_global_tag);
}
@@ -200,9 +200,9 @@ void BarrierSetAssembler::nmethod_entry_barrier(MacroAssembler* masm, Register t
// Low order half of 64 bit value is currently used.
__ ld(R0, in_bytes(bs_nm->thread_disarmed_guard_value_offset()), R16_thread);
__ cmpw(CCR0, R0, tmp);
__ cmpw(CR0, R0, tmp);
__ bnectrl(CCR0);
__ bnectrl(CR0);
// Oops may have been changed. Make those updates observable.
// "isync" can serve both, data and instruction patching.
@@ -229,8 +229,8 @@ void BarrierSetAssembler::c2i_entry_barrier(MacroAssembler *masm, Register tmp1,
Label bad_call, skip_barrier;
// Fast path: If no method is given, the call is definitely bad.
__ cmpdi(CCR0, R19_method, 0);
__ beq(CCR0, bad_call);
__ cmpdi(CR0, R19_method, 0);
__ beq(CR0, bad_call);
// Load class loader data to determine whether the method's holder is concurrently unloading.
__ load_method_holder(tmp1, R19_method);
@@ -238,14 +238,14 @@ void BarrierSetAssembler::c2i_entry_barrier(MacroAssembler *masm, Register tmp1,
// Fast path: If class loader is strong, the holder cannot be unloaded.
__ lwz(tmp2, in_bytes(ClassLoaderData::keep_alive_ref_count_offset()), tmp1_class_loader_data);
__ cmpdi(CCR0, tmp2, 0);
__ bne(CCR0, skip_barrier);
__ cmpdi(CR0, tmp2, 0);
__ bne(CR0, skip_barrier);
// Class loader is weak. Determine whether the holder is still alive.
__ ld(tmp2, in_bytes(ClassLoaderData::holder_offset()), tmp1_class_loader_data);
__ resolve_weak_handle(tmp2, tmp1, tmp3, MacroAssembler::PreservationLevel::PRESERVATION_FRAME_LR_GP_FP_REGS);
__ cmpdi(CCR0, tmp2, 0);
__ bne(CCR0, skip_barrier);
__ cmpdi(CR0, tmp2, 0);
__ bne(CR0, skip_barrier);
__ bind(bad_call);

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2021 SAP SE. All rights reserved.
* Copyright (c) 2018, 2025 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -49,7 +49,7 @@ void CardTableBarrierSetAssembler::gen_write_ref_array_post_barrier(MacroAssembl
Label Lskip_loop, Lstore_loop;
__ sldi_(count, count, LogBytesPerHeapOop);
__ beq(CCR0, Lskip_loop); // zero length
__ beq(CR0, Lskip_loop); // zero length
__ addi(count, count, -BytesPerHeapOop);
__ add(count, addr, count);
// Use two shifts to clear out those low order two bits! (Cannot opt. into 1.)

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2021 SAP SE. All rights reserved.
* Copyright (c) 2018, 2025 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -80,8 +80,8 @@ void ModRefBarrierSetAssembler::resolve_jobject(MacroAssembler* masm, Register v
Register tmp1, Register tmp2,
MacroAssembler::PreservationLevel preservation_level) {
Label done;
__ cmpdi(CCR0, value, 0);
__ beq(CCR0, done); // Use null as-is.
__ cmpdi(CR0, value, 0);
__ beq(CR0, done); // Use null as-is.
__ clrrdi(tmp1, value, JNIHandles::tag_size);
__ ld(value, 0, tmp1); // Resolve (untagged) jobject.

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2018, 2024, Red Hat, Inc. All rights reserved.
* Copyright (c) 2012, 2024 SAP SE. All rights reserved.
* Copyright (c) 2018, 2025, Red Hat, Inc. All rights reserved.
* Copyright (c) 2012, 2025 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -102,8 +102,8 @@ void ShenandoahBarrierSetAssembler::arraycopy_prologue(MacroAssembler *masm, Dec
Label skip_prologue;
// Fast path: Array is of length zero.
__ cmpdi(CCR0, count, 0);
__ beq(CCR0, skip_prologue);
__ cmpdi(CR0, count, 0);
__ beq(CR0, skip_prologue);
/* ==== Check whether barrier is required (gc state) ==== */
__ lbz(R11_tmp, in_bytes(ShenandoahThreadLocalData::gc_state_offset()),
@@ -118,7 +118,7 @@ void ShenandoahBarrierSetAssembler::arraycopy_prologue(MacroAssembler *masm, Dec
: ShenandoahHeap::HAS_FORWARDED | ShenandoahHeap::MARKING;
__ andi_(R11_tmp, R11_tmp, required_states);
__ beq(CCR0, skip_prologue);
__ beq(CR0, skip_prologue);
/* ==== Invoke runtime ==== */
// Save to-be-preserved registers.
@@ -216,7 +216,7 @@ void ShenandoahBarrierSetAssembler::satb_write_barrier_impl(MacroAssembler *masm
__ lbz(tmp1, in_bytes(ShenandoahThreadLocalData::gc_state_offset()), R16_thread);
__ andi_(tmp1, tmp1, ShenandoahHeap::MARKING);
__ beq(CCR0, skip_barrier);
__ beq(CR0, skip_barrier);
/* ==== Determine the reference's previous value ==== */
bool preloaded_mode = base == noreg;
@@ -235,12 +235,12 @@ void ShenandoahBarrierSetAssembler::satb_write_barrier_impl(MacroAssembler *masm
if ((decorators & IS_NOT_NULL) != 0) {
#ifdef ASSERT
__ cmpdi(CCR0, pre_val, 0);
__ cmpdi(CR0, pre_val, 0);
__ asm_assert_ne("null oop is not allowed");
#endif // ASSERT
} else {
__ cmpdi(CCR0, pre_val, 0);
__ beq(CCR0, skip_barrier);
__ cmpdi(CR0, pre_val, 0);
__ beq(CR0, skip_barrier);
}
} else {
// Load from the reference address to determine the reference's current value (before the store is being performed).
@@ -254,8 +254,8 @@ void ShenandoahBarrierSetAssembler::satb_write_barrier_impl(MacroAssembler *masm
__ ld(pre_val, ind_or_offs, base);
}
__ cmpdi(CCR0, pre_val, 0);
__ beq(CCR0, skip_barrier);
__ cmpdi(CR0, pre_val, 0);
__ beq(CR0, skip_barrier);
if (UseCompressedOops) {
__ decode_heap_oop_not_null(pre_val);
@@ -271,8 +271,8 @@ void ShenandoahBarrierSetAssembler::satb_write_barrier_impl(MacroAssembler *masm
// If not, jump to the runtime to commit the buffer and to allocate a new one.
// (The buffer's index corresponds to the amount of remaining free space.)
__ ld(Rindex, in_bytes(ShenandoahThreadLocalData::satb_mark_queue_index_offset()), R16_thread);
__ cmpdi(CCR0, Rindex, 0);
__ beq(CCR0, runtime); // If index == 0 (buffer is full), goto runtime.
__ cmpdi(CR0, Rindex, 0);
__ beq(CR0, runtime); // If index == 0 (buffer is full), goto runtime.
// Capacity suffices. Decrement the queue's size by the size of one oop.
// (The buffer is filled contrary to the heap's growing direction, i.e., it is filled downwards.)
@@ -362,9 +362,9 @@ void ShenandoahBarrierSetAssembler::resolve_forward_pointer_not_null(MacroAssemb
"marked value must equal the value obtained when all lock bits are being set");
if (VM_Version::has_isel()) {
__ xori(tmp1, tmp1, markWord::lock_mask_in_place);
__ isel(dst, CCR0, Assembler::equal, false, tmp1);
__ isel(dst, CR0, Assembler::equal, false, tmp1);
} else {
__ bne(CCR0, done);
__ bne(CR0, done);
__ xori(dst, tmp1, markWord::lock_mask_in_place);
}
@@ -402,7 +402,7 @@ void ShenandoahBarrierSetAssembler::load_reference_barrier_impl(
if (is_strong) {
// For strong references, the heap is considered stable if "has forwarded" is not active.
__ andi_(tmp1, tmp2, ShenandoahHeap::HAS_FORWARDED | ShenandoahHeap::EVACUATION);
__ beq(CCR0, skip_barrier);
__ beq(CR0, skip_barrier);
#ifdef ASSERT
// "evacuation" -> (implies) "has forwarded". If we reach this code, "has forwarded" must thus be set.
__ andi_(tmp1, tmp1, ShenandoahHeap::HAS_FORWARDED);
@@ -414,10 +414,10 @@ void ShenandoahBarrierSetAssembler::load_reference_barrier_impl(
// The additional phase conditions are in place to avoid the resurrection of weak references (see JDK-8266440).
Label skip_fastpath;
__ andi_(tmp1, tmp2, ShenandoahHeap::WEAK_ROOTS);
__ bne(CCR0, skip_fastpath);
__ bne(CR0, skip_fastpath);
__ andi_(tmp1, tmp2, ShenandoahHeap::HAS_FORWARDED | ShenandoahHeap::EVACUATION);
__ beq(CCR0, skip_barrier);
__ beq(CR0, skip_barrier);
#ifdef ASSERT
// "evacuation" -> (implies) "has forwarded". If we reach this code, "has forwarded" must thus be set.
__ andi_(tmp1, tmp1, ShenandoahHeap::HAS_FORWARDED);
@@ -453,7 +453,7 @@ void ShenandoahBarrierSetAssembler::load_reference_barrier_impl(
__ srdi(tmp1, dst, ShenandoahHeapRegion::region_size_bytes_shift_jint());
__ lbzx(tmp2, tmp1, tmp2);
__ andi_(tmp2, tmp2, 1);
__ beq(CCR0, skip_barrier);
__ beq(CR0, skip_barrier);
}
/* ==== Invoke runtime ==== */
@@ -639,8 +639,8 @@ void ShenandoahBarrierSetAssembler::try_resolve_jobject_in_native(MacroAssembler
Label done;
// Fast path: Reference is null (JNI tags are zero for null pointers).
__ cmpdi(CCR0, obj, 0);
__ beq(CCR0, done);
__ cmpdi(CR0, obj, 0);
__ beq(CR0, done);
// Resolve jobject using standard implementation.
BarrierSetAssembler::try_resolve_jobject_in_native(masm, dst, jni_env, obj, tmp, slowpath);
@@ -651,7 +651,7 @@ void ShenandoahBarrierSetAssembler::try_resolve_jobject_in_native(MacroAssembler
jni_env);
__ andi_(tmp, tmp, ShenandoahHeap::EVACUATION | ShenandoahHeap::HAS_FORWARDED);
__ bne(CCR0, slowpath);
__ bne(CR0, slowpath);
__ bind(done);
__ block_comment("} try_resolve_jobject_in_native (shenandoahgc)");
@@ -701,23 +701,23 @@ void ShenandoahBarrierSetAssembler::cmpxchg_oop(MacroAssembler *masm, Register b
// Given that 'expected' must refer to the to-space object of an evacuated object (strong to-space invariant),
// no special processing is required.
if (UseCompressedOops) {
__ cmpxchgw(CCR0, current_value, expected, new_val, base_addr, MacroAssembler::MemBarNone,
__ cmpxchgw(CR0, current_value, expected, new_val, base_addr, MacroAssembler::MemBarNone,
false, success_flag, nullptr, true);
} else {
__ cmpxchgd(CCR0, current_value, expected, new_val, base_addr, MacroAssembler::MemBarNone,
__ cmpxchgd(CR0, current_value, expected, new_val, base_addr, MacroAssembler::MemBarNone,
false, success_flag, nullptr, true);
}
// Skip the rest of the barrier if the CAS operation succeeds immediately.
// If it does not, the value stored at the address is either the from-space pointer of the
// referenced object (success criteria s2)) or simply another object.
__ beq(CCR0, done);
__ beq(CR0, done);
/* ==== Step 2 (Null check) ==== */
// The success criteria s2) cannot be matched with a null pointer
// (null pointers cannot be subject to concurrent evacuation). The failure of the CAS operation is thus legitimate.
__ cmpdi(CCR0, current_value, 0);
__ beq(CCR0, done);
__ cmpdi(CR0, current_value, 0);
__ beq(CR0, done);
/* ==== Step 3 (reference pointer refers to from-space version; success criteria s2)) ==== */
// To check whether the reference pointer refers to the from-space version, the forward
@@ -737,15 +737,15 @@ void ShenandoahBarrierSetAssembler::cmpxchg_oop(MacroAssembler *masm, Register b
// Load zero into register for the potential failure case.
__ li(success_flag, 0);
}
__ cmpd(CCR0, current_value, expected);
__ bne(CCR0, done);
__ cmpd(CR0, current_value, expected);
__ bne(CR0, done);
// Discard fetched value as it might be a reference to the from-space version of an object.
if (UseCompressedOops) {
__ cmpxchgw(CCR0, R0, initial_value, new_val, base_addr, MacroAssembler::MemBarNone,
__ cmpxchgw(CR0, R0, initial_value, new_val, base_addr, MacroAssembler::MemBarNone,
false, success_flag);
} else {
__ cmpxchgd(CCR0, R0, initial_value, new_val, base_addr, MacroAssembler::MemBarNone,
__ cmpxchgd(CR0, R0, initial_value, new_val, base_addr, MacroAssembler::MemBarNone,
false, success_flag);
}
@@ -770,7 +770,7 @@ void ShenandoahBarrierSetAssembler::cmpxchg_oop(MacroAssembler *masm, Register b
// guaranteed to be the case.
// In case of a concurrent update, the CAS would be retried again. This is legitimate
// in terms of program correctness (even though it is not desired).
__ bne(CCR0, step_four);
__ bne(CR0, step_four);
__ bind(done);
__ block_comment("} cmpxchg_oop (shenandoahgc)");
@@ -789,7 +789,7 @@ void ShenandoahBarrierSetAssembler::gen_write_ref_array_post_barrier(MacroAssemb
__ sldi_(count, count, LogBytesPerHeapOop);
// Zero length? Skip.
__ beq(CCR0, L_skip_loop);
__ beq(CR0, L_skip_loop);
__ addi(count, count, -BytesPerHeapOop);
__ add(count, addr, count);
@@ -835,8 +835,8 @@ void ShenandoahBarrierSetAssembler::gen_pre_barrier_stub(LIR_Assembler *ce, Shen
}
// Fast path: Reference is null.
__ cmpdi(CCR0, pre_val, 0);
__ bc_far_optimized(Assembler::bcondCRbiIs1_bhintNoHint, __ bi0(CCR0, Assembler::equal), *stub->continuation());
__ cmpdi(CR0, pre_val, 0);
__ bc_far_optimized(Assembler::bcondCRbiIs1_bhintNoHint, __ bi0(CR0, Assembler::equal), *stub->continuation());
// Argument passing via the stack.
__ std(pre_val, -8, R1_SP);
@@ -866,7 +866,7 @@ void ShenandoahBarrierSetAssembler::gen_load_reference_barrier_stub(LIR_Assemble
// Ensure that 'res' is 'R3_ARG1' and contains the same value as 'obj' to reduce the number of required
// copy instructions.
assert(R3_RET == res, "res must be r3");
__ cmpd(CCR0, res, obj);
__ cmpd(CR0, res, obj);
__ asm_assert_eq("result register must contain the reference stored in obj");
#endif
@@ -888,7 +888,7 @@ void ShenandoahBarrierSetAssembler::gen_load_reference_barrier_stub(LIR_Assemble
__ lbzx(tmp2, tmp1, tmp2);
__ andi_(tmp2, tmp2, 1);
__ bc_far_optimized(Assembler::bcondCRbiIs1_bhintNoHint, __ bi0(CCR0, Assembler::equal), *stub->continuation());
__ bc_far_optimized(Assembler::bcondCRbiIs1_bhintNoHint, __ bi0(CR0, Assembler::equal), *stub->continuation());
}
address blob_addr = nullptr;
@@ -946,13 +946,13 @@ void ShenandoahBarrierSetAssembler::generate_c1_pre_barrier_runtime_stub(StubAss
__ lbz(R12_tmp2, in_bytes(ShenandoahThreadLocalData::gc_state_offset()), R16_thread);
__ andi_(R12_tmp2, R12_tmp2, ShenandoahHeap::MARKING);
__ beq(CCR0, skip_barrier);
__ beq(CR0, skip_barrier);
/* ==== Add previous value directly to thread-local SATB mark queue ==== */
// Check queue's capacity. Jump to runtime if no free slot is available.
__ ld(R12_tmp2, in_bytes(ShenandoahThreadLocalData::satb_mark_queue_index_offset()), R16_thread);
__ cmpdi(CCR0, R12_tmp2, 0);
__ beq(CCR0, runtime);
__ cmpdi(CR0, R12_tmp2, 0);
__ beq(CR0, runtime);
// Capacity suffices. Decrement the queue's size by one slot (size of one oop).
__ addi(R12_tmp2, R12_tmp2, -wordSize);

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2021, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021, 2024 SAP SE. All rights reserved.
* Copyright (c) 2021, 2025 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -169,7 +169,7 @@ void ZBarrierSetAssembler::load_at(MacroAssembler* masm, DecoratorSet decorators
// if the pointer is not dirty.
// Only dirty pointers must be processed by this barrier, so we can skip it in case the latter condition holds true.
__ and_(tmp1, tmp1, dst);
__ beq(CCR0, uncolor);
__ beq(CR0, uncolor);
/* ==== Invoke barrier ==== */
{
@@ -193,8 +193,8 @@ void ZBarrierSetAssembler::load_at(MacroAssembler* masm, DecoratorSet decorators
// Slow-path has already uncolored
if (L_handle_null != nullptr) {
__ cmpdi(CCR0, dst, 0);
__ beq(CCR0, *L_handle_null);
__ cmpdi(CR0, dst, 0);
__ beq(CR0, *L_handle_null);
}
__ b(done);
@@ -203,7 +203,7 @@ void ZBarrierSetAssembler::load_at(MacroAssembler* masm, DecoratorSet decorators
__ srdi(dst, dst, ZPointerLoadShift);
} else {
__ srdi_(dst, dst, ZPointerLoadShift);
__ beq(CCR0, *L_handle_null);
__ beq(CR0, *L_handle_null);
}
__ bind(done);
@@ -234,7 +234,7 @@ static void emit_store_fast_path_check(MacroAssembler* masm, Register base, Regi
// A not relocatable object could have spurious raw null pointers in its fields after
// getting promoted to the old generation.
__ relocate(barrier_Relocation::spec(), ZBarrierRelocationFormatStoreGoodBits);
__ cmplwi(CCR0, R0, barrier_Relocation::unpatched);
__ cmplwi(CR0, R0, barrier_Relocation::unpatched);
} else {
__ ld(R0, ind_or_offs, base);
// Stores on relocatable objects never need to deal with raw null pointers in fields.
@@ -244,7 +244,7 @@ static void emit_store_fast_path_check(MacroAssembler* masm, Register base, Regi
__ relocate(barrier_Relocation::spec(), ZBarrierRelocationFormatStoreBadMask);
__ andi_(R0, R0, barrier_Relocation::unpatched);
}
__ bc_far_optimized(Assembler::bcondCRbiIs0, __ bi0(CCR0, Assembler::equal), medium_path);
__ bc_far_optimized(Assembler::bcondCRbiIs0, __ bi0(CR0, Assembler::equal), medium_path);
}
void ZBarrierSetAssembler::store_barrier_fast(MacroAssembler* masm,
@@ -274,7 +274,7 @@ void ZBarrierSetAssembler::store_barrier_fast(MacroAssembler* masm,
__ ld(R0, ind_or_offset, ref_base);
__ ld(rnew_zpointer, in_bytes(ZThreadLocalData::store_bad_mask_offset()), R16_thread);
__ and_(R0, R0, rnew_zpointer);
__ bne(CCR0, medium_path);
__ bne(CR0, medium_path);
__ bind(medium_path_continuation);
__ ld(rnew_zpointer, in_bytes(ZThreadLocalData::store_good_mask_offset()), R16_thread);
}
@@ -293,7 +293,7 @@ static void store_barrier_buffer_add(MacroAssembler* masm,
// Combined pointer bump and check if the buffer is disabled or full
__ ld(R0, in_bytes(ZStoreBarrierBuffer::current_offset()), tmp1);
__ addic_(R0, R0, -(int)sizeof(ZStoreBarrierEntry));
__ blt(CCR0, slow_path);
__ blt(CR0, slow_path);
__ std(R0, in_bytes(ZStoreBarrierBuffer::current_offset()), tmp1);
// Entry is at ZStoreBarrierBuffer (tmp1) + buffer_offset + scaled index (R0)
@@ -327,8 +327,8 @@ void ZBarrierSetAssembler::store_barrier_medium(MacroAssembler* masm,
// Atomic accesses can get to the medium fast path because the value was a
// raw null value. If it was not null, then there is no doubt we need to take a slow path.
__ ld(tmp, ind_or_offs, ref_base);
__ cmpdi(CCR0, tmp, 0);
__ bne(CCR0, slow_path);
__ cmpdi(CR0, tmp, 0);
__ bne(CR0, slow_path);
// If we get this far, we know there is a young raw null value in the field.
// Try to self-heal null values for atomic accesses
@@ -338,12 +338,12 @@ void ZBarrierSetAssembler::store_barrier_medium(MacroAssembler* masm,
need_restore = true;
}
__ ld(R0, in_bytes(ZThreadLocalData::store_good_mask_offset()), R16_thread);
__ cmpxchgd(CCR0, tmp, (intptr_t)0, R0, ref_base,
__ cmpxchgd(CR0, tmp, (intptr_t)0, R0, ref_base,
MacroAssembler::MemBarNone, MacroAssembler::cmpxchgx_hint_atomic_update(),
noreg, need_restore ? nullptr : &slow_path);
if (need_restore) {
__ sub(ref_base, ref_base, ind_or_offs);
__ bne(CCR0, slow_path);
__ bne(CR0, slow_path);
}
} else {
// A non-atomic relocatable object won't get to the medium fast path due to a
@@ -447,7 +447,7 @@ void ZBarrierSetAssembler::copy_load_at_fast(MacroAssembler* masm,
Label& continuation) const {
__ ldx(zpointer, addr);
__ and_(R0, zpointer, load_bad_mask);
__ bne(CCR0, slow_path);
__ bne(CR0, slow_path);
__ bind(continuation);
}
void ZBarrierSetAssembler::copy_load_at_slow(MacroAssembler* masm,
@@ -480,7 +480,7 @@ void ZBarrierSetAssembler::copy_store_at_fast(MacroAssembler* masm,
if (!dest_uninitialized) {
__ ldx(R0, addr);
__ and_(R0, R0, store_bad_mask);
__ bne(CCR0, medium_path);
__ bne(CR0, medium_path);
__ bind(continuation);
}
__ rldimi(zpointer, store_good_mask, 0, 64 - ZPointerLoadShift); // Replace color bits.
@@ -515,8 +515,8 @@ void ZBarrierSetAssembler::copy_store_at_slow(MacroAssembler* masm,
void ZBarrierSetAssembler::generate_disjoint_oop_copy(MacroAssembler* masm, bool dest_uninitialized) {
const Register zpointer = R2, tmp = R9;
Label done, loop, load_bad, load_good, store_bad, store_good;
__ cmpdi(CCR0, R5_ARG3, 0);
__ beq(CCR0, done);
__ cmpdi(CR0, R5_ARG3, 0);
__ beq(CR0, done);
__ mtctr(R5_ARG3);
__ align(32);
@@ -539,7 +539,7 @@ void ZBarrierSetAssembler::generate_conjoint_oop_copy(MacroAssembler* masm, bool
const Register zpointer = R2, tmp = R9;
Label done, loop, load_bad, load_good, store_bad, store_good;
__ sldi_(R0, R5_ARG3, 3);
__ beq(CCR0, done);
__ beq(CR0, done);
__ mtctr(R5_ARG3);
// Point behind last elements and copy backwards.
__ add(R3_ARG1, R3_ARG1, R0);
@@ -570,12 +570,12 @@ void ZBarrierSetAssembler::check_oop(MacroAssembler *masm, Register obj, const c
Label done, skip_uncolor;
// Skip (colored) null.
__ srdi_(R0, obj, ZPointerLoadShift);
__ beq(CCR0, done);
__ beq(CR0, done);
// Check if ZAddressHeapBase << ZPointerLoadShift is set. If so, we need to uncolor.
__ rldicl_(R0, obj, 64 - ZAddressHeapBaseShift - ZPointerLoadShift, 63);
__ mr(R0, obj);
__ beq(CCR0, skip_uncolor);
__ beq(CR0, skip_uncolor);
__ srdi(R0, obj, ZPointerLoadShift);
__ bind(skip_uncolor);
@@ -594,7 +594,7 @@ void ZBarrierSetAssembler::try_resolve_jobject_in_native(MacroAssembler* masm, R
// Test for tag
__ andi_(tmp, obj, JNIHandles::tag_mask);
__ bne(CCR0, tagged);
__ bne(CR0, tagged);
// Resolve local handle
__ ld(dst, 0, obj);
@@ -605,7 +605,7 @@ void ZBarrierSetAssembler::try_resolve_jobject_in_native(MacroAssembler* masm, R
// Test for weak tag
__ andi_(tmp, obj, JNIHandles::TypeTag::weak_global);
__ clrrdi(dst, obj, JNIHandles::tag_size); // Untag.
__ bne(CCR0, weak_tagged);
__ bne(CR0, weak_tagged);
// Resolve global handle
__ ld(dst, 0, dst);
@@ -620,7 +620,7 @@ void ZBarrierSetAssembler::try_resolve_jobject_in_native(MacroAssembler* masm, R
__ bind(check_color);
__ and_(tmp, tmp, dst);
__ bne(CCR0, slowpath);
__ bne(CR0, slowpath);
// Uncolor
__ srdi(dst, dst, ZPointerLoadShift);
@@ -666,7 +666,7 @@ void ZBarrierSetAssembler::generate_c1_load_barrier(LIR_Assembler* ce,
ZLoadBarrierStubC1* stub,
bool on_non_strong) const {
check_color(ce, ref, on_non_strong);
__ bc_far_optimized(Assembler::bcondCRbiIs0, __ bi0(CCR0, Assembler::equal), *stub->entry());
__ bc_far_optimized(Assembler::bcondCRbiIs0, __ bi0(CR0, Assembler::equal), *stub->entry());
z_uncolor(ce, ref);
__ bind(*stub->continuation());
}

View File

@@ -1,6 +1,6 @@
//
// Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved.
// Copyright (c) 2021 SAP SE. All rights reserved.
// Copyright (c) 2021, 2025, Oracle and/or its affiliates. All rights reserved.
// Copyright (c) 2025 SAP SE. All rights reserved.
// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
//
// This code is free software; you can redistribute it and/or modify it
@@ -70,7 +70,7 @@ static void z_load_barrier(MacroAssembler* masm, const MachNode* node, Address r
check_color(masm, ref, on_non_strong);
ZLoadBarrierStubC2* const stub = ZLoadBarrierStubC2::create(node, ref_addr, ref);
__ bne_far(CCR0, *stub->entry(), MacroAssembler::bc_far_optimize_on_relocate);
__ bne_far(CR0, *stub->entry(), MacroAssembler::bc_far_optimize_on_relocate);
z_uncolor(masm, ref);
__ bind(*stub->continuation());
@@ -97,7 +97,7 @@ static void z_compare_and_swap(MacroAssembler* masm, const MachNode* node,
Register rold_zpointer = tmp1, rnew_zpointer = tmp2;
z_store_barrier(masm, node, mem, 0, newval, rnew_zpointer, true /* is_atomic */);
z_color(masm, rold_zpointer, oldval);
__ cmpxchgd(CCR0, R0, rold_zpointer, rnew_zpointer, mem,
__ cmpxchgd(CR0, R0, rold_zpointer, rnew_zpointer, mem,
MacroAssembler::MemBarNone, MacroAssembler::cmpxchgx_hint_atomic_update(), res, nullptr, true,
false /* we could support weak, but benefit is questionable */);
@@ -119,7 +119,7 @@ static void z_compare_and_exchange(MacroAssembler* masm, const MachNode* node,
Register rold_zpointer = R0, rnew_zpointer = tmp;
z_store_barrier(masm, node, mem, 0, newval, rnew_zpointer, true /* is_atomic */);
z_color(masm, rold_zpointer, oldval);
__ cmpxchgd(CCR0, res, rold_zpointer, rnew_zpointer, mem,
__ cmpxchgd(CR0, res, rold_zpointer, rnew_zpointer, mem,
MacroAssembler::MemBarNone, MacroAssembler::cmpxchgx_hint_atomic_update(), noreg, nullptr, true,
false /* we could support weak, but benefit is questionable */);
z_uncolor(masm, res);

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2024 SAP SE. All rights reserved.
* Copyright (c) 2012, 2025 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -126,10 +126,10 @@ void InterpreterMacroAssembler::check_and_handle_popframe(Register scratch_reg)
// means that this code is called *during* popframe handling - we
// don't want to reenter.
andi_(R0, scratch_reg, JavaThread::popframe_pending_bit);
beq(CCR0, L);
beq(CR0, L);
andi_(R0, scratch_reg, JavaThread::popframe_processing_bit);
bne(CCR0, L);
bne(CR0, L);
// Call the Interpreter::remove_activation_preserving_args_entry()
// func to get the address of the same-named entrypoint in the
@@ -150,12 +150,12 @@ void InterpreterMacroAssembler::check_and_handle_earlyret(Register scratch_reg)
if (JvmtiExport::can_force_early_return()) {
Label Lno_early_ret;
ld(Rthr_state_addr, in_bytes(JavaThread::jvmti_thread_state_offset()), R16_thread);
cmpdi(CCR0, Rthr_state_addr, 0);
beq(CCR0, Lno_early_ret);
cmpdi(CR0, Rthr_state_addr, 0);
beq(CR0, Lno_early_ret);
lwz(R0, in_bytes(JvmtiThreadState::earlyret_state_offset()), Rthr_state_addr);
cmpwi(CCR0, R0, JvmtiThreadState::earlyret_pending);
bne(CCR0, Lno_early_ret);
cmpwi(CR0, R0, JvmtiThreadState::earlyret_pending);
bne(CR0, Lno_early_ret);
// Jump to Interpreter::_earlyret_entry.
lwz(R3_ARG1, in_bytes(JvmtiThreadState::earlyret_tos_offset()), Rthr_state_addr);
@@ -229,7 +229,7 @@ void InterpreterMacroAssembler::dispatch_Lbyte_code(TosState state, Register byt
ld(R0, in_bytes(JavaThread::polling_word_offset()), R16_thread);
// Armed page has poll_bit set, if poll bit is cleared just continue.
andi_(R0, R0, SafepointMechanism::poll_bit());
beq(CCR0, dispatch);
beq(CR0, dispatch);
load_dispatch_table(R11_scratch1, sfpt_tbl);
align(32, 16);
bind(dispatch);
@@ -528,8 +528,8 @@ void InterpreterMacroAssembler::load_resolved_reference_at_index(Register result
Label index_ok;
lwa(R0, arrayOopDesc::length_offset_in_bytes(), result);
sldi(R0, R0, LogBytesPerHeapOop);
cmpd(CCR0, index, R0);
blt(CCR0, index_ok);
cmpd(CR0, index, R0);
blt(CR0, index_ok);
stop("resolved reference index out of bounds");
bind(index_ok);
#endif
@@ -592,8 +592,8 @@ void InterpreterMacroAssembler::index_check_without_pop(Register Rarray, Registe
// Array nullcheck
if (!ImplicitNullChecks) {
cmpdi(CCR0, Rarray, 0);
beq(CCR0, LisNull);
cmpdi(CR0, Rarray, 0);
beq(CR0, LisNull);
} else {
null_check_throw(Rarray, arrayOopDesc::length_offset_in_bytes(), /*temp*/RsxtIndex);
}
@@ -605,9 +605,9 @@ void InterpreterMacroAssembler::index_check_without_pop(Register Rarray, Registe
// Index check
lwz(Rlength, arrayOopDesc::length_offset_in_bytes(), Rarray);
cmplw(CCR0, Rindex, Rlength);
cmplw(CR0, Rindex, Rlength);
sldi(RsxtIndex, RsxtIndex, index_shift);
blt(CCR0, LnotOOR);
blt(CR0, LnotOOR);
// Index should be in R17_tos, array should be in R4_ARG2.
mr_if_needed(R17_tos, Rindex);
mr_if_needed(R4_ARG2, Rarray);
@@ -687,11 +687,11 @@ void InterpreterMacroAssembler::unlock_if_synchronized_method(TosState state,
push(state);
// Skip if we don't have to unlock.
testbitdi(CCR0, R0, Raccess_flags, JVM_ACC_SYNCHRONIZED_BIT);
beq(CCR0, Lunlocked);
testbitdi(CR0, R0, Raccess_flags, JVM_ACC_SYNCHRONIZED_BIT);
beq(CR0, Lunlocked);
cmpwi(CCR0, Rdo_not_unlock_flag, 0);
bne(CCR0, Lno_unlock);
cmpwi(CR0, Rdo_not_unlock_flag, 0);
bne(CR0, Lno_unlock);
}
// Unlock
@@ -705,8 +705,8 @@ void InterpreterMacroAssembler::unlock_if_synchronized_method(TosState state,
-(frame::ijava_state_size + frame::interpreter_frame_monitor_size_in_bytes())); // Monitor base
ld(R0, BasicObjectLock::obj_offset(), Rmonitor_base);
cmpdi(CCR0, R0, 0);
bne(CCR0, Lunlock);
cmpdi(CR0, R0, 0);
bne(CR0, Lunlock);
// If it's already unlocked, throw exception.
if (throw_monitor_exception) {
@@ -740,7 +740,7 @@ void InterpreterMacroAssembler::unlock_if_synchronized_method(TosState state,
addi(Rmonitor_base, Rmonitor_base, - frame::ijava_state_size); // Monitor base
subf_(Riterations, R26_monitor, Rmonitor_base);
ble(CCR0, Lno_unlock);
ble(CR0, Lno_unlock);
addi(Rcurrent_obj_addr, Rmonitor_base,
in_bytes(BasicObjectLock::obj_offset()) - frame::interpreter_frame_monitor_size_in_bytes());
@@ -759,8 +759,8 @@ void InterpreterMacroAssembler::unlock_if_synchronized_method(TosState state,
bind(Lloop);
// Check if current entry is used.
cmpdi(CCR0, Rcurrent_obj, 0);
bne(CCR0, Lexception);
cmpdi(CR0, Rcurrent_obj, 0);
bne(CR0, Lexception);
// Preload next iteration's compare value.
ld(Rcurrent_obj, 0, Rcurrent_obj_addr);
addi(Rcurrent_obj_addr, Rcurrent_obj_addr, -delta);
@@ -816,29 +816,29 @@ void InterpreterMacroAssembler::narrow(Register result) {
Label notBool, notByte, notChar, done;
// common case first
cmpwi(CCR0, ret_type, T_INT);
beq(CCR0, done);
cmpwi(CR0, ret_type, T_INT);
beq(CR0, done);
cmpwi(CCR0, ret_type, T_BOOLEAN);
bne(CCR0, notBool);
cmpwi(CR0, ret_type, T_BOOLEAN);
bne(CR0, notBool);
andi(result, result, 0x1);
b(done);
bind(notBool);
cmpwi(CCR0, ret_type, T_BYTE);
bne(CCR0, notByte);
cmpwi(CR0, ret_type, T_BYTE);
bne(CR0, notByte);
extsb(result, result);
b(done);
bind(notByte);
cmpwi(CCR0, ret_type, T_CHAR);
bne(CCR0, notChar);
cmpwi(CR0, ret_type, T_CHAR);
bne(CR0, notChar);
andi(result, result, 0xffff);
b(done);
bind(notChar);
// cmpwi(CCR0, ret_type, T_SHORT); // all that's left
// bne(CCR0, done);
// cmpwi(CR0, ret_type, T_SHORT); // all that's left
// bne(CR0, done);
extsh(result, result);
// Nothing to do for T_INT
@@ -893,8 +893,8 @@ void InterpreterMacroAssembler::remove_activation(TosState state,
// check if already enabled - if so no re-enabling needed
assert(sizeof(StackOverflow::StackGuardState) == 4, "unexpected size");
lwz(R0, in_bytes(JavaThread::stack_guard_state_offset()), R16_thread);
cmpwi(CCR0, R0, StackOverflow::stack_guard_enabled);
beq_predict_taken(CCR0, no_reserved_zone_enabling);
cmpwi(CR0, R0, StackOverflow::stack_guard_enabled);
beq_predict_taken(CR0, no_reserved_zone_enabling);
// Compare frame pointers. There is no good stack pointer, as with stack
// frame compression we can get different SPs when we do calls. A subsequent
@@ -902,8 +902,8 @@ void InterpreterMacroAssembler::remove_activation(TosState state,
// inner call of the method annotated with ReservedStack.
ld_ptr(R0, JavaThread::reserved_stack_activation_offset(), R16_thread);
ld_ptr(R11_scratch1, _abi0(callers_sp), R1_SP); // Load frame pointer.
cmpld(CCR0, R11_scratch1, R0);
blt_predict_taken(CCR0, no_reserved_zone_enabling);
cmpld(CR0, R11_scratch1, R0);
blt_predict_taken(CR0, no_reserved_zone_enabling);
// Enable reserved zone again, throw stack overflow exception.
call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::enable_stack_reserved_zone), R16_thread);
@@ -961,8 +961,8 @@ void InterpreterMacroAssembler::lock_object(Register monitor, Register object) {
if (DiagnoseSyncOnValueBasedClasses != 0) {
load_klass(tmp, object);
lbz(tmp, in_bytes(Klass::misc_flags_offset()), tmp);
testbitdi(CCR0, R0, tmp, exact_log2(KlassFlags::_misc_is_value_based_class));
bne(CCR0, slow_case);
testbitdi(CR0, R0, tmp, exact_log2(KlassFlags::_misc_is_value_based_class));
bne(CR0, slow_case);
}
if (LockingMode == LM_LIGHTWEIGHT) {
@@ -989,8 +989,8 @@ void InterpreterMacroAssembler::lock_object(Register monitor, Register object) {
addi(object_mark_addr, object, oopDesc::mark_offset_in_bytes());
// Must fence, otherwise, preceding store(s) may float below cmpxchg.
// CmpxchgX sets CCR0 to cmpX(current, displaced).
cmpxchgd(/*flag=*/CCR0,
// CmpxchgX sets CR0 to cmpX(current, displaced).
cmpxchgd(/*flag=*/CR0,
/*current_value=*/current_header,
/*compare_value=*/header, /*exchange_value=*/monitor,
/*where=*/object_mark_addr,
@@ -1021,7 +1021,7 @@ void InterpreterMacroAssembler::lock_object(Register monitor, Register object) {
and_(R0/*==0?*/, current_header, tmp);
// If condition is true we are done and hence we can store 0 in the displaced
// header indicating it is a recursive lock.
bne(CCR0, slow_case);
bne(CR0, slow_case);
std(R0/*==0!*/, mark_offset, monitor);
b(count_locking);
}
@@ -1087,8 +1087,8 @@ void InterpreterMacroAssembler::unlock_object(Register monitor) {
BasicLock::displaced_header_offset_in_bytes(), monitor);
// If the displaced header is zero, we have a recursive unlock.
cmpdi(CCR0, header, 0);
beq(CCR0, free_slot); // recursive unlock
cmpdi(CR0, header, 0);
beq(CR0, free_slot); // recursive unlock
}
// } else if (Atomic::cmpxchg(obj->mark_addr(), monitor, displaced_header) == monitor) {
@@ -1108,8 +1108,8 @@ void InterpreterMacroAssembler::unlock_object(Register monitor) {
// We have the displaced header in displaced_header. If the lock is still
// lightweight, it will contain the monitor address and we'll store the
// displaced header back into the object's mark word.
// CmpxchgX sets CCR0 to cmpX(current, monitor).
cmpxchgd(/*flag=*/CCR0,
// CmpxchgX sets CR0 to cmpX(current, monitor).
cmpxchgd(/*flag=*/CR0,
/*current_value=*/current_header,
/*compare_value=*/monitor, /*exchange_value=*/header,
/*where=*/object_mark_addr,
@@ -1170,8 +1170,8 @@ void InterpreterMacroAssembler::call_from_interpreter(Register Rtarget_method, R
// compiled code in threads for which the event is enabled. Check here for
// interp_only_mode if these events CAN be enabled.
Label done;
cmpwi(CCR0, Rinterp_only, 0);
beq(CCR0, done);
cmpwi(CR0, Rinterp_only, 0);
beq(CR0, done);
ld(Rtarget_addr, in_bytes(Method::interpreter_entry_offset()), Rtarget_method);
align(32, 12);
bind(done);
@@ -1180,8 +1180,8 @@ void InterpreterMacroAssembler::call_from_interpreter(Register Rtarget_method, R
#ifdef ASSERT
{
Label Lok;
cmpdi(CCR0, Rtarget_addr, 0);
bne(CCR0, Lok);
cmpdi(CR0, Rtarget_addr, 0);
bne(CR0, Lok);
stop("null entry point");
bind(Lok);
}
@@ -1211,7 +1211,7 @@ void InterpreterMacroAssembler::call_from_interpreter(Register Rtarget_method, R
sldi(Rscratch1, Rscratch1, Interpreter::logStackElementSize);
add(Rscratch1, Rscratch1, Rscratch2); // Rscratch2 contains fp
// Compare sender_sp with the derelativized top_frame_sp
cmpd(CCR0, R21_sender_SP, Rscratch1);
cmpd(CR0, R21_sender_SP, Rscratch1);
asm_assert_eq("top_frame_sp incorrect");
#endif
@@ -1234,8 +1234,8 @@ void InterpreterMacroAssembler::set_method_data_pointer_for_bcp() {
// Test ImethodDataPtr. If it is null, continue at the specified label.
void InterpreterMacroAssembler::test_method_data_pointer(Label& zero_continue) {
assert(ProfileInterpreter, "must be profiling interpreter");
cmpdi(CCR0, R28_mdx, 0);
beq(CCR0, zero_continue);
cmpdi(CR0, R28_mdx, 0);
beq(CR0, zero_continue);
}
void InterpreterMacroAssembler::verify_method_data_pointer() {
@@ -1250,8 +1250,8 @@ void InterpreterMacroAssembler::verify_method_data_pointer() {
ld(R12_scratch2, in_bytes(Method::const_offset()), R19_method);
addi(R11_scratch1, R11_scratch1, in_bytes(ConstMethod::codes_offset()));
add(R11_scratch1, R12_scratch2, R12_scratch2);
cmpd(CCR0, R11_scratch1, R14_bcp);
beq(CCR0, verify_continue);
cmpd(CR0, R11_scratch1, R14_bcp);
beq(CR0, verify_continue);
call_VM_leaf(CAST_FROM_FN_PTR(address, InterpreterRuntime::verify_mdp ), R19_method, R14_bcp, R28_mdx);
@@ -1334,8 +1334,8 @@ void InterpreterMacroAssembler::test_mdp_data_at(int offset,
assert(ProfileInterpreter, "must be profiling interpreter");
ld(test_out, offset, R28_mdx);
cmpd(CCR0, value, test_out);
bne(CCR0, not_equal_continue);
cmpd(CR0, value, test_out);
bne(CR0, not_equal_continue);
}
// Update the method data pointer by the displacement located at some fixed
@@ -1491,8 +1491,8 @@ void InterpreterMacroAssembler::profile_virtual_call(Register Rreceiver,
Label skip_receiver_profile;
if (receiver_can_be_null) {
Label not_null;
cmpdi(CCR0, Rreceiver, 0);
bne(CCR0, not_null);
cmpdi(CR0, Rreceiver, 0);
bne(CR0, not_null);
// We are making a call. Increment the count for null receiver.
increment_mdp_data_at(in_bytes(CounterData::count_offset()), Rscratch1, Rscratch2);
b(skip_receiver_profile);
@@ -1681,8 +1681,8 @@ void InterpreterMacroAssembler::record_klass_in_profile_helper(
if (start_row == last_row) {
// The only thing left to do is handle the null case.
// Scratch1 contains test_out from test_mdp_data_at.
cmpdi(CCR0, scratch1, 0);
beq(CCR0, found_null);
cmpdi(CR0, scratch1, 0);
beq(CR0, found_null);
// Receiver did not match any saved receiver and there is no empty row for it.
// Increment total counter to indicate polymorphic case.
increment_mdp_data_at(in_bytes(CounterData::count_offset()), scratch1, scratch2);
@@ -1691,8 +1691,8 @@ void InterpreterMacroAssembler::record_klass_in_profile_helper(
break;
}
// Since null is rare, make it be the branch-taken case.
cmpdi(CCR0, scratch1, 0);
beq(CCR0, found_null);
cmpdi(CR0, scratch1, 0);
beq(CR0, found_null);
// Put all the "Case 3" tests here.
record_klass_in_profile_helper(receiver, scratch1, scratch2, start_row + 1, done);
@@ -1734,27 +1734,27 @@ void InterpreterMacroAssembler::profile_obj_type(Register obj, Register mdo_addr
ld(tmp, mdo_addr_offs, mdo_addr_base);
// Set null_seen if obj is 0.
cmpdi(CCR0, obj, 0);
cmpdi(CR0, obj, 0);
ori(R0, tmp, TypeEntries::null_seen);
beq(CCR0, do_update);
beq(CR0, do_update);
load_klass(klass, obj);
clrrdi(R0, tmp, exact_log2(-TypeEntries::type_klass_mask));
// Basically same as andi(R0, tmp, TypeEntries::type_klass_mask);
cmpd(CCR1, R0, klass);
cmpd(CR1, R0, klass);
// Klass seen before, nothing to do (regardless of unknown bit).
//beq(CCR1, do_nothing);
//beq(CR1, do_nothing);
andi_(R0, tmp, TypeEntries::type_unknown);
// Already unknown. Nothing to do anymore.
//bne(CCR0, do_nothing);
crorc(CCR0, Assembler::equal, CCR1, Assembler::equal); // cr0 eq = cr1 eq or cr0 ne
beq(CCR0, do_nothing);
//bne(CR0, do_nothing);
crorc(CR0, Assembler::equal, CR1, Assembler::equal); // cr0 eq = cr1 eq or cr0 ne
beq(CR0, do_nothing);
clrrdi_(R0, tmp, exact_log2(-TypeEntries::type_mask));
orr(R0, klass, tmp); // Combine klass and null_seen bit (only used if (tmp & type_mask)==0).
beq(CCR0, do_update); // First time here. Set profile type.
beq(CR0, do_update); // First time here. Set profile type.
// Different than before. Cannot keep accurate profile.
ori(R0, tmp, TypeEntries::type_unknown);
@@ -1785,8 +1785,8 @@ void InterpreterMacroAssembler::profile_arguments_type(Register callee,
in_bytes(VirtualCallData::virtual_call_data_size()) : in_bytes(CounterData::counter_data_size());
lbz(tmp1, in_bytes(DataLayout::tag_offset()) - off_to_start, R28_mdx);
cmpwi(CCR0, tmp1, is_virtual ? DataLayout::virtual_call_type_data_tag : DataLayout::call_type_data_tag);
bne(CCR0, profile_continue);
cmpwi(CR0, tmp1, is_virtual ? DataLayout::virtual_call_type_data_tag : DataLayout::call_type_data_tag);
bne(CR0, profile_continue);
if (MethodData::profile_arguments()) {
Label done;
@@ -1797,9 +1797,9 @@ void InterpreterMacroAssembler::profile_arguments_type(Register callee,
if (i > 0 || MethodData::profile_return()) {
// If return value type is profiled we may have no argument to profile.
ld(tmp1, in_bytes(TypeEntriesAtCall::cell_count_offset())-off_to_args, R28_mdx);
cmpdi(CCR0, tmp1, (i+1)*TypeStackSlotEntries::per_arg_count());
cmpdi(CR0, tmp1, (i+1)*TypeStackSlotEntries::per_arg_count());
addi(tmp1, tmp1, -i*TypeStackSlotEntries::per_arg_count());
blt(CCR0, done);
blt(CR0, done);
}
ld(tmp1, in_bytes(Method::const_offset()), callee);
lhz(tmp1, in_bytes(ConstMethod::size_of_parameters_offset()), tmp1);
@@ -1865,12 +1865,12 @@ void InterpreterMacroAssembler::profile_return_type(Register ret, Register tmp1,
// length.
lbz(tmp1, 0, R14_bcp);
lbz(tmp2, in_bytes(Method::intrinsic_id_offset()), R19_method);
cmpwi(CCR0, tmp1, Bytecodes::_invokedynamic);
cmpwi(CCR1, tmp1, Bytecodes::_invokehandle);
cror(CCR0, Assembler::equal, CCR1, Assembler::equal);
cmpwi(CCR1, tmp2, static_cast<int>(vmIntrinsics::_compiledLambdaForm));
cror(CCR0, Assembler::equal, CCR1, Assembler::equal);
bne(CCR0, profile_continue);
cmpwi(CR0, tmp1, Bytecodes::_invokedynamic);
cmpwi(CR1, tmp1, Bytecodes::_invokehandle);
cror(CR0, Assembler::equal, CR1, Assembler::equal);
cmpwi(CR1, tmp2, static_cast<int>(vmIntrinsics::_compiledLambdaForm));
cror(CR0, Assembler::equal, CR1, Assembler::equal);
bne(CR0, profile_continue);
}
profile_obj_type(ret, R28_mdx, -in_bytes(ReturnTypeEntry::size()), tmp1, tmp2);
@@ -1890,8 +1890,8 @@ void InterpreterMacroAssembler::profile_parameters_type(Register tmp1, Register
// Load the offset of the area within the MDO used for
// parameters. If it's negative we're not profiling any parameters.
lwz(tmp1, in_bytes(MethodData::parameters_type_data_di_offset()) - in_bytes(MethodData::data_offset()), R28_mdx);
cmpwi(CCR0, tmp1, 0);
blt(CCR0, profile_continue);
cmpwi(CR0, tmp1, 0);
blt(CR0, profile_continue);
// Compute a pointer to the area for parameters from the offset
// and move the pointer to the slot for the last
@@ -1936,9 +1936,9 @@ void InterpreterMacroAssembler::profile_parameters_type(Register tmp1, Register
// Go to next parameter.
int delta = TypeStackSlotEntries::per_arg_count() * DataLayout::cell_size + (type_base - off_base);
cmpdi(CCR0, entry_offset, off_base + delta);
cmpdi(CR0, entry_offset, off_base + delta);
addi(entry_offset, entry_offset, -delta);
bge(CCR0, loop);
bge(CR0, loop);
align(32, 12);
bind(profile_continue);
@@ -1975,7 +1975,7 @@ void InterpreterMacroAssembler::add_monitor_to_stack(bool stack_is_empty, Regist
subf(n_slots, esp, R26_monitor);
srdi_(n_slots, n_slots, LogBytesPerWord); // Compute number of slots to copy.
assert(LogBytesPerWord == 3, "conflicts assembler instructions");
beq(CCR0, copy_slot_finished); // Nothing to copy.
beq(CR0, copy_slot_finished); // Nothing to copy.
mtctr(n_slots);
@@ -2115,8 +2115,8 @@ void InterpreterMacroAssembler::check_and_forward_exception(Register Rscratch1,
Label Ldone;
// Get pending exception oop.
ld(Rexception, thread_(pending_exception));
cmpdi(CCR0, Rexception, 0);
beq(CCR0, Ldone);
cmpdi(CR0, Rexception, 0);
beq(CR0, Ldone);
li(Rtmp, 0);
mr_if_needed(R3, Rexception);
std(Rtmp, thread_(pending_exception)); // Clear exception in thread
@@ -2168,7 +2168,7 @@ void InterpreterMacroAssembler::call_VM_preemptable(Register oop_result, address
Label resume_pc, not_preempted;
DEBUG_ONLY(ld(R0, in_bytes(JavaThread::preempt_alternate_return_offset()), R16_thread));
DEBUG_ONLY(cmpdi(CCR0, R0, 0));
DEBUG_ONLY(cmpdi(CR0, R0, 0));
asm_assert_eq("Should not have alternate return address set");
// Preserve 2 registers
@@ -2186,8 +2186,8 @@ void InterpreterMacroAssembler::call_VM_preemptable(Register oop_result, address
// Jump to handler if the call was preempted
ld(R0, in_bytes(JavaThread::preempt_alternate_return_offset()), R16_thread);
cmpdi(CCR0, R0, 0);
beq(CCR0, not_preempted);
cmpdi(CR0, R0, 0);
beq(CR0, not_preempted);
mtlr(R0);
li(R0, 0);
std(R0, in_bytes(JavaThread::preempt_alternate_return_offset()), R16_thread);
@@ -2215,8 +2215,8 @@ void InterpreterMacroAssembler::restore_after_resume(Register fp) {
{
Label ok;
ld(R12_scratch2, 0, R1_SP); // load fp
cmpd(CCR0, R12_scratch2, R11_scratch1);
beq(CCR0, ok);
cmpd(CR0, R12_scratch2, R11_scratch1);
beq(CR0, ok);
stop(FILE_AND_LINE ": FP is expected in R11_scratch1");
bind(ok);
}
@@ -2298,8 +2298,8 @@ void InterpreterMacroAssembler::restore_interpreter_state(Register scratch, bool
{
Label Lok;
subf(R0, R1_SP, scratch);
cmpdi(CCR0, R0, frame::top_ijava_frame_abi_size + frame::ijava_state_size);
bge(CCR0, Lok);
cmpdi(CR0, R0, frame::top_ijava_frame_abi_size + frame::ijava_state_size);
bge(CR0, Lok);
stop("frame too small (restore istate)");
bind(Lok);
}
@@ -2312,13 +2312,13 @@ void InterpreterMacroAssembler::get_method_counters(Register method,
BLOCK_COMMENT("Load and ev. allocate counter object {");
Label has_counters;
ld(Rcounters, in_bytes(Method::method_counters_offset()), method);
cmpdi(CCR0, Rcounters, 0);
bne(CCR0, has_counters);
cmpdi(CR0, Rcounters, 0);
bne(CR0, has_counters);
call_VM(noreg, CAST_FROM_FN_PTR(address,
InterpreterRuntime::build_method_counters), method);
ld(Rcounters, in_bytes(Method::method_counters_offset()), method);
cmpdi(CCR0, Rcounters, 0);
beq(CCR0, skip); // No MethodCounters, OutOfMemory.
cmpdi(CR0, Rcounters, 0);
beq(CR0, skip); // No MethodCounters, OutOfMemory.
BLOCK_COMMENT("} Load and ev. allocate counter object");
bind(has_counters);
@@ -2398,7 +2398,7 @@ void InterpreterMacroAssembler::verify_oop_or_return_address(Register reg, Regis
const int log2_bytecode_size_limit = 16;
srdi_(Rtmp, reg, log2_bytecode_size_limit);
bne(CCR0, test);
bne(CR0, test);
address fd = CAST_FROM_FN_PTR(address, verify_return_address);
const int nbytes_save = MacroAssembler::num_volatile_regs * 8;
@@ -2442,8 +2442,8 @@ void InterpreterMacroAssembler::notify_method_entry() {
Label jvmti_post_done;
lwz(R0, in_bytes(JavaThread::interp_only_mode_offset()), R16_thread);
cmpwi(CCR0, R0, 0);
beq(CCR0, jvmti_post_done);
cmpwi(CR0, R0, 0);
beq(CR0, jvmti_post_done);
call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::post_method_entry));
bind(jvmti_post_done);
@@ -2476,8 +2476,8 @@ void InterpreterMacroAssembler::notify_method_exit(bool is_native_method, TosSta
Label jvmti_post_done;
lwz(R0, in_bytes(JavaThread::interp_only_mode_offset()), R16_thread);
cmpwi(CCR0, R0, 0);
beq(CCR0, jvmti_post_done);
cmpwi(CR0, R0, 0);
beq(CR0, jvmti_post_done);
if (!is_native_method) { push(state); } // Expose tos to GC.
call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::post_method_exit), check_exceptions);
if (!is_native_method) { pop(state); }

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2013 SAP SE. All rights reserved.
* Copyright (c) 2012, 2025 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -103,9 +103,9 @@ void InterpreterRuntime::SignatureHandlerGenerator::pass_object() {
Label do_null;
if (do_null_check) {
__ ld(R0, locals_j_arg_at(offset()));
__ cmpdi(CCR0, R0, 0);
__ cmpdi(CR0, R0, 0);
__ li(r, 0);
__ beq(CCR0, do_null);
__ beq(CR0, do_null);
}
__ addir(r, locals_j_arg_at(offset()));
__ bind(do_null);

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2019 SAP SE. All rights reserved.
* Copyright (c) 2012, 2025 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -75,7 +75,7 @@ address JNI_FastGetField::generate_fast_get_int_field0(BasicType type) {
__ ld(Rcounter, counter_offs, Rcounter_addr);
__ andi_(R0, Rcounter, 1);
__ bne(CCR0, slow);
__ bne(CR0, slow);
if (support_IRIW_for_not_multiple_copy_atomic_cpu) {
// Field may be volatile.
@@ -91,8 +91,8 @@ address JNI_FastGetField::generate_fast_get_int_field0(BasicType type) {
int fac_offs = __ load_const_optimized(Rtmp, JvmtiExport::get_field_access_count_addr(),
R0, true);
__ lwa(Rtmp, fac_offs, Rtmp);
__ cmpwi(CCR0, Rtmp, 0);
__ bne(CCR0, slow);
__ cmpwi(CR0, Rtmp, 0);
__ bne(CR0, slow);
}
BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
@@ -118,8 +118,8 @@ address JNI_FastGetField::generate_fast_get_int_field0(BasicType type) {
// Order preceding load(s) wrt. succeeding check (LoadStore for volatile field).
if (is_fp) {
Label next;
__ fcmpu(CCR0, F1_RET, F1_RET);
__ bne(CCR0, next);
__ fcmpu(CR0, F1_RET, F1_RET);
__ bne(CR0, next);
__ bind(next);
} else {
__ twi_0(Rtmp);
@@ -127,8 +127,8 @@ address JNI_FastGetField::generate_fast_get_int_field0(BasicType type) {
__ isync();
__ ld(R0, counter_offs, Rcounter_addr);
__ cmpd(CCR0, R0, Rcounter);
__ bne(CCR0, slow);
__ cmpd(CR0, R0, Rcounter);
__ bne(CR0, slow);
if (!is_fp) {
__ mr(R3_RET, Rtmp);

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2024 SAP SE. All rights reserved.
* Copyright (c) 2002, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2025 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -179,8 +179,8 @@ class MacroAssembler: public Assembler {
//
// branch, jump
//
// set dst to -1, 0, +1 as follows: if CCR0bi is "greater than", dst is set to 1,
// if CCR0bi is "equal", dst is set to 0, otherwise it's set to -1.
// set dst to -1, 0, +1 as follows: if CR0bi is "greater than", dst is set to 1,
// if CR0bi is "equal", dst is set to 0, otherwise it's set to -1.
void inline set_cmp3(Register dst);
// set dst to (treat_unordered_like_less ? -1 : +1)
void inline set_cmpu3(Register dst, bool treat_unordered_like_less);
@@ -612,6 +612,20 @@ class MacroAssembler: public Assembler {
// The temp_reg can be noreg, if no temps are available.
// It can also be sub_klass or super_klass, meaning it's OK to kill that one.
// Updates the sub's secondary super cache as necessary.
void check_klass_subtype_slow_path_linear(Register sub_klass,
Register super_klass,
Register temp1_reg,
Register temp2_reg,
Label* L_success = nullptr,
Register result_reg = noreg);
void check_klass_subtype_slow_path_table(Register sub_klass,
Register super_klass,
Register temp1_reg,
Register temp2_reg,
Label* L_success = nullptr,
Register result_reg = noreg);
void check_klass_subtype_slow_path(Register sub_klass,
Register super_klass,
Register temp1_reg,
@@ -619,6 +633,25 @@ class MacroAssembler: public Assembler {
Label* L_success = nullptr,
Register result_reg = noreg);
void lookup_secondary_supers_table_var(Register sub_klass,
Register r_super_klass,
Register temp1,
Register temp2,
Register temp3,
Register temp4,
Register result);
// If r is valid, return r.
// If r is invalid, remove a register r2 from available_regs, add r2
// to regs_to_push, then return r2.
Register allocate_if_noreg(const Register r,
RegSetIterator<Register> &available_regs,
RegSet &regs_to_push);
// Frameless register spills (negative offset from SP)
void push_set(RegSet set);
void pop_set(RegSet set);
// Simplified, combined version, good for typical uses.
// Falls through on failure.
void check_klass_subtype(Register sub_klass,
@@ -631,14 +664,14 @@ class MacroAssembler: public Assembler {
// As above, but with a constant super_klass.
// The result is in Register result, not the condition codes.
void lookup_secondary_supers_table(Register r_sub_klass,
Register r_super_klass,
Register temp1,
Register temp2,
Register temp3,
Register temp4,
Register result,
u1 super_klass_slot);
void lookup_secondary_supers_table_const(Register r_sub_klass,
Register r_super_klass,
Register temp1,
Register temp2,
Register temp3,
Register temp4,
Register result,
u1 super_klass_slot);
void verify_secondary_supers_table(Register r_sub_klass,
Register r_super_klass,

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2024 SAP SE. All rights reserved.
* Copyright (c) 2002, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2025 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -248,14 +248,14 @@ inline bool MacroAssembler::is_bc_far_variant3_at(address instruction_addr) {
is_endgroup(instruction_2);
}
// set dst to -1, 0, +1 as follows: if CCR0bi is "greater than", dst is set to 1,
// if CCR0bi is "equal", dst is set to 0, otherwise it's set to -1.
// set dst to -1, 0, +1 as follows: if CR0bi is "greater than", dst is set to 1,
// if CR0bi is "equal", dst is set to 0, otherwise it's set to -1.
inline void MacroAssembler::set_cmp3(Register dst) {
assert_different_registers(dst, R0);
// P10, prefer using setbc instructions
if (VM_Version::has_brw()) {
setbc(R0, CCR0, Assembler::greater); // Set 1 to R0 if CCR0bi is "greater than", otherwise 0
setnbc(dst, CCR0, Assembler::less); // Set -1 to dst if CCR0bi is "less than", otherwise 0
setbc(R0, CR0, Assembler::greater); // Set 1 to R0 if CR0bi is "greater than", otherwise 0
setnbc(dst, CR0, Assembler::less); // Set -1 to dst if CR0bi is "less than", otherwise 0
} else {
mfcr(R0); // copy CR register to R0
srwi(dst, R0, 30); // copy the first two bits to dst
@@ -267,9 +267,9 @@ inline void MacroAssembler::set_cmp3(Register dst) {
// set dst to (treat_unordered_like_less ? -1 : +1)
inline void MacroAssembler::set_cmpu3(Register dst, bool treat_unordered_like_less) {
if (treat_unordered_like_less) {
cror(CCR0, Assembler::less, CCR0, Assembler::summary_overflow); // treat unordered like less
cror(CR0, Assembler::less, CR0, Assembler::summary_overflow); // treat unordered like less
} else {
cror(CCR0, Assembler::greater, CCR0, Assembler::summary_overflow); // treat unordered like greater
cror(CR0, Assembler::greater, CR0, Assembler::summary_overflow); // treat unordered like greater
}
set_cmp3(dst);
}
@@ -280,11 +280,11 @@ inline void MacroAssembler::normalize_bool(Register dst, Register temp, bool is_
if (VM_Version::has_brw()) {
if (is_64bit) {
cmpdi(CCR0, dst, 0);
cmpdi(CR0, dst, 0);
} else {
cmpwi(CCR0, dst, 0);
cmpwi(CR0, dst, 0);
}
setbcr(dst, CCR0, Assembler::equal);
setbcr(dst, CR0, Assembler::equal);
} else {
assert_different_registers(temp, dst);
neg(temp, dst);
@@ -373,8 +373,8 @@ inline void MacroAssembler::null_check_throw(Register a, int offset, Register te
trap_null_check(a);
} else {
Label ok;
cmpdi(CCR0, a, 0);
bne(CCR0, ok);
cmpdi(CR0, a, 0);
bne(CR0, ok);
load_const_optimized(temp_reg, exception_entry);
mtctr(temp_reg);
bctr();
@@ -390,8 +390,8 @@ inline void MacroAssembler::null_check(Register a, int offset, Label *Lis_null)
trap_null_check(a);
} else if (Lis_null){
Label ok;
cmpdi(CCR0, a, 0);
beq(CCR0, *Lis_null);
cmpdi(CR0, a, 0);
beq(CR0, *Lis_null);
}
}
}
@@ -468,14 +468,14 @@ inline Register MacroAssembler::encode_heap_oop_not_null(Register d, Register sr
inline Register MacroAssembler::encode_heap_oop(Register d, Register src) {
if (CompressedOops::base() != nullptr) {
if (VM_Version::has_isel()) {
cmpdi(CCR0, src, 0);
cmpdi(CR0, src, 0);
Register co = encode_heap_oop_not_null(d, src);
assert(co == d, "sanity");
isel_0(d, CCR0, Assembler::equal);
isel_0(d, CR0, Assembler::equal);
} else {
Label isNull;
or_(d, src, src); // move and compare 0
beq(CCR0, isNull);
beq(CR0, isNull);
encode_heap_oop_not_null(d, src);
bind(isNull);
}
@@ -509,16 +509,16 @@ inline void MacroAssembler::decode_heap_oop(Register d) {
Label isNull;
bool use_isel = false;
if (CompressedOops::base() != nullptr) {
cmpwi(CCR0, d, 0);
cmpwi(CR0, d, 0);
if (VM_Version::has_isel()) {
use_isel = true;
} else {
beq(CCR0, isNull);
beq(CR0, isNull);
}
}
decode_heap_oop_not_null(d);
if (use_isel) {
isel_0(d, CCR0, Assembler::equal);
isel_0(d, CR0, Assembler::equal);
}
bind(isNull);
}

View File

@@ -93,7 +93,7 @@ void MacroAssembler::sha256_load_h_vec(const VectorRegister a,
lvx (a, hptr);
addi (tmp, hptr, 16);
lvx (e, tmp);
beq (CCR0, sha256_aligned);
beq (CR0, sha256_aligned);
// handle unaligned accesses
load_perm(vRb, hptr);
@@ -121,7 +121,7 @@ void MacroAssembler::sha256_load_w_plus_k_vec(const Register buf_in,
VectorRegister vRb = VR6;
andi_ (tmp, buf_in, 0xF);
beq (CCR0, w_aligned); // address ends with 0x0, not 0x8
beq (CR0, w_aligned); // address ends with 0x0, not 0x8
// deal with unaligned addresses
lvx (ws[0], buf_in);
@@ -318,7 +318,7 @@ void MacroAssembler::sha256_update_sha_state(const VectorRegister a,
li (of16, 16);
lvx (vt0, hptr);
lvx (vt5, of16, hptr);
beq (CCR0, state_load_aligned);
beq (CR0, state_load_aligned);
// handle unaligned accesses
li (of32, 32);
@@ -538,8 +538,8 @@ void MacroAssembler::sha256(bool multi_block) {
if (multi_block) {
addi(buf_in, buf_in, buf_size);
addi(ofs, ofs, buf_size);
cmplw(CCR0, ofs, limit);
ble(CCR0, sha_loop);
cmplw(CR0, ofs, limit);
ble(CR0, sha_loop);
// return ofs
mr(R3_RET, ofs);
@@ -567,7 +567,7 @@ void MacroAssembler::sha512_load_w_vec(const Register buf_in,
Label is_aligned, after_alignment;
andi_ (tmp, buf_in, 0xF);
beq (CCR0, is_aligned); // address ends with 0x0, not 0x8
beq (CR0, is_aligned); // address ends with 0x0, not 0x8
// deal with unaligned addresses
lvx (ws[0], buf_in);
@@ -623,7 +623,7 @@ void MacroAssembler::sha512_update_sha_state(const Register state,
VectorRegister aux = VR9;
andi_(tmp, state, 0xf);
beq(CCR0, state_save_aligned);
beq(CR0, state_save_aligned);
// deal with unaligned addresses
{
@@ -860,7 +860,7 @@ void MacroAssembler::sha512_load_h_vec(const Register state,
Label state_aligned, after_state_aligned;
andi_(tmp, state, 0xf);
beq(CCR0, state_aligned);
beq(CR0, state_aligned);
// deal with unaligned addresses
VectorRegister aux = VR9;
@@ -1121,8 +1121,8 @@ void MacroAssembler::sha512(bool multi_block) {
if (multi_block) {
addi(buf_in, buf_in, buf_size);
addi(ofs, ofs, buf_size);
cmplw(CCR0, ofs, limit);
ble(CCR0, sha_loop);
cmplw(CR0, ofs, limit);
ble(CR0, sha_loop);
// return ofs
mr(R3_RET, ofs);

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2024 SAP SE. All rights reserved.
* Copyright (c) 2012, 2025 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -83,16 +83,16 @@ void MethodHandles::verify_klass(MacroAssembler* _masm,
Label L_ok, L_bad;
BLOCK_COMMENT("verify_klass {");
__ verify_oop(obj_reg, FILE_AND_LINE);
__ cmpdi(CCR0, obj_reg, 0);
__ beq(CCR0, L_bad);
__ cmpdi(CR0, obj_reg, 0);
__ beq(CR0, L_bad);
__ load_klass(temp_reg, obj_reg);
__ load_const_optimized(temp2_reg, (address) klass_addr);
__ ld(temp2_reg, 0, temp2_reg);
__ cmpd(CCR0, temp_reg, temp2_reg);
__ beq(CCR0, L_ok);
__ cmpd(CR0, temp_reg, temp2_reg);
__ beq(CR0, L_ok);
__ ld(temp_reg, klass->super_check_offset(), temp_reg);
__ cmpd(CCR0, temp_reg, temp2_reg);
__ beq(CCR0, L_ok);
__ cmpd(CR0, temp_reg, temp2_reg);
__ beq(CR0, L_ok);
__ BIND(L_bad);
__ stop(error_message);
__ BIND(L_ok);
@@ -107,8 +107,8 @@ void MethodHandles::verify_ref_kind(MacroAssembler* _masm, int ref_kind, Registe
// assert(sizeof(u4) == sizeof(java.lang.invoke.MemberName.flags), "");
__ srwi( temp, temp, java_lang_invoke_MemberName::MN_REFERENCE_KIND_SHIFT);
__ andi(temp, temp, java_lang_invoke_MemberName::MN_REFERENCE_KIND_MASK);
__ cmpwi(CCR1, temp, ref_kind);
__ beq(CCR1, L);
__ cmpwi(CR1, temp, ref_kind);
__ beq(CR1, L);
{ char* buf = NEW_C_HEAP_ARRAY(char, 100, mtInternal);
jio_snprintf(buf, 100, "verify_ref_kind expected %x", ref_kind);
if (ref_kind == JVM_REF_invokeVirtual ||
@@ -135,11 +135,11 @@ void MethodHandles::jump_from_method_handle(MacroAssembler* _masm, Register meth
// compiled code in threads for which the event is enabled. Check here for
// interp_only_mode if these events CAN be enabled.
__ lwz(temp, in_bytes(JavaThread::interp_only_mode_offset()), R16_thread);
__ cmplwi(CCR0, temp, 0);
__ beq(CCR0, run_compiled_code);
__ cmplwi(CR0, temp, 0);
__ beq(CR0, run_compiled_code);
// Null method test is replicated below in compiled case.
__ cmplwi(CCR0, R19_method, 0);
__ beq(CCR0, L_no_such_method);
__ cmplwi(CR0, R19_method, 0);
__ beq(CR0, L_no_such_method);
__ ld(target, in_bytes(Method::interpreter_entry_offset()), R19_method);
__ mtctr(target);
__ bctr();
@@ -147,8 +147,8 @@ void MethodHandles::jump_from_method_handle(MacroAssembler* _masm, Register meth
}
// Compiled case, either static or fall-through from runtime conditional
__ cmplwi(CCR0, R19_method, 0);
__ beq(CCR0, L_no_such_method);
__ cmplwi(CR0, R19_method, 0);
__ beq(CR0, L_no_such_method);
const ByteSize entry_offset = for_compiler_entry ? Method::from_compiled_offset() :
Method::from_interpreted_offset();
@@ -200,8 +200,8 @@ void MethodHandles::jump_to_lambda_form(MacroAssembler* _masm,
// assert(sizeof(u2) == sizeof(ConstMethod::_size_of_parameters), "");
Label L;
__ ld(temp2, __ argument_offset(temp2, temp2, 0), R15_esp);
__ cmpd(CCR1, temp2, recv);
__ beq(CCR1, L);
__ cmpd(CR1, temp2, recv);
__ beq(CR1, L);
__ stop("receiver not on stack");
__ BIND(L);
}
@@ -248,8 +248,8 @@ address MethodHandles::generate_method_handle_interpreter_entry(MacroAssembler*
BLOCK_COMMENT("verify_intrinsic_id {");
__ load_sized_value(R30_tmp1, in_bytes(Method::intrinsic_id_offset()), R19_method,
sizeof(u2), /*is_signed*/ false);
__ cmpwi(CCR1, R30_tmp1, (int) iid);
__ beq(CCR1, L);
__ cmpwi(CR1, R30_tmp1, (int) iid);
__ beq(CR1, L);
if (iid == vmIntrinsics::_linkToVirtual ||
iid == vmIntrinsics::_linkToSpecial) {
// could do this for all kinds, but would explode assembly code size
@@ -425,8 +425,8 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm,
if (VerifyMethodHandles) {
Label L_index_ok;
__ cmpdi(CCR1, temp2_index, 0);
__ bge(CCR1, L_index_ok);
__ cmpdi(CR1, temp2_index, 0);
__ bge(CR1, L_index_ok);
__ stop("no virtual index");
__ BIND(L_index_ok);
}
@@ -457,8 +457,8 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm,
__ ld(vtable_index, NONZERO(java_lang_invoke_MemberName::vmindex_offset()), member_reg);
if (VerifyMethodHandles) {
Label L_index_ok;
__ cmpdi(CCR1, vtable_index, 0);
__ bge(CCR1, L_index_ok);
__ cmpdi(CR1, vtable_index, 0);
__ bge(CR1, L_index_ok);
__ stop("invalid vtable index for MH.invokeInterface");
__ BIND(L_index_ok);
}

View File

@@ -1,6 +1,6 @@
//
// Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
// Copyright (c) 2012, 2024 SAP SE. All rights reserved.
// Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved.
// Copyright (c) 2012, 2025 SAP SE. All rights reserved.
// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
//
// This code is free software; you can redistribute it and/or modify it
@@ -236,14 +236,14 @@ register %{
// in the CR register.
// types: v = volatile, nv = non-volatile, s = system
reg_def CCR0(SOC, SOC, Op_RegFlags, 0, CCR0->as_VMReg()); // v
reg_def CCR1(SOC, SOC, Op_RegFlags, 1, CCR1->as_VMReg()); // v
reg_def CCR2(SOC, SOC, Op_RegFlags, 2, CCR2->as_VMReg()); // nv
reg_def CCR3(SOC, SOC, Op_RegFlags, 3, CCR3->as_VMReg()); // nv
reg_def CCR4(SOC, SOC, Op_RegFlags, 4, CCR4->as_VMReg()); // nv
reg_def CCR5(SOC, SOC, Op_RegFlags, 5, CCR5->as_VMReg()); // v
reg_def CCR6(SOC, SOC, Op_RegFlags, 6, CCR6->as_VMReg()); // v
reg_def CCR7(SOC, SOC, Op_RegFlags, 7, CCR7->as_VMReg()); // v
reg_def CR0(SOC, SOC, Op_RegFlags, 0, CR0->as_VMReg()); // v
reg_def CR1(SOC, SOC, Op_RegFlags, 1, CR1->as_VMReg()); // v
reg_def CR2(SOC, SOC, Op_RegFlags, 2, CR2->as_VMReg()); // nv
reg_def CR3(SOC, SOC, Op_RegFlags, 3, CR3->as_VMReg()); // nv
reg_def CR4(SOC, SOC, Op_RegFlags, 4, CR4->as_VMReg()); // nv
reg_def CR5(SOC, SOC, Op_RegFlags, 5, CR5->as_VMReg()); // v
reg_def CR6(SOC, SOC, Op_RegFlags, 6, CR6->as_VMReg()); // v
reg_def CR7(SOC, SOC, Op_RegFlags, 7, CR7->as_VMReg()); // v
// Special registers of PPC64
@@ -443,14 +443,14 @@ alloc_class chunk1 (
alloc_class chunk2 (
// Chunk2 contains *all* 8 condition code registers.
CCR0,
CCR1,
CCR2,
CCR3,
CCR4,
CCR5,
CCR6,
CCR7
CR0,
CR1,
CR2,
CR3,
CR4,
CR5,
CR6,
CR7
);
alloc_class chunk3 (
@@ -803,30 +803,30 @@ reg_class bits64_reg_ro(
// Special Class for Condition Code Flags Register
reg_class int_flags(
/*CCR0*/ // scratch
/*CCR1*/ // scratch
/*CCR2*/ // nv!
/*CCR3*/ // nv!
/*CCR4*/ // nv!
CCR5,
CCR6,
CCR7
/*CR0*/ // scratch
/*CR1*/ // scratch
/*CR2*/ // nv!
/*CR3*/ // nv!
/*CR4*/ // nv!
CR5,
CR6,
CR7
);
reg_class int_flags_ro(
CCR0,
CCR1,
CCR2,
CCR3,
CCR4,
CCR5,
CCR6,
CCR7
CR0,
CR1,
CR2,
CR3,
CR4,
CR5,
CR6,
CR7
);
reg_class int_flags_CR0(CCR0);
reg_class int_flags_CR1(CCR1);
reg_class int_flags_CR6(CCR6);
reg_class int_flags_CR0(CR0);
reg_class int_flags_CR1(CR1);
reg_class int_flags_CR6(CR6);
reg_class ctr_reg(SR_CTR);
// ----------------------------
@@ -5568,8 +5568,8 @@ instruct loadF_ac(regF dst, memory mem, flagsRegCR0 cr0) %{
int Idisp = $mem$$disp + frame_slots_bias($mem$$base, ra_);
Label next;
__ lfs($dst$$FloatRegister, Idisp, $mem$$base$$Register);
__ fcmpu(CCR0, $dst$$FloatRegister, $dst$$FloatRegister);
__ bne(CCR0, next);
__ fcmpu(CR0, $dst$$FloatRegister, $dst$$FloatRegister);
__ bne(CR0, next);
__ bind(next);
__ isync();
%}
@@ -5604,8 +5604,8 @@ instruct loadD_ac(regD dst, memory mem, flagsRegCR0 cr0) %{
int Idisp = $mem$$disp + frame_slots_bias($mem$$base, ra_);
Label next;
__ lfd($dst$$FloatRegister, Idisp, $mem$$base$$Register);
__ fcmpu(CCR0, $dst$$FloatRegister, $dst$$FloatRegister);
__ bne(CCR0, next);
__ fcmpu(CR0, $dst$$FloatRegister, $dst$$FloatRegister);
__ bne(CR0, next);
__ bind(next);
__ isync();
%}
@@ -7394,8 +7394,8 @@ instruct compareAndSwapB_regP_regI_regI(iRegIdst res, iRegPdst mem_ptr, iRegIsrc
effect(TEMP_DEF res, TEMP cr0); // TEMP_DEF to avoid jump
format %{ "CMPXCHGB $res, $mem_ptr, $src1, $src2; as bool" %}
ins_encode %{
// CmpxchgX sets CCR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgb(CCR0, R0, $src1$$Register, $src2$$Register, $mem_ptr$$Register, noreg, noreg,
// CmpxchgX sets CR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgb(CR0, R0, $src1$$Register, $src2$$Register, $mem_ptr$$Register, noreg, noreg,
MacroAssembler::MemBarNone, MacroAssembler::cmpxchgx_hint_atomic_update(),
$res$$Register, nullptr, true);
if (support_IRIW_for_not_multiple_copy_atomic_cpu) {
@@ -7413,8 +7413,8 @@ instruct compareAndSwapB4_regP_regI_regI(iRegIdst res, rarg3RegP mem_ptr, iRegIs
effect(TEMP_DEF res, USE_KILL src2, USE_KILL mem_ptr, TEMP tmp1, TEMP tmp2, TEMP cr0); // TEMP_DEF to avoid jump
format %{ "CMPXCHGB $res, $mem_ptr, $src1, $src2; as bool" %}
ins_encode %{
// CmpxchgX sets CCR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgb(CCR0, R0, $src1$$Register, $src2$$Register, $mem_ptr$$Register, $tmp1$$Register, $tmp2$$Register,
// CmpxchgX sets CR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgb(CR0, R0, $src1$$Register, $src2$$Register, $mem_ptr$$Register, $tmp1$$Register, $tmp2$$Register,
MacroAssembler::MemBarNone, MacroAssembler::cmpxchgx_hint_atomic_update(),
$res$$Register, nullptr, true);
if (support_IRIW_for_not_multiple_copy_atomic_cpu) {
@@ -7432,8 +7432,8 @@ instruct compareAndSwapS_regP_regI_regI(iRegIdst res, iRegPdst mem_ptr, iRegIsrc
effect(TEMP_DEF res, TEMP cr0); // TEMP_DEF to avoid jump
format %{ "CMPXCHGH $res, $mem_ptr, $src1, $src2; as bool" %}
ins_encode %{
// CmpxchgX sets CCR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgh(CCR0, R0, $src1$$Register, $src2$$Register, $mem_ptr$$Register, noreg, noreg,
// CmpxchgX sets CR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgh(CR0, R0, $src1$$Register, $src2$$Register, $mem_ptr$$Register, noreg, noreg,
MacroAssembler::MemBarNone, MacroAssembler::cmpxchgx_hint_atomic_update(),
$res$$Register, nullptr, true);
if (support_IRIW_for_not_multiple_copy_atomic_cpu) {
@@ -7451,8 +7451,8 @@ instruct compareAndSwapS4_regP_regI_regI(iRegIdst res, rarg3RegP mem_ptr, iRegIs
effect(TEMP_DEF res, USE_KILL src2, USE_KILL mem_ptr, TEMP tmp1, TEMP tmp2, TEMP cr0); // TEMP_DEF to avoid jump
format %{ "CMPXCHGH $res, $mem_ptr, $src1, $src2; as bool" %}
ins_encode %{
// CmpxchgX sets CCR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgh(CCR0, R0, $src1$$Register, $src2$$Register, $mem_ptr$$Register, $tmp1$$Register, $tmp2$$Register,
// CmpxchgX sets CR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgh(CR0, R0, $src1$$Register, $src2$$Register, $mem_ptr$$Register, $tmp1$$Register, $tmp2$$Register,
MacroAssembler::MemBarNone, MacroAssembler::cmpxchgx_hint_atomic_update(),
$res$$Register, nullptr, true);
if (support_IRIW_for_not_multiple_copy_atomic_cpu) {
@@ -7469,8 +7469,8 @@ instruct compareAndSwapI_regP_regI_regI(iRegIdst res, iRegPdst mem_ptr, iRegIsrc
effect(TEMP_DEF res, TEMP cr0); // TEMP_DEF to avoid jump
format %{ "CMPXCHGW $res, $mem_ptr, $src1, $src2; as bool" %}
ins_encode %{
// CmpxchgX sets CCR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgw(CCR0, R0, $src1$$Register, $src2$$Register, $mem_ptr$$Register,
// CmpxchgX sets CR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgw(CR0, R0, $src1$$Register, $src2$$Register, $mem_ptr$$Register,
MacroAssembler::MemBarNone, MacroAssembler::cmpxchgx_hint_atomic_update(),
$res$$Register, nullptr, true);
if (support_IRIW_for_not_multiple_copy_atomic_cpu) {
@@ -7488,8 +7488,8 @@ instruct compareAndSwapN_regP_regN_regN(iRegIdst res, iRegPdst mem_ptr, iRegNsrc
effect(TEMP_DEF res, TEMP cr0); // TEMP_DEF to avoid jump
format %{ "CMPXCHGW $res, $mem_ptr, $src1, $src2; as bool" %}
ins_encode %{
// CmpxchgX sets CCR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgw(CCR0, R0, $src1$$Register, $src2$$Register, $mem_ptr$$Register,
// CmpxchgX sets CR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgw(CR0, R0, $src1$$Register, $src2$$Register, $mem_ptr$$Register,
MacroAssembler::MemBarNone, MacroAssembler::cmpxchgx_hint_atomic_update(),
$res$$Register, nullptr, true);
if (support_IRIW_for_not_multiple_copy_atomic_cpu) {
@@ -7506,8 +7506,8 @@ instruct compareAndSwapL_regP_regL_regL(iRegIdst res, iRegPdst mem_ptr, iRegLsrc
effect(TEMP_DEF res, TEMP cr0); // TEMP_DEF to avoid jump
format %{ "CMPXCHGD $res, $mem_ptr, $src1, $src2; as bool" %}
ins_encode %{
// CmpxchgX sets CCR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgd(CCR0, R0, $src1$$Register, $src2$$Register, $mem_ptr$$Register,
// CmpxchgX sets CR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgd(CR0, R0, $src1$$Register, $src2$$Register, $mem_ptr$$Register,
MacroAssembler::MemBarNone, MacroAssembler::cmpxchgx_hint_atomic_update(),
$res$$Register, nullptr, true);
if (support_IRIW_for_not_multiple_copy_atomic_cpu) {
@@ -7525,8 +7525,8 @@ instruct compareAndSwapP_regP_regP_regP(iRegIdst res, iRegPdst mem_ptr, iRegPsrc
predicate(n->as_LoadStore()->barrier_data() == 0);
format %{ "CMPXCHGD $res, $mem_ptr, $src1, $src2; as bool; ptr" %}
ins_encode %{
// CmpxchgX sets CCR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgd(CCR0, R0, $src1$$Register, $src2$$Register, $mem_ptr$$Register,
// CmpxchgX sets CR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgd(CR0, R0, $src1$$Register, $src2$$Register, $mem_ptr$$Register,
MacroAssembler::MemBarNone, MacroAssembler::cmpxchgx_hint_atomic_update(),
$res$$Register, nullptr, true);
if (support_IRIW_for_not_multiple_copy_atomic_cpu) {
@@ -7546,8 +7546,8 @@ instruct weakCompareAndSwapB_regP_regI_regI(iRegIdst res, iRegPdst mem_ptr, iReg
effect(TEMP_DEF res, TEMP cr0); // TEMP_DEF to avoid jump
format %{ "weak CMPXCHGB $res, $mem_ptr, $src1, $src2; as bool" %}
ins_encode %{
// CmpxchgX sets CCR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgb(CCR0, R0, $src1$$Register, $src2$$Register, $mem_ptr$$Register, noreg, noreg,
// CmpxchgX sets CR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgb(CR0, R0, $src1$$Register, $src2$$Register, $mem_ptr$$Register, noreg, noreg,
MacroAssembler::MemBarNone,
MacroAssembler::cmpxchgx_hint_atomic_update(), $res$$Register, nullptr, true, /*weak*/ true);
%}
@@ -7560,8 +7560,8 @@ instruct weakCompareAndSwapB4_regP_regI_regI(iRegIdst res, rarg3RegP mem_ptr, iR
effect(TEMP_DEF res, USE_KILL src2, USE_KILL mem_ptr, TEMP tmp1, TEMP tmp2, TEMP cr0); // TEMP_DEF to avoid jump
format %{ "weak CMPXCHGB $res, $mem_ptr, $src1, $src2; as bool" %}
ins_encode %{
// CmpxchgX sets CCR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgb(CCR0, R0, $src1$$Register, $src2$$Register, $mem_ptr$$Register, $tmp1$$Register, $tmp2$$Register,
// CmpxchgX sets CR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgb(CR0, R0, $src1$$Register, $src2$$Register, $mem_ptr$$Register, $tmp1$$Register, $tmp2$$Register,
MacroAssembler::MemBarNone,
MacroAssembler::cmpxchgx_hint_atomic_update(), $res$$Register, nullptr, true, /*weak*/ true);
%}
@@ -7574,8 +7574,8 @@ instruct weakCompareAndSwapB_acq_regP_regI_regI(iRegIdst res, iRegPdst mem_ptr,
effect(TEMP_DEF res, TEMP cr0); // TEMP_DEF to avoid jump
format %{ "weak CMPXCHGB acq $res, $mem_ptr, $src1, $src2; as bool" %}
ins_encode %{
// CmpxchgX sets CCR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgb(CCR0, R0, $src1$$Register, $src2$$Register, $mem_ptr$$Register, noreg, noreg,
// CmpxchgX sets CR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgb(CR0, R0, $src1$$Register, $src2$$Register, $mem_ptr$$Register, noreg, noreg,
support_IRIW_for_not_multiple_copy_atomic_cpu ? MacroAssembler::MemBarAcq : MacroAssembler::MemBarFenceAfter,
MacroAssembler::cmpxchgx_hint_atomic_update(), $res$$Register, nullptr, true, /*weak*/ true);
%}
@@ -7588,8 +7588,8 @@ instruct weakCompareAndSwapB4_acq_regP_regI_regI(iRegIdst res, rarg3RegP mem_ptr
effect(TEMP_DEF res, USE_KILL src2, USE_KILL mem_ptr, TEMP tmp1, TEMP tmp2, TEMP cr0); // TEMP_DEF to avoid jump
format %{ "weak CMPXCHGB acq $res, $mem_ptr, $src1, $src2; as bool" %}
ins_encode %{
// CmpxchgX sets CCR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgb(CCR0, R0, $src1$$Register, $src2$$Register, $mem_ptr$$Register, $tmp1$$Register, $tmp2$$Register,
// CmpxchgX sets CR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgb(CR0, R0, $src1$$Register, $src2$$Register, $mem_ptr$$Register, $tmp1$$Register, $tmp2$$Register,
support_IRIW_for_not_multiple_copy_atomic_cpu ? MacroAssembler::MemBarAcq : MacroAssembler::MemBarFenceAfter,
MacroAssembler::cmpxchgx_hint_atomic_update(), $res$$Register, nullptr, true, /*weak*/ true);
%}
@@ -7602,8 +7602,8 @@ instruct weakCompareAndSwapS_regP_regI_regI(iRegIdst res, iRegPdst mem_ptr, iReg
effect(TEMP_DEF res, TEMP cr0); // TEMP_DEF to avoid jump
format %{ "weak CMPXCHGH $res, $mem_ptr, $src1, $src2; as bool" %}
ins_encode %{
// CmpxchgX sets CCR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgh(CCR0, R0, $src1$$Register, $src2$$Register, $mem_ptr$$Register, noreg, noreg,
// CmpxchgX sets CR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgh(CR0, R0, $src1$$Register, $src2$$Register, $mem_ptr$$Register, noreg, noreg,
MacroAssembler::MemBarNone,
MacroAssembler::cmpxchgx_hint_atomic_update(), $res$$Register, nullptr, true, /*weak*/ true);
%}
@@ -7616,8 +7616,8 @@ instruct weakCompareAndSwapS4_regP_regI_regI(iRegIdst res, rarg3RegP mem_ptr, iR
effect(TEMP_DEF res, USE_KILL src2, USE_KILL mem_ptr, TEMP tmp1, TEMP tmp2, TEMP cr0); // TEMP_DEF to avoid jump
format %{ "weak CMPXCHGH $res, $mem_ptr, $src1, $src2; as bool" %}
ins_encode %{
// CmpxchgX sets CCR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgh(CCR0, R0, $src1$$Register, $src2$$Register, $mem_ptr$$Register, $tmp1$$Register, $tmp2$$Register,
// CmpxchgX sets CR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgh(CR0, R0, $src1$$Register, $src2$$Register, $mem_ptr$$Register, $tmp1$$Register, $tmp2$$Register,
MacroAssembler::MemBarNone,
MacroAssembler::cmpxchgx_hint_atomic_update(), $res$$Register, nullptr, true, /*weak*/ true);
%}
@@ -7630,8 +7630,8 @@ instruct weakCompareAndSwapS_acq_regP_regI_regI(iRegIdst res, iRegPdst mem_ptr,
effect(TEMP_DEF res, TEMP cr0); // TEMP_DEF to avoid jump
format %{ "weak CMPXCHGH acq $res, $mem_ptr, $src1, $src2; as bool" %}
ins_encode %{
// CmpxchgX sets CCR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgh(CCR0, R0, $src1$$Register, $src2$$Register, $mem_ptr$$Register, noreg, noreg,
// CmpxchgX sets CR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgh(CR0, R0, $src1$$Register, $src2$$Register, $mem_ptr$$Register, noreg, noreg,
support_IRIW_for_not_multiple_copy_atomic_cpu ? MacroAssembler::MemBarAcq : MacroAssembler::MemBarFenceAfter,
MacroAssembler::cmpxchgx_hint_atomic_update(), $res$$Register, nullptr, true, /*weak*/ true);
%}
@@ -7644,8 +7644,8 @@ instruct weakCompareAndSwapS4_acq_regP_regI_regI(iRegIdst res, rarg3RegP mem_ptr
effect(TEMP_DEF res, USE_KILL src2, USE_KILL mem_ptr, TEMP tmp1, TEMP tmp2, TEMP cr0); // TEMP_DEF to avoid jump
format %{ "weak CMPXCHGH acq $res, $mem_ptr, $src1, $src2; as bool" %}
ins_encode %{
// CmpxchgX sets CCR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgh(CCR0, R0, $src1$$Register, $src2$$Register, $mem_ptr$$Register, $tmp1$$Register, $tmp2$$Register,
// CmpxchgX sets CR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgh(CR0, R0, $src1$$Register, $src2$$Register, $mem_ptr$$Register, $tmp1$$Register, $tmp2$$Register,
support_IRIW_for_not_multiple_copy_atomic_cpu ? MacroAssembler::MemBarAcq : MacroAssembler::MemBarFenceAfter,
MacroAssembler::cmpxchgx_hint_atomic_update(), $res$$Register, nullptr, true, /*weak*/ true);
%}
@@ -7658,8 +7658,8 @@ instruct weakCompareAndSwapI_regP_regI_regI(iRegIdst res, iRegPdst mem_ptr, iReg
effect(TEMP_DEF res, TEMP cr0); // TEMP_DEF to avoid jump
format %{ "weak CMPXCHGW $res, $mem_ptr, $src1, $src2; as bool" %}
ins_encode %{
// CmpxchgX sets CCR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgw(CCR0, R0, $src1$$Register, $src2$$Register, $mem_ptr$$Register,
// CmpxchgX sets CR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgw(CR0, R0, $src1$$Register, $src2$$Register, $mem_ptr$$Register,
MacroAssembler::MemBarNone,
MacroAssembler::cmpxchgx_hint_atomic_update(), $res$$Register, nullptr, true, /*weak*/ true);
%}
@@ -7672,10 +7672,10 @@ instruct weakCompareAndSwapI_acq_regP_regI_regI(iRegIdst res, iRegPdst mem_ptr,
effect(TEMP_DEF res, TEMP cr0); // TEMP_DEF to avoid jump
format %{ "weak CMPXCHGW acq $res, $mem_ptr, $src1, $src2; as bool" %}
ins_encode %{
// CmpxchgX sets CCR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
// CmpxchgX sets CR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
// Acquire only needed in successful case. Weak node is allowed to report unsuccessful in additional rare cases and
// value is never passed to caller.
__ cmpxchgw(CCR0, R0, $src1$$Register, $src2$$Register, $mem_ptr$$Register,
__ cmpxchgw(CR0, R0, $src1$$Register, $src2$$Register, $mem_ptr$$Register,
support_IRIW_for_not_multiple_copy_atomic_cpu ? MacroAssembler::MemBarAcq : MacroAssembler::MemBarFenceAfter,
MacroAssembler::cmpxchgx_hint_atomic_update(), $res$$Register, nullptr, true, /*weak*/ true);
%}
@@ -7688,8 +7688,8 @@ instruct weakCompareAndSwapN_regP_regN_regN(iRegIdst res, iRegPdst mem_ptr, iReg
effect(TEMP_DEF res, TEMP cr0); // TEMP_DEF to avoid jump
format %{ "weak CMPXCHGW $res, $mem_ptr, $src1, $src2; as bool" %}
ins_encode %{
// CmpxchgX sets CCR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgw(CCR0, R0, $src1$$Register, $src2$$Register, $mem_ptr$$Register,
// CmpxchgX sets CR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgw(CR0, R0, $src1$$Register, $src2$$Register, $mem_ptr$$Register,
MacroAssembler::MemBarNone,
MacroAssembler::cmpxchgx_hint_atomic_update(), $res$$Register, nullptr, true, /*weak*/ true);
%}
@@ -7702,10 +7702,10 @@ instruct weakCompareAndSwapN_acq_regP_regN_regN(iRegIdst res, iRegPdst mem_ptr,
effect(TEMP_DEF res, TEMP cr0); // TEMP_DEF to avoid jump
format %{ "weak CMPXCHGW acq $res, $mem_ptr, $src1, $src2; as bool" %}
ins_encode %{
// CmpxchgX sets CCR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
// CmpxchgX sets CR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
// Acquire only needed in successful case. Weak node is allowed to report unsuccessful in additional rare cases and
// value is never passed to caller.
__ cmpxchgw(CCR0, R0, $src1$$Register, $src2$$Register, $mem_ptr$$Register,
__ cmpxchgw(CR0, R0, $src1$$Register, $src2$$Register, $mem_ptr$$Register,
support_IRIW_for_not_multiple_copy_atomic_cpu ? MacroAssembler::MemBarAcq : MacroAssembler::MemBarFenceAfter,
MacroAssembler::cmpxchgx_hint_atomic_update(), $res$$Register, nullptr, true, /*weak*/ true);
%}
@@ -7718,9 +7718,9 @@ instruct weakCompareAndSwapL_regP_regL_regL(iRegIdst res, iRegPdst mem_ptr, iReg
effect(TEMP_DEF res, TEMP cr0); // TEMP_DEF to avoid jump
format %{ "weak CMPXCHGD $res, $mem_ptr, $src1, $src2; as bool" %}
ins_encode %{
// CmpxchgX sets CCR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
// CmpxchgX sets CR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
// value is never passed to caller.
__ cmpxchgd(CCR0, R0, $src1$$Register, $src2$$Register, $mem_ptr$$Register,
__ cmpxchgd(CR0, R0, $src1$$Register, $src2$$Register, $mem_ptr$$Register,
MacroAssembler::MemBarNone,
MacroAssembler::cmpxchgx_hint_atomic_update(), $res$$Register, nullptr, true, /*weak*/ true);
%}
@@ -7733,10 +7733,10 @@ instruct weakCompareAndSwapL_acq_regP_regL_regL(iRegIdst res, iRegPdst mem_ptr,
effect(TEMP_DEF res, TEMP cr0); // TEMP_DEF to avoid jump
format %{ "weak CMPXCHGD acq $res, $mem_ptr, $src1, $src2; as bool" %}
ins_encode %{
// CmpxchgX sets CCR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
// CmpxchgX sets CR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
// Acquire only needed in successful case. Weak node is allowed to report unsuccessful in additional rare cases and
// value is never passed to caller.
__ cmpxchgd(CCR0, R0, $src1$$Register, $src2$$Register, $mem_ptr$$Register,
__ cmpxchgd(CR0, R0, $src1$$Register, $src2$$Register, $mem_ptr$$Register,
support_IRIW_for_not_multiple_copy_atomic_cpu ? MacroAssembler::MemBarAcq : MacroAssembler::MemBarFenceAfter,
MacroAssembler::cmpxchgx_hint_atomic_update(), $res$$Register, nullptr, true, /*weak*/ true);
%}
@@ -7749,8 +7749,8 @@ instruct weakCompareAndSwapP_regP_regP_regP(iRegIdst res, iRegPdst mem_ptr, iReg
effect(TEMP_DEF res, TEMP cr0); // TEMP_DEF to avoid jump
format %{ "weak CMPXCHGD $res, $mem_ptr, $src1, $src2; as bool; ptr" %}
ins_encode %{
// CmpxchgX sets CCR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgd(CCR0, R0, $src1$$Register, $src2$$Register, $mem_ptr$$Register,
// CmpxchgX sets CR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgd(CR0, R0, $src1$$Register, $src2$$Register, $mem_ptr$$Register,
MacroAssembler::MemBarNone,
MacroAssembler::cmpxchgx_hint_atomic_update(), $res$$Register, nullptr, true, /*weak*/ true);
%}
@@ -7763,10 +7763,10 @@ instruct weakCompareAndSwapP_acq_regP_regP_regP(iRegIdst res, iRegPdst mem_ptr,
effect(TEMP_DEF res, TEMP cr0); // TEMP_DEF to avoid jump
format %{ "weak CMPXCHGD acq $res, $mem_ptr, $src1, $src2; as bool; ptr" %}
ins_encode %{
// CmpxchgX sets CCR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
// CmpxchgX sets CR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
// Acquire only needed in successful case. Weak node is allowed to report unsuccessful in additional rare cases and
// value is never passed to caller.
__ cmpxchgd(CCR0, R0, $src1$$Register, $src2$$Register, $mem_ptr$$Register,
__ cmpxchgd(CR0, R0, $src1$$Register, $src2$$Register, $mem_ptr$$Register,
support_IRIW_for_not_multiple_copy_atomic_cpu ? MacroAssembler::MemBarAcq : MacroAssembler::MemBarFenceAfter,
MacroAssembler::cmpxchgx_hint_atomic_update(), $res$$Register, nullptr, true, /*weak*/ true);
%}
@@ -7781,8 +7781,8 @@ instruct compareAndExchangeB_regP_regI_regI(iRegIdst res, iRegPdst mem_ptr, iReg
effect(TEMP_DEF res, TEMP cr0);
format %{ "CMPXCHGB $res, $mem_ptr, $src1, $src2; as int" %}
ins_encode %{
// CmpxchgX sets CCR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgb(CCR0, $res$$Register, $src1$$Register, $src2$$Register, $mem_ptr$$Register, noreg, noreg,
// CmpxchgX sets CR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgb(CR0, $res$$Register, $src1$$Register, $src2$$Register, $mem_ptr$$Register, noreg, noreg,
MacroAssembler::MemBarNone, MacroAssembler::cmpxchgx_hint_atomic_update(),
noreg, nullptr, true);
%}
@@ -7795,8 +7795,8 @@ instruct compareAndExchangeB4_regP_regI_regI(iRegIdst res, rarg3RegP mem_ptr, iR
effect(TEMP_DEF res, USE_KILL src2, USE_KILL mem_ptr, TEMP tmp1, TEMP cr0);
format %{ "CMPXCHGB $res, $mem_ptr, $src1, $src2; as int" %}
ins_encode %{
// CmpxchgX sets CCR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgb(CCR0, $res$$Register, $src1$$Register, $src2$$Register, $mem_ptr$$Register, $tmp1$$Register, R0,
// CmpxchgX sets CR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgb(CR0, $res$$Register, $src1$$Register, $src2$$Register, $mem_ptr$$Register, $tmp1$$Register, R0,
MacroAssembler::MemBarNone, MacroAssembler::cmpxchgx_hint_atomic_update(),
noreg, nullptr, true);
%}
@@ -7809,8 +7809,8 @@ instruct compareAndExchangeB_acq_regP_regI_regI(iRegIdst res, iRegPdst mem_ptr,
effect(TEMP_DEF res, TEMP cr0);
format %{ "CMPXCHGB acq $res, $mem_ptr, $src1, $src2; as int" %}
ins_encode %{
// CmpxchgX sets CCR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgb(CCR0, $res$$Register, $src1$$Register, $src2$$Register, $mem_ptr$$Register, noreg, noreg,
// CmpxchgX sets CR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgb(CR0, $res$$Register, $src1$$Register, $src2$$Register, $mem_ptr$$Register, noreg, noreg,
MacroAssembler::MemBarNone, MacroAssembler::cmpxchgx_hint_atomic_update(),
noreg, nullptr, true);
if (support_IRIW_for_not_multiple_copy_atomic_cpu) {
@@ -7829,8 +7829,8 @@ instruct compareAndExchangeB4_acq_regP_regI_regI(iRegIdst res, rarg3RegP mem_ptr
effect(TEMP_DEF res, USE_KILL src2, USE_KILL mem_ptr, TEMP tmp1, TEMP cr0);
format %{ "CMPXCHGB acq $res, $mem_ptr, $src1, $src2; as int" %}
ins_encode %{
// CmpxchgX sets CCR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgb(CCR0, $res$$Register, $src1$$Register, $src2$$Register, $mem_ptr$$Register, $tmp1$$Register, R0,
// CmpxchgX sets CR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgb(CR0, $res$$Register, $src1$$Register, $src2$$Register, $mem_ptr$$Register, $tmp1$$Register, R0,
MacroAssembler::MemBarNone, MacroAssembler::cmpxchgx_hint_atomic_update(),
noreg, nullptr, true);
if (support_IRIW_for_not_multiple_copy_atomic_cpu) {
@@ -7849,8 +7849,8 @@ instruct compareAndExchangeS_regP_regI_regI(iRegIdst res, iRegPdst mem_ptr, iReg
effect(TEMP_DEF res, TEMP cr0);
format %{ "CMPXCHGH $res, $mem_ptr, $src1, $src2; as int" %}
ins_encode %{
// CmpxchgX sets CCR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgh(CCR0, $res$$Register, $src1$$Register, $src2$$Register, $mem_ptr$$Register, noreg, noreg,
// CmpxchgX sets CR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgh(CR0, $res$$Register, $src1$$Register, $src2$$Register, $mem_ptr$$Register, noreg, noreg,
MacroAssembler::MemBarNone, MacroAssembler::cmpxchgx_hint_atomic_update(),
noreg, nullptr, true);
%}
@@ -7863,8 +7863,8 @@ instruct compareAndExchangeS4_regP_regI_regI(iRegIdst res, rarg3RegP mem_ptr, iR
effect(TEMP_DEF res, USE_KILL src2, USE_KILL mem_ptr, TEMP tmp1, TEMP cr0);
format %{ "CMPXCHGH $res, $mem_ptr, $src1, $src2; as int" %}
ins_encode %{
// CmpxchgX sets CCR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgh(CCR0, $res$$Register, $src1$$Register, $src2$$Register, $mem_ptr$$Register, $tmp1$$Register, R0,
// CmpxchgX sets CR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgh(CR0, $res$$Register, $src1$$Register, $src2$$Register, $mem_ptr$$Register, $tmp1$$Register, R0,
MacroAssembler::MemBarNone, MacroAssembler::cmpxchgx_hint_atomic_update(),
noreg, nullptr, true);
%}
@@ -7877,8 +7877,8 @@ instruct compareAndExchangeS_acq_regP_regI_regI(iRegIdst res, iRegPdst mem_ptr,
effect(TEMP_DEF res, TEMP cr0);
format %{ "CMPXCHGH acq $res, $mem_ptr, $src1, $src2; as int" %}
ins_encode %{
// CmpxchgX sets CCR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgh(CCR0, $res$$Register, $src1$$Register, $src2$$Register, $mem_ptr$$Register, noreg, noreg,
// CmpxchgX sets CR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgh(CR0, $res$$Register, $src1$$Register, $src2$$Register, $mem_ptr$$Register, noreg, noreg,
MacroAssembler::MemBarNone, MacroAssembler::cmpxchgx_hint_atomic_update(),
noreg, nullptr, true);
if (support_IRIW_for_not_multiple_copy_atomic_cpu) {
@@ -7897,8 +7897,8 @@ instruct compareAndExchangeS4_acq_regP_regI_regI(iRegIdst res, rarg3RegP mem_ptr
effect(TEMP_DEF res, USE_KILL src2, USE_KILL mem_ptr, TEMP tmp1, TEMP cr0);
format %{ "CMPXCHGH acq $res, $mem_ptr, $src1, $src2; as int" %}
ins_encode %{
// CmpxchgX sets CCR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgh(CCR0, $res$$Register, $src1$$Register, $src2$$Register, $mem_ptr$$Register, $tmp1$$Register, R0,
// CmpxchgX sets CR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgh(CR0, $res$$Register, $src1$$Register, $src2$$Register, $mem_ptr$$Register, $tmp1$$Register, R0,
MacroAssembler::MemBarNone, MacroAssembler::cmpxchgx_hint_atomic_update(),
noreg, nullptr, true);
if (support_IRIW_for_not_multiple_copy_atomic_cpu) {
@@ -7917,8 +7917,8 @@ instruct compareAndExchangeI_regP_regI_regI(iRegIdst res, iRegPdst mem_ptr, iReg
effect(TEMP_DEF res, TEMP cr0);
format %{ "CMPXCHGW $res, $mem_ptr, $src1, $src2; as int" %}
ins_encode %{
// CmpxchgX sets CCR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgw(CCR0, $res$$Register, $src1$$Register, $src2$$Register, $mem_ptr$$Register,
// CmpxchgX sets CR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgw(CR0, $res$$Register, $src1$$Register, $src2$$Register, $mem_ptr$$Register,
MacroAssembler::MemBarNone, MacroAssembler::cmpxchgx_hint_atomic_update(),
noreg, nullptr, true);
%}
@@ -7931,8 +7931,8 @@ instruct compareAndExchangeI_acq_regP_regI_regI(iRegIdst res, iRegPdst mem_ptr,
effect(TEMP_DEF res, TEMP cr0);
format %{ "CMPXCHGW acq $res, $mem_ptr, $src1, $src2; as int" %}
ins_encode %{
// CmpxchgX sets CCR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgw(CCR0, $res$$Register, $src1$$Register, $src2$$Register, $mem_ptr$$Register,
// CmpxchgX sets CR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgw(CR0, $res$$Register, $src1$$Register, $src2$$Register, $mem_ptr$$Register,
MacroAssembler::MemBarNone, MacroAssembler::cmpxchgx_hint_atomic_update(),
noreg, nullptr, true);
if (support_IRIW_for_not_multiple_copy_atomic_cpu) {
@@ -7951,8 +7951,8 @@ instruct compareAndExchangeN_regP_regN_regN(iRegNdst res, iRegPdst mem_ptr, iReg
effect(TEMP_DEF res, TEMP cr0);
format %{ "CMPXCHGW $res, $mem_ptr, $src1, $src2; as narrow oop" %}
ins_encode %{
// CmpxchgX sets CCR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgw(CCR0, $res$$Register, $src1$$Register, $src2$$Register, $mem_ptr$$Register,
// CmpxchgX sets CR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgw(CR0, $res$$Register, $src1$$Register, $src2$$Register, $mem_ptr$$Register,
MacroAssembler::MemBarNone, MacroAssembler::cmpxchgx_hint_atomic_update(),
noreg, nullptr, true);
%}
@@ -7965,8 +7965,8 @@ instruct compareAndExchangeN_acq_regP_regN_regN(iRegNdst res, iRegPdst mem_ptr,
effect(TEMP_DEF res, TEMP cr0);
format %{ "CMPXCHGW acq $res, $mem_ptr, $src1, $src2; as narrow oop" %}
ins_encode %{
// CmpxchgX sets CCR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgw(CCR0, $res$$Register, $src1$$Register, $src2$$Register, $mem_ptr$$Register,
// CmpxchgX sets CR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgw(CR0, $res$$Register, $src1$$Register, $src2$$Register, $mem_ptr$$Register,
MacroAssembler::MemBarNone, MacroAssembler::cmpxchgx_hint_atomic_update(),
noreg, nullptr, true);
if (support_IRIW_for_not_multiple_copy_atomic_cpu) {
@@ -7985,8 +7985,8 @@ instruct compareAndExchangeL_regP_regL_regL(iRegLdst res, iRegPdst mem_ptr, iReg
effect(TEMP_DEF res, TEMP cr0);
format %{ "CMPXCHGD $res, $mem_ptr, $src1, $src2; as long" %}
ins_encode %{
// CmpxchgX sets CCR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgd(CCR0, $res$$Register, $src1$$Register, $src2$$Register, $mem_ptr$$Register,
// CmpxchgX sets CR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgd(CR0, $res$$Register, $src1$$Register, $src2$$Register, $mem_ptr$$Register,
MacroAssembler::MemBarNone, MacroAssembler::cmpxchgx_hint_atomic_update(),
noreg, nullptr, true);
%}
@@ -7999,8 +7999,8 @@ instruct compareAndExchangeL_acq_regP_regL_regL(iRegLdst res, iRegPdst mem_ptr,
effect(TEMP_DEF res, TEMP cr0);
format %{ "CMPXCHGD acq $res, $mem_ptr, $src1, $src2; as long" %}
ins_encode %{
// CmpxchgX sets CCR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgd(CCR0, $res$$Register, $src1$$Register, $src2$$Register, $mem_ptr$$Register,
// CmpxchgX sets CR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgd(CR0, $res$$Register, $src1$$Register, $src2$$Register, $mem_ptr$$Register,
MacroAssembler::MemBarNone, MacroAssembler::cmpxchgx_hint_atomic_update(),
noreg, nullptr, true);
if (support_IRIW_for_not_multiple_copy_atomic_cpu) {
@@ -8020,8 +8020,8 @@ instruct compareAndExchangeP_regP_regP_regP(iRegPdst res, iRegPdst mem_ptr, iReg
effect(TEMP_DEF res, TEMP cr0);
format %{ "CMPXCHGD $res, $mem_ptr, $src1, $src2; as ptr; ptr" %}
ins_encode %{
// CmpxchgX sets CCR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgd(CCR0, $res$$Register, $src1$$Register, $src2$$Register, $mem_ptr$$Register,
// CmpxchgX sets CR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgd(CR0, $res$$Register, $src1$$Register, $src2$$Register, $mem_ptr$$Register,
MacroAssembler::MemBarNone, MacroAssembler::cmpxchgx_hint_atomic_update(),
noreg, nullptr, true);
%}
@@ -8035,8 +8035,8 @@ instruct compareAndExchangeP_acq_regP_regP_regP(iRegPdst res, iRegPdst mem_ptr,
effect(TEMP_DEF res, TEMP cr0);
format %{ "CMPXCHGD acq $res, $mem_ptr, $src1, $src2; as ptr; ptr" %}
ins_encode %{
// CmpxchgX sets CCR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgd(CCR0, $res$$Register, $src1$$Register, $src2$$Register, $mem_ptr$$Register,
// CmpxchgX sets CR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
__ cmpxchgd(CR0, $res$$Register, $src1$$Register, $src2$$Register, $mem_ptr$$Register,
MacroAssembler::MemBarNone, MacroAssembler::cmpxchgx_hint_atomic_update(),
noreg, nullptr, true);
if (support_IRIW_for_not_multiple_copy_atomic_cpu) {
@@ -11389,7 +11389,7 @@ instruct cmpL3_reg_reg(iRegIdst dst, iRegLsrc src1, iRegLsrc src2, flagsRegCR0 c
format %{ "cmpL3_reg_reg $dst, $src1, $src2" %}
ins_encode %{
__ cmpd(CCR0, $src1$$Register, $src2$$Register);
__ cmpd(CR0, $src1$$Register, $src2$$Register);
__ set_cmp3($dst$$Register);
%}
ins_pipe(pipe_class_default);
@@ -11661,11 +11661,11 @@ instruct cmpF_reg_reg_Ex(flagsReg crx, regF src1, regF src2) %{
//
// block BXX:
// 0: instruct cmpFUnordered_reg_reg (cmpF_reg_reg-0):
// cmpFUrd CCR6, F11, F9
// cmpFUrd CR6, F11, F9
// 4: instruct cmov_bns_less (cmpF_reg_reg-1):
// cmov CCR6
// cmov CR6
// 8: instruct branchConSched:
// B_FARle CCR6, B56 P=0.500000 C=-1.000000
// B_FARle CR6, B56 P=0.500000 C=-1.000000
match(Set crx (CmpF src1 src2));
ins_cost(DEFAULT_COST+BRANCH_COST);
@@ -11724,7 +11724,7 @@ instruct cmpF3_reg_reg(iRegIdst dst, regF src1, regF src2, flagsRegCR0 cr0) %{
format %{ "cmpF3_reg_reg $dst, $src1, $src2" %}
ins_encode %{
__ fcmpu(CCR0, $src1$$FloatRegister, $src2$$FloatRegister);
__ fcmpu(CR0, $src1$$FloatRegister, $src2$$FloatRegister);
__ set_cmpu3($dst$$Register, true); // C2 requires unordered to get treated like less
%}
ins_pipe(pipe_class_default);
@@ -11808,7 +11808,7 @@ instruct cmpD3_reg_reg(iRegIdst dst, regD src1, regD src2, flagsRegCR0 cr0) %{
format %{ "cmpD3_reg_reg $dst, $src1, $src2" %}
ins_encode %{
__ fcmpu(CCR0, $src1$$FloatRegister, $src2$$FloatRegister);
__ fcmpu(CR0, $src1$$FloatRegister, $src2$$FloatRegister);
__ set_cmpu3($dst$$Register, true); // C2 requires unordered to get treated like less
%}
ins_pipe(pipe_class_default);
@@ -12069,6 +12069,7 @@ instruct branchLoopEndFar(cmpOp cmp, flagsRegSrc crx, label labl) %{
instruct partialSubtypeCheck(iRegPdst result, iRegP_N2P subklass, iRegP_N2P superklass,
iRegPdst tmp_klass, iRegPdst tmp_arrayptr) %{
match(Set result (PartialSubtypeCheck subklass superklass));
predicate(!UseSecondarySupersTable);
effect(TEMP_DEF result, TEMP tmp_klass, TEMP tmp_arrayptr);
ins_cost(DEFAULT_COST*10);
@@ -12080,6 +12081,30 @@ instruct partialSubtypeCheck(iRegPdst result, iRegP_N2P subklass, iRegP_N2P supe
ins_pipe(pipe_class_default);
%}
// Two versions of partialSubtypeCheck, both used when we need to
// search for a super class in the secondary supers array. The first
// is used when we don't know _a priori_ the class being searched
// for. The second, far more common, is used when we do know: this is
// used for instanceof, checkcast, and any case where C2 can determine
// it by constant propagation.
instruct partialSubtypeCheckVarSuper(iRegPsrc sub, iRegPsrc super, iRegPdst result,
iRegPdst tempR1, iRegPdst tempR2, iRegPdst tempR3, iRegPdst tempR4,
flagsRegCR0 cr0, regCTR ctr)
%{
match(Set result (PartialSubtypeCheck sub super));
predicate(UseSecondarySupersTable);
effect(KILL cr0, KILL ctr, TEMP_DEF result, TEMP tempR1, TEMP tempR2, TEMP tempR3, TEMP tempR4);
ins_cost(DEFAULT_COST * 10); // slightly larger than the next version
format %{ "partialSubtypeCheck $result, $sub, $super" %}
ins_encode %{
__ lookup_secondary_supers_table_var($sub$$Register, $super$$Register,
$tempR1$$Register, $tempR2$$Register, $tempR3$$Register, $tempR4$$Register,
$result$$Register);
%}
ins_pipe(pipe_class_memory);
%}
instruct partialSubtypeCheckConstSuper(rarg3RegP sub, rarg2RegP super_reg, immP super_con, rarg6RegP result,
rarg1RegP tempR1, rarg5RegP tempR2, rarg4RegP tempR3, rscratch1RegP tempR4,
flagsRegCR0 cr0, regCTR ctr)
@@ -12094,9 +12119,9 @@ instruct partialSubtypeCheckConstSuper(rarg3RegP sub, rarg2RegP super_reg, immP
ins_encode %{
u1 super_klass_slot = ((Klass*)$super_con$$constant)->hash_slot();
if (InlineSecondarySupersTest) {
__ lookup_secondary_supers_table($sub$$Register, $super_reg$$Register,
$tempR1$$Register, $tempR2$$Register, $tempR3$$Register, $tempR4$$Register,
$result$$Register, super_klass_slot);
__ lookup_secondary_supers_table_const($sub$$Register, $super_reg$$Register,
$tempR1$$Register, $tempR2$$Register, $tempR3$$Register, $tempR4$$Register,
$result$$Register, super_klass_slot);
} else {
address stub = StubRoutines::lookup_secondary_supers_table_stub(super_klass_slot);
Register r_stub_addr = $tempR1$$Register;
@@ -12745,7 +12770,7 @@ instruct string_inflate(Universe dummy, rarg1RegP src, rarg2RegP dst, iRegIsrc l
__ string_inflate_16($src$$Register, $dst$$Register, $len$$Register, $tmp1$$Register,
$tmp2$$Register, $tmp3$$Register, $tmp4$$Register, $tmp5$$Register);
__ rldicl_($tmp1$$Register, $len$$Register, 0, 64-3); // Remaining characters.
__ beq(CCR0, Ldone);
__ beq(CR0, Ldone);
__ string_inflate($src$$Register, $dst$$Register, $tmp1$$Register, $tmp2$$Register);
__ bind(Ldone);
%}
@@ -12829,8 +12854,8 @@ instruct minI_reg_reg_isel(iRegIdst dst, iRegIsrc src1, iRegIsrc src2, flagsRegC
ins_cost(DEFAULT_COST*2);
ins_encode %{
__ cmpw(CCR0, $src1$$Register, $src2$$Register);
__ isel($dst$$Register, CCR0, Assembler::less, /*invert*/false, $src1$$Register, $src2$$Register);
__ cmpw(CR0, $src1$$Register, $src2$$Register);
__ isel($dst$$Register, CR0, Assembler::less, /*invert*/false, $src1$$Register, $src2$$Register);
%}
ins_pipe(pipe_class_default);
%}
@@ -12862,8 +12887,8 @@ instruct maxI_reg_reg_isel(iRegIdst dst, iRegIsrc src1, iRegIsrc src2, flagsRegC
ins_cost(DEFAULT_COST*2);
ins_encode %{
__ cmpw(CCR0, $src1$$Register, $src2$$Register);
__ isel($dst$$Register, CCR0, Assembler::greater, /*invert*/false, $src1$$Register, $src2$$Register);
__ cmpw(CR0, $src1$$Register, $src2$$Register);
__ isel($dst$$Register, CR0, Assembler::greater, /*invert*/false, $src1$$Register, $src2$$Register);
%}
ins_pipe(pipe_class_default);
%}

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2023 SAP SE. All rights reserved.
* Copyright (c) 2000, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2025 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -179,14 +179,14 @@ inline constexpr ConditionRegister as_ConditionRegister(int encoding) {
return ConditionRegister(encoding);
}
constexpr ConditionRegister CCR0 = as_ConditionRegister(0);
constexpr ConditionRegister CCR1 = as_ConditionRegister(1);
constexpr ConditionRegister CCR2 = as_ConditionRegister(2);
constexpr ConditionRegister CCR3 = as_ConditionRegister(3);
constexpr ConditionRegister CCR4 = as_ConditionRegister(4);
constexpr ConditionRegister CCR5 = as_ConditionRegister(5);
constexpr ConditionRegister CCR6 = as_ConditionRegister(6);
constexpr ConditionRegister CCR7 = as_ConditionRegister(7);
constexpr ConditionRegister CR0 = as_ConditionRegister(0);
constexpr ConditionRegister CR1 = as_ConditionRegister(1);
constexpr ConditionRegister CR2 = as_ConditionRegister(2);
constexpr ConditionRegister CR3 = as_ConditionRegister(3);
constexpr ConditionRegister CR4 = as_ConditionRegister(4);
constexpr ConditionRegister CR5 = as_ConditionRegister(5);
constexpr ConditionRegister CR6 = as_ConditionRegister(6);
constexpr ConditionRegister CR7 = as_ConditionRegister(7);
class VectorSRegister;

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 1998, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2023 SAP SE. All rights reserved.
* Copyright (c) 2012, 2025 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -101,7 +101,7 @@ void OptoRuntime::generate_exception_blob() {
__ call_c((address) OptoRuntime::handle_exception_C);
address calls_return_pc = __ last_calls_return_pc();
# ifdef ASSERT
__ cmpdi(CCR0, R3_RET, 0);
__ cmpdi(CR0, R3_RET, 0);
__ asm_assert_ne("handle_exception_C must not return null");
# endif

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2024 SAP SE. All rights reserved.
* Copyright (c) 2012, 2025 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -908,9 +908,9 @@ static address gen_c2i_adapter(MacroAssembler *masm,
// Does compiled code exists? If yes, patch the caller's callsite.
__ ld(code, method_(code));
__ cmpdi(CCR0, code, 0);
__ cmpdi(CR0, code, 0);
__ ld(ientry, method_(interpreter_entry)); // preloaded
__ beq(CCR0, call_interpreter);
__ beq(CR0, call_interpreter);
// Patch caller's callsite, method_(code) was not null which means that
@@ -1184,9 +1184,9 @@ AdapterHandlerEntry* SharedRuntime::generate_i2c2i_adapters(MacroAssembler *masm
// Argument is valid and klass is as expected, continue.
__ ld(code, method_(code));
__ cmpdi(CCR0, code, 0);
__ cmpdi(CR0, code, 0);
__ ld(ientry, method_(interpreter_entry)); // preloaded
__ beq_predict_taken(CCR0, call_interpreter);
__ beq_predict_taken(CR0, call_interpreter);
// Branch to ic_miss_stub.
__ b64_patchable((address)SharedRuntime::get_ic_miss_stub(), relocInfo::runtime_call_type);
@@ -1203,7 +1203,7 @@ AdapterHandlerEntry* SharedRuntime::generate_i2c2i_adapters(MacroAssembler *masm
{ // Bypass the barrier for non-static methods
__ lhz(R0, in_bytes(Method::access_flags_offset()), R19_method);
__ andi_(R0, R0, JVM_ACC_STATIC);
__ beq(CCR0, L_skip_barrier); // non-static
__ beq(CR0, L_skip_barrier); // non-static
}
Register klass = R11_scratch1;
@@ -1251,8 +1251,8 @@ static void object_move(MacroAssembler* masm,
__ addi(r_handle, r_caller_sp, reg2offset(src.first()));
__ ld( r_temp_2, reg2offset(src.first()), r_caller_sp);
__ cmpdi(CCR0, r_temp_2, 0);
__ bne(CCR0, skip);
__ cmpdi(CR0, r_temp_2, 0);
__ bne(CR0, skip);
// Use a null handle if oop is null.
__ li(r_handle, 0);
__ bind(skip);
@@ -1281,8 +1281,8 @@ static void object_move(MacroAssembler* masm,
__ std( r_oop, oop_offset, R1_SP);
__ addi(r_handle, R1_SP, oop_offset);
__ cmpdi(CCR0, r_oop, 0);
__ bne(CCR0, skip);
__ cmpdi(CR0, r_oop, 0);
__ bne(CR0, skip);
// Use a null handle if oop is null.
__ li(r_handle, 0);
__ bind(skip);
@@ -1642,7 +1642,7 @@ static void continuation_enter_cleanup(MacroAssembler* masm) {
#ifdef ASSERT
__ block_comment("clean {");
__ ld_ptr(tmp1, JavaThread::cont_entry_offset(), R16_thread);
__ cmpd(CCR0, R1_SP, tmp1);
__ cmpd(CR0, R1_SP, tmp1);
__ asm_assert_eq(FILE_AND_LINE ": incorrect R1_SP");
#endif
@@ -1653,15 +1653,15 @@ static void continuation_enter_cleanup(MacroAssembler* masm) {
// Check if this is a virtual thread continuation
Label L_skip_vthread_code;
__ lwz(R0, in_bytes(ContinuationEntry::flags_offset()), R1_SP);
__ cmpwi(CCR0, R0, 0);
__ beq(CCR0, L_skip_vthread_code);
__ cmpwi(CR0, R0, 0);
__ beq(CR0, L_skip_vthread_code);
// If the held monitor count is > 0 and this vthread is terminating then
// it failed to release a JNI monitor. So we issue the same log message
// that JavaThread::exit does.
__ ld(R0, in_bytes(JavaThread::jni_monitor_count_offset()), R16_thread);
__ cmpdi(CCR0, R0, 0);
__ beq(CCR0, L_skip_vthread_code);
__ cmpdi(CR0, R0, 0);
__ beq(CR0, L_skip_vthread_code);
// Save return value potentially containing the exception oop
Register ex_oop = R15_esp; // nonvolatile register
@@ -1683,8 +1683,8 @@ static void continuation_enter_cleanup(MacroAssembler* masm) {
// Check if this is a virtual thread continuation
Label L_skip_vthread_code;
__ lwz(R0, in_bytes(ContinuationEntry::flags_offset()), R1_SP);
__ cmpwi(CCR0, R0, 0);
__ beq(CCR0, L_skip_vthread_code);
__ cmpwi(CR0, R0, 0);
__ beq(CR0, L_skip_vthread_code);
// See comment just above. If not checking JNI calls the JNI count is only
// needed for assertion checking.
@@ -1749,8 +1749,8 @@ static void gen_continuation_enter(MacroAssembler* masm,
#ifdef ASSERT
Label is_interp_only;
__ lwz(R0, in_bytes(JavaThread::interp_only_mode_offset()), R16_thread);
__ cmpwi(CCR0, R0, 0);
__ bne(CCR0, is_interp_only);
__ cmpwi(CR0, R0, 0);
__ bne(CR0, is_interp_only);
__ stop("enterSpecial interpreter entry called when not in interp_only_mode");
__ bind(is_interp_only);
#endif
@@ -1770,8 +1770,8 @@ static void gen_continuation_enter(MacroAssembler* masm,
fill_continuation_entry(masm, reg_cont_obj, reg_is_virtual);
// If isContinue, call to thaw. Otherwise, call Continuation.enter(Continuation c, boolean isContinue)
__ cmpwi(CCR0, reg_is_cont, 0);
__ bne(CCR0, L_thaw);
__ cmpwi(CR0, reg_is_cont, 0);
__ bne(CR0, L_thaw);
// --- call Continuation.enter(Continuation c, boolean isContinue)
@@ -1818,8 +1818,8 @@ static void gen_continuation_enter(MacroAssembler* masm,
fill_continuation_entry(masm, reg_cont_obj, reg_is_virtual);
// If isContinue, call to thaw. Otherwise, call Continuation.enter(Continuation c, boolean isContinue)
__ cmpwi(CCR0, reg_is_cont, 0);
__ bne(CCR0, L_thaw);
__ cmpwi(CR0, reg_is_cont, 0);
__ bne(CR0, L_thaw);
// --- call Continuation.enter(Continuation c, boolean isContinue)
@@ -1869,7 +1869,7 @@ static void gen_continuation_enter(MacroAssembler* masm,
// Pop frame and return
DEBUG_ONLY(__ ld_ptr(R0, 0, R1_SP));
__ addi(R1_SP, R1_SP, framesize_words*wordSize);
DEBUG_ONLY(__ cmpd(CCR0, R0, R1_SP));
DEBUG_ONLY(__ cmpd(CR0, R0, R1_SP));
__ asm_assert_eq(FILE_AND_LINE ": inconsistent frame size");
__ ld(R0, _abi0(lr), R1_SP); // Return pc
__ mtlr(R0);
@@ -1937,8 +1937,8 @@ static void gen_continuation_yield(MacroAssembler* masm,
Label L_pinned;
__ cmpwi(CCR0, R3_RET, 0);
__ bne(CCR0, L_pinned);
__ cmpwi(CR0, R3_RET, 0);
__ bne(CR0, L_pinned);
// yield succeeded
@@ -1961,8 +1961,8 @@ static void gen_continuation_yield(MacroAssembler* masm,
// handle pending exception thrown by freeze
__ ld(tmp, in_bytes(JavaThread::pending_exception_offset()), R16_thread);
__ cmpdi(CCR0, tmp, 0);
__ beq(CCR0, L_return); // return if no exception is pending
__ cmpdi(CR0, tmp, 0);
__ beq(CR0, L_return); // return if no exception is pending
__ pop_frame();
__ ld(R0, _abi0(lr), R1_SP); // Return pc
__ mtlr(R0);
@@ -2398,12 +2398,12 @@ nmethod *SharedRuntime::generate_native_wrapper(MacroAssembler *masm,
if (LockingMode == LM_LIGHTWEIGHT) {
// fast_lock kills r_temp_1, r_temp_2, r_temp_3.
Register r_temp_3_or_noreg = UseObjectMonitorTable ? r_temp_3 : noreg;
__ compiler_fast_lock_lightweight_object(CCR0, r_oop, r_box, r_temp_1, r_temp_2, r_temp_3_or_noreg);
__ compiler_fast_lock_lightweight_object(CR0, r_oop, r_box, r_temp_1, r_temp_2, r_temp_3_or_noreg);
} else {
// fast_lock kills r_temp_1, r_temp_2, r_temp_3.
__ compiler_fast_lock_object(CCR0, r_oop, r_box, r_temp_1, r_temp_2, r_temp_3);
__ compiler_fast_lock_object(CR0, r_oop, r_box, r_temp_1, r_temp_2, r_temp_3);
}
__ beq(CCR0, locked);
__ beq(CR0, locked);
// None of the above fast optimizations worked so we have to get into the
// slow case of monitor enter. Inline a special case of call_VM that
@@ -2538,8 +2538,8 @@ nmethod *SharedRuntime::generate_native_wrapper(MacroAssembler *masm,
// Not suspended.
// TODO: PPC port assert(4 == Thread::sz_suspend_flags(), "unexpected field size");
__ lwz(suspend_flags, thread_(suspend_flags));
__ cmpwi(CCR1, suspend_flags, 0);
__ beq(CCR1, no_block);
__ cmpwi(CR1, suspend_flags, 0);
__ beq(CR1, no_block);
// Block. Save any potential method result value before the operation and
// use a leaf call to leave the last_Java_frame setup undisturbed. Doing this
@@ -2572,8 +2572,8 @@ nmethod *SharedRuntime::generate_native_wrapper(MacroAssembler *masm,
if (LockingMode != LM_LEGACY && method->is_object_wait0()) {
Label not_preempted;
__ ld(R0, in_bytes(JavaThread::preempt_alternate_return_offset()), R16_thread);
__ cmpdi(CCR0, R0, 0);
__ beq(CCR0, not_preempted);
__ cmpdi(CR0, R0, 0);
__ beq(CR0, not_preempted);
__ mtlr(R0);
__ li(R0, 0);
__ std(R0, in_bytes(JavaThread::preempt_alternate_return_offset()), R16_thread);
@@ -2591,8 +2591,8 @@ nmethod *SharedRuntime::generate_native_wrapper(MacroAssembler *masm,
Label no_reguard;
__ lwz(r_temp_1, thread_(stack_guard_state));
__ cmpwi(CCR0, r_temp_1, StackOverflow::stack_guard_yellow_reserved_disabled);
__ bne(CCR0, no_reguard);
__ cmpwi(CR0, r_temp_1, StackOverflow::stack_guard_yellow_reserved_disabled);
__ bne(CR0, no_reguard);
save_native_result(masm, ret_type, workspace_slot_offset);
__ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::reguard_yellow_pages));
@@ -2622,11 +2622,11 @@ nmethod *SharedRuntime::generate_native_wrapper(MacroAssembler *masm,
// Try fastpath for unlocking.
if (LockingMode == LM_LIGHTWEIGHT) {
__ compiler_fast_unlock_lightweight_object(CCR0, r_oop, r_box, r_temp_1, r_temp_2, r_temp_3);
__ compiler_fast_unlock_lightweight_object(CR0, r_oop, r_box, r_temp_1, r_temp_2, r_temp_3);
} else {
__ compiler_fast_unlock_object(CCR0, r_oop, r_box, r_temp_1, r_temp_2, r_temp_3);
__ compiler_fast_unlock_object(CR0, r_oop, r_box, r_temp_1, r_temp_2, r_temp_3);
}
__ beq(CCR0, done);
__ beq(CR0, done);
// Save and restore any potential method result value around the unlocking operation.
save_native_result(masm, ret_type, workspace_slot_offset);
@@ -2693,8 +2693,8 @@ nmethod *SharedRuntime::generate_native_wrapper(MacroAssembler *masm,
// Check for pending exceptions.
// --------------------------------------------------------------------------
__ ld(r_temp_2, thread_(pending_exception));
__ cmpdi(CCR0, r_temp_2, 0);
__ bne(CCR0, handle_pending_exception);
__ cmpdi(CR0, r_temp_2, 0);
__ bne(CR0, handle_pending_exception);
// Return
// --------------------------------------------------------------------------
@@ -2851,7 +2851,7 @@ static void push_skeleton_frames(MacroAssembler* masm, bool deopt,
#ifdef ASSERT
// Make sure that there is at least one entry in the array.
__ cmpdi(CCR0, number_of_frames_reg, 0);
__ cmpdi(CR0, number_of_frames_reg, 0);
__ asm_assert_ne("array_size must be > 0");
#endif
@@ -2866,8 +2866,8 @@ static void push_skeleton_frames(MacroAssembler* masm, bool deopt,
pcs_reg,
frame_size_reg,
pc_reg);
__ cmpdi(CCR0, number_of_frames_reg, 0);
__ bne(CCR0, loop);
__ cmpdi(CR0, number_of_frames_reg, 0);
__ bne(CR0, loop);
// Get the return address pointing into the frame manager.
__ ld(R0, 0, pcs_reg);
@@ -3014,8 +3014,8 @@ void SharedRuntime::generate_deopt_blob() {
// stored in the thread during exception entry above. The exception
// oop will be the return value of this stub.
Label skip_restore_excp;
__ cmpdi(CCR0, exec_mode_reg, Deoptimization::Unpack_exception);
__ bne(CCR0, skip_restore_excp);
__ cmpdi(CR0, exec_mode_reg, Deoptimization::Unpack_exception);
__ bne(CR0, skip_restore_excp);
__ ld(R3_RET, in_bytes(JavaThread::exception_oop_offset()), R16_thread);
__ ld(R4_ARG2, in_bytes(JavaThread::exception_pc_offset()), R16_thread);
__ li(R0, 0);
@@ -3165,7 +3165,7 @@ void OptoRuntime::generate_uncommon_trap_blob() {
#ifdef ASSERT
__ lwz(R22_tmp2, in_bytes(Deoptimization::UnrollBlock::unpack_kind_offset()), unroll_block_reg);
__ cmpdi(CCR0, R22_tmp2, (unsigned)Deoptimization::Unpack_uncommon_trap);
__ cmpdi(CR0, R22_tmp2, (unsigned)Deoptimization::Unpack_uncommon_trap);
__ asm_assert_eq("OptoRuntime::generate_uncommon_trap_blob: expected Unpack_uncommon_trap");
#endif
@@ -3295,8 +3295,8 @@ SafepointBlob* SharedRuntime::generate_handler_blob(SharedStubId id, address cal
BLOCK_COMMENT(" Check pending exception.");
const Register pending_exception = R0;
__ ld(pending_exception, thread_(pending_exception));
__ cmpdi(CCR0, pending_exception, 0);
__ beq(CCR0, noException);
__ cmpdi(CR0, pending_exception, 0);
__ beq(CR0, noException);
// Exception pending
RegisterSaver::restore_live_registers_and_pop_frame(masm,
@@ -3315,8 +3315,8 @@ SafepointBlob* SharedRuntime::generate_handler_blob(SharedStubId id, address cal
Label no_adjust;
// If our stashed return pc was modified by the runtime we avoid touching it
__ ld(R0, frame_size_in_bytes + _abi0(lr), R1_SP);
__ cmpd(CCR0, R0, R31);
__ bne(CCR0, no_adjust);
__ cmpd(CR0, R0, R31);
__ bne(CR0, no_adjust);
// Adjust return pc forward to step over the safepoint poll instruction
__ addi(R31, R31, 4);
@@ -3395,8 +3395,8 @@ RuntimeStub* SharedRuntime::generate_resolve_blob(SharedStubId id, address desti
BLOCK_COMMENT("Check for pending exceptions.");
Label pending;
__ ld(R11_scratch1, thread_(pending_exception));
__ cmpdi(CCR0, R11_scratch1, 0);
__ bne(CCR0, pending);
__ cmpdi(CR0, R11_scratch1, 0);
__ bne(CR0, pending);
__ mtctr(R3_RET); // Ctr will not be touched by restore_live_registers_and_pop_frame.
@@ -3499,8 +3499,8 @@ RuntimeStub* SharedRuntime::generate_throw_exception(SharedStubId id, address ru
__ ld(R0,
in_bytes(Thread::pending_exception_offset()),
R16_thread);
__ cmpdi(CCR0, R0, 0);
__ bne(CCR0, L);
__ cmpdi(CR0, R0, 0);
__ bne(CR0, L);
__ stop("SharedRuntime::throw_exception: no pending exception");
__ bind(L);
}

View File

@@ -0,0 +1,57 @@
/*
* Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2025, Red Hat, Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#ifndef CPU_PPC_STUBDECLARATIONS_HPP
#define CPU_PPC_STUBDECLARATIONS_HPP
#define STUBGEN_INITIAL_BLOBS_ARCH_DO(do_stub, \
do_arch_blob, \
do_arch_entry, \
do_arch_entry_init) \
do_arch_blob(initial, 20000) \
#define STUBGEN_CONTINUATION_BLOBS_ARCH_DO(do_stub, \
do_arch_blob, \
do_arch_entry, \
do_arch_entry_init) \
do_arch_blob(continuation, 2000) \
#define STUBGEN_COMPILER_BLOBS_ARCH_DO(do_stub, \
do_arch_blob, \
do_arch_entry, \
do_arch_entry_init) \
do_arch_blob(compiler, 24000) \
#define STUBGEN_FINAL_BLOBS_ARCH_DO(do_stub, \
do_arch_blob, \
do_arch_entry, \
do_arch_entry_init) \
do_arch_blob(final, 24000) \
#endif // CPU_PPC_STUBDECLARATIONS_HPP

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2019 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -32,14 +32,17 @@
static bool returns_to_call_stub(address return_pc) { return return_pc == _call_stub_return_address; }
// emit enum used to size per-blob code buffers
#define DEFINE_BLOB_SIZE(blob_name, size) \
_ ## blob_name ## _code_size = size,
enum platform_dependent_constants {
// simply increase sizes if too small (assembler will crash if too small)
_initial_stubs_code_size = 20000,
_continuation_stubs_code_size = 2000,
_compiler_stubs_code_size = 24000,
_final_stubs_code_size = 24000
STUBGEN_ARCH_BLOBS_DO(DEFINE_BLOB_SIZE)
};
#undef DEFINE_BLOB_SIZE
// CRC32 Intrinsics.
#define CRC32_TABLE_SIZE (4 * 256)
#define REVERSE_CRC32_POLY 0xEDB88320

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2024 SAP SE. All rights reserved.
* Copyright (c) 2015, 2025 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -147,8 +147,8 @@ address TemplateInterpreterGenerator::generate_slow_signature_handler() {
assert(sizeof(AccessFlags) == 2, "wrong size");
__ lhz(R11_scratch1/*access_flags*/, method_(access_flags));
// testbit with condition register.
__ testbitdi(CCR0, R0, R11_scratch1/*access_flags*/, JVM_ACC_STATIC_BIT);
__ btrue(CCR0, L);
__ testbitdi(CR0, R0, R11_scratch1/*access_flags*/, JVM_ACC_STATIC_BIT);
__ btrue(CR0, L);
// For non-static functions, pass "this" in R4_ARG2 and copy it
// to 2nd C-arg slot.
// We need to box the Java object here, so we use arg_java
@@ -175,8 +175,8 @@ address TemplateInterpreterGenerator::generate_slow_signature_handler() {
// signature points to '(' at entry
#ifdef ASSERT
__ lbz(sig_byte, 0, signature);
__ cmplwi(CCR0, sig_byte, '(');
__ bne(CCR0, do_dontreachhere);
__ cmplwi(CR0, sig_byte, '(');
__ bne(CR0, do_dontreachhere);
#endif
__ bind(loop_start);
@@ -184,41 +184,41 @@ address TemplateInterpreterGenerator::generate_slow_signature_handler() {
__ addi(argcnt, argcnt, 1);
__ lbzu(sig_byte, 1, signature);
__ cmplwi(CCR0, sig_byte, ')'); // end of signature
__ beq(CCR0, loop_end);
__ cmplwi(CR0, sig_byte, ')'); // end of signature
__ beq(CR0, loop_end);
__ cmplwi(CCR0, sig_byte, 'B'); // byte
__ beq(CCR0, do_int);
__ cmplwi(CR0, sig_byte, 'B'); // byte
__ beq(CR0, do_int);
__ cmplwi(CCR0, sig_byte, 'C'); // char
__ beq(CCR0, do_int);
__ cmplwi(CR0, sig_byte, 'C'); // char
__ beq(CR0, do_int);
__ cmplwi(CCR0, sig_byte, 'D'); // double
__ beq(CCR0, do_double);
__ cmplwi(CR0, sig_byte, 'D'); // double
__ beq(CR0, do_double);
__ cmplwi(CCR0, sig_byte, 'F'); // float
__ beq(CCR0, do_float);
__ cmplwi(CR0, sig_byte, 'F'); // float
__ beq(CR0, do_float);
__ cmplwi(CCR0, sig_byte, 'I'); // int
__ beq(CCR0, do_int);
__ cmplwi(CR0, sig_byte, 'I'); // int
__ beq(CR0, do_int);
__ cmplwi(CCR0, sig_byte, 'J'); // long
__ beq(CCR0, do_long);
__ cmplwi(CR0, sig_byte, 'J'); // long
__ beq(CR0, do_long);
__ cmplwi(CCR0, sig_byte, 'S'); // short
__ beq(CCR0, do_int);
__ cmplwi(CR0, sig_byte, 'S'); // short
__ beq(CR0, do_int);
__ cmplwi(CCR0, sig_byte, 'Z'); // boolean
__ beq(CCR0, do_int);
__ cmplwi(CR0, sig_byte, 'Z'); // boolean
__ beq(CR0, do_int);
__ cmplwi(CCR0, sig_byte, 'L'); // object
__ beq(CCR0, do_object);
__ cmplwi(CR0, sig_byte, 'L'); // object
__ beq(CR0, do_object);
__ cmplwi(CCR0, sig_byte, '['); // array
__ beq(CCR0, do_array);
__ cmplwi(CR0, sig_byte, '['); // array
__ beq(CR0, do_array);
// __ cmplwi(CCR0, sig_byte, 'V'); // void cannot appear since we do not parse the return type
// __ beq(CCR0, do_void);
// __ cmplwi(CR0, sig_byte, 'V'); // void cannot appear since we do not parse the return type
// __ beq(CR0, do_void);
__ bind(do_dontreachhere);
@@ -231,16 +231,16 @@ address TemplateInterpreterGenerator::generate_slow_signature_handler() {
__ bind(start_skip);
__ lbzu(sig_byte, 1, signature);
__ cmplwi(CCR0, sig_byte, '[');
__ beq(CCR0, start_skip); // skip further brackets
__ cmplwi(CCR0, sig_byte, '9');
__ bgt(CCR0, end_skip); // no optional size
__ cmplwi(CCR0, sig_byte, '0');
__ bge(CCR0, start_skip); // skip optional size
__ cmplwi(CR0, sig_byte, '[');
__ beq(CR0, start_skip); // skip further brackets
__ cmplwi(CR0, sig_byte, '9');
__ bgt(CR0, end_skip); // no optional size
__ cmplwi(CR0, sig_byte, '0');
__ bge(CR0, start_skip); // skip optional size
__ bind(end_skip);
__ cmplwi(CCR0, sig_byte, 'L');
__ beq(CCR0, do_object); // for arrays of objects, the name of the object must be skipped
__ cmplwi(CR0, sig_byte, 'L');
__ beq(CR0, do_object); // for arrays of objects, the name of the object must be skipped
__ b(do_boxed); // otherwise, go directly to do_boxed
}
@@ -249,8 +249,8 @@ address TemplateInterpreterGenerator::generate_slow_signature_handler() {
Label L;
__ bind(L);
__ lbzu(sig_byte, 1, signature);
__ cmplwi(CCR0, sig_byte, ';');
__ bne(CCR0, L);
__ cmplwi(CR0, sig_byte, ';');
__ bne(CR0, L);
}
// Need to box the Java object here, so we use arg_java (address of
// current Java stack slot) as argument and don't dereference it as
@@ -258,16 +258,16 @@ address TemplateInterpreterGenerator::generate_slow_signature_handler() {
Label do_null;
__ bind(do_boxed);
__ ld(R0,0, arg_java);
__ cmpdi(CCR0, R0, 0);
__ cmpdi(CR0, R0, 0);
__ li(intSlot,0);
__ beq(CCR0, do_null);
__ beq(CR0, do_null);
__ mr(intSlot, arg_java);
__ bind(do_null);
__ std(intSlot, 0, arg_c);
__ addi(arg_java, arg_java, -BytesPerWord);
__ addi(arg_c, arg_c, BytesPerWord);
__ cmplwi(CCR0, argcnt, max_int_register_arguments);
__ blt(CCR0, move_intSlot_to_ARG);
__ cmplwi(CR0, argcnt, max_int_register_arguments);
__ blt(CR0, move_intSlot_to_ARG);
__ b(loop_start);
__ bind(do_int);
@@ -275,8 +275,8 @@ address TemplateInterpreterGenerator::generate_slow_signature_handler() {
__ std(intSlot, 0, arg_c);
__ addi(arg_java, arg_java, -BytesPerWord);
__ addi(arg_c, arg_c, BytesPerWord);
__ cmplwi(CCR0, argcnt, max_int_register_arguments);
__ blt(CCR0, move_intSlot_to_ARG);
__ cmplwi(CR0, argcnt, max_int_register_arguments);
__ blt(CR0, move_intSlot_to_ARG);
__ b(loop_start);
__ bind(do_long);
@@ -284,8 +284,8 @@ address TemplateInterpreterGenerator::generate_slow_signature_handler() {
__ std(intSlot, 0, arg_c);
__ addi(arg_java, arg_java, - 2 * BytesPerWord);
__ addi(arg_c, arg_c, BytesPerWord);
__ cmplwi(CCR0, argcnt, max_int_register_arguments);
__ blt(CCR0, move_intSlot_to_ARG);
__ cmplwi(CR0, argcnt, max_int_register_arguments);
__ blt(CR0, move_intSlot_to_ARG);
__ b(loop_start);
__ bind(do_float);
@@ -293,8 +293,8 @@ address TemplateInterpreterGenerator::generate_slow_signature_handler() {
__ stfs(floatSlot, Argument::float_on_stack_offset_in_bytes_c, arg_c);
__ addi(arg_java, arg_java, -BytesPerWord);
__ addi(arg_c, arg_c, BytesPerWord);
__ cmplwi(CCR0, fpcnt, max_fp_register_arguments);
__ blt(CCR0, move_floatSlot_to_FARG);
__ cmplwi(CR0, fpcnt, max_fp_register_arguments);
__ blt(CR0, move_floatSlot_to_FARG);
__ b(loop_start);
__ bind(do_double);
@@ -302,8 +302,8 @@ address TemplateInterpreterGenerator::generate_slow_signature_handler() {
__ stfd(floatSlot, 0, arg_c);
__ addi(arg_java, arg_java, - 2 * BytesPerWord);
__ addi(arg_c, arg_c, BytesPerWord);
__ cmplwi(CCR0, fpcnt, max_fp_register_arguments);
__ blt(CCR0, move_floatSlot_to_FARG);
__ cmplwi(CR0, fpcnt, max_fp_register_arguments);
__ blt(CR0, move_floatSlot_to_FARG);
__ b(loop_start);
__ bind(loop_end);
@@ -510,8 +510,8 @@ address TemplateInterpreterGenerator::generate_Reference_get_entry(void) {
__ ld(R3_RET, Interpreter::stackElementSize, R15_esp); // get receiver
// Check if receiver == nullptr and go the slow path.
__ cmpdi(CCR0, R3_RET, 0);
__ beq(CCR0, slow_path);
__ cmpdi(CR0, R3_RET, 0);
__ beq(CR0, slow_path);
__ load_heap_oop(R3_RET, referent_offset, R3_RET,
/* non-volatile temp */ R31, R11_scratch1,
@@ -725,8 +725,8 @@ void TemplateInterpreterGenerator::generate_counter_incr(Label* overflow) {
if (ProfileInterpreter) {
const Register Rmdo = R3_counters;
__ ld(Rmdo, in_bytes(Method::method_data_offset()), R19_method);
__ cmpdi(CCR0, Rmdo, 0);
__ beq(CCR0, no_mdo);
__ cmpdi(CR0, Rmdo, 0);
__ beq(CR0, no_mdo);
// Increment invocation counter in the MDO.
const int mdo_ic_offs = in_bytes(MethodData::invocation_counter_offset()) + in_bytes(InvocationCounter::counter_offset());
@@ -735,7 +735,7 @@ void TemplateInterpreterGenerator::generate_counter_incr(Label* overflow) {
__ addi(Rscratch2, Rscratch2, increment);
__ stw(Rscratch2, mdo_ic_offs, Rmdo);
__ and_(Rscratch1, Rscratch2, Rscratch1);
__ bne(CCR0, done);
__ bne(CR0, done);
__ b(*overflow);
}
@@ -748,7 +748,7 @@ void TemplateInterpreterGenerator::generate_counter_incr(Label* overflow) {
__ addi(Rscratch2, Rscratch2, increment);
__ stw(Rscratch2, mo_ic_offs, R3_counters);
__ and_(Rscratch1, Rscratch2, Rscratch1);
__ beq(CCR0, *overflow);
__ beq(CR0, *overflow);
__ bind(done);
}
@@ -789,8 +789,8 @@ void TemplateInterpreterGenerator::generate_stack_overflow_check(Register Rmem_f
BLOCK_COMMENT("stack_overflow_check_with_compare {");
__ sub(Rmem_frame_size, R1_SP, Rmem_frame_size);
__ ld(Rscratch1, thread_(stack_overflow_limit));
__ cmpld(CCR0/*is_stack_overflow*/, Rmem_frame_size, Rscratch1);
__ bgt(CCR0/*is_stack_overflow*/, done);
__ cmpld(CR0/*is_stack_overflow*/, Rmem_frame_size, Rscratch1);
__ bgt(CR0/*is_stack_overflow*/, done);
// The stack overflows. Load target address of the runtime stub and call it.
assert(SharedRuntime::throw_StackOverflowError_entry() != nullptr, "generated in wrong order");
@@ -799,13 +799,13 @@ void TemplateInterpreterGenerator::generate_stack_overflow_check(Register Rmem_f
// Restore caller_sp (c2i adapter may exist, but no shrinking of interpreted caller frame).
#ifdef ASSERT
Label frame_not_shrunk;
__ cmpld(CCR0, R1_SP, R21_sender_SP);
__ ble(CCR0, frame_not_shrunk);
__ cmpld(CR0, R1_SP, R21_sender_SP);
__ ble(CR0, frame_not_shrunk);
__ stop("frame shrunk");
__ bind(frame_not_shrunk);
__ ld(Rscratch1, 0, R1_SP);
__ ld(R0, 0, R21_sender_SP);
__ cmpd(CCR0, R0, Rscratch1);
__ cmpd(CR0, R0, Rscratch1);
__ asm_assert_eq("backlink");
#endif // ASSERT
__ mr(R1_SP, R21_sender_SP);
@@ -829,8 +829,8 @@ void TemplateInterpreterGenerator::lock_method(Register Rflags, Register Rscratc
// Check if methods needs synchronization.
{
Label Lok;
__ testbitdi(CCR0, R0, Rflags, JVM_ACC_SYNCHRONIZED_BIT);
__ btrue(CCR0,Lok);
__ testbitdi(CR0, R0, Rflags, JVM_ACC_SYNCHRONIZED_BIT);
__ btrue(CR0,Lok);
__ stop("method doesn't need synchronization");
__ bind(Lok);
}
@@ -842,8 +842,8 @@ void TemplateInterpreterGenerator::lock_method(Register Rflags, Register Rscratc
Label Lstatic;
Label Ldone;
__ testbitdi(CCR0, R0, Rflags, JVM_ACC_STATIC_BIT);
__ btrue(CCR0, Lstatic);
__ testbitdi(CR0, R0, Rflags, JVM_ACC_STATIC_BIT);
__ btrue(CR0, Lstatic);
// Non-static case: load receiver obj from stack and we're done.
__ ld(Robj_to_lock, R18_locals);
@@ -950,8 +950,8 @@ void TemplateInterpreterGenerator::generate_fixed_frame(bool native_call, Regist
// environment and one for a possible native mirror.
Label skip_native_calculate_max_stack;
__ addi(Rtop_frame_size, Rsize_of_parameters, 2);
__ cmpwi(CCR0, Rtop_frame_size, Argument::n_int_register_parameters_c);
__ bge(CCR0, skip_native_calculate_max_stack);
__ cmpwi(CR0, Rtop_frame_size, Argument::n_int_register_parameters_c);
__ bge(CR0, skip_native_calculate_max_stack);
__ li(Rtop_frame_size, Argument::n_int_register_parameters_c);
__ bind(skip_native_calculate_max_stack);
__ sldi(Rsize_of_parameters, Rsize_of_parameters, Interpreter::logStackElementSize);
@@ -999,8 +999,8 @@ void TemplateInterpreterGenerator::generate_fixed_frame(bool native_call, Regist
if (ProfileInterpreter) {
Label zero_continue;
__ ld(R28_mdx, method_(method_data));
__ cmpdi(CCR0, R28_mdx, 0);
__ beq(CCR0, zero_continue);
__ cmpdi(CR0, R28_mdx, 0);
__ beq(CR0, zero_continue);
__ addi(R28_mdx, R28_mdx, in_bytes(MethodData::data_offset()));
__ bind(zero_continue);
}
@@ -1330,8 +1330,8 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
__ ld(signature_handler_fd, method_(signature_handler));
Label call_signature_handler;
__ cmpdi(CCR0, signature_handler_fd, 0);
__ bne(CCR0, call_signature_handler);
__ cmpdi(CR0, signature_handler_fd, 0);
__ bne(CR0, call_signature_handler);
// Method has never been called. Either generate a specialized
// handler or point to the slow one.
@@ -1342,8 +1342,8 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
// Check for an exception while looking up the target method. If we
// incurred one, bail.
__ ld(pending_exception, thread_(pending_exception));
__ cmpdi(CCR0, pending_exception, 0);
__ bne(CCR0, exception_return_sync_check); // Has pending exception.
__ cmpdi(CR0, pending_exception, 0);
__ bne(CR0, exception_return_sync_check); // Has pending exception.
// Reload signature handler, it may have been created/assigned in the meanwhile.
__ ld(signature_handler_fd, method_(signature_handler));
@@ -1398,8 +1398,8 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
// Access_flags is non-volatile and still, no need to restore it.
// Restore access flags.
__ testbitdi(CCR0, R0, access_flags, JVM_ACC_STATIC_BIT);
__ bfalse(CCR0, method_is_not_static);
__ testbitdi(CR0, R0, access_flags, JVM_ACC_STATIC_BIT);
__ bfalse(CR0, method_is_not_static);
// Load mirror from interpreter frame (FP in R11_scratch1)
__ ld(R21_tmp1, _ijava_state_neg(mirror), R11_scratch1);
@@ -1508,8 +1508,8 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
// Not suspended.
// TODO PPC port assert(4 == Thread::sz_suspend_flags(), "unexpected field size");
__ lwz(suspend_flags, thread_(suspend_flags));
__ cmpwi(CCR1, suspend_flags, 0);
__ beq(CCR1, sync_check_done);
__ cmpwi(CR1, suspend_flags, 0);
__ beq(CR1, sync_check_done);
__ bind(do_safepoint);
__ isync();
@@ -1552,8 +1552,8 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
// Check preemption for Object.wait()
Label not_preempted;
__ ld(R0, in_bytes(JavaThread::preempt_alternate_return_offset()), R16_thread);
__ cmpdi(CCR0, R0, 0);
__ beq(CCR0, not_preempted);
__ cmpdi(CR0, R0, 0);
__ beq(CR0, not_preempted);
__ mtlr(R0);
__ li(R0, 0);
__ std(R0, in_bytes(JavaThread::preempt_alternate_return_offset()), R16_thread);
@@ -1611,8 +1611,8 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
Label exception_return_sync_check_already_unlocked;
__ ld(R0/*pending_exception*/, thread_(pending_exception));
__ cmpdi(CCR0, R0/*pending_exception*/, 0);
__ bne(CCR0, exception_return_sync_check_already_unlocked);
__ cmpdi(CR0, R0/*pending_exception*/, 0);
__ bne(CR0, exception_return_sync_check_already_unlocked);
//-----------------------------------------------------------------------------
// No exception pending.
@@ -1706,7 +1706,7 @@ address TemplateInterpreterGenerator::generate_normal_entry(bool synchronized) {
__ subf(Rnum, Rsize_of_parameters, Rsize_of_locals);
__ subf(Rslot_addr, Rsize_of_parameters, R18_locals);
__ srdi_(Rnum, Rnum, Interpreter::logStackElementSize);
__ beq(CCR0, Lno_locals);
__ beq(CR0, Lno_locals);
__ li(R0, 0);
__ mtctr(Rnum);
@@ -2080,8 +2080,8 @@ void TemplateInterpreterGenerator::generate_throw_exception() {
__ ld(return_pc, 0, R1_SP);
__ ld(return_pc, _abi0(lr), return_pc);
__ call_VM_leaf(CAST_FROM_FN_PTR(address, InterpreterRuntime::interpreter_contains), return_pc);
__ cmpdi(CCR0, R3_RET, 0);
__ bne(CCR0, Lcaller_not_deoptimized);
__ cmpdi(CR0, R3_RET, 0);
__ bne(CR0, Lcaller_not_deoptimized);
// The deoptimized case.
// In this case, we can't call dispatch_next() after the frame is
@@ -2127,16 +2127,16 @@ void TemplateInterpreterGenerator::generate_throw_exception() {
Label L_done;
__ lbz(R11_scratch1, 0, R14_bcp);
__ cmpwi(CCR0, R11_scratch1, Bytecodes::_invokestatic);
__ bne(CCR0, L_done);
__ cmpwi(CR0, R11_scratch1, Bytecodes::_invokestatic);
__ bne(CR0, L_done);
// The member name argument must be restored if _invokestatic is re-executed after a PopFrame call.
// Detect such a case in the InterpreterRuntime function and return the member name argument, or null.
__ ld(R4_ARG2, 0, R18_locals);
__ call_VM(R4_ARG2, CAST_FROM_FN_PTR(address, InterpreterRuntime::member_name_arg_or_null), R4_ARG2, R19_method, R14_bcp);
__ cmpdi(CCR0, R4_ARG2, 0);
__ beq(CCR0, L_done);
__ cmpdi(CR0, R4_ARG2, 0);
__ beq(CR0, L_done);
__ std(R4_ARG2, wordSize, R15_esp);
__ bind(L_done);
#endif // INCLUDE_JVMTI
@@ -2321,8 +2321,8 @@ address TemplateInterpreterGenerator::generate_trace_code(TosState state) {
int offs2 = __ load_const_optimized(R12_scratch2, (address) &BytecodeCounter::_counter_value, R0, true);
__ ld(R11_scratch1, offs1, R11_scratch1);
__ lwa(R12_scratch2, offs2, R12_scratch2);
__ cmpd(CCR0, R12_scratch2, R11_scratch1);
__ blt(CCR0, Lskip_vm_call);
__ cmpd(CR0, R12_scratch2, R11_scratch1);
__ blt(CR0, Lskip_vm_call);
}
__ push(state);
@@ -2396,8 +2396,8 @@ void TemplateInterpreterGenerator::stop_interpreter_at() {
int offs2 = __ load_const_optimized(R12_scratch2, (address) &BytecodeCounter::_counter_value, R0, true);
__ ld(R11_scratch1, offs1, R11_scratch1);
__ lwa(R12_scratch2, offs2, R12_scratch2);
__ cmpd(CCR0, R12_scratch2, R11_scratch1);
__ bne(CCR0, L);
__ cmpd(CR0, R12_scratch2, R11_scratch1);
__ bne(CR0, L);
__ illtrap();
__ bind(L);
}

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2024 SAP SE. All rights reserved.
* Copyright (c) 2013, 2025 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -123,9 +123,9 @@ void TemplateTable::patch_bytecode(Bytecodes::Code new_bc, Register Rnew_bc, Reg
int code_offset = (byte_no == f1_byte) ? in_bytes(ResolvedFieldEntry::get_code_offset())
: in_bytes(ResolvedFieldEntry::put_code_offset());
__ lbz(Rnew_bc, code_offset, Rtemp);
__ cmpwi(CCR0, Rnew_bc, 0);
__ cmpwi(CR0, Rnew_bc, 0);
__ li(Rnew_bc, (unsigned int)(unsigned char)new_bc);
__ beq(CCR0, L_patch_done);
__ beq(CR0, L_patch_done);
// __ isync(); // acquire not needed
break;
}
@@ -140,8 +140,8 @@ void TemplateTable::patch_bytecode(Bytecodes::Code new_bc, Register Rnew_bc, Reg
if (JvmtiExport::can_post_breakpoint()) {
Label L_fast_patch;
__ lbz(Rtemp, 0, R14_bcp);
__ cmpwi(CCR0, Rtemp, (unsigned int)(unsigned char)Bytecodes::_breakpoint);
__ bne(CCR0, L_fast_patch);
__ cmpwi(CR0, Rtemp, (unsigned int)(unsigned char)Bytecodes::_breakpoint);
__ bne(CR0, L_fast_patch);
// Perform the quickening, slowly, in the bowels of the breakpoint table.
__ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::set_original_bytecode_at), R19_method, R14_bcp, Rnew_bc);
__ b(L_patch_done);
@@ -261,14 +261,14 @@ void TemplateTable::ldc(LdcType type) {
__ addi(Rscratch2, Rscratch2, tags_offset);
__ lbzx(Rscratch2, Rscratch2, Rscratch1);
__ cmpwi(CCR0, Rscratch2, JVM_CONSTANT_UnresolvedClass); // Unresolved class?
__ cmpwi(CCR1, Rscratch2, JVM_CONSTANT_UnresolvedClassInError); // Unresolved class in error state?
__ cror(CCR0, Assembler::equal, CCR1, Assembler::equal);
__ cmpwi(CR0, Rscratch2, JVM_CONSTANT_UnresolvedClass); // Unresolved class?
__ cmpwi(CR1, Rscratch2, JVM_CONSTANT_UnresolvedClassInError); // Unresolved class in error state?
__ cror(CR0, Assembler::equal, CR1, Assembler::equal);
// Resolved class - need to call vm to get java mirror of the class.
__ cmpwi(CCR1, Rscratch2, JVM_CONSTANT_Class);
__ crnor(CCR0, Assembler::equal, CCR1, Assembler::equal); // Neither resolved class nor unresolved case from above?
__ beq(CCR0, notClass);
__ cmpwi(CR1, Rscratch2, JVM_CONSTANT_Class);
__ crnor(CR0, Assembler::equal, CR1, Assembler::equal); // Neither resolved class nor unresolved case from above?
__ beq(CR0, notClass);
__ li(R4, is_ldc_wide(type) ? 1 : 0);
call_VM(R17_tos, CAST_FROM_FN_PTR(address, InterpreterRuntime::ldc), R4);
@@ -279,16 +279,16 @@ void TemplateTable::ldc(LdcType type) {
__ bind(notClass);
__ addi(Rcpool, Rcpool, base_offset);
__ sldi(Rscratch1, Rscratch1, LogBytesPerWord);
__ cmpdi(CCR0, Rscratch2, JVM_CONSTANT_Integer);
__ bne(CCR0, notInt);
__ cmpdi(CR0, Rscratch2, JVM_CONSTANT_Integer);
__ bne(CR0, notInt);
__ lwax(R17_tos, Rcpool, Rscratch1);
__ push(itos);
__ b(exit);
__ align(32, 12);
__ bind(notInt);
__ cmpdi(CCR0, Rscratch2, JVM_CONSTANT_Float);
__ bne(CCR0, notFloat);
__ cmpdi(CR0, Rscratch2, JVM_CONSTANT_Float);
__ bne(CR0, notFloat);
__ lfsx(F15_ftos, Rcpool, Rscratch1);
__ push(ftos);
__ b(exit);
@@ -318,12 +318,12 @@ void TemplateTable::fast_aldc(LdcType type) {
int simm16_rest = __ load_const_optimized(R11_scratch1, Universe::the_null_sentinel_addr(), R0, true);
__ ld(R31, simm16_rest, R11_scratch1);
__ resolve_oop_handle(R31, R11_scratch1, R12_scratch2, MacroAssembler::PRESERVATION_NONE);
__ cmpld(CCR0, R17_tos, R31);
__ cmpld(CR0, R17_tos, R31);
if (VM_Version::has_isel()) {
__ isel_0(R17_tos, CCR0, Assembler::equal);
__ isel_0(R17_tos, CR0, Assembler::equal);
} else {
Label not_sentinel;
__ bne(CCR0, not_sentinel);
__ bne(CR0, not_sentinel);
__ li(R17_tos, 0);
__ bind(not_sentinel);
}
@@ -359,15 +359,15 @@ void TemplateTable::ldc2_w() {
__ lbzx(Rtag, Rtag, Rindex);
__ sldi(Rindex, Rindex, LogBytesPerWord);
__ cmpdi(CCR0, Rtag, JVM_CONSTANT_Double);
__ bne(CCR0, not_double);
__ cmpdi(CR0, Rtag, JVM_CONSTANT_Double);
__ bne(CR0, not_double);
__ lfdx(F15_ftos, Rcpool, Rindex);
__ push(dtos);
__ b(exit);
__ bind(not_double);
__ cmpdi(CCR0, Rtag, JVM_CONSTANT_Long);
__ bne(CCR0, not_long);
__ cmpdi(CR0, Rtag, JVM_CONSTANT_Long);
__ bne(CR0, not_long);
__ ldx(R17_tos, Rcpool, Rindex);
__ push(ltos);
__ b(exit);
@@ -401,32 +401,32 @@ void TemplateTable::condy_helper(Label& Done) {
{
// tos in (itos, ftos, stos, btos, ctos, ztos)
Label notInt, notFloat, notShort, notByte, notChar, notBool;
__ cmplwi(CCR0, flags, itos);
__ bne(CCR0, notInt);
__ cmplwi(CR0, flags, itos);
__ bne(CR0, notInt);
// itos
__ lwax(R17_tos, obj, off);
__ push(itos);
__ b(Done);
__ bind(notInt);
__ cmplwi(CCR0, flags, ftos);
__ bne(CCR0, notFloat);
__ cmplwi(CR0, flags, ftos);
__ bne(CR0, notFloat);
// ftos
__ lfsx(F15_ftos, obj, off);
__ push(ftos);
__ b(Done);
__ bind(notFloat);
__ cmplwi(CCR0, flags, stos);
__ bne(CCR0, notShort);
__ cmplwi(CR0, flags, stos);
__ bne(CR0, notShort);
// stos
__ lhax(R17_tos, obj, off);
__ push(stos);
__ b(Done);
__ bind(notShort);
__ cmplwi(CCR0, flags, btos);
__ bne(CCR0, notByte);
__ cmplwi(CR0, flags, btos);
__ bne(CR0, notByte);
// btos
__ lbzx(R17_tos, obj, off);
__ extsb(R17_tos, R17_tos);
@@ -434,16 +434,16 @@ void TemplateTable::condy_helper(Label& Done) {
__ b(Done);
__ bind(notByte);
__ cmplwi(CCR0, flags, ctos);
__ bne(CCR0, notChar);
__ cmplwi(CR0, flags, ctos);
__ bne(CR0, notChar);
// ctos
__ lhzx(R17_tos, obj, off);
__ push(ctos);
__ b(Done);
__ bind(notChar);
__ cmplwi(CCR0, flags, ztos);
__ bne(CCR0, notBool);
__ cmplwi(CR0, flags, ztos);
__ bne(CR0, notBool);
// ztos
__ lbzx(R17_tos, obj, off);
__ push(ztos);
@@ -456,16 +456,16 @@ void TemplateTable::condy_helper(Label& Done) {
case Bytecodes::_ldc2_w:
{
Label notLong, notDouble;
__ cmplwi(CCR0, flags, ltos);
__ bne(CCR0, notLong);
__ cmplwi(CR0, flags, ltos);
__ bne(CR0, notLong);
// ltos
__ ldx(R17_tos, obj, off);
__ push(ltos);
__ b(Done);
__ bind(notLong);
__ cmplwi(CCR0, flags, dtos);
__ bne(CCR0, notDouble);
__ cmplwi(CR0, flags, dtos);
__ bne(CR0, notDouble);
// dtos
__ lfdx(F15_ftos, obj, off);
__ push(dtos);
@@ -517,16 +517,16 @@ void TemplateTable::iload_internal(RewriteControl rc) {
// last two iloads in a pair. Comparing against fast_iload means that
// the next bytecode is neither an iload or a caload, and therefore
// an iload pair.
__ cmpwi(CCR0, Rnext_byte, (unsigned int)(unsigned char)Bytecodes::_iload);
__ beq(CCR0, Ldone);
__ cmpwi(CR0, Rnext_byte, (unsigned int)(unsigned char)Bytecodes::_iload);
__ beq(CR0, Ldone);
__ cmpwi(CCR1, Rnext_byte, (unsigned int)(unsigned char)Bytecodes::_fast_iload);
__ cmpwi(CR1, Rnext_byte, (unsigned int)(unsigned char)Bytecodes::_fast_iload);
__ li(Rrewrite_to, (unsigned int)(unsigned char)Bytecodes::_fast_iload2);
__ beq(CCR1, Lrewrite);
__ beq(CR1, Lrewrite);
__ cmpwi(CCR0, Rnext_byte, (unsigned int)(unsigned char)Bytecodes::_caload);
__ cmpwi(CR0, Rnext_byte, (unsigned int)(unsigned char)Bytecodes::_caload);
__ li(Rrewrite_to, (unsigned int)(unsigned char)Bytecodes::_fast_icaload);
__ beq(CCR0, Lrewrite);
__ beq(CR0, Lrewrite);
__ li(Rrewrite_to, (unsigned int)(unsigned char)Bytecodes::_fast_iload);
@@ -812,20 +812,20 @@ void TemplateTable::aload_0_internal(RewriteControl rc) {
__ lbz(Rnext_byte, Bytecodes::length_for(Bytecodes::_aload_0), R14_bcp);
// If _getfield, wait to rewrite. We only want to rewrite the last two bytecodes in a pair.
__ cmpwi(CCR0, Rnext_byte, (unsigned int)(unsigned char)Bytecodes::_getfield);
__ beq(CCR0, Ldont_rewrite);
__ cmpwi(CR0, Rnext_byte, (unsigned int)(unsigned char)Bytecodes::_getfield);
__ beq(CR0, Ldont_rewrite);
__ cmpwi(CCR1, Rnext_byte, (unsigned int)(unsigned char)Bytecodes::_fast_igetfield);
__ cmpwi(CR1, Rnext_byte, (unsigned int)(unsigned char)Bytecodes::_fast_igetfield);
__ li(Rrewrite_to, (unsigned int)(unsigned char)Bytecodes::_fast_iaccess_0);
__ beq(CCR1, Lrewrite);
__ beq(CR1, Lrewrite);
__ cmpwi(CCR0, Rnext_byte, (unsigned int)(unsigned char)Bytecodes::_fast_agetfield);
__ cmpwi(CR0, Rnext_byte, (unsigned int)(unsigned char)Bytecodes::_fast_agetfield);
__ li(Rrewrite_to, (unsigned int)(unsigned char)Bytecodes::_fast_aaccess_0);
__ beq(CCR0, Lrewrite);
__ beq(CR0, Lrewrite);
__ cmpwi(CCR1, Rnext_byte, (unsigned int)(unsigned char)Bytecodes::_fast_fgetfield);
__ cmpwi(CR1, Rnext_byte, (unsigned int)(unsigned char)Bytecodes::_fast_fgetfield);
__ li(Rrewrite_to, (unsigned int)(unsigned char)Bytecodes::_fast_faccess_0);
__ beq(CCR1, Lrewrite);
__ beq(CR1, Lrewrite);
__ li(Rrewrite_to, (unsigned int)(unsigned char)Bytecodes::_fast_aload_0);
@@ -997,8 +997,8 @@ void TemplateTable::aastore() {
Register Rscratch3 = Rindex;
// Do array store check - check for null value first.
__ cmpdi(CCR0, R17_tos, 0);
__ beq(CCR0, Lis_null);
__ cmpdi(CR0, R17_tos, 0);
__ beq(CR0, Lis_null);
__ load_klass(Rarray_klass, Rarray);
__ load_klass(Rvalue_klass, R17_tos);
@@ -1045,9 +1045,9 @@ void TemplateTable::bastore() {
__ load_klass(Rscratch, Rarray);
__ lwz(Rscratch, in_bytes(Klass::layout_helper_offset()), Rscratch);
int diffbit = exact_log2(Klass::layout_helper_boolean_diffbit());
__ testbitdi(CCR0, R0, Rscratch, diffbit);
__ testbitdi(CR0, R0, Rscratch, diffbit);
Label L_skip;
__ bfalse(CCR0, L_skip);
__ bfalse(CR0, L_skip);
__ andi(R17_tos, R17_tos, 1); // if it is a T_BOOLEAN array, mask the stored value to 0/1
__ bind(L_skip);
@@ -1262,11 +1262,11 @@ void TemplateTable::idiv() {
Register Rdividend = R11_scratch1; // Used by irem.
__ addi(R0, R17_tos, 1);
__ cmplwi(CCR0, R0, 2);
__ bgt(CCR0, Lnormal); // divisor <-1 or >1
__ cmplwi(CR0, R0, 2);
__ bgt(CR0, Lnormal); // divisor <-1 or >1
__ cmpwi(CCR1, R17_tos, 0);
__ beq(CCR1, Lexception); // divisor == 0
__ cmpwi(CR1, R17_tos, 0);
__ beq(CR1, Lexception); // divisor == 0
__ pop_i(Rdividend);
__ mullw(R17_tos, Rdividend, R17_tos); // div by +/-1
@@ -1307,11 +1307,11 @@ void TemplateTable::ldiv() {
Register Rdividend = R11_scratch1; // Used by lrem.
__ addi(R0, R17_tos, 1);
__ cmpldi(CCR0, R0, 2);
__ bgt(CCR0, Lnormal); // divisor <-1 or >1
__ cmpldi(CR0, R0, 2);
__ bgt(CR0, Lnormal); // divisor <-1 or >1
__ cmpdi(CCR1, R17_tos, 0);
__ beq(CCR1, Lexception); // divisor == 0
__ cmpdi(CR1, R17_tos, 0);
__ beq(CR1, Lexception); // divisor == 0
__ pop_l(Rdividend);
__ mulld(R17_tos, Rdividend, R17_tos); // div by +/-1
@@ -1565,18 +1565,18 @@ void TemplateTable::convert() {
case Bytecodes::_d2i:
case Bytecodes::_f2i:
__ fcmpu(CCR0, F15_ftos, F15_ftos);
__ fcmpu(CR0, F15_ftos, F15_ftos);
__ li(R17_tos, 0); // 0 in case of NAN
__ bso(CCR0, done);
__ bso(CR0, done);
__ fctiwz(F15_ftos, F15_ftos);
__ move_d_to_l();
break;
case Bytecodes::_d2l:
case Bytecodes::_f2l:
__ fcmpu(CCR0, F15_ftos, F15_ftos);
__ fcmpu(CR0, F15_ftos, F15_ftos);
__ li(R17_tos, 0); // 0 in case of NAN
__ bso(CCR0, done);
__ bso(CR0, done);
__ fctidz(F15_ftos, F15_ftos);
__ move_d_to_l();
break;
@@ -1593,7 +1593,7 @@ void TemplateTable::lcmp() {
const Register Rscratch = R11_scratch1;
__ pop_l(Rscratch); // first operand, deeper in stack
__ cmpd(CCR0, Rscratch, R17_tos); // compare
__ cmpd(CR0, Rscratch, R17_tos); // compare
__ set_cmp3(R17_tos); // set result as follows: <: -1, =: 0, >: 1
}
@@ -1611,7 +1611,7 @@ void TemplateTable::float_cmp(bool is_float, int unordered_result) {
__ pop_d(Rfirst);
}
__ fcmpu(CCR0, Rfirst, Rsecond); // compare
__ fcmpu(CR0, Rfirst, Rsecond); // compare
// if unordered_result is 1, treat unordered_result like 'greater than'
assert(unordered_result == 1 || unordered_result == -1, "unordered_result can be either 1 or -1");
__ set_cmpu3(R17_tos, unordered_result != 1);
@@ -1683,8 +1683,8 @@ void TemplateTable::branch(bool is_jsr, bool is_wide) {
Label Lforward;
// Check branch direction.
__ cmpdi(CCR0, Rdisp, 0);
__ bgt(CCR0, Lforward);
__ cmpdi(CR0, Rdisp, 0);
__ bgt(CR0, Lforward);
__ get_method_counters(R19_method, R4_counters, Lforward);
@@ -1695,8 +1695,8 @@ void TemplateTable::branch(bool is_jsr, bool is_wide) {
// If no method data exists, go to profile_continue.
__ ld(Rmdo, in_bytes(Method::method_data_offset()), R19_method);
__ cmpdi(CCR0, Rmdo, 0);
__ beq(CCR0, Lno_mdo);
__ cmpdi(CR0, Rmdo, 0);
__ beq(CR0, Lno_mdo);
// Increment backedge counter in the MDO.
const int mdo_bc_offs = in_bytes(MethodData::backedge_counter_offset()) + in_bytes(InvocationCounter::counter_offset());
@@ -1706,7 +1706,7 @@ void TemplateTable::branch(bool is_jsr, bool is_wide) {
__ stw(Rscratch2, mdo_bc_offs, Rmdo);
if (UseOnStackReplacement) {
__ and_(Rscratch3, Rscratch2, Rscratch3);
__ bne(CCR0, Lforward);
__ bne(CR0, Lforward);
__ b(Loverflow);
} else {
__ b(Lforward);
@@ -1722,7 +1722,7 @@ void TemplateTable::branch(bool is_jsr, bool is_wide) {
__ stw(Rscratch2, mo_bc_offs, R4_counters);
if (UseOnStackReplacement) {
__ and_(Rscratch3, Rscratch2, Rscratch3);
__ bne(CCR0, Lforward);
__ bne(CR0, Lforward);
} else {
__ b(Lforward);
}
@@ -1733,13 +1733,13 @@ void TemplateTable::branch(bool is_jsr, bool is_wide) {
__ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::frequency_counter_overflow), R4_ARG2, true);
// Was an OSR adapter generated?
__ cmpdi(CCR0, R3_RET, 0);
__ beq(CCR0, Lforward);
__ cmpdi(CR0, R3_RET, 0);
__ beq(CR0, Lforward);
// Has the nmethod been invalidated already?
__ lbz(R0, in_bytes(nmethod::state_offset()), R3_RET);
__ cmpwi(CCR0, R0, nmethod::in_use);
__ bne(CCR0, Lforward);
__ cmpwi(CR0, R0, nmethod::in_use);
__ bne(CR0, Lforward);
// Migrate the interpreter frame off of the stack.
// We can use all registers because we will not return to interpreter from this point.
@@ -1775,18 +1775,18 @@ void TemplateTable::if_cmp_common(Register Rfirst, Register Rsecond, Register Rs
if (is_jint) {
if (cmp0) {
__ cmpwi(CCR0, Rfirst, 0);
__ cmpwi(CR0, Rfirst, 0);
} else {
__ cmpw(CCR0, Rfirst, Rsecond);
__ cmpw(CR0, Rfirst, Rsecond);
}
} else {
if (cmp0) {
__ cmpdi(CCR0, Rfirst, 0);
__ cmpdi(CR0, Rfirst, 0);
} else {
__ cmpd(CCR0, Rfirst, Rsecond);
__ cmpd(CR0, Rfirst, Rsecond);
}
}
branch_conditional(CCR0, cc, Lnot_taken, /*invert*/ true);
branch_conditional(CR0, cc, Lnot_taken, /*invert*/ true);
// Conition is false => Jump!
branch(false, false);
@@ -1885,10 +1885,10 @@ void TemplateTable::tableswitch() {
__ get_u4(Rhigh_byte, Rdef_offset_addr, 2 *BytesPerInt, InterpreterMacroAssembler::Unsigned);
// Check for default case (=index outside [low,high]).
__ cmpw(CCR0, R17_tos, Rlow_byte);
__ cmpw(CCR1, R17_tos, Rhigh_byte);
__ blt(CCR0, Ldefault_case);
__ bgt(CCR1, Ldefault_case);
__ cmpw(CR0, R17_tos, Rlow_byte);
__ cmpw(CR1, R17_tos, Rhigh_byte);
__ blt(CR0, Ldefault_case);
__ bgt(CR1, Ldefault_case);
// Lookup dispatch offset.
__ sub(Rindex, R17_tos, Rlow_byte);
@@ -1944,8 +1944,8 @@ void TemplateTable::fast_linearswitch() {
__ addi(Rcurrent_pair, Rdef_offset_addr, 2 * BytesPerInt); // Rcurrent_pair now points to first pair.
__ mtctr(Rcount);
__ cmpwi(CCR0, Rcount, 0);
__ bne(CCR0, Lloop_entry);
__ cmpwi(CR0, Rcount, 0);
__ bne(CR0, Lloop_entry);
// Default case
__ bind(Ldefault_case);
@@ -1961,8 +1961,8 @@ void TemplateTable::fast_linearswitch() {
__ addi(Rcurrent_pair, Rcurrent_pair, 2 * BytesPerInt);
__ bind(Lloop_entry);
__ get_u4(Rvalue, Rcurrent_pair, 0, InterpreterMacroAssembler::Unsigned);
__ cmpw(CCR0, Rvalue, Rcmp_value);
__ bne(CCR0, Lsearch_loop);
__ cmpw(CR0, Rvalue, Rcmp_value);
__ bne(CR0, Lsearch_loop);
// Found, load offset.
__ get_u4(Roffset, Rcurrent_pair, BytesPerInt, InterpreterMacroAssembler::Signed);
@@ -2057,8 +2057,8 @@ void TemplateTable::fast_binaryswitch() {
// else
// Rh = Ri
Label Lgreater;
__ cmpw(CCR0, Rkey, Rscratch);
__ bge(CCR0, Lgreater);
__ cmpw(CR0, Rkey, Rscratch);
__ bge(CR0, Lgreater);
__ mr(Rj, Rh);
__ b(entry);
__ bind(Lgreater);
@@ -2067,10 +2067,10 @@ void TemplateTable::fast_binaryswitch() {
// while (i+1 < j)
__ bind(entry);
__ addi(Rscratch, Ri, 1);
__ cmpw(CCR0, Rscratch, Rj);
__ cmpw(CR0, Rscratch, Rj);
__ add(Rh, Ri, Rj); // start h = i + j >> 1;
__ blt(CCR0, loop);
__ blt(CR0, loop);
}
// End of binary search, result index is i (must check again!).
@@ -2086,8 +2086,8 @@ void TemplateTable::fast_binaryswitch() {
Label not_found;
// Ri = offset offset
__ cmpw(CCR0, Rkey, Rscratch);
__ beq(CCR0, not_found);
__ cmpw(CR0, Rkey, Rscratch);
__ beq(CR0, not_found);
// entry not found -> j = default offset
__ get_u4(Rj, Rarray, -2 * BytesPerInt, InterpreterMacroAssembler::Unsigned);
__ b(default_case);
@@ -2130,8 +2130,8 @@ void TemplateTable::_return(TosState state) {
// Load klass of this obj.
__ load_klass(Rklass, R17_tos);
__ lbz(Rklass_flags, in_bytes(Klass::misc_flags_offset()), Rklass);
__ testbitdi(CCR0, R0, Rklass_flags, exact_log2(KlassFlags::_misc_has_finalizer));
__ bfalse(CCR0, Lskip_register_finalizer);
__ testbitdi(CR0, R0, Rklass_flags, exact_log2(KlassFlags::_misc_has_finalizer));
__ bfalse(CR0, Lskip_register_finalizer);
__ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::register_finalizer), R17_tos /* obj */);
@@ -2143,7 +2143,7 @@ void TemplateTable::_return(TosState state) {
Label no_safepoint;
__ ld(R11_scratch1, in_bytes(JavaThread::polling_word_offset()), R16_thread);
__ andi_(R11_scratch1, R11_scratch1, SafepointMechanism::poll_bit());
__ beq(CCR0, no_safepoint);
__ beq(CR0, no_safepoint);
__ push(state);
__ push_cont_fastpath();
__ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint));
@@ -2214,8 +2214,8 @@ void TemplateTable::resolve_cache_and_index_for_method(int byte_no, Register Rca
// Load-acquire the bytecode to match store-release in InterpreterRuntime
__ lbz(Rscratch, bytecode_offset, Rcache);
// Acquire by cmp-br-isync (see below).
__ cmpdi(CCR0, Rscratch, (int)code);
__ beq(CCR0, Lresolved);
__ cmpdi(CR0, Rscratch, (int)code);
__ beq(CR0, Lresolved);
// Class initialization barrier slow path lands here as well.
__ bind(L_clinit_barrier_slow);
@@ -2263,8 +2263,8 @@ void TemplateTable::resolve_cache_and_index_for_field(int byte_no,
int code_offset = (byte_no == f1_byte) ? in_bytes(ResolvedFieldEntry::get_code_offset())
: in_bytes(ResolvedFieldEntry::put_code_offset());
__ lbz(R0, code_offset, Rcache);
__ cmpwi(CCR0, R0, (int)code); // have we resolved this bytecode?
__ beq(CCR0, resolved);
__ cmpwi(CR0, R0, (int)code); // have we resolved this bytecode?
__ beq(CR0, resolved);
// resolve first time through
address entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_from_cache);
@@ -2332,8 +2332,8 @@ void TemplateTable::load_resolved_method_entry_handle(Register cache,
// maybe push appendix to arguments (just before return address)
Label L_no_push;
__ testbitdi(CCR0, R0, flags, ResolvedMethodEntry::has_appendix_shift);
__ bfalse(CCR0, L_no_push);
__ testbitdi(CR0, R0, flags, ResolvedMethodEntry::has_appendix_shift);
__ bfalse(CR0, L_no_push);
// invokehandle uses an index into the resolved references array
__ lhz(ref_index, in_bytes(ResolvedMethodEntry::resolved_references_index_offset()), cache);
// Push the appendix as a trailing parameter.
@@ -2395,8 +2395,8 @@ void TemplateTable::load_invokedynamic_entry(Register method) {
__ ld_ptr(method, in_bytes(ResolvedIndyEntry::method_offset()), cache);
// The invokedynamic is unresolved iff method is null
__ cmpdi(CCR0, method, 0);
__ bne(CCR0, resolved);
__ cmpdi(CR0, method, 0);
__ bne(CR0, resolved);
Bytecodes::Code code = bytecode();
@@ -2408,7 +2408,7 @@ void TemplateTable::load_invokedynamic_entry(Register method) {
__ load_resolved_indy_entry(cache, index);
__ ld_ptr(method, in_bytes(ResolvedIndyEntry::method_offset()), cache);
DEBUG_ONLY(__ cmpdi(CCR0, method, 0));
DEBUG_ONLY(__ cmpdi(CR0, method, 0));
__ asm_assert_ne("Should be resolved by now");
__ bind(resolved);
__ isync(); // Order load wrt. succeeding loads.
@@ -2417,7 +2417,7 @@ void TemplateTable::load_invokedynamic_entry(Register method) {
// Check if there is an appendix
__ lbz(index, in_bytes(ResolvedIndyEntry::flags_offset()), cache);
__ rldicl_(R0, index, 64-ResolvedIndyEntry::has_appendix_shift, 63);
__ beq(CCR0, L_no_push);
__ beq(CR0, L_no_push);
// Get appendix
__ lhz(index, in_bytes(ResolvedIndyEntry::resolved_references_index_offset()), cache);
@@ -2489,8 +2489,8 @@ void TemplateTable::jvmti_post_field_access(Register Rcache, Register Rscratch,
int offs = __ load_const_optimized(Rscratch, JvmtiExport::get_field_access_count_addr(), R0, true);
__ lwz(Rscratch, offs, Rscratch);
__ cmpwi(CCR0, Rscratch, 0);
__ beq(CCR0, Lno_field_access_post);
__ cmpwi(CR0, Rscratch, 0);
__ beq(CR0, Lno_field_access_post);
// Post access enabled - do it!
if (is_static) {
@@ -2574,13 +2574,13 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static, RewriteContr
#ifdef ASSERT
Label LFlagInvalid;
__ cmpldi(CCR0, Rtos_state, number_of_states);
__ bge(CCR0, LFlagInvalid);
__ cmpldi(CR0, Rtos_state, number_of_states);
__ bge(CR0, LFlagInvalid);
#endif
// Load from branch table and dispatch (volatile case: one instruction ahead).
__ sldi(Rtos_state, Rtos_state, LogBytesPerWord);
__ cmpwi(CCR2, Rscratch, 1); // Volatile?
__ cmpwi(CR2, Rscratch, 1); // Volatile?
if (support_IRIW_for_not_multiple_copy_atomic_cpu) {
__ sldi(Rscratch, Rscratch, exact_log2(BytesPerInstWord)); // Volatile ? size of 1 instruction : 0.
}
@@ -2631,12 +2631,12 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static, RewriteContr
}
{
Label acquire_double;
__ beq(CCR2, acquire_double); // Volatile?
__ beq(CR2, acquire_double); // Volatile?
__ dispatch_epilog(vtos, Bytecodes::length_for(bytecode()));
__ bind(acquire_double);
__ fcmpu(CCR0, F15_ftos, F15_ftos); // Acquire by cmp-br-isync.
__ beq_predict_taken(CCR0, Lisync);
__ fcmpu(CR0, F15_ftos, F15_ftos); // Acquire by cmp-br-isync.
__ beq_predict_taken(CR0, Lisync);
__ b(Lisync); // In case of NAN.
}
@@ -2652,12 +2652,12 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static, RewriteContr
}
{
Label acquire_float;
__ beq(CCR2, acquire_float); // Volatile?
__ beq(CR2, acquire_float); // Volatile?
__ dispatch_epilog(vtos, Bytecodes::length_for(bytecode()));
__ bind(acquire_float);
__ fcmpu(CCR0, F15_ftos, F15_ftos); // Acquire by cmp-br-isync.
__ beq_predict_taken(CCR0, Lisync);
__ fcmpu(CR0, F15_ftos, F15_ftos); // Acquire by cmp-br-isync.
__ beq_predict_taken(CR0, Lisync);
__ b(Lisync); // In case of NAN.
}
@@ -2671,7 +2671,7 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static, RewriteContr
if (!is_static && rc == may_rewrite) {
patch_bytecode(Bytecodes::_fast_igetfield, Rbc, Rscratch);
}
__ beq(CCR2, Lacquire); // Volatile?
__ beq(CR2, Lacquire); // Volatile?
__ dispatch_epilog(vtos, Bytecodes::length_for(bytecode()));
__ align(32, 28, 28); // Align load.
@@ -2684,7 +2684,7 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static, RewriteContr
if (!is_static && rc == may_rewrite) {
patch_bytecode(Bytecodes::_fast_lgetfield, Rbc, Rscratch);
}
__ beq(CCR2, Lacquire); // Volatile?
__ beq(CR2, Lacquire); // Volatile?
__ dispatch_epilog(vtos, Bytecodes::length_for(bytecode()));
__ align(32, 28, 28); // Align load.
@@ -2698,7 +2698,7 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static, RewriteContr
if (!is_static && rc == may_rewrite) {
patch_bytecode(Bytecodes::_fast_bgetfield, Rbc, Rscratch);
}
__ beq(CCR2, Lacquire); // Volatile?
__ beq(CR2, Lacquire); // Volatile?
__ dispatch_epilog(vtos, Bytecodes::length_for(bytecode()));
__ align(32, 28, 28); // Align load.
@@ -2712,7 +2712,7 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static, RewriteContr
// use btos rewriting, no truncating to t/f bit is needed for getfield.
patch_bytecode(Bytecodes::_fast_bgetfield, Rbc, Rscratch);
}
__ beq(CCR2, Lacquire); // Volatile?
__ beq(CR2, Lacquire); // Volatile?
__ dispatch_epilog(vtos, Bytecodes::length_for(bytecode()));
__ align(32, 28, 28); // Align load.
@@ -2725,7 +2725,7 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static, RewriteContr
if (!is_static && rc == may_rewrite) {
patch_bytecode(Bytecodes::_fast_cgetfield, Rbc, Rscratch);
}
__ beq(CCR2, Lacquire); // Volatile?
__ beq(CR2, Lacquire); // Volatile?
__ dispatch_epilog(vtos, Bytecodes::length_for(bytecode()));
__ align(32, 28, 28); // Align load.
@@ -2738,7 +2738,7 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static, RewriteContr
if (!is_static && rc == may_rewrite) {
patch_bytecode(Bytecodes::_fast_sgetfield, Rbc, Rscratch);
}
__ beq(CCR2, Lacquire); // Volatile?
__ beq(CR2, Lacquire); // Volatile?
__ dispatch_epilog(vtos, Bytecodes::length_for(bytecode()));
__ align(32, 28, 28); // Align load.
@@ -2753,7 +2753,7 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static, RewriteContr
if (!is_static && rc == may_rewrite) {
patch_bytecode(Bytecodes::_fast_agetfield, Rbc, Rscratch);
}
__ beq(CCR2, Lacquire); // Volatile?
__ beq(CR2, Lacquire); // Volatile?
__ dispatch_epilog(vtos, Bytecodes::length_for(bytecode()));
__ align(32, 12);
@@ -2796,8 +2796,8 @@ void TemplateTable::jvmti_post_field_mod(Register Rcache, Register Rscratch, boo
int offs = __ load_const_optimized(Rscratch, JvmtiExport::get_field_modification_count_addr(), R0, true);
__ lwz(Rscratch, offs, Rscratch);
__ cmpwi(CCR0, Rscratch, 0);
__ beq(CCR0, Lno_field_mod_post);
__ cmpwi(CR0, Rscratch, 0);
__ beq(CR0, Lno_field_mod_post);
// Do the post
const Register Robj = Rscratch;
@@ -2830,11 +2830,11 @@ void TemplateTable::jvmti_post_field_mod(Register Rcache, Register Rscratch, boo
// the type to determine where the object is.
__ lbz(Rtos_state, in_bytes(ResolvedFieldEntry::type_offset()), Rcache);
__ cmpwi(CCR0, Rtos_state, ltos);
__ cmpwi(CCR1, Rtos_state, dtos);
__ cmpwi(CR0, Rtos_state, ltos);
__ cmpwi(CR1, Rtos_state, dtos);
__ addi(base, R15_esp, Interpreter::expr_offset_in_bytes(1));
__ crnor(CCR0, Assembler::equal, CCR1, Assembler::equal);
__ beq(CCR0, is_one_slot);
__ crnor(CR0, Assembler::equal, CR1, Assembler::equal);
__ beq(CR0, is_one_slot);
__ addi(base, R15_esp, Interpreter::expr_offset_in_bytes(2));
__ bind(is_one_slot);
break;
@@ -2881,7 +2881,7 @@ void TemplateTable::putfield_or_static(int byte_no, bool is_static, RewriteContr
Rscratch2 = R12_scratch2, // used by load_field_cp_cache_entry
Rscratch3 = R6_ARG4,
Rbc = Rscratch3;
const ConditionRegister CR_is_vol = CCR2; // Non-volatile condition register (survives runtime call in do_oop_store).
const ConditionRegister CR_is_vol = CR2; // Non-volatile condition register (survives runtime call in do_oop_store).
static address field_rw_branch_table[number_of_states],
field_norw_branch_table[number_of_states],
@@ -2907,8 +2907,8 @@ void TemplateTable::putfield_or_static(int byte_no, bool is_static, RewriteContr
#ifdef ASSERT
Label LFlagInvalid;
__ cmpldi(CCR0, Rtos_state, number_of_states);
__ bge(CCR0, LFlagInvalid);
__ cmpldi(CR0, Rtos_state, number_of_states);
__ bge(CR0, LFlagInvalid);
#endif
// Load from branch table and dispatch (volatile case: one instruction ahead).
@@ -3124,7 +3124,7 @@ void TemplateTable::fast_storefield(TosState state) {
Rscratch = R11_scratch1, // used by load_field_cp_cache_entry
Rscratch2 = R12_scratch2, // used by load_field_cp_cache_entry
Rscratch3 = R4_ARG2;
const ConditionRegister CR_is_vol = CCR2; // Non-volatile condition register (survives runtime call in do_oop_store).
const ConditionRegister CR_is_vol = CR2; // Non-volatile condition register (survives runtime call in do_oop_store).
// Constant pool already resolved => Load flags and offset of field.
__ load_field_entry(Rcache, Rscratch);
@@ -3139,7 +3139,7 @@ void TemplateTable::fast_storefield(TosState state) {
if (!support_IRIW_for_not_multiple_copy_atomic_cpu) { __ cmpdi(CR_is_vol, Rscratch, 1); }
{
Label LnotVolatile;
__ beq(CCR0, LnotVolatile);
__ beq(CR0, LnotVolatile);
__ release();
__ align(32, 12);
__ bind(LnotVolatile);
@@ -3219,7 +3219,7 @@ void TemplateTable::fast_accessfield(TosState state) {
// Get volatile flag.
__ rldicl_(Rscratch, Rflags, 64-ResolvedFieldEntry::is_volatile_shift, 63); // Extract volatile bit.
__ bne(CCR0, LisVolatile);
__ bne(CR0, LisVolatile);
switch(bytecode()) {
case Bytecodes::_fast_agetfield:
@@ -3307,8 +3307,8 @@ void TemplateTable::fast_accessfield(TosState state) {
Label Ldummy;
if (support_IRIW_for_not_multiple_copy_atomic_cpu) { __ fence(); }
__ lfsx(F15_ftos, Rclass_or_obj, Roffset);
__ fcmpu(CCR0, F15_ftos, F15_ftos); // Acquire by cmp-br-isync.
__ bne_predict_not_taken(CCR0, Ldummy);
__ fcmpu(CR0, F15_ftos, F15_ftos); // Acquire by cmp-br-isync.
__ bne_predict_not_taken(CR0, Ldummy);
__ bind(Ldummy);
__ isync();
break;
@@ -3322,8 +3322,8 @@ void TemplateTable::fast_accessfield(TosState state) {
Label Ldummy;
if (support_IRIW_for_not_multiple_copy_atomic_cpu) { __ fence(); }
__ lfdx(F15_ftos, Rclass_or_obj, Roffset);
__ fcmpu(CCR0, F15_ftos, F15_ftos); // Acquire by cmp-br-isync.
__ bne_predict_not_taken(CCR0, Ldummy);
__ fcmpu(CR0, F15_ftos, F15_ftos); // Acquire by cmp-br-isync.
__ bne_predict_not_taken(CR0, Ldummy);
__ bind(Ldummy);
__ isync();
break;
@@ -3360,7 +3360,7 @@ void TemplateTable::fast_xaccess(TosState state) {
// Get volatile flag.
__ rldicl_(Rscratch, Rflags, 64-ResolvedFieldEntry::is_volatile_shift, 63); // Extract volatile bit.
__ bne(CCR0, LisVolatile);
__ bne(CR0, LisVolatile);
switch(state) {
case atos:
@@ -3398,8 +3398,8 @@ void TemplateTable::fast_xaccess(TosState state) {
Label Ldummy;
if (support_IRIW_for_not_multiple_copy_atomic_cpu) { __ fence(); }
__ lfsx(F15_ftos, Rclass_or_obj, Roffset);
__ fcmpu(CCR0, F15_ftos, F15_ftos); // Acquire by cmp-br-isync.
__ bne_predict_not_taken(CCR0, Ldummy);
__ fcmpu(CR0, F15_ftos, F15_ftos); // Acquire by cmp-br-isync.
__ bne_predict_not_taken(CR0, Ldummy);
__ bind(Ldummy);
__ isync();
break;
@@ -3480,8 +3480,8 @@ void TemplateTable::invokevirtual(int byte_no) {
load_resolved_method_entry_virtual(Rcache, noreg, Rflags);
// Handle final method separately.
__ testbitdi(CCR0, R0, Rflags, ResolvedMethodEntry::is_vfinal_shift);
__ bfalse(CCR0, LnotFinal);
__ testbitdi(CR0, R0, Rflags, ResolvedMethodEntry::is_vfinal_shift);
__ bfalse(CR0, LnotFinal);
if (RewriteBytecodes && !CDSConfig::is_using_archive() && !CDSConfig::is_dumping_static_archive()) {
patch_bytecode(Bytecodes::_fast_invokevfinal, Rnew_bc, R12_scratch2);
@@ -3587,8 +3587,8 @@ void TemplateTable::invokeinterface_object_method(Register Rrecv_klass,
Label LnotFinal;
// Check for vfinal.
__ testbitdi(CCR0, R0, Rflags, ResolvedMethodEntry::is_vfinal_shift);
__ bfalse(CCR0, LnotFinal);
__ testbitdi(CR0, R0, Rflags, ResolvedMethodEntry::is_vfinal_shift);
__ bfalse(CR0, LnotFinal);
Register Rscratch = Rflags, // Rflags is dead now.
Rmethod = Rtemp2,
@@ -3641,8 +3641,8 @@ void TemplateTable::invokeinterface(int byte_no) {
// to handle this corner case.
Label LnotObjectMethod, Lthrow_ame;
__ testbitdi(CCR0, R0, Rflags, ResolvedMethodEntry::is_forced_virtual_shift);
__ bfalse(CCR0, LnotObjectMethod);
__ testbitdi(CR0, R0, Rflags, ResolvedMethodEntry::is_forced_virtual_shift);
__ bfalse(CR0, LnotObjectMethod);
invokeinterface_object_method(Rrecv_klass, Rret_addr, Rflags, Rcache, Rscratch1, Rscratch2);
__ bind(LnotObjectMethod);
@@ -3652,8 +3652,8 @@ void TemplateTable::invokeinterface(int byte_no) {
// Check for private method invocation - indicated by vfinal
Label LnotVFinal, L_no_such_interface, L_subtype;
__ testbitdi(CCR0, R0, Rflags, ResolvedMethodEntry::is_vfinal_shift);
__ bfalse(CCR0, LnotVFinal);
__ testbitdi(CR0, R0, Rflags, ResolvedMethodEntry::is_vfinal_shift);
__ bfalse(CR0, LnotVFinal);
__ check_klass_subtype(Rrecv_klass, Rinterface_klass, Rscratch1, Rscratch2, L_subtype);
// If we get here the typecheck failed
@@ -3687,8 +3687,8 @@ void TemplateTable::invokeinterface(int byte_no) {
__ lookup_interface_method(Rrecv_klass, Rinterface_klass, Rindex, Rmethod2, Rscratch1, Rscratch2,
L_no_such_interface);
__ cmpdi(CCR0, Rmethod2, 0);
__ beq(CCR0, Lthrow_ame);
__ cmpdi(CR0, Rmethod2, 0);
__ beq(CR0, Lthrow_ame);
// Found entry. Jump off!
// Argument and return type profiling.
__ profile_arguments_type(Rmethod2, Rscratch1, Rscratch2, true);
@@ -3795,8 +3795,8 @@ void TemplateTable::_new() {
__ addi(Rtags, Rtags, Array<u1>::base_offset_in_bytes());
__ lbzx(Rtags, Rindex, Rtags);
__ cmpdi(CCR0, Rtags, JVM_CONSTANT_Class);
__ bne(CCR0, Lslow_case);
__ cmpdi(CR0, Rtags, JVM_CONSTANT_Class);
__ bne(CR0, Lslow_case);
// Get instanceKlass
__ sldi(Roffset, Rindex, LogBytesPerWord);
@@ -3810,7 +3810,7 @@ void TemplateTable::_new() {
// Make sure klass is not abstract, or interface or java/lang/Class.
__ andi_(R0, Rinstance_size, Klass::_lh_instance_slow_path_bit); // slow path bit equals 0?
__ bne(CCR0, Lslow_case);
__ bne(CR0, Lslow_case);
// --------------------------------------------------------------------------
// Fast case:
@@ -3829,8 +3829,8 @@ void TemplateTable::_new() {
__ add(RnewTopValue, Rinstance_size, RoldTopValue);
// If there is enough space, we do not CAS and do not clear.
__ cmpld(CCR0, RnewTopValue, RendValue);
__ bgt(CCR0, Lslow_case);
__ cmpld(CR0, RnewTopValue, RendValue);
__ bgt(CR0, Lslow_case);
__ std(RnewTopValue, in_bytes(JavaThread::tlab_top_offset()), R16_thread);
@@ -3947,8 +3947,8 @@ void TemplateTable::checkcast() {
Rtags = R12_scratch2;
// Null does not pass.
__ cmpdi(CCR0, R17_tos, 0);
__ beq(CCR0, Lis_null);
__ cmpdi(CR0, R17_tos, 0);
__ beq(CR0, Lis_null);
// Get constant pool tag to find out if the bytecode has already been "quickened".
__ get_cpool_and_tags(Rcpool, Rtags);
@@ -3958,8 +3958,8 @@ void TemplateTable::checkcast() {
__ addi(Rtags, Rtags, Array<u1>::base_offset_in_bytes());
__ lbzx(Rtags, Rtags, Roffset);
__ cmpdi(CCR0, Rtags, JVM_CONSTANT_Class);
__ beq(CCR0, Lquicked);
__ cmpdi(CR0, Rtags, JVM_CONSTANT_Class);
__ beq(CR0, Lquicked);
// Call into the VM to "quicken" instanceof.
__ push_ptr(); // for GC
@@ -4009,8 +4009,8 @@ void TemplateTable::instanceof() {
Rtags = R12_scratch2;
// Null does not pass.
__ cmpdi(CCR0, R17_tos, 0);
__ beq(CCR0, Lis_null);
__ cmpdi(CR0, R17_tos, 0);
__ beq(CR0, Lis_null);
// Get constant pool tag to find out if the bytecode has already been "quickened".
__ get_cpool_and_tags(Rcpool, Rtags);
@@ -4020,8 +4020,8 @@ void TemplateTable::instanceof() {
__ addi(Rtags, Rtags, Array<u1>::base_offset_in_bytes());
__ lbzx(Rtags, Rtags, Roffset);
__ cmpdi(CCR0, Rtags, JVM_CONSTANT_Class);
__ beq(CCR0, Lquicked);
__ cmpdi(CR0, Rtags, JVM_CONSTANT_Class);
__ beq(CR0, Lquicked);
// Call into the VM to "quicken" instanceof.
__ push_ptr(); // for GC
@@ -4127,8 +4127,8 @@ void TemplateTable::monitorenter() {
__ null_check_throw(Robj_to_lock, -1, Rscratch1);
// Check if any slot is present => short cut to allocation if not.
__ cmpld(CCR0, Rcurrent_monitor, Rbot);
__ beq(CCR0, Lallocate_new);
__ cmpld(CR0, Rcurrent_monitor, Rbot);
__ beq(CR0, Lallocate_new);
// ------------------------------------------------------------------------------
// Find a free slot in the monitor block.
@@ -4141,24 +4141,24 @@ void TemplateTable::monitorenter() {
__ ld(Rcurrent_obj, in_bytes(BasicObjectLock::obj_offset()), Rcurrent_monitor);
// Exit if current entry is for same object; this guarantees, that new monitor
// used for recursive lock is above the older one.
__ cmpd(CCR0, Rcurrent_obj, Robj_to_lock);
__ beq(CCR0, Lexit); // recursive locking
__ cmpd(CR0, Rcurrent_obj, Robj_to_lock);
__ beq(CR0, Lexit); // recursive locking
__ cmpdi(CCR0, Rcurrent_obj, 0);
__ bne(CCR0, LnotFree);
__ cmpdi(CR0, Rcurrent_obj, 0);
__ bne(CR0, LnotFree);
__ mr(Rfree_slot, Rcurrent_monitor); // remember free slot closest to the bottom
__ bind(LnotFree);
__ addi(Rcurrent_monitor, Rcurrent_monitor, frame::interpreter_frame_monitor_size_in_bytes());
__ cmpld(CCR0, Rcurrent_monitor, Rbot);
__ bne(CCR0, Lloop);
__ cmpld(CR0, Rcurrent_monitor, Rbot);
__ bne(CR0, Lloop);
__ bind(Lexit);
}
// ------------------------------------------------------------------------------
// Check if we found a free slot.
__ cmpdi(CCR0, Rfree_slot, 0);
__ bne(CCR0, Lfound);
__ cmpdi(CR0, Rfree_slot, 0);
__ bne(CR0, Lfound);
// We didn't find a free BasicObjLock => allocate one.
__ bind(Lallocate_new);
@@ -4206,8 +4206,8 @@ void TemplateTable::monitorexit() {
__ null_check_throw(Robj_to_lock, -1, Rscratch);
// Check corner case: unbalanced monitorEnter / Exit.
__ cmpld(CCR0, Rcurrent_monitor, Rbot);
__ beq(CCR0, Lillegal_monitor_state);
__ cmpld(CR0, Rcurrent_monitor, Rbot);
__ beq(CR0, Lillegal_monitor_state);
// Find the corresponding slot in the monitors stack section.
{
@@ -4216,12 +4216,12 @@ void TemplateTable::monitorexit() {
__ bind(Lloop);
__ ld(Rcurrent_obj, in_bytes(BasicObjectLock::obj_offset()), Rcurrent_monitor);
// Is this entry for same obj?
__ cmpd(CCR0, Rcurrent_obj, Robj_to_lock);
__ beq(CCR0, Lfound);
__ cmpd(CR0, Rcurrent_obj, Robj_to_lock);
__ beq(CR0, Lfound);
__ addi(Rcurrent_monitor, Rcurrent_monitor, frame::interpreter_frame_monitor_size_in_bytes());
__ cmpld(CCR0, Rcurrent_monitor, Rbot);
__ bne(CCR0, Lloop);
__ cmpld(CR0, Rcurrent_monitor, Rbot);
__ bne(CR0, Lloop);
}
// Fell through without finding the basic obj lock => throw up!

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2024 SAP SE. All rights reserved.
* Copyright (c) 2012, 2025 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -91,8 +91,8 @@ VtableStub* VtableStubs::create_vtable_stub(int vtable_index) {
// Check offset vs vtable length.
const Register vtable_len = R12_scratch2;
__ lwz(vtable_len, in_bytes(Klass::vtable_length_offset()), rcvr_klass);
__ cmpwi(CCR0, vtable_len, vtable_index*vtableEntry::size());
__ bge(CCR0, L);
__ cmpwi(CR0, vtable_len, vtable_index*vtableEntry::size());
__ bge(CR0, L);
__ li(R12_scratch2, vtable_index);
__ call_VM(noreg, CAST_FROM_FN_PTR(address, bad_compiled_vtable_index), R3_ARG1, R12_scratch2, false);
__ bind(L);
@@ -108,8 +108,8 @@ VtableStub* VtableStubs::create_vtable_stub(int vtable_index) {
#ifndef PRODUCT
if (DebugVtables) {
Label L;
__ cmpdi(CCR0, R19_method, 0);
__ bne(CCR0, L);
__ cmpdi(CR0, R19_method, 0);
__ bne(CR0, L);
__ stop("Vtable entry is ZERO");
__ bind(L);
}
@@ -194,8 +194,8 @@ VtableStub* VtableStubs::create_itable_stub(int itable_index) {
#ifndef PRODUCT
if (DebugVtables) {
Label ok;
__ cmpdi(CCR0, R19_method, 0);
__ bne(CCR0, ok);
__ cmpdi(CR0, R19_method, 0);
__ bne(CR0, ok);
__ stop("method is null");
__ bind(ok);
}

View File

@@ -330,7 +330,104 @@ class InternalAddress: public Address {
};
class Assembler : public AbstractAssembler {
public:
protected:
static int zfa_zli_lookup_double(uint64_t value) {
switch(value) {
case 0xbff0000000000000 : return 0;
case 0x0010000000000000 : return 1;
case 0x3ef0000000000000 : return 2;
case 0x3f00000000000000 : return 3;
case 0x3f70000000000000 : return 4;
case 0x3f80000000000000 : return 5;
case 0x3fb0000000000000 : return 6;
case 0x3fc0000000000000 : return 7;
case 0x3fd0000000000000 : return 8;
case 0x3fd4000000000000 : return 9;
case 0x3fd8000000000000 : return 10;
case 0x3fdc000000000000 : return 11;
case 0x3fe0000000000000 : return 12;
case 0x3fe4000000000000 : return 13;
case 0x3fe8000000000000 : return 14;
case 0x3fec000000000000 : return 15;
case 0x3ff0000000000000 : return 16;
case 0x3ff4000000000000 : return 17;
case 0x3ff8000000000000 : return 18;
case 0x3ffc000000000000 : return 19;
case 0x4000000000000000 : return 20;
case 0x4004000000000000 : return 21;
case 0x4008000000000000 : return 22;
case 0x4010000000000000 : return 23;
case 0x4020000000000000 : return 24;
case 0x4030000000000000 : return 25;
case 0x4060000000000000 : return 26;
case 0x4070000000000000 : return 27;
case 0x40e0000000000000 : return 28;
case 0x40f0000000000000 : return 29;
case 0x7ff0000000000000 : return 30;
case 0x7ff8000000000000 : return 31;
default: break;
}
return -1;
}
static int zfa_zli_lookup_float(uint32_t value) {
switch(value) {
case 0xbf800000 : return 0;
case 0x00800000 : return 1;
case 0x37800000 : return 2;
case 0x38000000 : return 3;
case 0x3b800000 : return 4;
case 0x3c000000 : return 5;
case 0x3d800000 : return 6;
case 0x3e000000 : return 7;
case 0x3e800000 : return 8;
case 0x3ea00000 : return 9;
case 0x3ec00000 : return 10;
case 0x3ee00000 : return 11;
case 0x3f000000 : return 12;
case 0x3f200000 : return 13;
case 0x3f400000 : return 14;
case 0x3f600000 : return 15;
case 0x3f800000 : return 16;
case 0x3fa00000 : return 17;
case 0x3fc00000 : return 18;
case 0x3fe00000 : return 19;
case 0x40000000 : return 20;
case 0x40200000 : return 21;
case 0x40400000 : return 22;
case 0x40800000 : return 23;
case 0x41000000 : return 24;
case 0x41800000 : return 25;
case 0x43000000 : return 26;
case 0x43800000 : return 27;
case 0x47000000 : return 28;
case 0x47800000 : return 29;
case 0x7f800000 : return 30;
case 0x7fc00000 : return 31;
default: break;
}
return -1;
}
public:
static bool can_zfa_zli_float(jfloat f) {
if (!UseZfa) {
return false;
}
uint32_t f_bits = (uint32_t)jint_cast(f);
return zfa_zli_lookup_float(f_bits) != -1;
}
static bool can_zfa_zli_double(jdouble d) {
if (!UseZfa) {
return false;
}
uint64_t d_bits = (uint64_t)julong_cast(d);
return zfa_zli_lookup_double(d_bits) != -1;
}
enum {
instruction_size = 4,
@@ -972,6 +1069,13 @@ enum operand_size { int8, int16, int32, uint32, int64 };
fp_base<Fmt, funct5>(Rd->raw_encoding(), Rs1->raw_encoding(), Rs2, (RoundingMode)rm);
}
template <FmtPrecision Fmt, uint8_t funct5>
void fp_base(FloatRegister Rd, uint8_t Rs1, uint8_t Rs2, int8_t rm) {
guarantee(is_uimm5(Rs1), "Rs1 is out of validity");
guarantee(is_uimm5(Rs2), "Rs2 is out of validity");
fp_base<Fmt, funct5>(Rd->raw_encoding(), Rs1, Rs2, (RoundingMode)rm);
}
public:
enum FClassBits {
@@ -1293,6 +1397,18 @@ enum operand_size { int8, int16, int32, uint32, int64 };
fp_base<H_16_hp, 0b11100>(Rd, Rs1, 0b00000, 0b000);
}
// -------------- ZFA Instruction Definitions --------------
// Zfa Extension for Additional Floating-Point Instructions
void _fli_s(FloatRegister Rd, uint8_t Rs1) {
assert_cond(UseZfa);
fp_base<S_32_sp, 0b11110>(Rd, Rs1, 0b00001, 0b000);
}
void _fli_d(FloatRegister Rd, uint8_t Rs1) {
assert_cond(UseZfa);
fp_base<D_64_dp, 0b11110>(Rd, Rs1, 0b00001, 0b000);
}
// ==========================
// RISC-V Vector Extension
// ==========================

View File

@@ -425,6 +425,8 @@ void LIR_Assembler::const2reg(LIR_Opr src, LIR_Opr dest, LIR_PatchCode patch_cod
assert(dest->is_register(), "should not call otherwise");
LIR_Const* c = src->as_constant_ptr();
address const_addr = nullptr;
jfloat fconst;
jdouble dconst;
switch (c->type()) {
case T_INT:
@@ -460,15 +462,25 @@ void LIR_Assembler::const2reg(LIR_Opr src, LIR_Opr dest, LIR_PatchCode patch_cod
break;
case T_FLOAT:
const_addr = float_constant(c->as_jfloat());
assert(const_addr != nullptr, "must create float constant in the constant table");
__ flw(dest->as_float_reg(), InternalAddress(const_addr));
fconst = c->as_jfloat();
if (MacroAssembler::can_fp_imm_load(fconst)) {
__ fli_s(dest->as_float_reg(), fconst);
} else {
const_addr = float_constant(fconst);
assert(const_addr != nullptr, "must create float constant in the constant table");
__ flw(dest->as_float_reg(), InternalAddress(const_addr));
}
break;
case T_DOUBLE:
const_addr = double_constant(c->as_jdouble());
assert(const_addr != nullptr, "must create double constant in the constant table");
__ fld(dest->as_double_reg(), InternalAddress(const_addr));
dconst = c->as_jdouble();
if (MacroAssembler::can_dp_imm_load(dconst)) {
__ fli_d(dest->as_double_reg(), dconst);
} else {
const_addr = double_constant(c->as_jdouble());
assert(const_addr != nullptr, "must create double constant in the constant table");
__ fld(dest->as_double_reg(), InternalAddress(const_addr));
}
break;
default:

View File

@@ -1409,6 +1409,14 @@ void C2_MacroAssembler::string_compare(Register str1, Register str2,
load_chr_insn str1_load_chr = str1_isL ? (load_chr_insn)&MacroAssembler::lbu : (load_chr_insn)&MacroAssembler::lhu;
load_chr_insn str2_load_chr = str2_isL ? (load_chr_insn)&MacroAssembler::lbu : (load_chr_insn)&MacroAssembler::lhu;
int base_offset1 = arrayOopDesc::base_offset_in_bytes(T_BYTE);
int base_offset2 = arrayOopDesc::base_offset_in_bytes(T_CHAR);
assert((base_offset1 % (UseCompactObjectHeaders ? 4 :
(UseCompressedClassPointers ? 8 : 4))) == 0, "Must be");
assert((base_offset2 % (UseCompactObjectHeaders ? 4 :
(UseCompressedClassPointers ? 8 : 4))) == 0, "Must be");
BLOCK_COMMENT("string_compare {");
// Bizarrely, the counts are passed in bytes, regardless of whether they
@@ -1426,6 +1434,24 @@ void C2_MacroAssembler::string_compare(Register str1, Register str2,
mv(cnt2, cnt1);
bind(L);
// Load 4 bytes once to compare for alignment before main loop. Note that this
// is only possible for LL/UU case. We need to resort to load_long_misaligned
// for both LU and UL cases.
if (str1_isL == str2_isL) { // LL or UU
beq(str1, str2, DONE);
int base_offset = isLL ? base_offset1 : base_offset2;
if (AvoidUnalignedAccesses && (base_offset % 8) != 0) {
mv(t0, minCharsInWord / 2);
ble(cnt2, t0, SHORT_STRING);
lwu(tmp1, Address(str1));
lwu(tmp2, Address(str2));
bne(tmp1, tmp2, DIFFERENCE);
addi(str1, str1, 4);
addi(str2, str2, 4);
subi(cnt2, cnt2, minCharsInWord / 2);
}
}
// A very short string
mv(t0, minCharsInWord);
ble(cnt2, t0, SHORT_STRING);
@@ -1434,8 +1460,14 @@ void C2_MacroAssembler::string_compare(Register str1, Register str2,
// load first parts of strings and finish initialization while loading
{
if (str1_isL == str2_isL) { // LL or UU
// check if str1 and str2 is same pointer
beq(str1, str2, DONE);
#ifdef ASSERT
Label align_ok;
orr(t0, str1, str2);
andi(t0, t0, 0x7);
beqz(t0, align_ok);
stop("bad alignment");
bind(align_ok);
#endif
// load 8 bytes once to compare
ld(tmp1, Address(str1));
ld(tmp2, Address(str2));
@@ -1452,7 +1484,7 @@ void C2_MacroAssembler::string_compare(Register str1, Register str2,
sub(cnt2, zr, cnt2);
} else if (isLU) { // LU case
lwu(tmp1, Address(str1));
ld(tmp2, Address(str2));
load_long_misaligned(tmp2, Address(str2), tmp3, (base_offset2 % 8) != 0 ? 4 : 8);
mv(t0, STUB_THRESHOLD);
bge(cnt2, t0, STUB);
subi(cnt2, cnt2, 4);
@@ -1465,11 +1497,11 @@ void C2_MacroAssembler::string_compare(Register str1, Register str2,
sub(cnt2, zr, cnt2);
addi(cnt1, cnt1, 4);
} else { // UL case
ld(tmp1, Address(str1));
load_long_misaligned(tmp1, Address(str1), tmp3, (base_offset2 % 8) != 0 ? 4 : 8);
lwu(tmp2, Address(str2));
mv(t0, STUB_THRESHOLD);
bge(cnt2, t0, STUB);
addi(cnt2, cnt2, -4);
subi(cnt2, cnt2, 4);
slli(t0, cnt2, 1);
sub(cnt1, zr, t0);
add(str1, str1, t0);
@@ -1486,6 +1518,7 @@ void C2_MacroAssembler::string_compare(Register str1, Register str2,
// main loop
bind(NEXT_WORD);
if (str1_isL == str2_isL) { // LL or UU
// both of the two loads are 8-byte aligned
add(t0, str1, cnt2);
ld(tmp1, Address(t0));
add(t0, str2, cnt2);
@@ -1495,7 +1528,7 @@ void C2_MacroAssembler::string_compare(Register str1, Register str2,
add(t0, str1, cnt1);
lwu(tmp1, Address(t0));
add(t0, str2, cnt2);
ld(tmp2, Address(t0));
load_long_misaligned(tmp2, Address(t0), tmp3, (base_offset2 % 8) != 0 ? 4 : 8);
addi(cnt1, cnt1, 4);
inflate_lo32(tmp3, tmp1);
mv(tmp1, tmp3);
@@ -1504,7 +1537,7 @@ void C2_MacroAssembler::string_compare(Register str1, Register str2,
add(t0, str2, cnt2);
lwu(tmp2, Address(t0));
add(t0, str1, cnt1);
ld(tmp1, Address(t0));
load_long_misaligned(tmp1, Address(t0), tmp3, (base_offset2 % 8) != 0 ? 4 : 8);
inflate_lo32(tmp3, tmp2);
mv(tmp2, tmp3);
addi(cnt1, cnt1, 8);
@@ -1637,6 +1670,9 @@ void C2_MacroAssembler::arrays_equals(Register a1, Register a2,
int length_offset = arrayOopDesc::length_offset_in_bytes();
int base_offset = arrayOopDesc::base_offset_in_bytes(elem_size == 2 ? T_CHAR : T_BYTE);
assert((base_offset % (UseCompactObjectHeaders ? 4 :
(UseCompressedClassPointers ? 8 : 4))) == 0, "Must be");
Register cnt1 = tmp3;
Register cnt2 = tmp1; // cnt2 only used in array length compare
Label DONE, SAME, NEXT_WORD, SHORT, TAIL03, TAIL01;
@@ -1660,10 +1696,31 @@ void C2_MacroAssembler::arrays_equals(Register a1, Register a2,
la(a1, Address(a1, base_offset));
la(a2, Address(a2, base_offset));
// Load 4 bytes once to compare for alignment before main loop.
if (AvoidUnalignedAccesses && (base_offset % 8) != 0) {
subi(cnt1, cnt1, elem_per_word / 2);
bltz(cnt1, TAIL03);
lwu(tmp1, Address(a1));
lwu(tmp2, Address(a2));
addi(a1, a1, 4);
addi(a2, a2, 4);
bne(tmp1, tmp2, DONE);
}
// Check for short strings, i.e. smaller than wordSize.
subi(cnt1, cnt1, elem_per_word);
bltz(cnt1, SHORT);
#ifdef ASSERT
Label align_ok;
orr(t0, a1, a2);
andi(t0, t0, 0x7);
beqz(t0, align_ok);
stop("bad alignment");
bind(align_ok);
#endif
// Main 8 byte comparison loop.
bind(NEXT_WORD); {
ld(tmp1, Address(a1));
@@ -1729,20 +1786,45 @@ void C2_MacroAssembler::arrays_equals(Register a1, Register a2,
void C2_MacroAssembler::string_equals(Register a1, Register a2,
Register result, Register cnt1)
{
Label SAME, DONE, SHORT, NEXT_WORD;
Label SAME, DONE, SHORT, NEXT_WORD, TAIL03, TAIL01;
Register tmp1 = t0;
Register tmp2 = t1;
assert_different_registers(a1, a2, result, cnt1, tmp1, tmp2);
int base_offset = arrayOopDesc::base_offset_in_bytes(T_BYTE);
assert((base_offset % (UseCompactObjectHeaders ? 4 :
(UseCompressedClassPointers ? 8 : 4))) == 0, "Must be");
BLOCK_COMMENT("string_equals {");
mv(result, false);
// Load 4 bytes once to compare for alignment before main loop.
if (AvoidUnalignedAccesses && (base_offset % 8) != 0) {
subi(cnt1, cnt1, 4);
bltz(cnt1, TAIL03);
lwu(tmp1, Address(a1));
lwu(tmp2, Address(a2));
addi(a1, a1, 4);
addi(a2, a2, 4);
bne(tmp1, tmp2, DONE);
}
// Check for short strings, i.e. smaller than wordSize.
subi(cnt1, cnt1, wordSize);
bltz(cnt1, SHORT);
#ifdef ASSERT
Label align_ok;
orr(t0, a1, a2);
andi(t0, t0, 0x7);
beqz(t0, align_ok);
stop("bad alignment");
bind(align_ok);
#endif
// Main 8 byte comparison loop.
bind(NEXT_WORD); {
ld(tmp1, Address(a1));
@@ -1757,8 +1839,6 @@ void C2_MacroAssembler::string_equals(Register a1, Register a2,
beqz(tmp1, SAME);
bind(SHORT);
Label TAIL03, TAIL01;
// 0-7 bytes left.
test_bit(tmp1, cnt1, 2);
beqz(tmp1, TAIL03);
@@ -2512,6 +2592,9 @@ void C2_MacroAssembler::arrays_equals_v(Register a1, Register a2, Register resul
int length_offset = arrayOopDesc::length_offset_in_bytes();
int base_offset = arrayOopDesc::base_offset_in_bytes(elem_size == 2 ? T_CHAR : T_BYTE);
assert((base_offset % (UseCompactObjectHeaders ? 4 :
(UseCompressedClassPointers ? 8 : 4))) == 0, "Must be");
BLOCK_COMMENT("arrays_equals_v {");
// if (a1 == a2), return true

View File

@@ -103,6 +103,7 @@ define_pd_global(intx, InlineSmallCode, 1000);
product(bool, UseZba, false, DIAGNOSTIC, "Use Zba instructions") \
product(bool, UseZbb, false, DIAGNOSTIC, "Use Zbb instructions") \
product(bool, UseZbs, false, DIAGNOSTIC, "Use Zbs instructions") \
product(bool, UseZfa, false, EXPERIMENTAL, "Use Zfa instructions") \
product(bool, UseZfh, false, DIAGNOSTIC, "Use Zfh instructions") \
product(bool, UseZfhmin, false, DIAGNOSTIC, "Use Zfhmin instructions") \
product(bool, UseZacas, false, EXPERIMENTAL, "Use Zacas instructions") \

View File

@@ -2593,6 +2593,45 @@ void MacroAssembler::movptr2(Register Rd, uint64_t addr, int32_t &offset, Regist
offset = lower12;
}
// floating point imm move
bool MacroAssembler::can_fp_imm_load(float imm) {
jint f_bits = jint_cast(imm);
if (f_bits == 0) {
return true;
}
return can_zfa_zli_float(imm);
}
bool MacroAssembler::can_dp_imm_load(double imm) {
julong d_bits = julong_cast(imm);
if (d_bits == 0) {
return true;
}
return can_zfa_zli_double(imm);
}
void MacroAssembler::fli_s(FloatRegister Rd, float imm) {
jint f_bits = jint_cast(imm);
if (f_bits == 0) {
fmv_w_x(Rd, zr);
return;
}
int Rs = zfa_zli_lookup_float(f_bits);
assert(Rs != -1, "Must be");
_fli_s(Rd, Rs);
}
void MacroAssembler::fli_d(FloatRegister Rd, double imm) {
uint64_t d_bits = (uint64_t)julong_cast(imm);
if (d_bits == 0) {
fmv_d_x(Rd, zr);
return;
}
int Rs = zfa_zli_lookup_double(d_bits);
assert(Rs != -1, "Must be");
_fli_d(Rd, Rs);
}
void MacroAssembler::add(Register Rd, Register Rn, int64_t increment, Register tmp) {
if (is_simm12(increment)) {
addi(Rd, Rn, increment);
@@ -4268,7 +4307,7 @@ void MacroAssembler::population_count(Register dst, Register src,
{
bind(loop);
addi(dst, dst, 1);
addi(tmp2, tmp1, -1);
subi(tmp2, tmp1, 1);
andr(tmp1, tmp1, tmp2);
bnez(tmp1, loop);
}

View File

@@ -920,6 +920,11 @@ public:
void movptr1(Register Rd, uintptr_t addr, int32_t &offset);
void movptr2(Register Rd, uintptr_t addr, int32_t &offset, Register tmp);
public:
// float imm move
static bool can_fp_imm_load(float imm);
static bool can_dp_imm_load(double imm);
void fli_s(FloatRegister Rd, float imm);
void fli_d(FloatRegister Rd, double imm);
// arith
void add (Register Rd, Register Rn, int64_t increment, Register tmp = t0);

View File

@@ -4920,7 +4920,11 @@ instruct loadConF(fRegF dst, immF con) %{
%}
ins_encode %{
__ flw(as_FloatRegister($dst$$reg), $constantaddress($con));
if (MacroAssembler::can_fp_imm_load($con$$constant)) {
__ fli_s(as_FloatRegister($dst$$reg), $con$$constant);
} else {
__ flw(as_FloatRegister($dst$$reg), $constantaddress($con));
}
%}
ins_pipe(fp_load_constant_s);
@@ -4950,7 +4954,11 @@ instruct loadConD(fRegD dst, immD con) %{
%}
ins_encode %{
__ fld(as_FloatRegister($dst$$reg), $constantaddress($con));
if (MacroAssembler::can_dp_imm_load($con$$constant)) {
__ fli_d(as_FloatRegister($dst$$reg), $con$$constant);
} else {
__ fld(as_FloatRegister($dst$$reg), $constantaddress($con));
}
%}
ins_pipe(fp_load_constant_d);

View File

@@ -0,0 +1,87 @@
/*
* Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2025, Red Hat, Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#ifndef CPU_RISCV_STUBDECLARATIONS_HPP
#define CPU_RISCV_STUBDECLARATIONS_HPP
#define STUBGEN_INITIAL_BLOBS_ARCH_DO(do_stub, \
do_arch_blob, \
do_arch_entry, \
do_arch_entry_init) \
do_arch_blob(initial, 10000) \
#define STUBGEN_CONTINUATION_BLOBS_ARCH_DO(do_stub, \
do_arch_blob, \
do_arch_entry, \
do_arch_entry_init) \
do_arch_blob(continuation, 2000) \
#define STUBGEN_COMPILER_BLOBS_ARCH_DO(do_stub, \
do_arch_blob, \
do_arch_entry, \
do_arch_entry_init) \
do_arch_blob(compiler, 45000) \
do_stub(compiler, compare_long_string_LL) \
do_arch_entry(riscv, compiler, compare_long_string_LL, \
compare_long_string_LL, compare_long_string_LL) \
do_stub(compiler, compare_long_string_UU) \
do_arch_entry(riscv, compiler, compare_long_string_UU, \
compare_long_string_UU, compare_long_string_UU) \
do_stub(compiler, compare_long_string_LU) \
do_arch_entry(riscv, compiler, compare_long_string_LU, \
compare_long_string_LU, compare_long_string_LU) \
do_stub(compiler, compare_long_string_UL) \
do_arch_entry(riscv, compiler, compare_long_string_UL, \
compare_long_string_UL, compare_long_string_UL) \
do_stub(compiler, string_indexof_linear_ll) \
do_arch_entry(riscv, compiler, string_indexof_linear_ll, \
string_indexof_linear_ll, string_indexof_linear_ll) \
do_stub(compiler, string_indexof_linear_uu) \
do_arch_entry(riscv, compiler, string_indexof_linear_uu, \
string_indexof_linear_uu, string_indexof_linear_uu) \
do_stub(compiler, string_indexof_linear_ul) \
do_arch_entry(riscv, compiler, string_indexof_linear_ul, \
string_indexof_linear_ul, string_indexof_linear_ul) \
#define STUBGEN_FINAL_BLOBS_ARCH_DO(do_stub, \
do_arch_blob, \
do_arch_entry, \
do_arch_entry_init) \
do_arch_blob(final, 20000 ZGC_ONLY(+10000)) \
do_stub(final, copy_byte_f) \
do_arch_entry(riscv, final, copy_byte_f, copy_byte_f, \
copy_byte_f) \
do_stub(final, copy_byte_b) \
do_arch_entry(riscv, final, copy_byte_b, copy_byte_b, \
copy_byte_b) \
do_stub(final, zero_blocks) \
do_arch_entry(riscv, final, zero_blocks, zero_blocks, \
zero_blocks) \
#endif // CPU_RISCV_STUBDECLARATIONS_HPP

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
* Copyright (c) 2014, 2025, 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.
*
@@ -33,14 +33,19 @@
// Implementation of the platform-specific part of StubRoutines - for
// a description of how to extend it, see the stubRoutines.hpp file.
address StubRoutines::riscv::_zero_blocks = nullptr;
address StubRoutines::riscv::_compare_long_string_LL = nullptr;
address StubRoutines::riscv::_compare_long_string_UU = nullptr;
address StubRoutines::riscv::_compare_long_string_LU = nullptr;
address StubRoutines::riscv::_compare_long_string_UL = nullptr;
address StubRoutines::riscv::_string_indexof_linear_ll = nullptr;
address StubRoutines::riscv::_string_indexof_linear_uu = nullptr;
address StubRoutines::riscv::_string_indexof_linear_ul = nullptr;
// define fields for arch-specific entries
#define DEFINE_ARCH_ENTRY(arch, blob_name, stub_name, field_name, getter_name) \
address StubRoutines:: arch :: STUB_FIELD_NAME(field_name) = nullptr;
#define DEFINE_ARCH_ENTRY_INIT(arch, blob_name, stub_name, field_name, getter_name, init_function) \
address StubRoutines:: arch :: STUB_FIELD_NAME(field_name) = CAST_FROM_FN_PTR(address, init_function);
STUBGEN_ARCH_ENTRIES_DO(DEFINE_ARCH_ENTRY, DEFINE_ARCH_ENTRY_INIT)
#undef DEFINE_ARCH_ENTRY_INIT
#undef DEFINE_ARCH_ENTRY
bool StubRoutines::riscv::_completed = false;

View File

@@ -35,63 +35,53 @@ static bool returns_to_call_stub(address return_pc) {
return return_pc == _call_stub_return_address;
}
// emit enum used to size per-blob code buffers
#define DEFINE_BLOB_SIZE(blob_name, size) \
_ ## blob_name ## _code_size = size,
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 = 45000,
_final_stubs_code_size = 20000 ZGC_ONLY(+10000)
STUBGEN_ARCH_BLOBS_DO(DEFINE_BLOB_SIZE)
};
#undef DEFINE_BLOB_SIZE
class riscv {
friend class StubGenerator;
#if INCLUDE_JVMCI
friend class JVMCIVMStructs;
#endif
private:
static address _zero_blocks;
// declare fields for arch-specific entries
static address _compare_long_string_LL;
static address _compare_long_string_LU;
static address _compare_long_string_UL;
static address _compare_long_string_UU;
static address _string_indexof_linear_ll;
static address _string_indexof_linear_uu;
static address _string_indexof_linear_ul;
#define DECLARE_ARCH_ENTRY(arch, blob_name, stub_name, field_name, getter_name) \
static address STUB_FIELD_NAME(field_name) ;
#define DECLARE_ARCH_ENTRY_INIT(arch, blob_name, stub_name, field_name, getter_name, init_function) \
DECLARE_ARCH_ENTRY(arch, blob_name, stub_name, field_name, getter_name)
private:
STUBGEN_ARCH_ENTRIES_DO(DECLARE_ARCH_ENTRY, DECLARE_ARCH_ENTRY_INIT)
#undef DECLARE_ARCH_ENTRY_INIT
#undef DECLARE_ARCH_ENTRY
static bool _completed;
public:
static address zero_blocks() {
return _zero_blocks;
}
// declare getters for arch-specific entries
static address compare_long_string_LL() {
return _compare_long_string_LL;
}
#define DEFINE_ARCH_ENTRY_GETTER(arch, blob_name, stub_name, field_name, getter_name) \
static address getter_name() { return STUB_FIELD_NAME(field_name) ; }
static address compare_long_string_LU() {
return _compare_long_string_LU;
}
#define DEFINE_ARCH_ENTRY_GETTER_INIT(arch, blob_name, stub_name, field_name, getter_name, init_function) \
DEFINE_ARCH_ENTRY_GETTER(arch, blob_name, stub_name, field_name, getter_name)
static address compare_long_string_UL() {
return _compare_long_string_UL;
}
STUBGEN_ARCH_ENTRIES_DO(DEFINE_ARCH_ENTRY_GETTER, DEFINE_ARCH_ENTRY_GETTER_INIT)
static address compare_long_string_UU() {
return _compare_long_string_UU;
}
static address string_indexof_linear_ul() {
return _string_indexof_linear_ul;
}
static address string_indexof_linear_ll() {
return _string_indexof_linear_ll;
}
static address string_indexof_linear_uu() {
return _string_indexof_linear_uu;
}
#undef DEFINE_ARCH_ENTRY_GETTER_INIT
#undef DEFINE_ARCH_ENTRY_GETTER
static bool complete() {
return _completed;

View File

@@ -157,6 +157,7 @@ class VM_Version : public Abstract_VM_Version {
decl(ext_Zbc , "Zbc" , RV_NO_FLAG_BIT, true , NO_UPDATE_DEFAULT) \
decl(ext_Zbs , "Zbs" , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZbs)) \
decl(ext_Zcb , "Zcb" , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZcb)) \
decl(ext_Zfa , "Zfa" , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZfa)) \
decl(ext_Zfh , "Zfh" , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZfh)) \
decl(ext_Zfhmin , "Zfhmin" , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZfhmin)) \
decl(ext_Zicsr , "Zicsr" , RV_NO_FLAG_BIT, true , NO_UPDATE_DEFAULT) \
@@ -226,6 +227,7 @@ class VM_Version : public Abstract_VM_Version {
RV_ENABLE_EXTENSION(UseZbb) \
RV_ENABLE_EXTENSION(UseZbs) \
RV_ENABLE_EXTENSION(UseZcb) \
RV_ENABLE_EXTENSION(UseZfa) \
RV_ENABLE_EXTENSION(UseZfhmin) \
RV_ENABLE_EXTENSION(UseZic64b) \
RV_ENABLE_EXTENSION(UseZicbom) \

View File

@@ -0,0 +1,60 @@
/*
* Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2025, Red Hat, Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#ifndef CPU_S390_STUBDECLARATIONS_HPP
#define CPU_S390_STUBDECLARATIONS_HPP
#define STUBGEN_INITIAL_BLOBS_ARCH_DO(do_stub, \
do_arch_blob, \
do_arch_entry, \
do_arch_entry_init) \
do_arch_blob(initial, 20000) \
#define STUBGEN_CONTINUATION_BLOBS_ARCH_DO(do_stub, \
do_arch_blob, \
do_arch_entry, \
do_arch_entry_init) \
do_arch_blob(continuation, 2000) \
#define STUBGEN_COMPILER_BLOBS_ARCH_DO(do_stub, \
do_arch_blob, \
do_arch_entry, \
do_arch_entry_init) \
do_arch_blob(compiler, 20000 ) \
do_stub(compiler, partial_subtype_check) \
do_arch_entry(zarch, compiler, partial_subtype_check, \
partial_subtype_check, partial_subtype_check) \
#define STUBGEN_FINAL_BLOBS_ARCH_DO(do_stub, \
do_arch_blob, \
do_arch_entry, \
do_arch_entry_init) \
do_arch_blob(final, 20000) \
#endif // CPU_S390_STUBDECLARATIONS_HPP

View File

@@ -118,7 +118,8 @@ class StubGenerator: public StubCodeGenerator {
// Set up a new C frame, copy Java arguments, call frame manager
// or native_entry, and process result.
StubCodeMark mark(this, "StubRoutines", "call_stub");
StubGenStubId stub_id = StubGenStubId::call_stub_id;
StubCodeMark mark(this, stub_id);
address start = __ pc();
Register r_arg_call_wrapper_addr = Z_ARG1;
@@ -458,7 +459,8 @@ class StubGenerator: public StubCodeGenerator {
// pending exception stored in JavaThread that can be tested from
// within the VM.
address generate_catch_exception() {
StubCodeMark mark(this, "StubRoutines", "catch_exception");
StubGenStubId stub_id = StubGenStubId::catch_exception_id;
StubCodeMark mark(this, stub_id);
address start = __ pc();
@@ -509,7 +511,8 @@ class StubGenerator: public StubCodeGenerator {
// (Z_R14 is unchanged and is live out).
//
address generate_forward_exception() {
StubCodeMark mark(this, "StubRoutines", "forward_exception");
StubGenStubId stub_id = StubGenStubId::forward_exception_id;
StubCodeMark mark(this, stub_id);
address start = __ pc();
#define pending_exception_offset in_bytes(Thread::pending_exception_offset())
@@ -589,7 +592,8 @@ class StubGenerator: public StubCodeGenerator {
// raddr: Z_R14, blown by call
//
address generate_partial_subtype_check() {
StubCodeMark mark(this, "StubRoutines", "partial_subtype_check");
StubGenStubId stub_id = StubGenStubId::partial_subtype_check_id;
StubCodeMark mark(this, stub_id);
Label miss;
address start = __ pc();
@@ -621,8 +625,9 @@ class StubGenerator: public StubCodeGenerator {
return start;
}
address generate_lookup_secondary_supers_table_stub(u1 super_klass_index) {
StubCodeMark mark(this, "StubRoutines", "lookup_secondary_supers_table");
void generate_lookup_secondary_supers_table_stub() {
StubGenStubId stub_id = StubGenStubId::lookup_secondary_supers_table_id;
StubCodeMark mark(this, stub_id);
const Register
r_super_klass = Z_ARG1,
@@ -632,20 +637,20 @@ class StubGenerator: public StubCodeGenerator {
r_array_base = Z_ARG5,
r_bitmap = Z_R10,
r_result = Z_R11;
address start = __ pc();
for (int slot = 0; slot < Klass::SECONDARY_SUPERS_TABLE_SIZE; slot++) {
StubRoutines::_lookup_secondary_supers_table_stubs[slot] = __ pc();
__ lookup_secondary_supers_table_const(r_sub_klass, r_super_klass,
r_array_base, r_array_length, r_array_index,
r_bitmap, r_result, slot);
__ lookup_secondary_supers_table_const(r_sub_klass, r_super_klass,
r_array_base, r_array_length, r_array_index,
r_bitmap, r_result, super_klass_index);
__ z_br(Z_R14);
return start;
__ z_br(Z_R14);
}
}
// Slow path implementation for UseSecondarySupersTable.
address generate_lookup_secondary_supers_table_slow_path_stub() {
StubCodeMark mark(this, "StubRoutines", "lookup_secondary_supers_table_slow_path");
StubGenStubId stub_id = StubGenStubId::lookup_secondary_supers_table_slow_path_id;
StubCodeMark mark(this, stub_id);
address start = __ pc();
@@ -1260,51 +1265,75 @@ class StubGenerator: public StubCodeGenerator {
}
}
// Generate stub for disjoint byte copy. If "aligned" is true, the
// "from" and "to" addresses are assumed to be heapword aligned.
address generate_disjoint_byte_copy(bool aligned, const char * name) {
StubCodeMark mark(this, "StubRoutines", name);
// This is the zarch specific stub generator for byte array copy.
// Refer to generate_disjoint_copy for a list of prereqs and features:
address generate_disjoint_nonoop_copy(StubGenStubId stub_id) {
bool aligned;
int element_size;
switch (stub_id) {
case jbyte_disjoint_arraycopy_id:
aligned = false;
element_size = 1;
break;
case arrayof_jbyte_disjoint_arraycopy_id:
aligned = true;
element_size = 1;
break;
case jshort_disjoint_arraycopy_id:
aligned = false;
element_size = 2;
break;
case arrayof_jshort_disjoint_arraycopy_id:
aligned = true;
element_size = 2;
break;
case jint_disjoint_arraycopy_id:
aligned = false;
element_size = 4;
break;
case arrayof_jint_disjoint_arraycopy_id:
aligned = true;
element_size = 4;
break;
case jlong_disjoint_arraycopy_id:
aligned = false;
element_size = 8;
break;
case arrayof_jlong_disjoint_arraycopy_id:
aligned = true;
element_size = 8;
break;
default:
ShouldNotReachHere();
}
StubCodeMark mark(this, stub_id);
unsigned int start_off = __ offset(); // Remember stub start address (is rtn value).
generate_disjoint_copy(aligned, 1, false, false);
generate_disjoint_copy(aligned, element_size, false, false);
return __ addr_at(start_off);
}
address generate_disjoint_short_copy(bool aligned, const char * name) {
StubCodeMark mark(this, "StubRoutines", name);
// This is the zarch specific stub generator for short array copy.
// Refer to generate_disjoint_copy for a list of prereqs and features:
unsigned int start_off = __ offset(); // Remember stub start address (is rtn value).
generate_disjoint_copy(aligned, 2, false, false);
return __ addr_at(start_off);
}
address generate_disjoint_int_copy(bool aligned, const char * name) {
StubCodeMark mark(this, "StubRoutines", name);
// This is the zarch specific stub generator for int array copy.
// Refer to generate_disjoint_copy for a list of prereqs and features:
unsigned int start_off = __ offset(); // Remember stub start address (is rtn value).
generate_disjoint_copy(aligned, 4, false, false);
return __ addr_at(start_off);
}
address generate_disjoint_long_copy(bool aligned, const char * name) {
StubCodeMark mark(this, "StubRoutines", name);
// This is the zarch specific stub generator for long array copy.
// Refer to generate_disjoint_copy for a list of prereqs and features:
unsigned int start_off = __ offset(); // Remember stub start address (is rtn value).
generate_disjoint_copy(aligned, 8, false, false);
return __ addr_at(start_off);
}
address generate_disjoint_oop_copy(bool aligned, const char * name, bool dest_uninitialized) {
StubCodeMark mark(this, "StubRoutines", name);
address generate_disjoint_oop_copy(StubGenStubId stub_id) {
bool aligned;
bool dest_uninitialized;
switch (stub_id) {
case oop_disjoint_arraycopy_id:
aligned = false;
dest_uninitialized = false;
break;
case arrayof_oop_disjoint_arraycopy_id:
aligned = true;
dest_uninitialized = false;
break;
case oop_disjoint_arraycopy_uninit_id:
aligned = false;
dest_uninitialized = true;
break;
case arrayof_oop_disjoint_arraycopy_uninit_id:
aligned = true;
dest_uninitialized = true;
break;
default:
ShouldNotReachHere();
}
StubCodeMark mark(this, stub_id);
// This is the zarch specific stub generator for oop array copy.
// Refer to generate_disjoint_copy for a list of prereqs and features.
unsigned int start_off = __ offset(); // Remember stub start address (is rtn value).
@@ -1328,77 +1357,96 @@ class StubGenerator: public StubCodeGenerator {
return __ addr_at(start_off);
}
address generate_conjoint_byte_copy(bool aligned, const char * name) {
StubCodeMark mark(this, "StubRoutines", name);
// This is the zarch specific stub generator for overlapping byte array copy.
// Refer to generate_conjoint_copy for a list of prereqs and features:
unsigned int start_off = __ offset(); // Remember stub start address (is rtn value).
address nooverlap_target = aligned ? StubRoutines::arrayof_jbyte_disjoint_arraycopy()
: StubRoutines::jbyte_disjoint_arraycopy();
array_overlap_test(nooverlap_target, 0); // Branch away to nooverlap_target if disjoint.
generate_conjoint_copy(aligned, 1, false);
address generate_conjoint_nonoop_copy(StubGenStubId stub_id) {
bool aligned;
int shift; // i.e. log2(element size)
address nooverlap_target;
switch (stub_id) {
case jbyte_arraycopy_id:
aligned = false;
shift = 0;
nooverlap_target = StubRoutines::jbyte_disjoint_arraycopy();
break;
case arrayof_jbyte_arraycopy_id:
aligned = true;
shift = 0;
nooverlap_target = StubRoutines::arrayof_jbyte_disjoint_arraycopy();
break;
case jshort_arraycopy_id:
aligned = false;
shift = 1;
nooverlap_target = StubRoutines::jshort_disjoint_arraycopy();
break;
case arrayof_jshort_arraycopy_id:
aligned = true;
shift = 1;
nooverlap_target = StubRoutines::arrayof_jshort_disjoint_arraycopy();
break;
case jint_arraycopy_id:
aligned = false;
shift = 2;
nooverlap_target = StubRoutines::jint_disjoint_arraycopy();
break;
case arrayof_jint_arraycopy_id:
aligned = true;
shift = 2;
nooverlap_target = StubRoutines::arrayof_jint_disjoint_arraycopy();
break;
case jlong_arraycopy_id:
aligned = false;
shift = 3;
nooverlap_target = StubRoutines::jlong_disjoint_arraycopy();
break;
case arrayof_jlong_arraycopy_id:
aligned = true;
shift = 3;
nooverlap_target = StubRoutines::arrayof_jlong_disjoint_arraycopy();
break;
default:
ShouldNotReachHere();
}
StubCodeMark mark(this, stub_id);
unsigned int start_off = __ offset(); // Remember stub start address (is rtn value).
array_overlap_test(nooverlap_target, shift); // Branch away to nooverlap_target if disjoint.
generate_conjoint_copy(aligned, 1 << shift, false);
return __ addr_at(start_off);
}
address generate_conjoint_short_copy(bool aligned, const char * name) {
StubCodeMark mark(this, "StubRoutines", name);
// This is the zarch specific stub generator for overlapping short array copy.
// Refer to generate_conjoint_copy for a list of prereqs and features:
unsigned int start_off = __ offset(); // Remember stub start address (is rtn value).
address nooverlap_target = aligned ? StubRoutines::arrayof_jshort_disjoint_arraycopy()
: StubRoutines::jshort_disjoint_arraycopy();
array_overlap_test(nooverlap_target, 1); // Branch away to nooverlap_target if disjoint.
generate_conjoint_copy(aligned, 2, false);
return __ addr_at(start_off);
}
address generate_conjoint_int_copy(bool aligned, const char * name) {
StubCodeMark mark(this, "StubRoutines", name);
// This is the zarch specific stub generator for overlapping int array copy.
// Refer to generate_conjoint_copy for a list of prereqs and features:
unsigned int start_off = __ offset(); // Remember stub start address (is rtn value).
address nooverlap_target = aligned ? StubRoutines::arrayof_jint_disjoint_arraycopy()
: StubRoutines::jint_disjoint_arraycopy();
array_overlap_test(nooverlap_target, 2); // Branch away to nooverlap_target if disjoint.
generate_conjoint_copy(aligned, 4, false);
return __ addr_at(start_off);
}
address generate_conjoint_long_copy(bool aligned, const char * name) {
StubCodeMark mark(this, "StubRoutines", name);
// This is the zarch specific stub generator for overlapping long array copy.
// Refer to generate_conjoint_copy for a list of prereqs and features:
unsigned int start_off = __ offset(); // Remember stub start address (is rtn value).
address nooverlap_target = aligned ? StubRoutines::arrayof_jlong_disjoint_arraycopy()
: StubRoutines::jlong_disjoint_arraycopy();
array_overlap_test(nooverlap_target, 3); // Branch away to nooverlap_target if disjoint.
generate_conjoint_copy(aligned, 8, false);
return __ addr_at(start_off);
}
address generate_conjoint_oop_copy(bool aligned, const char * name, bool dest_uninitialized) {
StubCodeMark mark(this, "StubRoutines", name);
address generate_conjoint_oop_copy(StubGenStubId stub_id) {
bool aligned;
bool dest_uninitialized;
address nooverlap_target;
switch (stub_id) {
case oop_arraycopy_id:
aligned = false;
dest_uninitialized = false;
nooverlap_target = StubRoutines::oop_disjoint_arraycopy(dest_uninitialized);
break;
case arrayof_oop_arraycopy_id:
aligned = true;
dest_uninitialized = false;
nooverlap_target = StubRoutines::arrayof_oop_disjoint_arraycopy(dest_uninitialized);
break;
case oop_arraycopy_uninit_id:
aligned = false;
dest_uninitialized = true;
nooverlap_target = StubRoutines::oop_disjoint_arraycopy(dest_uninitialized);
break;
case arrayof_oop_arraycopy_uninit_id:
aligned = true;
dest_uninitialized = true;
nooverlap_target = StubRoutines::arrayof_oop_disjoint_arraycopy(dest_uninitialized);
break;
default:
ShouldNotReachHere();
}
StubCodeMark mark(this, stub_id);
// This is the zarch specific stub generator for overlapping oop array copy.
// Refer to generate_conjoint_copy for a list of prereqs and features.
unsigned int start_off = __ offset(); // Remember stub start address (is rtn value).
unsigned int size = UseCompressedOops ? 4 : 8;
unsigned int shift = UseCompressedOops ? 2 : 3;
address nooverlap_target = aligned ? StubRoutines::arrayof_oop_disjoint_arraycopy(dest_uninitialized)
: StubRoutines::oop_disjoint_arraycopy(dest_uninitialized);
// Branch to disjoint_copy (if applicable) before pre_barrier to avoid double pre_barrier.
array_overlap_test(nooverlap_target, shift); // Branch away to nooverlap_target if disjoint.
@@ -1425,33 +1473,33 @@ class StubGenerator: public StubCodeGenerator {
// Note: the disjoint stubs must be generated first, some of
// the conjoint stubs use them.
StubRoutines::_jbyte_disjoint_arraycopy = generate_disjoint_byte_copy (false, "jbyte_disjoint_arraycopy");
StubRoutines::_jshort_disjoint_arraycopy = generate_disjoint_short_copy(false, "jshort_disjoint_arraycopy");
StubRoutines::_jint_disjoint_arraycopy = generate_disjoint_int_copy (false, "jint_disjoint_arraycopy");
StubRoutines::_jlong_disjoint_arraycopy = generate_disjoint_long_copy (false, "jlong_disjoint_arraycopy");
StubRoutines::_oop_disjoint_arraycopy = generate_disjoint_oop_copy (false, "oop_disjoint_arraycopy", false);
StubRoutines::_oop_disjoint_arraycopy_uninit = generate_disjoint_oop_copy (false, "oop_disjoint_arraycopy_uninit", true);
StubRoutines::_jbyte_disjoint_arraycopy = generate_disjoint_nonoop_copy (StubGenStubId::jbyte_disjoint_arraycopy_id);
StubRoutines::_jshort_disjoint_arraycopy = generate_disjoint_nonoop_copy(StubGenStubId::jshort_disjoint_arraycopy_id);
StubRoutines::_jint_disjoint_arraycopy = generate_disjoint_nonoop_copy (StubGenStubId::jint_disjoint_arraycopy_id);
StubRoutines::_jlong_disjoint_arraycopy = generate_disjoint_nonoop_copy (StubGenStubId::jlong_disjoint_arraycopy_id);
StubRoutines::_oop_disjoint_arraycopy = generate_disjoint_oop_copy (StubGenStubId::oop_disjoint_arraycopy_id);
StubRoutines::_oop_disjoint_arraycopy_uninit = generate_disjoint_oop_copy (StubGenStubId::oop_disjoint_arraycopy_uninit_id);
StubRoutines::_arrayof_jbyte_disjoint_arraycopy = generate_disjoint_byte_copy (true, "arrayof_jbyte_disjoint_arraycopy");
StubRoutines::_arrayof_jshort_disjoint_arraycopy = generate_disjoint_short_copy(true, "arrayof_jshort_disjoint_arraycopy");
StubRoutines::_arrayof_jint_disjoint_arraycopy = generate_disjoint_int_copy (true, "arrayof_jint_disjoint_arraycopy");
StubRoutines::_arrayof_jlong_disjoint_arraycopy = generate_disjoint_long_copy (true, "arrayof_jlong_disjoint_arraycopy");
StubRoutines::_arrayof_oop_disjoint_arraycopy = generate_disjoint_oop_copy (true, "arrayof_oop_disjoint_arraycopy", false);
StubRoutines::_arrayof_oop_disjoint_arraycopy_uninit = generate_disjoint_oop_copy (true, "arrayof_oop_disjoint_arraycopy_uninit", true);
StubRoutines::_arrayof_jbyte_disjoint_arraycopy = generate_disjoint_nonoop_copy (StubGenStubId::arrayof_jbyte_disjoint_arraycopy_id);
StubRoutines::_arrayof_jshort_disjoint_arraycopy = generate_disjoint_nonoop_copy(StubGenStubId::arrayof_jshort_disjoint_arraycopy_id);
StubRoutines::_arrayof_jint_disjoint_arraycopy = generate_disjoint_nonoop_copy (StubGenStubId::arrayof_jint_disjoint_arraycopy_id);
StubRoutines::_arrayof_jlong_disjoint_arraycopy = generate_disjoint_nonoop_copy (StubGenStubId::arrayof_jlong_disjoint_arraycopy_id);
StubRoutines::_arrayof_oop_disjoint_arraycopy = generate_disjoint_oop_copy (StubGenStubId::arrayof_oop_disjoint_arraycopy_id);
StubRoutines::_arrayof_oop_disjoint_arraycopy_uninit = generate_disjoint_oop_copy (StubGenStubId::arrayof_oop_disjoint_arraycopy_uninit_id);
StubRoutines::_jbyte_arraycopy = generate_conjoint_byte_copy (false, "jbyte_arraycopy");
StubRoutines::_jshort_arraycopy = generate_conjoint_short_copy(false, "jshort_arraycopy");
StubRoutines::_jint_arraycopy = generate_conjoint_int_copy (false, "jint_arraycopy");
StubRoutines::_jlong_arraycopy = generate_conjoint_long_copy (false, "jlong_arraycopy");
StubRoutines::_oop_arraycopy = generate_conjoint_oop_copy (false, "oop_arraycopy", false);
StubRoutines::_oop_arraycopy_uninit = generate_conjoint_oop_copy (false, "oop_arraycopy_uninit", true);
StubRoutines::_jbyte_arraycopy = generate_conjoint_nonoop_copy(StubGenStubId::jbyte_arraycopy_id);
StubRoutines::_jshort_arraycopy = generate_conjoint_nonoop_copy(StubGenStubId::jshort_arraycopy_id);
StubRoutines::_jint_arraycopy = generate_conjoint_nonoop_copy(StubGenStubId::jint_arraycopy_id);
StubRoutines::_jlong_arraycopy = generate_conjoint_nonoop_copy(StubGenStubId::jlong_arraycopy_id);
StubRoutines::_oop_arraycopy = generate_conjoint_oop_copy(StubGenStubId::oop_arraycopy_id);
StubRoutines::_oop_arraycopy_uninit = generate_conjoint_oop_copy(StubGenStubId::oop_arraycopy_uninit_id);
StubRoutines::_arrayof_jbyte_arraycopy = generate_conjoint_byte_copy (true, "arrayof_jbyte_arraycopy");
StubRoutines::_arrayof_jshort_arraycopy = generate_conjoint_short_copy(true, "arrayof_jshort_arraycopy");
StubRoutines::_arrayof_jint_arraycopy = generate_conjoint_int_copy (true, "arrayof_jint_arraycopy");
StubRoutines::_arrayof_jlong_arraycopy = generate_conjoint_long_copy (true, "arrayof_jlong_arraycopy");
StubRoutines::_arrayof_oop_arraycopy = generate_conjoint_oop_copy (true, "arrayof_oop_arraycopy", false);
StubRoutines::_arrayof_oop_arraycopy_uninit = generate_conjoint_oop_copy (true, "arrayof_oop_arraycopy_uninit", true);
StubRoutines::_arrayof_jbyte_arraycopy = generate_conjoint_nonoop_copy(StubGenStubId::arrayof_jbyte_arraycopy_id);
StubRoutines::_arrayof_jshort_arraycopy = generate_conjoint_nonoop_copy(StubGenStubId::arrayof_jshort_arraycopy_id);
StubRoutines::_arrayof_jint_arraycopy = generate_conjoint_nonoop_copy (StubGenStubId::arrayof_jint_arraycopy_id);
StubRoutines::_arrayof_jlong_arraycopy = generate_conjoint_nonoop_copy(StubGenStubId::arrayof_jlong_arraycopy_id);
StubRoutines::_arrayof_oop_arraycopy = generate_conjoint_oop_copy(StubGenStubId::arrayof_oop_arraycopy_id);
StubRoutines::_arrayof_oop_arraycopy_uninit = generate_conjoint_oop_copy(StubGenStubId::arrayof_oop_arraycopy_uninit_id);
}
// Call interface for AES_encryptBlock, AES_decryptBlock stubs.
@@ -1733,9 +1781,10 @@ class StubGenerator: public StubCodeGenerator {
}
// Compute AES encrypt function.
address generate_AES_encryptBlock(const char* name) {
address generate_AES_encryptBlock() {
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", name);
StubGenStubId stub_id = StubGenStubId::aescrypt_encryptBlock_id;
StubCodeMark mark(this, stub_id);
unsigned int start_off = __ offset(); // Remember stub start address (is rtn value).
generate_AES_cipherBlock(false);
@@ -1744,9 +1793,10 @@ class StubGenerator: public StubCodeGenerator {
}
// Compute AES decrypt function.
address generate_AES_decryptBlock(const char* name) {
address generate_AES_decryptBlock() {
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", name);
StubGenStubId stub_id = StubGenStubId::aescrypt_decryptBlock_id;
StubCodeMark mark(this, stub_id);
unsigned int start_off = __ offset(); // Remember stub start address (is rtn value).
generate_AES_cipherBlock(true);
@@ -1804,9 +1854,10 @@ class StubGenerator: public StubCodeGenerator {
}
// Compute chained AES encrypt function.
address generate_cipherBlockChaining_AES_encrypt(const char* name) {
address generate_cipherBlockChaining_AES_encrypt() {
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", name);
StubGenStubId stub_id = StubGenStubId::cipherBlockChaining_encryptAESCrypt_id;
StubCodeMark mark(this, stub_id);
unsigned int start_off = __ offset(); // Remember stub start address (is rtn value).
generate_AES_cipherBlockChaining(false);
@@ -1815,9 +1866,10 @@ class StubGenerator: public StubCodeGenerator {
}
// Compute chained AES decrypt function.
address generate_cipherBlockChaining_AES_decrypt(const char* name) {
address generate_cipherBlockChaining_AES_decrypt() {
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", name);
StubGenStubId stub_id = StubGenStubId::cipherBlockChaining_decryptAESCrypt_id;
StubCodeMark mark(this, stub_id);
unsigned int start_off = __ offset(); // Remember stub start address (is rtn value).
generate_AES_cipherBlockChaining(true);
@@ -2521,9 +2573,10 @@ class StubGenerator: public StubCodeGenerator {
// Compute AES-CTR crypto function.
// Encrypt or decrypt is selected via parameters. Only one stub is necessary.
address generate_counterMode_AESCrypt(const char* name) {
address generate_counterMode_AESCrypt() {
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", name);
StubGenStubId stub_id = StubGenStubId::counterMode_AESCrypt_id;
StubCodeMark mark(this, stub_id);
unsigned int start_off = __ offset(); // Remember stub start address (is rtn value).
generate_counterMode_AES(false);
@@ -2536,7 +2589,8 @@ class StubGenerator: public StubCodeGenerator {
// Compute GHASH function.
address generate_ghash_processBlocks() {
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", "ghash_processBlocks");
StubGenStubId stub_id = StubGenStubId::ghash_processBlocks_id;
StubCodeMark mark(this, stub_id);
unsigned int start_off = __ offset(); // Remember stub start address (is rtn value).
const Register state = Z_ARG1;
@@ -2613,9 +2667,20 @@ class StubGenerator: public StubCodeGenerator {
// provides for a large enough source data buffer.
//
// Compute SHA-1 function.
address generate_SHA1_stub(bool multiBlock, const char* name) {
address generate_SHA1_stub(StubGenStubId stub_id) {
bool multiBlock;
switch (stub_id) {
case sha1_implCompress_id:
multiBlock = false;
break;
case sha1_implCompressMB_id:
multiBlock = true;
break;
default:
ShouldNotReachHere();
}
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", name);
StubCodeMark mark(this, stub_id);
unsigned int start_off = __ offset(); // Remember stub start address (is rtn value).
const Register srcBuff = Z_ARG1; // Points to first block to process (offset already added).
@@ -2695,9 +2760,20 @@ class StubGenerator: public StubCodeGenerator {
}
// Compute SHA-256 function.
address generate_SHA256_stub(bool multiBlock, const char* name) {
address generate_SHA256_stub(StubGenStubId stub_id) {
bool multiBlock;
switch (stub_id) {
case sha256_implCompress_id:
multiBlock = false;
break;
case sha256_implCompressMB_id:
multiBlock = true;
break;
default:
ShouldNotReachHere();
}
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", name);
StubCodeMark mark(this, stub_id);
unsigned int start_off = __ offset(); // Remember stub start address (is rtn value).
const Register srcBuff = Z_ARG1;
@@ -2775,9 +2851,20 @@ class StubGenerator: public StubCodeGenerator {
}
// Compute SHA-512 function.
address generate_SHA512_stub(bool multiBlock, const char* name) {
address generate_SHA512_stub(StubGenStubId stub_id) {
bool multiBlock;
switch (stub_id) {
case sha512_implCompress_id:
multiBlock = false;
break;
case sha512_implCompressMB_id:
multiBlock = true;
break;
default:
ShouldNotReachHere();
}
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", name);
StubCodeMark mark(this, stub_id);
unsigned int start_off = __ offset(); // Remember stub start address (is rtn value).
const Register srcBuff = Z_ARG1;
@@ -2867,7 +2954,7 @@ class StubGenerator: public StubCodeGenerator {
* Z_RET - int crc result
**/
// Compute CRC function (generic, for all polynomials).
void generate_CRC_updateBytes(const char* name, Register table, bool invertCRC) {
void generate_CRC_updateBytes(Register table, bool invertCRC) {
// arguments to kernel_crc32:
Register crc = Z_ARG1; // Current checksum, preset by caller or result from previous call, int.
@@ -2898,18 +2985,19 @@ class StubGenerator: public StubCodeGenerator {
// Compute CRC32 function.
address generate_CRC32_updateBytes(const char* name) {
address generate_CRC32_updateBytes() {
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", name);
StubGenStubId stub_id = StubGenStubId::updateBytesCRC32_id;
StubCodeMark mark(this, stub_id);
unsigned int start_off = __ offset(); // Remember stub start address (is rtn value).
assert(UseCRC32Intrinsics, "should not generate this stub (%s) with CRC32 intrinsics disabled", name);
assert(UseCRC32Intrinsics, "should not generate this stub (%s) with CRC32 intrinsics disabled", StubRoutines::get_stub_name(stub_id));
BLOCK_COMMENT("CRC32_updateBytes {");
Register table = Z_ARG4; // crc32 table address.
StubRoutines::zarch::generate_load_crc_table_addr(_masm, table);
generate_CRC_updateBytes(name, table, true);
generate_CRC_updateBytes(table, true);
BLOCK_COMMENT("} CRC32_updateBytes");
return __ addr_at(start_off);
@@ -2917,18 +3005,19 @@ class StubGenerator: public StubCodeGenerator {
// Compute CRC32C function.
address generate_CRC32C_updateBytes(const char* name) {
address generate_CRC32C_updateBytes() {
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", name);
StubGenStubId stub_id = StubGenStubId::updateBytesCRC32C_id;
StubCodeMark mark(this, stub_id);
unsigned int start_off = __ offset(); // Remember stub start address (is rtn value).
assert(UseCRC32CIntrinsics, "should not generate this stub (%s) with CRC32C intrinsics disabled", name);
assert(UseCRC32CIntrinsics, "should not generate this stub (%s) with CRC32C intrinsics disabled", StubRoutines::get_stub_name(stub_id));
BLOCK_COMMENT("CRC32C_updateBytes {");
Register table = Z_ARG4; // crc32c table address.
StubRoutines::zarch::generate_load_crc32c_table_addr(_masm, table);
generate_CRC_updateBytes(name, table, false);
generate_CRC_updateBytes(table, false);
BLOCK_COMMENT("} CRC32C_updateBytes");
return __ addr_at(start_off);
@@ -2943,7 +3032,8 @@ class StubGenerator: public StubCodeGenerator {
// Z_ARG5 - z address
address generate_multiplyToLen() {
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", "multiplyToLen");
StubGenStubId stub_id = StubGenStubId::multiplyToLen_id;
StubCodeMark mark(this, stub_id);
address start = __ pc();
@@ -2974,7 +3064,8 @@ class StubGenerator: public StubCodeGenerator {
address generate_method_entry_barrier() {
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", "nmethod_entry_barrier");
StubGenStubId stub_id = StubGenStubId::method_entry_barrier_id;
StubCodeMark mark(this, stub_id);
address start = __ pc();
@@ -3039,7 +3130,8 @@ class StubGenerator: public StubCodeGenerator {
// exception handler for upcall stubs
address generate_upcall_stub_exception_handler() {
StubCodeMark mark(this, "StubRoutines", "upcall stub exception handler");
StubGenStubId stub_id = StubGenStubId::upcall_stub_exception_handler_id;
StubCodeMark mark(this, stub_id);
address start = __ pc();
// Native caller has no idea how to handle exceptions,
@@ -3056,7 +3148,8 @@ class StubGenerator: public StubCodeGenerator {
// Z_ARG1 = jobject receiver
// Z_method = Method* result
address generate_upcall_stub_load_target() {
StubCodeMark mark(this, "StubRoutines", "upcall_stub_load_target");
StubGenStubId stub_id = StubGenStubId::upcall_stub_load_target_id;
StubCodeMark mark(this, stub_id);
address start = __ pc();
__ resolve_global_jobject(Z_ARG1, Z_tmp_1, Z_tmp_2);
@@ -3093,12 +3186,12 @@ class StubGenerator: public StubCodeGenerator {
if (UseCRC32Intrinsics) {
StubRoutines::_crc_table_adr = (address)StubRoutines::zarch::_crc_table;
StubRoutines::_updateBytesCRC32 = generate_CRC32_updateBytes("CRC32_updateBytes");
StubRoutines::_updateBytesCRC32 = generate_CRC32_updateBytes();
}
if (UseCRC32CIntrinsics) {
StubRoutines::_crc32c_table_addr = (address)StubRoutines::zarch::_crc32c_table;
StubRoutines::_updateBytesCRC32C = generate_CRC32C_updateBytes("CRC32C_updateBytes");
StubRoutines::_updateBytesCRC32C = generate_CRC32C_updateBytes();
}
// Comapct string intrinsics: Translate table for string inflate intrinsic. Used by trot instruction.
@@ -3117,8 +3210,6 @@ class StubGenerator: public StubCodeGenerator {
void generate_final_stubs() {
// Generates all stubs and initializes the entry points.
StubRoutines::zarch::_partial_subtype_check = generate_partial_subtype_check();
// Support for verify_oop (must happen after universe_init).
StubRoutines::_verify_oop_subroutine_entry = generate_verify_oop_subroutine();
@@ -3131,19 +3222,31 @@ class StubGenerator: public StubCodeGenerator {
StubRoutines::_method_entry_barrier = generate_method_entry_barrier();
}
#ifdef COMPILER2
if (UseSecondarySupersTable) {
StubRoutines::_lookup_secondary_supers_table_slow_path_stub = generate_lookup_secondary_supers_table_slow_path_stub();
if (!InlineSecondarySupersTest) {
generate_lookup_secondary_supers_table_stub();
}
}
#endif // COMPILER2
StubRoutines::_upcall_stub_exception_handler = generate_upcall_stub_exception_handler();
StubRoutines::_upcall_stub_load_target = generate_upcall_stub_load_target();
}
void generate_compiler_stubs() {
StubRoutines::zarch::_partial_subtype_check = generate_partial_subtype_check();
#if COMPILER2_OR_JVMCI
// Generate AES intrinsics code.
if (UseAESIntrinsics) {
if (VM_Version::has_Crypto_AES()) {
StubRoutines::_aescrypt_encryptBlock = generate_AES_encryptBlock("AES_encryptBlock");
StubRoutines::_aescrypt_decryptBlock = generate_AES_decryptBlock("AES_decryptBlock");
StubRoutines::_cipherBlockChaining_encryptAESCrypt = generate_cipherBlockChaining_AES_encrypt("AES_encryptBlock_chaining");
StubRoutines::_cipherBlockChaining_decryptAESCrypt = generate_cipherBlockChaining_AES_decrypt("AES_decryptBlock_chaining");
StubRoutines::_aescrypt_encryptBlock = generate_AES_encryptBlock();
StubRoutines::_aescrypt_decryptBlock = generate_AES_decryptBlock();
StubRoutines::_cipherBlockChaining_encryptAESCrypt = generate_cipherBlockChaining_AES_encrypt();
StubRoutines::_cipherBlockChaining_decryptAESCrypt = generate_cipherBlockChaining_AES_decrypt();
} else {
// In PRODUCT builds, the function pointers will keep their initial (null) value.
// LibraryCallKit::try_to_inline() will return false then, preventing the intrinsic to be called.
@@ -3153,7 +3256,7 @@ class StubGenerator: public StubCodeGenerator {
if (UseAESCTRIntrinsics) {
if (VM_Version::has_Crypto_AES_CTR()) {
StubRoutines::_counterMode_AESCrypt = generate_counterMode_AESCrypt("counterMode_AESCrypt");
StubRoutines::_counterMode_AESCrypt = generate_counterMode_AESCrypt();
} else {
// In PRODUCT builds, the function pointers will keep their initial (null) value.
// LibraryCallKit::try_to_inline() will return false then, preventing the intrinsic to be called.
@@ -3168,16 +3271,16 @@ class StubGenerator: public StubCodeGenerator {
// Generate SHA1/SHA256/SHA512 intrinsics code.
if (UseSHA1Intrinsics) {
StubRoutines::_sha1_implCompress = generate_SHA1_stub(false, "SHA1_singleBlock");
StubRoutines::_sha1_implCompressMB = generate_SHA1_stub(true, "SHA1_multiBlock");
StubRoutines::_sha1_implCompress = generate_SHA1_stub(StubGenStubId::sha1_implCompress_id);
StubRoutines::_sha1_implCompressMB = generate_SHA1_stub(StubGenStubId::sha1_implCompressMB_id);
}
if (UseSHA256Intrinsics) {
StubRoutines::_sha256_implCompress = generate_SHA256_stub(false, "SHA256_singleBlock");
StubRoutines::_sha256_implCompressMB = generate_SHA256_stub(true, "SHA256_multiBlock");
StubRoutines::_sha256_implCompress = generate_SHA256_stub(StubGenStubId::sha256_implCompress_id);
StubRoutines::_sha256_implCompressMB = generate_SHA256_stub(StubGenStubId::sha256_implCompressMB_id);
}
if (UseSHA512Intrinsics) {
StubRoutines::_sha512_implCompress = generate_SHA512_stub(false, "SHA512_singleBlock");
StubRoutines::_sha512_implCompressMB = generate_SHA512_stub(true, "SHA512_multiBlock");
StubRoutines::_sha512_implCompress = generate_SHA512_stub(StubGenStubId::sha512_implCompress_id);
StubRoutines::_sha512_implCompressMB = generate_SHA512_stub(StubGenStubId::sha512_implCompressMB_id);
}
#ifdef COMPILER2
@@ -3192,35 +3295,27 @@ class StubGenerator: public StubCodeGenerator {
StubRoutines::_montgomerySquare
= CAST_FROM_FN_PTR(address, SharedRuntime::montgomery_square);
}
if (UseSecondarySupersTable) {
StubRoutines::_lookup_secondary_supers_table_slow_path_stub = generate_lookup_secondary_supers_table_slow_path_stub();
if (!InlineSecondarySupersTest) {
for (int slot = 0; slot < Klass::SECONDARY_SUPERS_TABLE_SIZE; slot++) {
StubRoutines::_lookup_secondary_supers_table_stubs[slot] = generate_lookup_secondary_supers_table_stub(slot);
}
}
}
#endif
#endif // COMPILER2_OR_JVMCI
}
public:
StubGenerator(CodeBuffer* code, StubsKind kind) : StubCodeGenerator(code) {
switch(kind) {
case Initial_stubs:
StubGenerator(CodeBuffer* code, StubGenBlobId blob_id) : StubCodeGenerator(code, blob_id) {
switch(blob_id) {
case initial_id:
generate_initial_stubs();
break;
case Continuation_stubs:
case continuation_id:
generate_continuation_stubs();
break;
case Compiler_stubs:
case compiler_id:
generate_compiler_stubs();
break;
case Final_stubs:
case final_id:
generate_final_stubs();
break;
default:
fatal("unexpected stubs kind: %d", kind);
fatal("unexpected blob id: %d", blob_id);
break;
};
}
@@ -3259,6 +3354,6 @@ class StubGenerator: public StubCodeGenerator {
};
void StubGenerator_generate(CodeBuffer* code, StubCodeGenerator::StubsKind kind) {
StubGenerator g(code, kind);
void StubGenerator_generate(CodeBuffer* code, StubGenBlobId blob_id) {
StubGenerator g(code, blob_id);
}

View File

@@ -32,7 +32,18 @@
// Implementation of the platform-specific part of StubRoutines - for
// a description of how to extend it, see the stubRoutines.hpp file.
address StubRoutines::zarch::_partial_subtype_check = nullptr;
// define fields for arch-specific entries
#define DEFINE_ARCH_ENTRY(arch, blob_name, stub_name, field_name, getter_name) \
address StubRoutines:: arch :: STUB_FIELD_NAME(field_name) = nullptr;
#define DEFINE_ARCH_ENTRY_INIT(arch, blob_name, stub_name, field_name, getter_name, init_function) \
address StubRoutines:: arch :: STUB_FIELD_NAME(field_name) = CAST_FROM_FN_PTR(address, init_function);
STUBGEN_ARCH_ENTRIES_DO(DEFINE_ARCH_ENTRY, DEFINE_ARCH_ENTRY_INIT)
#undef DEFINE_ARCH_ENTRY_INIT
#undef DEFINE_ARCH_ENTRY
// Comapct string intrinsics: Translate table for string inflate intrinsic. Used by trot instruction.
address StubRoutines::zarch::_trot_table_addr = nullptr;

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, 2017 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -31,14 +31,17 @@
static bool returns_to_call_stub(address return_pc) { return return_pc == _call_stub_return_address; }
enum { // Platform dependent constants.
// simply increase sizes if too small (assembler will crash if too small)
_initial_stubs_code_size = 20000,
_continuation_stubs_code_size = 2000,
_compiler_stubs_code_size = 20000,
_final_stubs_code_size = 20000
// emit enum used to size per-blob code buffers
#define DEFINE_BLOB_SIZE(blob_name, size) \
_ ## blob_name ## _code_size = size,
enum platform_dependent_constants {
STUBGEN_ARCH_BLOBS_DO(DEFINE_BLOB_SIZE)
};
#undef DEFINE_BLOB_SIZE
// MethodHandles adapters
enum method_handles_platform_dependent_constants {
method_handles_adapters_code_size = 5000
@@ -69,10 +72,24 @@ class zarch {
locked = 1
};
// declare fields for arch-specific entries
#define DECLARE_ARCH_ENTRY(arch, blob_name, stub_name, field_name, getter_name) \
static address STUB_FIELD_NAME(field_name) ;
#define DECLARE_ARCH_ENTRY_INIT(arch, blob_name, stub_name, field_name, getter_name, init_function) \
DECLARE_ARCH_ENTRY(arch, blob_name, stub_name, field_name, getter_name)
private:
STUBGEN_ARCH_ENTRIES_DO(DECLARE_ARCH_ENTRY, DECLARE_ARCH_ENTRY_INIT)
#undef DECLARE_ARCH_ENTRY_INIT
#undef DECLARE_ARCH_ENTRY
private:
static int _atomic_memory_operation_lock;
static address _partial_subtype_check;
static juint _crc_table[CRC32_TABLES][CRC32_COLUMN_SIZE];
static juint _crc32c_table[CRC32_TABLES][CRC32_COLUMN_SIZE];
@@ -81,6 +98,20 @@ class zarch {
static jlong _trot_table[TROT_COLUMN_SIZE];
public:
// declare getters for arch-specific entries
#define DEFINE_ARCH_ENTRY_GETTER(arch, blob_name, stub_name, field_name, getter_name) \
static address getter_name() { return STUB_FIELD_NAME(field_name) ; }
#define DEFINE_ARCH_ENTRY_GETTER_INIT(arch, blob_name, stub_name, field_name, getter_name, init_function) \
DEFINE_ARCH_ENTRY_GETTER(arch, blob_name, stub_name, field_name, getter_name)
STUBGEN_ARCH_ENTRIES_DO(DEFINE_ARCH_ENTRY_GETTER, DEFINE_ARCH_ENTRY_GETTER_INIT)
#undef DEFINE_ARCH_ENTRY_GETTER_INIT
#undef DEFINE_ARCH_ENTRY_GETTER
// Global lock for everyone who needs to use atomic_compare_and_exchange
// or atomic_increment -- should probably use more locks for more
// scalability -- for instance one for each eden space or group of.
@@ -92,8 +123,6 @@ class zarch {
static int atomic_memory_operation_lock() { return _atomic_memory_operation_lock; }
static void set_atomic_memory_operation_lock(int value) { _atomic_memory_operation_lock = value; }
static address partial_subtype_check() { return _partial_subtype_check; }
static void generate_load_absolute_address(MacroAssembler* masm, Register table, address table_addr, uint64_t table_contents);
static void generate_load_crc_table_addr(MacroAssembler* masm, Register table);
static void generate_load_crc32c_table_addr(MacroAssembler* masm, Register table);

View File

@@ -199,13 +199,14 @@ void StubGenerator::generate_string_indexof(address *fnptrs) {
static void generate_string_indexof_stubs(StubGenerator *stubgen, address *fnptrs,
StrIntrinsicNode::ArgEncoding ae, MacroAssembler *_masm) {
StubCodeMark mark(stubgen, "StubRoutines", "stringIndexOf");
bool isLL = (ae == StrIntrinsicNode::LL);
bool isUL = (ae == StrIntrinsicNode::UL);
bool isUU = (ae == StrIntrinsicNode::UU);
bool isU = isUL || isUU; // At least one is UTF-16
assert(isLL || isUL || isUU, "Encoding not recognized");
StubGenStubId stub_id = (isLL ? StubGenStubId::string_indexof_linear_ll_id : (isUL ? StubGenStubId::string_indexof_linear_ul_id : StubGenStubId::string_indexof_linear_uu_id));
StubCodeMark mark(stubgen, stub_id);
// Keep track of isUL since we need to generate UU code in the main body
// for the case where we expand the needle from bytes to words on the stack.
// This is done at L_wcharBegin. The algorithm used is:

View File

@@ -9136,14 +9136,14 @@ void MacroAssembler::crc32c_ipl_alg2_alt2(Register in_out, Register in1, Registe
Label L_exit;
if (is_pclmulqdq_supported ) {
const_or_pre_comp_const_index[1] = *(uint32_t *)StubRoutines::_crc32c_table_addr;
const_or_pre_comp_const_index[0] = *((uint32_t *)StubRoutines::_crc32c_table_addr+1);
const_or_pre_comp_const_index[1] = *(uint32_t *)StubRoutines::crc32c_table_addr();
const_or_pre_comp_const_index[0] = *((uint32_t *)StubRoutines::crc32c_table_addr() + 1);
const_or_pre_comp_const_index[3] = *((uint32_t *)StubRoutines::_crc32c_table_addr + 2);
const_or_pre_comp_const_index[2] = *((uint32_t *)StubRoutines::_crc32c_table_addr + 3);
const_or_pre_comp_const_index[3] = *((uint32_t *)StubRoutines::crc32c_table_addr() + 2);
const_or_pre_comp_const_index[2] = *((uint32_t *)StubRoutines::crc32c_table_addr() + 3);
const_or_pre_comp_const_index[5] = *((uint32_t *)StubRoutines::_crc32c_table_addr + 4);
const_or_pre_comp_const_index[4] = *((uint32_t *)StubRoutines::_crc32c_table_addr + 5);
const_or_pre_comp_const_index[5] = *((uint32_t *)StubRoutines::crc32c_table_addr() + 4);
const_or_pre_comp_const_index[4] = *((uint32_t *)StubRoutines::crc32c_table_addr() + 5);
assert((CRC32C_NUM_PRECOMPUTED_CONSTANTS - 1 ) == 5, "Checking whether you declared all of the constants based on the number of \"chunks\"");
} else {
const_or_pre_comp_const_index[0] = 1;
@@ -9216,14 +9216,14 @@ void MacroAssembler::crc32c_ipl_alg2_alt2(Register in_out, Register in1, Registe
Label L_exit;
if (is_pclmulqdq_supported) {
const_or_pre_comp_const_index[1] = *(uint32_t *)StubRoutines::_crc32c_table_addr;
const_or_pre_comp_const_index[0] = *((uint32_t *)StubRoutines::_crc32c_table_addr + 1);
const_or_pre_comp_const_index[1] = *(uint32_t *)StubRoutines::crc32c_table_addr();
const_or_pre_comp_const_index[0] = *((uint32_t *)StubRoutines::crc32c_table_addr() + 1);
const_or_pre_comp_const_index[3] = *((uint32_t *)StubRoutines::_crc32c_table_addr + 2);
const_or_pre_comp_const_index[2] = *((uint32_t *)StubRoutines::_crc32c_table_addr + 3);
const_or_pre_comp_const_index[3] = *((uint32_t *)StubRoutines::crc32c_table_addr() + 2);
const_or_pre_comp_const_index[2] = *((uint32_t *)StubRoutines::crc32c_table_addr() + 3);
const_or_pre_comp_const_index[5] = *((uint32_t *)StubRoutines::_crc32c_table_addr + 4);
const_or_pre_comp_const_index[4] = *((uint32_t *)StubRoutines::_crc32c_table_addr + 5);
const_or_pre_comp_const_index[5] = *((uint32_t *)StubRoutines::crc32c_table_addr() + 4);
const_or_pre_comp_const_index[4] = *((uint32_t *)StubRoutines::crc32c_table_addr() + 5);
} else {
const_or_pre_comp_const_index[0] = 1;
const_or_pre_comp_const_index[1] = 0;

View File

@@ -0,0 +1,262 @@
/*
* Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2025, Red Hat, Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#ifndef CPU_X86_STUBDECLARATIONS_HPP
#define CPU_X86_STUBDECLARATIONS_HPP
#define STUBGEN_INITIAL_BLOBS_ARCH_DO(do_stub, \
do_arch_blob, \
do_arch_entry, \
do_arch_entry_init) \
do_arch_blob(initial, 20000 WINDOWS_ONLY(+1000)) \
do_stub(initial, verify_mxcsr) \
do_arch_entry(x86, initial, verify_mxcsr, verify_mxcsr_entry, \
verify_mxcsr_entry) \
LP64_ONLY( \
do_stub(initial, get_previous_sp) \
do_arch_entry(x86, initial, get_previous_sp, \
get_previous_sp_entry, \
get_previous_sp_entry) \
do_stub(initial, f2i_fixup) \
do_arch_entry(x86, initial, f2i_fixup, f2i_fixup, f2i_fixup) \
do_stub(initial, f2l_fixup) \
do_arch_entry(x86, initial, f2l_fixup, f2l_fixup, f2l_fixup) \
do_stub(initial, d2i_fixup) \
do_arch_entry(x86, initial, d2i_fixup, d2i_fixup, d2i_fixup) \
do_stub(initial, d2l_fixup) \
do_arch_entry(x86, initial, d2l_fixup, d2l_fixup, d2l_fixup) \
do_stub(initial, float_sign_mask) \
do_arch_entry(x86, initial, float_sign_mask, float_sign_mask, \
float_sign_mask) \
do_stub(initial, float_sign_flip) \
do_arch_entry(x86, initial, float_sign_flip, float_sign_flip, \
float_sign_flip) \
do_stub(initial, double_sign_mask) \
do_arch_entry(x86, initial, double_sign_mask, double_sign_mask, \
double_sign_mask) \
do_stub(initial, double_sign_flip) \
do_arch_entry(x86, initial, double_sign_flip, double_sign_flip, \
double_sign_flip) \
) \
NOT_LP64( \
do_stub(initial, verify_fpu_cntrl_word) \
do_arch_entry(x86, initial, verify_fpu_cntrl_word, \
verify_fpu_cntrl_wrd_entry, \
verify_fpu_cntrl_wrd_entry) \
do_stub(initial, d2i_wrapper) \
do_arch_entry(x86, initial, d2i_wrapper, d2i_wrapper, \
d2i_wrapper) \
do_stub(initial, d2l_wrapper) \
do_arch_entry(x86, initial, d2l_wrapper, d2l_wrapper, \
d2l_wrapper) \
) \
#define STUBGEN_CONTINUATION_BLOBS_ARCH_DO(do_stub, \
do_arch_blob, \
do_arch_entry, \
do_arch_entry_init) \
do_arch_blob(continuation, 1000 LP64_ONLY(+2000)) \
#define STUBGEN_COMPILER_BLOBS_ARCH_DO(do_stub, \
do_arch_blob, \
do_arch_entry, \
do_arch_entry_init) \
do_arch_blob(compiler, 20000 LP64_ONLY(+60000) WINDOWS_ONLY(+2000)) \
do_stub(compiler, vector_float_sign_mask) \
do_arch_entry(x86, compiler, vector_float_sign_mask, \
vector_float_sign_mask, vector_float_sign_mask) \
do_stub(compiler, vector_float_sign_flip) \
do_arch_entry(x86, compiler, vector_float_sign_flip, \
vector_float_sign_flip, vector_float_sign_flip) \
do_stub(compiler, vector_double_sign_mask) \
do_arch_entry(x86, compiler, vector_double_sign_mask, \
vector_double_sign_mask, vector_double_sign_mask) \
do_stub(compiler, vector_double_sign_flip) \
do_arch_entry(x86, compiler, vector_double_sign_flip, \
vector_double_sign_flip, vector_double_sign_flip) \
do_stub(compiler, vector_all_bits_set) \
do_arch_entry(x86, compiler, vector_all_bits_set, \
vector_all_bits_set, vector_all_bits_set) \
do_stub(compiler, vector_int_mask_cmp_bits) \
do_arch_entry(x86, compiler, vector_int_mask_cmp_bits, \
vector_int_mask_cmp_bits, vector_int_mask_cmp_bits) \
do_stub(compiler, vector_short_to_byte_mask) \
do_arch_entry(x86, compiler, vector_short_to_byte_mask, \
vector_short_to_byte_mask, vector_short_to_byte_mask) \
do_stub(compiler, vector_byte_perm_mask) \
do_arch_entry(x86, compiler,vector_byte_perm_mask, \
vector_byte_perm_mask, vector_byte_perm_mask) \
do_stub(compiler, vector_int_to_byte_mask) \
do_arch_entry(x86, compiler, vector_int_to_byte_mask, \
vector_int_to_byte_mask, vector_int_to_byte_mask) \
do_stub(compiler, vector_int_to_short_mask) \
do_arch_entry(x86, compiler, vector_int_to_short_mask, \
vector_int_to_short_mask, vector_int_to_short_mask) \
do_stub(compiler, vector_32_bit_mask) \
do_arch_entry(x86, compiler, vector_32_bit_mask, \
vector_32_bit_mask, vector_32_bit_mask) \
do_stub(compiler, vector_64_bit_mask) \
do_arch_entry(x86, compiler, vector_64_bit_mask, \
vector_64_bit_mask, vector_64_bit_mask) \
do_stub(compiler, vector_byte_shuffle_mask) \
do_arch_entry(x86, compiler, vector_int_shuffle_mask, \
vector_byte_shuffle_mask, vector_byte_shuffle_mask) \
do_stub(compiler, vector_short_shuffle_mask) \
do_arch_entry(x86, compiler, vector_int_shuffle_mask, \
vector_short_shuffle_mask, vector_short_shuffle_mask) \
do_stub(compiler, vector_int_shuffle_mask) \
do_arch_entry(x86, compiler, vector_int_shuffle_mask, \
vector_int_shuffle_mask, vector_int_shuffle_mask) \
do_stub(compiler, vector_long_shuffle_mask) \
do_arch_entry(x86, compiler, vector_long_shuffle_mask, \
vector_long_shuffle_mask, vector_long_shuffle_mask) \
do_stub(compiler, vector_long_sign_mask) \
do_arch_entry(x86, compiler, vector_long_sign_mask, \
vector_long_sign_mask, vector_long_sign_mask) \
do_stub(compiler, vector_iota_indices) \
do_arch_entry(x86, compiler, vector_iota_indices, \
vector_iota_indices, vector_iota_indices) \
do_stub(compiler, vector_count_leading_zeros_lut) \
do_arch_entry(x86, compiler, vector_count_leading_zeros_lut, \
vector_count_leading_zeros_lut, \
vector_count_leading_zeros_lut) \
do_stub(compiler, vector_reverse_bit_lut) \
do_arch_entry(x86, compiler, vector_reverse_bit_lut, \
vector_reverse_bit_lut, vector_reverse_bit_lut) \
do_stub(compiler, vector_reverse_byte_perm_mask_short) \
do_arch_entry(x86, compiler, vector_reverse_byte_perm_mask_short, \
vector_reverse_byte_perm_mask_short, \
vector_reverse_byte_perm_mask_short) \
do_stub(compiler, vector_reverse_byte_perm_mask_int) \
do_arch_entry(x86, compiler, vector_reverse_byte_perm_mask_int, \
vector_reverse_byte_perm_mask_int, \
vector_reverse_byte_perm_mask_int) \
do_stub(compiler, vector_reverse_byte_perm_mask_long) \
do_arch_entry(x86, compiler, vector_reverse_byte_perm_mask_long, \
vector_reverse_byte_perm_mask_long, \
vector_reverse_byte_perm_mask_long) \
do_stub(compiler, vector_popcount_lut) \
do_arch_entry(x86, compiler, vector_popcount_lut, \
vector_popcount_lut, vector_popcount_lut) \
do_stub(compiler, upper_word_mask) \
do_arch_entry(x86, compiler, upper_word_mask, upper_word_mask_addr, \
upper_word_mask_addr) \
do_stub(compiler, shuffle_byte_flip_mask) \
do_arch_entry(x86, compiler, shuffle_byte_flip_mask, \
shuffle_byte_flip_mask_addr, \
shuffle_byte_flip_mask_addr) \
do_stub(compiler, pshuffle_byte_flip_mask) \
do_arch_entry(x86, compiler, pshuffle_byte_flip_mask, \
pshuffle_byte_flip_mask_addr, \
pshuffle_byte_flip_mask_addr) \
LP64_ONLY( \
/* x86_64 exposes these 3 stubs via a generic entry array */ \
/* oher arches use arch-specific entries */ \
/* this really needs rationalising */ \
do_stub(compiler, string_indexof_linear_ll) \
do_stub(compiler, string_indexof_linear_uu) \
do_stub(compiler, string_indexof_linear_ul) \
do_stub(compiler, pshuffle_byte_flip_mask_sha512) \
do_arch_entry(x86, compiler, pshuffle_byte_flip_mask_sha512, \
pshuffle_byte_flip_mask_addr_sha512, \
pshuffle_byte_flip_mask_addr_sha512) \
do_stub(compiler, compress_perm_table32) \
do_arch_entry(x86, compiler, compress_perm_table32, \
compress_perm_table32, compress_perm_table32) \
do_stub(compiler, compress_perm_table64) \
do_arch_entry(x86, compiler, compress_perm_table64, \
compress_perm_table64, compress_perm_table64) \
do_stub(compiler, expand_perm_table32) \
do_arch_entry(x86, compiler, expand_perm_table32, \
expand_perm_table32, expand_perm_table32) \
do_stub(compiler, expand_perm_table64) \
do_arch_entry(x86, compiler, expand_perm_table64, \
expand_perm_table64, expand_perm_table64) \
do_stub(compiler, avx2_shuffle_base64) \
do_arch_entry(x86, compiler, avx2_shuffle_base64, \
avx2_shuffle_base64, base64_avx2_shuffle_addr) \
do_stub(compiler, avx2_input_mask_base64) \
do_arch_entry(x86, compiler, avx2_input_mask_base64, \
avx2_input_mask_base64, \
base64_avx2_input_mask_addr) \
do_stub(compiler, avx2_lut_base64) \
do_arch_entry(x86, compiler, avx2_lut_base64, \
avx2_lut_base64, base64_avx2_lut_addr) \
do_stub(compiler, avx2_decode_tables_base64) \
do_arch_entry(x86, compiler, avx2_decode_tables_base64, \
avx2_decode_tables_base64, \
base64_AVX2_decode_tables_addr) \
do_stub(compiler, avx2_decode_lut_tables_base64) \
do_arch_entry(x86, compiler, avx2_decode_lut_tables_base64, \
avx2_decode_lut_tables_base64, \
base64_AVX2_decode_LUT_tables_addr) \
do_stub(compiler, shuffle_base64) \
do_arch_entry(x86, compiler, shuffle_base64, shuffle_base64, \
base64_shuffle_addr) \
do_stub(compiler, lookup_lo_base64) \
do_arch_entry(x86, compiler, lookup_lo_base64, lookup_lo_base64, \
base64_vbmi_lookup_lo_addr) \
do_stub(compiler, lookup_hi_base64) \
do_arch_entry(x86, compiler, lookup_hi_base64, lookup_hi_base64, \
base64_vbmi_lookup_hi_addr) \
do_stub(compiler, lookup_lo_base64url) \
do_arch_entry(x86, compiler, lookup_lo_base64url, \
lookup_lo_base64url, \
base64_vbmi_lookup_lo_url_addr) \
do_stub(compiler, lookup_hi_base64url) \
do_arch_entry(x86, compiler, lookup_hi_base64url, \
lookup_hi_base64url, \
base64_vbmi_lookup_hi_url_addr) \
do_stub(compiler, pack_vec_base64) \
do_arch_entry(x86, compiler, pack_vec_base64, pack_vec_base64, \
base64_vbmi_pack_vec_addr) \
do_stub(compiler, join_0_1_base64) \
do_arch_entry(x86, compiler, join_0_1_base64, join_0_1_base64, \
base64_vbmi_join_0_1_addr) \
do_stub(compiler, join_1_2_base64) \
do_arch_entry(x86, compiler, join_1_2_base64, join_1_2_base64, \
base64_vbmi_join_1_2_addr) \
do_stub(compiler, join_2_3_base64) \
do_arch_entry(x86, compiler, join_2_3_base64, join_2_3_base64, \
base64_vbmi_join_2_3_addr) \
do_stub(compiler, encoding_table_base64) \
do_arch_entry(x86, compiler, encoding_table_base64, \
encoding_table_base64, base64_encoding_table_addr) \
do_stub(compiler, decoding_table_base64) \
do_arch_entry(x86, compiler, decoding_table_base64, \
decoding_table_base64, base64_decoding_table_addr) \
) \
#define STUBGEN_FINAL_BLOBS_ARCH_DO(do_stub, \
do_arch_blob, \
do_arch_entry, \
do_arch_entry_init) \
do_arch_blob(final, 11000 LP64_ONLY(+20000) \
WINDOWS_ONLY(+22000) ZGC_ONLY(+20000)) \
#endif // CPU_X86_STUBDECLARATIONS_HPP

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2025, 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,6 +28,7 @@
#include "code/codeBlob.hpp"
#include "runtime/continuation.hpp"
#include "runtime/stubCodeGenerator.hpp"
#include "runtime/stubRoutines.hpp"
// Stub Code definitions
@@ -87,29 +88,29 @@ class StubGenerator: public StubCodeGenerator {
address generate_d2i_fixup();
address generate_d2l_fixup();
address generate_count_leading_zeros_lut(const char *stub_name);
address generate_popcount_avx_lut(const char *stub_name);
address generate_iota_indices(const char *stub_name);
address generate_vector_reverse_bit_lut(const char *stub_name);
address generate_count_leading_zeros_lut();
address generate_popcount_avx_lut();
address generate_iota_indices();
address generate_vector_reverse_bit_lut();
address generate_vector_reverse_byte_perm_mask_long(const char *stub_name);
address generate_vector_reverse_byte_perm_mask_int(const char *stub_name);
address generate_vector_reverse_byte_perm_mask_short(const char *stub_name);
address generate_vector_byte_shuffle_mask(const char *stub_name);
address generate_vector_reverse_byte_perm_mask_long();
address generate_vector_reverse_byte_perm_mask_int();
address generate_vector_reverse_byte_perm_mask_short();
address generate_vector_byte_shuffle_mask();
address generate_fp_mask(const char *stub_name, int64_t mask);
address generate_fp_mask(StubGenStubId stub_id, int64_t mask);
address generate_compress_perm_table(const char *stub_name, int32_t esize);
address generate_compress_perm_table(StubGenStubId stub_id);
address generate_expand_perm_table(const char *stub_name, int32_t esize);
address generate_expand_perm_table(StubGenStubId stub_id);
address generate_vector_mask(const char *stub_name, int64_t mask);
address generate_vector_mask(StubGenStubId stub_id, int64_t mask);
address generate_vector_byte_perm_mask(const char *stub_name);
address generate_vector_byte_perm_mask();
address generate_vector_fp_mask(const char *stub_name, int64_t mask);
address generate_vector_fp_mask(StubGenStubId stub_id, int64_t mask);
address generate_vector_custom_i32(const char *stub_name, Assembler::AvxVectorLen len,
address generate_vector_custom_i32(StubGenStubId stub_id, Assembler::AvxVectorLen len,
int32_t val0, int32_t val1, int32_t val2, int32_t val3,
int32_t val4 = 0, int32_t val5 = 0, int32_t val6 = 0, int32_t val7 = 0,
int32_t val8 = 0, int32_t val9 = 0, int32_t val10 = 0, int32_t val11 = 0,
@@ -179,12 +180,10 @@ class StubGenerator: public StubCodeGenerator {
// - If user sets AVX3Threshold=0, then special cases for small blocks sizes operate over
// 64 byte vector registers (ZMMs).
address generate_disjoint_copy_avx3_masked(address* entry, const char *name, int shift,
bool aligned, bool is_oop, bool dest_uninitialized);
address generate_disjoint_copy_avx3_masked(StubGenStubId stub_id, address* entry);
address generate_conjoint_copy_avx3_masked(address* entry, const char *name, int shift,
address nooverlap_target, bool aligned, bool is_oop,
bool dest_uninitialized);
address generate_conjoint_copy_avx3_masked(StubGenStubId stub_id, address* entry,
address nooverlap_target);
void arraycopy_avx3_special_cases(XMMRegister xmm, KRegister mask, Register from,
Register to, Register count, int shift,
@@ -225,27 +224,21 @@ class StubGenerator: public StubCodeGenerator {
Register temp, int shift = Address::times_1, int offset = 0);
#endif // COMPILER2_OR_JVMCI
address generate_disjoint_byte_copy(bool aligned, address* entry, const char *name);
address generate_disjoint_byte_copy(address* entry);
address generate_conjoint_byte_copy(bool aligned, address nooverlap_target,
address* entry, const char *name);
address generate_conjoint_byte_copy(address nooverlap_target, address* entry);
address generate_disjoint_short_copy(bool aligned, address *entry, const char *name);
address generate_disjoint_short_copy(address *entry);
address generate_fill(BasicType t, bool aligned, const char *name);
address generate_fill(StubGenStubId stub_id);
address generate_conjoint_short_copy(bool aligned, address nooverlap_target,
address *entry, const char *name);
address generate_disjoint_int_oop_copy(bool aligned, bool is_oop, address* entry,
const char *name, bool dest_uninitialized = false);
address generate_conjoint_int_oop_copy(bool aligned, bool is_oop, address nooverlap_target,
address *entry, const char *name,
bool dest_uninitialized = false);
address generate_disjoint_long_oop_copy(bool aligned, bool is_oop, address *entry,
const char *name, bool dest_uninitialized = false);
address generate_conjoint_long_oop_copy(bool aligned, bool is_oop,
address nooverlap_target, address *entry,
const char *name, bool dest_uninitialized = false);
address generate_conjoint_short_copy(address nooverlap_target, address *entry);
address generate_disjoint_int_oop_copy(StubGenStubId stub_id, address* entry);
address generate_conjoint_int_oop_copy(StubGenStubId stub_id, address nooverlap_target,
address *entry);
address generate_disjoint_long_oop_copy(StubGenStubId stub_id, address* entry);
address generate_conjoint_long_oop_copy(StubGenStubId stub_id, address nooverlap_target,
address *entry);
// Helper for generating a dynamic type check.
// Smashes no registers.
@@ -255,8 +248,7 @@ class StubGenerator: public StubCodeGenerator {
Label& L_success);
// Generate checkcasting array copy stub
address generate_checkcast_copy(const char *name, address *entry,
bool dest_uninitialized = false);
address generate_checkcast_copy(StubGenStubId stub_id, address *entry);
// Generate 'unsafe' array copy stub
// Though just as safe as the other stubs, it takes an unscaled
@@ -264,8 +256,7 @@ class StubGenerator: public StubCodeGenerator {
//
// Examines the alignment of the operands and dispatches
// to a long, int, short, or byte copy loop.
address generate_unsafe_copy(const char *name,
address byte_copy_entry, address short_copy_entry,
address generate_unsafe_copy(address byte_copy_entry, address short_copy_entry,
address int_copy_entry, address long_copy_entry);
// Generate 'unsafe' set memory stub
@@ -274,7 +265,7 @@ class StubGenerator: public StubCodeGenerator {
//
// Examines the alignment of the operands and dispatches
// to an int, short, or byte copy loop.
address generate_unsafe_setmemory(const char *name, address byte_copy_entry);
address generate_unsafe_setmemory(address byte_copy_entry);
// Perform range checks on the proposed arraycopy.
// Kills temp, but nothing else.
@@ -288,8 +279,7 @@ class StubGenerator: public StubCodeGenerator {
Label& L_failed);
// Generate generic array copy stubs
address generate_generic_copy(const char *name,
address byte_copy_entry, address short_copy_entry,
address generate_generic_copy(address byte_copy_entry, address short_copy_entry,
address int_copy_entry, address oop_copy_entry,
address long_copy_entry, address checkcast_copy_entry);
@@ -304,19 +294,19 @@ class StubGenerator: public StubCodeGenerator {
// ofs and limit are use for multi-block byte array.
// int com.sun.security.provider.MD5.implCompress(byte[] b, int ofs)
address generate_md5_implCompress(bool multi_block, const char *name);
address generate_md5_implCompress(StubGenStubId stub_id);
// SHA stubs
// ofs and limit are use for multi-block byte array.
// int com.sun.security.provider.DigestBase.implCompressMultiBlock(byte[] b, int ofs, int limit)
address generate_sha1_implCompress(bool multi_block, const char *name);
address generate_sha1_implCompress(StubGenStubId stub_id);
// ofs and limit are use for multi-block byte array.
// int com.sun.security.provider.DigestBase.implCompressMultiBlock(byte[] b, int ofs, int limit)
address generate_sha256_implCompress(bool multi_block, const char *name);
address generate_sha512_implCompress(bool multi_block, const char *name);
address generate_sha256_implCompress(StubGenStubId stub_id);
address generate_sha512_implCompress(StubGenStubId stub_id);
// Mask for byte-swapping a couple of qwords in an XMM register using (v)pshufb.
address generate_pshuffle_byte_flip_mask_sha512();
@@ -499,7 +489,7 @@ class StubGenerator: public StubCodeGenerator {
// SHA3 stubs
void generate_sha3_stubs();
address generate_sha3_implCompress(bool multiBlock, const char *name);
address generate_sha3_implCompress(StubGenStubId stub_id);
// BASE64 stubs
@@ -595,7 +585,7 @@ class StubGenerator: public StubCodeGenerator {
void generate_string_indexof(address *fnptrs);
#endif
address generate_cont_thaw(const char* label, Continuation::thaw_kind kind);
address generate_cont_thaw(StubGenStubId stub_id);
address generate_cont_thaw();
// TODO: will probably need multiple return barriers depending on return type
@@ -604,6 +594,8 @@ class StubGenerator: public StubCodeGenerator {
address generate_cont_preempt_stub();
// TODO -- delete this as it is not implemented?
//
// Continuation point for throwing of implicit exceptions that are
// not handled in the current activation. Fabricates an exception
// oop and initiates normal exception dispatching in this
@@ -629,7 +621,7 @@ class StubGenerator: public StubCodeGenerator {
address generate_upcall_stub_load_target();
// Specialized stub implementations for UseSecondarySupersTable.
address generate_lookup_secondary_supers_table_stub(u1 super_klass_index);
void generate_lookup_secondary_supers_table_stub();
// Slow path implementation for UseSecondarySupersTable.
address generate_lookup_secondary_supers_table_slow_path_stub();
@@ -642,8 +634,8 @@ class StubGenerator: public StubCodeGenerator {
void generate_compiler_stubs();
void generate_final_stubs();
public:
StubGenerator(CodeBuffer* code, StubsKind kind);
public:
StubGenerator(CodeBuffer* code, StubGenBlobId blob_id);
};
#endif // CPU_X86_STUBGENERATOR_X86_64_HPP

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021, 2023, Intel Corporation. All rights reserved.
* Copyright (c) 2021, 2024, Intel Corporation. All rights reserved.
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -66,7 +66,8 @@ address StubGenerator::generate_updateBytesAdler32() {
assert(UseAdler32Intrinsics, "");
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", "updateBytesAdler32");
StubGenStubId stub_id = StubGenStubId::updateBytesAdler32_id;
StubCodeMark mark(this, stub_id);
address start = __ pc();
// Choose an appropriate LIMIT for inner loop based on the granularity

View File

@@ -249,7 +249,8 @@ void StubGenerator::generate_aes_stubs() {
// rax - number of processed bytes
address StubGenerator::generate_galoisCounterMode_AESCrypt() {
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", "galoisCounterMode_AESCrypt");
StubGenStubId stub_id = StubGenStubId::galoisCounterMode_AESCrypt_id;
StubCodeMark mark(this, stub_id);
address start = __ pc();
const Register in = c_rarg0;
@@ -335,7 +336,8 @@ address StubGenerator::generate_galoisCounterMode_AESCrypt() {
// rax - number of processed bytes
address StubGenerator::generate_avx2_galoisCounterMode_AESCrypt() {
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", "galoisCounterMode_AESCrypt");
StubGenStubId stub_id = StubGenStubId::galoisCounterMode_AESCrypt_id;
StubCodeMark mark(this, stub_id);
address start = __ pc();
const Register in = c_rarg0;
@@ -406,7 +408,8 @@ address StubGenerator::generate_avx2_galoisCounterMode_AESCrypt() {
// Vector AES Counter implementation
address StubGenerator::generate_counterMode_VectorAESCrypt() {
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", "counterMode_AESCrypt");
StubGenStubId stub_id = StubGenStubId::counterMode_AESCrypt_id;
StubCodeMark mark(this, stub_id);
address start = __ pc();
const Register from = c_rarg0; // source array address
@@ -494,7 +497,8 @@ address StubGenerator::generate_counterMode_VectorAESCrypt() {
address StubGenerator::generate_counterMode_AESCrypt_Parallel() {
assert(UseAES, "need AES instructions and misaligned SSE support");
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", "counterMode_AESCrypt");
StubGenStubId stub_id = StubGenStubId::counterMode_AESCrypt_id;
StubCodeMark mark(this, stub_id);
address start = __ pc();
const Register from = c_rarg0; // source array address
@@ -781,7 +785,8 @@ address StubGenerator::generate_counterMode_AESCrypt_Parallel() {
address StubGenerator::generate_cipherBlockChaining_decryptVectorAESCrypt() {
assert(VM_Version::supports_avx512_vaes(), "need AES instructions and misaligned SSE support");
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", "cipherBlockChaining_decryptAESCrypt");
StubGenStubId stub_id = StubGenStubId::cipherBlockChaining_decryptAESCrypt_id;
StubCodeMark mark(this, stub_id);
address start = __ pc();
const Register from = c_rarg0; // source array address
@@ -1063,7 +1068,8 @@ address StubGenerator::generate_cipherBlockChaining_decryptVectorAESCrypt() {
address StubGenerator::generate_aescrypt_encryptBlock() {
assert(UseAES, "need AES instructions and misaligned SSE support");
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", "aescrypt_encryptBlock");
StubGenStubId stub_id = StubGenStubId::aescrypt_encryptBlock_id;
StubCodeMark mark(this, stub_id);
Label L_doLast;
address start = __ pc();
@@ -1157,7 +1163,8 @@ address StubGenerator::generate_aescrypt_encryptBlock() {
address StubGenerator::generate_aescrypt_decryptBlock() {
assert(UseAES, "need AES instructions and misaligned SSE support");
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", "aescrypt_decryptBlock");
StubGenStubId stub_id = StubGenStubId::aescrypt_decryptBlock_id;
StubCodeMark mark(this, stub_id);
Label L_doLast;
address start = __ pc();
@@ -1258,7 +1265,8 @@ address StubGenerator::generate_aescrypt_decryptBlock() {
address StubGenerator::generate_cipherBlockChaining_encryptAESCrypt() {
assert(UseAES, "need AES instructions and misaligned SSE support");
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", "cipherBlockChaining_encryptAESCrypt");
StubGenStubId stub_id = StubGenStubId::cipherBlockChaining_encryptAESCrypt_id;
StubCodeMark mark(this, stub_id);
address start = __ pc();
Label L_exit, L_key_192_256, L_key_256, L_loopTop_128, L_loopTop_192, L_loopTop_256;
@@ -1409,7 +1417,8 @@ address StubGenerator::generate_cipherBlockChaining_encryptAESCrypt() {
address StubGenerator::generate_cipherBlockChaining_decryptAESCrypt_Parallel() {
assert(UseAES, "need AES instructions and misaligned SSE support");
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", "cipherBlockChaining_decryptAESCrypt");
StubGenStubId stub_id = StubGenStubId::cipherBlockChaining_decryptAESCrypt_id;
StubCodeMark mark(this, stub_id);
address start = __ pc();
const Register from = c_rarg0; // source array address
@@ -1651,7 +1660,8 @@ __ opc(xmm_result3, src_reg); \
address StubGenerator::generate_electronicCodeBook_encryptAESCrypt() {
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", "electronicCodeBook_encryptAESCrypt");
StubGenStubId stub_id = StubGenStubId::electronicCodeBook_encryptAESCrypt_id;
StubCodeMark mark(this, stub_id);
address start = __ pc();
const Register from = c_rarg0; // source array address
@@ -1671,7 +1681,8 @@ address StubGenerator::generate_electronicCodeBook_encryptAESCrypt() {
address StubGenerator::generate_electronicCodeBook_decryptAESCrypt() {
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", "electronicCodeBook_decryptAESCrypt");
StubGenStubId stub_id = StubGenStubId::electronicCodeBook_decryptAESCrypt_id;
StubCodeMark mark(this, stub_id);
address start = __ pc();
const Register from = c_rarg0; // source array address

View File

@@ -84,74 +84,51 @@ void StubGenerator::generate_arraycopy_stubs() {
address entry_jlong_arraycopy;
address entry_checkcast_arraycopy;
StubRoutines::_jbyte_disjoint_arraycopy = generate_disjoint_byte_copy(false, &entry,
"jbyte_disjoint_arraycopy");
StubRoutines::_jbyte_arraycopy = generate_conjoint_byte_copy(false, entry, &entry_jbyte_arraycopy,
"jbyte_arraycopy");
StubRoutines::_jbyte_disjoint_arraycopy = generate_disjoint_byte_copy(&entry);
StubRoutines::_jbyte_arraycopy = generate_conjoint_byte_copy(entry, &entry_jbyte_arraycopy);
StubRoutines::_jshort_disjoint_arraycopy = generate_disjoint_short_copy(false, &entry,
"jshort_disjoint_arraycopy");
StubRoutines::_jshort_arraycopy = generate_conjoint_short_copy(false, entry, &entry_jshort_arraycopy,
"jshort_arraycopy");
StubRoutines::_jshort_disjoint_arraycopy = generate_disjoint_short_copy(&entry);
StubRoutines::_jshort_arraycopy = generate_conjoint_short_copy(entry, &entry_jshort_arraycopy);
StubRoutines::_jint_disjoint_arraycopy = generate_disjoint_int_oop_copy(false, false, &entry,
"jint_disjoint_arraycopy");
StubRoutines::_jint_arraycopy = generate_conjoint_int_oop_copy(false, false, entry,
&entry_jint_arraycopy, "jint_arraycopy");
StubRoutines::_jint_disjoint_arraycopy = generate_disjoint_int_oop_copy(StubGenStubId::jint_disjoint_arraycopy_id, &entry);
StubRoutines::_jint_arraycopy = generate_conjoint_int_oop_copy(StubGenStubId::jint_arraycopy_id, entry, &entry_jint_arraycopy);
StubRoutines::_jlong_disjoint_arraycopy = generate_disjoint_long_oop_copy(false, false, &entry,
"jlong_disjoint_arraycopy");
StubRoutines::_jlong_arraycopy = generate_conjoint_long_oop_copy(false, false, entry,
&entry_jlong_arraycopy, "jlong_arraycopy");
StubRoutines::_jlong_disjoint_arraycopy = generate_disjoint_long_oop_copy(StubGenStubId::jlong_disjoint_arraycopy_id, &entry);
StubRoutines::_jlong_arraycopy = generate_conjoint_long_oop_copy(StubGenStubId::jlong_arraycopy_id, entry, &entry_jlong_arraycopy);
if (UseCompressedOops) {
StubRoutines::_oop_disjoint_arraycopy = generate_disjoint_int_oop_copy(false, true, &entry,
"oop_disjoint_arraycopy");
StubRoutines::_oop_arraycopy = generate_conjoint_int_oop_copy(false, true, entry,
&entry_oop_arraycopy, "oop_arraycopy");
StubRoutines::_oop_disjoint_arraycopy_uninit = generate_disjoint_int_oop_copy(false, true, &entry,
"oop_disjoint_arraycopy_uninit",
/*dest_uninitialized*/true);
StubRoutines::_oop_arraycopy_uninit = generate_conjoint_int_oop_copy(false, true, entry,
nullptr, "oop_arraycopy_uninit",
/*dest_uninitialized*/true);
StubRoutines::_oop_disjoint_arraycopy = generate_disjoint_int_oop_copy(StubGenStubId::oop_disjoint_arraycopy_id, &entry);
StubRoutines::_oop_arraycopy = generate_conjoint_int_oop_copy(StubGenStubId::oop_arraycopy_id, entry, &entry_oop_arraycopy);
StubRoutines::_oop_disjoint_arraycopy_uninit = generate_disjoint_int_oop_copy(StubGenStubId::oop_disjoint_arraycopy_uninit_id, &entry);
StubRoutines::_oop_arraycopy_uninit = generate_conjoint_int_oop_copy(StubGenStubId::oop_arraycopy_uninit_id, entry, nullptr);
} else {
StubRoutines::_oop_disjoint_arraycopy = generate_disjoint_long_oop_copy(false, true, &entry,
"oop_disjoint_arraycopy");
StubRoutines::_oop_arraycopy = generate_conjoint_long_oop_copy(false, true, entry,
&entry_oop_arraycopy, "oop_arraycopy");
StubRoutines::_oop_disjoint_arraycopy_uninit = generate_disjoint_long_oop_copy(false, true, &entry,
"oop_disjoint_arraycopy_uninit",
/*dest_uninitialized*/true);
StubRoutines::_oop_arraycopy_uninit = generate_conjoint_long_oop_copy(false, true, entry,
nullptr, "oop_arraycopy_uninit",
/*dest_uninitialized*/true);
StubRoutines::_oop_disjoint_arraycopy = generate_disjoint_long_oop_copy(StubGenStubId::oop_disjoint_arraycopy_id, &entry);
StubRoutines::_oop_arraycopy = generate_conjoint_long_oop_copy(StubGenStubId::oop_arraycopy_id, entry, &entry_oop_arraycopy);
StubRoutines::_oop_disjoint_arraycopy_uninit = generate_disjoint_long_oop_copy(StubGenStubId::oop_disjoint_arraycopy_uninit_id, &entry);
StubRoutines::_oop_arraycopy_uninit = generate_conjoint_long_oop_copy(StubGenStubId::oop_arraycopy_uninit_id, entry, nullptr);
}
StubRoutines::_checkcast_arraycopy = generate_checkcast_copy("checkcast_arraycopy", &entry_checkcast_arraycopy);
StubRoutines::_checkcast_arraycopy_uninit = generate_checkcast_copy("checkcast_arraycopy_uninit", nullptr,
/*dest_uninitialized*/true);
StubRoutines::_checkcast_arraycopy = generate_checkcast_copy(StubGenStubId::checkcast_arraycopy_id, &entry_checkcast_arraycopy);
StubRoutines::_checkcast_arraycopy_uninit = generate_checkcast_copy(StubGenStubId::checkcast_arraycopy_uninit_id, nullptr);
StubRoutines::_unsafe_arraycopy = generate_unsafe_copy("unsafe_arraycopy",
entry_jbyte_arraycopy,
StubRoutines::_unsafe_arraycopy = generate_unsafe_copy(entry_jbyte_arraycopy,
entry_jshort_arraycopy,
entry_jint_arraycopy,
entry_jlong_arraycopy);
StubRoutines::_generic_arraycopy = generate_generic_copy("generic_arraycopy",
entry_jbyte_arraycopy,
StubRoutines::_generic_arraycopy = generate_generic_copy(entry_jbyte_arraycopy,
entry_jshort_arraycopy,
entry_jint_arraycopy,
entry_oop_arraycopy,
entry_jlong_arraycopy,
entry_checkcast_arraycopy);
StubRoutines::_jbyte_fill = generate_fill(T_BYTE, false, "jbyte_fill");
StubRoutines::_jshort_fill = generate_fill(T_SHORT, false, "jshort_fill");
StubRoutines::_jint_fill = generate_fill(T_INT, false, "jint_fill");
StubRoutines::_arrayof_jbyte_fill = generate_fill(T_BYTE, true, "arrayof_jbyte_fill");
StubRoutines::_arrayof_jshort_fill = generate_fill(T_SHORT, true, "arrayof_jshort_fill");
StubRoutines::_arrayof_jint_fill = generate_fill(T_INT, true, "arrayof_jint_fill");
StubRoutines::_jbyte_fill = generate_fill(StubGenStubId::jbyte_fill_id);
StubRoutines::_jshort_fill = generate_fill(StubGenStubId::jshort_fill_id);
StubRoutines::_jint_fill = generate_fill(StubGenStubId::jint_fill_id);
StubRoutines::_arrayof_jbyte_fill = generate_fill(StubGenStubId::arrayof_jbyte_fill_id);
StubRoutines::_arrayof_jshort_fill = generate_fill(StubGenStubId::arrayof_jshort_fill_id);
StubRoutines::_arrayof_jint_fill = generate_fill(StubGenStubId::arrayof_jint_fill_id);
StubRoutines::_unsafe_setmemory = generate_unsafe_setmemory("unsafe_setmemory", StubRoutines::_jbyte_fill);
StubRoutines::_unsafe_setmemory = generate_unsafe_setmemory(StubRoutines::_jbyte_fill);
// We don't generate specialized code for HeapWord-aligned source
// arrays, so just use the code we've already generated
@@ -507,11 +484,50 @@ void StubGenerator::copy_bytes_backward(Register from, Register dest,
// disjoint_copy_avx3_masked is set to the no-overlap entry point
// used by generate_conjoint_[byte/int/short/long]_copy().
//
address StubGenerator::generate_disjoint_copy_avx3_masked(address* entry, const char *name,
int shift, bool aligned, bool is_oop,
bool dest_uninitialized) {
address StubGenerator::generate_disjoint_copy_avx3_masked(StubGenStubId stub_id, address* entry) {
// aligned is always false -- x86_64 always uses the unaligned code
const bool aligned = false;
int shift;
bool is_oop;
bool dest_uninitialized;
switch (stub_id) {
case jbyte_disjoint_arraycopy_id:
shift = 0;
is_oop = false;
dest_uninitialized = false;
break;
case jshort_disjoint_arraycopy_id:
shift = 1;
is_oop = false;
dest_uninitialized = false;
break;
case jint_disjoint_arraycopy_id:
shift = 2;
is_oop = false;
dest_uninitialized = false;
break;
case jlong_disjoint_arraycopy_id:
shift = 3;
is_oop = false;
dest_uninitialized = false;
break;
case oop_disjoint_arraycopy_id:
shift = (UseCompressedOops ? 2 : 3);
is_oop = true;
dest_uninitialized = false;
break;
case oop_disjoint_arraycopy_uninit_id:
shift = (UseCompressedOops ? 2 : 3);
is_oop = true;
dest_uninitialized = true;
break;
default:
ShouldNotReachHere();
}
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", name);
StubCodeMark mark(this, stub_id);
address start = __ pc();
int avx3threshold = VM_Version::avx3_threshold();
@@ -806,11 +822,50 @@ void StubGenerator::arraycopy_avx3_large(Register to, Register from, Register te
// c_rarg2 - element count, treated as ssize_t, can be zero
//
//
address StubGenerator::generate_conjoint_copy_avx3_masked(address* entry, const char *name, int shift,
address nooverlap_target, bool aligned,
bool is_oop, bool dest_uninitialized) {
address StubGenerator::generate_conjoint_copy_avx3_masked(StubGenStubId stub_id, address* entry, address nooverlap_target) {
// aligned is always false -- x86_64 always uses the unaligned code
const bool aligned = false;
int shift;
bool is_oop;
bool dest_uninitialized;
switch (stub_id) {
case jbyte_arraycopy_id:
shift = 0;
is_oop = false;
dest_uninitialized = false;
break;
case jshort_arraycopy_id:
shift = 1;
is_oop = false;
dest_uninitialized = false;
break;
case jint_arraycopy_id:
shift = 2;
is_oop = false;
dest_uninitialized = false;
break;
case jlong_arraycopy_id:
shift = 3;
is_oop = false;
dest_uninitialized = false;
break;
case oop_arraycopy_id:
shift = (UseCompressedOops ? 2 : 3);
is_oop = true;
dest_uninitialized = false;
break;
case oop_arraycopy_uninit_id:
shift = (UseCompressedOops ? 2 : 3);
is_oop = true;
dest_uninitialized = true;
break;
default:
ShouldNotReachHere();
}
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", name);
StubCodeMark mark(this, stub_id);
address start = __ pc();
int avx3threshold = VM_Version::avx3_threshold();
@@ -1262,9 +1317,7 @@ void StubGenerator::copy64_avx(Register dst, Register src, Register index, XMMRe
// Arguments:
// aligned - true => Input and output aligned on a HeapWord == 8-byte boundary
// ignored
// name - stub name string
// entry - location for return of (post-push) entry
//
// Inputs:
// c_rarg0 - source array address
@@ -1277,18 +1330,20 @@ void StubGenerator::copy64_avx(Register dst, Register src, Register index, XMMRe
// and stored atomically.
//
// Side Effects:
// disjoint_byte_copy_entry is set to the no-overlap entry point
// entry is set to the no-overlap entry point
// used by generate_conjoint_byte_copy().
//
address StubGenerator::generate_disjoint_byte_copy(bool aligned, address* entry, const char *name) {
address StubGenerator::generate_disjoint_byte_copy(address* entry) {
StubGenStubId stub_id = StubGenStubId::jbyte_disjoint_arraycopy_id;
// aligned is always false -- x86_64 always uses the unaligned code
const bool aligned = false;
#if COMPILER2_OR_JVMCI
if (VM_Version::supports_avx512vlbw() && VM_Version::supports_bmi2() && MaxVectorSize >= 32) {
return generate_disjoint_copy_avx3_masked(entry, "jbyte_disjoint_arraycopy_avx3", 0,
aligned, false, false);
return generate_disjoint_copy_avx3_masked(stub_id, entry);
}
#endif
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", name);
StubCodeMark mark(this, stub_id);
address start = __ pc();
DecoratorSet decorators = IN_HEAP | IS_ARRAY | ARRAYCOPY_DISJOINT;
@@ -1383,9 +1438,8 @@ __ BIND(L_exit);
// Arguments:
// aligned - true => Input and output aligned on a HeapWord == 8-byte boundary
// ignored
// name - stub name string
// entry - location for return of (post-push) entry
// nooverlap_target - entry to branch to if no overlap detected
//
// Inputs:
// c_rarg0 - source array address
@@ -1397,16 +1451,17 @@ __ BIND(L_exit);
// dwords or qwords that span cache line boundaries will still be loaded
// and stored atomically.
//
address StubGenerator::generate_conjoint_byte_copy(bool aligned, address nooverlap_target,
address* entry, const char *name) {
address StubGenerator::generate_conjoint_byte_copy(address nooverlap_target, address* entry) {
StubGenStubId stub_id = StubGenStubId::jbyte_arraycopy_id;
// aligned is always false -- x86_64 always uses the unaligned code
const bool aligned = false;
#if COMPILER2_OR_JVMCI
if (VM_Version::supports_avx512vlbw() && VM_Version::supports_bmi2() && MaxVectorSize >= 32) {
return generate_conjoint_copy_avx3_masked(entry, "jbyte_conjoint_arraycopy_avx3", 0,
nooverlap_target, aligned, false, false);
return generate_conjoint_copy_avx3_masked(stub_id, entry, nooverlap_target);
}
#endif
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", name);
StubCodeMark mark(this, stub_id);
address start = __ pc();
DecoratorSet decorators = IN_HEAP | IS_ARRAY;
@@ -1493,9 +1548,7 @@ address StubGenerator::generate_conjoint_byte_copy(bool aligned, address nooverl
// Arguments:
// aligned - true => Input and output aligned on a HeapWord == 8-byte boundary
// ignored
// name - stub name string
// entry - location for return of (post-push) entry
//
// Inputs:
// c_rarg0 - source array address
@@ -1508,19 +1561,21 @@ address StubGenerator::generate_conjoint_byte_copy(bool aligned, address nooverl
// and stored atomically.
//
// Side Effects:
// disjoint_short_copy_entry is set to the no-overlap entry point
// entry is set to the no-overlap entry point
// used by generate_conjoint_short_copy().
//
address StubGenerator::generate_disjoint_short_copy(bool aligned, address *entry, const char *name) {
address StubGenerator::generate_disjoint_short_copy(address *entry) {
StubGenStubId stub_id = StubGenStubId::jshort_disjoint_arraycopy_id;
// aligned is always false -- x86_64 always uses the unaligned code
const bool aligned = false;
#if COMPILER2_OR_JVMCI
if (VM_Version::supports_avx512vlbw() && VM_Version::supports_bmi2() && MaxVectorSize >= 32) {
return generate_disjoint_copy_avx3_masked(entry, "jshort_disjoint_arraycopy_avx3", 1,
aligned, false, false);
return generate_disjoint_copy_avx3_masked(stub_id, entry);
}
#endif
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", name);
StubCodeMark mark(this, stub_id);
address start = __ pc();
DecoratorSet decorators = IN_HEAP | IS_ARRAY | ARRAYCOPY_DISJOINT;
@@ -1607,9 +1662,41 @@ __ BIND(L_exit);
}
address StubGenerator::generate_fill(BasicType t, bool aligned, const char *name) {
address StubGenerator::generate_fill(StubGenStubId stub_id) {
BasicType t;
bool aligned;
switch (stub_id) {
case jbyte_fill_id:
t = T_BYTE;
aligned = false;
break;
case jshort_fill_id:
t = T_SHORT;
aligned = false;
break;
case jint_fill_id:
t = T_INT;
aligned = false;
break;
case arrayof_jbyte_fill_id:
t = T_BYTE;
aligned = true;
break;
case arrayof_jshort_fill_id:
t = T_SHORT;
aligned = true;
break;
case arrayof_jint_fill_id:
t = T_INT;
aligned = true;
break;
default:
ShouldNotReachHere();
}
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", name);
StubCodeMark mark(this, stub_id);
address start = __ pc();
BLOCK_COMMENT("Entry:");
@@ -1636,9 +1723,8 @@ address StubGenerator::generate_fill(BasicType t, bool aligned, const char *name
// Arguments:
// aligned - true => Input and output aligned on a HeapWord == 8-byte boundary
// ignored
// name - stub name string
// entry - location for return of (post-push) entry
// nooverlap_target - entry to branch to if no overlap detected
//
// Inputs:
// c_rarg0 - source array address
@@ -1650,16 +1736,18 @@ address StubGenerator::generate_fill(BasicType t, bool aligned, const char *name
// or qwords that span cache line boundaries will still be loaded
// and stored atomically.
//
address StubGenerator::generate_conjoint_short_copy(bool aligned, address nooverlap_target,
address *entry, const char *name) {
address StubGenerator::generate_conjoint_short_copy(address nooverlap_target, address *entry) {
StubGenStubId stub_id = StubGenStubId::jshort_arraycopy_id;
// aligned is always false -- x86_64 always uses the unaligned code
const bool aligned = false;
#if COMPILER2_OR_JVMCI
if (VM_Version::supports_avx512vlbw() && VM_Version::supports_bmi2() && MaxVectorSize >= 32) {
return generate_conjoint_copy_avx3_masked(entry, "jshort_conjoint_arraycopy_avx3", 1,
nooverlap_target, aligned, false, false);
return generate_conjoint_copy_avx3_masked(stub_id, entry, nooverlap_target);
}
#endif
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", name);
StubCodeMark mark(this, stub_id);
address start = __ pc();
DecoratorSet decorators = IN_HEAP | IS_ARRAY;
@@ -1738,10 +1826,9 @@ address StubGenerator::generate_conjoint_short_copy(bool aligned, address noover
// Arguments:
// aligned - true => Input and output aligned on a HeapWord == 8-byte boundary
// ignored
// is_oop - true => oop array, so generate store check code
// name - stub name string
// stub_id - unqiue id for stub to generate
// entry - location for return of (post-push) entry
// is_oop - true => oop array, so generate store check code
//
// Inputs:
// c_rarg0 - source array address
@@ -1756,18 +1843,39 @@ address StubGenerator::generate_conjoint_short_copy(bool aligned, address noover
// disjoint_int_copy_entry is set to the no-overlap entry point
// used by generate_conjoint_int_oop_copy().
//
address StubGenerator::generate_disjoint_int_oop_copy(bool aligned, bool is_oop, address* entry,
const char *name, bool dest_uninitialized) {
address StubGenerator::generate_disjoint_int_oop_copy(StubGenStubId stub_id, address* entry) {
// aligned is always false -- x86_64 always uses the unaligned code
const bool aligned = false;
bool is_oop;
bool dest_uninitialized;
switch (stub_id) {
case StubGenStubId::jint_disjoint_arraycopy_id:
is_oop = false;
dest_uninitialized = false;
break;
case StubGenStubId::oop_disjoint_arraycopy_id:
assert(UseCompressedOops, "inconsistent oop copy size!");
is_oop = true;
dest_uninitialized = false;
break;
case StubGenStubId::oop_disjoint_arraycopy_uninit_id:
assert(UseCompressedOops, "inconsistent oop copy size!");
is_oop = true;
dest_uninitialized = true;
break;
default:
ShouldNotReachHere();
}
BarrierSetAssembler *bs = BarrierSet::barrier_set()->barrier_set_assembler();
#if COMPILER2_OR_JVMCI
if ((!is_oop || bs->supports_avx3_masked_arraycopy()) && VM_Version::supports_avx512vlbw() && VM_Version::supports_bmi2() && MaxVectorSize >= 32) {
return generate_disjoint_copy_avx3_masked(entry, "jint_disjoint_arraycopy_avx3", 2,
aligned, is_oop, dest_uninitialized);
return generate_disjoint_copy_avx3_masked(stub_id, entry);
}
#endif
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", name);
StubCodeMark mark(this, stub_id);
address start = __ pc();
Label L_copy_bytes, L_copy_8_bytes, L_copy_4_bytes, L_exit;
@@ -1853,10 +1961,9 @@ __ BIND(L_exit);
// Arguments:
// aligned - true => Input and output aligned on a HeapWord == 8-byte boundary
// ignored
// entry - location for return of (post-push) entry
// nooverlap_target - entry to branch to if no overlap detected
// is_oop - true => oop array, so generate store check code
// name - stub name string
//
// Inputs:
// c_rarg0 - source array address
@@ -1867,18 +1974,39 @@ __ BIND(L_exit);
// the hardware handle it. The two dwords within qwords that span
// cache line boundaries will still be loaded and stored atomically.
//
address StubGenerator::generate_conjoint_int_oop_copy(bool aligned, bool is_oop, address nooverlap_target,
address *entry, const char *name,
bool dest_uninitialized) {
address StubGenerator::generate_conjoint_int_oop_copy(StubGenStubId stub_id, address nooverlap_target, address *entry) {
// aligned is always false -- x86_64 always uses the unaligned code
const bool aligned = false;
bool is_oop;
bool dest_uninitialized;
switch (stub_id) {
case StubGenStubId::jint_arraycopy_id:
is_oop = false;
dest_uninitialized = false;
break;
case StubGenStubId::oop_arraycopy_id:
assert(UseCompressedOops, "inconsistent oop copy size!");
is_oop = true;
dest_uninitialized = false;
break;
case StubGenStubId::oop_arraycopy_uninit_id:
assert(UseCompressedOops, "inconsistent oop copy size!");
is_oop = true;
dest_uninitialized = true;
break;
default:
ShouldNotReachHere();
}
BarrierSetAssembler *bs = BarrierSet::barrier_set()->barrier_set_assembler();
#if COMPILER2_OR_JVMCI
if ((!is_oop || bs->supports_avx3_masked_arraycopy()) && VM_Version::supports_avx512vlbw() && VM_Version::supports_bmi2() && MaxVectorSize >= 32) {
return generate_conjoint_copy_avx3_masked(entry, "jint_conjoint_arraycopy_avx3", 2,
nooverlap_target, aligned, is_oop, dest_uninitialized);
return generate_conjoint_copy_avx3_masked(stub_id, entry, nooverlap_target);
}
#endif
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", name);
StubCodeMark mark(this, stub_id);
address start = __ pc();
Label L_copy_bytes, L_copy_8_bytes, L_exit;
@@ -1968,10 +2096,7 @@ __ BIND(L_exit);
// Arguments:
// aligned - true => Input and output aligned on a HeapWord boundary == 8 bytes
// ignored
// is_oop - true => oop array, so generate store check code
// name - stub name string
// entry - location for return of (post-push) entry
//
// Inputs:
// c_rarg0 - source array address
@@ -1982,17 +2107,39 @@ __ BIND(L_exit);
// disjoint_oop_copy_entry or disjoint_long_copy_entry is set to the
// no-overlap entry point used by generate_conjoint_long_oop_copy().
//
address StubGenerator::generate_disjoint_long_oop_copy(bool aligned, bool is_oop, address *entry,
const char *name, bool dest_uninitialized) {
address StubGenerator::generate_disjoint_long_oop_copy(StubGenStubId stub_id, address *entry) {
// aligned is always false -- x86_64 always uses the unaligned code
const bool aligned = false;
bool is_oop;
bool dest_uninitialized;
switch (stub_id) {
case StubGenStubId::jlong_disjoint_arraycopy_id:
is_oop = false;
dest_uninitialized = false;
break;
case StubGenStubId::oop_disjoint_arraycopy_id:
assert(!UseCompressedOops, "inconsistent oop copy size!");
is_oop = true;
dest_uninitialized = false;
break;
case StubGenStubId::oop_disjoint_arraycopy_uninit_id:
assert(!UseCompressedOops, "inconsistent oop copy size!");
is_oop = true;
dest_uninitialized = true;
break;
default:
ShouldNotReachHere();
}
BarrierSetAssembler *bs = BarrierSet::barrier_set()->barrier_set_assembler();
#if COMPILER2_OR_JVMCI
if ((!is_oop || bs->supports_avx3_masked_arraycopy()) && VM_Version::supports_avx512vlbw() && VM_Version::supports_bmi2() && MaxVectorSize >= 32) {
return generate_disjoint_copy_avx3_masked(entry, "jlong_disjoint_arraycopy_avx3", 3,
aligned, is_oop, dest_uninitialized);
return generate_disjoint_copy_avx3_masked(stub_id, entry);
}
#endif
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", name);
StubCodeMark mark(this, stub_id);
address start = __ pc();
Label L_copy_bytes, L_copy_8_bytes, L_exit;
@@ -2084,28 +2231,48 @@ address StubGenerator::generate_disjoint_long_oop_copy(bool aligned, bool is_oop
// Arguments:
// aligned - true => Input and output aligned on a HeapWord boundary == 8 bytes
// ignored
// entry - location for return of (post-push) entry
// nooverlap_target - entry to branch to if no overlap detected
// is_oop - true => oop array, so generate store check code
// name - stub name string
//
// Inputs:
// c_rarg0 - source array address
// c_rarg1 - destination array address
// c_rarg2 - element count, treated as ssize_t, can be zero
//
address StubGenerator::generate_conjoint_long_oop_copy(bool aligned, bool is_oop, address nooverlap_target,
address *entry, const char *name,
bool dest_uninitialized) {
address StubGenerator::generate_conjoint_long_oop_copy(StubGenStubId stub_id, address nooverlap_target, address *entry) {
// aligned is always false -- x86_64 always uses the unaligned code
const bool aligned = false;
bool is_oop;
bool dest_uninitialized;
switch (stub_id) {
case StubGenStubId::jlong_arraycopy_id:
is_oop = false;
dest_uninitialized = false;
break;
case StubGenStubId::oop_arraycopy_id:
assert(!UseCompressedOops, "inconsistent oop copy size!");
is_oop = true;
dest_uninitialized = false;
break;
case StubGenStubId::oop_arraycopy_uninit_id:
assert(!UseCompressedOops, "inconsistent oop copy size!");
is_oop = true;
dest_uninitialized = true;
break;
default:
ShouldNotReachHere();
}
BarrierSetAssembler *bs = BarrierSet::barrier_set()->barrier_set_assembler();
#if COMPILER2_OR_JVMCI
if ((!is_oop || bs->supports_avx3_masked_arraycopy()) && VM_Version::supports_avx512vlbw() && VM_Version::supports_bmi2() && MaxVectorSize >= 32) {
return generate_conjoint_copy_avx3_masked(entry, "jlong_conjoint_arraycopy_avx3", 3,
nooverlap_target, aligned, is_oop, dest_uninitialized);
return generate_conjoint_copy_avx3_masked(stub_id, entry, nooverlap_target);
}
#endif
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", name);
StubCodeMark mark(this, stub_id);
address start = __ pc();
Label L_copy_bytes, L_copy_8_bytes, L_exit;
@@ -2224,7 +2391,19 @@ void StubGenerator::generate_type_check(Register sub_klass,
// rax == 0 - success
// rax == -1^K - failure, where K is partial transfer count
//
address StubGenerator::generate_checkcast_copy(const char *name, address *entry, bool dest_uninitialized) {
address StubGenerator::generate_checkcast_copy(StubGenStubId stub_id, address *entry) {
bool dest_uninitialized;
switch (stub_id) {
case StubGenStubId::checkcast_arraycopy_id:
dest_uninitialized = false;
break;
case StubGenStubId::checkcast_arraycopy_uninit_id:
dest_uninitialized = true;
break;
default:
ShouldNotReachHere();
}
Label L_load_element, L_store_element, L_do_card_marks, L_done;
@@ -2254,7 +2433,7 @@ address StubGenerator::generate_checkcast_copy(const char *name, address *entry,
// checked.
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", name);
StubCodeMark mark(this, stub_id);
address start = __ pc();
__ enter(); // required for proper stackwalking of RuntimeStub frame
@@ -2430,8 +2609,7 @@ address StubGenerator::generate_checkcast_copy(const char *name, address *entry,
// Examines the alignment of the operands and dispatches
// to a long, int, short, or byte copy loop.
//
address StubGenerator::generate_unsafe_copy(const char *name,
address byte_copy_entry, address short_copy_entry,
address StubGenerator::generate_unsafe_copy(address byte_copy_entry, address short_copy_entry,
address int_copy_entry, address long_copy_entry) {
Label L_long_aligned, L_int_aligned, L_short_aligned;
@@ -2445,7 +2623,8 @@ address StubGenerator::generate_unsafe_copy(const char *name,
const Register bits = rax; // test copy of low bits
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", name);
StubGenStubId stub_id = StubGenStubId::unsafe_arraycopy_id;
StubCodeMark mark(this, stub_id);
address start = __ pc();
__ enter(); // required for proper stackwalking of RuntimeStub frame
@@ -2578,10 +2757,10 @@ static void do_setmemory_atomic_loop(USM_TYPE type, Register dest,
// Examines the alignment of the operands and dispatches
// to an int, short, or byte fill loop.
//
address StubGenerator::generate_unsafe_setmemory(const char *name,
address unsafe_byte_fill) {
address StubGenerator::generate_unsafe_setmemory(address unsafe_byte_fill) {
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", name);
StubGenStubId stub_id = StubGenStubId::unsafe_setmemory_id;
StubCodeMark mark(this, stub_id);
address start = __ pc();
__ enter(); // required for proper stackwalking of RuntimeStub frame
@@ -2724,8 +2903,7 @@ void StubGenerator::arraycopy_range_checks(Register src, // source array oop
// rax == 0 - success
// rax == -1^K - failure, where K is partial transfer count
//
address StubGenerator::generate_generic_copy(const char *name,
address byte_copy_entry, address short_copy_entry,
address StubGenerator::generate_generic_copy(address byte_copy_entry, address short_copy_entry,
address int_copy_entry, address oop_copy_entry,
address long_copy_entry, address checkcast_copy_entry) {
@@ -2751,7 +2929,8 @@ address StubGenerator::generate_generic_copy(const char *name,
if (advance < 0) advance += modulus;
if (advance > 0) __ nop(advance);
}
StubCodeMark mark(this, "StubRoutines", name);
StubGenStubId stub_id = StubGenStubId::generic_arraycopy_id;
StubCodeMark mark(this, stub_id);
// Short-hop target to L_failed. Makes for denser prologue code.
__ BIND(L_failed_0);

View File

@@ -112,7 +112,8 @@ void StubGenerator::generate_chacha_stubs() {
/* The 2-block AVX/AVX2-enabled ChaCha20 block function implementation */
address StubGenerator::generate_chacha20Block_avx() {
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", "chacha20Block");
StubGenStubId stub_id = StubGenStubId::chacha20Block_id;
StubCodeMark mark(this, stub_id);
address start = __ pc();
Label L_twoRounds;
@@ -300,7 +301,8 @@ address StubGenerator::generate_chacha20Block_avx() {
/* The 4-block AVX512-enabled ChaCha20 block function implementation */
address StubGenerator::generate_chacha20Block_avx512() {
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", "chacha20Block");
StubGenStubId stub_id = StubGenStubId::chacha20Block_id;
StubCodeMark mark(this, stub_id);
address start = __ pc();
Label L_twoRounds;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2021, Intel Corporation. All rights reserved.
* Copyright (c) 2016, 2024, Intel Corporation. All rights reserved.
* Intel Math Library (LIBM) Source Code
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -173,7 +173,8 @@
#define __ _masm->
address StubGenerator::generate_libmCos() {
StubCodeMark mark(this, "StubRoutines", "libmCos");
StubGenStubId stub_id = StubGenStubId::dcos_id;
StubCodeMark mark(this, stub_id);
address start = __ pc();
Label L_2TAG_PACKET_0_0_1, L_2TAG_PACKET_1_0_1, L_2TAG_PACKET_2_0_1, L_2TAG_PACKET_3_0_1;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2021, Intel Corporation. All rights reserved.
* Copyright (c) 2016, 2024, Intel Corporation. All rights reserved.
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
* Intel Math Library (LIBM) Source Code
*
@@ -165,7 +165,8 @@ ATTRIBUTE_ALIGNED(4) static const juint _INF[] =
#define __ _masm->
address StubGenerator::generate_libmExp() {
StubCodeMark mark(this, "StubRoutines", "libmExp");
StubGenStubId stub_id = StubGenStubId::dexp_id;
StubCodeMark mark(this, stub_id);
address start = __ pc();
Label L_2TAG_PACKET_0_0_2, L_2TAG_PACKET_1_0_2, L_2TAG_PACKET_2_0_2, L_2TAG_PACKET_3_0_2;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023, Intel Corporation. All rights reserved.
* Copyright (c) 2023, 2024, Intel Corporation. All rights reserved.
* Intel Math Library (LIBM) Source Code
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -73,7 +73,8 @@ ATTRIBUTE_ALIGNED(32) static const uint64_t CONST_e307[] = {
address StubGenerator::generate_libmFmod() {
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", "libmFmod");
StubGenStubId stub_id = StubGenStubId::fmod_id;
StubCodeMark mark(this, stub_id);
address start = __ pc();
__ enter(); // required for proper stackwalking of RuntimeStub frame

View File

@@ -82,7 +82,8 @@ void StubGenerator::generate_ghash_stubs() {
address StubGenerator::generate_ghash_processBlocks() {
__ align(CodeEntryAlignment);
Label L_ghash_loop, L_exit;
StubCodeMark mark(this, "StubRoutines", "ghash_processBlocks");
StubGenStubId stub_id = StubGenStubId::ghash_processBlocks_id;
StubCodeMark mark(this, stub_id);
address start = __ pc();
const Register state = c_rarg0;
@@ -218,7 +219,8 @@ address StubGenerator::generate_ghash_processBlocks() {
address StubGenerator::generate_avx_ghash_processBlocks() {
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", "ghash_processBlocks");
StubGenStubId stub_id = StubGenStubId::ghash_processBlocks_id;
StubCodeMark mark(this, stub_id);
address start = __ pc();
// arguments

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