Compare commits

..

1485 Commits

Author SHA1 Message Date
Vitaly Provodin
2978361744 update exclude list on results of main.3228 test runs 2025-04-12 06:13:07 +04:00
Vitaly Provodin
61c3e26f63 update exclude list on results of 25.16.14 test runs 2025-04-12 06:13:06 +04:00
Vitaly Provodin
f910f468d8 update exclude list on results of 25.14.12 test runs 2025-04-12 06:13:06 +04:00
Vladimir Dvorak
e8c1e591b7 JBR-8301 serialGC dcevm patch 2025-04-12 06:13:05 +04:00
Vladimir Dvorak
2dd4b6da12 JBR-8301 disable VMContinuations in dcevm 2025-04-12 06:13:05 +04:00
Vladimir Dvorak
b22a263480 JBR-8301 cleanup; nullptr + asserts 2025-04-12 06:13:05 +04:00
Vladimir Dvorak
d5995f0e3c JBR-8301 fix find_class + use cld iteration convention 2025-04-12 06:13:04 +04:00
Vladimir Dvorak
e47ab0a33b JBR-8301 compilation issues + G1 fix forward 2025-04-12 06:13:04 +04:00
Vladimir Dvorak
d741ec49dd JBR-8301 adjust method ID numbering
Ensure the jmethod_ids array has sufficient initial capacity. This array is not resized since JDK 23.
2025-04-12 06:13:03 +04:00
Vladimir Dvorak
2780e77080 JBR-8301 clear constant pool cache entries.
java23 has a new implementation of CP cache
2025-04-12 06:13:03 +04:00
Vladimir Dvorak
a89b7ee051 JBR-7649 fix DCEVM crashes on assert() in VM_Exit 2025-04-12 06:13:03 +04:00
Vladimir Dvorak
51c3e40b70 JBR-7523 fix ClassUnloading support in DCEVM 2025-04-12 06:13:02 +04:00
Vladimir Dvorak
9d85acf1c7 JBR-7635 Skip rolled-back classes in search for affected classes 2025-04-12 06:13:02 +04:00
Vladimir Dvorak
d1b213ac55 JBR-7447 use new method for unregister nmethods in G1
caused by JBR-7219 ("Rebasing JBR21 on top of OpenJDK 21.0.4") and changes in G1 nmethods unregister
2025-04-12 06:13:01 +04:00
Vladimir Dvorak
702b7cbde3 JBR-7351 DCEVM: Respect explicit -XX:+ClassUnloading option
Ensure that ClassUnloading is not disabled if the -XX:+ClassUnloading flag is explicitly set by the user. Display a warning about potential instability in this configuration.
2025-04-12 06:13:01 +04:00
Vladimir Dvorak
48a74d49d9 JBR-7246 DCEVM: Fix SIGSEGV in method_hash on redefinition 2025-04-12 06:13:01 +04:00
Vladimir Dvorak
bb66d13689 JBR-7245 DCEVM: Fix multiple class modification at breakpoint
If an application is paused at a breakpoint in method M of class C and method M is modified N times, each modification triggers N redefinitions of class C. This patch fixes this bug.
2025-04-12 06:13:01 +04:00
Vladimir Dvorak
760dca564f JBR-6648 - Fix ObjectCollectedException in enhanced redefineClasses due to stale jvmtiTagMap entries 2025-04-12 06:13:00 +04:00
Vladimir Dvorak
d2fc8fd7df JBR-6746 Fix linux build failing on: "error: 'this' pointer is null" 2025-04-12 06:13:00 +04:00
Vladimir Dvorak
1df63b008a JBR-6674 Fix parallel oops iteration in dcevm redefinition
This patch addresses unsynchronized parallel access to ChangePointersObjectClosure._tmp_obj by creating a separate instance for each thread, enhancing thread safety. Additionally, it deems parallel DCEVM iteration in G1 as redundant and removes it.
2025-04-12 06:13:00 +04:00
Vladimir Dvorak
ebc58780e8 JBR-6647 Disable check for final field access from method $$ha$clinit 2025-04-12 06:12:59 +04:00
Vladimir Dvorak
96ccd682fd JBR-6643 - fix GitHub actions builds 2025-04-12 06:12:59 +04:00
Vladimir Dvorak
72e8cc9941 JBR-6419 - fix macos-aarch64 build problem 2025-04-12 06:12:58 +04:00
Vladimir Dvorak
3e2d710400 JBR-6419 - resolve win+macos jdk build issues 2025-04-12 06:12:58 +04:00
Vladimir Dvorak
269c06d10f JBR-6419 - support for enhanced redefinition of java.lang.Object 2025-04-12 06:12:57 +04:00
Vladimir Dvorak
9450000998 JBR-8301 fix compilations issues 2025-04-12 06:12:57 +04:00
Vladimir Dvorak
fd24510804 JBR-5183 as dcevm-23 base
JBR-5183 - ref openjdk/8292818 - special access flags removed

JBR-5183 - add new DeoptimizationScope from openjdk

JBR-5183 clean DCEVM code separation in standard jdk code + typo fix

JBR-5464 Fix native method registration

JBR-5183 - fix compilation on win - using size_t

JBR-5183 - fix error: invalid use of incomplete type 'struct Atomic::StoreImpl

JBR-5183 - fix windows build

JBR-5183 - nullptr in VM_EnhancedRedefineClasses

JBR-5183 - fix compilation locking

JBR-5183 fix G1GC forward pointer check

JBR-5183 fix problem with _first_dead in serial GC

JBR-5183 fix bug from dcevm21 merge resolving

JBR-5183 use sorted static fields in class comparison

JBR-5183 do not use EnhancedRedefineClasses_lock

JBR-5183 fix assert in make_jmethod_id

JBR-5183 remove VM_ThreadsSuspendJVMTI

JBR-5183 fix dcevm21 issues after merge dcevm17 updates

JBR-5183 dcevm17 squashed commits

JBR-3111 Update class in all dictionaries where it was already defined

This patch keeps compatibility with std redefinition, that does not
create a new Klass, but modifies it, then it is modified in all
dictionaries containing this class.

Add ClassLoaderDataGraph_lock to define new class in enhanced
redefiniton

ClassLoaderDataGraph locking for introduced in redefinition in
java.version>11
JBR-3140 - support for modularized HotswapAgent

Add -XX:HotswapAgent=[disabled,fatjar.core]

Support for redefinition of Well Known classses (java.*,jdk.*, sun.*)

Fix fastdebug compilation issues - cast_to_oop
JBR-3458: Skip dynamic proxy classes based on com.sun.proxy
JBR-3459: Fix race condition in ClassLoaderDataGraph::classes_do

InstanceKlass in ClassLoaderData can be uninitialized when
ClassLoaderDataGraph::classes_do is called. Using
ClassLoaderDataGraph::dictionary_classes_do is safe but problem is still
persisting with anonymous classes.

Fix compilation problems

Fix dcevm issues related to refactorization of Thread to JavaThread
Fix init_method_MemberName after Thread to JavaThread refactorization
Fix "implicit conversion of NULL constant to 'bool'"
Fix, pass SystemDictionary::resolve_from_stream cl_info param
Search for affected classes in all initialized classes in cld

Fix also case when lambda interface is redefined. Lambda class is
missing in cld dictionary since it is hidden since j17
Fix compilation issue
Remove duplicated lambdaFormInvokers.cpp

JBR-3867 - update keys of jvmti TAG map after redefinition

jdwp keeps relation class_ptr->class_ref in jvmti tag. class_ptr is used
as a tag key, tag value is refnode. There are new class_ptrs after
redefinition, therefore jdwp redefinition method update all affected
keys in the tag map.
JBR-3867 - fix msvc compilation issue with non const array on stack
Attempt to fix JBR-3887
JBR-3937 Fix crashes in C1/C2 compilers

There is a race condition in enhanced redefinition with C1/C2. Therefore
the patch stops C1/C2 compilation before redefinition and release after
redefinition finishing. There is no performance impact since dcevm
flushes all code cache.

Fix line ending CRLF->LF
G1 fixes, code cleanup
JBR-3867 - fix dcevm redefinition stops due the not updated weak oops

Dcevm must update also oops in weak storage using WeakProcessor. Oops
storage is new concept in java17.
JBR-4018 - fix zero variant compilation issues

JBR-3997 - fix _invokehandle and _invokedynamic race conditions

Old clear mechanism of CpCacheEntry has cleared partially _flags and the
entire _f1, but both values could be later used in interpreter for
invocation. It ended up with various types of crashes. To prevent dcevm
crashes, we keep the old _f1 and _flags values until they are resolved
again. We need a new flag 'is_f1_null_dcevm_shift' indicating that _f1
is NULL (while f1 keeps old value).

JBR-4053 - Fix fastdebug compilation issue
JBR-4125 - fix wrong addition of java.lang.Object as superclass
JBR-4110 - disable UseEmptySlotsInSupers

dcevm instance transformation expects increasing field's offset when
fields of class are iterated. This ordering is no more valid if
UseEmptySlotsInSupers=true.
JBR-4148 - removed meaningless copying of data to itself
JBR-4312 - fix crash call ResolvedMethodTable from ServiceThread

adjust_metod_entries_dcevm incorrectly changed the hashes of resolved
method oops stored in ResolvedMethodTable. Now all oops of old methods
are first removed, then updated and then added to table again
JBR-4352 - fix AARCH64 compilation issues

- use correct INCLUDE_JFR condition for jfr code
- exclude jvmtiEnhancedRedefineClasses.cpp if INCLUDE_JVMTI=0
Remove version-numbers left over from the merge of dcevm17
JBR-4392 - use only loaded classes when collecting affected classes
JBR-4386 - disable AllowEnhancedClassRedefinition in jfr

JBR-5183 fix dcevm21 compilation issues

JBR-5183 pre-dcevm17 squashed commits

dcevm11 fixes

1. We need to set classRedefinitionCount on new class, not old class.

2.Fix crashes in MetadataOnStackMark::~MetadataOnSta

MetadataOnStackMark should not remove dcevm stuff. It was added
accidentaly in dcevm9 and never was part of doit() in previous versions.

3. Fix problem with nested members

Reported at :
https://stackoverflow.com/questions/53370380/hotswapagent-incompatibleclasschangeerror-type-headerpanel1-is-not-a-nest-mem

4. Use init_mark_raw()

method changed since j8 - it used init_mark()

5. Fix methodHandles and fieldHandles

6. Code cleanup

7. Fix force_forward in dead space

8. Fix check_class

9. increment_class_counter() using orig dcevm code

Probably it is cause of SISEGV on:
_
VM_EnhancedRedefineClasses::redefine_single_class->java_mirror()

10 Fix 11.0.7 compilation issues

11. Refactor ClearCpoolCacheAndUnpatch

12. not nullable oop_store_not_null() method+handle NULL in mem_name in
dmh

13. Use INCLUDE_CDS condition on "UseSharedSpaces" block from master

14. Add codecache flush optimization, but just flush all cache.

15. Cleanup

16. Use original code for adjust_method_entries in standard redefinition

17. iterate old method version only in dcevm

18. Revert code for !AllowEnhancedClassRedefinition

19. Code cleanup

20. Activate cpCache definition asserts for !dcevm

21. Skip GC runs for redefinitions without instance size change

22. This is the 2nd commit message:

23. dcevm15 - Cleanup code related to removed CMS

Fix class cast exception on redefinition of class A, that is superclass
of B that has anonymous class C

Support for Lambda class redefinition

Fix "no original bytecode found" error if method with bkp is missing

Sometimes IDE can deploy class with erroneous method, such method has
n bytecode, but breakpoint position can still exist.

Replace deleted method with Universe::throw_no_such_method_error

+ Change log level in advanced redefinition
- Change log level for "Comparing different class ver.." to debug
- Fix adjust_method_entries_dcevm logging levels and severity
Support for G1 gc

AllowEnhancedClassRedefinition is false (disabled) by default

Set HOTSPOT_VM_DISTRO=Dynamic Code Evolution

Clear dcevm code separation

Fix LoadedClassesClosure - fixes problems with remote debugging

dcevm15 - fix java15 compilation issues
dcevm15 - add ClassLoaderDataGraph_lock on
ClassLoaderDataGraph::classes_do

ClassLoaderDataGraph::classes_do and need safepoint or lock,
find_sorted_affected_classes is not in safepoint therefore it must be
locked
ClassLoaderDataGraph::rollback_redefinition need safepoint too
dcevm15 - fix Universe::root_oops_do

Removed ClassLoaderDataGraph::cld_do was cause of crashes due multiple
oop patching. ClassLoaderDataGraph::cld_do replaced in dcevm15
previously used and removed SystemDictionary:oops_do
dcevm15 - check if has_nestmate_access_to has newest host class
dcevm15 - mark_as_scavengable only alive methods
dcevm15 - fix hidded classes

dcevm15 - DON'T clear F2 in CP cache after indy unevolving

It's not clear why it was cleared in dcevm7-11
Cleanup and review comments
Disable AllowEnhancedClassRedefinition in flight recorder

dcevm17 - fix compilation issues

Fix crash on GrowableArray allocation in C_HEAP
Rename confusing method name old_if_redefined to old_if_redefining
Check InstanceKlass::has_nestmate_access_to with active classes

Dcevm can leave old host in nested class if nested class is not
redefined together with host class
2025-04-12 06:12:56 +04:00
Vitaly Provodin
810bf9e561 update exclude list on results of 25.12.11 test runs 2025-04-12 06:12:56 +04:00
Vitaly Provodin
214ee580ae update exclude list on results of 25.12 test runs 2025-04-12 06:12:56 +04:00
Vitaly Provodin
1c3b369541 update exclude list on results of 25.10.10 test runs 2025-04-12 06:12:55 +04:00
Vitaly Provodin
11fb4e084b update exclude list on results of 25.8.6 test runs 2025-04-12 06:12:55 +04:00
Vitaly Provodin
e0d67f1e0f update exclude list on results of 25.6.4 test runs 2025-04-12 06:12:54 +04:00
Vitaly Provodin
c62e85acd6 update exclude list on results of 25.5.2 test runs 2025-04-12 06:12:54 +04:00
Vitaly Provodin
3ad7a31bb3 update exclude list on results of 25.5 test runs 2025-04-12 06:12:53 +04:00
Vitaly Provodin
a71b3e1385 update exclude list on results of 25.3 test runs 2025-04-12 06:12:53 +04:00
Nikita Gubarkov
fbb34c6383 JBR-8608 Vulkan: Cleanup capability checks 2025-04-12 02:04:18 +02:00
Maxim Kartashev
b926cdc517 JBR-7892 Generate a descriptive error message when awt cannot be loaded 2025-04-12 02:04:18 +02:00
Vladimir Lagunov
37cfe64999 JBR-8539 fix jdk/jfr/event/io/TestFileReadOnly.java: mimic errors in RandomAccessFile.write 2025-04-12 02:04:18 +02:00
Vladimir Lagunov
c3b822f0fd JBR-8538 JBR-7700 Change handling of new File("")
A new behavior for java.io.File was introduced in commit 9477c705c0. For example, `new File("").exists()` returns true now, but it used to return false.
2025-04-12 02:04:18 +02:00
Vladimir Lagunov
3d332e7fbd JBR-7700 Fix the behavior of setReadOnly(false) on Posix 2025-04-12 02:04:18 +02:00
Vladimir Lagunov
f0668fdd1c JBR-7700 Prepare for cases when getFileAttributeView returns null
It doesn't happen in any default implementation with default attribute classes, but some 3rd party implementations can do that.
2025-04-12 02:04:18 +02:00
Vladimir Lagunov
dbbb849eba JBR-7700 Fix the case with deletion of locked file on Windows 2025-04-12 02:04:18 +02:00
Maxim Kartashev
a3e6049c02 JBR-8551 Wayland: javax/swing/JSlider/TestJSliderRendering.java: The slider is not rendered properly 2025-04-12 02:04:18 +02:00
Nikita Gubarkov
5ca083b9a5 JBR-8602 Migrate JBR API backend to Classfile API 2025-04-12 02:04:18 +02:00
Nikita Gubarkov
3dcc010d50 JBR-8601 Vulkan: Decouple from Wayland 2025-04-12 02:04:18 +02:00
Vitaly Provodin
215083bbad Update README.md 2025-04-12 02:04:18 +02:00
Maxim Kartashev
c03a618361 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-04-12 02:04:18 +02:00
Maxim Kartashev
ccf4eb23f4 JBR-8587 jb/build/ResolveSymbolsTest/ResolveSymbolsRealEnv.java fails on Alpine 2025-04-12 02:04:18 +02:00
Maxim Kartashev
fa66881eb1 JBR-8572 Wayland: java/awt/Desktop/DesktopGtkLoadTest/DesktopGtkLoadTest.java: Wrong GTK library version: null 2025-04-12 02:04:17 +02:00
Vitaly Provodin
27d93e43bc JBR-8219 run "clean" separately before building (workaraound for JDK-8349665) 2025-04-12 02:04:17 +02:00
Vitaly Provodin
e92876f904 update exclude list on results of 3188 test runs 2025-04-12 02:04:17 +02:00
Nikita Tsarev
24aba38338 JBR-8533: Fix wrong keys and modifiers being reported for certain non-function key combinations [WLToolkit] 2025-04-12 02:04:17 +02:00
Maxim Kartashev
4bab23436e JBR-7896 Wayland: Deadlock in WLClipboard
Avoid performing blocking I/O while holding a lock
2025-04-12 02:04:17 +02:00
Nikita Gubarkov
3a02330dc7 JBR-8555 Vulkan: Do not flush the surface on transform change 2025-04-12 02:04:17 +02:00
Nikita Gubarkov
03a374bd4f JBR-8553 Vulkan: Respect filtering hints in blits 2025-04-12 02:04:17 +02:00
Nikita Gubarkov
3e352e004c <TEMP> 8353542: No native raster data for common pixel-interleaved BufferedImages
This duplicates my OpenJDK PR, wait till it's resolved in upstream.
2025-04-12 02:04:17 +02:00
Nikita Gubarkov
a78d466c7b JBR-8525 Vulkan: Fix offscreen surface scaling 2025-04-12 02:04:17 +02:00
Maxim Kartashev
703ceff09f JBR-8436 Describe various type of github releases 2025-04-12 02:04:17 +02:00
Maxim Kartashev
847dc30643 JBR-7087 Wayland: GtkFileDialogPeer implementation 2025-04-12 02:04:17 +02:00
Maxim Kartashev
c5e5a7851e JBR-7087 Wayland: Desktop support via GNOME 2025-04-12 02:04:17 +02:00
Maxim Kartashev
80e88ddda7 JBR-7087 Wayland: GTKLookAndFeel support 2025-04-12 02:04:17 +02:00
Vitaly Provodin
73d7e822bf update exclude list on results of 3184 test runs 2025-04-12 02:04:17 +02:00
Alexey Ushakov
c975f31e42 JBR-7725 Vulkan: low performance in SwingMark
Implemented intermediate buffer for loading raster data
Removed extra synchronization in blits
2025-04-12 02:04:16 +02:00
Nikita Gubarkov
6386a75f1a JBR-8485 Vulkan: Blit surface into itself 2025-04-12 02:04:16 +02:00
Alexey Ushakov
47dc4088f9 JBR-8479 Support Vulkan accelerated mode in perf scripts
Added the new option, minor refactoring
2025-04-12 02:04:16 +02:00
Nikita Gubarkov
27db94f320 JBR-8478 Vulkan: Pull real supported formats from the device 2025-04-12 02:04:16 +02:00
Nikita Gubarkov
c7e8293605 JBR-8473 Vulkan: Support for various source blit formats via swizzling 2025-04-12 02:04:16 +02:00
Nikita Gubarkov
d71e8ce50c JBR-8472 Vulkan: Respect source alpha type in blit routines 2025-04-12 02:04:16 +02:00
Nikita Gubarkov
61d2ccf319 JBR-8471 Vulkan: Reuse descriptor sets in blit routines 2025-04-12 02:04:16 +02:00
Nikita Tsarev
5b18c4433f JBR-8422: A temporary workaround for crash in SystemHotkey setup on macOS 15.4 beta 2025-04-12 02:04:16 +02:00
Vitaly Provodin
531e025972 update exclude list on results of 3147 test runs 2025-04-12 02:04:16 +02:00
Nikita Gubarkov
59df6d4921 JBR-8448 Vulkan: Cleanup & fix Sw->Surface blit 2025-04-12 02:04:16 +02:00
Nikita Gubarkov
b9628a0fb2 JBR-8447 Vulkan: Implement multi-view images 2025-04-12 02:04:16 +02:00
bourgesl
f3ce47a88b JBR-5497: change the default value for the system property "awt.mac.flushBuffers.invokeLater" to 'enabled' to avoid any potential freeze (safe) until a better solution 2025-04-12 02:04:16 +02:00
bourgesl
b744726512 JBR-5497: follow-up fix
- monitors sleep/wake-up notifications to define ThreadUtilities.isWithinPowerTransition()
- fixed CPlatformWindow.flushBuffers() to use this pwm flag to use invokeLater() when the system property '-Dawt.mac.flushBuffers.pwm=true'
- always use invokeLater() when display mirroring is enabled (i.e. '-Dawt.mac.flushBuffers.invokeLater'=[auto|default])
- always use the timeout=0.666s in CPlatformWindow.flushBuffer()
- always use the time limit=13.333s in LWCToolkit.doAWTRunLoop() to ensure avoiding any potential hangs / freezes on macOS
2025-04-12 02:04:16 +02:00
bourgesl
ee98858ed7 JBR-8183: fixed cherry-pick (bad merge) 2025-04-12 02:04:16 +02:00
bourgesl
2421c5cfb7 JBR-8183: get low resolution display modes (mac intel) and do not call anymore the DisplayConfiguration transaction on the main thread avoid main thread as it hangs for several seconds on macbook intel + macOS 15 2025-04-12 02:04:16 +02:00
Nikita Gubarkov
34499545b6 <TEMP> 8352407: PixelInterleavedSampleModel with unused components throws RasterFormatException: Incorrect pixel stride
This duplicates my OpenJDK PR, wait till it's resolved in upstream.
2025-04-12 02:04:15 +02:00
Nikita Gubarkov
2144f97666 JBR-8442 Vulkan: Fix OPAQUE mode rendering 2025-04-12 02:04:15 +02:00
Nikita Gubarkov
8b762ef66a JBR-8441 Vulkan: Update CArrayUtil.h 2025-04-12 02:04:15 +02:00
Nikita Gubarkov
c651e37499 JBR-8440 Vulkan: Pass the surface format to native code 2025-04-12 02:04:15 +02:00
Nikita Gubarkov
63f9d99a10 JBR-8439 Vulkan: Cleanup Surface->Surface blit 2025-04-12 02:04:15 +02:00
Alexey Ushakov
cbf8e2eda1 JBR-8418 Vulkan: RenderPerfTest Image test does not work properly
Added regression test and flush content of the destination surface
2025-04-12 02:04:15 +02:00
Alexey Ushakov
d071d6b56c JBR-8418 Vulkan: RenderPerfTest Image test does not work properly
Passed transform to VKRenderer code
2025-04-12 02:04:15 +02:00
Alexey Ushakov
786baf6c0d JBR-8430 Vulkan: move RenderingContext into Renderer
Moved context to the VKRenderer
2025-04-12 02:04:15 +02:00
Vitaly Provodin
3e549b1e61 update exclude list on results of 3113 test runs 2025-04-12 02:04:15 +02:00
Vitaly Provodin
18e6dfe7d5 JBR-8417 specify XCODE_PATH for JBR building on macOS 2025-04-12 02:04:15 +02:00
Maxim Kartashev
57ac9b1c7d JBR-8419 sources/TestNoNULL.java: Test found 32 usages of 'NULL' in source files 2025-04-12 02:04:15 +02:00
Nikita Gubarkov
0ef1940369 JBR-8424 Vulkan: Format-aware Surface->Sw blit 2025-04-12 02:04:15 +02:00
Nikita Gubarkov
5de9cb31ae JBR-8423 Vulkan: Expose VKFormat on Java side 2025-04-12 02:04:15 +02:00
Nikita Provotorov
ad492733f7 JBR-7659 [macOS] SIGILL at [CoreFoundation+0x1d47c5] CFRunLoopRunSpecific.cold.1+0xe / sun.lwawt.macosx.CAccessibility.getChildrenAndRolesRecursive (2K frames).
Fixes crashes caused by multiple javax.accessibility.AccessibleState.EXPANDED/COLLAPSED changes by making sure AppKit has not more than one event of each type being processed or pending in its queue. The logic can be rolled back via a new system property -Dsun.lwawt.macosx.CAccessible.eventsCoalescingEnabled=false.

(cherry picked from commits 84012b5f39, a2707d4e95, fa8c4705e6, a23ab5a040, fe07d2731a)
2025-04-12 02:04:15 +02:00
vlad20012
61dd4d0408 JBR-8303 Provide JBR API method to perform GC with more intensive heap shrinking 2025-04-12 02:04:14 +02:00
Vladimir Lagunov
57b49b70ec JBR-8396 JBR-7700 Fix FileTest.getCanonicalPath on macOS 2025-04-12 02:04:14 +02:00
Alexey Ushakov
51824e53ad JBR-8398 Vulkan: refactor shader code to use transforms
Replaced normalization logic with transform matrix
2025-04-12 02:04:14 +02:00
Nikita Gubarkov
335838cf57 JBR-8413 Vulkan: Make surfaces VKGPU-aware 2025-04-12 02:04:14 +02:00
Nikita Gubarkov
d3d9a4fbb9 JBR-8412 Vulkan: Add generic offscreen GraphicsConfig implementation 2025-04-12 02:04:14 +02:00
Nikita Gubarkov
770aa99ed3 JBR-8411 Vulkan: Move generic VKGraphicsConfig implementation into shared code 2025-04-12 02:04:14 +02:00
Nikita Gubarkov
68132ac241 JBR-8410 Vulkan: Expose VKDevice on Java side 2025-04-12 02:04:14 +02:00
Nikita Gubarkov
fd1c395fb9 JBR-8391 Vulkan: Split instance and device into separate files 2025-04-12 02:04:14 +02:00
Vladimir Lagunov
cb3d6f4148 JBR-7700 Classes from package java.io. use java.nio.file inside
The option can be enabled/disabled by specifying `-Djbr.java.io.use.nio=true/false`
2025-04-12 02:04:14 +02:00
Vitaly Provodin
9973c62bed update exclude list on results of 3097 test runs 2025-04-12 02:04:14 +02:00
Vitaly Provodin
4b4a0c8c1f Update README.md 2025-04-12 02:04:14 +02:00
Nikita Gubarkov
a4f321cea7 JBR-8363 Vulkan: Organize usage of FlushRenderPass and FlushSurface 2025-04-12 02:04:14 +02:00
Nikita Gubarkov
e459694559 JBR-8359 Vulkan: Put VK_DRAW after VKRenderer_AllocateMaskFillBytes
As VKRenderer_AllocateMaskFillBytes can invalidate draw call state due to overflow, it (and future similar functions) must be called before VK_DRAW.
2025-04-12 02:04:14 +02:00
Nikita Gubarkov
908953028c JBR-8358 Vulkan: Framebuffer destruction queue
Can be generalized to destroy arbitrary resources later.
2025-04-12 02:04:13 +02:00
Maxim Kartashev
42304a9134 JBR-6979 Modernize more WaitForSingleObject on Windows
Use -XX:+UnlockExperimentalVMOptions -XX:-UseModernSynchAPI
to switch back to the original implementation
2025-04-12 02:04:13 +02:00
Nikita Gubarkov
3f2bfdc954 JBR-8350 Vulkan: Refactor pipeline cache & composites
This is needed for the implementation of painters (JBR-7646)
- Request pipelines one-by-one instead of a "pipeline sets"
- Split pipeline key into separate "shader" and "topology" (more items may need to be added later)
- Move management of composites into its own file
2025-04-12 02:04:13 +02:00
Alexey Ushakov
2d59828cab JBR-8347 Download gtk-shell.xml if absent
Added downloading code
2025-04-12 02:04:13 +02:00
Vitaly Provodin
ed468d8d9c update exclude list on results of 3054 test runs 2025-04-12 02:04:13 +02:00
Vitaly Provodin
6cf011a73e JBR-8196 fix calculating the number of attempts 2025-04-12 02:04:13 +02:00
Nikita Gubarkov
882253b641 JBR-8342 Vulkan: Skip validation setup if extension is unavailable 2025-04-12 02:04:13 +02:00
Nikita Tsarev
1f0a6d4b7a JBR-7994: Properly report non-base-level function keys [WLToolkit] 2025-04-12 02:04:13 +02:00
Artem Bochkarev
938f8d8439 JBR-8138 Sign jcef binaries with separate entitlements
Revert to true the OSX entitlement "com.apple.security.cs.allow-dyld-environment-variables"
2025-04-12 02:04:13 +02:00
Vladimir Kharitonov
4444a137ef JBR-8118 TextureWrapperImage for MTLTexture 2025-04-12 02:04:13 +02:00
Alexey Ushakov
bf3f824add JBR-8297 Vulkan: Implement ISO_BLIT
Implemented general logic of the blit, removed extra logging
Corrected clipping logic, updated regression tests
Added some flush and init code for the surfaces
2025-04-12 02:04:13 +02:00
Dmitry Drobotov
07fc5bbe83 JBR-8216 Implement setAccessibilityValue method for NavigableTextAccessibility
* This method allows for third-party tools to modify text component contents through the accessibility API on macOS;
* The setAccessibilityValue method is implemented similarly to NavigableTextAccessibility.setAccessibilitySelectedText. On the Java side, it calls AccessibleEditableText.setTextContents according to the comment in JavaTextAccessibility.accessibilitySetValueAttribute;
* The isAccessibilitySelectorAllowed method is implemented similarly to JavaTextAccessibility.accessibilityIsValueAttributeSettable: it checks if the text component implements AccessibleEditableText, is enabled, and additionally checks if the editable property is true, because some components could be enabled but not editable, and we shouldn't allow setting the value in this case.

(cherry picked from commit 61a501351a)
2025-04-12 02:04:13 +02:00
Vitaly Provodin
41856b2e05 Update README.md 2025-04-12 02:04:13 +02:00
Vitaly Provodin
4ff8ce2082 JBR-8255 pass WLToolkit-related settings to subprocesses launched by tests 2025-04-12 02:04:13 +02:00
Vitaly Provodin
07782c4670 JBR-8244 add logging stdout/stderr of subprocesses
(cherry picked from commit 41d655243f)
2025-04-12 02:04:13 +02:00
Vitaly Provodin
33a712c748 update exclude list on results of 3034 test runs 2025-04-12 02:04:12 +02:00
Alexey Ushakov
51e56d97ff JBR-8287 Vulkan: enable hw accelerated VolatileImage
Moved robot pixel grabber into windows surface data
Created offscreen surface data
Separated surfaces implementation into two files
Moved offscreen surface to the shared code

Fix
2025-04-12 02:04:12 +02:00
Nikita Gubarkov
3f0174182d JBR-8288 Vulkan: Synchronous render queue flush.
RQ doesn't expose async flush operation. All RQ flushes wait for the queue to be drained, effectively serializing queue flusher and EDT execution while still making it prone to deadlocks.
The periodic flush feature of the queue flusher thread is of no use as well, as every observable effect of RQ operation is already immediately followed by a forced flush.
As Vulkan functions have no restriction on the calling thread, keep it simple - lock the monitor and drain the queue synchronously.
2025-04-12 02:04:12 +02:00
Maxim Kartashev
c54595a423 JBR-8264 java/awt/Multiscreen/UpdateGCTest/UpdateGCTest.java throws StackOverflowError at WLComponentPeer.getMinimumSize 2025-04-12 02:04:12 +02:00
Nikita Gubarkov
65dd6981e1 JBR-8284 Vulkan: fix $VULKAN_SDK autoconf check. 2025-04-12 02:04:12 +02:00
Nikita Gubarkov
5285fec165 JBR-8254 Buffer X11GraphicsEnvironment.rebuildDevices calls. 2025-04-12 02:04:12 +02:00
Maxim Kartashev
668d93e48f JBR-8234 IDE cannot start on Wayland with large scale
Make sure the surface used for the cursor is marked as such prior to
being committed in order to receive an exception from enforcing the rule
about the buffer size having to be multiple of its scale.
2025-04-12 02:04:12 +02:00
Maxim Kartashev
d39145f073 JBR-7897 Tool window resizes is not smooth 2025-04-12 02:04:12 +02:00
Vitaly Provodin
8048aad42d Update README.md 2025-04-12 02:04:12 +02:00
Vitaly Provodin
5c0263a2e3 update exclude list on results of 3005 test runs 2025-04-12 02:04:12 +02:00
Vitaly Provodin
ba3dcc3b4f Update README.md 2025-04-12 02:04:12 +02:00
Maxim Kartashev
23e9dfeea8 JBR-8209 javax/swing/JPopupMenu/NestedFocusablePopupTest.java: WLRobotPeer: wakefield extension not present in Wayland instance 2025-04-12 02:04:12 +02:00
Alexey Ushakov
a9ed27e6ac JBR-8201 Vulkan: crash in VKRenderer_MaskFill
Supported fully opaque mask
2025-04-12 02:04:12 +02:00
Vitaly Provodin
1e7c59908d Update README.md 2025-04-12 02:04:12 +02:00
Maxim Kartashev
17ab99c48b JBR-8197 Wayland: Robot fails if offset in monitor configuration exists 2025-04-12 02:04:11 +02:00
Roman Shevchenko
077cfaaa9b JBR-8198: substituting empty extension with the "Unix executable" type in the macOS file dialog (#479) 2025-04-12 02:04:11 +02:00
Maxim Kartashev
b9bbf57b60 JBR-8066 Wayland: clipboard size is limited to 65000 symbols 2025-04-12 02:04:11 +02:00
Maxim Kartashev
fd39b7df79 JBR-8116 Wayland: support RounderCornersManager JBR API 2025-04-12 02:04:11 +02:00
Nikita Gubarkov
c1e0043f05 Added Clion project setup
(cherry picked from commit db962149ec)
2025-04-12 02:04:11 +02:00
Nikita Gubarkov
4e09a2a383 Updated IDEA project setup 2025-04-12 02:04:11 +02:00
Nikita Gubarkov
23524ff3e1 JBR-8112 Revert swing.bufferPerWindow back to false on Windows 2025-04-12 02:04:11 +02:00
Vitaly Provodin
f89e7dd598 enabling dtrace-tests: added dtrace keyword
(cherry picked from commit 0b5119ca89)
(cherry picked from commit 1959e4a2a4)
2025-04-12 02:04:11 +02:00
bourgesl
94c7378828 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-04-12 02:04:11 +02:00
Sergey Shelomentsev
5103d74758 JBR-8046 repack java.base.jmod with correct module hashes after signing 2025-04-12 02:04:11 +02:00
Vitaly Provodin
499181fa08 JBR-8161 Move docker files under jbr-tools 2025-04-12 02:04:11 +02:00
Vitaly Provodin
f35186e726 update exclude list on results of 2963 test runs 2025-04-12 02:04:11 +02:00
Alexey Ushakov
40ca7f7885 JBR-8091 X: jb/java/wayland/RobotGet tests thorw java.awt.AWTException: headless environment
Do not run test logic in the headless environment
2025-04-12 02:04:11 +02:00
Maxim Kartashev
0d4fd91bb8 JBR-7457 Provide JBR API method to explicitly call gc() 2025-04-12 02:04:11 +02:00
Roman Shevchenko
ec42c23d7a JBR-8156 restoring WSL visibility in the folder picker mode 2025-04-12 02:04:10 +02:00
Nikita Tsarev
5bec162f33 JBR-5851: Fix 'DVORAK - QWERTY Cmd' layout 2025-04-12 02:04:10 +02:00
Vitaly Provodin
5e226d7f58 Update README.md 2025-04-12 02:04:10 +02:00
Maxim Kartashev
c2b74d7c4b JBR-8133 Runtime crash after jfr drag and drop to IU 2025-04-12 02:04:10 +02:00
Alexey Ushakov
d28efd3a5e JBR-7990 Vulkan: Robot pixel grabbing for Vulkan surfaces
Implemented grabbing pixels via partly supported SurfaceToSwBlit, fixed multi-monitor scenario
2025-04-12 02:04:10 +02:00
Maxim Kartashev
49a33e8cfd 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-04-12 02:04:10 +02:00
Vitaly Provodin
4967c38e69 Update README.md 2025-04-12 02:04:10 +02:00
Nikita Tsarev
961af3202a JBR-8004: Support the context menu key on macOS 2025-04-12 02:04:10 +02:00
Maxim Kartashev
1db1f54f94 JBR-8123 NPE because FileSystems.getDefault() is null with -Djava.util.zip.use.nio.for.zip.file.access=true 2025-04-12 02:04:10 +02:00
Vitaly Provodin
0fa2d24a37 JBR-8104 OL8: enable premier support for docker images 2025-04-12 02:04:10 +02:00
Vitaly Provodin
793611099e JBR-8072 move JBR docker images to registry.jetbrains.team 2025-04-12 02:04:10 +02:00
Vitaly Provodin
bdc94ee6a9 update exclude list on results of 2925 test runs 2025-04-12 02:04:10 +02:00
Maxim Kartashev
24f187d00e JBR-6247 Update JBR-specific tests after JDK-8314823
(cherry picked from commit 791448a24d)
2025-04-12 02:04:10 +02:00
Maxim Kartashev
f4e223edcd 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-04-12 02:04:10 +02:00
Vitaly Provodin
2b41f6e6b3 update exclude list on results of 2910 test runs 2025-04-12 02:04:09 +02:00
Vitaly Provodin
8d280ebbed 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-04-12 02:04:09 +02:00
Vitaly Provodin
395a8280b8 update exclude list on results of 2898 test runs 2025-04-12 02:04:09 +02:00
Maxim Kartashev
e512373a09 JBR-7988 Wayland: WLPopupLocation test: incorrect size detected 2025-04-12 02:04:09 +02:00
bourgesl
30054f2ff5 JBR-8048: only log system property 'awt.mac.flushBuffers.invokeLater' if manually set 2025-04-12 02:04:09 +02:00
bourgesl
bd1779c357 JBR-5497: improved system property (awt.mac.flushBuffers.invokeLater) handling to support false/auto/true modes and log used value at startup 2025-04-12 02:04:09 +02:00
bourgesl
1431275249 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-04-12 02:04:09 +02:00
bourgesl
3e0be5c089 JBR-5497: revert JRSUIController changes (performOnMainThreadWaiting:YES) to avoid UI freeze but appkit violations must be fixed in follow-up fix 2025-04-12 02:04:09 +02:00
Vitaly Provodin
ad3ad82810 update exclude list on results of 2865 test runs 2025-04-12 02:04:09 +02:00
Maxim Kartashev
a8d937089c JBR-7889 Wayland: java/awt/Focus/ComponentLostFocusTest.java: class sun.awt.NullComponentPeer cannot be cast to class java.awt.peer.TextFieldPeer 2025-04-12 02:04:09 +02:00
Maxim Kartashev
88f18182ce 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-04-12 02:04:09 +02:00
Vitaly Provodin
7da04f5446 JBR-8006 specify path to gcc-toolset-10 2025-04-12 02:04:09 +02:00
Maxim Kartashev
c709f34a41 JBR-7993 Menus are not displayed directly underneath main menu if offset in monitor configuration exists 2025-04-12 02:04:09 +02:00
Vladimir Kharitonov
4845806694 JBR-7983 adapt the Dockerfile.oraclelinux to build jcef 2025-04-12 02:04:09 +02:00
Sergey Shelomentsev
1a0eb14206 JBR-7919 add tests for Wayland popups 2025-04-12 02:04:09 +02:00
Maxim Kartashev
87b02a2c14 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-04-12 02:04:08 +02:00
Maxim Kartashev
085cdf36f5 JBR-7969 Wayland: some popups misplaced when maximized with fractional scale 2025-04-12 02:04:08 +02:00
Maxim Kartashev
9e2a2399c5 JBR-7071 Wayland: cursor does not change when hovering over gutter icons 2025-04-12 02:04:08 +02:00
Maxim Kartashev
0513b8addb 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-04-12 02:04:08 +02:00
Sergey Shelomentsev
5c000fea1d JBR-5318 add Github workflow usage for pull requests pre-commit testing
(cherry picked from commit f36aa7f9fa)
2025-04-12 02:04:08 +02:00
Vitaly Provodin
11a9bc4e4d update exclude list on results of 2827 test runs 2025-04-12 02:04:08 +02:00
Vitaly Provodin
e4fce046f7 Update README.md 2025-04-12 02:04:08 +02:00
Sergey Shelomentsev
94e93f154d JBR-7939 set max wait to 1 min for jetsign client 2025-04-12 02:04:08 +02:00
Nikita Gubarkov
2aaef3c972 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-04-12 02:04:08 +02:00
Vitaly Provodin
f26ce4198c Update README.md 2025-04-12 02:04:08 +02:00
Vitaly Provodin
4199ee1a23 update exclude list on results of 2777 test runs 2025-04-12 02:04:08 +02:00
Sergey Shelomentsev
fbcacdae86 JBR-7867 Notarization scripts: fail build if signing of separate files are failed 2025-04-12 02:04:08 +02:00
Maxim Kartashev
7e9f97ee67 JBR-7916 Wayland: tests open-sourced in 2024.09 fail 2025-04-12 02:04:08 +02:00
Vitaly Provodin
56edc95d63 update exclude list on results of 2765 test runs 2025-04-12 02:04:08 +02:00
Dmitrii Morskii
22cd004a63 JBR-7040 implemented FPS counter on D3D 2025-04-12 02:04:07 +02:00
Dmitrii Morskii
42e3cef25c JBR-7900 Improve logic of detecting toolkit inside registerShutdownHook 2025-04-12 02:04:07 +02:00
Dmitrii Morskii
a74fe7a165 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-04-12 02:04:07 +02:00
Maxim Kartashev
ed3c3df030 JBR-5483 MacOSXWatchService assumes that the default file system is the UnixFileSystem, which might not be the case
(cherry picked from commit 0af640f048)
2025-04-12 02:04:07 +02:00
Maxim Kartashev
c4ad29ca72 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-04-12 02:04:07 +02:00
Maxim Kartashev
7599a73270 JBR-7859 Wayland: Unexpected focus owner set in a Window 2025-04-12 02:04:07 +02:00
Maxim Kartashev
d8423f5357 JBR-7851 Wayland: IDEA crashes if Esc is pressed to close Diff window 2025-04-12 02:04:07 +02:00
Maxim Kartashev
3bcce88f45 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-04-12 02:04:07 +02:00
Maxim Kartashev
03025895c0 JBR-7760 Pure wayland: incorrect popup scale
(cherry picked from commit d16c50248d)
2025-04-12 02:04:07 +02:00
Sergey Shelomentsev
158fae684b JBR-7856 use jmod from currently built JDK
(cherry picked from commit 5c90a8d4aa)
2025-04-12 02:04:07 +02:00
Sergey Shelomentsev
43d79a2d77 fixup! JBR-7800 Add jnativescan to signing
(cherry picked from commit 3ef8a52e0c)
2025-04-12 02:04:07 +02:00
Nikita Gubarkov
9332ee2149 JBR-7846 Vulkan: Fix compilation in Musl Docker container
(cherry picked from commit 79b9f5b71c)
2025-04-12 02:04:07 +02:00
sergey.shelomentsev
056b6e0b58 JBR-7800 Fix notarization of jbrsdk (sign libs and execs inside jmod files)
(cherry picked from commit dbb42d10f5)
2025-04-12 02:04:07 +02:00
Vitaly Provodin
8ba2248a67 Update README.md
(cherry picked from commit ff4c5dc7b5)
2025-04-12 02:04:07 +02:00
Vitaly Provodin
28f4d6e151 JBR-6144 enable building JBR with Vulkan
(cherry picked from commit 099698fa19)
2025-04-12 02:04:07 +02:00
Nikita Gubarkov
fe4c5ea7d7 JBR-7840 Vulkan: Fix compilation in Docker container
(cherry picked from commit f678372d66)
2025-04-12 02:04:06 +02:00
Dmitrii Morskii
80787ccba3 JBR-6754 setting nopixfmt in case of running on Remote Desktop
(cherry picked from commit de5d101cac)
2025-04-12 02:04:06 +02:00
Dmitry Batrak
4cf8d193dc JBR-7833 Wayland: typeahead problem in a popup
(cherry picked from commit 6093b65936)
2025-04-12 02:04:06 +02:00
Maxim Kartashev
2889277fc7 JBR-7811 Wayland: IDE dialogs and popups flash black before opening
(cherry picked from commit 0703011d40)
2025-04-12 02:04:06 +02:00
Sergey Shelomentsev
bee77d49b2 JBR-7734 add zip distribution for Windows
(cherry picked from commit da26c98b82)
2025-04-12 02:04:06 +02:00
Maxim Kartashev
1ec970e894 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-04-12 02:04:06 +02:00
Konstantin Nisht
c6a937a13e JBR-7466 Exception on VM startup with -Djava.util.zip.use.nio.for.zip.file.access=true
(cherry picked from commit 79f79bf137)
2025-04-12 02:04:06 +02:00
Konstantin Nisht
a402492296 JBR-7392: Use NIO FS in ZipFile
(cherry picked from commit e21c67095b)
2025-04-12 02:04:06 +02:00
Vitaly Provodin
68f372e5cd Update README.md
(cherry picked from commit 0d66d2bf26)
2025-04-12 02:04:06 +02:00
Vitaly Provodin
e6c33b9470 JBR-7797 build fastdebug without jcef
(cherry picked from commit cb322fe90d)
2025-04-12 02:04:06 +02:00
Maxim Kartashev
24b2244557 JBR-6691 test/jdk/jdk/internal/misc/VM/RuntimeArguments.java fails on Linux
(cherry picked from commit a3ecac8a79)
2025-04-12 02:04:06 +02:00
Maxim Kartashev
0b13f51427 JBR-7663 Wayland: make gtk-shell1 protocol support optional
(cherry picked from commit 30e6c720b6)
2025-04-12 02:04:06 +02:00
Maxim Kartashev
1d69db6867 BR-7663 Wayland: generate proxy code with wayland-scanner on the fly
(cherry picked from commit d599043b7d)
2025-04-12 02:04:06 +02:00
Maxim Kartashev
bf6c63c197 JBR-7663 Wayland: add wayland-protocols to the docker files
(cherry picked from commit 8d207ee7e7)
2025-04-12 02:04:06 +02:00
Maxim Kartashev
c8377d368b JBR-7726 X11 toolkit: Dialog buttons rendering black rectangle after hovering
(cherry picked from commit 18e63514c5)
2025-04-12 02:04:05 +02:00
Dmitrii Morskii
6e8bc6311e JBR-7302 added additional emptiness check in getGlyphOutlineBounds
(cherry picked from commit 60fd39e59d)
2025-04-12 02:04:05 +02:00
Nikita Gubarkov
928f0aab69 JBR-7766 Fix VKTexturePool OOM.
(cherry picked from commit 1a806f4f1b)
2025-04-12 02:04:05 +02:00
Nikita Tsarev
a9b3f6437c 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-04-12 02:04:05 +02:00
Maxim Kartashev
c6b37b656f JBR-7749 Settings popup invoked from the main toolbar appears misaligned if fractional scaling set
(cherry picked from commit d41d89e8b4)
2025-04-12 02:04:05 +02:00
Nikita Gubarkov
d4ce4a6c78 JBR-4725 File dialog modality
(cherry picked from commit 2a5b044c95)
2025-04-12 02:04:05 +02:00
Maxim Kartashev
4a365e52a4 JBR-7544 Wayland: Cannot resize window to more that 3500px vertically
(cherry picked from commit ef3dfff3ae)
2025-04-12 02:04:05 +02:00
Vitaly Provodin
d4c2c2375f Update README.md
(cherry picked from commit 7b6bc93034)
2025-04-12 02:04:05 +02:00
Maxim Kartashev
8e0a1a6cbe 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-04-12 02:04:05 +02:00
Vitaly Provodin
211a5829cd Update README.md
(cherry picked from commit dd41dbcb7b)
2025-04-12 02:04:05 +02:00
Maxim Kartashev
d869918306 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-04-12 02:04:05 +02:00
Nikita Tsarev
c43e21ec2c JBR-6324: JBR API for System Shortcuts (macOS)
(cherry picked from commit 22d406a76b)
2025-04-12 02:04:05 +02:00
Nikita Tsarev
4da89ea1ef JBR-5690: Reload next window shortcut when it changes
(cherry picked from commit be0d27983c)
2025-04-12 02:04:05 +02:00
Nikita Tsarev
7839b9d5bd JBR-5726: Report 'Move focus to the previous window in application' system shortcut
(cherry picked from commit 5721bd6908)
2025-04-12 02:04:05 +02:00
Nikita Gubarkov
bba91cec4d JBR-7653 Prepare Docker images for Vulkan builds
(cherry picked from commit 249c46bb6b)
2025-04-12 02:04:05 +02:00
Nikita Gubarkov
1acf49e006 JBR-7673 Cleanup docker scripts
(cherry picked from commit 473686a92e)
2025-04-12 02:04:04 +02:00
Nikita Tsarev
b60e9331f2 JBR-5448: Return all shortcuts from readSystemHotkeys
(cherry picked from commit bb25ab3424)
2025-04-12 02:04:04 +02:00
Nikita Gubarkov
5da0281556 JBR-7579 Fix SurfaceManager.cacheMap retaining strong references.
(cherry picked from commit b8434796ae)
2025-04-12 02:04:04 +02:00
Alexey Ushakov
173e711f52 JBR-7724 Add vulkan support to the performance scripts
Implemented -vulkan option

(cherry picked from commit 6f1ecb9b47)
2025-04-12 02:04:04 +02:00
Vitaly Provodin
98700ce356 Update README.md
(cherry picked from commit a51b24a7eb)
2025-04-12 02:04:04 +02:00
Nikita Gubarkov
40613308e3 JBR-7565 Vulkan: Implement clip 2025-04-12 02:04:04 +02:00
Nikita Gubarkov
3edae5804e JBR-7645 Vulkan: Implement hash table for pipeline sets 2025-04-12 02:04:04 +02:00
Nikita Gubarkov
3d72425e1c 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-04-12 02:04:04 +02:00
Nikita Gubarkov
0ad092dd9d JBR-7564 Vulkan: Fix HIDPI and multi-monitor scenarios
(cherry picked from commit 7f0b10ad23)
2025-04-12 02:04:04 +02:00
Nikita Gubarkov
5a90ca0922 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-04-12 02:04:04 +02:00
Nikita Gubarkov
93d8f4236e JBR-7943 Vulkan: Provide utilities for inspecting image formats 2025-04-12 02:04:04 +02:00
Vitaly Provodin
3008aad007 Update README.md
(cherry picked from commit 770c075320)
2025-04-12 02:04:04 +02:00
Nikita Gubarkov
ec0f72922d JBR-7574 Vulkan: Implement memory allocator
(cherry picked from commit 0be149c84e)
2025-04-12 02:04:04 +02:00
Nikita Tsarev
3e61b50537 JBR-7524: Workaround for showing window tiling actions when hovering over the maximize button on macOS
(cherry picked from commit 8fb519bec4)
2025-04-12 02:04:04 +02:00
Maxim Kartashev
c8a2359e6b JBR-7504 Use accurate event serial number with the clipboard
(cherry picked from commit d935bd156e)
2025-04-12 02:04:03 +02:00
Maxim Kartashev
1e769fc469 JBR-7504 WLToolkit - Middle click paste doesn't work properly when pasting to other applications
(cherry picked from commit b553c722be)
2025-04-12 02:04:03 +02:00
Alexey Ushakov
a38f171156 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-04-12 02:04:03 +02:00
Egor Ushakov
e98c3afddd 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-04-12 02:04:03 +02:00
Egor Ushakov
0cead52a47 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-04-12 02:04:03 +02:00
Vitaly Provodin
c12fb225df Update README.md
(cherry picked from commit 64f5af4fda)
2025-04-12 02:04:03 +02:00
Nikita Tsarev
2b17474ec0 JBR-7672: Only abort key repeat when the key that is being repeated is released [WLToolkit]
(cherry picked from commit a500b52ecb)
2025-04-12 02:04:03 +02:00
Nikita Tsarev
c2cc7b2d16 JBR-7662: Fix key repeat manager sometimes not cancelling properly [WLToolkit]
(cherry picked from commit e1b1116bb9)
2025-04-12 02:04:03 +02:00
Vitaly Provodin
58160e91ff 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-04-12 02:04:03 +02:00
bourgesl
a3d4c35f79 JBR-7616: fixed type (str)
(cherry picked from commit a6569241db)
2025-04-12 02:04:03 +02:00
Nikita Tsarev
c862d5f3af JBR-7675: Respect disabling key repeat [WLToolkit]
(cherry picked from commit 723f45aca7)
2025-04-12 02:04:03 +02:00
Vitaly Provodin
053a029425 JBR-7566 apply standard measurement scripts to Render
(cherry picked from commit be24b3e8ed)
2025-04-12 02:04:03 +02:00
Vitaly Provodin
6220fa3d53 JBR-7567 apply standard measurement scripts to Dacapo
(cherry picked from commit 289121d0ea)
2025-04-12 02:04:03 +02:00
bourgesl
ba208d612a 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-04-12 02:04:03 +02:00
Vitaly Provodin
b788779bff Update README.md
(cherry picked from commit f3fc7649fb)
2025-04-12 02:04:03 +02:00
Vitaly Provodin
54dc639b50 Update README.md
(cherry picked from commit 12dd44c724)
2025-04-12 02:04:02 +02:00
Nikita Gubarkov
b7638c4fbc JBR-7572 Bring back VKBuffer functions
(cherry picked from commit 90e516f24c)
2025-04-12 02:04:02 +02:00
Nikita Gubarkov
3a559e96b9 JBR-7644 Vulkan: Move barrier state tracking from surface into image
(cherry picked from commit 76dbad4387)
2025-04-12 02:04:02 +02:00
Nikita Gubarkov
abdf5d63cf 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-04-12 02:04:02 +02:00
Vitaly Provodin
687068ad6b Update README.md
(cherry picked from commit 62d575dfe4)
2025-04-12 02:04:02 +02:00
Nikita Gubarkov
e8d713e753 JBR-7556 Check negative glyphID in HBShaper
(cherry picked from commit 76852278f4)
2025-04-12 02:04:02 +02:00
bourgesl
ee69066806 JBR-7616: improved MTLRenderQueue exception handling
(cherry picked from commit ea57bf75e7)
2025-04-12 02:04:02 +02:00
Maxim Kartashev
14ee2727fc 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-04-12 02:04:02 +02:00
Nikita Provotorov
fe0167c761 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-04-12 02:04:02 +02:00
Nikita Provotorov
15a03259e7 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-04-12 02:04:02 +02:00
Vitaly Provodin
f8ad54d134 Update README.md
(cherry picked from commit 29f3f9f229)
2025-04-12 02:04:02 +02:00
Sergei Tachenov
196957b185 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-04-12 02:04:02 +02:00
Nikita Tsarev
1a03d0e7cc JBR-7594 Check for LWCToolkit in JBR TextInput API
(cherry picked from commit 3c1fd1c3e6)
2025-04-12 02:04:02 +02:00
Sergei Tachenov
0a974e1500 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-04-12 02:04:02 +02:00
Sergei Tachenov
bc37791b41 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-04-12 02:04:01 +02:00
Vitaly Provodin
b23847a286 Update README.md
(cherry picked from commit 170a7cfa7f)
2025-04-12 02:04:01 +02:00
Alexey Ushakov
3e53b02977 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-04-12 02:04:01 +02:00
Nikita Gubarkov
ba5add95f4 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-04-12 02:04:01 +02:00
Maxim Kartashev
44c1c70322 JBR-5615 added missing part for WLToolkit
(cherry picked from commit f407b957f2)
2025-04-12 02:04:01 +02:00
Dominik Matta
eca0adda18 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-04-12 02:04:01 +02:00
Maxim Kartashev
819ecb0a5f 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-04-12 02:04:01 +02:00
Maxim Kartashev
b1088ffa5f Added proper copyright headers
(cherry picked from commit 0d5aea938e)
2025-04-12 02:04:01 +02:00
Nikita Gubarkov
beb0e8f60f Fix WindowMoveService on Wayland
(cherry picked from commit 00f213d0ff)
2025-04-12 02:04:01 +02:00
Nikita Gubarkov
8ce1ca77b3 JBR-7570 Implemented ring buffer. Added lazy implicit initialization for dynamic arrays. (#451)
(cherry picked from commit 7b89fe2311)
2025-04-12 02:04:01 +02:00
Nikita Gubarkov
4c2f0787e5 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-04-12 02:04:01 +02:00
Nikita Gubarkov
881913b149 JBR-7569 Removed VMA-Hpp (#450)
(cherry picked from commit 3867557192)
2025-04-12 02:04:01 +02:00
Dmitrii Morskii
022ab3a5a5 JBR-7126 add more possible names for cursor arrow icon
(cherry picked from commit 95e391166d)
2025-04-12 02:04:01 +02:00
Vitaly Provodin
bf9254c6d9 JBR-5989 Wayland: jdk_swing_wayland test group 2025-04-12 02:04:01 +02:00
Maxim Kartashёv
fc92964072 JBR-7016 IDEA 2024.2 Wayland: UI Crash when selecting Code and pressing Alt+Enter
(cherry picked from commit 35776b5975)
2025-04-12 02:04:00 +02:00
Maxim Kartashёv
0b362769cd JBR-7493 Wayland: can't start in maximized state on WSL
(cherry picked from commit 18e39cafa0)
2025-04-12 02:04:00 +02:00
Maxim Kartashёv
a61b69563e JBR-7516 Wayland: DamageList_AddList: Assertion `list != add' failed
(cherry picked from commit 674b7d1dac)
2025-04-12 02:04:00 +02:00
Maxim Kartashёv
8bdc2267f3 JBR-7501 Wayland: SurfaceData.flush() method is mis-used
(cherry picked from commit 1299f0f6c6)
2025-04-12 02:04:00 +02:00
Nikita Tsarev
3a60b3ee64 JBR-7478: Fix wrong timestamps on KEY_TYPED events [WLToolkit]
(cherry picked from commit c47edfa7c7)
2025-04-12 02:04:00 +02:00
lbourges
7d7c4c4892 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-04-12 02:04:00 +02:00
Maxim Kartashёv
3598f51156 JBR-7313 Wayland: error: xdg_surface buffer does not match the configured maximized state
(cherry picked from commit 4bb0306175)
2025-04-12 02:04:00 +02:00
Maxim Kartashev
a72ac52c25 JBR-7397 Wayland: make certain interfaces optional
(cherry picked from commit a1dcba231a)
2025-04-12 02:04:00 +02:00
Maxim Kartashev
fb2e14c033 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-04-12 02:04:00 +02:00
Alexey Ushakov
937cfdd336 JBR-7452 Vulkan: Reuse VkRenderPass for multiple renderers (#428)
Moved shared VkRenderPass to the logical device

(cherry picked from commit 3d782ed0f0)
2025-04-12 02:04:00 +02:00
Alexey Ushakov
d29fdbaa2d 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-04-12 02:04:00 +02:00
Nikita Gubarkov
9143863bbd 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-04-12 02:04:00 +02:00
Maxim Kartashёv
2ff1d2af25 JBR-7390 Wayland: need better headless exception message
(cherry picked from commit b68c0ecc6f)
2025-04-12 02:04:00 +02:00
Maxim Kartashёv
d0b3c0321c 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-04-12 02:04:00 +02:00
Maxim Kartashёv
da0ab4a814 JBR-7254 Impossible to copy/paste files in Project tree
(cherry picked from commit 762cd2b23e)
2025-04-12 02:04:00 +02:00
Maxim Kartashev
d454994661 JBR-7290 Wayland: window permanently looses focus after invoking Go To Line dialog
(cherry picked from commit c381634aff)
2025-04-12 02:03:59 +02:00
Alexey Ushakov
b52daec351 JBR-7308 Vulkan: Build failure in vulkan enabled builds
Added missing header (jni_util.h)

(cherry picked from commit 02fb3aee06)
2025-04-12 02:03:59 +02:00
Alexey Ushakov
3242fb5887 JBR-7305 Vulkan: Implement FILL_SPANS primitive for flat color rendering
Implemented flat color shape rendering

(cherry picked from commit 6f84d82d1d)
2025-04-12 02:03:59 +02:00
Nikita Gubarkov
74ab5326ea JBR-7307 Add stub for VKInstance.initNative with disabled Vulkan.
(cherry picked from commit e834ce867f)
2025-04-12 02:03:59 +02:00
Nikita Gubarkov
93b3b523e9 JBR-7237 Fix cyclic dependency of Wayland and Vulkan initialization (#396)
(cherry picked from commit cde482c1fd)
2025-04-12 02:03:59 +02:00
Maxim Kartashёv
e2ea7ea494 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-04-12 02:03:59 +02:00
Alexey Ushakov
ae3311376a JBR-7256 Vulkan: Implement FILL_PARALLELOGRAM primitive for flat color rendering
(cherry picked from commit 57dc1a9e23)
2025-04-12 02:03:59 +02:00
Maxim Kartashev
247718f288 JBR-7237 Separate display connect from WLToolkit initialization
(cherry picked from commit 768d46d049)
2025-04-12 02:03:59 +02:00
Maxim Kartashev
b59506d4cd JBR-7202 wayland: memory leak when resizing windows
(cherry picked from commit 64660b0c00)
2025-04-12 02:03:59 +02:00
Maxim Kartashev
22d1d66e62 JBR-7206 Wayland: Stylepad demo flickers when resizing on KDE
(cherry picked from commit 996d4f7490)
2025-04-12 02:03:59 +02:00
Alexey Ushakov
53f80fa658 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-04-12 02:03:59 +02:00
Maxim Kartashev
8d360e981d JBR-7209 Wayland: modernize window decorations
(cherry picked from commit d3496bc966)
2025-04-12 02:03:59 +02:00
Maxim Kartashev
3803ccf995 JBR-7201 Wayland: update copyright in files generated by wayland-scanner
(cherry picked from commit 33a7167108)
2025-04-12 02:03:59 +02:00
Maxim Kartashev
83669b43e3 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-04-12 02:03:59 +02:00
Maxim Kartashev
3e2c8b05f1 JBR-7158 Wayland: scale with wp_viewport instead of buffer scale
(cherry picked from commit 8227e43343)
2025-04-12 02:03:58 +02:00
Maxim Kartashev
74740f5353 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-04-12 02:03:58 +02:00
Maxim Kartashev
d23649877e JBR-7047 Deadlock on git fetch on Wayland
(cherry picked from commit eabaada5bc)
2025-04-12 02:03:58 +02:00
Maxim Kartashev
6e1ef69dd5 JBR-6576 Wayland: exception when double-clicking dialog title bar
(cherry picked from commit e42b74780b)
2025-04-12 02:03:58 +02:00
Maxim Kartashev
6b13ac6198 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-04-12 02:03:58 +02:00
tsarn
097b63938f JBR-7063: Make .getKeyChar() report chars in KEY_PRESSED/KEY_RELEASED events for compatibility [WLToolkit] (#371)
(cherry picked from commit bc5bdd2b9e)
2025-04-12 02:03:58 +02:00
tsarn
2248f1c486 JBR-6848: Support extra mouse buttons for navigation [WLToolkit]
(cherry picked from commit 2fb530835d)
2025-04-12 02:03:58 +02:00
tsarn
9cb6829a4a JBR-6434: Fix pointer leave also resetting the keyboard modifiers [WLToolkit] (#370)
(cherry picked from commit bae7c40fa5)
2025-04-12 02:03:58 +02:00
tsarn
0a3bf5c938 JBR-7044: Reset clickCount on mouse moves [WLToolkit]
(cherry picked from commit 0dc57e183c)
2025-04-12 02:03:58 +02:00
Maxim Kartashev
93b9264f3e JBR-7010 Wayland: Swing window resizing is not smooth enough
(cherry picked from commit 724bdfbabb)
2025-04-12 02:03:58 +02:00
Maxim Kartashev
47eb4027ea JBR-6926 Wayland: fonts are aliased/grainy on first start
(cherry picked from commit 9ee13ff658)
2025-04-12 02:03:58 +02:00
Maxim Kartashev
84992eb3de JBR-6920 Wayland: some IDEA popups positioned incorrectly
(cherry picked from commit e28d2bacc7)
2025-04-12 02:03:58 +02:00
Maxim Kartashev
a70e88c55b JBR-6895 Wayland: cursor changes to resize at edges even when window is maximized
(cherry picked from commit a634a8b345)
2025-04-12 02:03:58 +02:00
Maxim Kartashev
ab5c9fa0ea JBR-6884 SIGSEGV in Java_sun_java2d_wl_WLSMSurfaceData_pixelsAt
(cherry picked from commit 5b883749de)
2025-04-12 02:03:58 +02:00
Maxim Kartashev
a5a732f92c JBR-6448 Wayland: IDEA window looks pixelated after monitors scale was changed
(cherry picked from commit 3318c2260b)
2025-04-12 02:03:58 +02:00
Maxim Kartashev
505aef2c97 JBR-6814 Wayland: support sun.java2d.uiScale property
(cherry picked from commit 2d420bfd59)
2025-04-12 02:03:57 +02:00
Alexey Ushakov
fe5d04d64d JBR-6787 WLToolkit/wsl: crash in WLComponentPeer.setCursor
Added check for unavailable cursor pData

(cherry picked from commit b24e4bce02)
2025-04-12 02:03:57 +02:00
Maxim Kartashev
65c79ec6db JBR-6783 MouseEvent/MenuDragMouseEventAbsoluteCoordsTest/MenuDragMouseEventAbsoluteCoordsTest.java: Found one Java-level deadlock
(cherry picked from commit 4e391051bd)
2025-04-12 02:03:57 +02:00
Maxim Kartashev
bdb1c3f2ff JBR-6504 Wayland: optional Robot capability to peek at current window's pixels
(cherry picked from commit 4e1bac1d8e)
2025-04-12 02:03:57 +02:00
Maxim Kartashev
7dba39fef1 JBR-6519 Linux: SIGSEGV at [libwayland] wl_proxy_get_version
Guard against passing NULL to libwayland

(cherry picked from commit 74ab4ac224)
2025-04-12 02:03:57 +02:00
Maxim Kartashev
47993c00e6 JBR-6736 libwakefield crashes weston
(cherry picked from commit 6777dcb2f7)
2025-04-12 02:03:57 +02:00
Maxim Kartashev
bc1ab7c02e JBR-6722 OutOfMemoryError: Failed to allocate Wayland surface buffer
(cherry picked from commit 8ccf0e158f)
2025-04-12 02:03:57 +02:00
Maxim Kartashev
69c0b2cf31 JBR-6617 Wayland: java/awt/Frame/HugeFrame/HugeFrame.java crashes JVM
(cherry picked from commit 1d9a2193c9)
2025-04-12 02:03:57 +02:00
Maxim Kartashev
4a8e65e3dc 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-04-12 02:03:57 +02:00
Maxim Kartashev
5a76b907bf JBR-6469 Wayland: java/awt/image/ColorModel/DrawCustomColorModel.java throws UnsupportedOperationException
(cherry picked from commit 40da67b44e)
2025-04-12 02:03:57 +02:00
Maxim Kartashev
4b091586a6 JBR-6467 Wayland: java/awt/GraphicsConfiguration/NormalizingTransformTest/NormalizingTransformTest.java fails
(cherry picked from commit 14339b83cd)
2025-04-12 02:03:57 +02:00
Maxim Kartashev
924e229dd9 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-04-12 02:03:57 +02:00
Maxim Kartashev
7b171fed25 JBR-6559 Wayland: popups may stop working after a while
Cancel the frame callback when hiding a window.

(cherry picked from commit fd4ba3f752)
2025-04-12 02:03:57 +02:00
Maxim Kartashev
5e75b16616 JBR-6452 Wayland: avoid copying entire surface buffers
(cherry picked from commit b13bcec55b)
2025-04-12 02:03:57 +02:00
Maxim Kartashev
2a11f17429 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-04-12 02:03:56 +02:00
Dmitrii Morskii
60837a940e 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-04-12 02:03:56 +02:00
Alexey Ushakov
9e7dee0db6 JBR-6445 Prepare RepaintManager code for displaySync=false
Refactored AWTAccessor code

(cherry picked from commit acbd18f361)
2025-04-12 02:03:56 +02:00
Dmitry Batrak
7ba730578c 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-04-12 02:03:56 +02:00
Maxim Kartashev
4d9c35c504 JBR-6416 Wayland: IDEA maximize button out of sync sometimes
(cherry picked from commit 6122875478)
2025-04-12 02:03:56 +02:00
Maxim Kartashev
ff3120441a JBR-6391 Wayland: memory indicator tooltip flickers
(cherry picked from commit e84bddb1ba)
2025-04-12 02:03:56 +02:00
Dmitrii Morskii
111c6a1457 JBR-6213 Wayland: removed blurring on cursor on multiple monitors with different scales
(cherry picked from commit fa7844da7c)
2025-04-12 02:03:56 +02:00
Maxim Kartashev
33aa2e3f36 JBR-6276 Wayland: WLToolkit logs too much
Changed the logging level for such messages to FINE

(cherry picked from commit e946179554)
2025-04-12 02:03:56 +02:00
Maxim Kartashev
0209777759 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-04-12 02:03:56 +02:00
Maxim Kartashev
b5ac49a11c JBR-6321 Wayland: popup windows do not respect screen bounds
(cherry picked from commit b8b08a36aa)
2025-04-12 02:03:56 +02:00
Maxim Kartashev
609ec7e2a3 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-04-12 02:03:56 +02:00
Maxim Kartashev
7d3bf11f29 JBR-6276 Wayland: WLToolkit logs too much
(cherry picked from commit fee20da837)
2025-04-12 02:03:56 +02:00
Nikita Tsarev
425cdab9cb JBR-5678: Refactor Wayland keyboard support
(cherry picked from commit 070ec5bb8c)
2025-04-12 02:03:56 +02:00
Dmitrii Morskii
a3a6c2a15d JBR-5965 Wayland: implement SplashScreen
(cherry picked from commit c0247eae4f)
2025-04-12 02:03:56 +02:00
Maxim Kartashev
571c259273 JBR-6253 Wayland: can't run in weston because of xdg_wm_base version 3
(cherry picked from commit 79ddf65b83)
2025-04-12 02:03:55 +02:00
Maxim Kartashev
dca5a1f090 JBR-6212 Wayland: app does not terminate upon Wayland protocol error
(cherry picked from commit 5ad4f8a06d)
2025-04-12 02:03:55 +02:00
Maxim Kartashev
3cfdcf466c JBR-6209 Wayland: popup windows cannot be moved
(cherry picked from commit 0aecd427d2)
2025-04-12 02:03:55 +02:00
Maxim Kartashev
6e5d0280d0 JBR-5977 Wayland: make undecorated windows natively resizeable
(cherry picked from commit fc735db0dc)
2025-04-12 02:03:55 +02:00
Maxim Kartashev
005314ca07 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-04-12 02:03:55 +02:00
Maxim Kartashev
fd58f5ebbc JBR-6183 Wayland: clipboard-related exception in headless environment
(cherry picked from commit e302f472f2)
2025-04-12 02:03:55 +02:00
Nikita Gubarkov
191aebac41 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-04-12 02:03:55 +02:00
Alexey Ushakov
2288cf77cf 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-04-12 02:03:55 +02:00
Maxim Kartashev
e11cc2a4f7 JBR-5857 Wayland: implement clipboard support
(cherry picked from commit c155acb7f5)
2025-04-12 02:03:55 +02:00
Dmitry Batrak
54fcf37e95 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-04-12 02:03:55 +02:00
Maxim Kartashev
ef31a8611e JBR-6138 Wayland: utilize gtk_shell1 protocol to mark dialogs as modal
(cherry picked from commit ba60bfa1f4)
2025-04-12 02:03:55 +02:00
Maxim Kartashev
73d05c6253 JBR-6117 Wayland: JVM shutdown hang
(cherry picked from commit 20b2eeb0cc)
2025-04-12 02:03:55 +02:00
Dmitry Batrak
a21d354061 JBR-5961 Wayland: can't switch between projects using menu
prevent using a pointer to destroyed surface

(cherry picked from commit ba1b5cec5f)
2025-04-12 02:03:55 +02:00
Dmitry Batrak
e5678c585e JBR-5961 Wayland: can't switch between projects using menu
fix typo

(cherry picked from commit 1ee3c83ef0)
2025-04-12 02:03:55 +02:00
Dmitry Batrak
af53dd1ae5 JBR-5961 Wayland: can't switch between projects using menu
support Window.toFront in Wayland toolkit

(cherry picked from commit b42043930f)
2025-04-12 02:03:55 +02:00
Maxim Kartashev
c9a0c8a13f JBR-6071 Alpine Linux compilation: error: implicit declaration of function 'pthread_getname_np'
(cherry picked from commit 72722dac36)
2025-04-12 02:03:54 +02:00
Maxim Kartashev
de110474c9 JBR-5989 Wayland: jdk_awt_wayland test group
(cherry picked from commit 05ad0c35dd)
2025-04-12 02:03:54 +02:00
Maxim Kartashev
ad603abb44 JBR-6025 Wayland: miscellaneous small improvements
(cherry picked from commit 9dfeaac204)
2025-04-12 02:03:54 +02:00
Alexey Ushakov
00f694637f 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-04-12 02:03:54 +02:00
Alexey Ushakov
73bb060ee8 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-04-12 02:03:54 +02:00
Maxim Kartashev
d5bead46dd 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-04-12 02:03:54 +02:00
Nikita Gubarkov
ee8a68c3ee 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-04-12 02:03:54 +02:00
Alexey Ushakov
f07fce9456 JBR-6032 WLToolkit: Uninitialized WLComponentPeer sends paint requests
Protected surfaceAssigned from MT access

(cherry picked from commit e5a3802293)
2025-04-12 02:03:54 +02:00
Alexey Ushakov
764eb0ff9e JBR-6032 WLToolkit: Uninitialized WLComponentPeer sends paint requests
Skip sending paint events for not configured peers

(cherry picked from commit 145d6405e4)
2025-04-12 02:03:54 +02:00
Maxim Kartashev
298049bb04 JBR-5968 Wayland: support PERPIXEL_TRANSLUCENT
(cherry picked from commit 35bb2d2489)
2025-04-12 02:03:54 +02:00
Nikita Tsarev
77f50e3cae JBR-5963: Fix RobotKeyboard test and implement getLockingKeyState
(cherry picked from commit 8210596700)
2025-04-12 02:03:54 +02:00
Maxim Kartashev
a5154c3016 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-04-12 02:03:54 +02:00
Nikita Tsarev
f51838a218 Regenerate wakefield-client-protocol using an older wayland-scanner to temporarily fix build problems
(cherry picked from commit 7310c73a94)
2025-04-12 02:03:54 +02:00
Nikita Tsarev
301358ab28 JBR-5676: Support emulating input events in Wakefield
(cherry picked from commit 6544d9d976)
2025-04-12 02:03:54 +02:00
Nikita Tsarev
d0da2b08bc JBR-5900: Fix deadlock when enabling the Wakefield extension
(cherry picked from commit f1712ababd)
2025-04-12 02:03:53 +02:00
Nikita Tsarev
2701b4d30a JBR-5896: Fix WLToolkit being instantiated twice
(cherry picked from commit 1bdfdc275d)
2025-04-12 02:03:53 +02:00
Maxim Kartashev
eb9a5ec845 JBR-5861 Wayland: minimum necessary stubs to run IDEA
(cherry picked from commit d8dbfd7249)
2025-04-12 02:03:53 +02:00
Alexey Ushakov
999eb3b6db 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-04-12 02:03:53 +02:00
Maxim Kartashev
2e10121840 JBR-5661 Wayland: implement heavy-weight popup windows
(cherry picked from commit abdfb7231b)
2025-04-12 02:03:53 +02:00
Maxim Kartashev
f558aeebc4 JBR-5666 Wayland: WLToolkit doesn't work with weston
Multiple Wayland buffers support.

(cherry picked from commit 4541c118ff)
2025-04-12 02:03:53 +02:00
Maxim Kartashev
6daf074a76 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-04-12 02:03:53 +02:00
Maxim Kartashev
99de85cf96 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-04-12 02:03:53 +02:00
Maxim Kartashev
9242985101 JBR-5655 java/awt/Toolkit/Wayland/WaylandToolkit.java: WLToolkit not found
WLToolkit made operational in headless mode

(cherry picked from commit 5679e134a7)
2025-04-12 02:03:53 +02:00
Maxim Kartashev
a1f39b3d59 Wayland: fix AWT initialization on macOS
(cherry picked from commit 382e6c6989)
2025-04-12 02:03:53 +02:00
Maxim Kartashev
1a1aa60d11 Wayland: fixed build errors on macOS
(cherry picked from commit 82fe989dd7)
2025-04-12 02:03:53 +02:00
Maxim Kartashev
84933fa405 Wayland: fixed build errors with older versions of Wayland
(cherry picked from commit d6150b8c8b)
2025-04-12 02:03:53 +02:00
Alexey Ushakov
8e6d5b05a1 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-04-12 02:03:53 +02:00
Vitaly Provodin
f25d0a0322 Update README.md
(cherry picked from commit 49c5e7dd3a)
2025-04-12 02:03:53 +02:00
Vitaly Provodin
542b17e156 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-04-12 02:03:52 +02:00
Vitaly Provodin
0cfdfd8ca8 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-04-12 02:03:52 +02:00
Nikita Tsarev
3e193e422e JBR-7529: Explicitly check for press-and-hold in performKeyEquivalent
(cherry picked from commit 9fadadf039)
2025-04-12 02:03:52 +02:00
Vitaly Provodin
6953decb63 JBR-7517 build JBR artefacts with CDS archives
(cherry picked from commit 0b5462b3ec)
2025-04-12 02:03:52 +02:00
Vitaly Provodin
238be32c08 Update README.md
(cherry picked from commit d27df085c7)
2025-04-12 02:03:52 +02:00
bourgesl
fda85b1ad3 JBR-7460: fixed (macos) MTLTexturePool GC implementation: minor syntax updates from JBR-7461
(cherry picked from commit 713162c6b5)
2025-04-12 02:03:52 +02:00
Nikita Tsarev
2109a188cb JBR-7426: Fix cancelling press-and-hold causing some future key events being swallowed
(cherry picked from commit a07d5e4a60)
2025-04-12 02:03:52 +02:00
bourgesl
df47588d66 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-04-12 02:03:52 +02:00
Dmitrii Morskii
4c435389e6 JBR-6772 handled case with adding new timers after VM was suspended
(cherry picked from commit 1dd81b186b)
2025-04-12 02:03:52 +02:00
Maxim Kartashёv
d693685967 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-04-12 02:03:52 +02:00
Sergey Shelomentsev
96e2d61eee Update jbr-api version to 1.0.2
(cherry picked from commit 9c4a2ac50a)
2025-04-12 02:03:52 +02:00
Stanislav Dombrovsky
62085dc945 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-04-12 02:03:52 +02:00
Nikita Tsarev
17f1a37d3c JBR-6588: JBR API for inspecting certain properties of KeyEvents
(cherry picked from commit cf2abf34d7)
2025-04-12 02:03:52 +02:00
Nikita Tsarev
f690e43604 JBR-7449: Fix press-and-hold cancel keys not being swallowed by JBR
(cherry picked from commit a0dbdff2b0)
2025-04-12 02:03:52 +02:00
Alexey Ushakov
89f69730df 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-04-12 02:03:51 +02:00
Artem Bochkarev
58c9c878f7 JBR-5405: supported BufImgSurfaceData
(cherry picked from commit 3c2d26f834)
2025-04-12 02:03:51 +02:00
Maxim Kartashev
ee4cbd1405 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-04-12 02:03:51 +02:00
Artem Bochkarev
17b3298b04 JBR-4430 Fixed execution permissions on Linux
(cherry picked from commit f3896017f0)
2025-04-12 02:03:51 +02:00
Vitaly Provodin
004d5a2119 update exclude list on results of 21.0.3_b517.1 test runs
(cherry picked from commit 88a92ef655)
2025-04-12 02:03:51 +02:00
Vitaly Provodin
ed3f51128b Update README.md
(cherry picked from commit 4d2ddff1f8)
2025-04-12 02:03:51 +02:00
bourgesl
384280c04b 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-04-12 02:03:51 +02:00
Vitaly Provodin
8fb9eb251b Update README.md
(cherry picked from commit 2edeae7740)
2025-04-12 02:03:51 +02:00
Vitaly Provodin
0cbd5dc110 JBR-6696: fix drawableId usage + revert PrinterJob changes (non-appkit thread)
(cherry picked from commit 5229c513e3)
2025-04-12 02:03:51 +02:00
Vitaly Provodin
3bd9699902 Update README.md
(cherry picked from commit c6583bd7fc)
2025-04-12 02:03:51 +02:00
Vitaly Provodin
6620061922 Update README.md
(cherry picked from commit db562b31b0)
2025-04-12 02:03:51 +02:00
bourgesl
0d28ca8b14 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-04-12 02:03:51 +02:00
Alexey Ushakov
1d32dfc156 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-04-12 02:03:51 +02:00
Nikita Tsarev
cb86543e5b JBR-6764: Add null check on hostAdapterLocator
(cherry picked from commit 7396316337)
2025-04-12 02:03:51 +02:00
Sergey Shelomentsev
46ec4b8ad5 JBR-4912 test moved from JBR repository
(cherry picked from commit 4732942427)
2025-04-12 02:03:51 +02:00
Nikita Provotorov
e236608efd 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-04-12 02:03:50 +02:00
Nikita Tsarev
1a7f9a5d14 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-04-12 02:03:50 +02:00
Vitaly Provodin
b0460a76b4 Update README.md
(cherry picked from commit ca6ad3d091)
2025-04-12 02:03:50 +02:00
Artem Bochkarev
ae35d4ba59 JBR-5405: implementation of direct raster loading for VolatileImage
(cherry picked from commit d963035445)
2025-04-12 02:03:50 +02:00
Vitaly Provodin
573c6cb18f update exclude list on results of 21.0.3_b479 test runs
(cherry picked from commit 3c65d18f2e)
2025-04-12 02:03:50 +02:00
Vitaly Provodin
93884b3f03 fixup! JBR-7263 introduce /othervm for the tests specifying -Djetbrains.runtime.api.extendRegistry=true
(cherry picked from commit b85f46318a)
2025-04-12 02:03:50 +02:00
bourgesl
a9eb2e7285 JBR-7170: fixed NPE if peer is null
(cherry picked from commit a786741193)
2025-04-12 02:03:50 +02:00
Sergey Shelomentsev
32e022378a Set jbr-api version to 1.0.0
(cherry picked from commit fa825aee1d)
2025-04-12 02:03:50 +02:00
Nikita Tsarev
f075ac08a4 JBR-7133: JBR API for IME replacement range on macOS
(cherry picked from commit b807d0f946)
2025-04-12 02:03:50 +02:00
Vitaly Provodin
c7d3219a81 update exclude lists removing lines related to fixed issues
(cherry picked from commit 4526475115)
2025-04-12 02:03:50 +02:00
Vitaly Provodin
53a7fce32f Update README.md
(cherry picked from commit 48e2248486)
2025-04-12 02:03:50 +02:00
Maxim Kartashev
c34f904c49 JBR-5761 Make error printing more robust during early stages of VM initialization
(cherry picked from commit 84d95894e4)
2025-04-12 02:03:50 +02:00
bourgesl
c00369ab59 JBR-7170: added explicit @available for addPresentedHandler()
(cherry picked from commit 7973a4cff4)
2025-04-12 02:03:50 +02:00
bourgesl
5ce997be95 JBR-7170: implement FPS counters for metal using callbacks from MTLLayer presentHandler
(cherry picked from commit cf06dcc383)
2025-04-12 02:03:50 +02:00
Nikita Gubarkov
bad13b8f79 JBR-5615 add sun.java2d.logDisplays VM option
It prints to stdout whenever display configuration is changed.

(cherry picked from commit 8eec3188c6)
2025-04-12 02:03:49 +02:00
Nikita Gubarkov
c4b457046c 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-04-12 02:03:49 +02:00
Roman Shevchenko
9b51b707da JBR-7194: extension-based filters in native file dialogs
(cherry picked from commit cf5d136b3e)
2025-04-12 02:03:49 +02:00
Nikita Tsarev
1e8991f533 JBR-7134: Fix InputMethodTests on macOS
(cherry picked from commit 7a970238af)
2025-04-12 02:03:49 +02:00
Vitaly Provodin
f5533321f0 Update README.md
(cherry picked from commit 6514818b3b)
2025-04-12 02:03:49 +02:00
Dmitrii Morskii
4eb2a87432 JBR-7128 Use the correct WmSize event type for JFrame moved to another monitor
author: Sergei Tachenov
(cherry picked from commit 01f1c7e15d)
2025-04-12 02:03:49 +02:00
Vitaly Provodin
034430be6b Update README.md
(cherry picked from commit 6242827cd1)
2025-04-12 02:03:49 +02:00
Vitaly Provodin
16ba130f26 update exclude list on results of 21.0.3_b453.2 test runs
(cherry picked from commit 1bc34d2a51)
2025-04-12 02:03:49 +02:00
Sergey Shelomentsev
6694f29589 JBR-7117 Set initial display mode after test execution
(cherry picked from commit e4530745c2)
2025-04-12 02:03:49 +02:00
Vitaly Provodin
57ea6ded39 Update README.md
(cherry picked from commit 0e705dc638)
2025-04-12 02:03:49 +02:00
Maxim Kartashev
1921b4027a 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-04-12 02:03:49 +02:00
Vitaly Provodin
aa0958b8dd Update README.md
(cherry picked from commit 9ace20e1e1)
2025-04-12 02:03:49 +02:00
Dmitry Drobotov
34b97a37df 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-04-12 02:03:49 +02:00
Vitaly Provodin
7b794849dc Update README.md
(cherry picked from commit a66b19eb93)
2025-04-12 02:03:49 +02:00
Vitaly Provodin
74f7d24d0a Update README.md
(cherry picked from commit 68a09733c8)
2025-04-12 02:03:48 +02:00
Vitaly Provodin
43748cf0c9 update exclude list on results of 21.0.3_b446.1 test runs
(cherry picked from commit a0edd1e725)
2025-04-12 02:03:48 +02:00
Nikita Provotorov
a7cb23405a 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-04-12 02:03:48 +02:00
Nikita Tsarev
2d1a01cef0 JBR-7119: respect replacementRange in IME events on macOS
(cherry picked from commit 09c31a6242)
2025-04-12 02:03:48 +02:00
Dmitrii Morskii
0b89ce2f74 JBR-6376: implement detecting of OS theme on linux
(cherry picked from commit d8aaa3da47)
2025-04-12 02:03:48 +02:00
Dmitrii Morskii
cd66558ac6 Revert "JBR-6372: implement detecting of OS theme on linux"
This reverts commit a657e4e2cbce139f2c5b53c7fb5f30d81f99e311.

(cherry picked from commit c626c9f220)
2025-04-12 02:03:48 +02:00
Nikita Gubarkov
8ff4211224 JBR-7046 Tolerate subpixelResolution=0 in Metal and OGL
(cherry picked from commit 28d0f00899)
2025-04-12 02:03:48 +02:00
Maxim Kartashev
7e73f32211 JBR-5611 Window header is visible but body not on Linux Ubuntu with external display
(cherry picked from commit 96494dd000)
2025-04-12 02:03:48 +02:00
Nikita Gubarkov
97cdc93dcf 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-04-12 02:03:48 +02:00
Nikita Tsarev
a60f034471 Disable flappy KeyCodesTest assertions, see JBR-6888
(cherry picked from commit 7f5dd368e3)
2025-04-12 02:03:48 +02:00
Sergei Tachenov
fefbc132f5 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-04-12 02:03:48 +02:00
Ajit Ghaisas
43bd613c0f update exclude list on results of main.2176 test runs
(cherry picked from commit 82a97445bd)
2025-04-12 02:03:48 +02:00
Vitaly Provodin
3014733a1a introduce jbMuslProblemList.txt exclude list
(cherry picked from commit 17c6238051)
2025-04-12 02:03:48 +02:00
Vitaly Provodin
0577d6222a update exclude list on results of 21.0.2_b427.6 test runs
(cherry picked from commit e768c854cf)
2025-04-12 02:03:48 +02:00
Sergei Tachenov
acde355a43 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-04-12 02:03:48 +02:00
Maxim Kartashev
3ca96caa18 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-04-12 02:03:47 +02:00
Nikita Gubarkov
74f1ed5e9b JBR-6927 Safe asynchronous destruction of Metal graphics config.
(cherry picked from commit eee433fe5e)
2025-04-12 02:03:47 +02:00
Nikita Gubarkov
695680405e Fix Windows AWT compilation errors
Frame, Window, FileDialog, CustomTitleBar

(cherry picked from commit 2ada4a575b)
2025-04-12 02:03:47 +02:00
Vitaly Provodin
a69567231d Update README.md
(cherry picked from commit 0ea55b1641)
2025-04-12 02:03:47 +02:00
Vitaly Provodin
0d135e66ff JBR-6639 Docker images for JBR/JCEF testing
(cherry picked from commit 1342899218)
2025-04-12 02:03:47 +02:00
Vitaly Provodin
7fa9d78d4a JBR-6915 add the option -w into mkimages scripts
(cherry picked from commit 56bb878275)
2025-04-12 02:03:47 +02:00
Alexey Ushakov
0f3539154d 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-04-12 02:03:47 +02:00
Dmitrii Morskii
bd3dbbaaeb JBR-6171 removing deadlock related to calling getCurrentServerTime
(cherry picked from commit 5fa4617d38)
2025-04-12 02:03:47 +02:00
Maxim Kartashev
166bbe6714 JBR-6847 Improve locking performance on Windows
Use -XX:+UnlockExperimentalVMOptions -XX:-UseCriticalSection
to revert to the old behavior

(cherry picked from commit 72ffacf34a)
2025-04-12 02:03:47 +02:00
Vitaly Provodin
b32584c094 update exclude list on results of 21.0.2_b417.1 test runs
(cherry picked from commit b77ac8db98)
2025-04-12 02:03:47 +02:00
Dmitrii Morskii
a5fb41908d JBR-6372: implement detecting of OS theme on linux
(cherry picked from commit 1d47383016)
2025-04-12 02:03:47 +02:00
Vitaly Provodin
ae9b0b6edd 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-04-12 02:03:47 +02:00
Nikita Gubarkov
31cd731125 JBR-6723 Deal with integer overflow in DrawGlyphList with enabled subpixelResolution
(cherry picked from commit 8b34ae396c)
2025-04-12 02:03:47 +02:00
Vitaly Provodin
de9b262a86 Update README.md
(cherry picked from commit bdae8e43fb)
2025-04-12 02:03:47 +02:00
Nikita Provotorov
9e9b0c9494 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-04-12 02:03:46 +02:00
Dmitrii Morskii
01f5e5280e JBR-6541 Added ability to get supported features and stylistic sets for font
(cherry picked from commit 170e743a13)
2025-04-12 02:03:46 +02:00
Nikita Tsarev
a096019979 increase delay in InputMethodTest
(cherry picked from commit 8048ea52f7)
2025-04-12 02:03:46 +02:00
Nikita Tsarev
96c78e5fb3 JBR-6704: Fix extra IME events when a ctrl shortcut causes window focus switch [macOS]
(cherry picked from commit 4d851790cd)
2025-04-12 02:03:46 +02:00
Nikita Tsarev
dc8b64feb7 JBR-6331: Fix some memory safety issues in macOS keyboards
(cherry picked from commit 0f9ba8771f)
2025-04-12 02:03:46 +02:00
Nikita Tsarev
d5ee901799 JBR-6028: Check before attempting to switch to a layout that might not exist in KeyCodesTest
(cherry picked from commit 421dd1fa69)
2025-04-12 02:03:46 +02:00
Nikita Tsarev
eefaa477ad InputMethodTest: fix certain IMEs not being added properly
(cherry picked from commit 621a5e37d6)
2025-04-12 02:03:46 +02:00
Nikita Tsarev
66a53afbb4 JBR-5379: Ignore input events only on permament focus loss
(cherry picked from commit ca8aebd211)
2025-04-12 02:03:46 +02:00
Nikita Tsarev
838f10d065 JBR-5630: vmoption to change dead key reporting behavior on macOS
(cherry picked from commit aeb6569d4c)
2025-04-12 02:03:46 +02:00
Nikita Tsarev
e581db0ec5 JBR-5469: Fix NextAppWinKey behavior with certain keys
(cherry picked from commit 9a1d6d1813)
2025-04-12 02:03:46 +02:00
Nikita Tsarev
299f552ab6 JBR-5558: macOS keyboard rewrite 2
(cherry picked from commit 81f3819f4e)
2025-04-12 02:03:46 +02:00
Nikita Tsarev
ee47539f8d JBR-5295: Fix wrong keycodes for non-letter keys that lack a corresponding VK_ constant on macOS
(cherry picked from commit 3c42e56d93)
2025-04-12 02:03:46 +02:00
Nikita Tsarev
424cf2af25 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-04-12 02:03:46 +02:00
Nikita Tsarev
afaa1f11f9 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-04-12 02:03:46 +02:00
Nikita Tsarev
ebd5c1258c JBR-5233 Setup/teardown necessary keyboard layouts in macOS keyboard tests
(cherry picked from commit 1fa48463f2)
2025-04-12 02:03:45 +02:00
Nikita Tsarev
be2260c6f4 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-04-12 02:03:45 +02:00
Nikita Tsarev
b2c8fb8bc7 Revert "macOS national keyboard support"
This reverts commit 21bffd06bc.

(cherry picked from commit 7806ef7ff3)
2025-04-12 02:03:45 +02:00
Nikita Provotorov
672ade1171 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-04-12 02:03:45 +02:00
Nikita Tsarev
f37e2e03fa JBR-4990: Undo changes to ExtendedKeyCodes
(cherry picked from commit 823086623e)
2025-04-12 02:03:45 +02:00
Nikita Tsarev
ae67c8daa8 JBR-3860: Fix shortcut behavior when Shift is the only modifier
(cherry picked from commit e419730031)
2025-04-12 02:03:45 +02:00
Nikita Tsarev
90e0ae2567 JBR-4990: Fix regression tests for national keyboard layouts on macOS
(cherry picked from commit 5835150f63)
2025-04-12 02:03:45 +02:00
Vitaly Provodin
b1f7bfb94e update exclude list on results of 21.0.2_b393.7 test runs
(cherry picked from commit a396e62035)
2025-04-12 02:03:45 +02:00
Nikita Gubarkov
e1235f73d4 JBR-6723 flush vertex cache and command buffer before freeing glyph cache. (#334)
(cherry picked from commit 1faccf3995)
2025-04-12 02:03:45 +02:00
Alexey Ushakov
c78ba05cdb JBR-6785 wsl: update build scripts for linux target
Added explicit platform target

(cherry picked from commit 3b96e66202)
2025-04-12 02:03:45 +02:00
Vitaly Provodin
1c1e2e6089 Update README.md
(cherry picked from commit 74b00b6c2f)
2025-04-12 02:03:45 +02:00
Vitaly Provodin
569300a240 Update README.md
(cherry picked from commit 163ce4ecce)
2025-04-12 02:03:45 +02:00
Maxim Kartashev
9988aa29e0 JBR-6742 Record resident set size in JVM fatal error log
(cherry picked from commit 5cc72b464b)
2025-04-12 02:03:45 +02:00
Alexey Ushakov
4f82dc9dd3 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-04-12 02:03:45 +02:00
Dmitry Drobotov
959acc6599 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-04-12 02:03:45 +02:00
Vitaly Provodin
315db71c66 update exclude list linux-x86 failures
(cherry picked from commit 264bcf41f9)
2025-04-12 02:03:44 +02:00
Vitaly Provodin
9e14088f71 update exclude list on results of 22_b2075 test runs
(cherry picked from commit 37a71238b2)
2025-04-12 02:03:44 +02:00
Vitaly Provodin
a28d4d797d update exclude list - remove failures no having tickets
(cherry picked from commit 4d11023858)
2025-04-12 02:03:44 +02:00
Nikita Provotorov
ef857a9b2b 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-04-12 02:03:44 +02:00
Dmitry Drobotov
f86c44ceb3 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-04-12 02:03:44 +02:00
Vitaly Provodin
8380602f43 Update README.md
(cherry picked from commit b93b6a39fc)
2025-04-12 02:03:44 +02:00
Dmitrii Morskii
693b9dee56 JBR-5500 Handled situation of processing WM_ENDSESSION in process of closing application
(cherry picked from commit c87b70ad46)
2025-04-12 02:03:44 +02:00
Vitaly Provodin
0b405ad6f6 Update README.md
(cherry picked from commit 588d57f140)
2025-04-12 02:03:44 +02:00
Dmitry Drobotov
b2c5970f12 JBR-6472 Add default value in CAccessibility.isComboBoxEditable to avoid NPE
(cherry picked from commit 93937603b3)
(cherry picked from commit 6a70aebb6b)
2025-04-12 02:03:44 +02:00
Alexey Ushakov
37101c08ed JBR-6612 Provide standard scripts for performance measurements
run_rp.sh - additional checks

(cherry picked from commit e1cf099c09)
2025-04-12 02:03:44 +02:00
Maxim Kartashev
7134d64895 JBR-6246 Do not overwrite CDS archives after created with jlink
(cherry picked from commit 457e760872)
2025-04-12 02:03:44 +02:00
Alexey Ushakov
8afa1ece37 JBR-6612 Provide standard scripts for performance measurements
Initial implementation for linux and macOS

(cherry picked from commit fe09bf671b)
2025-04-12 02:03:44 +02:00
Nikita Tsarev
a6af77dec0 JBR-6297: Don't check for NSInputManager wantsToHandleMouseEvents in mouseDown by default
(cherry picked from commit c08268def6)
2025-04-12 02:03:44 +02:00
Maxim Kartashev
99bb564dae Update README.md with up-to-date build instructions
(cherry picked from commit 695d0a0577)
2025-04-12 02:03:44 +02:00
Vitaly Provodin
e1beebd829 Update README.md
(cherry picked from commit 22f4dd6d4a)
2025-04-12 02:03:43 +02:00
Vitaly Provodin
4846c8bdbb Update README.md
(cherry picked from commit c6cc4d76c1)
2025-04-12 02:03:43 +02:00
Alexey Ushakov
d9fa6b1b09 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-04-12 02:03:43 +02:00
Nikita Gubarkov
8253c3757a JBR-4618 Force window size update after display reconfiguration
- Re-create all GraphicsDevices on displayChanged()

(cherry picked from commit a59d4903b2)
2025-04-12 02:03:43 +02:00
Dmitrii Morskii
3174290323 JBR-6671 added option 'freetype.font.rendering'
(cherry picked from commit a24c5bbcdb)
2025-04-12 02:03:43 +02:00
Dmitrii Morskii
298ef611be Revert "JBR-6346 update Inter font version"
This reverts commit 7712e529330674b83e39c8e81701db32436d42dc.

(cherry picked from commit 1752433479)
2025-04-12 02:03:43 +02:00
bourgesl
e750705402 Revert "JBR-6522: ensure thread-safety in MTLGC_DestroyMTLGraphicsConfig (pthread_mutex_t)"
This reverts commit e7e3638c52.

(cherry picked from commit a2ee33a45a)
2025-04-12 02:03:43 +02:00
bourgesl
fc5a5b3037 JBR-6522: ensure thread-safety in MTLGC_DestroyMTLGraphicsConfig (pthread_mutex_t)
(cherry picked from commit 3ddc59a433)
2025-04-12 02:03:43 +02:00
Vitaly Provodin
5b328cef4d JBR-6649 add synchronization for creating UI
(cherry picked from commit 9618df8e14)
2025-04-12 02:03:43 +02:00
Nikita Gubarkov
dc00846327 JBR-6651 Exclude keycap emoji from EmojiVariation test.
(cherry picked from commit bb1926d974)
2025-04-12 02:03:43 +02:00
Vitaly Provodin
c2dc7df349 update exclude list on results of 22_b2014 test runs
(cherry picked from commit 99eb375cfd)
2025-04-12 02:03:43 +02:00
Vitaly Provodin
e2ccae790d JBR-6620 restore displayMode to the state that was before running the test
(cherry picked from commit 285d3d3860)
2025-04-12 02:03:43 +02:00
Dmitrii Morskii
3758ab4498 JBR-6346 update Inter font version
(cherry picked from commit 30820c33ba)
2025-04-12 02:03:43 +02:00
Vitaly Provodin
7dd71896f9 Update README.md
(cherry picked from commit 4fef254b44)
2025-04-12 02:03:43 +02:00
Vitaly Provodin
3b7c448b9b remove resolved issues from exclude list
(cherry picked from commit 1bdef4e67a)
2025-04-12 02:03:42 +02:00
Vitaly Provodin
1062785d77 Update README.md
(cherry picked from commit 888e8bda45)
2025-04-12 02:03:42 +02:00
Dmitrii Morskii
834309e50a JBR-6604 supported case when fonts directory is missing
(cherry picked from commit a622888816)
2025-04-12 02:03:42 +02:00
Aleksey Shipilev
66a091e6da update exclude list on results of main.2003 test runs
(cherry picked from commit 2f441c0a3b)
2025-04-12 02:03:42 +02:00
Vitaly Provodin
dea8a8faaf JBR-6591 specify values for the configure options --with-vendor-url and --with-vendor-bug-url
(cherry picked from commit b7f236be6b)
2025-04-12 02:03:42 +02:00
Dmitry Batrak
c037b1db2c 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-04-12 02:03:42 +02:00
Vitaly Provodin
672842477a JBR-6558 synchronize drawing and the test checking
(cherry picked from commit a8f38d8682)
2025-04-12 02:03:42 +02:00
Vitaly Provodin
2cc1808676 JBR-6556 add saving screenshots for analysis of test failures
(cherry picked from commit 9330ab5416)
2025-04-12 02:03:42 +02:00
Vitaly Provodin
9160559498 update exclude list on results of 21.0.1_b334 test runs
(cherry picked from commit f4c811c548)
2025-04-12 02:03:42 +02:00
Dmitrii
07d53d4645 JBR-3098 move repaintPeer event from AppKit thread to EDT on macos
(cherry picked from commit 11d3e5414f)
2025-04-12 02:03:42 +02:00
Nikita Gubarkov
cfc21262e6 JBR-6264 Improved coordinate conversion in XWayland mode
(cherry picked from commit 9c96ecd2f7)
2025-04-12 02:03:42 +02:00
bourgesl
9ae878d37f JBR-6505: removed extra setNeedDisplay() in startRedrawIfNeeded() to restore JavaDraw performance (more frames rendered than real vsync FPS)
(cherry picked from commit d046741a56)
2025-04-12 02:03:42 +02:00
Vitaly Provodin
7584e655c8 update exclude list on results of 21.0.1_b331.1 test runs
(cherry picked from commit 4d755ad656)
2025-04-12 02:03:42 +02:00
Vitaly Provodin
b160cf10d4 JBR-5863 add verbose mode thata saves the captured image
(cherry picked from commit b83c0ddca7)
2025-04-12 02:03:42 +02:00
Vitaly Provodin
eeced3d209 JBR-6493 add jtreg test
(cherry picked from commit 96ee046fdc)
2025-04-12 02:03:41 +02:00
Vitaly Provodin
25f3a543cf update exclude list on results of 23_b1960 test runs
(cherry picked from commit f36606576d)
2025-04-12 02:03:41 +02:00
Dmitrii Morskii
0ceab00dbe Revert "JBR-6346 update Inter font version"
This reverts commit 9aa690a94e.

(cherry picked from commit c97c8eb5fd)
2025-04-12 02:03:41 +02:00
bourgesl
c38219042f JBR-6241: RenderPerf 23.12: remove older RenderPerfTest in src
(cherry picked from commit eeae9a1cb2)
2025-04-12 02:03:41 +02:00
Vitaly Provodin
d5849d6cf5 JBR-6454 add synchronization at disposing windows
(cherry picked from commit 48bc9affc9)
2025-04-12 02:03:41 +02:00
bourgesl
7d5e6f3702 JBR-6377: fixed MTLLayer.redrawCount = 1 to avoid extra redraws with multiple windows
(cherry picked from commit 52610b9bf2)
2025-04-12 02:03:41 +02:00
Maxim Kartashev
d9e248d15a 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-04-12 02:03:41 +02:00
Nikita Gubarkov
bde6d8a55b 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-04-12 02:03:41 +02:00
Alexey Ushakov
b69a737352 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-04-12 02:03:41 +02:00
Alexey Ushakov
0435a7c904 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-04-12 02:03:41 +02:00
Dmitrii Morskii
181eaf80d6 JBR-6346 update Inter font version
(cherry picked from commit 37ac0f2c3d)
2025-04-12 02:03:41 +02:00
Nikita Provotorov
aaef1972a0 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-04-12 02:03:41 +02:00
Vitaly Provodin
c072b89b76 JBR-6404 synchronize drawing and the test checking
(cherry picked from commit e763bb96ea)
2025-04-12 02:03:41 +02:00
Vitaly Provodin
7b6effd03e JBR-3902 create jbr_all test group
(cherry picked from commit 104bd3086a)
2025-04-12 02:03:41 +02:00
Maxim Kartashev
545d471177 JBR-6002 Linux: maximized window goes fullscreen after being moved between monitors
(cherry picked from commit 83c4c0364698f5bfb682d715bbe4ac70d50f11b3)
(cherry picked from commit 41dde53a30)
2025-04-12 02:03:40 +02:00
ngubarkov
b0c232be63 JBR-5605 ignore empty client area when syncing bounds in XDecoratedPeer.
(cherry picked from commit d2301edbd0de04747817a2d382f587056d954627)
(cherry picked from commit b694ce0e9a)
2025-04-12 02:03:40 +02:00
ngubarkov
a3270de623 JBR-5438 Fix window bounds in XWM#setShellResizable
(cherry picked from commit 0aee99ac703f3b360277293e6e7a2e1aadfaba33)
(cherry picked from commit 637e8e473e)
2025-04-12 02:03:40 +02:00
ngubarkov
a6fbd6fc44 JBR-5265 Workaround incorrect position of content window in queryXLocation.
(cherry picked from commit 26684fd4c761dcd2a4c93673d7732095a2050c9b)
(cherry picked from commit 4f44486d15)
2025-04-12 02:03:40 +02:00
ngubarkov
3b56f6685f JBR-5417 Fix flickering in multi-monitor setups on Linux.
(cherry picked from commit 9b813e21c361e9e4b97c52bdd8eccef0030a7763)
(cherry picked from commit d0fa8194dd)
2025-04-12 02:03:40 +02:00
Dmitry Batrak
040000dbbe 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-04-12 02:03:40 +02:00
Sergey Shelomentsev
8e01571f2e 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-04-12 02:03:40 +02:00
Nikita Provotorov
c3e1636a5f 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-04-12 02:03:40 +02:00
Vitaly Provodin
cd8c5684c6 update exclude list on results of 22_b1930 test runs
(cherry picked from commit def4d8ad64e4b1fea76ace0d9014c1a063e44891)
(cherry picked from commit 32327c3f64)
2025-04-12 02:03:40 +02:00
Vladimir Kharitonov
a75d949081 RDCT-766 add libwayland-cursor.so to ResolveSymbolsTestMinEnv
(cherry picked from commit 9626cc17447b96e8b4a16908f349e682525e3090)
(cherry picked from commit 09d1ab6ca20b51a46dad120ac044346bb2a8d48e)
(cherry picked from commit b3d3fc5bc0)
2025-04-12 02:03:40 +02:00
Vladimir Kharitonov
669b2a7a34 JBR-6272 add resolve symbols tests
(cherry picked from commit a4acdf005c53b1765ad356a740d4569db70e8b02)
(cherry picked from commit 9178b241d5d706c7628d5ebfac0fff8b54029b97)
(cherry picked from commit 262cccdd23)
2025-04-12 02:03:40 +02:00
Vitaly Provodin
5bc4ee0724 JBR-6246 add (re)generating cds archives at jlink step
(cherry picked from commit 5f1b08c70d)
2025-04-12 02:03:40 +02:00
Nikita Gubarkov
2e90b374cd 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-04-12 02:03:40 +02:00
Sergey Shelomentsev
a87af088ee Don't trigger workflow on push
(cherry picked from commit d900720a03)
2025-04-12 02:03:39 +02:00
Dmitrii Morskii
b19095c650 JBR-5724: fixed serialization and backward compatibility of Font
(cherry picked from commit 120cac9145)
2025-04-12 02:03:39 +02:00
Alexander Lobas
81c4c28a50 JBR-4834 JBR-5139 Rounded corners on Mac OS and Windows: support custom border color
(cherry picked from commit 936f47d811)
2025-04-12 02:03:39 +02:00
Dmitrii Morskii
73b05d7322 JBR-6044 handle absence of fontConfig library in setupRenderingFontHints
(cherry picked from commit 6d41e07ffa)
2025-04-12 02:03:39 +02:00
Dmitrii Morskii
2f2881af41 JBR-6041 started using correct type inside FcPatternGetValueFuncType
(cherry picked from commit fc2b096811)
2025-04-12 02:03:39 +02:00
Dmitrii Morskii
b94b845c77 JBR-6018 removed incorrect test testFeaturesZeroFrac
(cherry picked from commit e387761828)
2025-04-12 02:03:39 +02:00
Dmitrii
e6af4d80da JBR-5502: optimize stringWidth & charsWidth methods of FontDesignMetrics
(cherry picked from commit b9eb40284f)
2025-04-12 02:03:39 +02:00
Dmitrii Morskii
bfd10b9f88 JBR-5844: fixed other part of issue. Added missing implementation of native methods in fontconfigmanager
(cherry picked from commit dbd70b4401)
2025-04-12 02:03:39 +02:00
Alexey Ushakov
91d3972d06 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-04-12 02:03:39 +02:00
Dmitrii Morskii
70cc174d1c JBR-5844: fix case with non-scalable face
(cherry picked from commit 490080a315)
2025-04-12 02:03:39 +02:00
Dmitrii Morskii
dcd32bfd14 JBR-5804: refactoring of freetypeScaler and moving fontconfig's logic in separate file
(cherry picked from commit 4700386a2e)
2025-04-12 02:03:39 +02:00
Dmitrii
7b117d7ce7 JBR-5246 add OpenType's features support
(cherry picked from commit a2900b0bd9)
2025-04-12 02:03:39 +02:00
Dmitry Batrak
450d49b0f9 JBR-5751 java/awt/Focus/RowToleranceTransitivityTest.java: Focus got stuck while traversing.
(cherry picked from commit d56b4b045d)
2025-04-12 02:03:39 +02:00
Vitaly Provodin
c98329ae1f JBR-5286 make windows-aarch64 building script identical to the same script in jbr17
(cherry picked from commit a451d19108)
2025-04-12 02:03:39 +02:00
Vitaly Provodin
ff7a397fc7 update jetbrains.api hash and API version
(cherry picked from commit 2a53bf894c)
2025-04-12 02:03:38 +02:00
Vitaly Provodin
b8c7d7edf7 Revert "JBR-5724: fixed serialization and backward compatibility of Font"
This reverts commit c5cc5b4dedbdf73871f14db92afaac15fd985d86.

(cherry picked from commit 34ed77394f)
2025-04-12 02:03:38 +02:00
Vitaly Provodin
9e863eae2a JBR-6246 add default CDS archives into jbrsdk distributions
(cherry picked from commit f103a46a4d)
2025-04-12 02:03:38 +02:00
Dmitry Drobotov
fee3f4190a JBR-4479 Add text caret tracking for macOS Accessibility Zoom
(cherry picked from commit 0dfbf34b37)
(cherry picked from commit 29ce00912d)
2025-04-12 02:03:38 +02:00
Dmitry Drobotov
c28c8a19a1 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-04-12 02:03:38 +02:00
Vitaly Provodin
21cc45d596 Update README.md
(cherry picked from commit 053f3acae4)
2025-04-12 02:03:38 +02:00
Maxim Kartashev
a7abf09943 JBR-6220 javax/swing/GraphicsConfigNotifier/StalePreferredSize.java became failing by time out on Linux
(cherry picked from commit 3f78590707)
2025-04-12 02:03:38 +02:00
Maxim Kartashev
a4fe4de9bd 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-04-12 02:03:38 +02:00
Maxim Kartashev
c392304ffe JBR-5971 Wayland: support WindowMove JBR API
Updated the XToolkit implementation to match API changes required for
WLToolkit

(cherry picked from commit 7492c11138)
2025-04-12 02:03:38 +02:00
Maxim Kartashev
019845d391 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-04-12 02:03:38 +02:00
Maxim Kartashev
5af3584d4f JBR-5637 Linux: implement window position change with WM help
Introduced JBR.isWindowMoveSupported() and
JBR.getWindowMove().startMovingTogetherWithMouse()

(cherry picked from commit 747bc94e8f)
2025-04-12 02:03:38 +02:00
Maxim Kartashev
b0b40721db 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-04-12 02:03:38 +02:00
Alexander Lobas
c80db2daff JBR-5546 Iterating open windows with cmd backtick on Mac forces minimized windows to un-minimize
(cherry picked from commit ffb74e32a0)
2025-04-12 02:03:38 +02:00
Alexander Lobas
ea90978078 JBR-5478 IDEA window doesn't fit the screen properly on turning off/on an external monitor
(cherry picked from commit 24930c2624)
2025-04-12 02:03:38 +02:00
Alexander Lobas
fede89c97a JBR-5384 New UI: window header is hard to resize on the top edge, top/right corner
(cherry picked from commit c4dd01c027)
2025-04-12 02:03:37 +02:00
Alexander Lobas
6ea809125a 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-04-12 02:03:37 +02:00
Dmitry Batrak
8de5c7324c 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-04-12 02:03:37 +02:00
Nikita Gubarkov
34a38b96c5 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-04-12 02:03:37 +02:00
Vitaly Provodin
a762b59c48 update exclude list on results of 21.0.1_b293.1 test runs
(cherry picked from commit a247590ca0)
2025-04-12 02:03:37 +02:00
Nikita Provotorov
bc5c44b141 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-04-12 02:03:37 +02:00
Maxim Kartashev
da7d084473 JBR-6291 runtime/cds/appcds/dynamicArchive/TestDynamicDumpAtOom.java: Attempting to acquire lock OOMEStacks_lock/safepoint out of order
(cherry picked from commit c8c8881be4)
2025-04-12 02:03:37 +02:00
Alexander Lobas
7b7fd36350 JBR-5409 "No Print Service Found" Error when saving to PDF
(cherry picked from commit 9c9859ba1a)
2025-04-12 02:03:37 +02:00
Alexey Ushakov
5547c9cf9e JBR-6281 Remove MTLEvent sync from Metal rendering code
Removed sync code

(cherry picked from commit 660d97005c)
2025-04-12 02:03:37 +02:00
Nikita Provotorov
59ed0d2307 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-04-12 02:03:37 +02:00
Nikita Provotorov
f427b2179f 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-04-12 02:03:37 +02:00
Maxim Kartashev
3590bcf1a1 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-04-12 02:03:37 +02:00
Nikita Provotorov
3a7fc8bdd7 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-04-12 02:03:37 +02:00
Nikita Provotorov
b46756e3f0 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-04-12 02:03:37 +02:00
Vitaly Provodin
c2aa8176c2 JBR-6255 improve calculation JDK_BUILD_NUMBER
(cherry picked from commit 186d1c3229)
2025-04-12 02:03:37 +02:00
Nikita Gubarkov
45e07cbb55 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-04-12 02:03:36 +02:00
Alexey Ushakov
7d5a77d0d9 JBR-5025 Reduce latency during display reconfiguration in Metal
Moved metal load library checks to CGraphicsEnvironment

(cherry picked from commit eeee663bb4)
2025-04-12 02:03:36 +02:00
Alexey Ushakov
08d5054c00 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-04-12 02:03:36 +02:00
Alexey Ushakov
022cce93f1 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-04-12 02:03:36 +02:00
Vitaly Provodin
224abac1ac Update README.md
(cherry picked from commit 74f354be28)
2025-04-12 02:03:36 +02:00
Vladimir Kharitonov
ae213c4667 JBR-6239 sign frameworks in cef_server.app
(cherry picked from commit 8f6ae7a89c)
2025-04-12 02:03:36 +02:00
Maxim Kartashev
028d0e0fe4 JBR-4020 Test ObsoleteFlagErrorMessage fails after +IgnoreUnrecognizedVMOptions has become the default
(cherry picked from commit ae5963a094)
(cherry picked from commit 5b27cdbd14)
2025-04-12 02:03:36 +02:00
Maxim Kartashev
d11a97b7d9 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-04-12 02:03:36 +02:00
Alexey Ushakov
cc55c5dc99 JBR-5741 broken build in main because of hotspot changes (JDK-8309613)
Added missing parameter

(cherry picked from commit c4c6d022f8)
2025-04-12 02:03:36 +02:00
Maxim Kartashev
6432052ab8 JBR-5480 Include more information in OOME crash reports
(cherry picked from commit 44f8dc85da)
2025-04-12 02:03:36 +02:00
Maxim Kartashev
ba9ce548e5 JBR-5466 jb/hotspot/JNIRefsInCrashLog.java: 'hs_err_42.txt' missing from stdout/stderr
(cherry picked from commit e511c26794)
2025-04-12 02:03:36 +02:00
Maxim Kartashev
cb6d354ab0 JBR-5431 Include memory used by JNI references into crash reports
(cherry picked from commit 9a6eb0b730)
2025-04-12 02:03:36 +02:00
Vitaly Provodin
1725074eab Update README.md
(cherry picked from commit 66c66543bb)
2025-04-12 02:03:36 +02:00
bourgesl
e51a3190e4 JBR-5638: improved renderer performance for simple rectangular area (see BBoxAATileGenerator), added new statistics in Renderer
(cherry picked from commit dd4f818488)
2025-04-12 02:03:36 +02:00
Nikita Tsarev
3cff5403e6 JBR-6215: Override XToolkit's default nonintuitive behavior when translating F13-F24 keys
(cherry picked from commit 413b679eda)
2025-04-12 02:03:35 +02:00
Konstantin Bulenkov
56199d3271 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-04-12 02:03:35 +02:00
Nikita Gubarkov
acfa6ea384 JBR-6208 Extended glyph cache for Metal
(cherry picked from commit 6878613df0)
2025-04-12 02:03:35 +02:00
Vitaly Provodin
74fa733df4 JBR-6181 add Linux executables with bundled FreeType
(cherry picked from commit 12449b3de5)
2025-04-12 02:03:35 +02:00
Vitaly Provodin
12419ae776 Update README.md
(cherry picked from commit cff858e253)
2025-04-12 02:03:35 +02:00
Alexey Ushakov
ec898c12dc 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-04-12 02:03:35 +02:00
Dmitrii Morskii
6c74fa9fae JBR-6135 removed dependence on process reading TTF in fixed size chunks
(cherry picked from commit 7c4721fa68)
2025-04-12 02:03:35 +02:00
Alexey Ushakov
8994248c40 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-04-12 02:03:35 +02:00
Vitaly Provodin
5c3721faec Update README.md
(cherry picked from commit 7d1bcef8cd)
2025-04-12 02:03:35 +02:00
Nikita Provotorov
28cca8c6a0 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-04-12 02:03:35 +02:00
Vitaly Provodin
c0a8e6907a JBR-6130 add VK_TAB release action
(cherry picked from commit e16990eb93)
2025-04-12 02:03:35 +02:00
Alexey Ushakov
36278d342f JBR-4983 MacOS Ventura - External monitor lagging
Added extra redraw request

(cherry picked from commit bd436709f5)
2025-04-12 02:03:35 +02:00
ghostflyby
9a1cde830f JBR-6124 Fix macOS services writing text back to textfield
(cherry picked from commit 51bde60b42)
2025-04-12 02:03:35 +02:00
Sergey Shelomentsev
0c8a667f03 exclude FocusTraversalOrderTest
(cherry picked from commit f7004afdb1)
2025-04-12 02:03:35 +02:00
Sergey Shelomentsev
40aa73337d JBR-6060 add focus traversal order test
(cherry picked from commit 40dec50c3a)
2025-04-12 02:03:34 +02:00
Nikita Gubarkov
d28542afea JBR-6016 doPrivileged for JBR API internal services.
(cherry picked from commit 06290bfd1e)
2025-04-12 02:03:34 +02:00
Vitaly Provodin
972eaface9 JBR-6008 Update JetBrains Mono fonts to v2.304
(cherry picked from commit 676a270ac1)
2025-04-12 02:03:34 +02:00
Vitaly Provodin
edb6a4dee4 Update README.md
(cherry picked from commit 0400cd7f9b)
2025-04-12 02:03:34 +02:00
Dmitry Batrak
9af4971a0d JBR-3353 Sibling popup window is shown below dialog on macOS
(cherry picked from commit 4c6f3e4510)
(cherry picked from commit 73678a99d5)
2025-04-12 02:03:34 +02:00
Dmitry Batrak
4f0ecc680b JBR-5953 If hieroglyph typing isn't finalised, focusing another component inserts the composed text there
(cherry picked from commit 5dedf0e367)
2025-04-12 02:03:34 +02:00
Dmitry Batrak
8f4e278c6c JBR-5946 Allow to disable painting of composed text in Swing text components using TextLayout.draw
(cherry picked from commit 3ac357417b)
2025-04-12 02:03:34 +02:00
Dmitry Batrak
4f4824abbb 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-04-12 02:03:34 +02:00
ngubarkov
8ca3ef1ff2 JBR-5240 Fix XToolkit#getScreenInsets in Xinerama mode.
(cherry picked from commit 5df3fc666d)
2025-04-12 02:03:34 +02:00
ngubarkov
b37d0496cf JBR-5316 Fix fractional scaling HIDPI.
(cherry picked from commit acb62617d7)
2025-04-12 02:03:34 +02:00
Nikita Gubarkov
e5d582ad1b 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-04-12 02:03:34 +02:00
Nikita Gubarkov
8bb91ab29f IDEA-141456 Multimonitor HIDPI support for Linux
(cherry picked from commit 980c18ae92)
2025-04-12 02:03:34 +02:00
Dmitrii Morskii
50f6236cc4 JBR-5724: fixed serialization and backward compatibility of Font
(cherry picked from commit e3da733724)
2025-04-12 02:03:34 +02:00
Dmitrii Morskii
604d00981e JBR-5259: fixed Canvas mispositioning after dragging JFrame to a monitor with different scale
(cherry picked from commit de62b80ef2)
2025-04-12 02:03:34 +02:00
Vitaly Provodin
1dd1708983 Update README.md
(cherry picked from commit b438d74f39)
2025-04-12 02:03:33 +02:00
Maxim Kartashev
13905fb251 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-04-12 02:03:33 +02:00
Alexey Ushakov
65a9e950b8 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-04-12 02:03:33 +02:00
bourgesl
241c1d401f 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-04-12 02:03:33 +02:00
Nikita Provotorov
cebe6cd8b6 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-04-12 02:03:33 +02:00
Dmitrii Morskii
fc4c7c8c84 JBR-5548 fix BadSerializationTest
(cherry picked from commit 90d867d08b)
2025-04-12 02:03:33 +02:00
Vitaly Provodin
5f7e972964 Update README.md
(cherry picked from commit 8efb8ded38)
2025-04-12 02:03:33 +02:00
Sergey Shelomentsev
d936f40b24 JBR-5746 wait for menu visibility of fail the test
add mouse events logging

(cherry picked from commit 5a05bd2046)
2025-04-12 02:03:33 +02:00
Dmitry Batrak
131ca62d99 JBR-5720 Wrong modifiers are reported for mouse middle and right buttons' release/clicked events
(cherry picked from commit afa0283f16)
2025-04-12 02:03:33 +02:00
Dmitry Batrak
8d39876428 JBR-5684 Focus state is broken after closing of modal dialog in an inactive application
(cherry picked from commit 2f2fe7a11c)
2025-04-12 02:03:33 +02:00
Vitaly Provodin
f832711de6 update exclude list
(cherry picked from commit 36f380d4b4)
2025-04-12 02:03:33 +02:00
Vitaly Provodin
ce9ff5e328 Update README.md
(cherry picked from commit b4071ba08d)
2025-04-12 02:03:33 +02:00
Alexey Ushakov
bed5bda9b2 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-04-12 02:03:33 +02:00
Dmitrii Morskii
76ad1189ba JBR-1775: improved logic for choosing newer font between system and bundled ones
(cherry picked from commit 41cbdf720c)
2025-04-12 02:03:33 +02:00
Sergey Shelomentsev
0b291a1c60 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-04-12 02:03:33 +02:00
Vitaly Provodin
3cad5293c4 Update README.md
(cherry picked from commit 15fdca4193)
2025-04-12 02:03:32 +02:00
Alexey Ushakov
54ef93339e 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-04-12 02:03:32 +02:00
Alexey Ushakov
f68f2aeb21 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-04-12 02:03:32 +02:00
Sergey Shelomentsev
4bfec74a10 JBR-5670 restore initial display mode after test execution
restore original display mode

(cherry picked from commit d098ad1f77)
2025-04-12 02:03:32 +02:00
Sergey Shelomentsev
b0c15fc4cb JBR-4880 Fix DeadKeySystemAssertionDialog to avoid receiving key event out of the window
(cherry picked from commit 5467dea09b)
2025-04-12 02:03:32 +02:00
Vladislav Rassokhin
434a4fade1 JBR-5600 Reduce noise in signing scripts output
(cherry picked from commit bc145d39be)
2025-04-12 02:03:32 +02:00
Vladislav Rassokhin
9d0813b445 JBR-5600 Sign frameworks as whole, verify framework signature before full app sign
(cherry picked from commit 2fecc58be2)
2025-04-12 02:03:32 +02:00
Nikita Provotorov
2d0b2e1728 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-04-12 02:03:32 +02:00
Vladislav Rassokhin
178aaa1e4e 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-04-12 02:03:32 +02:00
Vladislav Rassokhin
80299e0c75 JBR-5600 Staple .pkg with signature
(cherry picked from commit 6555023fd3)
2025-04-12 02:03:32 +02:00
Vladislav Rassokhin
c5c82194a1 JBR-5600 Notarize macOS binaries using notarytool
(cherry picked from commit 7916ed31b7)
2025-04-12 02:03:32 +02:00
Vladislav Rassokhin
1e0d7df8b3 JBR-5600 Sign macOS binaries using jet-sign
(cherry picked from commit 95ef69df13)
2025-04-12 02:03:32 +02:00
Sergey Shelomentsev
d58cfa8f5e JBR-5579 Update mouse location checks, set window always on top for ActionListenerTest
(cherry picked from commit b867b1c395)
2025-04-12 02:03:32 +02:00
Sergey Shelomentsev
64bee9f87f 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-04-12 02:03:32 +02:00
Sergey Shelomentsev
312074eeb8 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-04-12 02:03:32 +02:00
Sergey Shelomentsev
4eae9e02cf remove jb/java/awt/Window/ZOrderOnModalDialogActivation.java
(cherry picked from commit 9b6037dee3)
2025-04-12 02:03:31 +02:00
Sergey Shelomentsev
7840d9c072 JBR-4494 pass ui scale options for child process
(cherry picked from commit e32e657c55)
2025-04-12 02:03:31 +02:00
Maxim Kartashev
e68de324ff JBR-5656 Builds of JDK 21 are reproducible by default
(cherry picked from commit 0d663a139acf3d5cdb19b33494ab9f6273c4ebfa)
(cherry picked from commit f086917fa7)
2025-04-12 02:03:31 +02:00
bourgesl
cf4a2ba189 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-04-12 02:03:31 +02:00
Alexey Ushakov
4c97354334 JBR-5649 Flickering in multi-monitor configuration
Provided corrected initial value for currentDisplayID

(cherry picked from commit c0f779b7e6)
2025-04-12 02:03:31 +02:00
Vitaly Provodin
2838467027 JBR-5627 add regression test AsyncProfilerRunnerTest
(cherry picked from commit ce37138a4a)
2025-04-12 02:03:31 +02:00
Maxim Kartashev
764df4b6e8 JBR-5631 Refactor Dockerfile for x64 builds
(cherry picked from commit 3bb93255e9)
2025-04-12 02:03:31 +02:00
Vitaly Provodin
273e8355b2 JBR-5603 build aarch64 Linux from arm64v8/centos:7 and check glibc to be not higher 2.17
(cherry picked from commit f6be01d68c)
2025-04-12 02:03:31 +02:00
Alexey Ushakov
bc11af8542 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-04-12 02:03:31 +02:00
Sergey Shelomentsev
fcfe94f913 update a11y exclude list
(cherry picked from commit 5641f7141f)
2025-04-12 02:03:31 +02:00
Alexey Ushakov
217f291040 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-04-12 02:03:31 +02:00
bourgesl
19e16ee894 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-04-12 02:03:31 +02:00
Alexey Ushakov
a6a22269d7 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-04-12 02:03:31 +02:00
Nikita Provotorov
3b7f814b22 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-04-12 02:03:31 +02:00
Alexey Ushakov
f5441734a5 JBR-4883 macOS: SIGSEGV at MTLVertexCache_FlushGlyphVertexCache
Use separate glyph cache for each MTLContext instance. Refactored MTLGlyphCache

(cherry picked from commit 845a30560e)
2025-04-12 02:03:30 +02:00
Alexey Ushakov
b4bcd37382 JBR-5193 Do not use extra commandQueue in metal pipeline
Removed extra command queue

(cherry picked from commit a235903851)
2025-04-12 02:03:30 +02:00
Alexey Ushakov
31dc08fd2c 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-04-12 02:03:30 +02:00
Vitaly Provodin
774185d326 Update README.md
(cherry picked from commit aa1d64ca93)
2025-04-12 02:03:30 +02:00
Maxim Kartashev
da3635cf4a jb/branchdiff.py is a lot faster
(cherry picked from commit 5c3726555d)
2025-04-12 02:03:30 +02:00
Sergey Shelomentsev
b9f5882f2d JBR-5505 update exclude list for a11y testing on Windows
(cherry picked from commit 12330ba916)
2025-04-12 02:03:30 +02:00
Sergey Shelomentsev
b6b8c3aeee JBR-5397 update exclude list for a11y testing on MacOS
(cherry picked from commit 688b16a796)
2025-04-12 02:03:30 +02:00
Sergey Shelomentsev
e9ffe58fa6 JBR-5441 fix wait for idle
(cherry picked from commit 8b5945f834)
2025-04-12 02:03:30 +02:00
Maxim Kartashev
ddcc19029d jb/branchdiff.py to warn if it can't differentiate between commits
(cherry picked from commit 3504702f9c)
2025-04-12 02:03:30 +02:00
Sergey Shelomentsev
11922bb810 JBR-5440 fix calculations for double click location
(cherry picked from commit e468d39869)
2025-04-12 02:03:30 +02:00
Artem Bochkarev
9bf7cc74ae JBR-5426 write JCEF version info inside release file
(cherry picked from commit 59701eefa3)
2025-04-12 02:03:30 +02:00
Maxim Kartashev
55390de8a3 JBR-5445 JBRApiTest test fails on development builds
(cherry picked from commit d9d941f9c5)
2025-04-12 02:03:30 +02:00
Sergey Shelomentsev
aaf8605540 JBR-5433 add typing latency text for JTextArea
(cherry picked from commit c6706f1794)
2025-04-12 02:03:30 +02:00
Vitaly Provodin
d9449af8d1 JBR-5432 increase setAutoDelay for Robot
(cherry picked from commit 17b10df182)
2025-04-12 02:03:30 +02:00
Maxim Kartashev
902378bc0a JBR-5230 Wanted: an ability to use Unix Domain sockets with overridden default NIO file system
(cherry picked from commit 946a7ca9ec)
2025-04-12 02:03:30 +02:00
Sergey Shelomentsev
3958b205c8 fixup! JBR-4875 set proper OS to run ComboBoxTransparentTittleBarTest
(cherry picked from commit 611dcc6475)
2025-04-12 02:03:29 +02:00
Sergey Shelomentsev
6887a32bae fix controls width calculation
(cherry picked from commit b88d26c9dd)
2025-04-12 02:03:29 +02:00
Sergey Shelomentsev
95b1425a5c split ActionListenerTest
(cherry picked from commit 36f13b0158)
2025-04-12 02:03:29 +02:00
Sergey Shelomentsev
30c1f90b8a JBR-5345 native controls detection and scale fixes
(cherry picked from commit e191789794)
2025-04-12 02:03:29 +02:00
Maxim Kartashev
ce1c0ba696 README.md: spelled out JBR distinctive features
(cherry picked from commit 51e9900c8b)
2025-04-12 02:03:29 +02:00
Vitaly Provodin
94ea5bd057 update exclude list on results of 21_b28.1 test runs
(cherry picked from commit 4619c5ed7f)
2025-04-12 02:03:29 +02:00
Alexey Ushakov
749e7b9c21 JBR-5330 Blank Welcome screen after moving to another display
Initialize currentDisplayID on AWTWindow creation

(cherry picked from commit c5ea4e48ac)
2025-04-12 02:03:29 +02:00
Nikita Tsarev
23e8039faa JBR-5369: Update failing tests list in response to macOS keyboard support rewrite
(cherry picked from commit a9313e2d06)
2025-04-12 02:03:29 +02:00
Vitaly Provodin
abe564505e Update README.md
(cherry picked from commit ed3d57cf10)
2025-04-12 02:03:29 +02:00
Vitaly Provodin
b004e7c322 update exclude list on results of 21_b24.2 test runs
(cherry picked from commit 3276006be9)
2025-04-12 02:03:29 +02:00
Vitaly Provodin
bee1868efd Update README.md
(cherry picked from commit 552fa7c32e)
2025-04-12 02:03:29 +02:00
Sergey Shelomentsev
6d85977091 JBR-5350 Separate test for Mac OS
(cherry picked from commit dc4a094f03)
2025-04-12 02:03:29 +02:00
Sergey Shelomentsev
5ea603f1e4 JBR-5346 run MaximizedCustomDecorationsTest on windows/mac only
(cherry picked from commit c47b6f4880)
2025-04-12 02:03:29 +02:00
Sergey Shelomentsev
5c689b8396 JBR-5350 fix FrameNativeControlTest checks on MacOS
(cherry picked from commit f8f1c8625e)
2025-04-12 02:03:29 +02:00
Sergey Shelomentsev
17028bf8bc JBR-5344 fix incorrectly specified VM options
(cherry picked from commit 2f101dbf8a)
2025-04-12 02:03:29 +02:00
Vitaly Provodin
75322e0efb Update README.md
(cherry picked from commit 952295b14d)
2025-04-12 02:03:28 +02:00
Vitaly Provodin
d1b6c14a6e update exclude list on results of 17.0.6_b855.1 test runs
(cherry picked from commit b018988c02)
2025-04-12 02:03:28 +02:00
Sergey Shelomentsev
a87b154596 JBR-5313 fix broken custom decoration tests on Windows
(cherry picked from commit c6e21bdbad)
2025-04-12 02:03:28 +02:00
Sergey Shelomentsev
dd0296956e JBR-5253 Use new JBR API for custom decorations
(cherry picked from commit fdead3d90a)
2025-04-12 02:03:28 +02:00
Vitaly Provodin
f7d69156bf JBR-5300 move jbr-api.jar into test artefact
(cherry picked from commit f199d6c98a)
2025-04-12 02:03:28 +02:00
Vitaly Provodin
5b359260ae update exclude list on results of 17.0.6_b837.3 test runs
(cherry picked from commit 415267181c)
2025-04-12 02:03:28 +02:00
Maxim Kartashev
a2b13cd156 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-04-12 02:03:28 +02:00
Sergey Shelomentsev
51740e3075 set version for building jbr-api
(cherry picked from commit 6a0113fd07)
2025-04-12 02:03:28 +02:00
Sergey Shelomentsev
ffe74e6141 get rid of build-jbr-api scripts
(cherry picked from commit 1c8496e757)
2025-04-12 02:03:28 +02:00
Vitaly Provodin
9f628f9c2f clean up exclude lists
(cherry picked from commit de6d9f328f)
2025-04-12 02:03:28 +02:00
Sergey Shelomentsev
abd7aa64e9 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-04-12 02:03:28 +02:00
Sergey Shelomentsev
0f391d4116 build jbr-api as a part of bundle build
(cherry picked from commit 45efe7fdd5)
2025-04-12 02:03:28 +02:00
Vitaly Provodin
83eb83b25a Update README.md
(cherry picked from commit dd24017389)
2025-04-12 02:03:28 +02:00
Vitaly Provodin
040b64b6d2 Update README.md
(cherry picked from commit 45d7501c9f)
2025-04-12 02:03:28 +02:00
Artem Semenov
e754d9231e 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-04-12 02:03:28 +02:00
Alexey Ushakov
b103a3ebbd JBR-5279 restore saving jbr native symbols bin/server/jvm.pdb
(cherry picked from commit 887b9dbcac)
2025-04-12 02:03:27 +02:00
Sergey Shelomentsev
da9de5b9e1 JBR-4875 update test to use new JBR API window custom decorations
(cherry picked from commit df92d71389)
2025-04-12 02:03:27 +02:00
Vitaly Provodin
98964ec4cd Update README.md
(cherry picked from commit 373482ffc4)
2025-04-12 02:03:27 +02:00
Artem Semenov
c60659f431 JBR-5269 Announcement priorities not set correctly (#214)
(cherry picked from commit c34aa6fc6f)
2025-04-12 02:03:27 +02:00
Vitaly Provodin
0236130bf8 Update README.md
(cherry picked from commit 3631c19265)
2025-04-12 02:03:27 +02:00
Artem Semenov
d563269b3b JBR-5248 exception in accessible announcing
(cherry picked from commit a4e0f6018f)
2025-04-12 02:03:27 +02:00
Vitaly Provodin
20bdb24e8a update exclude list on results of 21_b9 test runs
(cherry picked from commit 9f04c32c10)
2025-04-12 02:03:27 +02:00
Vitaly Provodin
61c0529c7e JBR-5217 enable NVDA support in Windows builds
(cherry picked from commit afc5710f21)
2025-04-12 02:03:27 +02:00
Vitaly Provodin
150baf2291 Update README.md
(cherry picked from commit df4fd03fba)
2025-04-12 02:03:27 +02:00
AMPivovarov
03689361aa JBR-5213 JBR API v0.0.9 - add GraphicsUtils (#208)
* relax type constraints in BltBufferStrategy.getDrawGraphics

(cherry picked from commit 715b615d88)
2025-04-12 02:03:27 +02:00
Artem Semenov
a6de5ba0cc JBR-5221 Add announcing to JBRAPI
(cherry picked from commit 7189d50b76)
2025-04-12 02:03:27 +02:00
Vitaly Provodin
41a84a3877 update exclude list on results of 21_b8 test runs
(cherry picked from commit 17d5e3895b)
2025-04-12 02:03:27 +02:00
Artem Semenov
db14bc0d3e JBR-4170 Implement API for announcing
(cherry picked from commit d7f14bf793)
2025-04-12 02:03:27 +02:00
Vitaly Provodin
0b4b89856b update exclude list on results of 21_b7 test runs
(cherry picked from commit e40cdc800e)
2025-04-12 02:03:27 +02:00
Vitaly Provodin
dd8152bb6d update exclude list on results of stability checking runs due to 8253184
(cherry picked from commit 166924f5ed)
2025-04-12 02:03:26 +02:00
Artem Bochkarev
3a0e2f6c41 JBR-3575 use flag processEvents in LWCToolkit.invokeAndWait
(cherry picked from commit dcf9ff3315)
2025-04-12 02:03:26 +02:00
Vitaly Provodin
eea33f6cb9 exclude several tests from runs on machines with enabled VoiceOver
(cherry picked from commit 8040e574e4)
2025-04-12 02:03:26 +02:00
Anton Tarasov
4b404114d7 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-04-12 02:03:26 +02:00
Anton Tarasov
8e05be1c63 JBR-4362 [mac] system menu opens with duplicated items
(cherry picked from commit e32defe49d)
(cherry picked from commit 2d1e14f01d)
2025-04-12 02:03:26 +02:00
Anton Tarasov
1f5af75df9 JBR-4328 remove LWCToolkit.unsafeNonblockingExecute
(cherry picked from commit 9a3f31a6c4)
(cherry picked from commit f9a02266a0)
2025-04-12 02:03:26 +02:00
Anton Tarasov
92ad4ca22b 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-04-12 02:03:26 +02:00
Anton Tarasov
57e0448d9c 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-04-12 02:03:26 +02:00
Anton Tarasov
a13444cf2a JBR-4119 UI freezes at sun.lwawt.macosx.CAccessibility.getChildrenAndRoles
(cherry picked from commit 6ba79774d8)
(cherry picked from commit e1623dc301)
2025-04-12 02:03:26 +02:00
Anton Tarasov
28c6917ef3 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-04-12 02:03:26 +02:00
Anton Tarasov
67e31f6abb JBR-4208 LWCToolkit.invokeAndWait should not stuck on invocation loss
including JBR-4543 (NPE: IdeEventQueue.lambda$getNextEvent$0)

(cherry picked from commit b16d847947)
2025-04-12 02:03:26 +02:00
Anton Tarasov
e18615b0bb 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-04-12 02:03:26 +02:00
Vitaly Provodin
c21ab59905 update exclude list on results of 21_b1447 test runs
(cherry picked from commit 3502c53a16)
2025-04-12 02:03:26 +02:00
Vitaly Provodin
e5c73b2d92 Update README.md
(cherry picked from commit fcbfb32b13)
2025-04-12 02:03:26 +02:00
Vitaly Provodin
2171d7721e update exclude list on results of main.1441 test runs
(cherry picked from commit 7194b34979)
2025-04-12 02:03:26 +02:00
Alexey Ushakov
7ef5d863ef 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-04-12 02:03:25 +02:00
Artem Semenov
82a58e3e61 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-04-12 02:03:25 +02:00
Artem Semenov
2a508acf3f JBR-4235 Context menu not readable after opening on Mac OS
(cherry picked from commit 83d6b20711)
2025-04-12 02:03:25 +02:00
Artem Semenov
cf83fe74a4 JBR-4012 On Idea Vo often speeks selected element of tables, lists, and trees.
(cherry picked from commit 47783c1c85)
2025-04-12 02:03:25 +02:00
Artem Semenov
902d6ce5ef JBR-3868 Combobox list is not voiced of VoiceOver
(cherry picked from commit 1f777d72ea)
2025-04-12 02:03:25 +02:00
Alexey Ushakov
e2db44ebef JBR-5041 macOS: SIGSEGV at [libawt_lwawt] getRenderEncoder:(dstOps == NULL)
Protected code from using NULL dstOps

(cherry picked from commit 44c76b8b99)
2025-04-12 02:03:25 +02:00
Alexey Ushakov
05d4f6ba45 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-04-12 02:03:25 +02:00
Dmitry Batrak
8df2418ea9 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-04-12 02:03:25 +02:00
Vitaly Provodin
86cbbbf3ca Update README.md
(cherry picked from commit 0a469f5069)
2025-04-12 02:03:25 +02:00
Alexey Ushakov
c289b84012 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-04-12 02:03:25 +02:00
Nikita Provotorov
2291473ace 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-04-12 02:03:25 +02:00
Victor Kropp
e1dac54b97 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-04-12 02:03:25 +02:00
Nikita Provotorov
af19d50b74 Update README.md
Replaced jbr-dev to main and other minor fixes.

(cherry picked from commit 91bea99984)
2025-04-12 02:03:25 +02:00
Vitaly Provodin
9725952831 update exclude list on results of 17.0.5_b721.3 test runs
(cherry picked from commit 652e397e29)
2025-04-12 02:03:25 +02:00
Alexey Ushakov
c4d064b496 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-04-12 02:03:25 +02:00
Vitaly Provodin
88143af2ab update exclude list on results of 17.0.5_b712.2 test runs
(cherry picked from commit ef68a82141)
2025-04-12 02:03:24 +02:00
Vitaly Provodin
0a3036f7d3 JBR-4956 reduce width of screenshot by one pixel to exclude caret
(cherry picked from commit dd36d60415)
2025-04-12 02:03:24 +02:00
ngubarkov
611dd14492 JBR-4840 cache screen resolution in XToolkit
(cherry picked from commit b0c0a6ff75)
2025-04-12 02:03:24 +02:00
Alexey Ushakov
39e92b8c0a 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-04-12 02:03:24 +02:00
Dmitry Batrak
522a217646 JBR-5045 Invisible component can break focus cycle
(cherry picked from commit 0f57a27879)
(cherry picked from commit 8309d820fd)
2025-04-12 02:03:24 +02:00
Vitaly Provodin
ee211ce9c4 Update README.md
(cherry picked from commit 1fb0b4f098)
2025-04-12 02:03:24 +02:00
Vitaly Provodin
883aa20921 Update README.md
(cherry picked from commit a8862ab989)
2025-04-12 02:03:24 +02:00
Vitaly Provodin
8bff75b4c7 update exclude list on results of 17.0.5_b691.6 test runs
(cherry picked from commit 668a433320)
2025-04-12 02:03:24 +02:00
Vitaly Provodin
359405fe69 Update README.md
(cherry picked from commit 2cdd0386c3)
2025-04-12 02:03:24 +02:00
Alexey Ushakov
d3d1778d4e 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-04-12 02:03:24 +02:00
Dmitry Batrak
a7e2e1b6b6 JBR-4988 Transient Z-order violations on macOS
(cherry picked from commit bcba97511c)
(cherry picked from commit 3ff06e954d)
2025-04-12 02:03:24 +02:00
Vitaly Provodin
8129893fce JBR-4947 update alpine x64 image up to 3.14
(cherry picked from commit 88f2d7010f)
2025-04-12 02:03:24 +02:00
Vitaly Provodin
46cbbada19 update exclude list on results of 17.0.5_b469.67 test runs
(cherry picked from commit 5ab3a9bf5f)
2025-04-12 02:03:24 +02:00
Vitaly Provodin
dfda3d75e5 Update README.md
(cherry picked from commit 61d47b2fd3)
2025-04-12 02:03:24 +02:00
Alexey Ushakov
6c5adc51c5 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-04-12 02:03:23 +02:00
Vitaly Provodin
bb4d1349ec update Commit and Full testing exclude list on results of jbr17.668 test runs
(cherry picked from commit e7e823a0a3)
2025-04-12 02:03:23 +02:00
Maxim Kartashev
b898f999b9 JBR-4951 In function 'convert_to_java_array': error: comparison of integer expressions of different signedness
(cherry picked from commit 4293e2832c)
2025-04-12 02:03:23 +02:00
Vitaly Provodin
389396b9dc JBR-4089 add modules sun.awt sun.awt.image sun.java2d
(cherry picked from commit 2cae8fb09c)
2025-04-12 02:03:23 +02:00
Vitaly Provodin
a46acd1997 update exclude list for Commit testing
(cherry picked from commit c037eec3ac)
2025-04-12 02:03:23 +02:00
Vitaly Provodin
1512cabf11 exclude tests failing because of JBR-4933, JBR-4934
(cherry picked from commit 6f78d1b02c)
2025-04-12 02:03:23 +02:00
Alexey Ushakov
de6e8c66fe 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-04-12 02:03:23 +02:00
Maxim Kartashev
751e5de9a4 Move JBR README.md to .github/
(cherry picked from commit b69b12f489)
2025-04-12 02:03:23 +02:00
Svyatoslav Vlasov
8d9ece4e04 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-04-12 02:03:23 +02:00
Nikita Tsarev
3155cec309 JBR-3941 Make apple.awt.captureNextAppWinKey default to false
(cherry picked from commit ea29fc8942)
2025-04-12 02:03:23 +02:00
Vitaly Provodin
9861a6f7cb JBR-4912 jb/java/api/frontend/CustomTitleBarDoubleClick.java intermittently throws java.awt.AWTError
(cherry picked from commit ff7ca451fe)
2025-04-12 02:03:23 +02:00
Maxim Kartashev
5b156cf4e8 exclude java/awt/dnd/AcceptDropMultipleTimes/AcceptDropMultipleTimes.java due to JBR-4880 on windows
(cherry picked from commit 2d98733ab5)
2025-04-12 02:03:23 +02:00
Alexey Ushakov
e33178c1d7 JBR-4710 macOS: SIGSEGV at sun.java2d.metal.MTLLayer.blitTexture
Added check for disposed texture in the MTLLayer

(cherry picked from commit c27d8a7c5e)
2025-04-12 02:03:23 +02:00
Nikita Gubarkov
19a9a58589 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-04-12 02:03:23 +02:00
Artem Bochkarev
78d501af59 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-04-12 02:03:23 +02:00
Vitaly Provodin
96cef297f6 exclude java/awt/FullScreen/AltTabCrashTest/AltTabCrashTest.java due to JBR-4905 on windows&linux
(cherry picked from commit 8150b0e5e7)
2025-04-12 02:03:22 +02:00
Alexey Ushakov
79679f8a86 JBR-4897 Reconnecting multiscreen monitor displays blank IDE
Handled NSWindowDidChangeScreenNotification, resolved race condition in window peer displayChanged listener

(cherry picked from commit 1e697c8623)
2025-04-12 02:03:22 +02:00
Vitaly Provodin
556ccf71d8 exclude jb/java/jcef/HandleJSQueryTest3314.sh due to JBR-4866 on linux
(cherry picked from commit d619e3320a)
2025-04-12 02:03:22 +02:00
Vitaly Provodin
299ff320ce exclude some tests due to JBR-4880 on windows
(cherry picked from commit 1a9fb2cfa2)
2025-04-12 02:03:22 +02:00
Vitaly Provodin
c158f95fd2 exclude javax/swing/JInternalFrame/8020708/bug8020708.java due to JBR-4879 on windows
(cherry picked from commit 85ba459fae)
2025-04-12 02:03:22 +02:00
Vitaly Provodin
d3c5de0247 exclude java/awt tests which do not close child processes/windows
(cherry picked from commit 3cf2b36323)
2025-04-12 02:03:22 +02:00
Vitaly Provodin
3113f8a4f0 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-04-12 02:03:22 +02:00
Maxim Kartashev
200ca18fea JBR-4877 WARNING: JNI local refs: 33, exceeds capacity: 32
(cherry picked from commit a10770c49d)
2025-04-12 02:03:22 +02:00
Artem Bochkarev
d7428545c9 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-04-12 02:03:22 +02:00
Vitaly Provodin
2d14bdc0e2 JBR-4875 jb/javax/swing/JComboBox/ComboBoxTransparentTittleBarTest.java checks dragging JFrame with Combobox
(cherry picked from commit 8d5472c900)
2025-04-12 02:03:22 +02:00
Dmitry Batrak
368d1b978e JBR-4871 Closed project leaked via KeyboardFocusManager#newFocusOwner
(cherry picked from commit 50c0ce58d3)
(cherry picked from commit 46a0f0d75b)
2025-04-12 02:03:22 +02:00
Maxim Kartashev
49779304a6 JBR-4839 Report if wrong shared library is detected at run time
(cherry picked from commit e8c1913562)
2025-04-12 02:03:22 +02:00
Maxim Kartashev
1468181f5e 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-04-12 02:03:22 +02:00
Alexey Ushakov
28c95b2b32 JBR-4590 macOS: SIGSEGV at [libawt_lwawt] MTLTR_DrawGlyphList
Invalidate glyph cache cell info after switching MTLContext

(cherry picked from commit 664528713e)
2025-04-12 02:03:22 +02:00
Nikita Gubarkov
118b062445 JBR-4815 force hinting for non-antialiased text
(cherry picked from commit 6c3517ae9d)
2025-04-12 02:03:22 +02:00
Maxim Kartashev
32e0f10c7a jb/branchdiff.py script to help with release branches
(cherry picked from commit a03f10e9b7)
2025-04-12 02:03:21 +02:00
Nikita Gubarkov
59b3013de0 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-04-12 02:03:21 +02:00
Alexander Lobas
a8eb7047e7 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-04-12 02:03:21 +02:00
Vitaly Provodin
87858910d5 updated JTreg exclude list
(cherry picked from commit 03fba5ebf2)
2025-04-12 02:03:21 +02:00
Alexey Ushakov
a53db6dce7 JBR-4696 macOS: NPE in -[AWTView viewDidChangeBackingProperties]
Added null pointer checks

(cherry picked from commit b0374bdccf)
2025-04-12 02:03:21 +02:00
MonoBot
e124f9042a JBR-4809 Update the bundled JetBrains Mono font version
Fonts release 2.242

(cherry picked from commit 641424a3e3)
(cherry picked from commit ab5066f90f)
2025-04-12 02:03:21 +02:00
Alexey Ushakov
2e576511a6 JBR-4680 idea window flickers while changing the screen brightness
Update insets in separate notification

(cherry picked from commit e7936d9958)
2025-04-12 02:03:21 +02:00
Maxim Kartashev
f12809a4ef 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-04-12 02:03:21 +02:00
Maxim Kartashev
e1bd368d33 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-04-12 02:03:21 +02:00
Nikita Gubarkov
241a5cf4e4 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-04-12 02:03:21 +02:00
Denis Fokin
ae21c0b2b0 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-04-12 02:03:21 +02:00
Alexey Ushakov
55a857d332 JBR-4784 Extra allocations of MTLRenderPipelineDescriptor affects performance in metal pipeline
Remove extra allocations

(cherry picked from commit e1fe3a3807)
2025-04-12 02:03:21 +02:00
Alexey Ushakov
4f625b8635 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-04-12 02:03:21 +02:00
Dmitry Batrak
81bda6c503 JBR-4782 Synergy keyboard/mouse input: window disabled after bringing IntelliJ into focus
(cherry picked from commit f863a14b19)
(cherry picked from commit 34ec3053ab)
2025-04-12 02:03:20 +02:00
Alexey Ushakov
762f47e523 JBR-4363 Changes in fonts rendering between JBR11 and JBR17
Do not use hinting for generating outlines

(cherry picked from commit 7bb3a76942)
2025-04-12 02:03:20 +02:00
Alexey Ushakov
2bae6d69e1 JBR-3100 Exception in NSApplicationAWT: java.lang.NullPointerException at java.desktop/sun.lwawt.LWComponentPeer.windowToLocal
Added null check

(cherry picked from commit 0c23ef45ba)
2025-04-12 02:03:20 +02:00
Alexey Ushakov
8173fde013 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-04-12 02:03:20 +02:00
Alexey Ushakov
08ff0d7167 JBR-3102 Exception in NSApplicationAWT: Invalid parameter not satisfying: !isnan(newOrigin.y)
Handled NAN values with some defaults

(cherry picked from commit f1aed3db71)
2025-04-12 02:03:20 +02:00
Vladislav Rassokhin
6a2227eb2f JBR-4263 Improve check_jbr_size.sh
* Fix shellcheck inspections
* Don't silently fail if TOKEN is incorrect

(cherry picked from commit e0ab03ce52)
2025-04-12 02:03:20 +02:00
Maxim Kartashev
d099fa34a3 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-04-12 02:03:20 +02:00
Maxim Kartashev
9ca903c3d6 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-04-12 02:03:20 +02:00
Dmitry Batrak
aae2ba81a9 JBR-4720 Focus state is broken after certain operations when VoiceOver is enabled
(cherry picked from commit dc1b49b5a6)
(cherry picked from commit 51df5fbf67)
2025-04-12 02:03:20 +02:00
Dmitry Batrak
6612376c67 JBR-4673 Focus moves to another application on file dialog closing
(cherry picked from commit 7468974488)
(cherry picked from commit 72a74312b7)
2025-04-12 02:03:20 +02:00
Dmitry Batrak
e85d799f5e JBR-4665 Focus 'jitter' on window showing in WSLg
(cherry picked from commit 9b32c2a577)
(cherry picked from commit 2952a2eeb4)
2025-04-12 02:03:20 +02:00
Nikita Gubarkov
f9c68f0582 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-04-12 02:03:20 +02:00
Alexey Ushakov
61f7327b93 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-04-12 02:03:20 +02:00
Dmitry Batrak
5f556ef94e 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-04-12 02:03:20 +02:00
artem.bochkarev
d5bd430be9 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-04-12 02:03:20 +02:00
Vitaly Provodin
eb8061fda6 exclude sun/java2d/DirectX/RenderingToCachedGraphicsTest/RenderingToCachedGraphicsTest.java on linux-all due to 8252812
(cherry picked from commit 336230c628)
2025-04-12 02:03:19 +02:00
Vitaly Provodin
0ca181fcd4 exclude sanity/client/SwingSet/src/ColorChooserDemoTest.java on windows-all due to 8278582
(cherry picked from commit 07e8b19419)
2025-04-12 02:03:19 +02:00
Alexey Ushakov
5805333c06 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-04-12 02:03:19 +02:00
Nikita Gubarkov
44171eba75 8289189: Fix ./configure on WSL1
(cherry picked from commit 617ed45c5c)
2025-04-12 02:03:19 +02:00
Alexey Ushakov
3ed59c818d 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-04-12 02:03:19 +02:00
Vitaly Provodin
3296404ed5 exclude vmTestbase/vm/jit/LongTransitions due to 8271615 on macOS
(cherry picked from commit 66e8a68de9)
2025-04-12 02:03:19 +02:00
Maxim Kartashev
16bb4cd551 JBR-4602 Unexpected NoSuchFileException running Rider test
This reverts commits for JBR-3680, JBR-4118, and JBR-4485.

(cherry picked from commit 5a165aa533)
2025-04-12 02:03:19 +02:00
Nikita Gubarkov
029884c83d JBR-4373 Add mapping for .NewYork-* and .SFArabic-* system fonts
(cherry picked from commit e34f1abedc)
2025-04-12 02:03:19 +02:00
Alexander Lobas
9757dbf5f8 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-04-12 02:03:19 +02:00
Alexander Lobas
c31df6f8bf JBR-4563 Rounded corners for native Window on Mac OS
(cherry picked from commit 4aecaafa7c)
2025-04-12 02:03:19 +02:00
Alexander Lobas
79cc31c7b8 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-04-12 02:03:19 +02:00
Alexey Ushakov
ea6c30d320 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-04-12 02:03:19 +02:00
Artem Bochkarev
f10660cbf9 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-04-12 02:03:19 +02:00
Artem Bochkarev
4a86351593 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-04-12 02:03:19 +02:00
Vitaly Provodin
6811bfeca0 exclude javax/swing/JToolBar/4529206/bug4529206.java due to 8288707 on linux
(cherry picked from commit 8bc1905696)
2025-04-12 02:03:19 +02:00
Maxim Kartashev
a400920fe0 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-04-12 02:03:18 +02:00
Maxim Kartashev
9ad05bbb54 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-04-12 02:03:18 +02:00
Vitaly Provodin
8e2253b301 JBR-4570 improve synchronization and increase waiting time
(cherry picked from commit d7b11a1925)
2025-04-12 02:03:18 +02:00
Dmitry Batrak
0c11e9e487 JBR-4552 Windows revert back after initial move/resize in Cygwin/X
(cherry picked from commit 6dc194e089)
(cherry picked from commit 9c2eccb07c)
2025-04-12 02:03:18 +02:00
Manuel Unterhofer
27f32b5e60 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-04-12 02:03:18 +02:00
Nikita Provotorov
e84e71b690 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-04-12 02:03:18 +02:00
Nikita Provotorov
f0957d6cb0 JBR-4394, IDEA-246833: fixup of JBR-2444.
(cherry picked from commit ef262dc8bb)
(cherry picked from commit b026461771)
2025-04-12 02:03:18 +02:00
Dmitry Batrak
41b8028a81 JBR-4537 Popup windows shown for a background window cause app icon to blink in taskbar on KDE
(cherry picked from commit 704ffcc0ee)
2025-04-12 02:03:18 +02:00
Dmitry Batrak
4f329cb9b5 JBR-4535 Popup windows disappear on mouse hover when 'Focus strictly under mouse' policy is used in KDE
(cherry picked from commit a70a83e7fe)
2025-04-12 02:03:18 +02:00
Alexey Ushakov
536e71f99b 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-04-12 02:03:18 +02:00
Vitaly Provodin
cbdb6c81cf exclude jb/java/awt/Window/ZOrderOnModalDialogActivation.java from S2 runs on Windows and Linux
(cherry picked from commit c1cb686198)
2025-04-12 02:03:18 +02:00
Vitaly Provodin
41000d4081 exclude javax/swing/plaf/nimbus/TestNimbusOverride.java on windows due to 8253184
(cherry picked from commit 5c6f2241db)
2025-04-12 02:03:18 +02:00
Vitaly Provodin
b56f9ae8ba exclude java/awt/Graphics2D/DrawString/DrawRotatedStringUsingRotatedFont.java on linux-aarch64 only due to 8266283
(cherry picked from commit cc5f59a5ed)
2025-04-12 02:03:18 +02:00
Artem Bochkarev
04ea68df95 JBR-4473: fixed native part of SystemHotkeyReader
(cherry picked from commit 4d96436851)
2025-04-12 02:03:18 +02:00
Dmitry Batrak
aa8c3d7cdb JBR-1740 Menu remains open when application loses focus
(cherry picked from commit f987d22cd2)
(cherry picked from commit 4a7913c9e6)
2025-04-12 02:03:17 +02:00
Vitaly Provodin
ba8fd1aed5 exclude Frame/RestoreToOppositeScreen/RestoreToOppositeScreen.java from S2 runs due to 8286840
(cherry picked from commit 811db62fec)
2025-04-12 02:03:17 +02:00
Vitaly Provodin
a03c0a0570 exclude java/awt/Mouse/GetMousePositionTest/GetMousePositionWithPopup.java due to 8282232
(cherry picked from commit 17d6d1047e)
2025-04-12 02:03:17 +02:00
Maxim Kartashev
e4313d801c 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-04-12 02:03:17 +02:00
Manuel Unterhofer
21dfc43bd9 Merge fullscreen handlers for transparent title bar into existing ones
(cherry picked from commit a992612585)
2025-04-12 02:03:17 +02:00
Manuel Unterhofer
a367f10690 FL-11420 Fix view hierarchy restoration for full-screen mode on macOS
(cherry picked from commit f708ad2c57)
2025-04-12 02:03:17 +02:00
Nikita Gubarkov
7bab457da3 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-04-12 02:03:17 +02:00
Dmitry Batrak
153c94b77c 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-04-12 02:03:17 +02:00
Maxim Kartashev
fdeb1d7c10 JBR-4464 Error building latest jbr-dev after JDK-8285730
(cherry picked from commit 8b0ae02f8d)
2025-04-12 02:03:17 +02:00
Maxim Kartashev
0754ce60bd 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-04-12 02:03:17 +02:00
Maxim Kartashev
480f56cb28 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-04-12 02:03:17 +02:00
Renaud Paquay
46330bb683 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-04-12 02:03:17 +02:00
Dmitry Batrak
d5e8a916d8 JBR-1518 JBR 11 does not support chain of popups on Linux
(cherry picked from commit 849356ee01)
(cherry picked from commit b85be77543)
2025-04-12 02:03:17 +02:00
Dmitry Batrak
2d48496034 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-04-12 02:03:17 +02:00
Ryan Osial
15a4e749fc 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-04-12 02:03:17 +02:00
Maxim Kartashev
b5b00b6403 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-04-12 02:03:16 +02:00
Anton Tarasov
b4fe0c7605 JBR-4389 [update_1] IDEA UI font becomes too large after disconnecting the external monitor / sleep
(cherry picked from commit 74c977e942)
2025-04-12 02:03:16 +02:00
Anton Tarasov
1533e1ec6a JBR-4389 IDEA UI font becomes too large after disconnecting the external monitor / sleep
(cherry picked from commit 1288c65208)
2025-04-12 02:03:16 +02:00
Dmitry Batrak
4ee5740a59 remove duplicate bundled JetBrains Mono bold italic font
following JBR-4402

(cherry picked from commit b7e5d3cfcf)
(cherry picked from commit ac765d3d2c)
2025-04-12 02:03:16 +02:00
Dmitry Batrak
2cda394fa3 JBR-4402 The wrong text is rendered in editor
(cherry picked from commit 8c1de95991)
2025-04-12 02:03:16 +02:00
Vitaly Provodin
d4d364af79 JBR-4297 add a regression test
(cherry picked from commit 8e94fff6aa)
(cherry picked from commit 8eb5ce4b34)
2025-04-12 02:03:16 +02:00
Konstantin Bulenkov
c53fc09315 Update JetBrains Mono font to 2.225
(cherry picked from commit 84c7519c7e)
2025-04-12 02:03:16 +02:00
Alexey Ushakov
220ad8c65a JBR-4363 Changes in fonts rendering between JBR11 and JBR17
Resolved merge artifact after applying IDEA-57233 fix

(cherry picked from commit 0e2c16e0f0)
2025-04-12 02:03:16 +02:00
Alexey Ushakov
b20b7be7c8 JBR-3843 IDE text is misaligned vertically when using Consolas font
Use usWinAscent/usWinDescent for metrics on Windows

(cherry picked from commit 4aed6ab51d)
2025-04-12 02:03:16 +02:00
Alexey Ushakov
c7a50101f6 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-04-12 02:03:16 +02:00
Alexey Ushakov
155aa2a450 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-04-12 02:03:16 +02:00
Dmitry Batrak
0de61c7e15 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-04-12 02:03:16 +02:00
Alexey Ushakov
6e4209746f JBR-3827 SIGILL at [libsystem_kernel] __kill in Java Exception at -[CDragSource convertData:]
Added check for drag source

(cherry picked from commit a2b6100b57)
2025-04-12 02:03:16 +02:00
Alexey Ushakov
d581a600b0 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-04-12 02:03:16 +02:00
Alexey Ushakov
0a551b7cac 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-04-12 02:03:15 +02:00
Dmitry Batrak
597e6b60eb 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-04-12 02:03:15 +02:00
Vitaly Provodin
dfc498db60 JBR-4294 split desktop tests to more groups for Commit testing
(cherry picked from commit e2360b07b9)
2025-04-12 02:03:15 +02:00
Dmitry Batrak
50234fbd36 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-04-12 02:03:15 +02:00
greg
1715e19e6f 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-04-12 02:03:15 +02:00
Denis Fokin
22dc621e08 JBR-4038 [JBR17] Force Touch events are not supported on macOS
Added missing files and handlers from JBR11

(cherry picked from commit 0a82277650)
2025-04-12 02:03:15 +02:00
Alexey Ushakov
f8dd974be0 JBR-3901 jbr-dev compile problem
Added transient keyword

(cherry picked from commit 8bd487eca9)
2025-04-12 02:03:15 +02:00
Alexander Lobas
ebeedcfb66 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-04-12 02:03:15 +02:00
Dmitry Batrak
6bebc9f080 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-04-12 02:03:15 +02:00
Dmitry Batrak
ec32fd3628 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-04-12 02:03:15 +02:00
Dmitry Batrak
63c5c90469 refactor nativeCreateNSWindow call wrapping
as part of JBR-3017

(cherry picked from commit eeef67a335)
(cherry picked from commit 1bb0bf3f82)
2025-04-12 02:03:15 +02:00
Dmitry Batrak
a63e96a56c 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-04-12 02:03:15 +02:00
Dmitry Batrak
682e5624fe JBR-2971 Log more information about window creation and property changes
(cherry picked from commit 9d86b4d235)
(cherry picked from commit e93eeba9c2)
2025-04-12 02:03:15 +02:00
Dmitry Batrak
8a44b2b05f 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-04-12 02:03:15 +02:00
Nikita Provotorov
99a627e18d 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-04-12 02:03:15 +02:00
Nikita Gubarkov
340357ada2 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-04-12 02:03:14 +02:00
Alexey Ushakov
5346650272 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-04-12 02:03:14 +02:00
Vitaly Provodin
12c47dd1f5 exclude javax/swing/border/TestTitledBorderLeak.java on windows due to 8213531
(cherry picked from commit c32cf1fe07)
2025-04-12 02:03:14 +02:00
Ivan Lopatin
0b813c86f0 Scale2: exclude java/awt/SplashScreen/MultiResolutionSplash/MultiResolutionSplashTest.java due to 8279190 on macosx-all
(cherry picked from commit 58854d5467)
2025-04-12 02:03:14 +02:00
Nikita Provotorov
459639920e 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-04-12 02:03:14 +02:00
Vitaly Provodin
46661c6620 exclude java/awt/Frame/FrameSetSizeStressTest/FrameSetSizeStressTest.java on Wayland
sun/security/pkcs11/Signature/TestDSAKeyLength.java                                 8279941 linux-all

(cherry picked from commit ddd0a7409d)
2025-04-12 02:03:14 +02:00
Alexey Ushakov
3481ea3817 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-04-12 02:03:14 +02:00
Nikita Provotorov
bf629cbc5d 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-04-12 02:03:14 +02:00
Nikita Provotorov
2b2dd0a7e3 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-04-12 02:03:14 +02:00
Vitaly Provodin
939876f611 exclude sun/security/pkcs11/Signature/TestDSAKeyLength.java on Ubuntu 21.04 due to 8279941
(cherry picked from commit c3d8e648a6)
2025-04-12 02:03:14 +02:00
Anton Tarasov
fd2725c0a9 JBR-4204 provide an option to disable a11y support on macOS
(cherry picked from commit ee3c56abdc)
(cherry picked from commit e2419baf87)
2025-04-12 02:03:14 +02:00
Vitaly Provodin
7e15595222 exclude two swing tests on Windows due to JBR-4197
(cherry picked from commit 3a99f6b99d)
2025-04-12 02:03:14 +02:00
Alexey Ushakov
a1d79baae5 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-04-12 02:03:14 +02:00
Alexey Ushakov
f2979e1f1b 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-04-12 02:03:14 +02:00
Alexey Ushakov
4a0d62eeb5 JBR-4177 libc++abi: terminating with uncaught exception of type NSException
Added check for AppContext

(cherry picked from commit 54c83d2ef6)
2025-04-12 02:03:13 +02:00
Alexey Ushakov
4688255ec8 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-04-12 02:03:13 +02:00
Artem Semenov
c234b60d97 JBR-4167 [JCK] AccassibleJTree tests fail on Ubuntu
(cherry picked from commit 40e8687667)
2025-04-12 02:03:13 +02:00
Alexey Ushakov
bde677e00f JBR-4164 IDEs cannot be launched via launch configuration
Moved execution of displayChanged() to EDT

(cherry picked from commit b6f91a9c10)
2025-04-12 02:03:13 +02:00
Vitaly Provodin
29e343ce48 JBR-4169 add jdk.javadoc into JBR
(cherry picked from commit 861742faf1)
2025-04-12 02:03:13 +02:00
Alexey Ushakov
0380c202d2 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-04-12 02:03:13 +02:00
Vitaly Provodin
42825a25a3 exclude java/awt/Focus/ActualFocusedWindowTest/ActualFocusedWindowBlockingTest.java on Wayland configs due to 8279256
(cherry picked from commit 9d17b66630)
2025-04-12 02:03:13 +02:00
Vitaly Provodin
b043a30475 exclude java/awt/SplashScreen/MultiResolutionSplash/MultiResolutionSplashTest.java on Scale2 configs due to 8279190
(cherry picked from commit 0949bd7a8a)
2025-04-12 02:03:13 +02:00
Vitaly Provodin
41da287a71 exclude java/awt/FullScreen/UninitializedDisplayModeChangeTest/UninitializedDisplayModeChangeTest.java due to 827361
(cherry picked from commit b98807e58f)
2025-04-12 02:03:13 +02:00
Vitaly Provodin
9e10789f90 add exclude list for Wayland failures
(cherry picked from commit 2b7bdfe3d5)
2025-04-12 02:03:13 +02:00
Vitaly Provodin
e5b06267ce exclude javax/swing/plaf/basic/BasicComboPopup/JComboBoxPopupLocation /JComboBoxPopupLocation.java on macOS due to 8194945
(cherry picked from commit 86f21becde)
2025-04-12 02:03:13 +02:00
Vitaly Provodin
1e5c4f8d1b exclude sun/java2d/SunGraphics2D/EmptyClipRenderingTest.java on windows due to 8144029
(cherry picked from commit f3f6365d05)
2025-04-12 02:03:13 +02:00
Maxim Kartashev
cc94995bed 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-04-12 02:03:13 +02:00
Vitaly Provodin
f8498ff8e5 add exclude list for Scale2 test runs
(cherry picked from commit 45ddfe3353)
2025-04-12 02:03:13 +02:00
Vitaly Provodin
10fb700117 exclude java/awt/SplashScreen/MultiResolutionSplash/MultiResolutionSplashTest.java due to 8134231
(cherry picked from commit defd9f66a7)
2025-04-12 02:03:13 +02:00
Alexey Ushakov
21b8d6455c 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-04-12 02:03:12 +02:00
Artem Semenov
e67a0da1c5 JBR-3775 Optimize the algorithm for obtaining tree elements
(cherry picked from commit 01dbe66b3e)
2025-04-12 02:03:12 +02:00
Nikita Gubarkov
764caea1f6 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-04-12 02:03:12 +02:00
Vitaly Provodin
0e8174974b JBR-3931 add the module jdk.unsupported.desktop into jbr
(cherry picked from commit 32def2fd42)
(cherry picked from commit d8fd2c9664)
2025-04-12 02:03:12 +02:00
Alexey Ushakov
858dea10b3 JBR-4111 [JBR17] Make possible to select files and directories independently
Implemented apple.awt.fileDialogForFiles property

(cherry picked from commit 67ea24d06e)
2025-04-12 02:03:12 +02:00
Vitaly Provodin
e61bc31e93 enable fixed tests to regular runs
(cherry picked from commit ae87bdb09a)
2025-04-12 02:03:12 +02:00
Vitaly Provodin
142138bb57 exclude javax/swing tests on mac-aarch64 due to 8277816
(cherry picked from commit a39f9150c3)
2025-04-12 02:03:12 +02:00
Aleksandr Veselov
c22c59dcb6 JBR-4107 A11y: macOS - wrong frame position if window is not on primary screen
(cherry picked from commit 6006b52f33)
2025-04-12 02:03:12 +02:00
Alexey Ushakov
d86392339a 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-04-12 02:03:12 +02:00
Alexey Ushakov
dbd6922985 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-04-12 02:03:12 +02:00
Alexey Ushakov
57568b5e51 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-04-12 02:03:12 +02:00
Alexey Ushakov
c94be759b3 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-04-12 02:03:12 +02:00
Alexey Ushakov
7150d0aeba JBR-4104 jbr-dev compilation failure
Corrected suppress warnings

(cherry picked from commit 3ff69f1653)
2025-04-12 02:03:12 +02:00
Dmitry Batrak
64b61a797b JBR-4084 Default font '. AppleSystemUIFont' does not have bold weight on Chinese characters
(cherry picked from commit 4fde082d53)
(cherry picked from commit dc1806aa60)
2025-04-12 02:03:12 +02:00
Maxim Kartashev
1a82a302c0 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-04-12 02:03:12 +02:00
Dmitry Batrak
f6fac8b4e3 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-04-12 02:03:11 +02:00
Maxim Kartashev
dbfd0a8a14 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-04-12 02:03:11 +02:00
Vitaly Provodin
d842735fe4 exclude tests spontaneously creating windows during test execution
(cherry picked from commit 0dc17f51ed)
2025-04-12 02:03:11 +02:00
Maxim Kartashev
6e8aa5053e 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-04-12 02:03:11 +02:00
Alexey Ushakov
f4d6e49220 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-04-12 02:03:11 +02:00
Nikita Gubarkov
b3c916e1fd 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-04-12 02:03:11 +02:00
Pavel
cec9bf5dff 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-04-12 02:03:11 +02:00
Maxim Kartashev
79b5933e9f 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-04-12 02:03:11 +02:00
Dmitry Batrak
3fda29e4cd 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-04-12 02:03:11 +02:00
Alexey Ushakov
88b7f63e78 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-04-12 02:03:11 +02:00
Alexey Ushakov
5ef96d70ae 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-04-12 02:03:11 +02:00
Alexander Lobas
cd02b67cf4 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-04-12 02:03:11 +02:00
Alexander Lobas
cf6c60763c 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-04-12 02:03:11 +02:00
Alexander Lobas
ff2641be50 JBR-3443 Native file dialog on OSX enable filename filter by VM option
(cherry-picked from commit f10e324538)

(cherry picked from commit 7ad92e4703)
2025-04-12 02:03:11 +02:00
Alexander Lobas
0bfe6be91f 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-04-12 02:03:10 +02:00
Maxim Kartashev
4a924b5a81 Revert "JBR-2755 IDE UI became slow via remote X Server connection from Windows"
This reverts commit cd9138844da770ae60806fd7dbc1e85c773882a8.

(cherry picked from commit ec6f644c12)
2025-04-12 02:03:10 +02:00
Konstantin Aleev
a8ae2df461 fix memory leaks in AccessibleJTree
(cherry picked from commit 561a7b8def)
(cherry picked from commit 6aa0951e7f)
2025-04-12 02:03:10 +02:00
Maxim Kartashev
0f71cc4227 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-04-12 02:03:10 +02:00
Maxim Kartashev
fbcd2e23bd 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-04-12 02:03:10 +02:00
Nikita Provotorov
0b5f06534f 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-04-12 02:03:10 +02:00
Maxim Kartashev
588345c271 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-04-12 02:03:10 +02:00
Alexey Ushakov
c8223c6b8a 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-04-12 02:03:10 +02:00
Artem Bochkarev
7ac30dd8b0 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-04-12 02:03:10 +02:00
Dmitry Batrak
80c914dcff JBR-2759 Typeahead issue on Linux
(cherry picked from commits 76bdaf1131, b20c56ff3e, c9609330f2, a170b4e4ae)

(cherry picked from commit 281e6abf47)
2025-04-12 02:03:10 +02:00
Artem Bochkarev
489cdab820 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-04-12 02:03:10 +02:00
Renaud Paquay
77928e516f 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-04-12 02:03:10 +02:00
Ivan Migalev
e5d0e38424 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-04-12 02:03:10 +02:00
Dmitry Batrak
39329c87e5 JBR-3779 Unexpected Alt+Tab behaviour for Java frames on Cinnamon DE
(cherry picked from commit 0bf13985d5)
(cherry picked from commit 3853438e52)
2025-04-12 02:03:10 +02:00
Maxim Kartashev
8f76dd305c 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-04-12 02:03:09 +02:00
Dmitry Batrak
2150628169 JBR-3504 a11y focus is set on the wrong element when opening popups
(cherry-picked from commit a69e12e0d2)

(cherry picked from commit e06081f5ab)
2025-04-12 02:03:09 +02:00
Maxim Kartashev
c59cf3c52a 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-04-12 02:03:09 +02:00
Maxim Kartashev
779b00fca7 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-04-12 02:03:09 +02:00
Alexey Ushakov
c330dd03e8 Added support for otf into the build scripts. Updated prebuild maps.
Applied code from jbr-dev

(cherry picked from commit 9c23814897)
2025-04-12 02:03:09 +02:00
Konstantin Bulenkov
1d916722d0 bundle Inter font
(cherry picked from commit 9f54e5ce48)
2025-04-12 02:03:09 +02:00
Maxim Kartashev
d0367084e4 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-04-12 02:03:09 +02:00
Dmitry Batrak
f1009b63e5 JBR-3726 Modal windows 'disappear' on minimize in KDE
(cherry picked from commits d9baf2d9db, 9c2841028f, 5c4fd9ceaf, f0ed32fca4)

(cherry picked from commit 21a64a69e4)
2025-04-12 02:03:09 +02:00
Maxim Kartashev
2f95a577f8 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-04-12 02:03:09 +02:00
Dmitry Batrak
5a25837bbe 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-04-12 02:03:09 +02:00
Dmitry Batrak
8d9b9588d5 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-04-12 02:03:09 +02:00
Dmitry Batrak
ab6f625c6a 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-04-12 02:03:09 +02:00
Nikita Gubarkov
7f2becad0c JBR-3648 Replace CacheCellInfo usages with MTLCacheCellInfo in metal rendering code
(cherry picked from commit 7a94f7ea07)
2025-04-12 02:03:09 +02:00
Dmitry Batrak
b9763326f3 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-04-12 02:03:09 +02:00
Anton Tarasov
cf0b8e75c4 JBR-1834 [linux] runtime hidpi switch is broken
(cherry picked from commit eaa04303a7)
(cherry picked from commit 2df217d6fe)
2025-04-12 02:03:09 +02:00
Anton Tarasov
a3688741b0 JBR-1429 Scale is huge due to GDK_SCALE
(cherry-picked from commit 1c3477df2e)

(cherry picked from commit 3ac8aeea3d)
2025-04-12 02:03:08 +02:00
Anton Tarasov
4001221cdf JBR-1365 force IDE-managed HiDPI on Linux for fractional scales
(cherry picked from commit f092ff3962)
(cherry picked from commit ae72b9e01d)
2025-04-12 02:03:08 +02:00
Anton Tarasov
f4dc05a04c Allow HiDPI mode on Linux
(cherry picked from commit e192da4f83)
2025-04-12 02:03:08 +02:00
Anton Tarasov
f92c1c18c2 JRE-489 -Dswing.bufferPerWindow is fractional scale unfriendly
(cherry picked from commit 67fb7a274c)
2025-04-12 02:03:08 +02:00
Anton Tarasov
831ec6d3f9 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-04-12 02:03:08 +02:00
Vitaly.Provodin
46bcac1488 add 32-sizes for native data types
(cherry picked from commit 3a79870da8)
(cherry picked from commit 15f6d3290b)
2025-04-12 02:03:08 +02:00
Nikita Gubarkov
5d86b4f917 Added JBR-specific .idea project files
(cherry picked from commit 6b34834621)
2025-04-12 02:03:08 +02:00
Alexey Ushakov
df4a93c55e 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-04-12 02:03:08 +02:00
Anton Tarasov
df7a094a25 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-04-12 02:03:08 +02:00
Anton Tarasov
b30c8f4b3c JBR-3545 Window.setMinimumSize does not respect DPI scaling
(cherry picked from commit 9b4f72ad18)
(cherry picked from commit f3f87f5f27)
2025-04-12 02:03:08 +02:00
Denis Fokin
5c40ebedcd 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-04-12 02:03:08 +02:00
Elena Sayapina
97133bfc05 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-04-12 02:03:08 +02:00
Denis Konoplev
8e6e3724c0 EA-252361: Check window for null
(cherry picked from commit 23a7dbd486)
(cherry picked from commit aa4d6f14dc)
2025-04-12 02:03:08 +02:00
Artem Bochkarev
c732582a4d JBR-3131: support custom view for system menu items
(cherry picked from commit 78d509ac0f)
(cherry picked from commit ca05fefb28)
2025-04-12 02:03:08 +02:00
Artem Bochkarev
a23f3f82a7 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-04-12 02:03:07 +02:00
Nikita Gubarkov
5ce012d053 JBR-3376 Added check for -1 glyph info pointer in OGLTextRenderer.c
(cherry picked from commit 40ea728335)
2025-04-12 02:03:07 +02:00
Dmitry Batrak
8d6a383cd3 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-04-12 02:03:07 +02:00
Vitaly Provodin
0c08f5d3cb JBR-3314 add regression test
(cherry picked from commit c81adfed61)
(cherry picked from commit e4c3db3a2c)
2025-04-12 02:03:07 +02:00
Ivan Migalev
38d0a1c499 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-04-12 02:03:07 +02:00
Ivan Migalev
e52b4dbd1a JBR-3068 Update path selector behavior when sun.awt.windows.useCommonItemDialog is enabled
(cherry picked from commit 442bb7eecc)
(cherry picked from commit 6177142c3a)
2025-04-12 02:03:07 +02:00
Alexey Ushakov
0bc23d3d0c 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-04-12 02:03:07 +02:00
Alexey Ushakov
c0569cdf7b 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-04-12 02:03:07 +02:00
Dmitry Batrak
c927692da1 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-04-12 02:03:07 +02:00
Dmitry Batrak
7374f634fa 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-04-12 02:03:07 +02:00
Dmitry Batrak
b8800d671b fix occasional freezes of JBR-3017 reproducer after the fix
(cherry picked from commit 7e6db54f77)
(cherry picked from commit 2b7f78f50e)
2025-04-12 02:03:07 +02:00
Dmitry Batrak
41f9d9d924 JBR-2819 Create API to determine typographic family/subfamily for available fonts
(cherry picked from commit 89e519a4ef)
(cherry picked from commit 21129ca270)
2025-04-12 02:03:07 +02:00
Nikita Gubarkov
c30b924e99 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-04-12 02:03:07 +02:00
Nikita Gubarkov
36cb42d763 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-04-12 02:03:07 +02:00
Dmitry Batrak
e9cb21c14d JBR-3017 Focus issue in presence of third-party accessibility tool
(cherry picked from commit 88ead5d9e3)
(cherry picked from commit 97753f15b6)
2025-04-12 02:03:07 +02:00
Vitaly Provodin
ff32de369b 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-04-12 02:03:06 +02:00
Elena Sayapina
0696807acc JBR-2890 [TESTUPDATE] Enable jcef tests on macOS aarch64 platform
(cherry picked from commit 1714d7b627)
(cherry picked from commit 54e74d75d0)
2025-04-12 02:03:06 +02:00
Nikita Gubarkov
1e85b868ea Added JBR API
with fix for JBR-5300 Change source code and test files to use GPL license

(cherry picked from commit 2ce0a876c5)
2025-04-12 02:03:06 +02:00
Artem Bochkarev
554815067a 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-04-12 02:03:06 +02:00
Mikhail Grishchenko
f921abc039 JBR-2890 Disable jcef tests on 32-bit and aarch64 platforms
(cherry picked from commit d34d6528fe)
(cherry picked from commit 793add3ff1)
2025-04-12 02:03:06 +02:00
Alexey Ushakov
e2ecb99c26 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-04-12 02:03:06 +02:00
Nikita Gubarkov
33b0cf6b93 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-04-12 02:03:06 +02:00
Alexey Ushakov
73e50119a5 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-04-12 02:03:06 +02:00
Alexey Ushakov
e15d4a779e 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-04-12 02:03:06 +02:00
Alexey Ushakov
0b38d0134d 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-04-12 02:03:06 +02:00
Alexey Ushakov
023433ae92 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-04-12 02:03:06 +02:00
Vitaly Provodin
5325075bbb exclude bug7154030 on macosx-aarch64 due to 8268284
(cherry picked from commit 253f1246e5)
2025-04-12 02:03:06 +02:00
Vitaly Provodin
295775f33b exclude SharedMemoryPixmapsTest on macosx-all due to 8221451
(cherry picked from commit d929111f7a)
2025-04-12 02:03:06 +02:00
Vyacheslav Moklev
c20703f109 JBR-2442 fix memory leak of fileBuffer
fix was suggested by Nikita Gubarkov

(cherry picked from commit a166fb65e1)
2025-04-12 02:03:06 +02:00
Sergey Malenkov
20adcbc7fd EA-235126 - CME: HighlightableComponent.getPreferredSize
(cherry picked from commit 523d80cafd)
(cherry picked from commit 31c4452397)
2025-04-12 02:03:06 +02:00
Kirill Kirichenko
f258879e14 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-04-12 02:03:05 +02:00
Kirill Kirichenko
4143f079dc 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-04-12 02:03:05 +02:00
Alexey Ushakov
8ce6ccc795 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-04-12 02:03:05 +02:00
Nikita Gubarkov
189a51451b JBR-2910 Implemented extended glyph cache for Linux
(cherry picked from commit d488f716e7)
2025-04-12 02:03:05 +02:00
Nikita Gubarkov
236e63d8f5 JBR-2910 Implemented extended glyph cache for Windows
(cherry picked from commit 7f75d75933)
2025-04-12 02:03:05 +02:00
Nikita Gubarkov
c26556b4a3 JBR-2614 Fixed LCD glyph width to include both left & right padding, so that rowBytes = width * 3
(cherry picked from commit afb52a160d)
2025-04-12 02:03:05 +02:00
Alexey Ushakov
b55673cdd4 JBR-2463 Font rendering problem on macOS Mojave
Use adjusted advances for glyphs

(cherry picked from commit 1af5dd4aae)
(cherry picked from commit bd6dae9ddf)
2025-04-12 02:03:05 +02:00
Denis Konoplev
4a45c89a3e 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-04-12 02:03:05 +02:00
Vitaly Provodin
67a9ca745d JBR-2545 Clean up the list of ignored Render tests
(cherry picked from commit f7b4c42e1d)
(cherry picked from commit 32b8d67527)
2025-04-12 02:03:05 +02:00
Jayathirth D V
7c1c75dcbd 8241490: Add large text performance tests in RenderPerfTest
(cherry picked from commit 803ee2f2b5)
(cherry picked from commit bbe57208d2)
2025-04-12 02:03:05 +02:00
Alexey Ushakov
cda5aac4d9 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-04-12 02:03:05 +02:00
Konstantin Bulenkov
e9b278cc0b Update FiraCode to 5.2
(cherry picked from commit 71e2a8d8ad)
(cherry picked from commit 0582e90d58)
2025-04-12 02:03:05 +02:00
Alexey Ushakov
54a4af7bd1 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-04-12 02:03:05 +02:00
Alexey Ushakov
c69ecbab0d 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-04-12 02:03:05 +02:00
Alexey Ushakov
7857f08a0f JBR-2463 Font rendering problem on macOS Mojave
Use adjusted advances for glyphs

(cherry picked from commit 1af5dd4aae)
(cherry picked from commit df670fc276)
2025-04-12 02:03:04 +02:00
Anton Tarasov
7ea9a8e1c0 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-04-12 02:03:04 +02:00
Anton Tarasov
06cca33371 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-04-12 02:03:04 +02:00
Anton Tarasov
d87c33e7e1 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-04-12 02:03:04 +02:00
Anton Tarasov
5c7875ccd6 JBR-2645 enable CefBrowser.close(true) in jcef reg tests
(cherry picked from commit 492c217125)
(cherry picked from commit 8975bde92c)
2025-04-12 02:03:04 +02:00
Anton Tarasov
4352022784 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-04-12 02:03:04 +02:00
Anton Tarasov
8e4b512476 JBR-2557 use com.jetbrains.cef.JCefAppConfig in JCEF tests
(cherry picked from commit e30a309f92)
(cherry picked from commit 441ee96ec5)
2025-04-12 02:03:04 +02:00
Anton Tarasov
90ce776f03 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-04-12 02:03:04 +02:00
Anton Tarasov
ac50dbf207 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-04-12 02:03:04 +02:00
Anton Tarasov
1224634010 JBR-2305 jcef: jb/java/jcef/JCEFStartupTest.java throws java.lang.ExceptionInInitializerError
(cherry picked from commit f0385f01ec)
(cherry picked from commit c7d407e0a6)
2025-04-12 02:03:04 +02:00
Anton Tarasov
5d9cb5458f 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-04-12 02:03:04 +02:00
Anton Tarasov
c00bb60a22 JBR-2299 [mac] jcef requests for "chromium safe storage" keychain access
(cherry picked from commit dd1334a352)
(cherry picked from commit 2ebe5709c0)
2025-04-12 02:03:04 +02:00
Anton Tarasov
26a091c263 JBR-2222 Crash during closing IDE
(cherry picked from commit d0c367b31f)
(cherry picked from commit bf36d7873b)
2025-04-12 02:03:04 +02:00
Anton Tarasov
b439597b7d JBR-2287 [jcef] add CefBrowser wrapper to jtreg tests
(cherry picked from commit fa961d1769)
(cherry picked from commit 74ccb86095)
2025-04-12 02:03:04 +02:00
Anton Tarasov
35b3f2be4d JBR-2169 AWTThreading: remove tracked invocation event from completion listener
(cherry picked from commit a855f3b835)
(cherry picked from commit c54371231c)
2025-04-12 02:03:04 +02:00
Anton Tarasov
c28dbe13c7 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-04-12 02:03:03 +02:00
Anton Tarasov
450613e23f JBR-2148 JCEF: JBR bundle has invalid app structure
(cherry picked from commit f45f84d7ed)
(cherry picked from commit b610a7c4f9)
2025-04-12 02:03:03 +02:00
Anton Tarasov
e38b0c4361 JBR-2146 improve InvokeOnToolkitHelper to cover more generic case
(cherry picked from commit 37db252ad7)
2025-04-12 02:03:03 +02:00
Anton Tarasov
903f57dd42 JBR-2139 Idea freeze on dynamic plugin unloading
(cherry picked from commit e57bae4f66)
(cherry picked from commit 647f198b17)
2025-04-12 02:03:03 +02:00
Anton Tarasov
d7aa07544c JBR-2099 jb/java/jcef/JCEFStartupTest.java fails on Windows, Linux
(cherry picked from commit 3dfb0aa16a)
(cherry picked from commit 3750608e62)
2025-04-12 02:03:03 +02:00
Anton Tarasov
752580af9c JBR-2093 create reg test for JCEF startup
(cherry picked from commit e8c2761f5b)
(cherry picked from commit 17cfb8e0d8)
2025-04-12 02:03:03 +02:00
Anton Tarasov
d678a33798 JBR-2082 Revealing taskbar does not work when "Automatically hide the taskbar"
(cherry picked from commit b31a41fb2f)
(cherry picked from commit d2d4e58c13)
2025-04-12 02:03:03 +02:00
Mikhail Grishchenko
50d321d9aa 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-04-12 02:03:03 +02:00
Mikhail Grishchenko
3e5b57153a 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-04-12 02:03:03 +02:00
Mikhail Grishchenko
9ffd857daa JBR-2412 [windows] mouse listener does not work for jcef
added regression test

(cherry picked from commit d1479872f2)
(cherry picked from commit 9e5032e328)
2025-04-12 02:03:03 +02:00
Elena Sayapina
7092c93e00 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-04-12 02:03:03 +02:00
Mikhail Grishchenko
3aa1228de4 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-04-12 02:03:03 +02:00
Vitaly Provodin
2f10950515 exclude the new printer test 8262731
(cherry picked from commit c5ff1e3025)
2025-04-12 02:03:03 +02:00
Alexey Ushakov
4da32e2bb9 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-04-12 02:03:03 +02:00
Alexey Ushakov
6dca4a1f1f 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-04-12 02:03:03 +02:00
Artem Bochkarev
9f9e9dabb7 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-04-12 02:03:02 +02:00
Kirill Kirichenko
12a25a3a6d JBR-1874 Cursor not changing from 'default' to 'text'. Additional fix after reopening.
(cherry picked from commit 5a29d4ade9)
(cherry picked from commit da44860f22)
2025-04-12 02:03:02 +02:00
Elena Sayapina
8bbf511bd2 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-04-12 02:03:02 +02:00
Elena Sayapina
2192101338 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-04-12 02:03:02 +02:00
Elena Sayapina
6e9de4268c 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-04-12 02:03:02 +02:00
Mikhail Grishchenko
0f8f945308 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-04-12 02:03:02 +02:00
Denis Konoplev
61656147da JBR-2490 Add option to work with Surface Pen
(cherry picked from commit 5acc7680a1)
(cherry picked from commit b604023cef)
2025-04-12 02:03:02 +02:00
Denis Konoplev
1ae415657d JBR-2669: set unicode for both keyCode and extendedKeyCode
(cherry picked from commit ba3f14c83a)
(cherry picked from commit 544176fbce)
2025-04-12 02:03:02 +02:00
Denis Konoplev
9d29fc1cf8 JBR-2554: Proper unicode values in KeyEvent.keyCode
(cherry picked from commit 703d77a927)
(cherry picked from commit 63bdac9bbf)
2025-04-12 02:03:02 +02:00
Denis Konoplev
524d11b2e2 JBR-215: Remove SystemInfo
(cherry picked from commit 9adf77a512)
(cherry picked from commit 6a6761d365)
2025-04-12 02:03:02 +02:00
Denis Konoplev
c2b8561a70 JBR-215: Separate LatinNonAlphaNumKeycodes option
(cherry picked from commit caf366f6f3)
(cherry picked from commit ed143f6d73)
2025-04-12 02:03:02 +02:00
Denis Konoplev
47865f3fb0 JBR-215: Windows non-alphanumeric shortcuts
(cherry picked from commit 4f60efebe2)
(cherry picked from commit b5fd23e498)
2025-04-12 02:03:02 +02:00
Denis Konoplev
6a5ce941e2 JBR-2280: Fix regression. Mode compatible with old option.
(cherry picked from commit a3e3c23cb1)
(cherry picked from commit 8c15ab819c)
2025-04-12 02:03:02 +02:00
Denis Fokin
ef31f2d3ad macOS national keyboard support
(cherry picked from commit 83356eb0bb)
(cherry picked from commit c8a36e1804)
2025-04-12 02:03:02 +02:00
Nikita Gubarkov
bb0973459c JBR-6387 Revert "8315701: [macos] Regression: KeyEvent has different keycode on different keyboard layouts"
(cherry picked from commit efd4acd419)
2025-04-12 02:03:01 +02:00
Sergey Malenkov
53910a14cb JBR-1929 FractionalMetricsSupport
(cherry picked from commit bbdc159762)
(cherry picked from commit 9fad8b07f1)
2025-04-12 02:03:01 +02:00
Mikhail Grishchenko
eb634d0447 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-04-12 02:03:01 +02:00
Mikhail Grishchenko
9bc453329b 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-04-12 02:03:01 +02:00
Mikhail Grishchenko
ef32ddc8f1 JBR-1414 [Test] downscale frames to run on low-dpi screens
(cherry picked from commit b46e74fe6f)
(cherry picked from commit 844b3e1d5f)
2025-04-12 02:03:01 +02:00
Elena Sayapina
7c7ca89528 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-04-12 02:03:01 +02:00
Alexey Ushakov
427cc4274e 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-04-12 02:03:01 +02:00
Alexey Ushakov
23fc460b26 JBR-2137 JetBrainsMono fonts update to v1.0.3
(cherry picked from commit a6e441828a)
(cherry picked from commit b25c90ba53)
2025-04-12 02:03:01 +02:00
Mikhail Grishchenko
2bf789c942 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-04-12 02:03:01 +02:00
Elena Sayapina
43a7e00b96 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-04-12 02:03:01 +02:00
Konstantin Bulenkov
f6fb5f200f Update JetBrains Mono to 1.0.2
(cherry picked from commit 6f4a13e46f)
(cherry picked from commit b14bfd3ac9)
2025-04-12 02:03:01 +02:00
Ivan Migalev
ad1d14f202 Extract the DWM colorization parameters from registry (JBR-2070)
(cherry picked from commit 0330cab60b)
(cherry picked from commit 6525a8b70d)
2025-04-12 02:03:01 +02:00
Ivan Migalev
aba1c3c8f8 Refresh desktop properties on WM_DWMCOLORIZATIONCOLORCHANGED (JBR-2070)
(cherry picked from commit 06086f4a7e)
(cherry picked from commit afd04d7c5b)
2025-04-12 02:03:01 +02:00
Ivan Migalev
b1f9f7871e Fix a possible resource leak in ColorizationColorAffectsBorders
(cherry picked from commit 0c911b6ffe)
(cherry picked from commit ffbaf5e1d1)
2025-04-12 02:03:01 +02:00
Elena Sayapina
ef6b25fbce JBR-2086 JetBrainsMono fonts update to v1.0.1
(cherry picked from commit a4b373e631)
(cherry picked from commit 462fef3916)
2025-04-12 02:03:01 +02:00
Konstantin Bulenkov
14ecb82d4e JetBrains Mono 1.0
(cherry picked from commit d514f7a982)
(cherry picked from commit 56ee3ef459)
2025-04-12 02:03:00 +02:00
Denis Konoplev
081cab91a9 JBR-3444: Return NullSurfaceData when gc == null
(cherry picked from commit 01ad15e61c)
(cherry picked from commit 2a7a828ec8)
2025-04-12 02:03:00 +02:00
Denis Konoplev
ceb72ff284 JBR-1995: Last character issue with korean
Fix for JTextComponent

(cherry picked from commit a7c8b0b535)
(cherry picked from commit 48410e5865)
2025-04-12 02:03:00 +02:00
Denis Konoplev
5585e882e1 JBR-2891: Post PhaseEvents in the begin and end of Magnify and Rotate
(cherry picked from commit c811c295c2)
(cherry picked from commit fe18b612dc)
2025-04-12 02:03:00 +02:00
Denis Konoplev
7a3e54cba7 JBR-2444: Turn on IM workaround by default
(cherry picked from commit 15c4ce1d3e)
(cherry picked from commit fe0c4e5b9e)
2025-04-12 02:03:00 +02:00
Denis Konoplev
eac84cef60 Fix build: add import & fix jwhen
(cherry picked from commit 3551c2a4c0)
2025-04-12 02:03:00 +02:00
Denis Konoplev
864e1994de JBR-2795: Add explicit conversion
(cherry picked from commit bf3e1c0c31)
(cherry picked from commit 5f07df3034)
2025-04-12 02:03:00 +02:00
Denis Konoplev
a8d6809825 IDEA-237231: Correct signarute mask
(cherry picked from commit 6974131eec)
(cherry picked from commit af2154f8b1)
2025-04-12 02:03:00 +02:00
Denis Konoplev
a22ec231ae IDEA-237231: Possible fix for pen interraction
(cherry picked from commit 33a8c95d39)
(cherry picked from commit 58fbc3f800)
2025-04-12 02:03:00 +02:00
Denis Konoplev
f6364c3c1a JBR-2041: Project view tap fix, recovery? constants & logging
(cherry picked from commit 1e904db3b0)
(cherry picked from commit 5c62dbdbca)
2025-04-12 02:03:00 +02:00
Denis Konoplev
899f92c408 IDEA-229135: Fling animation stop on tap
(cherry picked from commit 7ce0f79561)
(cherry picked from commit 01f0f774b4)
2025-04-12 02:03:00 +02:00
Denis Konoplev
7251d63062 Windows touch screen support
(cherry picked from commit cab3f28907)
(cherry picked from commit ce0e4aff62)
2025-04-12 02:03:00 +02:00
Denis Konoplev
ee14b10dd6 Turn off multitouch
(cherry picked from commit a2576ffa9a)
(cherry picked from commit 41eaa75d27)
2025-04-12 02:03:00 +02:00
Denis Konoplev
c42242d59e Check XInput extension && touch inertia
(cherry picked from commit cca7fb97f4)
(cherry picked from commit edcb7310d3)
2025-04-12 02:03:00 +02:00
Denis Konoplev
e4be602a33 Touch scroll handling
(cherry picked from commit 6dcec3dc31)
(cherry picked from commit c585901afe)
2025-04-12 02:02:59 +02:00
Denis Konoplev
a9b0e927ce XI2 Constants
(cherry picked from commit 588cd6ee73)
(cherry picked from commit 2e4a8ba10b)
2025-04-12 02:02:59 +02:00
Denis Konoplev
61294d46ef XLibWrapper XI2 functions
(cherry picked from commit d6bd1bfa2b)
(cherry picked from commit 7edf395b3b)
2025-04-12 02:02:59 +02:00
Denis Konoplev
a640f7d606 X11 native get put double
(cherry picked from commit f101bc1108)
(cherry picked from commit 344fe36ceb)
2025-04-12 02:02:59 +02:00
Denis Konoplev
3512ef2a82 Native data types
(cherry picked from commit 9504574dbb)
(cherry picked from commit 5967b3f41b)
2025-04-12 02:02:59 +02:00
Denis Konoplev
55228f9312 XI2 headers in xlib wrapper generator
(cherry picked from commit ef108067a1)
(cherry picked from commit 1397389026)
2025-04-12 02:02:59 +02:00
Denis Konoplev
777d13fb17 Revert "Turn off multitouch"
This reverts commit 90ea3bf57e4c687e9d9bf0a37f2f64c82a81f4eb.

(cherry picked from commit b154b46eb0)
2025-04-12 02:02:59 +02:00
Denis Konoplev
d648c2d0d0 Turn off multitouch
(cherry picked from commit a2576ffa9a)
(cherry picked from commit 960e154377)
2025-04-12 02:02:59 +02:00
Alexey Ushakov
4b2b0409b1 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-04-12 02:02:59 +02:00
Vitaly Provodin
69723c54a6 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-04-12 02:02:59 +02:00
Dennis Ushakov
3587c5d61d JBR-1863, JBR-1868 correct advances on Catalina
(cherry picked from commit bff05a1a97)
2025-04-12 02:02:59 +02:00
Dennis Ushakov
363749530f JBR-1850: on macOS fonts should be sorted by weight to ensure proper population of the families
(cherry picked from commit 59974ca04c)
2025-04-12 02:02:59 +02:00
Dennis Ushakov
e67b1fa114 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-04-12 02:02:59 +02:00
Dennis Ushakov
4898b631d3 JBR-1756 use CoreText for all font rendering on Catalina
(cherry picked from commit a4f42cd091)
2025-04-12 02:02:59 +02:00
Nikita Gubarkov
c087532517 JBR-410 Added emoji support for Linux
(cherry picked from commit a98fac2c53)
2025-04-12 02:02:59 +02:00
Alexey Ushakov
04cd53c198 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-04-12 02:02:58 +02:00
Anton Tarasov
22e95a1a30 JRE-729 [windows] unreasonable IME activity consumes CPU
(cherry picked from commit caf8462e09)
2025-04-12 02:02:58 +02:00
Dmitry Batrak
04ededd5bc 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-04-12 02:02:58 +02:00
Dmitry Batrak
49519458b1 JBR-3038 Unexpected windows z-order change on workspace switch
(cherry picked from commit ddda860f42)
(cherry picked from commit f4b23f8be1)
2025-04-12 02:02:58 +02:00
Dmitry Batrak
2f250e8f23 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-04-12 02:02:58 +02:00
Dmitry Batrak
549ed67b1c JBR-2934 Serious usability issue with GoLand 2020.3 caused by JBR
(cherry picked from commit 95be4351d4)
(cherry picked from commit 79d0b926b2)
2025-04-12 02:02:58 +02:00
Dmitry Batrak
8255a2d8c0 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-04-12 02:02:58 +02:00
Dmitry Batrak
7933209ab3 JBR-2698 setAutoRequestFocus(false) breaks focus logic under i3 window manager on Linux
(cherry picked from commit ebcdeb7d80)
(cherry picked from commit 6d26292983)
2025-04-12 02:02:58 +02:00
Dmitry Batrak
0afd69e095 JBR-2696 Log focus API invocations with stack traces
(cherry picked from commits 0f038754e5, a507cab6d3)

(cherry picked from commit a494c76a27)
2025-04-12 02:02:58 +02:00
Dmitry Batrak
b74db4e48e 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-04-12 02:02:58 +02:00
Alexey Ushakov
d29549c644 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-04-12 02:02:58 +02:00
Artem Bochkarev
c3b499425f 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-04-12 02:02:58 +02:00
Artem Bochkarev
9f7b45d59c JBR-1841: allow deferred disabling of InputMethods-support
(cherry picked from commit 969255904b)
(cherry picked from commit f8513bcad9)
2025-04-12 02:02:58 +02:00
Artem Bochkarev
077f47a723 JBR-1668: add hardcoded default values for preferences node NSServicesStatus
(cherry picked from commit 8445f53d85)
(cherry picked from commit 2e3a5fe508)
2025-04-12 02:02:58 +02:00
Artem Bochkarev
27e14793b5 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-04-12 02:02:58 +02:00
Artem Bochkarev
53743109e5 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-04-12 02:02:57 +02:00
Elena Sayapina
ff3a9fc2f7 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-04-12 02:02:57 +02:00
Alexey Ushakov
ff86c719c9 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-04-12 02:02:57 +02:00
Dmitry Batrak
08aa4cfa81 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-04-12 02:02:57 +02:00
Dmitry Batrak
544d674892 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-04-12 02:02:57 +02:00
Dmitry Batrak
95b2c8abce 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-04-12 02:02:57 +02:00
Artem Bochkarev
a6d5997eda JBR-1771: fixed compilation errors (macosx-x86_64-normal-server-fastdebug)
(cherry picked from commit 1acada7cac)
(cherry picked from commit c1751ca98d)
2025-04-12 02:02:57 +02:00
Artem Bochkarev
91cc7bb40c JBR-1668: minor fixes
fixed review comments

(cherry picked from commit 9dbcf194c9)
(cherry picked from commit 8276f81a13)
2025-04-12 02:02:57 +02:00
Vitaly Provodin
5f90edb080 JBR-1618: fixed misprint, added saving screenshots in case of failure
(cherry picked from commit e4a3889cf0)
(cherry picked from commit 3959ac1680)
2025-04-12 02:02:57 +02:00
Alexey Ushakov
35f3b7acbd 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-04-12 02:02:57 +02:00
Alexey Ushakov
ae6ae5ffab 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-04-12 02:02:57 +02:00
Elena Sayapina
14e9a38897 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-04-12 02:02:57 +02:00
Artem Bochkarev
b4a1fd1b9f JBR-1668: read system keyboard shortcuts
initial support for OS X

(cherry picked from commit 6bbe7102e2)
(cherry picked from commit ccd8116bf3)
2025-04-12 02:02:57 +02:00
Artem Bochkarev
5df037a350 JBR-1573: restore current input context after cleanup
(cherry picked from commit b7acd7f6f6)
(cherry picked from commit 9dbdd24cc3)
2025-04-12 02:02:57 +02:00
Alexey Ushakov
874614b0ad 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-04-12 02:02:56 +02:00
Alexey Ushakov
08481c67bd 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-04-12 02:02:56 +02:00
Alexey Ushakov
485c7ef82a 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-04-12 02:02:56 +02:00
Alexey Ushakov
63bb92cabd 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-04-12 02:02:56 +02:00
Alexey Ushakov
6bf96f023a 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-04-12 02:02:56 +02:00
Alexey Ushakov
b8573df0d0 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-04-12 02:02:56 +02:00
Alexey Ushakov
ad22ef1ee7 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-04-12 02:02:56 +02:00
Alexey Ushakov
7e1d0767e5 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-04-12 02:02:56 +02:00
Alexey Ushakov
f998c3d5d3 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-04-12 02:02:56 +02:00
Alexey Ushakov
dbede8f26b 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-04-12 02:02:56 +02:00
Artem Bochkarev
2b7ba2a1f4 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-04-12 02:02:56 +02:00
Alexey Ushakov
02a1e67e76 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-04-12 02:02:56 +02:00
Artem Bochkarev
000cf4817b JBR-1541: activate menu in completion handler of modal dialog
(cherry picked from commit e57384c1d6)
(cherry picked from commit b38f01f5e4)
2025-04-12 02:02:56 +02:00
Alexey Ushakov
24e0143bbe 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-04-12 02:02:56 +02:00
Alexey Ushakov
7ea75a280d 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-04-12 02:02:55 +02:00
Alexey Ushakov
a19c2c4e9b 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-04-12 02:02:55 +02:00
Elena Sayapina
732a428c84 JBR-1372: [TESTBUG] JDialog1054.java, MoveFocusShortcutTest.java regression tests need update
(cherry picked from commit a5948894bf)
(cherry picked from commit dcc2be2a53)
2025-04-12 02:02:55 +02:00
Maxim Kartashev
ed2d502b5f 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-04-12 02:02:55 +02:00
Vyacheslav Moklev
c106e998cb Fix const pointer after JDK-8225032 fix
(cherry picked from commit dc3ae1cafa)
2025-04-12 02:02:55 +02:00
Vyacheslav Moklev
31cf361919 Fix compilation on windows platform: awt_ole.h must be included before awt.h
(cherry picked from commit 6fdcfedd0e)
2025-04-12 02:02:55 +02:00
Vyacheslav Moklev
1a65244976 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-04-12 02:02:55 +02:00
Vyacheslav Moklev
20f30ffe4d JBR-1271 Wrong parent of native windows dialogs
Set a proper parent to a dialog window

(cherry picked from commit 803ba97361)
2025-04-12 02:02:55 +02:00
Vyacheslav Moklev
cce44079d6 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-04-12 02:02:55 +02:00
Vyacheslav Moklev
06d36492a6 JBR-1274 Common Item Dialog sometimes crash the process
Prevent from freeing memory with CoTaskMemFree twice

(cherry picked from commit 8e5e04a798)
2025-04-12 02:02:55 +02:00
Vyacheslav Moklev
02247cd39b 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-04-12 02:02:55 +02:00
Vyacheslav Moklev
0bac0d79d8 JBR-1258 CommonItemDialog ignores directory to open
Fix parsing of directory path / file path

(cherry picked from commit b09a8aace1)
2025-04-12 02:02:55 +02:00
Vyacheslav Moklev
83930276fe 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-04-12 02:02:55 +02:00
Alexey Ushakov
d40a2fd60a 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-04-12 02:02:55 +02:00
Alexey Ushakov
58461fb841 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-04-12 02:02:55 +02:00
Elena Sayapina
d2fca09ad4 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-04-12 02:02:54 +02:00
Elena Sayapina
f0cf6a1d59 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-04-12 02:02:54 +02:00
Elena Sayapina
2b71575bbb 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-04-12 02:02:54 +02:00
Elena Sayapina
fadc7feb82 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-04-12 02:02:54 +02:00
Vitaly Provodin
49dce6065e 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-04-12 02:02:54 +02:00
Vitaly Provodin
45161642d8 JRE-1117 J2DBench: introduced result reader for TC's charts
(cherry picked from commit 422fa59643)
(cherry picked from commit 43b5f7f8b0)
2025-04-12 02:02:54 +02:00
Alexey Ushakov
45e37b8b48 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-04-12 02:02:54 +02:00
Alexey Ushakov
244ea82bed 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-04-12 02:02:54 +02:00
Alexey Ushakov
0198042ad5 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-04-12 02:02:54 +02:00
Alexey Ushakov
401b1ee75d 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-04-12 02:02:54 +02:00
Konstantin Bulenkov
fb3268d0ea update icons
(cherry picked from commit dfe387ff5037deda29d8d522cba6cc5370796ff4)
(cherry picked from commit de1e4a9d71)
(cherry picked from commit 0b33efa7d1)
2025-04-12 02:02:54 +02:00
Vitaly Provodin
439ce57d84 Update README.md
(cherry picked from commit eacef38934)
2025-04-12 02:02:54 +02:00
Vitaly Provodin
cb2e0be199 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-04-12 02:02:54 +02:00
Vitaly Provodin
ddc0ad573f 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-04-12 02:02:54 +02:00
Vitaly Provodin
7c1c0dd286 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-04-12 02:02:54 +02:00
Sergey Malenkov
aca089b292 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-04-12 02:02:53 +02:00
Sergey Malenkov
9835329210 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-04-12 02:02:53 +02:00
Dmitry Batrak
af593beb8e JBR-3339 Window requests focus on horizontal scroll (on Linux)
(cherry picked from commit 8d74e8e30b)
(cherry picked from commit 88edabdd60)
2025-04-12 02:02:53 +02:00
Anton Tarasov
5b3e9f9ae6 JRE-166 [macOS] deadlock with JFXPanel
(cherry picked from commit a9dbb6990fac0c659297487a261ba9170e5fb3ad)

(cherry picked from commit 8a44e1bb37)
(cherry picked from commit 9a280dc79e)
2025-04-12 02:02:53 +02:00
Alexey Ushakov
8520d820a9 8265445: Introduce the new client property for mac: apple.awt.windowAppearance
Implemented apple.awt.windowAppearance client property

(cherry picked from commit ba60f7bd8f)
2025-04-12 02:02:53 +02:00
Anton Tarasov
0a22f7bc4f 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-04-12 02:02:53 +02:00
Dmitry Batrak
3d0aa47565 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-04-12 02:02:53 +02:00
Alexey Ushakov
a3992dccac 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-04-12 02:02:53 +02:00
Alexey Ushakov
27cee33a80 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-04-12 02:02:53 +02:00
Alexey Ushakov
3cbe30d9be 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-04-12 02:02:53 +02:00
Dmitry Batrak
556a08e407 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-04-12 02:02:53 +02:00
Alexey Ushakov
f6af468818 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-04-12 02:02:53 +02:00
Alexey Ushakov
8985937079 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-04-12 02:02:53 +02:00
Alexey Ushakov
b6422de5f4 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-04-12 02:02:53 +02:00
Alexey Ushakov
ed0752372f JBR-3304 jbr-dev warnings: 'getPhysFontName' defined but not used [-Werror=unused-function]
Removed unused code

(cherry picked from commit 6781f2646f)
2025-04-12 02:02:53 +02:00
Vitaly Provodin
5461384349 exclude javax/swing/JTabbedPane/4624207/bug4624207.java failing on windows due to 8197552
(cherry picked from commit 3f8f2e8928)
2025-04-12 02:02:52 +02:00
Alexey Ushakov
f7999b3392 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-04-12 02:02:52 +02:00
Alexey Ushakov
ae042d5754 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-04-12 02:02:52 +02:00
Denis Konoplev
22aaac896f 8264143: Change uint8_t to unsigned char
(cherry picked from commit 9d01b82f64)
2025-04-12 02:02:52 +02:00
Dmitry Batrak
f1ef1e2d4d JBR-3255 Applying 'incline' transform might change character's advance
(cherry picked from commit b37f7cfdb1)
(cherry picked from commit 2bd6c80390)
2025-04-12 02:02:52 +02:00
Dmitry Batrak
211340de47 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-04-12 02:02:52 +02:00
Dmitry Batrak
fe88cae842 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-04-12 02:02:52 +02:00
Dmitry Batrak
99df718792 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-04-12 02:02:52 +02:00
Dmitry Batrak
68856334ac 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-04-12 02:02:52 +02:00
Dmitry Batrak
35ea11d3db 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-04-12 02:02:52 +02:00
Dmitry Batrak
50b46de947 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-04-12 02:02:52 +02:00
Dmitry Batrak
c9a132404d 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-04-12 02:02:52 +02:00
Dmitry Batrak
c0cdebc437 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-04-12 02:02:52 +02:00
Denis Konoplev
491b821948 8264143: Lanai: RenderPerfTest.BgrSwBlitImage has artefacts on apple M1
Add stdint include to fix x64 build

(cherry picked from commit 0dc04385a3)
2025-04-12 02:02:52 +02:00
Dmitry Batrak
6846569b9d JBR-2498 Fix unexpected window raising under Mutter WM
(cherry picked from commit 73b45fb899)
(cherry picked from commit bc8dec8fc1)
2025-04-12 02:02:51 +02:00
Dmitry Batrak
88233b5a1e 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-04-12 02:02:51 +02:00
Dmitry Batrak
f11d654c11 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-04-12 02:02:51 +02:00
Dmitry Batrak
9dc90899b3 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-04-12 02:02:51 +02:00
Dmitry Batrak
8f1aac3c6e 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-04-12 02:02:51 +02:00
Dmitry Batrak
4539f5d6f2 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-04-12 02:02:51 +02:00
Dmitry Batrak
66a4fbb34e 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-04-12 02:02:51 +02:00
Dmitry Batrak
5ad319ee1b 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-04-12 02:02:51 +02:00
Dmitry Batrak
16031f0d35 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-04-12 02:02:51 +02:00
Dmitry Batrak
1b49c64ed8 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-04-12 02:02:51 +02:00
Dmitry Batrak
ed915490e9 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-04-12 02:02:51 +02:00
Dmitry Batrak
7204ec1019 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-04-12 02:02:51 +02:00
Dmitry Batrak
a618668299 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-04-12 02:02:51 +02:00
Dmitry Batrak
cadadf2dfd 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-04-12 02:02:51 +02:00
Alexey Ushakov
58573aa1bc 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-04-12 02:02:51 +02:00
Alexey Ushakov
1c95598226 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-04-12 02:02:50 +02:00
Dmitry Batrak
80f596e11b 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-04-12 02:02:50 +02:00
Dmitry Batrak
7cece5a27a JRE-11 Support text rendering via DirectWrite API on Windows
(cherry picked from commit 6605d4a525)
2025-04-12 02:02:50 +02:00
Dmitry Batrak
4add69ea48 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-04-12 02:02:50 +02:00
Vitaly Provodin
061ed0e3d0 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-04-12 02:02:50 +02:00
Vitaly Provodin
02a5c81afe 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-04-12 02:02:50 +02:00
Alexey Ushakov
b329ee1495 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-04-12 02:02:50 +02:00
Vitaly Provodin
454058cd66 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-04-12 02:02:50 +02:00
Vitaly Provodin
56f2f16c4f 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-04-12 02:02:50 +02:00
Vitaly Provodin
54556e0389 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-04-12 02:02:50 +02:00
Vitaly Provodin
82a2db3a1a 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-04-12 02:02:50 +02:00
Vitaly Provodin
1b886e02aa 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-04-12 02:02:50 +02:00
Vitaly Provodin
546b1904bf 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-04-12 02:02:50 +02:00
Vitaly Provodin
4153dbcbe6 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-04-12 02:02:50 +02:00
Vitaly Provodin
5519b852b0 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-04-12 02:02:50 +02:00
Vitaly Provodin
c5c23f44f2 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-04-12 02:02:49 +02:00
Vitaly Provodin
71c7c5c7d8 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-04-12 02:02:49 +02:00
Vitaly Provodin
00f1643051 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-04-12 02:02:49 +02:00
Vitaly Provodin
3afcac06ce 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-04-12 02:02:49 +02:00
Vitaly Provodin
4a2047e4be 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-04-12 02:02:49 +02:00
Alexey Ushakov
a58bd433d8 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-04-12 02:02:49 +02:00
Alexey Ushakov
01e4811016 Added missing fontconfig defines
(cherry picked from commit 2ac273a456)
(cherry picked from commit d922d7dfaf)
2025-04-12 02:02:49 +02:00
Alexey Ushakov
48afc170a0 JRE-43 Font.getFamily() does not work in headless mode
Removed unused code

(cherry picked from commit 5b523f049e)
(cherry picked from commit 3535055ecd)
2025-04-12 02:02:49 +02:00
Alexey Ushakov
5f0f7b4bd6 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-04-12 02:02:49 +02:00
Alexey Ushakov
99945592eb 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-04-12 02:02:49 +02:00
Alexey Ushakov
2c47f19334 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-04-12 02:02:49 +02:00
Alexey Ushakov
17a6b005bc 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-04-12 02:02:49 +02:00
Alexey Ushakov
d26abab26d 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-04-12 02:02:49 +02:00
Alexey Ushakov
2a216ba45b JRE-29 fontconfig lib crashes CLion on OSX
Disabled fontconfig usage on OSX

(cherry picked from commit 431e14429c)
(cherry picked from commit 534d184416)
2025-04-12 02:02:49 +02:00
Vitaly Provodin
416b8ce9ee exclude tests spontaneously creating windows during test execution
(cherry picked from commit bd278194b9)
2025-04-12 02:02:48 +02:00
Alexey Ushakov
1066f625df 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-04-12 02:02:48 +02:00
Alexey Ushakov
b2dced7457 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-04-12 02:02:48 +02:00
Alexey Ushakov
57fc168902 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-04-12 02:02:48 +02:00
Anton Tarasov
f3a307cf74 JBR-2031 [mac] jcef deadlocks with a11y on start
(cherry picked from commit 4f44b37f08)
(cherry picked from commit 8a4a781393)
2025-04-12 02:02:48 +02:00
Alexey Ushakov
8f3151915d 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-04-12 02:02:48 +02:00
Anton Tarasov
5ccfde558b JBR-2019 provide getWindowHandle method for jcef
(cherry picked from commit 7ae706b629)
(cherry picked from commit d0b855df14)
2025-04-12 02:02:48 +02:00
Anton Tarasov
cde93de14b JBR-1976 [jcef] need mouse-transparent window on Windows
(cherry picked from commit b60fac96b4)
(cherry picked from commit e68503823b)
2025-04-12 02:02:48 +02:00
Anton Tarasov
6268d2c1af JBR-1824 export NSWindow::setIgnoresMouseEvents to java internal API
(cherry picked from commit 4399dc382c)
(cherry picked from commit 99d8964d90)
2025-04-12 02:02:48 +02:00
Anton Tarasov
a65330f586 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-04-12 02:02:48 +02:00
Anton Tarasov
e3116cfa4f JBR-1795 Project opened from Welcome screen goes to backgound after loading
(cherry picked from commit 322526458a)
(cherry picked from commit 2ee33311dd)
2025-04-12 02:02:48 +02:00
Anton Tarasov
9df3ec5058 JBR-1609 Jupyter Notebook eventually causes IDEA to become unresponsive on Mac OSX
(cherry picked from commit 8ae0be8eb6)
(cherry picked from commit 812158fb5b)
2025-04-12 02:02:48 +02:00
Anton Tarasov
c3d94c8678 JBR-1786 Weird white border for IDE window
(cherry picked from commit 4b09614a0e)
(cherry picked from commit 8366197c01)
2025-04-12 02:02:48 +02:00
Vyacheslav Moklev
99a965d17b 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-04-12 02:02:48 +02:00
Vyacheslav Moklev
38e7e90417 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-04-12 02:02:48 +02:00
Anton Tarasov
16a2ad31f4 JBR-1770 [windows] frame does not open as maximized
(cherry picked from commit d9dfc3c6c5)
(cherry picked from commit 7525d41946)
2025-04-12 02:02:47 +02:00
Anton Tarasov
8fb1017eb4 JBR-1693 difficult to input Japanese text with "Fast" Key Repeat
(cherry picked from commit 12de3e287e)
(cherry picked from commit bfa95fd66e)
2025-04-12 02:02:47 +02:00
Anton Tarasov
87f83fc2c6 JBR-1669 IDE-managed HiDPI mode is broken
(cherry picked from commit 461b0b5cd4)
(cherry picked from commit 3049d42f8c)
2025-04-12 02:02:47 +02:00
Anton Tarasov
7fd43106f8 JBR-1650 propagate custom decoration title bar height to native
(cherry picked from commit f6fc65d014)
(cherry picked from commit 34032b2ced)
2025-04-12 02:02:47 +02:00
Anton Tarasov
edf41c5af1 JBR-1629 Maximized window cut at the right and bottom
(cherry picked from commit 9e768377db)
(cherry picked from commit 0532e6c2aa)
2025-04-12 02:02:47 +02:00
Anton Tarasov
953f9ec6e9 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-04-12 02:02:47 +02:00
Anton Tarasov
ff0eae88d2 JBR-1427 pycharm jupyter preview stuck and no response when click on preview.
(cherry picked from commit 1746b04686)
(cherry picked from commit 3c3c2ffa90)
2025-04-12 02:02:47 +02:00
Anton Tarasov
887308ba9c IDEA-210154 Borderless UI: Top frame of IDEA window is blue
(cherry picked from commit 2dd4163bc4)
(cherry picked from commit 2f4e023df0)
2025-04-12 02:02:47 +02:00
Anton Tarasov
b842b7a225 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-04-12 02:02:47 +02:00
Anton Tarasov
91f7f0eef5 JBR-1313 wrong insets for non-resizable custom-decorated frame
(cherry picked from commit 9179718cb6)
(cherry picked from commit 05f934ea20)
2025-04-12 02:02:47 +02:00
Anton Tarasov
066d5a141f 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-04-12 02:02:47 +02:00
Anton Tarasov
f30823bc7d JBR-1278 allow native border and shadow for custom decoration mode
(cherry picked from commit ec106a58a3)
2025-04-12 02:02:47 +02:00
Anton Tarasov
c11c1ae600 JRE-1232 forwardport: JRE-1228 support custom frame decoration
(cherry picked from commit d2820524a1)
(cherry picked from commit 1ebd6a000b)
2025-04-12 02:02:47 +02:00
Anton Tarasov
34904d4d43 JRE-1162 [jdk11] support on-the-fly DPI change on linux
(cherry picked from commit c06c4c69d3)
(cherry picked from commit 5138201282)
2025-04-12 02:02:47 +02:00
Anton Tarasov
d99e927be0 JRE-1142 [jdk11] hidpi is not detected since Ubuntu 18.04
(cherry picked from commit be4f8c0d9d)
(cherry picked from commit 96b07c6c65)
2025-04-12 02:02:46 +02:00
Anton Tarasov
b2dbe24abb 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-04-12 02:02:46 +02:00
Anton Tarasov
69b5d7337a fix JNI_OnUnload definition
(cherry picked from the commit  3571e39071)

(cherry picked from commit 1019d8f0f2)
(cherry picked from commit 4fae6cb785)
2025-04-12 02:02:46 +02:00
Anton Tarasov
3c30ab0414 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-04-12 02:02:46 +02:00
Anton Tarasov
8325fdd42e JRE-938 [windows] Frame.setMaximizedBounds not hidpi-aware
(cherry picked from commit cc97899923320e1fa17f5e44975c4a0f0ba51014)
(cherry picked from commit ccfe65be7f)
(cherry picked from commit b86054beb6)
2025-04-12 02:02:46 +02:00
Anton Tarasov
a27d088261 JRE-907 macOS: add ability to check for scaled display mode
(cherry picked from commit e496262aa1)
(cherry picked from commit e07eaabe47)
2025-04-12 02:02:46 +02:00
Anton Tarasov
edec30074a JRE-934 Diff viewer errors are not visible on HiDPI Linux
(cherry picked from commit 641a09dd52)
(cherry picked from commit c37bfae963)
2025-04-12 02:02:46 +02:00
Anton Tarasov
c8a2150c23 [jdk9] HiDPI scale is not detected on some linux desktops
(cherry picked from commit 9279d80110)
(cherry picked from commit 57f7da037b)
2025-04-12 02:02:46 +02:00
Anton Tarasov
c4d69c80bc JRE-681 [windows] direct drawing into frame graphics may have wrong translate
(cherry picked from commit 6ea1d45fd1)
(cherry picked from commit 60bb53f919)
2025-04-12 02:02:46 +02:00
Anton Tarasov
6e73c2f268 Read org.gnome.desktop.interface/scaling-factor
(cherry picked from commit 277357ae73)
(cherry picked from commit d4f290861b)
2025-04-12 02:02:46 +02:00
Anton Tarasov
a3a1ca3eff 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-04-12 02:02:46 +02:00
Anton Tarasov
4fc324d141 Do not scale base font in HiDPI mode on Linux
(cherry picked from commit 6fb2c36529)
(cherry picked from commit b2e47f1be3)
2025-04-12 02:02:46 +02:00
Anton Tarasov
40ddeb5c67 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-04-12 02:02:46 +02:00
Anton Tarasov
f5124031ba 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-04-12 02:02:46 +02:00
Anton Tarasov
e2b46b1b5e 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-04-12 02:02:46 +02:00
Anton Tarasov
c94a690c06 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-04-12 02:02:45 +02:00
Anton Tarasov
7dfa669a6f 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-04-12 02:02:45 +02:00
Anton Tarasov
c8d92d695c 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-04-12 02:02:45 +02:00
Anton Tarasov
c02229c9e6 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-04-12 02:02:45 +02:00
Anton Tarasov
26869225d4 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-04-12 02:02:45 +02:00
Anton Tarasov
d6fb438dcf 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-04-12 02:02:45 +02:00
Anton Tarasov
2d5b06dc18 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-04-12 02:02:45 +02:00
Anton Tarasov
70d1f71ae2 JRE-373 [macos] nativeCreateNSWindow deadlocks with a11y
(cherry picked from commit 72c77a992bbf1b95b82ffc08cb2f4f3bc36b3657)

(cherry picked from commit aa09fa2c85)
(cherry picked from commit 9b32557ad4)
2025-04-12 02:02:45 +02:00
Anton Tarasov
76bd41ec3e 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-04-12 02:02:45 +02:00
Anton Tarasov
13771dc73e 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-04-12 02:02:45 +02:00
Anton Tarasov
b438cfb3a6 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-04-12 02:02:45 +02:00
Anton Tarasov
abb092eb32 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-04-12 02:02:45 +02:00
Anton Tarasov
2bb34ceb98 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-04-12 02:02:45 +02:00
Anton Tarasov
00a20cb25b 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-04-12 02:02:45 +02:00
Anton Tarasov
d9da25abed 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-04-12 02:02:45 +02:00
Anton Tarasov
f4deb331a7 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-04-12 02:02:44 +02:00
Anton Tarasov
9f40a53b39 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-04-12 02:02:44 +02:00
Anton Tarasov
f42ab10909 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-04-12 02:02:44 +02:00
Anton Tarasov
dcdf31a98d 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-04-12 02:02:44 +02:00
Vitaly Provodin
c81af72d04 updated JTreg exclude list
(cherry picked from commit 418fb32e7f)
2025-04-12 02:02:44 +02:00
Alexey Ushakov
be30d873a9 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-04-12 02:02:44 +02:00
Vitaly Provodin
ff1d8a442e JBR-3398 remove the Experimental AOT and JIT Compiler (JEP 410)
(cherry picked from commit df63a5e6ad)
2025-04-12 02:02:44 +02:00
Alexey Ushakov
b10b0adb43 JBR-2807: JDK15: update modules.list to resolve jbr build failure
removed nashorn modules

(cherry picked from commit c56a18eaf9)
2025-04-12 02:02:44 +02:00
Vitaly Provodin
e59440b5aa JBR-2130 remove module jdk.pack
(cherry picked from commit 9acab72161)
2025-04-12 02:02:44 +02:00
Vitaly Provodin
7d49bd441f JBR-4810 add VERSION_PATCH into version number string
(cherry picked from commit 401a12b6b9)
2025-04-12 02:02:44 +02:00
Vitaly Provodin
5fccfdf6f1 JBR-4754 make root directory with the same name as archive name
(cherry picked from commit 97a17c9a36)
2025-04-12 02:02:44 +02:00
Nikita Provotorov
ff1d92eaf5 JBR-2074 Windows 10 AArch64 support: make the build scripts use custom build-jdk.
(cherry picked from commit 3d9869c702)
2025-04-12 02:02:44 +02:00
Nikita Provotorov
5c65b11c09 JBR-2074 Windows 10 AArch64 support: build fixes.
(cherry picked from commit a873008261)
2025-04-12 02:02:44 +02:00
Vitaly Provodin
6387ee40b2 JBR-4567 replace comma with point in RenderPerf scores
(cherry picked from commit 5b91efd8c0)
2025-04-12 02:02:44 +02:00
Vitaly Provodin
947b246baf JBR-4520 set file permissions after signing
(cherry picked from commit 64259b866c)
2025-04-12 02:02:44 +02:00
Vitaly Provodin
4b874a77c0 JBR-4512 windows: include pdb-files into jbrsdk
(cherry picked from commit 606ad057d3)
2025-04-12 02:02:43 +02:00
Vitaly Provodin
cc6179d182 JBR-4087 add version info into the name of root directory in JBR tar.gz-distributions
(cherry picked from commit 45eeae64ee)
2025-04-12 02:02:43 +02:00
Vitaly Provodin
77e3cd9480 JBR-4511 remove --disable options from configure mac-aarch64 builds & unify configure for x64 and aarch64
(cherry picked from commit b387b2213e)
2025-04-12 02:02:43 +02:00
Maxim Kartashev
2cddda8ea6 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-04-12 02:02:43 +02:00
Vladislav Rassokhin
a7c55ba42f JBR-4451 Make bash scripts safer
(cherry picked from commit 4f048b9790)
2025-04-12 02:02:43 +02:00
Vitaly Provodin
9e1debba67 JBR-4487 enable Linux 32 builds
(cherry picked from commit 38dbda93d0)
2025-04-12 02:02:43 +02:00
Vitaly Provodin
40e6cfb03d JBR-4458 enable JBR17 windows 32 bit builds
(cherry picked from commit d3e65953e7)
2025-04-12 02:02:43 +02:00
Vitaly Provodin
aa72d48c0f JBR-4272 generate and save debug symbols for JBR on macos/linux
(cherry picked from commit ef34e66dbf)
2025-04-12 02:02:43 +02:00
Vitaly Provodin
ec95ff512e JBR-4053 integrate DCEVM patches as usual commits
(cherry picked from commit 45672abcad)
2025-04-12 02:02:43 +02:00
Vitaly Provodin
5181139699 JBR-4370 create a test checking all JBR artifacts exist - add exit code
(cherry picked from commit 4dce25a5db)
2025-04-12 02:02:43 +02:00
Nikita Provotorov
151acf611c JBR-2074 Windows 10 AArch64 support: add build and pack scripts.
(cherry picked from commit e33c77a615)
2025-04-12 02:02:43 +02:00
Vladimir Kempik
06f86b6ef5 JBR-4452: Update crash report message with JBR youtrack link
instead of bugreport.java.com

(cherry picked from commit c52914a035)
2025-04-12 02:02:43 +02:00
Vitaly Provodin
a1a5db7657 JBR-4437 add sources to JBRSDK distributions for Windows and Linux
(cherry picked from commit 0399594195)
2025-04-12 02:02:43 +02:00
Vitaly Provodin
5546f829ff JBR-4437 add sources to JBRSDK distributions
(cherry picked from commit a13a015597)
2025-04-12 02:02:43 +02:00
Anton Tarasov
262556f679 JBR-3906 JBR for Linux aarch64 with JCEF is missing, is there any support plan?
(cherry picked from commit d47bc61b0e)
2025-04-12 02:02:43 +02:00
Vitaly Provodin
745e71daa8 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-04-12 02:02:42 +02:00
Vladimir Kempik
702548805c JBR-4283: Provide native JBR builds for alpine Linux-aarch64
(cherry picked from commit 925f02d3c5)
2025-04-12 02:02:42 +02:00
Vladimir Kempik
3250037231 JBR-4242:Provide native JBR builds for alpine Linux
(cherry picked from commit c62e05e7ac)
2025-04-12 02:02:42 +02:00
Maxim Kartashev
4d72a4f9ee JBR-3917 Problem using windows certificate store (trustStoreType=Windows-ROOT not recognized)
(cherry picked from commit 65abc7b029)
2025-04-12 02:02:42 +02:00
Maxim Kartashev
a448ee104e 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-04-12 02:02:42 +02:00
Vitaly Provodin
1c057c061b JBR-4154 extract version info from sources & JBR-4099 make test-image on jbrsdk_jcef step
(cherry picked from commit f22a76949b)
2025-04-12 02:02:42 +02:00
Vitaly Provodin
63a419e9dd JBR-4067 fix misprint with applying obsolete exclude_jcef_module.patch
(cherry picked from commit 106349f0fe)
2025-04-12 02:02:42 +02:00
Vitaly Provodin
db245d7d32 JBR-3756 remove JNF from mac-aarch64 binaries
(cherry picked from commit 011d461c99)
2025-04-12 02:02:42 +02:00
Vitaly Provodin
f9e637f310 JBR-4082 create JBR & JBRSDK installer packages
(cherry picked from commit a2e1fe0fa4)
2025-04-12 02:02:42 +02:00
Maxim Kartashev
124fdc5985 JBR-4061 Specify build user for the build
(cherry picked from commit 66713adb61)
2025-04-12 02:02:42 +02:00
Maxim Kartashev
ef24b891c8 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-04-12 02:02:42 +02:00
Maxim Kartashev
a1d28928c2 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-04-12 02:02:42 +02:00
Maxim Kartashev
b9c3bf18d5 JBR-4059 Create Dockerfile for building on AArch64 Linux
(cherry picked from commit 249614a30b)
2025-04-12 02:02:42 +02:00
Vitaly Provodin
5da73dc0ee JBR-3905 add incremental JBR building
(cherry picked from commit 54f28cde44)
2025-04-12 02:02:42 +02:00
Vitaly Provodin
3ad91ed055 JBR-3904 fix the image directory name of macos builds
(cherry picked from commit cf13b7c46e)
2025-04-12 02:02:42 +02:00
Vitaly Provodin
76426f32a3 configure BOOT_JDK to use JDK 17
(cherry picked from commit d815b82649)
2025-04-12 02:02:41 +02:00
Anton Tarasov
33376a1640 JBR-3655 jbr-dev build fails to find jcef modules on Windows
(cherry picked from commit f63fd1c8ec)
2025-04-12 02:02:41 +02:00
Maxim Kartashev
78316fc889 JBR-3645 Tool to support keeping JBR in sync with OpenJDK
(cherry picked from commit 21c43f48cf)
2025-04-12 02:02:41 +02:00
Vitaly Provodin
a1ceffd97b JBR-3639 add jbrsdk tarballs for dcevm, jcef builds
(cherry picked from commit 0117d49591)
2025-04-12 02:02:41 +02:00
Anton Tarasov
3207cb42f6 JBR-3627 include jmods in jbrsdk bundle for jbr-dev
(cherry picked from commit f54c836685)
2025-04-12 02:02:41 +02:00
Vitaly.Provodin
51c52449d9 add dockerfile for x86
(cherry picked from commit 8fb2341ea8)
(cherry picked from commit cfbafa6c73)
2025-04-12 02:02:41 +02:00
Vitaly Provodin
06d1d30db1 JBR-1505 add jdk.jcmd module into JBR
(cherry picked from commit c40b9c8b9e)
(cherry picked from commit 5362ff99a2)
2025-04-12 02:02:41 +02:00
Vitaly Provodin
d384c853d5 JBR-2957 notarize JBR and JBRSDK as APPL
(cherry picked from commit 0e7f9ce4ca)
(cherry picked from commit 3f4aee8c63)
2025-04-12 02:02:41 +02:00
Vitaly Provodin
5053306afb JBR-667 add shenandoahgc feature
(cherry picked from commit e15dad04)
(cherry picked from commit 0845bb7308)
2025-04-12 02:02:41 +02:00
Vitaly Provodin
03c2e71f38 configure BOOT_JDK to use JDK 16
(cherry picked from commit 3e34330003)
2025-04-12 02:02:41 +02:00
Anton Tarasov
93bac96b61 Add build.gradle
(cherry picked from commit 9d01f893b6)
2025-04-12 02:02:41 +02:00
Vitaly Provodin
0ce7fc17b2 JBR-3401 enable macos-aarhc64 builds
(cherry picked from commit d2c40f66f8)
2025-04-12 02:02:41 +02:00
Vitaly Provodin
8b10f287de JBR-3305 remove the option --disable-warnings-as-errors from configure
(cherry picked from commit 301fcb2df1)
2025-04-12 02:02:41 +02:00
Vitaly Provodin
5988097975 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-04-12 02:02:41 +02:00
Vitaly Provodin
69bb5ff326 JBR-2912 add JBR 15 builds with DCEVM
(cherry picked from commit 95416c501a)
2025-04-12 02:02:41 +02:00
Vitaly Provodin
fe8ddd637c JBR-2864 initial commit of DCEVM patches reworked for 15
(cherry picked from commit a592f63537)
2025-04-12 02:02:40 +02:00
Vitaly Provodin
7bb048727a JBR-2812 remove --with-import-modules from configure for aarch64
(cherry picked from commit 49fa98391a)
2025-04-12 02:02:40 +02:00
Anton Tarasov
5c94341097 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-04-12 02:02:40 +02:00
Vitaly Provodin
3056964c67 JBR-2787 fix copying jcef files into jbr/jbrsdk binaries
(cherry picked from commit a4269d0907)
2025-04-12 02:02:40 +02:00
Vitaly Provodin
f473f2da7c 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-04-12 02:02:40 +02:00
Anton Tarasov
4cf7814963 JBR-2016 add jcef module and export packages to it
(cherry picked from commit cf997f71c6)
(cherry picked from commit cad125e01d)
2025-04-12 02:02:40 +02:00
Vitaly Provodin
9529d88b43 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-04-12 02:02:40 +02:00
Vitaly Provodin
2d545c28f0 JBR-2395 eliminate JavaFX from JBR
(cherry picked from commit cd7e539561)
2025-04-12 02:02:40 +02:00
Vitaly Provodin
4ff38d7620 JBR-2409 fix prameters for configure
(cherry picked from commit f309357fba)
2025-04-12 02:02:40 +02:00
Vitaly Provodin
491dd1e934 JDK14: exclude dependencies on jcef in x86, fastdebug builds
(cherry picked from commit 14e98eaf94)
2025-04-12 02:02:40 +02:00
Vitaly Provodin
226b3d79b2 JBR-2396 fix CONF names
(cherry picked from commit 34cd854326)
2025-04-12 02:02:40 +02:00
Vitaly Provodin
fdede764f8 JBR-2394 replace --disable-debug-symbols with --with-native-debug-symbols=none
(cherry picked from commit 79ff0cb7b3)
2025-04-12 02:02:40 +02:00
Vitaly Provodin
022a084436 add exec permitions to configure
(cherry picked from commit bf2e441e09)
2025-04-12 02:02:40 +02:00
Vitaly Provodin
c0d603b13f split checkout before building JBR+JFX or JBR+JCEF on two separate commands
(cherry picked from commit b7030bae8e)
2025-04-12 02:02:40 +02:00
Vitaly Provodin
0b42dd188b change BOOT_JDK, fix target names
(cherry picked from commit 6a778fa6ea)
2025-04-12 02:02:40 +02:00
Vitaly Provodin
0bc1c86510 JBR-2291 add vendor info into bundles
(cherry picked from commit 026fcaaf2b)
2025-04-12 02:02:39 +02:00
Vitaly Provodin
245e69ec8f JBR-2324 address new layout in mac jcef 80.0.4+g74f7b0c+chromium-80.0.3987.122
(cherry picked from commit 6f45378ed9)
2025-04-12 02:02:39 +02:00
Vitaly Provodin
b861b35421 JBR-2320 add jdk.attach module into JBR
(cherry picked from commit a1884561bd)
2025-04-12 02:02:39 +02:00
Vitaly Provodin
a7b8a77bd8 JBR-2217 provide JCEF-only (no JavaFX) bundle for master/202 branches
(cherry picked from commit d5fef466f4)
2025-04-12 02:02:39 +02:00
Vitaly Provodin
db692ab766 JBR-2212 add scripts for linux_x86, linux_aarch64, linux_x64_fastdebug, osx_fastdebug, windows_x86
(cherry picked from commit 211b306949)
2025-04-12 02:02:39 +02:00
Vitaly Provodin
588d3b1291 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-04-12 02:02:39 +02:00
Vitaly Provodin
079892af8b JBR-2181 create two separate JBR bundles with JFX and JFX+JCEF
(cherry picked from commit a26a1dcef0)
2025-04-12 02:02:39 +02:00
Vitaly Provodin
e348db7910 JBR-2148 modify signapp&build scripts to match to the new layout
(cherry picked from commit 7cdd4cbf4a)
2025-04-12 02:02:39 +02:00
Vitaly Provodin
35e40306ab JBR-2084 modify scripts to sign Contents/MacOS/libjli.dylib as a a normal file
(cherry picked from commit 47ac942dfb)
2025-04-12 02:02:39 +02:00
Vitaly Provodin
d6acf24f51 JBR-1821 notarize JBR bundles as a standalone app
(cherry picked from commit 96e733ed79)
2025-04-12 02:02:39 +02:00
Vitaly Provodin
5ce1c942db JBR-2162 move building scripts from TC to JBR repo
(cherry picked from commit 6f4774c0d4)
2025-04-12 02:02:39 +02:00
Anton Tarasov
c7c4b82e83 JBR-2016 add jcef module and export some sun.* packages to it
(cherry picked from commit 193da0eff7)
2025-04-12 02:02:39 +02:00
Vitaly Provodin
d48ce22631 JBR-2014 add jdk.hotspot.agent module to jbr
(cherry picked from commit b352fa1b54)
2025-04-12 02:02:39 +02:00
Vitaly Provodin
5490389577 JBR-1286 add jdk.compiler into JBR
(cherry picked from commit 245db892cd)
2025-04-12 02:02:39 +02:00
Vitaly Provodin
70cf090383 JBR-1199 add JBR modules list for jlink
(cherry picked from commit ff8dc6567f)
2025-04-12 02:02:39 +02:00
Vitaly Provodin
3e38ca2c1f Update docker script to create jdk15 build env
(cherry picked from commit cd5b1b94e7)
2025-04-12 02:02:38 +02:00
Vitaly Provodin
75941152a5 JBR-3045 add pressing ESC to close the dialog after test completion
(cherry picked from commit 44d8b28b0b)
(cherry picked from commit c98106b4b0)
2025-04-12 02:02:38 +02:00
Vitaly Provodin
3198554980 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-04-12 02:02:38 +02:00
Vitaly.Provodin
3d0fc9a26f updated JTreg exclude list
(cherry picked from commit 6d1cee2181)
2025-04-12 02:02:38 +02:00
407 changed files with 173492 additions and 8839 deletions

View File

@@ -534,21 +534,22 @@ define SetupRunGtestTestBody
$$(eval $1_PASSED := $$(shell $$(AWK) '/\[ PASSED \] .* tests?./ \
{ print $$$$4 }' $$($1_RESULT_FILE))) \
$$(if $$($1_PASSED), , $$(eval $1_PASSED := 0)) \
$$(eval $1_GTEST_DISABLED := $$(shell $$(AWK) '/YOU HAVE .* DISABLED TEST/ \
{ print $$$$3 }' $$($1_RESULT_FILE))) \
$$(if $$($1_GTEST_DISABLED), , $$(eval $1_GTEST_DISABLED := 0)) \
$$(eval $1_GTEST_SKIPPED := $$(shell $$(AWK) '/\[ SKIPPED \] .* tests?.*/ \
{ print $$$$4 }' $$($1_RESULT_FILE))) \
$$(if $$($1_GTEST_SKIPPED), , $$(eval $1_GTEST_SKIPPED := 0)) \
$$(eval $1_SKIPPED := $$(shell \
$$(EXPR) $$($1_GTEST_DISABLED) + $$($1_GTEST_SKIPPED))) \
$$(eval $1_SKIPPED := $$(shell $$(AWK) \
'/YOU HAVE [0-9]+ DISABLED TEST/ { \
if (match($$$$0, /[0-9]+/, arr)) { \
print arr[0]; \
found=1; \
} \
} \
END { if (!found) print 0; }' \
$$($1_RESULT_FILE))) \
$$(eval $1_FAILED := $$(shell $$(AWK) '/\[ FAILED \] .* tests?, \
listed below/ { print $$$$4 }' $$($1_RESULT_FILE))) \
$$(if $$($1_FAILED), , $$(eval $1_FAILED := 0)) \
$$(eval $1_ERROR := $$(shell \
$$(EXPR) $$($1_RUN) - $$($1_PASSED) - $$($1_FAILED) - $$($1_GTEST_SKIPPED))) \
$$(EXPR) $$($1_RUN) - $$($1_PASSED) - $$($1_FAILED))) \
$$(eval $1_TOTAL := $$(shell \
$$(EXPR) $$($1_RUN) + $$($1_GTEST_DISABLED))) \
$$(EXPR) $$($1_RUN) + $$($1_SKIPPED))) \
, \
$$(eval $1_PASSED := 0) \
$$(eval $1_FAILED := 0) \

View File

@@ -468,15 +468,7 @@ AC_DEFUN_ONCE([BASIC_SETUP_PANDOC],
AC_MSG_CHECKING([if the pandoc smart extension needs to be disabled for markdown])
if $PANDOC --list-extensions | $GREP -q '+smart'; then
AC_MSG_RESULT([yes])
PANDOC_MARKDOWN_FLAG="$PANDOC_MARKDOWN_FLAG-smart"
else
AC_MSG_RESULT([no])
fi
AC_MSG_CHECKING([if the pandoc tex_math_dollars extension needs to be disabled for markdown])
if $PANDOC --list-extensions | $GREP -q '+tex_math_dollars'; then
AC_MSG_RESULT([yes])
PANDOC_MARKDOWN_FLAG="$PANDOC_MARKDOWN_FLAG-tex_math_dollars"
PANDOC_MARKDOWN_FLAG="markdown-smart"
else
AC_MSG_RESULT([no])
fi

View File

@@ -721,7 +721,7 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
$1_CFLAGS_CPU="-fsigned-char -Wno-psabi $ARM_ARCH_TYPE_FLAGS $ARM_FLOAT_TYPE_FLAGS -DJDK_ARCH_ABI_PROP_NAME='\"\$(JDK_ARCH_ABI_PROP_NAME)\"'"
$1_CFLAGS_CPU_JVM="-DARM"
elif test "x$FLAGS_CPU_ARCH" = xppc; then
$1_CFLAGS_CPU_JVM="-mno-multiple -mno-string"
$1_CFLAGS_CPU_JVM="-minsert-sched-nops=regroup_exact -mno-multiple -mno-string"
if test "x$FLAGS_CPU" = xppc64; then
# -mminimal-toc fixes `relocation truncated to fit' error for gcc 4.1.
# Use ppc64 instructions, but schedule for power5

View File

@@ -108,6 +108,13 @@ AC_DEFUN_ONCE([LIB_SETUP_VULKAN],
fi
fi
# Add platform-specific flags
if test "x$VULKAN_ENABLED" = xtrue; then
if test "x$NEEDS_LIB_WAYLAND" = xtrue; then
VULKAN_FLAGS="$VULKAN_FLAGS -DVK_USE_PLATFORM_WAYLAND_KHR"
fi
fi
AC_SUBST(VULKAN_ENABLED)
AC_SUBST(VULKAN_FLAGS)
AC_SUBST(VULKAN_SHADER_COMPILER)

View File

@@ -93,7 +93,7 @@ ifneq ($(call check-jvm-feature, jvmti), true)
jvmtiEnvThreadState.cpp jvmtiTagMap.cpp jvmtiEventController.cpp \
evmCompat.cpp jvmtiEnter.xsl jvmtiExport.cpp \
jvmtiClassFileReconstituter.cpp jvmtiTagMapTable.cpp jvmtiAgent.cpp \
jvmtiAgentList.cpp jfrJvmtiAgent.cpp
jvmtiAgentList.cpp jfrJvmtiAgent.cpp jvmtiEnhancedRedefineClasses.cpp
endif
ifneq ($(call check-jvm-feature, jvmci), true)

View File

@@ -1,32 +0,0 @@
#
# Copyright (c) 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.
#
################################################################################
# Instruct SetupJavaCompilation for the jdk.jlink module to include
# upgrade_files_<module-name>.conf files
COPY += .conf
################################################################################

View File

@@ -63,7 +63,7 @@ public class CodePointInputMethodDescriptor implements InputMethodDescriptor {
* Creates a new instance of the Code Point input method.
*
* @return a new instance of the Code Point input method
* @throws Exception any exception that may occur while creating the
* @exception Exception any exception that may occur while creating the
* input method instance
*/
public InputMethod createInputMethod() throws Exception {

View File

@@ -12918,6 +12918,380 @@ void Assembler::edecl(Register dst, Register src, bool no_flags) {
(void) evex_prefix_and_encode_ndd(0, dst->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags);
emit_int8(0x48 | src->encoding());
}
// 64bit doesn't use the x87
void Assembler::fabs() {
emit_int16((unsigned char)0xD9, (unsigned char)0xE1);
}
void Assembler::fadd(int i) {
emit_farith(0xD8, 0xC0, i);
}
void Assembler::fadd_d(Address src) {
InstructionMark im(this);
emit_int8((unsigned char)0xDC);
emit_operand32(rax, src, 0);
}
void Assembler::fadd_s(Address src) {
InstructionMark im(this);
emit_int8((unsigned char)0xD8);
emit_operand32(rax, src, 0);
}
void Assembler::fadda(int i) {
emit_farith(0xDC, 0xC0, i);
}
void Assembler::faddp(int i) {
emit_farith(0xDE, 0xC0, i);
}
void Assembler::fchs() {
emit_int16((unsigned char)0xD9, (unsigned char)0xE0);
}
void Assembler::fcom(int i) {
emit_farith(0xD8, 0xD0, i);
}
void Assembler::fcomp(int i) {
emit_farith(0xD8, 0xD8, i);
}
void Assembler::fcomp_d(Address src) {
InstructionMark im(this);
emit_int8((unsigned char)0xDC);
emit_operand32(rbx, src, 0);
}
void Assembler::fcomp_s(Address src) {
InstructionMark im(this);
emit_int8((unsigned char)0xD8);
emit_operand32(rbx, src, 0);
}
void Assembler::fcompp() {
emit_int16((unsigned char)0xDE, (unsigned char)0xD9);
}
void Assembler::fcos() {
emit_int16((unsigned char)0xD9, (unsigned char)0xFF);
}
void Assembler::fdecstp() {
emit_int16((unsigned char)0xD9, (unsigned char)0xF6);
}
void Assembler::fdiv(int i) {
emit_farith(0xD8, 0xF0, i);
}
void Assembler::fdiv_d(Address src) {
InstructionMark im(this);
emit_int8((unsigned char)0xDC);
emit_operand32(rsi, src, 0);
}
void Assembler::fdiv_s(Address src) {
InstructionMark im(this);
emit_int8((unsigned char)0xD8);
emit_operand32(rsi, src, 0);
}
void Assembler::fdiva(int i) {
emit_farith(0xDC, 0xF8, i);
}
// Note: The Intel manual (Pentium Processor User's Manual, Vol.3, 1994)
// is erroneous for some of the floating-point instructions below.
void Assembler::fdivp(int i) {
emit_farith(0xDE, 0xF8, i); // ST(0) <- ST(0) / ST(1) and pop (Intel manual wrong)
}
void Assembler::fdivr(int i) {
emit_farith(0xD8, 0xF8, i);
}
void Assembler::fdivr_d(Address src) {
InstructionMark im(this);
emit_int8((unsigned char)0xDC);
emit_operand32(rdi, src, 0);
}
void Assembler::fdivr_s(Address src) {
InstructionMark im(this);
emit_int8((unsigned char)0xD8);
emit_operand32(rdi, src, 0);
}
void Assembler::fdivra(int i) {
emit_farith(0xDC, 0xF0, i);
}
void Assembler::fdivrp(int i) {
emit_farith(0xDE, 0xF0, i); // ST(0) <- ST(1) / ST(0) and pop (Intel manual wrong)
}
void Assembler::ffree(int i) {
emit_farith(0xDD, 0xC0, i);
}
void Assembler::fild_d(Address adr) {
InstructionMark im(this);
emit_int8((unsigned char)0xDF);
emit_operand32(rbp, adr, 0);
}
void Assembler::fild_s(Address adr) {
InstructionMark im(this);
emit_int8((unsigned char)0xDB);
emit_operand32(rax, adr, 0);
}
void Assembler::fincstp() {
emit_int16((unsigned char)0xD9, (unsigned char)0xF7);
}
void Assembler::finit() {
emit_int24((unsigned char)0x9B, (unsigned char)0xDB, (unsigned char)0xE3);
}
void Assembler::fist_s(Address adr) {
InstructionMark im(this);
emit_int8((unsigned char)0xDB);
emit_operand32(rdx, adr, 0);
}
void Assembler::fistp_d(Address adr) {
InstructionMark im(this);
emit_int8((unsigned char)0xDF);
emit_operand32(rdi, adr, 0);
}
void Assembler::fistp_s(Address adr) {
InstructionMark im(this);
emit_int8((unsigned char)0xDB);
emit_operand32(rbx, adr, 0);
}
void Assembler::fld1() {
emit_int16((unsigned char)0xD9, (unsigned char)0xE8);
}
void Assembler::fld_s(Address adr) {
InstructionMark im(this);
emit_int8((unsigned char)0xD9);
emit_operand32(rax, adr, 0);
}
void Assembler::fld_s(int index) {
emit_farith(0xD9, 0xC0, index);
}
void Assembler::fldcw(Address src) {
InstructionMark im(this);
emit_int8((unsigned char)0xD9);
emit_operand32(rbp, src, 0);
}
void Assembler::fldenv(Address src) {
InstructionMark im(this);
emit_int8((unsigned char)0xD9);
emit_operand32(rsp, src, 0);
}
void Assembler::fldlg2() {
emit_int16((unsigned char)0xD9, (unsigned char)0xEC);
}
void Assembler::fldln2() {
emit_int16((unsigned char)0xD9, (unsigned char)0xED);
}
void Assembler::fldz() {
emit_int16((unsigned char)0xD9, (unsigned char)0xEE);
}
void Assembler::flog() {
fldln2();
fxch();
fyl2x();
}
void Assembler::flog10() {
fldlg2();
fxch();
fyl2x();
}
void Assembler::fmul(int i) {
emit_farith(0xD8, 0xC8, i);
}
void Assembler::fmul_d(Address src) {
InstructionMark im(this);
emit_int8((unsigned char)0xDC);
emit_operand32(rcx, src, 0);
}
void Assembler::fmul_s(Address src) {
InstructionMark im(this);
emit_int8((unsigned char)0xD8);
emit_operand32(rcx, src, 0);
}
void Assembler::fmula(int i) {
emit_farith(0xDC, 0xC8, i);
}
void Assembler::fmulp(int i) {
emit_farith(0xDE, 0xC8, i);
}
void Assembler::fnsave(Address dst) {
InstructionMark im(this);
emit_int8((unsigned char)0xDD);
emit_operand32(rsi, dst, 0);
}
void Assembler::fnstcw(Address src) {
InstructionMark im(this);
emit_int16((unsigned char)0x9B, (unsigned char)0xD9);
emit_operand32(rdi, src, 0);
}
void Assembler::fprem1() {
emit_int16((unsigned char)0xD9, (unsigned char)0xF5);
}
void Assembler::frstor(Address src) {
InstructionMark im(this);
emit_int8((unsigned char)0xDD);
emit_operand32(rsp, src, 0);
}
void Assembler::fsin() {
emit_int16((unsigned char)0xD9, (unsigned char)0xFE);
}
void Assembler::fsqrt() {
emit_int16((unsigned char)0xD9, (unsigned char)0xFA);
}
void Assembler::fst_d(Address adr) {
InstructionMark im(this);
emit_int8((unsigned char)0xDD);
emit_operand32(rdx, adr, 0);
}
void Assembler::fst_s(Address adr) {
InstructionMark im(this);
emit_int8((unsigned char)0xD9);
emit_operand32(rdx, adr, 0);
}
void Assembler::fstp_s(Address adr) {
InstructionMark im(this);
emit_int8((unsigned char)0xD9);
emit_operand32(rbx, adr, 0);
}
void Assembler::fsub(int i) {
emit_farith(0xD8, 0xE0, i);
}
void Assembler::fsub_d(Address src) {
InstructionMark im(this);
emit_int8((unsigned char)0xDC);
emit_operand32(rsp, src, 0);
}
void Assembler::fsub_s(Address src) {
InstructionMark im(this);
emit_int8((unsigned char)0xD8);
emit_operand32(rsp, src, 0);
}
void Assembler::fsuba(int i) {
emit_farith(0xDC, 0xE8, i);
}
void Assembler::fsubp(int i) {
emit_farith(0xDE, 0xE8, i); // ST(0) <- ST(0) - ST(1) and pop (Intel manual wrong)
}
void Assembler::fsubr(int i) {
emit_farith(0xD8, 0xE8, i);
}
void Assembler::fsubr_d(Address src) {
InstructionMark im(this);
emit_int8((unsigned char)0xDC);
emit_operand32(rbp, src, 0);
}
void Assembler::fsubr_s(Address src) {
InstructionMark im(this);
emit_int8((unsigned char)0xD8);
emit_operand32(rbp, src, 0);
}
void Assembler::fsubra(int i) {
emit_farith(0xDC, 0xE0, i);
}
void Assembler::fsubrp(int i) {
emit_farith(0xDE, 0xE0, i); // ST(0) <- ST(1) - ST(0) and pop (Intel manual wrong)
}
void Assembler::ftan() {
emit_int32((unsigned char)0xD9, (unsigned char)0xF2, (unsigned char)0xDD, (unsigned char)0xD8);
}
void Assembler::ftst() {
emit_int16((unsigned char)0xD9, (unsigned char)0xE4);
}
void Assembler::fucomi(int i) {
// make sure the instruction is supported (introduced for P6, together with cmov)
guarantee(VM_Version::supports_cmov(), "illegal instruction");
emit_farith(0xDB, 0xE8, i);
}
void Assembler::fucomip(int i) {
// make sure the instruction is supported (introduced for P6, together with cmov)
guarantee(VM_Version::supports_cmov(), "illegal instruction");
emit_farith(0xDF, 0xE8, i);
}
void Assembler::fwait() {
emit_int8((unsigned char)0x9B);
}
void Assembler::fxch(int i) {
emit_farith(0xD9, 0xC8, i);
}
void Assembler::fyl2x() {
emit_int16((unsigned char)0xD9, (unsigned char)0xF1);
}
void Assembler::frndint() {
emit_int16((unsigned char)0xD9, (unsigned char)0xFC);
}
void Assembler::f2xm1() {
emit_int16((unsigned char)0xD9, (unsigned char)0xF0);
}
void Assembler::fldl2e() {
emit_int16((unsigned char)0xD9, (unsigned char)0xEA);
}
#endif // !_LP64
// SSE SIMD prefix byte values corresponding to VexSimdPrefix encoding.

View File

@@ -1397,6 +1397,135 @@ private:
public:
#ifndef _LP64
void emms();
void fabs();
void fadd(int i);
void fadd_d(Address src);
void fadd_s(Address src);
// "Alternate" versions of x87 instructions place result down in FPU
// stack instead of on TOS
void fadda(int i); // "alternate" fadd
void faddp(int i = 1);
void fchs();
void fcom(int i);
void fcomp(int i = 1);
void fcomp_d(Address src);
void fcomp_s(Address src);
void fcompp();
void fcos();
void fdecstp();
void fdiv(int i);
void fdiv_d(Address src);
void fdivr_s(Address src);
void fdiva(int i); // "alternate" fdiv
void fdivp(int i = 1);
void fdivr(int i);
void fdivr_d(Address src);
void fdiv_s(Address src);
void fdivra(int i); // "alternate" reversed fdiv
void fdivrp(int i = 1);
void ffree(int i = 0);
void fild_d(Address adr);
void fild_s(Address adr);
void fincstp();
void finit();
void fist_s (Address adr);
void fistp_d(Address adr);
void fistp_s(Address adr);
void fld1();
void fld_s(Address adr);
void fld_s(int index);
void fldcw(Address src);
void fldenv(Address src);
void fldlg2();
void fldln2();
void fldz();
void flog();
void flog10();
void fmul(int i);
void fmul_d(Address src);
void fmul_s(Address src);
void fmula(int i); // "alternate" fmul
void fmulp(int i = 1);
void fnsave(Address dst);
void fnstcw(Address src);
void fprem1();
void frstor(Address src);
void fsin();
void fsqrt();
void fst_d(Address adr);
void fst_s(Address adr);
void fstp_s(Address adr);
void fsub(int i);
void fsub_d(Address src);
void fsub_s(Address src);
void fsuba(int i); // "alternate" fsub
void fsubp(int i = 1);
void fsubr(int i);
void fsubr_d(Address src);
void fsubr_s(Address src);
void fsubra(int i); // "alternate" reversed fsub
void fsubrp(int i = 1);
void ftan();
void ftst();
void fucomi(int i = 1);
void fucomip(int i = 1);
void fwait();
void fxch(int i = 1);
void fyl2x();
void frndint();
void f2xm1();
void fldl2e();
#endif // !_LP64
// operands that only take the original 32bit registers

View File

@@ -324,11 +324,11 @@ void C1_MacroAssembler::remove_frame(int frame_size_in_bytes) {
void C1_MacroAssembler::verified_entry(bool breakAtEntry) {
if (breakAtEntry) {
if (breakAtEntry || VerifyFPU) {
// Verified Entry first instruction should be 5 bytes long for correct
// patching by patch_verified_entry().
//
// Breakpoint has one byte first instruction.
// Breakpoint and VerifyFPU have one byte first instruction.
// Also first instruction will be one byte "push(rbp)" if stack banging
// code is not generated (see build_frame() above).
// For all these cases generate long instruction first.
@@ -336,6 +336,7 @@ void C1_MacroAssembler::verified_entry(bool breakAtEntry) {
}
if (breakAtEntry) int3();
// build frame
IA32_ONLY( verify_FPU(0, "method_entry"); )
}
void C1_MacroAssembler::load_parameter(int offset_in_words, Register reg) {

View File

@@ -261,12 +261,15 @@ template<typename FKind> frame ThawBase::new_stack_frame(const frame& hf, frame&
}
inline intptr_t* ThawBase::align(const frame& hf, intptr_t* frame_sp, frame& caller, bool bottom) {
#ifdef _LP64
if (((intptr_t)frame_sp & 0xf) != 0) {
assert(caller.is_interpreted_frame() || (bottom && hf.compiled_frame_stack_argsize() % 2 != 0), "");
frame_sp--;
caller.set_sp(caller.sp() - 1);
}
assert(is_aligned(frame_sp, frame::frame_alignment), "");
#endif
return frame_sp;
}

View File

@@ -55,11 +55,18 @@ static inline void patch_return_pc_with_preempt_stub(frame& f) {
}
inline int ContinuationHelper::frame_align_words(int size) {
#ifdef _LP64
return size & 1;
#else
return 0;
#endif
}
inline intptr_t* ContinuationHelper::frame_align_pointer(intptr_t* sp) {
return align_down(sp, frame::frame_alignment);
#ifdef _LP64
sp = align_down(sp, frame::frame_alignment);
#endif
return sp;
}
template<typename FKind>

View File

@@ -143,6 +143,26 @@ void MacroAssembler::extend_sign(Register hi, Register lo) {
}
}
void MacroAssembler::jC2(Register tmp, Label& L) {
// set parity bit if FPU flag C2 is set (via rax)
save_rax(tmp);
fwait(); fnstsw_ax();
sahf();
restore_rax(tmp);
// branch
jcc(Assembler::parity, L);
}
void MacroAssembler::jnC2(Register tmp, Label& L) {
// set parity bit if FPU flag C2 is set (via rax)
save_rax(tmp);
fwait(); fnstsw_ax();
sahf();
restore_rax(tmp);
// branch
jcc(Assembler::noParity, L);
}
// 32bit can do a case table jump in one instruction but we no longer allow the base
// to be installed in the Address class
void MacroAssembler::jump(ArrayAddress entry, Register rscratch) {
@@ -2034,6 +2054,115 @@ void MacroAssembler::fat_nop() {
}
}
#ifndef _LP64
void MacroAssembler::fcmp(Register tmp) {
fcmp(tmp, 1, true, true);
}
void MacroAssembler::fcmp(Register tmp, int index, bool pop_left, bool pop_right) {
assert(!pop_right || pop_left, "usage error");
if (VM_Version::supports_cmov()) {
assert(tmp == noreg, "unneeded temp");
if (pop_left) {
fucomip(index);
} else {
fucomi(index);
}
if (pop_right) {
fpop();
}
} else {
assert(tmp != noreg, "need temp");
if (pop_left) {
if (pop_right) {
fcompp();
} else {
fcomp(index);
}
} else {
fcom(index);
}
// convert FPU condition into eflags condition via rax,
save_rax(tmp);
fwait(); fnstsw_ax();
sahf();
restore_rax(tmp);
}
// condition codes set as follows:
//
// CF (corresponds to C0) if x < y
// PF (corresponds to C2) if unordered
// ZF (corresponds to C3) if x = y
}
void MacroAssembler::fcmp2int(Register dst, bool unordered_is_less) {
fcmp2int(dst, unordered_is_less, 1, true, true);
}
void MacroAssembler::fcmp2int(Register dst, bool unordered_is_less, int index, bool pop_left, bool pop_right) {
fcmp(VM_Version::supports_cmov() ? noreg : dst, index, pop_left, pop_right);
Label L;
if (unordered_is_less) {
movl(dst, -1);
jcc(Assembler::parity, L);
jcc(Assembler::below , L);
movl(dst, 0);
jcc(Assembler::equal , L);
increment(dst);
} else { // unordered is greater
movl(dst, 1);
jcc(Assembler::parity, L);
jcc(Assembler::above , L);
movl(dst, 0);
jcc(Assembler::equal , L);
decrementl(dst);
}
bind(L);
}
void MacroAssembler::fld_d(AddressLiteral src) {
fld_d(as_Address(src));
}
void MacroAssembler::fld_s(AddressLiteral src) {
fld_s(as_Address(src));
}
void MacroAssembler::fldcw(AddressLiteral src) {
fldcw(as_Address(src));
}
void MacroAssembler::fpop() {
ffree();
fincstp();
}
void MacroAssembler::fremr(Register tmp) {
save_rax(tmp);
{ Label L;
bind(L);
fprem();
fwait(); fnstsw_ax();
sahf();
jcc(Assembler::parity, L);
}
restore_rax(tmp);
// Result is in ST0.
// Note: fxch & fpop to get rid of ST1
// (otherwise FPU stack could overflow eventually)
fxch(1);
fpop();
}
void MacroAssembler::empty_FPU_stack() {
if (VM_Version::supports_mmx()) {
emms();
} else {
for (int i = 8; i-- > 0; ) ffree(i);
}
}
#endif // !LP64
void MacroAssembler::mulpd(XMMRegister dst, AddressLiteral src, Register rscratch) {
assert(rscratch != noreg || always_reachable(src), "missing");
if (reachable(src)) {
@@ -2860,39 +2989,91 @@ void MacroAssembler::push_IU_state() {
void MacroAssembler::push_cont_fastpath() {
if (!Continuations::enabled()) return;
Label L_done;
cmpptr(rsp, Address(r15_thread, JavaThread::cont_fastpath_offset()));
jccb(Assembler::belowEqual, L_done);
movptr(Address(r15_thread, JavaThread::cont_fastpath_offset()), rsp);
bind(L_done);
#ifndef _LP64
Register rthread = rax;
Register rrealsp = rbx;
push(rthread);
push(rrealsp);
get_thread(rthread);
// The code below wants the original RSP.
// Move it back after the pushes above.
movptr(rrealsp, rsp);
addptr(rrealsp, 2*wordSize);
#else
Register rthread = r15_thread;
Register rrealsp = rsp;
#endif
Label done;
cmpptr(rrealsp, Address(rthread, JavaThread::cont_fastpath_offset()));
jccb(Assembler::belowEqual, done);
movptr(Address(rthread, JavaThread::cont_fastpath_offset()), rrealsp);
bind(done);
#ifndef _LP64
pop(rrealsp);
pop(rthread);
#endif
}
void MacroAssembler::pop_cont_fastpath() {
if (!Continuations::enabled()) return;
Label L_done;
cmpptr(rsp, Address(r15_thread, JavaThread::cont_fastpath_offset()));
jccb(Assembler::below, L_done);
movptr(Address(r15_thread, JavaThread::cont_fastpath_offset()), 0);
bind(L_done);
#ifndef _LP64
Register rthread = rax;
Register rrealsp = rbx;
push(rthread);
push(rrealsp);
get_thread(rthread);
// The code below wants the original RSP.
// Move it back after the pushes above.
movptr(rrealsp, rsp);
addptr(rrealsp, 2*wordSize);
#else
Register rthread = r15_thread;
Register rrealsp = rsp;
#endif
Label done;
cmpptr(rrealsp, Address(rthread, JavaThread::cont_fastpath_offset()));
jccb(Assembler::below, done);
movptr(Address(rthread, JavaThread::cont_fastpath_offset()), 0);
bind(done);
#ifndef _LP64
pop(rrealsp);
pop(rthread);
#endif
}
void MacroAssembler::inc_held_monitor_count() {
#ifdef _LP64
incrementq(Address(r15_thread, JavaThread::held_monitor_count_offset()));
#endif
}
void MacroAssembler::dec_held_monitor_count() {
#ifdef _LP64
decrementq(Address(r15_thread, JavaThread::held_monitor_count_offset()));
#endif
}
#ifdef ASSERT
void MacroAssembler::stop_if_in_cont(Register cont, const char* name) {
#ifdef _LP64
Label no_cont;
movptr(cont, Address(r15_thread, JavaThread::cont_entry_offset()));
testl(cont, cont);
jcc(Assembler::zero, no_cont);
stop(name);
bind(no_cont);
#else
Unimplemented();
#endif
}
#endif
@@ -2909,11 +3090,21 @@ void MacroAssembler::reset_last_Java_frame(bool clear_fp) { // determine java_th
vzeroupper();
}
void MacroAssembler::restore_rax(Register tmp) {
if (tmp == noreg) pop(rax);
else if (tmp != rax) mov(rax, tmp);
}
void MacroAssembler::round_to(Register reg, int modulus) {
addptr(reg, modulus - 1);
andptr(reg, -modulus);
}
void MacroAssembler::save_rax(Register tmp) {
if (tmp == noreg) push(rax);
else if (tmp != rax) mov(tmp, rax);
}
void MacroAssembler::safepoint_poll(Label& slow_path, bool at_return, bool in_nmethod) {
if (at_return) {
// Note that when in_nmethod is set, the stack pointer is incremented before the poll. Therefore,
@@ -5597,6 +5788,85 @@ void MacroAssembler::print_CPU_state() {
pop_CPU_state();
}
#ifndef _LP64
static bool _verify_FPU(int stack_depth, char* s, CPU_State* state) {
static int counter = 0;
FPU_State* fs = &state->_fpu_state;
counter++;
// For leaf calls, only verify that the top few elements remain empty.
// We only need 1 empty at the top for C2 code.
if( stack_depth < 0 ) {
if( fs->tag_for_st(7) != 3 ) {
printf("FPR7 not empty\n");
state->print();
assert(false, "error");
return false;
}
return true; // All other stack states do not matter
}
assert((fs->_control_word._value & 0xffff) == StubRoutines::x86::fpu_cntrl_wrd_std(),
"bad FPU control word");
// compute stack depth
int i = 0;
while (i < FPU_State::number_of_registers && fs->tag_for_st(i) < 3) i++;
int d = i;
while (i < FPU_State::number_of_registers && fs->tag_for_st(i) == 3) i++;
// verify findings
if (i != FPU_State::number_of_registers) {
// stack not contiguous
printf("%s: stack not contiguous at ST%d\n", s, i);
state->print();
assert(false, "error");
return false;
}
// check if computed stack depth corresponds to expected stack depth
if (stack_depth < 0) {
// expected stack depth is -stack_depth or less
if (d > -stack_depth) {
// too many elements on the stack
printf("%s: <= %d stack elements expected but found %d\n", s, -stack_depth, d);
state->print();
assert(false, "error");
return false;
}
} else {
// expected stack depth is stack_depth
if (d != stack_depth) {
// wrong stack depth
printf("%s: %d stack elements expected but found %d\n", s, stack_depth, d);
state->print();
assert(false, "error");
return false;
}
}
// everything is cool
return true;
}
void MacroAssembler::verify_FPU(int stack_depth, const char* s) {
if (!VerifyFPU) return;
push_CPU_state();
push(rsp); // pass CPU state
ExternalAddress msg((address) s);
// pass message string s
pushptr(msg.addr(), noreg);
push(stack_depth); // pass stack depth
call(RuntimeAddress(CAST_FROM_FN_PTR(address, _verify_FPU)));
addptr(rsp, 3 * wordSize); // discard arguments
// check for error
{ Label L;
testl(rax, rax);
jcc(Assembler::notZero, L);
int3(); // break if error condition
bind(L);
}
pop_CPU_state();
}
#endif // _LP64
void MacroAssembler::restore_cpu_control_state_after_jni(Register rscratch) {
// Either restore the MXCSR register after returning from the JNI Call
// or verify that it wasn't changed (with -Xcheck:jni flag).
@@ -5609,6 +5879,14 @@ void MacroAssembler::restore_cpu_control_state_after_jni(Register rscratch) {
}
// Clear upper bits of YMM registers to avoid SSE <-> AVX transition penalty.
vzeroupper();
#ifndef _LP64
// Either restore the x87 floating pointer control word after returning
// from the JNI call or verify that it wasn't changed.
if (CheckJNICalls) {
call(RuntimeAddress(StubRoutines::x86::verify_fpu_cntrl_wrd_entry()));
}
#endif // _LP64
}
// ((OopHandle)result).resolve();

View File

@@ -71,6 +71,11 @@ class MacroAssembler: public Assembler {
void call_VM_helper(Register oop_result, address entry_point, int number_of_arguments, bool check_exceptions = true);
// helpers for FPU flag access
// tmp is a temporary register, if none is available use noreg
void save_rax (Register tmp);
void restore_rax(Register tmp);
public:
MacroAssembler(CodeBuffer* code) : Assembler(code) {}
@@ -455,6 +460,39 @@ class MacroAssembler: public Assembler {
// Division by power of 2, rounding towards 0
void division_with_shift(Register reg, int shift_value);
#ifndef _LP64
// Compares the top-most stack entries on the FPU stack and sets the eflags as follows:
//
// CF (corresponds to C0) if x < y
// PF (corresponds to C2) if unordered
// ZF (corresponds to C3) if x = y
//
// The arguments are in reversed order on the stack (i.e., top of stack is first argument).
// tmp is a temporary register, if none is available use noreg (only matters for non-P6 code)
void fcmp(Register tmp);
// Variant of the above which allows y to be further down the stack
// and which only pops x and y if specified. If pop_right is
// specified then pop_left must also be specified.
void fcmp(Register tmp, int index, bool pop_left, bool pop_right);
// Floating-point comparison for Java
// Compares the top-most stack entries on the FPU stack and stores the result in dst.
// The arguments are in reversed order on the stack (i.e., top of stack is first argument).
// (semantics as described in JVM spec.)
void fcmp2int(Register dst, bool unordered_is_less);
// Variant of the above which allows y to be further down the stack
// and which only pops x and y if specified. If pop_right is
// specified then pop_left must also be specified.
void fcmp2int(Register dst, bool unordered_is_less, int index, bool pop_left, bool pop_right);
// Floating-point remainder for Java (ST0 = ST0 fremr ST1, ST1 is empty afterwards)
// tmp is a temporary register, if none is available use noreg
void fremr(Register tmp);
// only if +VerifyFPU
void verify_FPU(int stack_depth, const char* s = "illegal FPU state");
#endif // !LP64
// dst = c = a * b + c
void fmad(XMMRegister dst, XMMRegister a, XMMRegister b, XMMRegister c);
void fmaf(XMMRegister dst, XMMRegister a, XMMRegister b, XMMRegister c);
@@ -469,6 +507,18 @@ class MacroAssembler: public Assembler {
void cmpss2int(XMMRegister opr1, XMMRegister opr2, Register dst, bool unordered_is_less);
void cmpsd2int(XMMRegister opr1, XMMRegister opr2, Register dst, bool unordered_is_less);
// branch to L if FPU flag C2 is set/not set
// tmp is a temporary register, if none is available use noreg
void jC2 (Register tmp, Label& L);
void jnC2(Register tmp, Label& L);
#ifndef _LP64
// Pop ST (ffree & fincstp combined)
void fpop();
void empty_FPU_stack();
#endif // !_LP64
void push_IU_state();
void pop_IU_state();
@@ -1029,6 +1079,27 @@ public:
void comisd(XMMRegister dst, Address src) { Assembler::comisd(dst, src); }
void comisd(XMMRegister dst, AddressLiteral src, Register rscratch = noreg);
#ifndef _LP64
void fadd_s(Address src) { Assembler::fadd_s(src); }
void fadd_s(AddressLiteral src) { Assembler::fadd_s(as_Address(src)); }
void fldcw(Address src) { Assembler::fldcw(src); }
void fldcw(AddressLiteral src);
void fld_s(int index) { Assembler::fld_s(index); }
void fld_s(Address src) { Assembler::fld_s(src); }
void fld_s(AddressLiteral src);
void fld_d(Address src) { Assembler::fld_d(src); }
void fld_d(AddressLiteral src);
void fld_x(Address src) { Assembler::fld_x(src); }
void fld_x(AddressLiteral src) { Assembler::fld_x(as_Address(src)); }
void fmul_s(Address src) { Assembler::fmul_s(src); }
void fmul_s(AddressLiteral src) { Assembler::fmul_s(as_Address(src)); }
#endif // !_LP64
void cmp32_mxcsr_std(Address mxcsr_save, Register tmp, Register rscratch = noreg);
void ldmxcsr(Address src) { Assembler::ldmxcsr(src); }
void ldmxcsr(AddressLiteral src, Register rscratch = noreg);

View File

@@ -82,8 +82,8 @@ void MethodHandles::verify_klass(MacroAssembler* _masm,
__ verify_oop(obj);
__ testptr(obj, obj);
__ jcc(Assembler::zero, L_bad);
#define PUSH { __ push(temp); __ push(rscratch1); }
#define POP { __ pop(rscratch1); __ pop(temp); }
#define PUSH { __ push(temp); LP64_ONLY( __ push(rscratch1); ) }
#define POP { LP64_ONLY( __ pop(rscratch1); ) __ pop(temp); }
PUSH;
__ load_klass(temp, obj, rscratch1);
__ cmpptr(temp, ExternalAddress((address) klass_addr), rscratch1);
@@ -139,9 +139,15 @@ void MethodHandles::jump_from_method_handle(MacroAssembler* _masm, Register meth
// JVMTI events, such as single-stepping, are implemented partly by avoiding running
// compiled code in threads for which the event is enabled. Check here for
// interp_only_mode if these events CAN be enabled.
#ifdef _LP64
Register rthread = r15_thread;
#else
Register rthread = temp;
__ get_thread(rthread);
#endif
// interp_only is an int, on little endian it is sufficient to test the byte only
// Is a cmpl faster?
__ cmpb(Address(r15_thread, JavaThread::interp_only_mode_offset()), 0);
__ cmpb(Address(rthread, JavaThread::interp_only_mode_offset()), 0);
__ jccb(Assembler::zero, run_compiled_code);
__ jmp(Address(method, Method::interpreter_entry_offset()));
__ BIND(run_compiled_code);
@@ -318,6 +324,7 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm,
assert(is_signature_polymorphic(iid), "expected invoke iid");
Register rbx_method = rbx; // eventual target of this invocation
// temps used in this code are not used in *either* compiled or interpreted calling sequences
#ifdef _LP64
Register temp1 = rscratch1;
Register temp2 = rscratch2;
Register temp3 = rax;
@@ -326,7 +333,19 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm,
assert_different_registers(temp1, j_rarg0, j_rarg1, j_rarg2, j_rarg3, j_rarg4, j_rarg5);
assert_different_registers(temp2, j_rarg0, j_rarg1, j_rarg2, j_rarg3, j_rarg4, j_rarg5);
assert_different_registers(temp3, j_rarg0, j_rarg1, j_rarg2, j_rarg3, j_rarg4, j_rarg5);
} else {
}
#else
Register temp1 = (for_compiler_entry ? rsi : rdx);
Register temp2 = rdi;
Register temp3 = rax;
if (for_compiler_entry) {
assert(receiver_reg == (iid == vmIntrinsics::_linkToStatic || iid == vmIntrinsics::_linkToNative ? noreg : rcx), "only valid assignment");
assert_different_registers(temp1, rcx, rdx);
assert_different_registers(temp2, rcx, rdx);
assert_different_registers(temp3, rcx, rdx);
}
#endif
else {
assert_different_registers(temp1, temp2, temp3, saved_last_sp_register()); // don't trash lastSP
}
assert_different_registers(temp1, temp2, temp3, receiver_reg);

View File

@@ -60,5 +60,5 @@ public:
static Register saved_last_sp_register() {
// Should be in sharedRuntime, not here.
return r13;
return LP64_ONLY(r13) NOT_LP64(rsi);
}

View File

@@ -73,14 +73,21 @@ void SharedRuntime::inline_check_hashcode_from_object_header(MacroAssembler* mas
}
// get hash
#ifdef _LP64
// Read the header and build a mask to get its hash field.
// Depend on hash_mask being at most 32 bits and avoid the use of hash_mask_in_place
// because it could be larger than 32 bits in a 64-bit vm. See markWord.hpp.
__ shrptr(result, markWord::hash_shift);
__ andptr(result, markWord::hash_mask);
#else
__ andptr(result, markWord::hash_mask_in_place);
#endif //_LP64
// test if hashCode exists
__ jccb(Assembler::zero, slowCase);
__ jcc(Assembler::zero, slowCase);
#ifndef _LP64
__ shrptr(result, markWord::hash_shift);
#endif
__ ret(0);
__ bind(slowCase);
}

View File

@@ -34,43 +34,58 @@
do_stub(initial, verify_mxcsr) \
do_arch_entry(x86, initial, verify_mxcsr, verify_mxcsr_entry, \
verify_mxcsr_entry) \
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) \
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, 3000) \
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, 109000 WINDOWS_ONLY(+2000)) \
do_arch_blob(compiler, 20000 LP64_ONLY(+89000) 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) \
@@ -158,88 +173,90 @@
do_arch_entry(x86, compiler, pshuffle_byte_flip_mask, \
pshuffle_byte_flip_mask_addr, \
pshuffle_byte_flip_mask_addr) \
/* x86_64 exposes these 3 stubs via a generic entry array */ \
/* other 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) \
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, 31000 \
WINDOWS_ONLY(+22000) ZGC_ONLY(+20000)) \
do_arch_blob(final, 11000 LP64_ONLY(+20000) \
WINDOWS_ONLY(+22000) ZGC_ONLY(+20000)) \
#endif // CPU_X86_STUBDECLARATIONS_HPP

View File

@@ -46,8 +46,10 @@ STUBGEN_ARCH_ENTRIES_DO(DEFINE_ARCH_ENTRY, DEFINE_ARCH_ENTRY_INIT)
#undef DEFINE_ARCH_ENTRY
address StubRoutines::x86::_k256_adr = nullptr;
#ifdef _LP64
address StubRoutines::x86::_k256_W_adr = nullptr;
address StubRoutines::x86::_k512_W_addr = nullptr;
#endif
const uint64_t StubRoutines::x86::_crc_by128_masks[] =
{
@@ -144,6 +146,7 @@ const juint StubRoutines::x86::_crc_table[] =
0x2d02ef8dUL
};
#ifdef _LP64
const juint StubRoutines::x86::_crc_table_avx512[] =
{
0xe95c1271UL, 0x00000000UL, 0xce3371cbUL, 0x00000000UL,
@@ -190,6 +193,7 @@ const juint StubRoutines::x86::_shuf_table_crc32_avx512[] =
0x83828100UL, 0x87868584UL, 0x8b8a8988UL, 0x8f8e8d8cUL,
0x03020100UL, 0x07060504UL, 0x0b0a0908UL, 0x000e0d0cUL
};
#endif // _LP64
const jint StubRoutines::x86::_arrays_hashcode_powers_of_31[] =
{
@@ -352,6 +356,7 @@ ATTRIBUTE_ALIGNED(64) const juint StubRoutines::x86::_k256[] =
0x90befffaUL, 0xa4506cebUL, 0xbef9a3f7UL, 0xc67178f2UL
};
#ifdef _LP64
// used in MacroAssembler::sha256_AVX2
// dynamically built from _k256
ATTRIBUTE_ALIGNED(64) juint StubRoutines::x86::_k256_W[2*sizeof(StubRoutines::x86::_k256)];
@@ -400,3 +405,4 @@ ATTRIBUTE_ALIGNED(64) const julong StubRoutines::x86::_k512_W[] =
0x4cc5d4becb3e42b6ULL, 0x597f299cfc657e2aULL,
0x5fcb6fab3ad6faecULL, 0x6c44198c4a475817ULL,
};
#endif

View File

@@ -75,16 +75,39 @@ public:
#undef DEFINE_ARCH_ENTRY_GETTER_INIT
#undef DEFINE_ARCH_GETTER_ENTRY
#ifndef _LP64
static jint _fpu_cntrl_wrd_std;
static jint _fpu_cntrl_wrd_24;
static jint _fpu_cntrl_wrd_trunc;
static jint _fpu_subnormal_bias1[3];
static jint _fpu_subnormal_bias2[3];
static address addr_fpu_cntrl_wrd_std() { return (address)&_fpu_cntrl_wrd_std; }
static address addr_fpu_cntrl_wrd_24() { return (address)&_fpu_cntrl_wrd_24; }
static address addr_fpu_cntrl_wrd_trunc() { return (address)&_fpu_cntrl_wrd_trunc; }
static address addr_fpu_subnormal_bias1() { return (address)&_fpu_subnormal_bias1; }
static address addr_fpu_subnormal_bias2() { return (address)&_fpu_subnormal_bias2; }
static jint fpu_cntrl_wrd_std() { return _fpu_cntrl_wrd_std; }
#endif // !LP64
private:
static jint _mxcsr_std;
#ifdef _LP64
static jint _mxcsr_rz;
#endif // _LP64
// masks and table for CRC32
static const uint64_t _crc_by128_masks[];
static const juint _crc_table[];
#ifdef _LP64
static const juint _crc_by128_masks_avx512[];
static const juint _crc_table_avx512[];
static const juint _crc32c_table_avx512[];
static const juint _shuf_table_crc32_avx512[];
#endif // _LP64
// table for CRC32C
static juint* _crc32c_table;
// table for arrays_hashcode
@@ -92,22 +115,30 @@ public:
//k256 table for sha256
static const juint _k256[];
static address _k256_adr;
#ifdef _LP64
static juint _k256_W[];
static address _k256_W_adr;
static const julong _k512_W[];
static address _k512_W_addr;
#endif
public:
static address addr_mxcsr_std() { return (address)&_mxcsr_std; }
#ifdef _LP64
static address addr_mxcsr_rz() { return (address)&_mxcsr_rz; }
#endif // _LP64
static address crc_by128_masks_addr() { return (address)_crc_by128_masks; }
#ifdef _LP64
static address crc_by128_masks_avx512_addr() { return (address)_crc_by128_masks_avx512; }
static address shuf_table_crc32_avx512_addr() { return (address)_shuf_table_crc32_avx512; }
static address crc_table_avx512_addr() { return (address)_crc_table_avx512; }
static address crc32c_table_avx512_addr() { return (address)_crc32c_table_avx512; }
#endif // _LP64
static address k256_addr() { return _k256_adr; }
#ifdef _LP64
static address k256_W_addr() { return _k256_W_adr; }
static address k512_W_addr() { return _k512_W_addr; }
#endif
static address arrays_hashcode_powers_of_31() { return (address)_arrays_hashcode_powers_of_31; }
static void generate_CRC32C_table(bool is_pclmulqdq_supported);

View File

@@ -3062,10 +3062,6 @@ uint64_t VM_Version::CpuidInfo::feature_flags() const {
result |= CPU_TSCINV_BIT;
if (std_cpuid1_ecx.bits.aes != 0)
result |= CPU_AES;
if (ext_cpuid1_ecx.bits.lzcnt != 0)
result |= CPU_LZCNT;
if (ext_cpuid1_ecx.bits.prefetchw != 0)
result |= CPU_3DNOW_PREFETCH;
if (sef_cpuid7_ebx.bits.erms != 0)
result |= CPU_ERMS;
if (sef_cpuid7_edx.bits.fast_short_rep_mov != 0)
@@ -3084,36 +3080,48 @@ uint64_t VM_Version::CpuidInfo::feature_flags() const {
result |= CPU_FMA;
if (sef_cpuid7_ebx.bits.clflushopt != 0)
result |= CPU_FLUSHOPT;
if (sef_cpuid7_ebx.bits.clwb != 0)
result |= CPU_CLWB;
if (ext_cpuid1_edx.bits.rdtscp != 0)
result |= CPU_RDTSCP;
if (sef_cpuid7_ecx.bits.rdpid != 0)
result |= CPU_RDPID;
// AMD|Hygon additional features.
// AMD|Hygon features.
if (is_amd_family()) {
// PREFETCHW was checked above, check TDNOW here.
if ((ext_cpuid1_edx.bits.tdnow != 0))
if ((ext_cpuid1_edx.bits.tdnow != 0) ||
(ext_cpuid1_ecx.bits.prefetchw != 0))
result |= CPU_3DNOW_PREFETCH;
if (ext_cpuid1_ecx.bits.lzcnt != 0)
result |= CPU_LZCNT;
if (ext_cpuid1_ecx.bits.sse4a != 0)
result |= CPU_SSE4A;
}
// Intel additional features.
// Intel features.
if (is_intel()) {
if (ext_cpuid1_ecx.bits.lzcnt != 0) {
result |= CPU_LZCNT;
}
if (ext_cpuid1_ecx.bits.prefetchw != 0) {
result |= CPU_3DNOW_PREFETCH;
}
if (sef_cpuid7_ebx.bits.clwb != 0) {
result |= CPU_CLWB;
}
if (sef_cpuid7_edx.bits.serialize != 0)
result |= CPU_SERIALIZE;
if (_cpuid_info.sef_cpuid7_edx.bits.avx512_fp16 != 0)
result |= CPU_AVX512_FP16;
}
// ZX additional features.
// ZX features.
if (is_zx()) {
// We do not know if these are supported by ZX, so we cannot trust
// common CPUID bit for them.
assert((result & CPU_CLWB) == 0, "Check if it is supported?");
result &= ~CPU_CLWB;
if (ext_cpuid1_ecx.bits.lzcnt != 0) {
result |= CPU_LZCNT;
}
if (ext_cpuid1_ecx.bits.prefetchw != 0) {
result |= CPU_3DNOW_PREFETCH;
}
}
// Protection key features.

View File

@@ -7396,7 +7396,7 @@ instruct addL_mem_imm(memory dst, immL32 src, rFlagsReg cr)
ins_pipe(ialu_mem_imm);
%}
instruct incL_rReg(rRegL dst, immL1 src, rFlagsReg cr)
instruct incL_rReg(rRegI dst, immL1 src, rFlagsReg cr)
%{
predicate(!UseAPX && UseIncDec);
match(Set dst (AddL dst src));
@@ -7409,7 +7409,7 @@ instruct incL_rReg(rRegL dst, immL1 src, rFlagsReg cr)
ins_pipe(ialu_reg);
%}
instruct incL_rReg_ndd(rRegL dst, rRegI src, immL1 val, rFlagsReg cr)
instruct incL_rReg_ndd(rRegI dst, rRegI src, immL1 val, rFlagsReg cr)
%{
predicate(UseAPX && UseIncDec);
match(Set dst (AddL src val));
@@ -7422,7 +7422,7 @@ instruct incL_rReg_ndd(rRegL dst, rRegI src, immL1 val, rFlagsReg cr)
ins_pipe(ialu_reg);
%}
instruct incL_rReg_mem_ndd(rRegL dst, memory src, immL1 val, rFlagsReg cr)
instruct incL_rReg_mem_ndd(rRegI dst, memory src, immL1 val, rFlagsReg cr)
%{
predicate(UseAPX && UseIncDec);
match(Set dst (AddL (LoadL src) val));
@@ -11345,7 +11345,7 @@ instruct xorL_rReg_mem_rReg_ndd(rRegL dst, memory src1, rRegL src2, rFlagsReg cr
ins_cost(150);
format %{ "exorq $dst, $src1, $src2\t# long ndd" %}
ins_encode %{
__ exorq($dst$$Register, $src1$$Address, $src2$$Register, false);
__ exorq($dst$$Register, $src1$$Address, $src1$$Register, false);
%}
ins_pipe(ialu_reg_mem);
%}

View File

@@ -211,6 +211,7 @@ void LambdaFormInvokers::regenerate_class(char* class_name, ClassFileStream& st,
class_name_sym,
cld,
cl_info,
false, // pick_newest
CHECK);
assert(result->java_mirror() != nullptr, "must be");

View File

@@ -31,7 +31,7 @@
//
// Set the unique identity number of a ciBaseObject.
void ciBaseObject::set_ident(uint id) {
assert(_ident == 0, "must only initialize once");
assert(AllowEnhancedClassRedefinition || _ident == 0, "must only initialize once");
_ident = id;
}

View File

@@ -255,7 +255,7 @@ ciEnv::ciEnv(Arena* arena) : _ciEnv_arena(mtCompiler, Arena::Tag::tag_cienv) {
_break_at_compile = false;
_compiler_data = nullptr;
#ifndef PRODUCT
assert(firstEnv, "must be first");
assert(AllowEnhancedClassRedefinition || firstEnv, "must be first");
firstEnv = false;
#endif /* !PRODUCT */

View File

@@ -139,6 +139,7 @@ public:
juint prototype_header_offset();
uintptr_t prototype_header();
Klass* new_version() { return get_Klass()->new_version(); }
};
#endif // SHARE_CI_CIKLASS_HPP

View File

@@ -73,7 +73,10 @@ GrowableArray<ciMetadata*>* ciObjectFactory::_shared_ci_metadata = nullptr;
ciSymbol* ciObjectFactory::_shared_ci_symbols[vmSymbols::number_of_symbols()];
int ciObjectFactory::_shared_ident_limit = 0;
volatile bool ciObjectFactory::_initialized = false;
volatile bool ciObjectFactory::_reinitialize_vm_klasses = false;
// TODO: review...
Arena* ciObjectFactory::_initial_arena = nullptr;
// ------------------------------------------------------------------
// ciObjectFactory::ciObjectFactory
@@ -109,6 +112,9 @@ void ciObjectFactory::initialize() {
// compiler thread that initializes the initial ciObjectFactory which
// creates the shared ciObjects that all later ciObjectFactories use.
Arena* arena = new (mtCompiler) Arena(mtCompiler, Arena::Tag::tag_cienv);
if (AllowEnhancedClassRedefinition) {
ciObjectFactory::_initial_arena = arena;
}
ciEnv initial(arena);
ciEnv* env = ciEnv::current();
env->_factory->init_shared_objects();
@@ -117,6 +123,16 @@ void ciObjectFactory::initialize() {
}
// (DCEVM) vm classes could be modified
void ciObjectFactory::reinitialize_vm_classes_dcevm() {
// TODO: compiler crashes after 'delete _initial_arena;'
// delete ciObjectFactory::_initial_arena;
_initialized = false;
ciObjectFactory::initialize();
_reinitialize_vm_klasses = false;
_initialized = true;
}
void ciObjectFactory::init_shared_objects() {
_next_ident = 1; // start numbering CI objects at 1
@@ -719,3 +735,28 @@ void ciObjectFactory::print() {
_unloaded_instances.length(),
_unloaded_klasses.length());
}
int ciObjectFactory::compare_cimetadata(ciMetadata** a, ciMetadata** b) {
Metadata* am = (*a)->constant_encoding();
Metadata* bm = (*b)->constant_encoding();
return ((am > bm) ? 1 : ((am == bm) ? 0 : -1));
}
// FIXME: review... Resoring the ciObject arrays after class redefinition
void ciObjectFactory::resort_shared_ci_metadata() {
if (_shared_ci_metadata == nullptr) return;
_shared_ci_metadata->sort(ciObjectFactory::compare_cimetadata);
#ifdef ASSERT
if (CIObjectFactoryVerify) {
Metadata* last = nullptr;
for (int j = 0; j< _shared_ci_metadata->length(); j++) {
Metadata* o = _shared_ci_metadata->at(j)->constant_encoding();
assert(last < o, "out of order");
last = o;
}
}
#endif // ASSERT
}

View File

@@ -41,9 +41,11 @@ class ciObjectFactory : public ArenaObj {
private:
static volatile bool _initialized;
static volatile bool _reinitialize_vm_klasses;
static GrowableArray<ciMetadata*>* _shared_ci_metadata;
static ciSymbol* _shared_ci_symbols[];
static int _shared_ident_limit;
static Arena* _initial_arena;
Arena* _arena;
GrowableArray<ciMetadata*> _ci_metadata;
@@ -88,8 +90,13 @@ private:
ciInstance* get_unloaded_instance(ciInstanceKlass* klass);
static int compare_cimetadata(ciMetadata** a, ciMetadata** b);
public:
static bool is_initialized() { return _initialized; }
// (DCEVM)
static bool is_reinitialize_vm_klasses() { return _reinitialize_vm_klasses; }
static void set_reinitialize_vm_klasses() { _reinitialize_vm_klasses = true; }
static void reinitialize_vm_classes_dcevm();
static void initialize();
void init_shared_objects();
@@ -144,6 +151,8 @@ public:
void print_contents();
void print();
static void resort_shared_ci_metadata();
};
#endif // SHARE_CI_CIOBJECTFACTORY_HPP

View File

@@ -826,6 +826,9 @@ void ClassFileParser::parse_interfaces(const ClassFileStream* const stream,
false, CHECK);
}
// (DCEVM) pick newest
interf = (Klass *) maybe_newest(interf);
if (!interf->is_interface()) {
THROW_MSG(vmSymbols::java_lang_IncompatibleClassChangeError(),
err_msg("class %s can not implement %s, because it is not an interface (%s)",
@@ -3795,7 +3798,8 @@ const InstanceKlass* ClassFileParser::parse_super_class(ConstantPool* const cp,
// However, make sure it is not an array type.
bool is_array = false;
if (cp->tag_at(super_class_index).is_klass()) {
super_klass = InstanceKlass::cast(cp->resolved_klass_at(super_class_index));
// (DCEVM) pick newest
super_klass = InstanceKlass::cast(maybe_newest(cp->resolved_klass_at(super_class_index)));
if (need_verify)
is_array = super_klass->is_array_klass();
} else if (need_verify) {
@@ -3935,7 +3939,10 @@ void ClassFileParser::set_precomputed_flags(InstanceKlass* ik) {
if (!_has_empty_finalizer) {
if (_has_finalizer ||
(super != nullptr && super->has_finalizer())) {
ik->set_has_finalizer();
// FIXME - (DCEVM) this is condition from previous DCEVM version, however after reload a new finalize() method is not active
if (ik->old_version() == nullptr || ik->old_version()->has_finalizer()) {
ik->set_has_finalizer();
}
}
}
@@ -5262,6 +5269,7 @@ ClassFileParser::ClassFileParser(ClassFileStream* stream,
ClassLoaderData* loader_data,
const ClassLoadInfo* cl_info,
Publicity pub_level,
const bool pick_newest,
TRAPS) :
_stream(stream),
_class_name(nullptr),
@@ -5320,7 +5328,8 @@ ClassFileParser::ClassFileParser(ClassFileStream* stream,
_has_contended_fields(false),
_has_finalizer(false),
_has_empty_finalizer(false),
_max_bootstrap_specifier_index(-1) {
_max_bootstrap_specifier_index(-1),
_pick_newest(pick_newest) {
_class_name = name != nullptr ? name : vmSymbols::unknown_class_name();
_class_name->increment_refcount();
@@ -5707,16 +5716,18 @@ void ClassFileParser::post_process_parsed_stream(const ClassFileStream* const st
CHECK);
}
Handle loader(THREAD, _loader_data->class_loader());
Klass* super_klass;
if (loader.is_null() && super_class_name == vmSymbols::java_lang_Object()) {
_super_klass = vmClasses::Object_klass();
super_klass = vmClasses::Object_klass();
} else {
_super_klass = (const InstanceKlass*)
super_klass = (InstanceKlass*)
SystemDictionary::resolve_super_or_fail(_class_name,
super_class_name,
loader,
true,
CHECK);
}
_super_klass = (InstanceKlass*) maybe_newest(super_klass);
}
if (_super_klass != nullptr) {

View File

@@ -197,6 +197,9 @@ class ClassFileParser {
bool _has_empty_finalizer;
int _max_bootstrap_specifier_index; // detects BSS values
// (DCEVM) Enhanced class redefinition
const bool _pick_newest;
void parse_stream(const ClassFileStream* const stream, TRAPS);
void mangle_hidden_class_name(InstanceKlass* const ik);
@@ -484,6 +487,8 @@ class ClassFileParser {
TRAPS);
void update_class_name(Symbol* new_name);
// (DCEVM) Enhanced class redefinition
inline const Klass* maybe_newest(const Klass* klass) const { return klass != NULL && _pick_newest ? klass->newest_version() : klass; }
public:
ClassFileParser(ClassFileStream* stream,
@@ -491,6 +496,7 @@ class ClassFileParser {
ClassLoaderData* loader_data,
const ClassLoadInfo* cl_info,
Publicity pub_level,
const bool pick_newest,
TRAPS);
~ClassFileParser();
@@ -521,6 +527,7 @@ class ClassFileParser {
ClassLoaderData* loader_data() const { return _loader_data; }
const Symbol* class_name() const { return _class_name; }
const InstanceKlass* super_klass() const { return _super_klass; }
Array<InstanceKlass*>* local_interfaces() const { return _local_interfaces; }
ReferenceType super_reference_type() const;
bool is_instance_ref_klass() const;

View File

@@ -1098,6 +1098,7 @@ InstanceKlass* ClassLoader::load_class(Symbol* name, PackageEntry* pkg_entry, bo
name,
loader_data,
cl_info,
false, // pick_newest
CHECK_NULL);
result->set_classpath_index(classpath_index);
return result;

View File

@@ -651,6 +651,15 @@ Dictionary* ClassLoaderData::create_dictionary() {
return new Dictionary(this, size);
}
void ClassLoaderData::exchange_holders(ClassLoaderData* cld) {
oop holder_oop = _holder.peek();
_holder.replace(cld->_holder.peek());
cld->_holder.replace(holder_oop);
WeakHandle exchange = _holder;
_holder = cld->_holder;
cld->_holder = exchange;
}
// Tell the GC to keep this klass alive. Needed while iterating ClassLoaderDataGraph,
// and any runtime code that uses klasses.
oop ClassLoaderData::holder() const {

View File

@@ -208,6 +208,8 @@ private:
// Resolving the holder keeps this CLD alive for the current GC cycle.
oop holder() const;
void keep_alive() const { (void)holder(); }
// (DCEVM)
void exchange_holders(ClassLoaderData* cld);
void classes_do(void f(Klass* const));

View File

@@ -352,6 +352,38 @@ void ClassLoaderDataGraph::verify_dictionary() {
}
}
// (DCEVM) - iterate over dict classes
void ClassLoaderDataGraph::dictionary_classes_do(KlassClosure* klass_closure) {
ClassLoaderDataGraphIterator iter;
while (ClassLoaderData* cld = iter.get_next()) {
if (cld->dictionary() != nullptr) {
cld->dictionary()->classes_do(klass_closure);
}
}
}
// (DCEVM) rollback redefined classes
void ClassLoaderDataGraph::rollback_redefinition() {
ClassLoaderDataGraphIterator iter;
while (ClassLoaderData* cld = iter.get_next()) {
if (cld->dictionary() != nullptr) {
cld->dictionary()->rollback_redefinition();
}
}
}
// (DCEVM) - iterate over all classes in all dictionaries
bool ClassLoaderDataGraph::dictionary_classes_do_update_klass(Thread* current, Symbol* name, InstanceKlass* k, InstanceKlass* old_klass) {
bool ok = false;
ClassLoaderDataGraphIterator iter;
while (ClassLoaderData* cld = iter.get_next()) {
if (cld->dictionary() != nullptr) {
ok = cld->dictionary()->update_klass(current, name, k, old_klass) || ok;
}
}
return ok;
}
void ClassLoaderDataGraph::print_dictionary(outputStream* st) {
ClassLoaderDataGraphIterator iter;
while (ClassLoaderData *cld = iter.get_next()) {

View File

@@ -83,6 +83,7 @@ class ClassLoaderDataGraph : public AllStatic {
// for redefinition. These classes are removed during the next class unloading.
// Walking the ClassLoaderDataGraph also includes hidden classes.
static void classes_do(KlassClosure* klass_closure);
static void classes_do(void f(Klass* const));
static void methods_do(void f(Method*));
static void modules_do_keepalive(void f(ModuleEntry*));
@@ -100,6 +101,11 @@ class ClassLoaderDataGraph : public AllStatic {
// Called from VMOperation
static void walk_metadata_and_clean_metaspaces();
// (DCEVM) Enhanced class redefinition
static void dictionary_classes_do(KlassClosure* klass_closure);
static void rollback_redefinition();
static bool dictionary_classes_do_update_klass(Thread* current, Symbol* name, InstanceKlass* k, InstanceKlass* old_klass);
static void verify_dictionary();
static void print_dictionary(outputStream* st);
static void print_table_statistics(outputStream* st);

View File

@@ -91,6 +91,31 @@ void Dictionary::classes_do(void f(InstanceKlass*)) {
_table->do_scan(Thread::current(), doit);
}
void Dictionary::classes_do_safepoint(void f(InstanceKlass*)) {
auto doit = [&] (InstanceKlass** value) {
InstanceKlass* k = (*value);
if (loader_data() == k->class_loader_data()) {
f(k);
}
return true;
};
_table->do_safepoint_scan(doit);
}
// (DCEVM) iterate over dict entry
void Dictionary::classes_do(KlassClosure* closure) {
auto doit = [&] (InstanceKlass** value) {
InstanceKlass* k = (*value);
if (loader_data() == k->class_loader_data()) {
closure->do_klass(k);
}
return true;
};
_table->do_scan(Thread::current(), doit);
}
// All classes, and their class loaders, including initiating class loaders
void Dictionary::all_entries_do(KlassClosure* closure) {
auto all_doit = [&] (InstanceKlass** value) {
@@ -179,7 +204,57 @@ InstanceKlass* Dictionary::find_class(Thread* current, Symbol* class_name) {
bool needs_rehashing = false;
_table->get(current, lookup, get, &needs_rehashing);
assert (!needs_rehashing, "should never need rehashing");
return result;
return old_if_redefining(result);
}
class UpdateKlassDcevm : public StackObj {
InstanceKlass* _new_klass;
InstanceKlass* _old_klass;
bool _replaced;
public:
UpdateKlassDcevm(InstanceKlass* new_klass, InstanceKlass* old_klass) :
_new_klass(new_klass),
_old_klass(old_klass),
_replaced(false) {
}
void operator()(InstanceKlass** old_table_value) {
assert(*old_table_value == _old_klass, "should be old class");
*old_table_value = _new_klass;
_replaced = true;
}
bool get_replaced() {
return _replaced;
}
};
// (DCEVM) replace old_class by new class in dictionary
bool Dictionary::update_klass(Thread* current, Symbol* class_name, InstanceKlass* k, InstanceKlass* old_klass) {
UpdateKlassDcevm found(k, old_klass);
DictionaryLookup lookup(class_name);
InstanceKlass* result = nullptr;
bool needs_rehashing = false;
bool ret = _table->insert_get(current, lookup, old_klass, found);
return ret || found.get_replaced();
}
class RollBackDcevm : public StackObj {
public:
bool operator()(InstanceKlass** table_value) {
InstanceKlass* k = *table_value;
if (k->is_redefining()) {
*table_value = (InstanceKlass*) k->old_version();
}
return true;
}
};
// (DCEVM) rollback redefinition
void Dictionary::rollback_redefinition() {
RollBackDcevm rollback;
_table->do_scan(Thread::current(), rollback);
}
void Dictionary::print_size(outputStream* st) const {

View File

@@ -63,6 +63,10 @@ public:
InstanceKlass* find_class(Thread* current, Symbol* name);
void classes_do(void f(InstanceKlass*));
// (DCEVM)
void classes_do_safepoint(void f(InstanceKlass*));
void classes_do(KlassClosure* closure);
void all_entries_do(KlassClosure* closure);
void classes_do(MetaspaceClosure* it);
@@ -71,6 +75,16 @@ public:
void print_on(outputStream* st) const;
void print_size(outputStream* st) const;
void verify();
// (DCEVM) Enhanced class redefinition
bool update_klass(Thread* current, Symbol* class_name, InstanceKlass* k, InstanceKlass* old_klass);
void rollback_redefinition();
private:
// (DCEVM) return old class if redefining in AllowEnhancedClassRedefinition, otherwise return "k"
static InstanceKlass* old_if_redefining(InstanceKlass* k) {
return (k != nullptr && k->is_redefining()) ? ((InstanceKlass* )k->old_version()) : k;
}
};
#endif // SHARE_CLASSFILE_DICTIONARY_HPP

View File

@@ -93,6 +93,7 @@
#if INCLUDE_JVMCI
#include "jvmci/jvmciJavaClasses.hpp"
#endif
#include "prims/jvmtiEnhancedRedefineClasses.hpp"
#define DECLARE_INJECTED_FIELD(klass, name, signature, may_be_java) \
{ VM_CLASS_ID(klass), VM_SYMBOL_ENUM_NAME(name##_name), VM_SYMBOL_ENUM_NAME(signature), may_be_java },
@@ -732,7 +733,8 @@ char* java_lang_String::as_utf8_string(oop java_string, typeArrayOop value, int
}
bool java_lang_String::equals(oop java_string, const jchar* chars, int len) {
assert(java_string->klass() == vmClasses::String_klass(),
assert(java_string->klass() == vmClasses::String_klass()
|| (Universe::is_inside_redefinition() && java_string->klass()->newest_version() == vmClasses::String_klass()),
"must be java_string");
typeArrayOop value = java_lang_String::value_no_keepalive(java_string);
int length = java_lang_String::length(java_string, value);
@@ -1496,7 +1498,8 @@ BasicType java_lang_Class::as_BasicType(oop java_class, Klass** reference_klass)
oop java_lang_Class::primitive_mirror(BasicType t) {
oop mirror = Universe::java_mirror(t);
assert(mirror != nullptr && mirror->is_a(vmClasses::Class_klass()), "must be a Class");
assert(mirror != nullptr && (mirror->is_a(vmClasses::Class_klass())
|| (Universe::is_inside_redefinition() && vmClasses::Class_klass()->old_version() != NULL && mirror->is_a(vmClasses::Class_klass()->old_version()))), "must be a Class");
assert(is_primitive(mirror), "must be primitive");
return mirror;
}
@@ -2847,6 +2850,8 @@ void java_lang_Throwable::fill_in_stack_trace(Handle throwable, const methodHand
skip_throwableInit_check = true;
}
}
// (DCEVM): Line numbers from newest version must be used for EMCP-swapped methods
method = method->newest_version();
if (method->is_hidden() || method->is_continuation_enter_intrinsic()) {
if (skip_hidden) {
if (total_count == 0) {
@@ -4188,6 +4193,62 @@ void java_lang_invoke_DirectMethodHandle::serialize_offsets(SerializeClosure* f)
}
#endif
// Support for java_lang_invoke_DirectMethodHandle$StaticAccessor
int java_lang_invoke_DirectMethodHandle_StaticAccessor::_static_offset_offset;
long java_lang_invoke_DirectMethodHandle_StaticAccessor::static_offset(oop dmh) {
assert(_static_offset_offset != 0, "");
return dmh->long_field(_static_offset_offset);
}
void java_lang_invoke_DirectMethodHandle_StaticAccessor::set_static_offset(oop dmh, long static_offset) {
assert(_static_offset_offset != 0, "");
dmh->long_field_put(_static_offset_offset, static_offset);
}
#define DIRECTMETHODHANDLE_STATIC_ACCESSOR_FIELDS_DO(macro) \
macro(_static_offset_offset, k, vmSymbols::static_offset_name(), long_signature, false)
void java_lang_invoke_DirectMethodHandle_StaticAccessor::compute_offsets() {
InstanceKlass* k = vmClasses::DirectMethodHandle_StaticAccessor_klass();
DIRECTMETHODHANDLE_STATIC_ACCESSOR_FIELDS_DO(FIELD_COMPUTE_OFFSET);
}
#if INCLUDE_CDS
void java_lang_invoke_DirectMethodHandle_StaticAccessor::serialize_offsets(SerializeClosure* f) {
DIRECTMETHODHANDLE_STATIC_ACCESSOR_FIELDS_DO(FIELD_SERIALIZE_OFFSET);
}
#endif
// Support for java_lang_invoke_DirectMethodHandle$Accessor
int java_lang_invoke_DirectMethodHandle_Accessor::_field_offset_offset;
int java_lang_invoke_DirectMethodHandle_Accessor::field_offset(oop dmh) {
assert(_field_offset_offset != 0, "");
return dmh->int_field(_field_offset_offset);
}
void java_lang_invoke_DirectMethodHandle_Accessor::set_field_offset(oop dmh, int field_offset) {
assert(_field_offset_offset != 0, "");
dmh->int_field_put(_field_offset_offset, field_offset);
}
#define DIRECTMETHODHANDLE_ACCESSOR_FIELDS_DO(macro) \
macro(_field_offset_offset, k, vmSymbols::field_offset_name(), int_signature, false)
void java_lang_invoke_DirectMethodHandle_Accessor::compute_offsets() {
InstanceKlass* k = vmClasses::DirectMethodHandle_Accessor_klass();
DIRECTMETHODHANDLE_ACCESSOR_FIELDS_DO(FIELD_COMPUTE_OFFSET);
}
#if INCLUDE_CDS
void java_lang_invoke_DirectMethodHandle_Accessor::serialize_offsets(SerializeClosure* f) {
DIRECTMETHODHANDLE_ACCESSOR_FIELDS_DO(FIELD_SERIALIZE_OFFSET);
}
#endif
// Support for java_lang_invoke_MethodHandle
int java_lang_invoke_MethodHandle::_type_offset;
@@ -5390,6 +5451,8 @@ void java_lang_InternalError::serialize_offsets(SerializeClosure* f) {
f(java_lang_invoke_MethodType) \
f(java_lang_invoke_CallSite) \
f(java_lang_invoke_ConstantCallSite) \
f(java_lang_invoke_DirectMethodHandle_StaticAccessor) \
f(java_lang_invoke_DirectMethodHandle_Accessor) \
f(java_lang_reflect_AccessibleObject) \
f(java_lang_reflect_Method) \
f(java_lang_reflect_Constructor) \

View File

@@ -267,7 +267,9 @@ class java_lang_Class : AllStatic {
static void set_init_lock(oop java_class, oop init_lock);
static void set_protection_domain(oop java_class, oop protection_domain);
static void set_class_loader(oop java_class, oop class_loader);
public: // DCEVM
static void set_component_mirror(oop java_class, oop comp_mirror);
private:
static void initialize_mirror_fields(Klass* k, Handle mirror, Handle protection_domain,
Handle classData, TRAPS);
static void set_mirror_module_field(JavaThread* current, Klass* K, Handle mirror, Handle module);
@@ -1118,6 +1120,55 @@ class java_lang_invoke_DirectMethodHandle: AllStatic {
static int member_offset() { CHECK_INIT(_member_offset); }
};
// Interface to java.lang.invoke.DirectMethodHandle$StaticAccessor objects
class java_lang_invoke_DirectMethodHandle_StaticAccessor: AllStatic {
friend class JavaClasses;
private:
static int _static_offset_offset; // offset to static field
static void compute_offsets();
public:
// Accessors
static long static_offset(oop dmh);
static void set_static_offset(oop dmh, long value);
// Testers
static bool is_subclass(Klass* klass) {
return klass->is_subclass_of(vmClasses::DirectMethodHandle_StaticAccessor_klass());
}
static bool is_instance(oop obj);
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
};
// Interface to java.lang.invoke.DirectMethodHandle$Accessor objects
class java_lang_invoke_DirectMethodHandle_Accessor: AllStatic {
friend class JavaClasses;
private:
static int _field_offset_offset; // offset to field
static void compute_offsets();
public:
// Accessors
static int field_offset(oop dmh);
static void set_field_offset(oop dmh, int value);
// Testers
static bool is_subclass(Klass* klass) {
return klass->is_subclass_of(vmClasses::DirectMethodHandle_Accessor_klass());
}
static bool is_instance(oop obj);
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
};
// Interface to java.lang.invoke.LambdaForm objects
// (These are a private interface for managing adapter code generation.)

View File

@@ -34,6 +34,7 @@
#include "oops/oop.inline.hpp"
#include "oops/oopsHierarchy.hpp"
#include "oops/typeArrayOop.inline.hpp"
#include "prims/jvmtiEnhancedRedefineClasses.hpp"
void java_lang_String::set_coder(oop string, jbyte coder) {
string->byte_field_put(_coder_offset, coder);
@@ -123,7 +124,8 @@ int java_lang_String::length(oop java_string) {
}
bool java_lang_String::is_instance(oop obj) {
return obj != nullptr && obj->klass() == vmClasses::String_klass();
return obj != nullptr && (obj->klass() == vmClasses::String_klass()
|| (Universe::is_inside_redefinition() && obj->klass()->newest_version() == vmClasses::String_klass()));
}
// Accessors
@@ -264,11 +266,13 @@ inline bool java_lang_invoke_ConstantCallSite::is_instance(oop obj) {
}
inline bool java_lang_invoke_MemberName::is_instance(oop obj) {
return obj != nullptr && obj->klass() == vmClasses::MemberName_klass();
return obj != nullptr && (obj->klass() == vmClasses::MemberName_klass()
|| (Universe::is_inside_redefinition() && obj->klass()->newest_version() == vmClasses::MemberName_klass()));
}
inline bool java_lang_invoke_ResolvedMethodName::is_instance(oop obj) {
return obj != nullptr && obj->klass() == vmClasses::ResolvedMethodName_klass();
return obj != nullptr && (obj->klass() == vmClasses::ResolvedMethodName_klass()
|| (Universe::is_inside_redefinition() && obj->klass()->newest_version() == vmClasses::ResolvedMethodName_klass()));
}
inline bool java_lang_invoke_MethodType::is_instance(oop obj) {
@@ -280,7 +284,8 @@ inline bool java_lang_invoke_MethodHandle::is_instance(oop obj) {
}
inline bool java_lang_Class::is_instance(oop obj) {
return obj != nullptr && obj->klass() == vmClasses::Class_klass();
return obj != nullptr && (obj->klass() == vmClasses::Class_klass()
|| (Universe::is_inside_redefinition() && obj->klass()->newest_version() == vmClasses::Class_klass()));
}
inline Klass* java_lang_Class::as_Klass(oop java_class) {
@@ -317,6 +322,16 @@ inline size_t java_lang_Class::oop_size(oop java_class) {
}
inline bool java_lang_invoke_DirectMethodHandle::is_instance(oop obj) {
return obj != nullptr && (is_subclass(obj->klass())
|| (Universe::is_inside_redefinition() && is_subclass(obj->klass()->newest_version())));
}
inline bool java_lang_invoke_DirectMethodHandle_StaticAccessor::is_instance(oop obj) {
return obj != nullptr && (is_subclass(obj->klass())
|| (Universe::is_inside_redefinition() && is_subclass(obj->klass()->newest_version())));
}
inline bool java_lang_invoke_DirectMethodHandle_Accessor::is_instance(oop obj) {
return obj != nullptr && is_subclass(obj->klass());
}

View File

@@ -85,6 +85,7 @@ InstanceKlass* KlassFactory::check_shared_class_file_load_hook(
loader_data,
&cl_info,
ClassFileParser::BROADCAST, // publicity level
false,
CHECK_NULL);
const ClassInstanceInfo* cl_inst_info = cl_info.class_hidden_info_ptr();
InstanceKlass* new_ik = parser.create_instance_klass(true, // changed_by_loadhook
@@ -171,6 +172,7 @@ InstanceKlass* KlassFactory::create_from_stream(ClassFileStream* stream,
Symbol* name,
ClassLoaderData* loader_data,
const ClassLoadInfo& cl_info,
const bool pick_newest,
TRAPS) {
assert(stream != nullptr, "invariant");
assert(loader_data != nullptr, "invariant");
@@ -200,6 +202,7 @@ InstanceKlass* KlassFactory::create_from_stream(ClassFileStream* stream,
loader_data,
&cl_info,
ClassFileParser::BROADCAST, // publicity level
pick_newest,
CHECK_NULL);
const ClassInstanceInfo* cl_inst_info = cl_info.class_hidden_info_ptr();

View File

@@ -64,6 +64,7 @@ class KlassFactory : AllStatic {
Symbol* name,
ClassLoaderData* loader_data,
const ClassLoadInfo& cl_info,
const bool pick_newest,
TRAPS);
static InstanceKlass* check_shared_class_file_load_hook(
InstanceKlass* ik,

View File

@@ -218,6 +218,21 @@ void LoaderConstraintTable::add_loader_constraint(Symbol* name, InstanceKlass* k
}
}
// (DCEVM) update constraint entries to new classes, called from dcevm redefinition code only
void LoaderConstraintTable::update_after_redefinition() {
auto update_old = [&] (SymbolHandle& key, ConstraintSet& set) {
int len = set.num_constraints();
for (int i = 0; i < len; i++) {
LoaderConstraint* probe = set.constraint_at(i);
if (probe->klass() != nullptr) {
// We swap the class with the newest version with an assumption that the hash will be the same
probe->set_klass((InstanceKlass*) probe->klass()->newest_version());
}
}
};
_loader_constraint_table->iterate_all(update_old);
}
class PurgeUnloadedConstraints : public StackObj {
public:
bool do_entry(SymbolHandle& name, ConstraintSet& set) {
@@ -526,6 +541,7 @@ void LoaderConstraintTable::verify() {
guarantee(k == probe->klass(), "klass should be in dictionary");
// If we don't find the class in the dictionary, it is
// in the process of loading and may or may not be in the placeholder table.
guarantee(k == probe->klass() || (AllowEnhancedClassRedefinition && k->newest_version() == probe->klass()->newest_version()), "klass should be in dictionary");
}
}
for (int n = 0; n< probe->num_loaders(); n++) {

View File

@@ -44,6 +44,9 @@ private:
LoaderConstraint* pp2, InstanceKlass* klass);
public:
static void initialize();
// (DCEVM) update all klasses with newest version
static void update_after_redefinition();
// Check class loader constraints
static bool add_entry(Symbol* name, InstanceKlass* klass1, ClassLoaderData* loader1,
InstanceKlass* klass2, ClassLoaderData* loader2);

View File

@@ -300,7 +300,7 @@ static void verify_dictionary_entry(Symbol* class_name, InstanceKlass* k) {
Dictionary* dictionary = loader_data->dictionary();
assert(class_name == k->name(), "Must be the same");
InstanceKlass* kk = dictionary->find_class(JavaThread::current(), class_name);
assert(kk == k, "should be present in dictionary");
assert((kk == k && !k->is_redefining()) || (k->is_redefining() && kk == k->old_version()), "should be present in dictionary");
}
#endif
@@ -337,6 +337,7 @@ Klass* SystemDictionary::resolve_or_fail(Symbol* class_name, Handle class_loader
if (HAS_PENDING_EXCEPTION || klass == nullptr) {
handle_resolution_exception(class_name, throw_error, CHECK_NULL);
}
assert(klass == nullptr || klass->new_version() == nullptr || klass->newest_version()->is_redefining(), "must be");
return klass;
}
@@ -785,11 +786,14 @@ InstanceKlass* SystemDictionary::resolve_hidden_class_from_stream(
Symbol* class_name,
Handle class_loader,
const ClassLoadInfo& cl_info,
InstanceKlass* old_klass,
TRAPS) {
EventClassLoad class_load_start_event;
ClassLoaderData* loader_data;
bool is_redefining = (old_klass != nullptr);
// - for hidden classes that are not strong: create a new CLD that has a class holder and
// whose loader is the Lookup class's loader.
// - for hidden class: add the class to the Lookup class's loader's CLD.
@@ -804,8 +808,13 @@ InstanceKlass* SystemDictionary::resolve_hidden_class_from_stream(
class_name,
loader_data,
cl_info,
is_redefining, // pick_newest
CHECK_NULL);
assert(k != nullptr, "no klass created");
if (is_redefining && k != nullptr) {
k->set_redefining(true);
k->set_old_version(old_klass);
}
// Hidden classes that are not strong must update ClassLoaderData holder
// so that they can be unloaded when the mirror is no longer referenced.
@@ -841,10 +850,12 @@ InstanceKlass* SystemDictionary::resolve_class_from_stream(
Symbol* class_name,
Handle class_loader,
const ClassLoadInfo& cl_info,
InstanceKlass* old_klass,
TRAPS) {
HandleMark hm(THREAD);
bool is_redefining = (old_klass != nullptr);
ClassLoaderData* loader_data = register_loader(class_loader);
// Classloaders that support parallelism, e.g. bootstrap classloader,
@@ -859,6 +870,7 @@ InstanceKlass* SystemDictionary::resolve_class_from_stream(
InstanceKlass* k = nullptr;
#if INCLUDE_CDS
// FIXME: (DCEVM) what to do during redefinition?
if (!CDSConfig::is_dumping_static_archive()) {
k = SystemDictionaryShared::lookup_from_stream(class_name,
class_loader,
@@ -869,7 +881,12 @@ InstanceKlass* SystemDictionary::resolve_class_from_stream(
#endif
if (k == nullptr) {
k = KlassFactory::create_from_stream(st, class_name, loader_data, cl_info, CHECK_NULL);
k = KlassFactory::create_from_stream(st, class_name, loader_data, cl_info, is_redefining, CHECK_NULL);
}
if (is_redefining && k != nullptr) {
k->set_redefining(true);
k->set_old_version(old_klass);
}
assert(k != nullptr, "no klass created");
@@ -880,10 +897,10 @@ InstanceKlass* SystemDictionary::resolve_class_from_stream(
// If a class loader supports parallel classloading, handle parallel define requests.
// find_or_define_instance_class may return a different InstanceKlass,
// in which case the old k would be deallocated
if (is_parallelCapable(class_loader)) {
if (is_parallelCapable(class_loader) && !is_redefining) {
k = find_or_define_instance_class(h_name, class_loader, k, CHECK_NULL);
} else {
define_instance_class(k, class_loader, THREAD);
define_instance_class(k, old_klass, class_loader, THREAD);
// If defining the class throws an exception register 'k' for cleanup.
if (HAS_PENDING_EXCEPTION) {
@@ -903,11 +920,12 @@ InstanceKlass* SystemDictionary::resolve_from_stream(ClassFileStream* st,
Symbol* class_name,
Handle class_loader,
const ClassLoadInfo& cl_info,
InstanceKlass* old_klass,
TRAPS) {
if (cl_info.is_hidden()) {
return resolve_hidden_class_from_stream(st, class_name, class_loader, cl_info, CHECK_NULL);
return resolve_hidden_class_from_stream(st, class_name, class_loader, cl_info, old_klass, CHECK_NULL);
} else {
return resolve_class_from_stream(st, class_name, class_loader, cl_info, CHECK_NULL);
return resolve_class_from_stream(st, class_name, class_loader, cl_info, old_klass, CHECK_NULL);
}
}
@@ -1335,10 +1353,11 @@ static void post_class_define_event(InstanceKlass* k, const ClassLoaderData* def
}
}
void SystemDictionary::define_instance_class(InstanceKlass* k, Handle class_loader, TRAPS) {
void SystemDictionary::define_instance_class(InstanceKlass* k, InstanceKlass* old_klass, Handle class_loader, TRAPS) {
ClassLoaderData* loader_data = k->class_loader_data();
assert(loader_data->class_loader() == class_loader(), "they must be the same");
bool is_redefining = (old_klass != NULL);
// Bootstrap and other parallel classloaders don't acquire a lock,
// they use placeholder token.
@@ -1360,7 +1379,17 @@ void SystemDictionary::define_instance_class(InstanceKlass* k, Handle class_load
// classloader lock held
// Parallel classloaders will call find_or_define_instance_class
// which will require a token to perform the define class
check_constraints(k, loader_data, true, CHECK);
if (is_redefining) {
// Update all dictionaries containing old_class to new_class
// outcome must be same as result of standard redefinition, that does not create a new Klass
ClassLoaderDataGraph_lock->lock();
Symbol* name_h = k->name();
bool ok = ClassLoaderDataGraph::dictionary_classes_do_update_klass(THREAD, name_h, k, old_klass);
ClassLoaderDataGraph_lock->unlock();
assert (ok, "must have found old class and updated!");
}
check_constraints(k, loader_data, !is_redefining, CHECK);
// Register class just loaded with class loader (placed in ArrayList)
// Note we do this before updating the dictionary, as this can
@@ -1383,7 +1412,7 @@ void SystemDictionary::define_instance_class(InstanceKlass* k, Handle class_load
update_dictionary(THREAD, k, loader_data);
// notify jvmti
if (JvmtiExport::should_post_class_load()) {
if (!is_redefining && JvmtiExport::should_post_class_load()) {
JvmtiExport::post_class_load(THREAD, k);
}
post_class_define_event(k, loader_data);
@@ -1455,7 +1484,7 @@ InstanceKlass* SystemDictionary::find_or_define_helper(Symbol* class_name, Handl
}
}
define_instance_class(k, class_loader, THREAD);
define_instance_class(k, NULL, class_loader, THREAD);
// definer must notify any waiting threads
{
@@ -1493,6 +1522,14 @@ InstanceKlass* SystemDictionary::find_or_define_instance_class(Symbol* class_nam
}
// (DCEVM) - remove from klass hierarchy
void SystemDictionary::remove_from_hierarchy(InstanceKlass* k) {
assert(k != NULL, "just checking");
// remove receiver from sibling list
k->remove_from_sibling_list();
}
// ----------------------------------------------------------------------------
// GC support
@@ -1600,7 +1637,7 @@ void SystemDictionary::check_constraints(InstanceKlass* k,
// else - ok, class loaded by a different thread in parallel.
// We should only have found it if it was done loading and ok to use.
if ((defining == true) || (k != check)) {
if ((defining == true) || (k != check && (!AllowEnhancedClassRedefinition || k->old_version() != check))) {
throwException = true;
ss.print("loader %s", loader_data->loader_name_and_id());
ss.print(" attempted duplicate %s definition for %s. (%s)",
@@ -2303,7 +2340,7 @@ Handle SystemDictionary::link_method_handle_constant(Klass* caller,
// call java.lang.invoke.MethodHandleNatives::linkMethodHandleConstant(Class caller, int refKind, Class callee, String name, Object type) -> MethodHandle
JavaCallArguments args;
args.push_oop(Handle(THREAD, caller->java_mirror())); // the referring class
args.push_oop(Handle(THREAD, caller->newest_version()->java_mirror())); // the referring class
args.push_int(ref_kind);
args.push_oop(Handle(THREAD, callee->java_mirror())); // the target class
args.push_oop(name_str);

View File

@@ -125,6 +125,7 @@ class SystemDictionary : AllStatic {
Symbol* class_name,
Handle class_loader,
const ClassLoadInfo& cl_info,
InstanceKlass* old_klass,
TRAPS);
// Resolve a class from stream (called by jni_DefineClass and JVM_DefineClass)
@@ -133,6 +134,7 @@ class SystemDictionary : AllStatic {
Symbol* class_name,
Handle class_loader,
const ClassLoadInfo& cl_info,
InstanceKlass* old_klass,
TRAPS);
static oop get_system_class_loader_impl(TRAPS);
@@ -144,6 +146,7 @@ class SystemDictionary : AllStatic {
Symbol* class_name,
Handle class_loader,
const ClassLoadInfo& cl_info,
InstanceKlass* old_klass,
TRAPS);
// Lookup an already loaded class. If not found null is returned.
@@ -203,6 +206,9 @@ class SystemDictionary : AllStatic {
// Initialization
static void initialize(TRAPS);
// (DCEVM) Enhanced class redefinition
static void remove_from_hierarchy(InstanceKlass* k);
public:
// Returns java system loader
static oop java_system_loader();
@@ -297,7 +303,7 @@ private:
static Klass* resolve_array_class_or_null(Symbol* class_name,
Handle class_loader,
TRAPS);
static void define_instance_class(InstanceKlass* k, Handle class_loader, TRAPS);
static void define_instance_class(InstanceKlass* k, InstanceKlass* old_klass, Handle class_loader, TRAPS);
static InstanceKlass* find_or_define_helper(Symbol* class_name,
Handle class_loader,
InstanceKlass* k, TRAPS);

View File

@@ -373,6 +373,7 @@ class ClassVerifier : public StackObj {
VerificationType object_type() const;
InstanceKlass* _klass_to_verify;
InstanceKlass* _klass; // the class being verified
methodHandle _method; // current method being verified
VerificationType _this_type; // the verification type of the current class

View File

@@ -110,6 +110,8 @@
\
/* support for dynamic typing */ \
do_klass(DirectMethodHandle_klass, java_lang_invoke_DirectMethodHandle ) \
do_klass(DirectMethodHandle_StaticAccessor_klass, java_lang_invoke_DirectMethodHandle_StaticAccessor ) \
do_klass(DirectMethodHandle_Accessor_klass, java_lang_invoke_DirectMethodHandle_Accessor ) \
do_klass(MethodHandle_klass, java_lang_invoke_MethodHandle ) \
do_klass(VarHandle_klass, java_lang_invoke_VarHandle ) \
do_klass(MemberName_klass, java_lang_invoke_MemberName ) \

View File

@@ -259,3 +259,20 @@ BasicType vmClasses::box_klass_type(Klass* k) {
}
return T_OBJECT;
}
bool vmClasses::update_vm_klass(InstanceKlass* old_klass, InstanceKlass* new_klass) {
for (int i = T_BOOLEAN; i < T_VOID+1; i++) {
if (_box_klasses[i] == old_klass) {
_box_klasses[i] = new_klass;
break;
}
}
for (int id = static_cast<int>(vmClassID::FIRST); id < static_cast<int>(vmClassID::LIMIT); id++) {
if (_klasses[id] == old_klass) {
_klasses[id] = new_klass;
return true;
}
}
return false;
}

View File

@@ -108,6 +108,10 @@ public:
static bool Cloneable_klass_loaded() { return is_loaded(VM_CLASS_AT(Cloneable_klass)); }
static bool Parameter_klass_loaded() { return is_loaded(VM_CLASS_AT(reflect_Parameter_klass)); }
static bool ClassLoader_klass_loaded() { return is_loaded(VM_CLASS_AT(ClassLoader_klass)); }
// (DCEVM) vmClasses could be modified
static bool update_vm_klass(InstanceKlass* new_klass, InstanceKlass* old_klass);
};
#endif // SHARE_CLASSFILE_VMCLASSES_HPP

View File

@@ -313,6 +313,8 @@ class SerializeClosure;
template(java_lang_invoke_CallSite, "java/lang/invoke/CallSite") \
template(java_lang_invoke_ConstantCallSite, "java/lang/invoke/ConstantCallSite") \
template(java_lang_invoke_DirectMethodHandle, "java/lang/invoke/DirectMethodHandle") \
template(java_lang_invoke_DirectMethodHandle_StaticAccessor, "java/lang/invoke/DirectMethodHandle$StaticAccessor") \
template(java_lang_invoke_DirectMethodHandle_Accessor, "java/lang/invoke/DirectMethodHandle$Accessor") \
template(java_lang_invoke_MutableCallSite, "java/lang/invoke/MutableCallSite") \
template(java_lang_invoke_VolatileCallSite, "java/lang/invoke/VolatileCallSite") \
template(java_lang_invoke_MethodHandle, "java/lang/invoke/MethodHandle") \
@@ -386,6 +388,8 @@ class SerializeClosure;
template(interrupt_method_name, "interrupt") \
template(exit_method_name, "exit") \
template(remove_method_name, "remove") \
template(registerNatives_method_name, "registerNatives") \
template(initIDs_method_name, "initIDs") \
template(parent_name, "parent") \
template(maxPriority_name, "maxPriority") \
template(shutdown_name, "shutdown") \
@@ -512,6 +516,9 @@ class SerializeClosure;
template(maxThawingSize_name, "maxThawingSize") \
template(lockStackSize_name, "lockStackSize") \
template(objectWaiter_name, "objectWaiter") \
template(static_offset_name, "staticOffset") \
template(static_base_name, "staticBase") \
template(field_offset_name, "fieldOffset") \
\
/* name symbols needed by intrinsics */ \
VM_INTRINSICS_DO(VM_INTRINSIC_IGNORE, VM_SYMBOL_IGNORE, template, VM_SYMBOL_IGNORE, VM_ALIAS_IGNORE) \

View File

@@ -143,6 +143,8 @@ CompileLog** CompileBroker::_compiler2_logs = nullptr;
volatile jint CompileBroker::_compilation_id = 0;
volatile jint CompileBroker::_osr_compilation_id = 0;
volatile jint CompileBroker::_native_compilation_id = 0;
volatile bool CompileBroker::_compilation_stopped = false;
volatile jint CompileBroker::_active_compilations = 0;
// Performance counters
PerfCounter* CompileBroker::_perf_total_compilation = nullptr;
@@ -1948,7 +1950,32 @@ void CompileBroker::compiler_thread_loop() {
if (method()->number_of_breakpoints() == 0) {
// Compile the method.
if ((UseCompiler || AlwaysCompileLoopMethods) && CompileBroker::should_compile_new_jobs()) {
invoke_compiler_on_method(task);
// TODO: review usage of CompileThread_lock (DCEVM)
if (AllowEnhancedClassRedefinition) {
{
// go to native, since dcevm doit() is in a safepoint (_compilation_stopped == true)
ThreadToNativeFromVM ttn(thread);
MonitorLocker locker(DcevmCompilation_lock, Mutex::_no_safepoint_check_flag);
// stop all compilations if requested from redefinition
while (_compilation_stopped) {
locker.wait(20);
}
Atomic::add(&_active_compilations, 1);
}
if (ciObjectFactory::is_reinitialize_vm_klasses()) {
MutexLocker only_one(DcevmCompilationInit_lock, Mutex::_no_safepoint_check_flag);
if (ciObjectFactory::is_reinitialize_vm_klasses()) {
ciObjectFactory::reinitialize_vm_classes_dcevm();
}
}
invoke_compiler_on_method(task);
Atomic::sub(&_active_compilations, 1);
} else {
invoke_compiler_on_method(task);
}
thread->start_idle_timer();
} else {
// After compilation is disabled, remove remaining methods from queue
@@ -2304,8 +2331,16 @@ void CompileBroker::invoke_compiler_on_method(CompileTask* task) {
if (WhiteBoxAPI && WhiteBox::compilation_locked) {
whitebox_lock_compilation();
}
comp->compile_method(&ci_env, target, osr_bci, true, directive);
if (AllowEnhancedClassRedefinition) {
// Skip redefined methods
if (task->method()->is_old() || task->method()->method_holder()->new_version() != NULL) {
ci_env.record_method_not_compilable("redefined method", true);
} else {
comp->compile_method(&ci_env, target, osr_bci, true, directive);
}
} else {
comp->compile_method(&ci_env, target, osr_bci, true, directive);
}
/* Repeat compilation without installing code for profiling purposes */
int repeat_compilation_count = directive->RepeatCompilationOption;
while (repeat_compilation_count > 0) {
@@ -2314,6 +2349,7 @@ void CompileBroker::invoke_compiler_on_method(CompileTask* task) {
comp->compile_method(&ci_env, target, osr_bci, false, directive);
repeat_compilation_count--;
}
}
@@ -2891,3 +2927,30 @@ void CompileBroker::print_heapinfo(outputStream* out, const char* function, size
}
out->print_cr("\n__ CodeHeapStateAnalytics total duration %10.3f seconds _________\n", ts_total.seconds());
}
void CompileBroker::stopCompilationBeforeEnhancedRedefinition() {
// There are hard to fix C1/C2 race conditions with dcevm. The easiest solution
// is to stop compilation.
if (AllowEnhancedClassRedefinition) {
DcevmCompilation_lock->lock_without_safepoint_check();
_compilation_stopped = true;
while (_active_compilations > 0) {
DcevmCompilation_lock->wait_without_safepoint_check(10);
if (_active_compilations > 0) {
DcevmCompilation_lock->unlock(); // must unlock to run following VM op
VM_ForceSafepoint forceSafePoint; // force safepoint to avoid deadlock
VMThread::execute(&forceSafePoint);
DcevmCompilation_lock->lock_without_safepoint_check();
}
}
DcevmCompilation_lock->unlock();
}
}
void CompileBroker::releaseCompilationAfterEnhancedRedefinition() {
if (AllowEnhancedClassRedefinition) {
MonitorLocker locker(DcevmCompilation_lock, Mutex::_no_safepoint_check_flag);
_compilation_stopped = false;
locker.notify_all();
}
}

View File

@@ -200,6 +200,9 @@ class CompileBroker: AllStatic {
static volatile jint _osr_compilation_id;
static volatile jint _native_compilation_id;
static volatile bool _compilation_stopped;
static volatile jint _active_compilations;
static CompileQueue* _c2_compile_queue;
static CompileQueue* _c1_compile_queue;
@@ -449,6 +452,9 @@ public:
// CodeHeap State Analytics.
static void print_info(outputStream *out);
static void print_heapinfo(outputStream *out, const char* function, size_t granularity);
static void stopCompilationBeforeEnhancedRedefinition();
static void releaseCompilationAfterEnhancedRedefinition();
};
#endif // SHARE_COMPILER_COMPILEBROKER_HPP

View File

@@ -1933,6 +1933,24 @@ public:
}
};
class G1IterateObjectClosureTask : public WorkerTask {
private:
ObjectClosure* _cl;
G1CollectedHeap* _g1h;
G1HeapRegionClaimer _hrclaimer;
public:
G1IterateObjectClosureTask(ObjectClosure* cl, G1CollectedHeap* g1h) : WorkerTask("IterateObject Closure"),
_cl(cl), _g1h(g1h), _hrclaimer(g1h->workers()->active_workers()) { }
virtual void work(uint worker_id) {
Thread *thread = Thread::current();
HandleMark hm(thread); // make sure any handles created are deleted
ResourceMark rm(thread);
IterateObjectClosureRegionClosure blk(_cl);
_g1h->heap_region_par_iterate_from_worker_offset(&blk, &_hrclaimer, worker_id);
}
};
void G1CollectedHeap::object_iterate(ObjectClosure* cl) {
IterateObjectClosureRegionClosure blk(cl);
heap_region_iterate(&blk);

View File

@@ -160,6 +160,7 @@ class G1CollectedHeap : public CollectedHeap {
// Closures used in implementation.
friend class G1EvacuateRegionsTask;
friend class G1PLABAllocator;
friend class G1FullGCPrepareTask;
// Other related classes.
friend class G1HeapPrinterMark;

View File

@@ -355,14 +355,18 @@ void G1FullCollector::phase2_prepare_compaction() {
// Try to avoid OOM immediately after Full GC in case there are no free regions
// left after determining the result locations (i.e. this phase). Prepare to
// maximally compact the tail regions of the compaction queues serially.
if (scope()->do_maximal_compaction() || !has_free_compaction_targets) {
phase2c_prepare_serial_compaction();
if (!Universe::is_redefining_gc_run()) {
if (scope()->do_maximal_compaction() || !has_free_compaction_targets) {
phase2c_prepare_serial_compaction();
if (scope()->do_maximal_compaction() &&
has_humongous() &&
serial_compaction_point()->has_regions()) {
phase2d_prepare_humongous_compaction();
if (scope()->do_maximal_compaction() &&
has_humongous() &&
serial_compaction_point()->has_regions()) {
phase2d_prepare_humongous_compaction();
}
}
} else {
phase2c_prepare_serial_compaction_dcevm();
}
}
@@ -473,6 +477,27 @@ void G1FullCollector::phase2d_prepare_humongous_compaction() {
}
}
void G1FullCollector::phase2c_prepare_serial_compaction_dcevm() {
GCTraceTime(Debug, gc, phases) debug("Phase 2: Prepare Serial Compaction", scope()->timer());
for (uint i = 0; i < workers(); i++) {
G1FullGCCompactionPoint* cp = compaction_point(i);
// collect remaining, not forwarded rescued oops using serial compact point
while (cp->last_rescued_oop() < cp->rescued_oops()->length()) {
G1HeapRegion* hr = G1CollectedHeap::heap()->new_region(G1HeapRegion::GrainBytes / HeapWordSize, G1HeapRegionType::Eden, true, G1NUMA::AnyNodeIndex);
if (hr == nullptr) {
vm_exit_out_of_memory(0, OOM_MMAP_ERROR, "G1 - not enough of free regions after redefinition.");
}
set_compaction_top(hr, hr->bottom());
cp->add(hr);
cp->forward_rescued();
cp->update();
}
}
}
void G1FullCollector::phase3_adjust_pointers() {
// Adjust the pointers to reflect the new locations
GCTraceTime(Info, gc, phases) info("Phase 3: Adjust pointers", scope()->timer());
@@ -488,8 +513,12 @@ void G1FullCollector::phase4_do_compaction() {
run_task(&task);
// Serial compact to avoid OOM when very few free regions.
if (serial_compaction_point()->has_regions()) {
task.serial_compaction();
if (!Universe::is_redefining_gc_run()) {
if (serial_compaction_point()->has_regions()) {
task.serial_compaction();
}
} else {
task.serial_compaction_dcevm();
}
if (!_humongous_compaction_regions.is_empty()) {

View File

@@ -160,6 +160,7 @@ private:
bool phase2b_forward_oops();
void phase2c_prepare_serial_compaction();
void phase2d_prepare_humongous_compaction();
void phase2c_prepare_serial_compaction_dcevm();
void phase3_adjust_pointers();
void phase4_do_compaction();

View File

@@ -30,6 +30,7 @@
#include "gc/g1/g1HeapRegion.inline.hpp"
#include "gc/shared/fullGCForwarding.inline.hpp"
#include "gc/shared/gcTraceTime.inline.hpp"
#include "gc/shared/dcevmSharedGC.hpp"
#include "logging/log.hpp"
#include "oops/oop.inline.hpp"
#include "utilities/ticks.hpp"
@@ -88,10 +89,28 @@ void G1FullGCCompactTask::compact_region(G1HeapRegion* hr) {
void G1FullGCCompactTask::work(uint worker_id) {
Ticks start = Ticks::now();
GrowableArray<G1HeapRegion*>* compaction_queue = collector()->compaction_point(worker_id)->regions();
for (GrowableArrayIterator<G1HeapRegion*> it = compaction_queue->begin();
it != compaction_queue->end();
++it) {
compact_region(*it);
if (!Universe::is_redefining_gc_run()) {
GrowableArray<G1HeapRegion*>* compaction_queue = collector()->compaction_point(worker_id)->regions();
for (GrowableArrayIterator<G1HeapRegion*> it = compaction_queue->begin();
it != compaction_queue->end();
++it) {
compact_region(*it);
}
} else {
GrowableArrayIterator<HeapWord*> rescue_oops_it = collector()->compaction_point(worker_id)->rescued_oops()->begin();
GrowableArray<HeapWord*>* rescued_oops_values = collector()->compaction_point(worker_id)->rescued_oops_values();
for (GrowableArrayIterator<G1HeapRegion*> it = compaction_queue->begin();
it != compaction_queue->end();
++it) {
compact_region_dcevm(*it, rescued_oops_values, &rescue_oops_it);
}
assert(rescue_oops_it.at_end(), "Must be at end");
G1FullGCCompactionPoint* cp = collector()->compaction_point(worker_id);
if (cp->last_rescued_oop() > 0) {
DcevmSharedGC::copy_rescued_objects_back(rescued_oops_values, 0, cp->last_rescued_oop(), false);
}
}
}
@@ -150,3 +169,77 @@ void G1FullGCCompactTask::free_non_overlapping_regions(uint src_start_idx, uint
_g1h->free_humongous_region(hr, nullptr);
}
}
void G1FullGCCompactTask::compact_region_dcevm(G1HeapRegion* hr, GrowableArray<HeapWord*>* rescued_oops_values,
GrowableArrayIterator<HeapWord*>* rescue_oops_it) {
assert(!hr->is_humongous(), "Should be no humongous regions in compaction queue");
ResourceMark rm; //
if (!collector()->is_free(hr->hrm_index())) {
// The compaction closure not only copies the object to the new
// location, but also clears the bitmap for it. This is needed
// for bitmap verification and to be able to use the bitmap
// for evacuation failures in the next young collection. Testing
// showed that it was better overall to clear bit by bit, compared
// to clearing the whole region at the end. This difference was
// clearly seen for regions with few marks.
G1CompactRegionClosureDcevm compact(collector()->mark_bitmap(), rescued_oops_values, rescue_oops_it);
hr->apply_to_marked_objects(collector()->mark_bitmap(), &compact);
}
hr->reset_compacted_after_full_gc(_collector->compaction_top(hr));
}
void G1FullGCCompactTask::serial_compaction_dcevm() {
GCTraceTime(Debug, gc, phases) tm("Phase 4: Serial Compaction", collector()->scope()->timer());
// Clear allocated resources at compact points now, since all rescued oops are copied to destination.
for (uint i = 0; i < collector()->workers(); i++) {
G1FullGCCompactionPoint* cp = collector()->compaction_point(i);
DcevmSharedGC::clear_rescued_objects_heap(cp->rescued_oops_values());
}
}
void G1FullGCCompactTask::G1CompactRegionClosureDcevm::clear_in_bitmap(oop obj) {
assert(_bitmap->is_marked(obj), "Should only compact marked objects");
_bitmap->clear(obj);
}
size_t G1FullGCCompactTask::G1CompactRegionClosureDcevm::apply(oop obj) {
size_t size = obj->size();
if (obj->is_forwarded()) {
HeapWord* destination = cast_from_oop<HeapWord*>(FullGCForwarding::forwardee(obj));
// copy object and reinit its mark
HeapWord *obj_addr = cast_from_oop<HeapWord *>(obj);
if (!_rescue_oops_it->at_end() && **_rescue_oops_it == obj_addr) {
++(*_rescue_oops_it);
HeapWord *rescued_obj = NEW_C_HEAP_ARRAY(HeapWord, size, mtInternal);
Copy::aligned_disjoint_words(obj_addr, rescued_obj, size);
_rescued_oops_values->append(rescued_obj);
debug_only(Copy::fill_to_words(obj_addr, size, 0));
return size;
}
if (obj->klass()->new_version() != nullptr) {
Klass *new_version = obj->klass()->new_version();
if (new_version->update_information() == nullptr) {
Copy::aligned_conjoint_words(obj_addr, destination, size);
cast_to_oop(destination)->set_klass(new_version);
} else {
DcevmSharedGC::update_fields(obj, cast_to_oop(destination));
}
cast_to_oop(destination)->init_mark();
assert(cast_to_oop(destination)->klass() != nullptr, "should have a class");
return size;
}
Copy::aligned_conjoint_words(obj_addr, destination, size);
cast_to_oop(destination)->init_mark();
assert(cast_to_oop(destination)->klass() != nullptr, "should have a class");
}
clear_in_bitmap(obj);
return size;
}

View File

@@ -45,6 +45,8 @@ class G1FullGCCompactTask : public G1FullGCTask {
void free_non_overlapping_regions(uint src_start_idx, uint dest_start_idx, uint num_regions);
static void copy_object_to_new_location(oop obj);
void compact_region_dcevm(G1HeapRegion* hr, GrowableArray<HeapWord*>* rescued_oops_values,
GrowableArrayIterator<HeapWord*>* rescue_oops_it);
public:
G1FullGCCompactTask(G1FullCollector* collector) :
@@ -56,6 +58,7 @@ public:
void work(uint worker_id);
void serial_compaction();
void humongous_compaction();
void serial_compaction_dcevm();
class G1CompactRegionClosure : public StackObj {
G1CMBitMap* _bitmap;
@@ -64,6 +67,22 @@ public:
G1CompactRegionClosure(G1CMBitMap* bitmap) : _bitmap(bitmap) { }
size_t apply(oop object);
};
class G1CompactRegionClosureDcevm : public StackObj {
G1CMBitMap* _bitmap;
GrowableArray<HeapWord*>* _rescued_oops_values;
GrowableArrayIterator<HeapWord*>* _rescue_oops_it;
void clear_in_bitmap(oop object);
public:
G1CompactRegionClosureDcevm(G1CMBitMap* bitmap,
GrowableArray<HeapWord*>* rescued_oops_values,
GrowableArrayIterator<HeapWord*>* rescue_oops_it) :
_bitmap(bitmap),
_rescued_oops_values(rescued_oops_values),
_rescue_oops_it(rescue_oops_it)
{ }
size_t apply(oop object);
};
};
#endif // SHARE_GC_G1_G1FULLGCCOMPACTTASK_HPP

View File

@@ -34,13 +34,18 @@ G1FullGCCompactionPoint::G1FullGCCompactionPoint(G1FullCollector* collector, Pre
_collector(collector),
_current_region(nullptr),
_compaction_top(nullptr),
_preserved_stack(preserved_stack) {
_preserved_stack(preserved_stack),
_last_rescued_oop(0) {
_compaction_regions = new (mtGC) GrowableArray<G1HeapRegion*>(32, mtGC);
_compaction_region_iterator = _compaction_regions->begin();
_rescued_oops = new (mtGC) GrowableArray<HeapWord*>(128, mtGC);
_rescued_oops_values = new (mtGC) GrowableArray<HeapWord*>(128, mtGC);
}
G1FullGCCompactionPoint::~G1FullGCCompactionPoint() {
delete _compaction_regions;
delete _rescued_oops;
delete _rescued_oops_values;
}
void G1FullGCCompactionPoint::update() {
@@ -80,6 +85,14 @@ GrowableArray<G1HeapRegion*>* G1FullGCCompactionPoint::regions() {
return _compaction_regions;
}
GrowableArray<HeapWord*>* G1FullGCCompactionPoint::rescued_oops() {
return _rescued_oops;
}
GrowableArray<HeapWord*>* G1FullGCCompactionPoint::rescued_oops_values() {
return _rescued_oops_values;
}
bool G1FullGCCompactionPoint::object_will_fit(size_t size) {
size_t space_left = pointer_delta(_current_region->end(), _compaction_top);
return size <= space_left;
@@ -216,3 +229,62 @@ uint G1FullGCCompactionPoint::find_contiguous_before(G1HeapRegion* hr, uint num_
// Return the index of the first region in the range of contiguous regions.
return range_end - contiguous_region_count;
}
HeapWord* G1FullGCCompactionPoint::forward_compact_top(size_t size) {
assert(_current_region != NULL, "Must have been initialized");
// Ensure the object fit in the current region.
while (!object_will_fit(size)) {
if (!_compaction_region_iterator.has_next()) {
return NULL;
}
switch_region();
}
return _compaction_top;
}
void G1FullGCCompactionPoint::forward_dcevm(oop object, size_t size, bool force_forward) {
assert(_current_region != NULL, "Must have been initialized");
// Ensure the object fit in the current region.
while (!object_will_fit(size)) {
switch_region();
}
// Store a forwarding pointer if the object should be moved.
if (cast_from_oop<HeapWord*>(object) != _compaction_top || force_forward) {
if (!object->is_forwarded()) {
preserved_stack()->push_if_necessary(object, object->mark());
}
FullGCForwarding::forward_to(object, cast_to_oop(_compaction_top));
assert(FullGCForwarding::is_forwarded(object), "must be forwarded");
} else {
assert(!FullGCForwarding::is_forwarded(object), "must not be forwarded");
}
// Update compaction values.
_compaction_top += size;
_current_region->update_bot_for_block(_compaction_top - size, _compaction_top);
}
void G1FullGCCompactionPoint::forward_rescued() {
int i;
i = _last_rescued_oop;
for (;i<rescued_oops()->length(); i++) {
HeapWord* q = rescued_oops()->at(i);
size_t size = cast_to_oop(q)->size();
// (DCEVM) There is a new version of the class of q => different size
if (cast_to_oop(q)->klass()->new_version() != nullptr) {
// assert(size != new_size, "instances without changed size have to be updated prior to GC run");
size = cast_to_oop(q)->size_given_klass(cast_to_oop(q)->klass()->new_version());
}
if (forward_compact_top(size) == nullptr) {
break;
}
forward_dcevm(cast_to_oop(q), size, true);
}
_last_rescued_oop = i;
}

View File

@@ -41,6 +41,9 @@ class G1FullGCCompactionPoint : public CHeapObj<mtGC> {
PreservedMarks* _preserved_stack;
GrowableArray<G1HeapRegion*>* _compaction_regions;
GrowableArrayIterator<G1HeapRegion*> _compaction_region_iterator;
GrowableArray<HeapWord*>* _rescued_oops;
GrowableArray<HeapWord*>* _rescued_oops_values;
int _last_rescued_oop;
bool object_will_fit(size_t size);
void initialize_values();
@@ -60,6 +63,8 @@ public:
void forward_humongous(G1HeapRegion* hr);
void add(G1HeapRegion* hr);
void add_humongous(G1HeapRegion* hr);
HeapWord* forward_compact_top(size_t size);
void forward_dcevm(oop object, size_t size, bool force_forward);
void remove_at_or_above(uint bottom);
G1HeapRegion* current_region();
@@ -75,6 +80,12 @@ public:
assert(_preserved_stack == nullptr, "only initialize once");
_preserved_stack = preserved_stack;
}
GrowableArray<HeapWord*>* rescued_oops();
GrowableArray<HeapWord*>* rescued_oops_values();
void forward_rescued();
int last_rescued_oop() { return _last_rescued_oop; }
};
#endif // SHARE_GC_G1_G1FULLGCCOMPACTIONPOINT_HPP

View File

@@ -45,6 +45,7 @@ G1DetermineCompactionQueueClosure::G1DetermineCompactionQueueClosure(G1FullColle
bool G1FullGCPrepareTask::G1CalculatePointersClosure::do_heap_region(G1HeapRegion* hr) {
uint region_idx = hr->hrm_index();
assert(_collector->is_compaction_target(region_idx), "must be");
hr->set_processing_order(_region_processing_order++);
assert(!hr->is_humongous(), "must be");
@@ -82,6 +83,9 @@ void G1FullGCPrepareTask::work(uint worker_id) {
++it) {
closure.do_heap_region(*it);
}
if (Universe::is_redefining_gc_run()) {
compaction_point->forward_rescued();
}
compaction_point->update();
// Determine if there are any unused compaction targets. This is only the case if
// there are
@@ -100,7 +104,8 @@ G1FullGCPrepareTask::G1CalculatePointersClosure::G1CalculatePointersClosure(G1Fu
_g1h(G1CollectedHeap::heap()),
_collector(collector),
_bitmap(collector->mark_bitmap()),
_cp(cp) { }
_cp(cp),
_region_processing_order(0) { }
G1FullGCPrepareTask::G1PrepareCompactLiveClosure::G1PrepareCompactLiveClosure(G1FullGCCompactionPoint* cp) :
@@ -114,7 +119,61 @@ size_t G1FullGCPrepareTask::G1PrepareCompactLiveClosure::apply(oop object) {
void G1FullGCPrepareTask::G1CalculatePointersClosure::prepare_for_compaction(G1HeapRegion* hr) {
if (!_collector->is_free(hr->hrm_index())) {
G1PrepareCompactLiveClosure prepare_compact(_cp);
hr->apply_to_marked_objects(_bitmap, &prepare_compact);
if (!Universe::is_redefining_gc_run()) {
G1PrepareCompactLiveClosure prepare_compact(_cp);
hr->apply_to_marked_objects(_bitmap, &prepare_compact);
} else {
G1PrepareCompactLiveClosureDcevm prepare_compact(_cp, hr->processing_order());
hr->apply_to_marked_objects(_bitmap, &prepare_compact);
}
}
}
G1FullGCPrepareTask::G1PrepareCompactLiveClosureDcevm::G1PrepareCompactLiveClosureDcevm(G1FullGCCompactionPoint* cp,
uint region_processing_order) :
_cp(cp),
_region_processing_order(region_processing_order) { }
size_t G1FullGCPrepareTask::G1PrepareCompactLiveClosureDcevm::apply(oop object) {
size_t size = object->size();
size_t forward_size = size;
// (DCEVM) There is a new version of the class of q => different size
if (object->klass()->new_version() != nullptr) {
forward_size = object->size_given_klass(object->klass()->new_version());
}
HeapWord* compact_top = _cp->forward_compact_top(forward_size);
if (compact_top == nullptr || must_rescue(object, cast_to_oop(compact_top))) {
_cp->rescued_oops()->append(cast_from_oop<HeapWord*>(object));
} else {
_cp->forward_dcevm(object, forward_size, (size != forward_size));
}
return size;
}
bool G1FullGCPrepareTask::G1PrepareCompactLiveClosureDcevm::must_rescue(oop old_obj, oop new_obj) {
// Only redefined objects can have the need to be rescued.
if (old_obj->klass()->new_version() == nullptr) {
return false;
}
if (_region_processing_order > _cp->current_region()->processing_order()) {
return false;
}
if (_region_processing_order < _cp->current_region()->processing_order()) {
return true;
}
// old obj and new obj are within same region
size_t new_size = old_obj->size_given_klass(oop(old_obj)->klass()->new_version());
size_t original_size = old_obj->size();
// what if old_obj > new_obj ?
bool overlap = (cast_from_oop<HeapWord*>(old_obj) + original_size < cast_from_oop<HeapWord*>(new_obj) + new_size);
return overlap;
}

View File

@@ -79,6 +79,7 @@ private:
G1FullCollector* _collector;
G1CMBitMap* _bitmap;
G1FullGCCompactionPoint* _cp;
uint _region_processing_order;
void prepare_for_compaction(G1HeapRegion* hr);
@@ -96,6 +97,16 @@ private:
G1PrepareCompactLiveClosure(G1FullGCCompactionPoint* cp);
size_t apply(oop object);
};
class G1PrepareCompactLiveClosureDcevm : public StackObj {
G1FullGCCompactionPoint* _cp;
uint _region_processing_order;
bool must_rescue(oop old_obj, oop new_obj);
public:
G1PrepareCompactLiveClosureDcevm(G1FullGCCompactionPoint* cp, uint region_processing_order);
size_t apply(oop object);
};
};
// Closure to re-prepare objects in the serial compaction point queue regions for

View File

@@ -46,6 +46,9 @@ inline bool G1DetermineCompactionQueueClosure::should_compact(G1HeapRegion* hr)
if (hr->is_humongous() || hr->has_pinned_objects()) {
return false;
}
if (Universe::is_redefining_gc_run()) {
return true;
}
size_t live_words = _collector->live_words(hr->hrm_index());
size_t live_words_threshold = _collector->scope()->region_compaction_threshold();
// High live ratio region will not be compacted.

View File

@@ -199,6 +199,8 @@ private:
// The remembered set for this region.
G1HeapRegionRemSet* _rem_set;
uint _processing_order;
// Cached index of this region in the heap region sequence.
const uint _hrm_index;
@@ -432,6 +434,14 @@ public:
return _rem_set;
}
uint processing_order() {
return _processing_order;
}
void set_processing_order(uint processing_order) {
_processing_order = processing_order;
}
inline bool in_collection_set() const;
void prepare_remset_for_scan();

View File

@@ -70,6 +70,7 @@
#include "utilities/copy.hpp"
#include "utilities/events.hpp"
#include "utilities/stack.inline.hpp"
#include "gc/shared/dcevmSharedGC.hpp"
#if INCLUDE_JVMCI
#include "jvmci/jvmci.hpp"
#endif
@@ -104,7 +105,11 @@ public:
DeadSpacer(ContiguousSpace* space) : _allowed_deadspace_words(0), _space(space) {
size_t ratio = (_space == SerialHeap::heap()->old_gen()->space())
? MarkSweepDeadRatio : 0;
_active = ratio > 0;
if (!Universe::is_redefining_gc_run()) {
_active = ratio > 0;
} else {
_active = false; // dead spacer is not active in DCEVM
}
if (_active) {
// We allow some amount of garbage towards the bottom of the space, so
@@ -173,6 +178,11 @@ class Compacter {
// Used for BOT update
TenuredGeneration* _old_gen;
// (DCEVM)
GrowableArray<HeapWord*>* _rescued_oops;
GrowableArray<HeapWord*>* _rescued_oops_values;
GrowableArrayIterator<HeapWord*> _rescue_oops_it;
HeapWord* get_compaction_top(uint index) const {
return _spaces[index]._compaction_top;
}
@@ -238,6 +248,12 @@ class Compacter {
}
}
static void forward_obj_dcevm(oop obj, HeapWord* new_addr) {
// always forward in dcevm
prefetch_write_scan(obj);
FullGCForwarding::forward_to(obj, cast_to_oop(new_addr));
}
static HeapWord* find_next_live_addr(HeapWord* start, HeapWord* end) {
for (HeapWord* i_addr = start; i_addr < end; /* empty */) {
prefetch_read_scan(i_addr);
@@ -267,6 +283,45 @@ class Compacter {
return obj_size;
}
size_t relocate_dcevm(HeapWord* addr) {
// Prefetch source and destination
prefetch_read_scan(addr);
oop obj = cast_to_oop(addr);
size_t obj_size = obj->size();
if (!_rescue_oops_it.at_end() && *_rescue_oops_it == addr) {
++_rescue_oops_it;
HeapWord *rescued_obj = NEW_C_HEAP_ARRAY(HeapWord, obj_size, mtInternal);
Copy::aligned_disjoint_words(addr, rescued_obj, obj_size);
_rescued_oops_values->append(rescued_obj);
debug_only(Copy::fill_to_words(addr, obj_size, 0));
return obj_size;
}
oop new_obj = FullGCForwarding::forwardee(obj);
HeapWord* new_addr = cast_from_oop<HeapWord*>(new_obj);
// assert(addr != new_addr, "inv");
prefetch_write_copy(new_addr);
if (obj->klass()->new_version() != nullptr) {
Klass *new_version = obj->klass()->new_version();
if (new_version->update_information() == nullptr) {
Copy::aligned_conjoint_words(addr, new_addr, obj_size);
cast_to_oop(new_addr)->set_klass(new_version);
} else {
DcevmSharedGC::update_fields(obj, cast_to_oop(new_addr));
}
cast_to_oop(new_addr)->init_mark();
assert(cast_to_oop(new_addr)->klass() != nullptr, "should have a class");
return obj_size;
}
Copy::aligned_conjoint_words(addr, new_addr, obj_size);
new_obj->init_mark();
return obj_size;
}
public:
explicit Compacter(SerialHeap* heap) {
// In this order so that heap is compacted towards old-gen.
@@ -283,9 +338,25 @@ public:
}
_index = 0;
_old_gen = heap->old_gen();
_rescued_oops = nullptr;
_rescued_oops_values = nullptr;
}
~Compacter() {
if (_rescued_oops != nullptr) {
delete _rescued_oops;
delete _rescued_oops_values;
}
}
void phase2_calculate_new_addr() {
bool redefinition_run = Universe::is_redefining_gc_run();
if (redefinition_run) {
_rescued_oops = new (mtGC) GrowableArray<HeapWord*>(128, mtGC);
_rescued_oops_values = new (mtGC) GrowableArray<HeapWord*>(128, mtGC);
}
for (uint i = 0; i < _num_spaces; ++i) {
ContiguousSpace* space = get_space(i);
HeapWord* cur_addr = space->bottom();
@@ -299,9 +370,24 @@ public:
oop obj = cast_to_oop(cur_addr);
size_t obj_size = obj->size();
if (obj->is_gc_marked()) {
HeapWord* new_addr = alloc(obj_size);
forward_obj(obj, new_addr);
cur_addr += obj_size;
if (redefinition_run) {
size_t forward_size = obj_size;
if (obj->klass()->new_version() != nullptr) {
forward_size = obj->size_given_klass(obj->klass()->new_version());
}
if (must_rescue(obj, cast_to_oop(get_compaction_top(_index)))) {
_rescued_oops->append(cast_from_oop<HeapWord *>(obj));
cur_addr += obj_size;
continue;
}
HeapWord *new_addr = alloc(forward_size);
forward_obj_dcevm(obj, new_addr);
cur_addr += obj_size;
} else {
HeapWord *new_addr = alloc(obj_size);
forward_obj(obj, new_addr);
cur_addr += obj_size;
}
} else {
// Skipping the current known-unmarked obj
HeapWord* next_live_addr = find_next_live_addr(cur_addr + obj_size, top);
@@ -323,6 +409,10 @@ public:
record_first_dead(i, top);
}
}
if (redefinition_run) {
forward_rescued();
}
}
void phase3_adjust_pointers() {
@@ -346,6 +436,12 @@ public:
}
void phase4_compact() {
bool redefinition_run = Universe::is_redefining_gc_run();
if (redefinition_run) {
_rescue_oops_it = _rescued_oops->begin();
}
for (uint i = 0; i < _num_spaces; ++i) {
ContiguousSpace* space = get_space(i);
HeapWord* cur_addr = space->bottom();
@@ -362,7 +458,11 @@ public:
cur_addr = *(HeapWord**) cur_addr;
continue;
}
cur_addr += relocate(cur_addr);
if (redefinition_run) {
cur_addr += relocate_dcevm(cur_addr);
} else {
cur_addr += relocate(cur_addr);
}
}
// Reset top and unused memory
@@ -372,6 +472,60 @@ public:
space->mangle_unused_area(MemRegion(new_top, top));
}
}
if (redefinition_run) {
DcevmSharedGC::copy_rescued_objects_back(_rescued_oops_values, false);
DcevmSharedGC::clear_rescued_objects_heap(_rescued_oops_values);
}
}
bool must_rescue(oop old_obj, oop new_obj) {
// Only redefined objects can have the need to be rescued.
if (oop(old_obj)->klass()->new_version() == nullptr) return false;
size_t new_size = old_obj->size_given_klass(oop(old_obj)->klass()->new_version());
size_t original_size = old_obj->size();
uint old_index = -1u;
uint new_index = -1u;
for (uint i=0; i<_num_spaces; i++) {
if (old_index == -1u && _spaces[i]._space->is_in_reserved(old_obj)) {
old_index = i;
}
if (new_index == -1u && _spaces[i]._space->is_in_reserved(new_obj)) {
new_index = i;
}
}
if (old_index == new_index) {
// Rescue if object may overlap with a higher memory address.
bool overlap = (cast_from_oop<HeapWord*>(old_obj) + original_size < cast_from_oop<HeapWord*>(new_obj) + new_size);
return overlap;
} else {
if (old_index == 0) {
// Must always rescue when moving from the old into the new generation.
return false;
} else {
// Must never rescue when moving from the new into the old generation.
return true;
}
}
}
void forward_rescued() {
for (int i=0; i<_rescued_oops->length(); i++) {
oop obj = cast_to_oop(_rescued_oops->at(i));
size_t obj_size = obj->size();
size_t forward_size = obj_size;
if (obj->klass()->new_version() != nullptr) {
forward_size = obj->size_given_klass(obj->klass()->new_version());
}
HeapWord *new_addr = alloc(forward_size);
forward_obj_dcevm(obj, new_addr);
}
}
};

View File

@@ -0,0 +1,154 @@
/*
* Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#include "gc/shared/dcevmSharedGC.hpp"
#include "oops/compressedOops.inline.hpp"
#include "oops/instanceKlass.inline.hpp"
#include "gc/shared/fullGCForwarding.inline.hpp"
#include "utilities/copy.hpp"
void DcevmSharedGC::copy_rescued_objects_back(GrowableArray<HeapWord*>* rescued_oops, bool must_be_new) {
if (rescued_oops != nullptr) {
copy_rescued_objects_back(rescued_oops, 0, rescued_oops->length(), must_be_new);
}
}
// (DCEVM) Copy the rescued objects to their destination address after compaction.
void DcevmSharedGC::copy_rescued_objects_back(GrowableArray<HeapWord*>* rescued_oops, int from, int to, bool must_be_new) {
if (rescued_oops != nullptr) {
ResourceMark rm;
for (int i=from; i < to; i++) {
HeapWord* rescued_ptr = rescued_oops->at(i);
oop rescued_obj = cast_to_oop(rescued_ptr);
size_t size = rescued_obj->size();
oop new_obj = FullGCForwarding::forwardee(rescued_obj);
assert(!must_be_new || rescued_obj->klass()->new_version() != nullptr, "Just checking");
Klass* new_klass = rescued_obj->klass()->new_version();
if (new_klass!= nullptr) {
if (new_klass->update_information() != nullptr) {
DcevmSharedGC::update_fields(rescued_obj, new_obj);
} else {
rescued_obj->set_klass(new_klass);
Copy::aligned_disjoint_words(cast_from_oop<HeapWord*>(rescued_obj), cast_from_oop<HeapWord*>(new_obj), size);
}
} else {
Copy::aligned_disjoint_words(cast_from_oop<HeapWord*>(rescued_obj), cast_from_oop<HeapWord*>(new_obj), size);
}
new_obj->init_mark();
assert(oopDesc::is_oop(new_obj), "must be a valid oop");
}
}
}
void DcevmSharedGC::clear_rescued_objects_resource(GrowableArray<HeapWord*>* rescued_oops) {
if (rescued_oops != nullptr) {
for (int i=0; i < rescued_oops->length(); i++) {
HeapWord* rescued_ptr = rescued_oops->at(i);
size_t size = cast_to_oop(rescued_ptr)->size();
FREE_RESOURCE_ARRAY(HeapWord, rescued_ptr, size);
}
rescued_oops->clear();
}
}
void DcevmSharedGC::clear_rescued_objects_heap(GrowableArray<HeapWord*>* rescued_oops) {
if (rescued_oops != nullptr) {
for (int i=0; i < rescued_oops->length(); i++) {
HeapWord* rescued_ptr = rescued_oops->at(i);
FREE_C_HEAP_ARRAY(HeapWord, rescued_ptr);
}
rescued_oops->clear();
}
}
// (DCEVM) Update instances of a class whose fields changed.
void DcevmSharedGC::update_fields(oop q, oop new_location) {
assert(q->klass()->new_version() != nullptr, "class of old object must have new version");
Klass* old_klass_oop = q->klass();
Klass* new_klass_oop = q->klass()->new_version();
InstanceKlass *old_klass = InstanceKlass::cast(old_klass_oop);
InstanceKlass *new_klass = InstanceKlass::cast(new_klass_oop);
size_t size = q->size_given_klass(old_klass);
size_t new_size = q->size_given_klass(new_klass);
HeapWord* tmp = nullptr;
oop tmp_obj = q;
// Save object somewhere, there is an overlap in fields
if (new_klass_oop->is_copying_backwards()) {
if ((cast_from_oop<HeapWord*>(q) >= cast_from_oop<HeapWord*>(new_location) && cast_from_oop<HeapWord*>(q) < cast_from_oop<HeapWord*>(new_location) + new_size) ||
(cast_from_oop<HeapWord*>(new_location) >= cast_from_oop<HeapWord*>(q) && cast_from_oop<HeapWord*>(new_location) < cast_from_oop<HeapWord*>(q) + size)) {
tmp = NEW_RESOURCE_ARRAY(HeapWord, size);
q = cast_to_oop(tmp);
Copy::aligned_disjoint_words(cast_from_oop<HeapWord*>(tmp_obj), cast_from_oop<HeapWord*>(q), size);
}
}
q->set_klass(new_klass_oop);
int *cur = new_klass_oop->update_information();
assert(cur != nullptr, "just checking");
DcevmSharedGC::update_fields(new_location, q, cur);
if (tmp != nullptr) {
FREE_RESOURCE_ARRAY(HeapWord, tmp, size);
}
}
void DcevmSharedGC::update_fields(oop new_location, oop tmp_obj, int *cur) {
assert(cur != nullptr, "just checking");
char* to = (char*)cast_from_oop<HeapWord*>(new_location);
while (*cur != 0) {
int size = *cur;
if (size > 0) {
cur++;
int offset = *cur;
HeapWord* from = (HeapWord*)(((char *)cast_from_oop<HeapWord*>(tmp_obj)) + offset);
if (size == HeapWordSize) {
*((HeapWord*)to) = *from;
} else if (size == HeapWordSize * 2) {
*((HeapWord*)to) = *from;
*(((HeapWord*)to) + 1) = *(from + 1);
} else {
Copy::conjoint_jbytes(from, to, size);
}
to += size;
cur++;
} else {
assert(size < 0, "");
int skip = -*cur;
Copy::fill_to_bytes(to, skip, 0);
to += skip;
cur++;
}
}
}

View File

@@ -0,0 +1,48 @@
/*
* Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#ifndef SHARE_GC_DCEVM_SHARED_GC_HPP
#define SHARE_GC_DCEVM_SHARED_GC_HPP
#include "gc/shared/collectedHeap.hpp"
#include "gc/shared/taskqueue.hpp"
#include "memory/iterator.hpp"
#include "oops/markWord.hpp"
#include "oops/oop.hpp"
#include "runtime/timer.hpp"
#include "utilities/growableArray.hpp"
#include "utilities/stack.hpp"
// Shared GC code used from different GC (Serial, CMS, G1) on enhanced redefinition
class DcevmSharedGC : AllStatic {
public:
static void copy_rescued_objects_back(GrowableArray<HeapWord*>* rescued_oops, bool must_be_new);
static void copy_rescued_objects_back(GrowableArray<HeapWord*>* rescued_oops, int from, int to, bool must_be_new);
static void clear_rescued_objects_resource(GrowableArray<HeapWord*>* rescued_oops);
static void clear_rescued_objects_heap(GrowableArray<HeapWord*>* rescued_oops);
static void update_fields(oop q, oop new_location);
static void update_fields(oop new_location, oop tmp_obj, int *cur);
};
#endif

View File

@@ -95,7 +95,10 @@ void GCConfig::fail_if_non_included_gc_is_selected() {
}
void GCConfig::select_gc_ergonomically() {
if (os::is_server_class_machine()) {
if (AllowEnhancedClassRedefinition && !UseSerialGC) {
// (DCEVM) use G1 as default GC in Enhanced class redefinition
FLAG_SET_ERGO(UseG1GC, true);
} else if (os::is_server_class_machine()) {
#if INCLUDE_G1GC
FLAG_SET_ERGO_IF_DEFAULT(UseG1GC, true);
#elif INCLUDE_PARALLELGC

View File

@@ -1003,44 +1003,37 @@ bool ZPartition::prime(ZWorkers* workers, size_t size) {
return true;
}
ZArray<ZVirtualMemory> vmems;
// Claim virtual memory
const size_t claimed_size = claim_virtual(size, &vmems);
// The partition must have size available in virtual memory when priming.
assert(claimed_size == size, "must succeed %zx == %zx", claimed_size, size);
const ZVirtualMemory vmem = claim_virtual(size);
// Increase capacity
increase_capacity(claimed_size);
increase_capacity(size);
for (ZVirtualMemory vmem : vmems) {
// Claim the backing physical memory
claim_physical(vmem);
// Claim the backing physical memory
claim_physical(vmem);
// Commit the claimed physical memory
const size_t committed = commit_physical(vmem);
// Commit the claimed physical memory
const size_t committed = commit_physical(vmem);
if (committed != vmem.size()) {
// This is a failure state. We do not cleanup the maybe partially committed memory.
return false;
}
map_virtual(vmem);
check_numa_mismatch(vmem, _numa_id);
if (AlwaysPreTouch) {
// Pre-touch memory
ZPreTouchTask task(vmem.start(), vmem.end());
workers->run_all(&task);
}
// We don't have to take a lock here as no other threads will access the cache
// until we're finished
_cache.insert(vmem);
if (committed != vmem.size()) {
// This is a failure state. We do not cleanup the maybe partially committed memory.
return false;
}
map_virtual(vmem);
check_numa_mismatch(vmem, _numa_id);
if (AlwaysPreTouch) {
// Pre-touch memory
ZPreTouchTask task(vmem.start(), vmem.end());
workers->run_all(&task);
}
// We don't have to take a lock here as no other threads will access the cache
// until we're finished
_cache.insert(vmem);
return true;
}

View File

@@ -369,7 +369,7 @@ Bytecodes::Code Bytecodes::code_at(Method* method, int bci) {
Bytecodes::Code Bytecodes::non_breakpoint_code_at(const Method* method, address bcp) {
assert(method != nullptr, "must have the method for breakpoint conversion");
assert(method->contains(bcp), "must be valid bcp in method");
return method->orig_bytecode_at(method->bci_from(bcp));
return method->orig_bytecode_at(method->bci_from(bcp), false);
}
int Bytecodes::special_length_at(Bytecodes::Code code, address bcp, address end) {

View File

@@ -777,7 +777,7 @@ JRT_END
// Invokes
JRT_ENTRY(Bytecodes::Code, InterpreterRuntime::get_original_bytecode_at(JavaThread* current, Method* method, address bcp))
return method->orig_bytecode_at(method->bci_from(bcp));
return method->orig_bytecode_at(method->bci_from(bcp), false);
JRT_END
JRT_ENTRY(void, InterpreterRuntime::set_original_bytecode_at(JavaThread* current, Method* method, address bcp, Bytecodes::Code new_code))

View File

@@ -158,14 +158,14 @@ void CallInfo::set_common(Klass* resolved_klass,
}
// utility query for unreflecting a method
CallInfo::CallInfo(Method* resolved_method, Klass* resolved_klass, TRAPS) {
CallInfo::CallInfo(Method* resolved_method, Klass* resolved_klass, Thread* thread) {
Klass* resolved_method_holder = resolved_method->method_holder();
if (resolved_klass == nullptr) { // 2nd argument defaults to holder of 1st
resolved_klass = resolved_method_holder;
}
_resolved_klass = resolved_klass;
_resolved_method = methodHandle(THREAD, resolved_method);
_selected_method = methodHandle(THREAD, resolved_method);
_resolved_method = methodHandle(thread, resolved_method);
_selected_method = methodHandle(thread, resolved_method);
// classify:
CallKind kind = CallInfo::unknown_kind;
int index = resolved_method->vtable_index();
@@ -206,8 +206,9 @@ CallInfo::CallInfo(Method* resolved_method, Klass* resolved_klass, TRAPS) {
_call_index = index;
_resolved_appendix = Handle();
// Find or create a ResolvedMethod instance for this Method*
set_resolved_method_name(CHECK);
if (thread->is_Java_thread()) { // exclude DCEVM VM thread
set_resolved_method_name(JavaThread::cast(thread));
}
DEBUG_ONLY(verify());
}
@@ -217,6 +218,10 @@ void CallInfo::set_resolved_method_name(TRAPS) {
_resolved_method_name = Handle(THREAD, rmethod_name);
}
void CallInfo::set_resolved_method_name_dcevm(oop rmethod_name, Thread* thread) {
_resolved_method_name = Handle(thread, rmethod_name);
}
#ifdef ASSERT
void CallInfo::verify() {
switch (call_kind()) { // the meaning and allowed value of index depends on kind
@@ -314,9 +319,14 @@ void LinkResolver::check_klass_accessibility(Klass* ref_klass, Klass* sel_klass,
if (!base_klass->is_instance_klass()) {
return; // no relevant check to do
}
Klass* refKlassNewest = ref_klass;
Klass* baseKlassNewest = base_klass;
if (AllowEnhancedClassRedefinition) {
refKlassNewest = ref_klass->newest_version();
baseKlassNewest = base_klass->newest_version();
}
Reflection::VerifyClassAccessResults vca_result =
Reflection::verify_class_access(ref_klass, InstanceKlass::cast(base_klass), true);
Reflection::verify_class_access(refKlassNewest, InstanceKlass::cast(baseKlassNewest), true);
if (vca_result != Reflection::ACCESS_OK) {
ResourceMark rm(THREAD);
char* msg = Reflection::verify_class_access_msg(ref_klass,
@@ -578,7 +588,8 @@ void LinkResolver::check_method_accessability(Klass* ref_klass,
// We'll check for the method name first, as that's most likely
// to be false (so we'll short-circuit out of these tests).
if (sel_method->name() == vmSymbols::clone_name() &&
sel_klass == vmClasses::Object_klass() &&
( (!AllowEnhancedClassRedefinition && sel_klass == vmClasses::Object_klass()) ||
(AllowEnhancedClassRedefinition && sel_klass->newest_version() == vmClasses::Object_klass()->newest_version()) ) &&
resolved_klass->is_array_klass()) {
// We need to change "protected" to "public".
assert(flags.is_protected(), "clone not protected?");
@@ -1040,7 +1051,7 @@ void LinkResolver::resolve_field(fieldDescriptor& fd,
// or by the <init> method (in case of an instance field).
if (is_put && fd.access_flags().is_final()) {
if (sel_klass != current_klass) {
if (sel_klass != current_klass && (!AllowEnhancedClassRedefinition || sel_klass != current_klass->active_version())) {
ResourceMark rm(THREAD);
stringStream ss;
ss.print("Update to %s final field %s.%s attempted from a different class (%s) than the field's declaring class",
@@ -1059,14 +1070,16 @@ void LinkResolver::resolve_field(fieldDescriptor& fd,
!fd.is_static() &&
!m->is_object_initializer());
if (is_initialized_static_final_update || is_initialized_instance_final_update) {
ResourceMark rm(THREAD);
stringStream ss;
ss.print("Update to %s final field %s.%s attempted from a different method (%s) than the initializer method %s ",
is_static ? "static" : "non-static", resolved_klass->external_name(), fd.name()->as_C_string(),
m->name()->as_C_string(),
is_static ? "<clinit>" : "<init>");
THROW_MSG(vmSymbols::java_lang_IllegalAccessError(), ss.as_string());
if (!AllowEnhancedClassRedefinition || !m->name()->equals("$$ha$clinit")) {
if (is_initialized_static_final_update || is_initialized_instance_final_update) {
ResourceMark rm(THREAD);
stringStream ss;
ss.print("Update to %s final field %s.%s attempted from a different method (%s) than the initializer method %s ",
is_static ? "static" : "non-static", resolved_klass->external_name(), fd.name()->as_C_string(),
m->name()->as_C_string(),
is_static ? "<clinit>" : "<init>");
THROW_MSG(vmSymbols::java_lang_IllegalAccessError(), ss.as_string());
}
}
}
}

View File

@@ -89,7 +89,7 @@ class CallInfo : public StackObj {
// utility to extract an effective CallInfo from a method and an optional receiver limit
// does not queue the method for compilation. This also creates a ResolvedMethodName
// object for the resolved_method.
CallInfo(Method* resolved_method, Klass* resolved_klass, TRAPS);
CallInfo(Method* resolved_method, Klass* resolved_klass, Thread* thread);
Klass* resolved_klass() const { return _resolved_klass; }
Method* resolved_method() const;
@@ -98,6 +98,7 @@ class CallInfo : public StackObj {
Handle resolved_method_name() const { return _resolved_method_name; }
// Materialize a java.lang.invoke.ResolvedMethodName for this resolved_method
void set_resolved_method_name(TRAPS);
void set_resolved_method_name_dcevm(oop rmethod_name, Thread* thread);
CallKind call_kind() const { return _call_kind; }
int vtable_index() const {

View File

@@ -1698,6 +1698,7 @@ static InstanceKlass* create_new_instance_klass(InstanceKlass* ik, ClassFileStre
cld,
&cl_info,
ClassFileParser::INTERNAL, // internal visibility
false,
THREAD);
if (HAS_PENDING_EXCEPTION) {
log_pending_exception(PENDING_EXCEPTION);

View File

@@ -453,10 +453,10 @@
<Field type="ulong" contentType="bytes" name="regionEndWaste" label="Region End Wasted" description="Total memory wasted at the end of regions due to refill" />
<Field type="uint" name="regionsRefilled" label="Region Refills" description="Number of regions refilled" />
<Field type="ulong" name="numPlabsFilled" label="PLAB Fills" description="Number of PLABs filled" />
<Field type="ulong" contentType="bytes" name="directAllocated" label="Allocated (Direct)" description="Total memory allocated using direct allocation outside of PLABs" />
<Field type="ulong" name="numDirectAllocated" label="Direct Allocations" description="Number of direct allocations" />
<Field type="ulong" contentType="bytes" name="failureUsed" label="Used (Failure)" description="Total memory occupied by objects in regions where evacuation failed" />
<Field type="ulong" contentType="bytes" name="failureWaste" label="Wasted (Failure)" description="Total memory left unused in regions where evacuation failed" />
<Field type="ulong" contentType="bytes" name="directAllocated" label="Allocated (direct)" description="Total memory allocated using direct allocation outside of PLABs" />
<Field type="ulong" name="numDirectAllocated" label="Direct allocations" description="Number of direct allocations" />
<Field type="ulong" contentType="bytes" name="failureUsed" label="Used (failure)" description="Total memory occupied by objects in regions where evacuation failed" />
<Field type="ulong" contentType="bytes" name="failureWaste" label="Wasted (failure)" description="Total memory left unused in regions where evacuation failed" />
</Type>
<Event name="G1EvacuationYoungStatistics" category="Java Virtual Machine, GC, Detailed" label="G1 Evacuation Statistics for Young" startTime="false"
@@ -523,7 +523,7 @@
<Event name="PromotionFailed" category="Java Virtual Machine, GC, Detailed" label="Promotion Failed" startTime="false" description="Promotion of an object failed">
<Field type="uint" name="gcId" label="GC Identifier" relation="GcId" />
<Field type="CopyFailed" struct="true" name="promotionFailed" label="Promotion Failed Data" />
<Field type="Thread" name="thread" label="Running Thread" />
<Field type="Thread" name="thread" label="Running thread" />
</Event>
<Event name="EvacuationFailed" category="Java Virtual Machine, GC, Detailed" label="Evacuation Failed" startTime="false" description="Evacuation of an object failed">
@@ -1007,7 +1007,7 @@
<Field type="ulong" contentType="bytes" name="nmethodsSize" label="Compilation Resulting Size" />
<Field type="ulong" contentType="bytes" name="nmethodCodeSize" label="Compilation Resulting Code Size" />
<Field type="long" contentType="millis" name="peakTimeSpent" label="Peak Time" />
<Field type="long" contentType="millis" name="totalTimeSpent" label="Total Time" />
<Field type="long" contentType="millis" name="totalTimeSpent" label="Total time" />
</Event>
<Event name="CompilerConfiguration" category="Java Virtual Machine, Compiler" label="Compiler Configuration" thread="false" period="endChunk" startTime="false">
@@ -1030,10 +1030,10 @@
<Event name="CodeCacheConfiguration" category="Java Virtual Machine, Code Cache" label="Code Cache Configuration" thread="false" period="endChunk" startTime="false">
<Field type="ulong" contentType="bytes" name="initialSize" label="Initial Size" />
<Field type="ulong" contentType="bytes" name="reservedSize" label="Reserved Size" />
<Field type="ulong" contentType="bytes" name="nonNMethodSize" label="Non-Nmethod Size" />
<Field type="ulong" contentType="bytes" name="nonNMethodSize" label="Non-nmethod Size" />
<Field type="ulong" contentType="bytes" name="profiledSize" label="Profiled Size" />
<Field type="ulong" contentType="bytes" name="nonProfiledSize" label="Non-Profiled Size" />
<Field type="ulong" contentType="bytes" name="expansionSize" label="Expansion Size" />
<Field type="ulong" contentType="bytes" name="nonProfiledSize" label="Non-profiled Size" />
<Field type="ulong" contentType="bytes" name="expansionSize" label="Expansion size" />
<Field type="ulong" contentType="bytes" name="minBlockLength" label="Minimum Block Length" />
<Field type="ulong" contentType="address" name="startAddress" label="Start Address" />
<Field type="ulong" contentType="address" name="reservedTopAddress" label="Reserved Top" />
@@ -1159,10 +1159,10 @@
<Field type="ulong" contentType="bytes" name="size" label="Size" />
<Field type="ulong" contentType="bytes" name="harvested" label="Harvested" />
<Field type="ulong" contentType="bytes" name="committed" label="Committed" />
<Field type="uint" name="harvestedRanges" label="Harvested Ranges" description="Number of harvested memory ranges" />
<Field type="boolean" name="multiPartition" label="Multi-Partition" />
<Field type="boolean" name="successful" label="Successful" />
<Field type="boolean" name="nonBlocking" label="Non-Blocking" />
<Field type="uint" name="numHarvested" label="Number of harvested vmems" />
<Field type="boolean" name="multiPartition" label="Multi-partition allocation" />
<Field type="boolean" name="successful" label="Successful allocation" />
<Field type="boolean" name="nonBlocking" label="Non-blocking" />
</Event>
<Event name="ZRelocationSet" category="Java Virtual Machine, GC, Detailed" label="ZGC Relocation Set" thread="true">

View File

@@ -69,6 +69,7 @@ static bool enable() {
}
_enabled = FlightRecorder;
assert(_enabled, "invariant");
AllowEnhancedClassRedefinition = false;
return _enabled;
}

View File

@@ -2253,21 +2253,14 @@ static jobject read_field_value(Handle obj, long displacement, jchar type_char,
if (!aligned) {
JVMCI_THROW_MSG_NULL(IllegalArgumentException, "read is unaligned");
}
if (obj->is_array()) {
// Disallow reading after the last element of an array
size_t array_length = arrayOop(obj())->length();
int lh = obj->klass()->layout_helper();
size_t size_in_bytes = array_length << Klass::layout_helper_log2_element_size(lh);
size_in_bytes += Klass::layout_helper_header_size(lh);
if ((size_t) displacement + basic_type_elemsize > size_in_bytes) {
JVMCI_THROW_MSG_NULL(IllegalArgumentException, "reading after last array element");
}
}
if (basic_type == T_OBJECT) {
if (obj->is_objArray()) {
if (displacement < arrayOopDesc::base_offset_in_bytes(T_OBJECT)) {
JVMCI_THROW_MSG_NULL(IllegalArgumentException, "reading from array header");
}
if (displacement + heapOopSize > arrayOopDesc::base_offset_in_bytes(T_OBJECT) + arrayOop(obj())->length() * heapOopSize) {
JVMCI_THROW_MSG_NULL(IllegalArgumentException, "reading after last array element");
}
if (((displacement - arrayOopDesc::base_offset_in_bytes(T_OBJECT)) % heapOopSize) != 0) {
JVMCI_THROW_MSG_NULL(IllegalArgumentException, "misaligned object read from array");
}

View File

@@ -180,6 +180,8 @@ int Universe::_base_vtable_size = 0;
bool Universe::_bootstrapping = false;
bool Universe::_module_initialized = false;
bool Universe::_fully_initialized = false;
bool Universe::_is_redefining_gc_run = false;
bool Universe::_is_inside_redefinition = false;
OopStorage* Universe::_vm_weak = nullptr;
OopStorage* Universe::_vm_global = nullptr;
@@ -1074,6 +1076,35 @@ void Universe::initialize_known_methods(JavaThread* current) {
vmSymbols::doStackWalk_signature(), false);
}
void Universe::reinitialize_known_method_dcevm(JavaThread* current) {
// Set up static method for registering finalizers
_finalizer_register_cache.init(current,
vmClasses::Finalizer_klass(),
"register",
vmSymbols::object_void_signature(), true);
_throw_illegal_access_error_cache.init(current,
vmClasses::internal_Unsafe_klass(),
"throwIllegalAccessError",
vmSymbols::void_method_signature(), true);
_throw_no_such_method_error_cache.init(current,
vmClasses::internal_Unsafe_klass(),
"throwNoSuchMethodError",
vmSymbols::void_method_signature(), true);
// Set up method for registering loaded classes in class loader vector
_loader_addClass_cache.init(current,
vmClasses::ClassLoader_klass(),
"addClass",
vmSymbols::class_void_signature(), false);
// Set up method for stack walking
_do_stack_walk_cache.init(current,
vmClasses::AbstractStackWalker_klass(),
"doStackWalk",
vmSymbols::doStackWalk_signature(), false);
}
void universe2_init() {
EXCEPTION_MARK;
Universe::genesis(CATCH);
@@ -1376,3 +1407,9 @@ bool Universe::is_in_heap(const void* p) {
}
#endif // ASSERT
void Universe::update_vmClasses_dcevm() {
_the_array_interfaces_array->at_put(0, vmClasses::Cloneable_klass()->newest_version());
_the_array_interfaces_array->at_put(1, vmClasses::Serializable_klass()->newest_version());
}

View File

@@ -160,6 +160,8 @@ class Universe: AllStatic {
static uintptr_t _verify_oop_mask;
static uintptr_t _verify_oop_bits;
static bool _is_redefining_gc_run;
static bool _is_inside_redefinition;
// Table of primitive type mirrors, excluding T_OBJECT and T_ARRAY
// but including T_VOID, hence the index including T_VOID
@@ -175,6 +177,12 @@ class Universe: AllStatic {
static void calculate_verify_data(HeapWord* low_boundary, HeapWord* high_boundary) PRODUCT_RETURN;
static void set_verify_data(uintptr_t mask, uintptr_t bits) PRODUCT_RETURN;
// (DCEVM) Advanced class redefinition.
static bool is_redefining_gc_run() { return _is_redefining_gc_run; }
static void set_redefining_gc_run(bool b) { _is_redefining_gc_run = b; }
static bool is_inside_redefinition() { return _is_inside_redefinition; }
static void set_inside_redefinition(bool b) { _is_inside_redefinition = b; }
// Known classes in the VM
static TypeArrayKlass* boolArrayKlass() { return typeArrayKlass(T_BOOLEAN); }
static TypeArrayKlass* byteArrayKlass() { return typeArrayKlass(T_BYTE); }
@@ -189,6 +197,9 @@ class Universe: AllStatic {
static Klass* fillerArrayKlass() { return _fillerArrayKlass; }
// (DCEVM)
static void update_vmClasses_dcevm();
static TypeArrayKlass* typeArrayKlass(BasicType t) {
assert((uint)t >= T_BOOLEAN, "range check for type: %s", type2name(t));
assert((uint)t < T_LONG+1, "range check for type: %s", type2name(t));
@@ -249,6 +260,8 @@ class Universe: AllStatic {
// Function to initialize these
static void initialize_known_methods(JavaThread* current);
static void reinitialize_known_method_dcevm(JavaThread* current);
static void create_preallocated_out_of_memory_errors(TRAPS);
// Reference pending list manipulation. Access is protected by

View File

@@ -95,7 +95,7 @@ inline void CompressedKlassPointers::check_valid_narrow_klass_id(narrowKlass nk)
inline address CompressedKlassPointers::encoding_range_end() {
const int max_bits = narrow_klass_pointer_bits() + _shift;
return (address)((uintptr_t)_base + nth_bit(max_bits));
return _base + nth_bit(max_bits);
}
#endif // SHARE_OOPS_COMPRESSEDKLASS_INLINE_HPP

View File

@@ -322,7 +322,7 @@ ResolvedMethodEntry* ConstantPoolCache::set_method_handle(int method_index, cons
if (has_appendix) {
const int appendix_index = method_entry->resolved_references_index();
assert(appendix_index >= 0 && appendix_index < resolved_references->length(), "oob");
assert(resolved_references->obj_at(appendix_index) == nullptr, "init just once");
assert(AllowEnhancedClassRedefinition || resolved_references->obj_at(appendix_index) == nullptr, "init just once");
resolved_references->obj_at_put(appendix_index, appendix());
}
@@ -872,3 +872,25 @@ void ConstantPoolCache::print_resolved_indy_entries(outputStream* st) const {
}
}
}
void ConstantPoolCache::clear_entries() {
if (_resolved_indy_entries != nullptr) {
for (int i = 0; i < _resolved_indy_entries->length(); i++) {
ResolvedIndyEntry *indy_entry = resolved_indy_entry_at(i);
indy_entry->clear_entry();
}
}
if (_resolved_field_entries != nullptr) {
for (int i = 0; i < _resolved_field_entries->length(); i++) {
ResolvedFieldEntry* field_entry = resolved_field_entry_at(i);
field_entry->clear_entry();
}
}
if (_resolved_method_entries != nullptr) {
for (int i = 0; i < _resolved_method_entries->length(); i++) {
ResolvedMethodEntry *method_entry = resolved_method_entry_at(i);
method_entry->clear_entry();
}
}
}

View File

@@ -251,6 +251,9 @@ class ConstantPoolCache: public MetaspaceObj {
// Verify
void verify_on(outputStream* st);
// DCEVM
void clear_entries();
};
#endif // SHARE_OOPS_CPCACHE_HPP

View File

@@ -199,6 +199,9 @@ class FieldInfo {
inline Symbol* signature(ConstantPool* cp) const;
// (DCEVM) - signature() duplicate for internal fields to resolve gcc compilation "nonnull" issue
inline Symbol* signature_injected_dcevm() const;
inline Symbol* lookup_symbol(int symbol_index) const;
void print(outputStream* os, ConstantPool* cp);

View File

@@ -49,6 +49,12 @@ inline Symbol* FieldInfo::signature(ConstantPool* cp) const {
return cp->symbol_at(index);
}
inline Symbol* FieldInfo::signature_injected_dcevm() const {
assert(_field_flags.is_injected(), "injected only");
int index = _signature_index;
return lookup_symbol(index);
}
inline Symbol* FieldInfo::lookup_symbol(int symbol_index) const {
assert(_field_flags.is_injected(), "only injected fields");
return Symbol::vm_symbol_at(static_cast<vmSymbolID>(symbol_index));

View File

@@ -120,7 +120,7 @@ class FieldStreamBase : public StackObj {
// Convenient methods
const FieldInfo& to_FieldInfo() const {
FieldInfo to_FieldInfo() {
return _fi_buf;
}
@@ -131,7 +131,7 @@ class FieldStreamBase : public StackObj {
// bridge to a heavier API:
fieldDescriptor& field_descriptor() const {
fieldDescriptor& field = const_cast<fieldDescriptor&>(_fd_buf);
field.reinitialize(field_holder(), to_FieldInfo());
field.reinitialize(field_holder(), _index);
return field;
}
};

View File

@@ -97,6 +97,7 @@
#include "utilities/events.hpp"
#include "utilities/macros.hpp"
#include "utilities/nativeStackPrinter.hpp"
#include "utilities/pair.hpp"
#include "utilities/stringUtils.hpp"
#ifdef COMPILER1
#include "c1/c1_Compiler.hpp"
@@ -431,11 +432,21 @@ bool InstanceKlass::has_nestmate_access_to(InstanceKlass* k, TRAPS) {
return false;
}
// (DCEVM) cur_host can be old, decide accessibility based on active version
if (AllowEnhancedClassRedefinition) {
cur_host = InstanceKlass::cast(cur_host->active_version());
}
Klass* k_nest_host = k->nest_host(CHECK_false);
if (k_nest_host == nullptr) {
return false;
}
// (DCEVM) k_nest_host can be old, decide accessibility based on active version
if (AllowEnhancedClassRedefinition) {
k_nest_host = InstanceKlass::cast(k_nest_host->active_version());
}
bool access = (cur_host == k_nest_host);
ResourceMark rm(THREAD);
@@ -988,7 +999,10 @@ bool InstanceKlass::link_class_impl(TRAPS) {
if (is_shared()) {
assert(!verified_at_dump_time(), "must be");
}
{
// (DCEVM): If class A is being redefined and class B->A (B is extended from A) and B is host class of anonymous class C
// then second redefinition fails with cannot cast klass exception. So we currently turn off bytecode verification
// on redefinition.
if (!AllowEnhancedClassRedefinition || !newest_version()->is_redefining()) {
bool verify_ok = verify_code(THREAD);
if (!verify_ok) {
return false;
@@ -1050,7 +1064,7 @@ bool InstanceKlass::link_class_impl(TRAPS) {
} else {
set_init_state(linked);
}
if (JvmtiExport::should_post_class_prepare()) {
if (JvmtiExport::should_post_class_prepare() && (!AllowEnhancedClassRedefinition || old_version() == nullptr /* JVMTI deadlock otherwise */)) {
JvmtiExport::post_class_prepare(THREAD, this);
}
}
@@ -1196,7 +1210,8 @@ void InstanceKlass::initialize_impl(TRAPS) {
// If we were to use wait() instead of waitInterruptibly() then
// we might end up throwing IE from link/symbol resolution sites
// that aren't expected to throw. This would wreak havoc. See 6320309.
while (is_being_initialized() && !is_reentrant_initialization(jt)) {
while ((is_being_initialized() && !is_reentrant_initialization(jt))
|| (AllowEnhancedClassRedefinition && old_version() != nullptr && InstanceKlass::cast(old_version())->is_being_initialized())) {
if (debug_logging_enabled) {
ResourceMark rm(jt);
log_debug(class, init)("Thread \"%s\" waiting for initialization of %s by thread \"%s\"",
@@ -1483,6 +1498,15 @@ void InstanceKlass::init_implementor() {
}
}
// (DCEVM) - init_implementor() for dcevm
void InstanceKlass::init_implementor_from_redefine() {
assert(is_interface(), "not interface");
InstanceKlass* volatile* addr = adr_implementor();
assert(addr != nullptr, "null addr");
if (addr != nullptr) {
*addr = nullptr;
}
}
void InstanceKlass::process_interfaces() {
// link this class into the implementors list of every interface it implements
@@ -1539,6 +1563,20 @@ bool InstanceKlass::implements_interface(Klass* k) const {
return false;
}
// (DCEVM)
bool InstanceKlass::implements_interface_any_version(Klass* k) const {
k = k->newest_version();
if (this->newest_version() == k) return true;
assert(k->is_interface(), "should be an interface class");
for (int i = 0; i < transitive_interfaces()->length(); i++) {
if (transitive_interfaces()->at(i)->newest_version() == k) {
return true;
}
}
return false;
}
bool InstanceKlass::is_same_or_direct_interface(Klass *k) const {
// Verify direct super interface
if (this == k) return true;
@@ -1784,7 +1822,7 @@ bool InstanceKlass::find_local_field(Symbol* name, Symbol* sig, fieldDescriptor*
Symbol* f_name = fs.name();
Symbol* f_sig = fs.signature();
if (f_name == name && f_sig == sig) {
fd->reinitialize(const_cast<InstanceKlass*>(this), fs.to_FieldInfo());
fd->reinitialize(const_cast<InstanceKlass*>(this), fs.index());
return true;
}
}
@@ -1853,7 +1891,7 @@ Klass* InstanceKlass::find_field(Symbol* name, Symbol* sig, bool is_static, fiel
bool InstanceKlass::find_local_field_from_offset(int offset, bool is_static, fieldDescriptor* fd) const {
for (JavaFieldStream fs(this); !fs.done(); fs.next()) {
if (fs.offset() == offset) {
fd->reinitialize(const_cast<InstanceKlass*>(this), fs.to_FieldInfo());
fd->reinitialize(const_cast<InstanceKlass*>(this), fs.index());
if (fd->is_static() == is_static) return true;
}
}
@@ -1889,6 +1927,21 @@ void InstanceKlass::methods_do(void f(Method* method)) {
}
}
// (DCEVM) Update information contains mapping of fields from old class to the new class.
// Info is stored on HEAP, you need to call clear_update_information to free the space.
void InstanceKlass::store_update_information(GrowableArray<int> &values) {
int *arr = NEW_C_HEAP_ARRAY(int, values.length(), mtClass);
for (int i = 0; i < values.length(); i++) {
arr[i] = values.at(i);
}
set_update_information(arr);
}
void InstanceKlass::clear_update_information() {
FREE_C_HEAP_ARRAY(int, update_information());
set_update_information(nullptr);
}
void InstanceKlass::do_local_static_fields(FieldClosure* cl) {
for (JavaFieldStream fs(this); !fs.done(); fs.next()) {
@@ -1914,16 +1967,78 @@ void InstanceKlass::do_nonstatic_fields(FieldClosure* cl) {
if (super != nullptr) {
super->do_nonstatic_fields(cl);
}
for (JavaFieldStream fs(this); !fs.done(); fs.next()) {
fieldDescriptor& fd = fs.field_descriptor();
fieldDescriptor fd;
int length = java_fields_count();
for (int i = 0; i < length; i += 1) {
fd.reinitialize(this, i);
if (!fd.is_static()) {
cl->do_field(&fd);
}
}
}
static int compare_fields_by_offset(FieldInfo* a, FieldInfo* b) {
return a->offset() - b->offset();
// first in Pair is offset, second is index.
static int compare_fields_by_offset(Pair<int,int>* a, Pair<int,int>* b) {
return a->first - b->first;
}
template<typename F, typename S, typename T, typename ALLOC_BASE = ResourceObj>
class Triple : public ALLOC_BASE {
public:
F first;
S second;
T third;
Triple() {}
Triple(F f, S s, T t) : first(f), second(s), third(t) {}
};
void InstanceKlass::do_nonstatic_fields_dcevm_collect_fields(void* fields, int depth) {
InstanceKlass* super = superklass();
if (super != nullptr) {
super->do_nonstatic_fields_dcevm_collect_fields(fields, depth + 1);
}
GrowableArray<Triple<int,int, int> >* all_fields = (GrowableArray<Triple<int,int,int> >*) fields;
// In DebugInfo nonstatic fields are sorted by offset.
for (AllFieldStream fs(this); !fs.done(); fs.next()) {
if (!fs.access_flags().is_static()) {
Triple<int,int, int> f(fs.offset(), fs.index(), depth);
all_fields->push(f);
}
}
}
static int compare_fields_by_offset_dcevm(Triple<int,int,int>* a, Triple<int,int,int>* b) {
return a->first - b->first;
}
void InstanceKlass::do_nonstatic_fields_dcevm(FieldClosure* cl) {
GrowableArray<InstanceKlass*> class_hiearchy;
class_hiearchy.push(this);
InstanceKlass* super = superklass();
while (super != nullptr) {
class_hiearchy.push(super);
super = super->superklass();
}
GrowableArray<Triple<int,int, int>> fields_sorted;
do_nonstatic_fields_dcevm_collect_fields(&fields_sorted, 0);
int length = fields_sorted.length();
if (length > 0) {
// _sort_Fn is defined in growableArray.hpp.
fields_sorted.sort(compare_fields_by_offset_dcevm);
fieldDescriptor fd;
for (int i = 0; i < length; i++) {
InstanceKlass* ik = class_hiearchy.at(fields_sorted.at(i).third);
fd.reinitialize(ik, fields_sorted.at(i).second);
assert(!fd.is_static(), "only nonstatic fields");
assert(fd.offset() == fields_sorted.at(i).first, "offset matches");
cl->do_field(&fd);
}
}
}
void InstanceKlass::print_nonstatic_fields(FieldClosure* cl) {
@@ -1932,20 +2047,25 @@ void InstanceKlass::print_nonstatic_fields(FieldClosure* cl) {
super->print_nonstatic_fields(cl);
}
ResourceMark rm;
fieldDescriptor fd;
// In DebugInfo nonstatic fields are sorted by offset.
GrowableArray<FieldInfo> fields_sorted;
GrowableArray<Pair<int,int> > fields_sorted;
int i = 0;
for (AllFieldStream fs(this); !fs.done(); fs.next()) {
if (!fs.access_flags().is_static()) {
fields_sorted.push(fs.to_FieldInfo());
fd = fs.field_descriptor();
Pair<int,int> f(fs.offset(), fs.index());
fields_sorted.push(f);
i++;
}
}
int length = fields_sorted.length();
if (length > 0) {
if (i > 0) {
int length = i;
assert(length == fields_sorted.length(), "duh");
fields_sorted.sort(compare_fields_by_offset);
fieldDescriptor fd;
for (int i = 0; i < length; i++) {
fd.reinitialize(this, fields_sorted.at(i));
assert(!fd.is_static() && fd.offset() == checked_cast<int>(fields_sorted.at(i).offset()), "only nonstatic fields");
fd.reinitialize(this, fields_sorted.at(i).second);
assert(!fd.is_static() && fd.offset() == fields_sorted.at(i).first, "only nonstatic fields");
cl->do_field(&fd);
}
}
@@ -2508,6 +2628,20 @@ void InstanceKlass::clean_dependency_context() {
dependencies().clean_unloading_dependents();
}
// DCEVM - update jmethod ids
bool InstanceKlass::update_jmethod_id(Method* method, jmethodID newMethodID) {
size_t idnum = (size_t)method->method_idnum();
jmethodID* jmeths = methods_jmethod_ids_acquire();
size_t length; // length assigned as debugging crumb
jmethodID id = nullptr;
if (jmeths != nullptr && // If there is a cache
(length = (size_t)jmeths[0]) > idnum) { // and if it is long enough,
jmeths[idnum+1] = newMethodID; // Set method id (may be nullptr)
return true;
}
return false;
}
#ifndef PRODUCT
void InstanceKlass::print_dependent_nmethods(bool verbose) {
dependencies().print_dependent_nmethods(verbose);
@@ -4097,7 +4231,7 @@ void InstanceKlass::verify_on(outputStream* st) {
}
guarantee(sib->is_klass(), "should be klass");
guarantee(sib->super() == super, "siblings should have same superklass");
guarantee(sib->super() == super || (AllowEnhancedClassRedefinition && sib->super()->newest_version() == super->newest_version()), "siblings should have same superklass");
}
// Verify local interfaces

View File

@@ -136,6 +136,7 @@ class InstanceKlass: public Klass {
friend class JVMCIVMStructs;
friend class ClassFileParser;
friend class CompileReplay;
friend class VM_EnhancedRedefineClasses;
public:
static const KlassKind Kind = InstanceKlassKind;
@@ -548,6 +549,11 @@ public:
// reference type
ReferenceType reference_type() const { return (ReferenceType)_reference_type; }
// (DCEVM)
void set_reference_type(ReferenceType t) {
assert(t == (u1)t, "overflow");
_reference_type = (u1)t;
}
// this class cp index
u2 this_class_index() const { return _this_class_index; }
@@ -767,6 +773,13 @@ public:
inline u2 next_method_idnum();
void set_initial_method_idnum(u2 value) { _idnum_allocated_count = value; }
// DCEVM
void adjust_method_idnum(u2 value) {
if (value > _idnum_allocated_count) {
_idnum_allocated_count= value;
}
}
// generics support
Symbol* generic_signature() const;
u2 generic_signature_index() const;
@@ -787,6 +800,7 @@ public:
void ensure_space_for_methodids(int start_offset = 0);
jmethodID jmethod_id_or_null(Method* method);
void update_methods_jmethod_cache();
bool update_jmethod_id(Method* method, jmethodID newMethodID);
// annotations support
Annotations* annotations() const { return _annotations; }
@@ -863,6 +877,7 @@ public:
// subclass/subinterface checks
bool implements_interface(Klass* k) const;
bool implements_interface_any_version(Klass* k) const;
bool is_same_or_direct_interface(Klass* k) const;
#ifdef ASSERT
@@ -876,11 +891,13 @@ public:
int nof_implementors() const;
void add_implementor(InstanceKlass* ik); // ik is a new class that implements this interface
void init_implementor(); // initialize
void init_implementor_from_redefine(); // initialize
private:
// link this class into the implementors list of every interface it implements
void process_interfaces();
// (DCEVM)
void do_nonstatic_fields_dcevm_collect_fields(void* fields, int depth);
public:
// virtual operations from Klass
GrowableArray<Klass*>* compute_secondary_supers(int num_extra_slots,
@@ -894,9 +911,15 @@ public:
// Iterators
void do_local_static_fields(FieldClosure* cl);
void do_nonstatic_fields(FieldClosure* cl); // including inherited fields
// (DCEVM)
void do_nonstatic_fields_dcevm(FieldClosure* cl);
void do_local_static_fields(void f(fieldDescriptor*, Handle, TRAPS), Handle, TRAPS);
void print_nonstatic_fields(FieldClosure* cl); // including inherited and injected fields
// Advanced class redefinition: FIXME: why here?
void store_update_information(GrowableArray<int> &values);
void clear_update_information();
void methods_do(void f(Method* method));
static InstanceKlass* cast(Klass* k) {

View File

@@ -301,7 +301,15 @@ Klass::Klass() : _kind(UnknownKlassKind) {
// which doesn't zero out the memory before calling the constructor.
Klass::Klass(KlassKind kind) : _kind(kind),
_prototype_header(make_prototype(this)),
_shared_class_path_index(-1) {
_old_version(nullptr),
_new_version(nullptr),
_redefinition_flags(Klass::NoRedefinition),
_is_redefining(false),
_update_information(nullptr),
_is_copying_backwards(false),
_is_rolled_back(false),
_shared_class_path_index(-1)
{
CDS_ONLY(_shared_class_flags = 0;)
CDS_JAVA_HEAP_ONLY(_archived_mirror_index = -1;)
_primary_supers[0] = this;
@@ -511,8 +519,8 @@ void Klass::initialize_supers(Klass* k, Array<InstanceKlass*>* transitive_interf
set_super(nullptr);
_primary_supers[0] = this;
assert(super_depth() == 0, "Object must already be initialized properly");
} else if (k != super() || k == vmClasses::Object_klass()) {
assert(super() == nullptr || super() == vmClasses::Object_klass(),
} else if (k != super() || k == vmClasses::Object_klass() || (k->is_redefining() && k == vmClasses::Object_klass()->newest_version())) {
assert(super() == NULL || super() == vmClasses::Object_klass() || (k->is_redefining() && super() == vmClasses::Object_klass()->newest_version()),
"initialize this only once to a non-trivial value");
set_super(k);
Klass* sup = k;
@@ -718,6 +726,27 @@ void Klass::clean_subklass() {
}
}
void Klass::remove_from_sibling_list() {
debug_only(verify();)
// remove ourselves to superklass' subklass list
InstanceKlass* super = superklass();
if (super == nullptr) return; // special case: class Object
if (super->subklass() == this) {
// this klass is the first subklass
super->set_subklass(next_sibling());
} else {
Klass* sib = super->subklass();
assert(sib != nullptr, "cannot find this class in sibling list!");
while (sib->next_sibling() != this) {
sib = sib->next_sibling();
assert(sib != nullptr, "cannot find this class in sibling list!");
}
sib->set_next_sibling(next_sibling());
}
debug_only(verify();)
}
void Klass::clean_weak_klass_links(bool unloading_occurred, bool clean_alive_klasses) {
if (!ClassUnloading || !unloading_occurred) {
return;
@@ -1342,3 +1371,25 @@ void Klass::on_secondary_supers_verification_failure(Klass* super, Klass* sub, b
fatal("%s: %s implements %s: linear_search: %d; table_lookup: %d",
msg, sub->external_name(), super->external_name(), linear_result, table_result);
}
void Klass::update_supers_dcevm() {
if (_super != NULL) {
_super = _super->newest_version();
}
int sup_depth = super_depth();
for (int idx = 0; idx < sup_depth; idx++) {
Klass* primary = _primary_supers[idx];
if (primary == NULL) {
break;
}
_primary_supers[idx] = primary->newest_version();
}
if (secondary_super_cache() != NULL) {
set_secondary_super_cache(secondary_super_cache()->newest_version());
}
int cnt = secondary_supers()->length();
for (int i = 0; i < cnt; i++) {
secondary_supers()->at_put(i, secondary_supers()->at(i)->newest_version());
}
}

View File

@@ -17,7 +17,7 @@
* 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
e or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
@@ -165,6 +165,19 @@ class Klass : public Metadata {
uintx _secondary_supers_bitmap;
uint8_t _hash_slot;
// Advanced class redefinition
// Old version (used in advanced class redefinition)
Klass* _old_version;
// New version (used in advanced class redefinition)
Klass* _new_version;
int _redefinition_flags; // Level of class redefinition
bool _is_redefining;
int* _update_information;
bool _is_copying_backwards; // Does the class need to copy fields backwards? => possibly overwrite itself?
bool _is_rolled_back; // true if class was rolled back in redefinition
private:
// This is an index into AOTClassLocationConfig::class_locations(), to
// indicate the AOTClassLocation where this class is loaded from during
@@ -302,6 +315,7 @@ protected:
InstanceKlass* superklass() const;
void append_to_sibling_list(); // add newly created receiver to superklass' subklass list
void remove_from_sibling_list(); // enhanced class redefinition
void set_next_link(Klass* k) { _next_link = k; }
Klass* next_link() const { return _next_link; } // The next klass defined by the class loader.
@@ -402,6 +416,33 @@ protected:
virtual ModuleEntry* module() const = 0;
virtual PackageEntry* package() const = 0;
// Advanced class redefinition
Klass* old_version() const { return _old_version; }
void set_old_version(Klass* klass) { assert(_old_version == nullptr || klass == nullptr, "Old version can only be set once!"); _old_version = klass; }
Klass* new_version() const { return _new_version; }
void set_new_version(Klass* klass) { assert(_new_version == nullptr || klass == nullptr, "New version can only be set once!"); _new_version = klass; }
bool is_redefining() const { return _is_redefining; }
void set_redefining(bool b) { _is_redefining = b; }
int redefinition_flags() const { return _redefinition_flags; }
bool check_redefinition_flag(int flags) const { return (_redefinition_flags & flags) != 0; }
void clear_redefinition_flag(int flag) { _redefinition_flags &= ~flag; }
void set_redefinition_flag(int flag) { _redefinition_flags |= flag; }
void set_redefinition_flags(int flags) { _redefinition_flags = flags; }
const Klass* newest_version() const { return _new_version == nullptr ? this : _new_version->newest_version(); }
Klass* newest_version() { return _new_version == nullptr ? this : _new_version->newest_version(); }
const Klass* active_version() const { return _new_version == nullptr || _new_version->is_redefining() ? this : _new_version->active_version(); }
Klass* active_version() { return _new_version == nullptr || _new_version->is_redefining() ? this : _new_version->active_version(); }
// update information
int *update_information() const { return _update_information; }
void set_update_information(int *info) { _update_information = info; }
bool is_copying_backwards() const { return _is_copying_backwards; }
void set_copying_backwards(bool b) { _is_copying_backwards = b; }
bool is_rolled_back() { return _is_rolled_back; }
void set_rolled_back(bool b) { _is_rolled_back = b;}
protected: // internal accessors
void set_subklass(Klass* s);
void set_next_sibling(Klass* s);
@@ -432,6 +473,16 @@ protected:
static constexpr uintx SECONDARY_SUPERS_BITMAP_EMPTY = 0;
static constexpr uintx SECONDARY_SUPERS_BITMAP_FULL = ~(uintx)0;
enum RedefinitionFlags {
NoRedefinition, // This class is not redefined at all!
ModifyClass = 1, // There are changes to the class meta data.
ModifyClassSize = ModifyClass << 1, // The size of the class meta data changes.
ModifyInstances = ModifyClassSize << 1, // There are change to the instance format.
ModifyInstanceSize = ModifyInstances << 1, // The size of instances changes.
RemoveSuperType = ModifyInstanceSize << 1, // A super type of this class is removed.
MarkedAsAffected = RemoveSuperType << 1, // This class has been marked as an affected class.
PrimaryRedefine = MarkedAsAffected << 1 // This class is from primary redefinition set
};
// Compiler support
static ByteSize super_offset() { return byte_offset_of(Klass, _super); }
@@ -788,6 +839,8 @@ public:
// Returns true if this Klass needs to be addressable via narrow Klass ID.
inline bool needs_narrow_id() const;
// (DCEVM)
void update_supers_dcevm();
};
#endif // SHARE_OOPS_KLASS_HPP

View File

@@ -101,7 +101,8 @@ Method* Method::allocate(ClassLoaderData* loader_data,
return new (loader_data, size, MetaspaceObj::MethodType, THREAD) Method(cm, access_flags, name);
}
Method::Method(ConstMethod* xconst, AccessFlags access_flags, Symbol* name) {
Method::Method(ConstMethod* xconst, AccessFlags access_flags, Symbol* name) : _new_version(nullptr),
_old_version(nullptr) {
NoSafepointVerifier no_safepoint;
set_constMethod(xconst);
set_access_flags(access_flags);
@@ -1838,14 +1839,14 @@ bool CompressedLineNumberReadStream::read_pair() {
#if INCLUDE_JVMTI
Bytecodes::Code Method::orig_bytecode_at(int bci) const {
Bytecodes::Code Method::orig_bytecode_at(int bci, bool no_fatal) const {
BreakpointInfo* bp = method_holder()->breakpoints();
for (; bp != nullptr; bp = bp->next()) {
if (bp->match(this, bci)) {
return bp->orig_bytecode();
}
}
{
if (!no_fatal) {
ResourceMark rm;
fatal("no original bytecode found in %s at bci %d", name_and_sig_as_C_string(), bci);
}
@@ -1950,7 +1951,7 @@ BreakpointInfo::BreakpointInfo(Method* m, int bci) {
_signature_index = m->signature_index();
_orig_bytecode = (Bytecodes::Code) *m->bcp_from(_bci);
if (_orig_bytecode == Bytecodes::_breakpoint)
_orig_bytecode = m->orig_bytecode_at(_bci);
_orig_bytecode = m->orig_bytecode_at(_bci, false);
_next = nullptr;
}
@@ -1959,7 +1960,7 @@ void BreakpointInfo::set(Method* method) {
{
Bytecodes::Code code = (Bytecodes::Code) *method->bcp_from(_bci);
if (code == Bytecodes::_breakpoint)
code = method->orig_bytecode_at(_bci);
code = method->orig_bytecode_at(_bci, false);
assert(orig_bytecode() == code, "original bytecode must be the same");
}
#endif
@@ -2135,7 +2136,10 @@ jmethodID Method::make_jmethod_id(ClassLoaderData* cld, Method* m) {
// Have to add jmethod_ids() to class loader data thread-safely.
// Also have to add the method to the list safely, which the lock
// protects as well.
assert(JmethodIdCreation_lock->owned_by_self(), "sanity check");
assert(AllowEnhancedClassRedefinition || JmethodIdCreation_lock->owned_by_self(), "sanity check");
if (AllowEnhancedClassRedefinition && m != m->newest_version()) {
m = m->newest_version();
}
ResourceMark rm;
log_debug(jmethod)("Creating jmethodID for Method %s", m->external_name());

View File

@@ -78,6 +78,9 @@ class Method : public Metadata {
int _vtable_index; // vtable index of this method (see VtableIndexFlag)
AccessFlags _access_flags; // Access flags
MethodFlags _flags;
// (DCEVM) Newer version of method available?
Method* _new_version;
Method* _old_version;
u2 _intrinsic_id; // vmSymbols::intrinsic_id (0 == _none)
@@ -143,6 +146,23 @@ class Method : public Metadata {
u2 name_index() const { return constMethod()->name_index(); }
void set_name_index(int index) { constMethod()->set_name_index(index); }
Method* new_version() const { return _new_version; }
void set_new_version(Method* m) { _new_version = m; }
Method* newest_version() { return (_new_version == nullptr) ? this : _new_version->newest_version(); }
Method* old_version() const { return _old_version; }
void set_old_version(Method* m) {
/*if (m == nullptr) {
_old_version = nullptr;
return;
}*/
assert(_old_version == nullptr, "may only be set once");
assert(this->code_size() == m->code_size(), "must have same code length");
_old_version = m;
}
const Method* oldest_version() const { return (_old_version == nullptr) ? this : _old_version->oldest_version(); }
// signature
Symbol* signature() const { return constants()->symbol_at(signature_index()); }
u2 signature_index() const { return constMethod()->signature_index(); }
@@ -198,7 +218,7 @@ class Method : public Metadata {
// JVMTI breakpoints
#if !INCLUDE_JVMTI
Bytecodes::Code orig_bytecode_at(int bci) const {
Bytecodes::Code orig_bytecode_at(int bci, bool no_fatal) const {
ShouldNotReachHere();
return Bytecodes::_shouldnotreachhere;
}
@@ -207,7 +227,7 @@ class Method : public Metadata {
};
u2 number_of_breakpoints() const {return 0;}
#else // !INCLUDE_JVMTI
Bytecodes::Code orig_bytecode_at(int bci) const;
Bytecodes::Code orig_bytecode_at(int bci, bool no_fatal) const;
void set_orig_bytecode_at(int bci, Bytecodes::Code code);
void set_breakpoint(int bci);
void clear_breakpoint(int bci);
@@ -850,7 +870,7 @@ public:
void release_C_heap_structures();
Method* get_new_method() const {
InstanceKlass* holder = method_holder();
InstanceKlass* holder = InstanceKlass::cast(method_holder()->newest_version());
Method* new_method = holder->method_with_idnum(orig_method_idnum());
assert(new_method != nullptr, "method_with_idnum() should not be null");

View File

@@ -54,3 +54,8 @@ void ResolvedFieldEntry::mark_and_relocate() {
ArchiveBuilder::current()->mark_and_relocate_to_buffered_addr(&_field_holder);
}
#endif
void ResolvedFieldEntry::clear_entry() {
_get_code = 0;
_put_code = 0;
}

View File

@@ -157,6 +157,9 @@ public:
void mark_and_relocate();
#endif
// DCEVM
void clear_entry();
// Offsets
static ByteSize field_holder_offset() { return byte_offset_of(ResolvedFieldEntry, _field_holder); }
static ByteSize field_offset_offset() { return byte_offset_of(ResolvedFieldEntry, _field_offset); }

View File

@@ -66,3 +66,8 @@ void ResolvedIndyEntry::print_on(outputStream* st) const {
st->print_cr(" - Has Appendix: %d", has_appendix());
st->print_cr(" - Resolution Failed %d", resolution_failed());
}
void ResolvedIndyEntry::clear_entry() {
_flags |= (1 << is_not_resolved_shift);
}

View File

@@ -71,6 +71,7 @@ public:
// Note: Only two flags exists at the moment but more could be added
enum {
has_appendix_shift = 1,
is_not_resolved_shift = 2
};
// Getters
@@ -79,7 +80,7 @@ public:
u2 constant_pool_index() const { return _cpool_index; }
u2 num_parameters() const { return _number_of_parameters; }
u1 return_type() const { return _return_type; }
bool is_resolved() const { return method() != nullptr; }
bool is_resolved() const { return method() != nullptr && !(_flags & (1 << is_not_resolved_shift)); }
bool has_appendix() const { return (_flags & (1 << has_appendix_shift)) != 0; }
bool resolution_failed() const { return (_flags & 1) != 0; }
bool is_vfinal() const { return false; }
@@ -107,7 +108,7 @@ public:
void fill_in(Method* m, u2 num_params, u1 return_type, bool has_appendix) {
set_num_parameters(num_params);
_return_type = return_type;
set_flags(has_appendix);
set_flags(has_appendix); // DCEVM: this also clears "is_not_resolved_shift" bit
// Set the method last since it is read lock free.
// Resolution is indicated by whether or not the method is set.
Atomic::release_store(&_method, m);
@@ -134,6 +135,9 @@ public:
void mark_and_relocate();
#endif
// DCEVM
void clear_entry();
// Offsets
static ByteSize method_offset() { return byte_offset_of(ResolvedIndyEntry, _method); }
static ByteSize resolved_references_index_offset() { return byte_offset_of(ResolvedIndyEntry, _resolved_references_index); }

View File

@@ -108,3 +108,10 @@ void ResolvedMethodEntry::print_on(outputStream* st) const {
st->print_cr(" - Bytecode 1: %s", Bytecodes::name((Bytecodes::Code)bytecode1()));
st->print_cr(" - Bytecode 2: %s", Bytecodes::name((Bytecodes::Code)bytecode2()));
}
void ResolvedMethodEntry::clear_entry() {
// Always clear for invokehandle/invokedynamic to re-resolve them
set_bytecode1(0);
set_bytecode2(0);
}

View File

@@ -254,6 +254,9 @@ class ResolvedMethodEntry {
void mark_and_relocate(ConstantPool* src_cp);
#endif
// DCEVM
void clear_entry();
// Offsets
static ByteSize klass_offset() { return byte_offset_of(ResolvedMethodEntry, _entry_specific._interface_klass); }
static ByteSize method_offset() { return byte_offset_of(ResolvedMethodEntry, _method); }

View File

@@ -74,7 +74,7 @@ public:
}
static void initialize_arraycopy_Type() {
assert(_arraycopy_type_Type == nullptr, "should be");
assert(AllowEnhancedClassRedefinition || _arraycopy_type_Type == nullptr, "should be");
const Type** fields = TypeTuple::fields(ParmLimit - TypeFunc::Parms);
fields[Src] = TypeInstPtr::BOTTOM;
fields[SrcPos] = TypeInt::INT;

View File

@@ -36,6 +36,7 @@
#include "runtime/globals_extension.hpp"
#include "utilities/macros.hpp"
bool C2Compiler::_reinitialize_vm_klasses = false;
// register information defined by ADLC
extern const char register_save_policy[];

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