Skip to content

Commit 08adc55

Browse files
committed
Merge master HEAD into openj9-staging
Signed-off-by: J9 Build <[email protected]>
2 parents c2bf70d + 68c4069 commit 08adc55

File tree

26 files changed

+716
-402
lines changed

26 files changed

+716
-402
lines changed

doc/hotspot-style.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -217,10 +217,10 @@ <h3 id="source-files">Source Files</h3>
217217
should be put in the .hpp file, and not in the .inline.hpp file. This
218218
rule exists to resolve problems with circular dependencies between
219219
.inline.hpp files.</p></li>
220-
<li><p>All .cpp files include precompiled.hpp as the first include
221-
line.</p></li>
222-
<li><p>precompiled.hpp is just a build time optimization, so don't rely
223-
on it to resolve include problems.</p></li>
220+
<li><p>Some build configurations use precompiled headers to speed up the
221+
build times. The precompiled headers are included in the precompiled.hpp
222+
file. Note that precompiled.hpp is just a build time optimization, so
223+
don't rely on it to resolve include problems.</p></li>
224224
<li><p>Keep the include lines alphabetically sorted.</p></li>
225225
<li><p>Put conditional inclusions (<code>#if ...</code>) at the end of
226226
the include list.</p></li>

doc/hotspot-style.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,10 @@ the first include line. Declarations needed by other files should be put
150150
in the .hpp file, and not in the .inline.hpp file. This rule exists to
151151
resolve problems with circular dependencies between .inline.hpp files.
152152

153-
* All .cpp files include precompiled.hpp as the first include line.
154-
155-
* precompiled.hpp is just a build time optimization, so don't rely on
156-
it to resolve include problems.
153+
* Some build configurations use precompiled headers to speed up the
154+
build times. The precompiled headers are included in the precompiled.hpp
155+
file. Note that precompiled.hpp is just a build time optimization, so
156+
don't rely on it to resolve include problems.
157157

158158
* Keep the include lines alphabetically sorted.
159159

make/RunTests.gmk

+4
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ $(eval $(call IncludeCustomExtension, RunTests.gmk))
7878

7979
# This is the JDK that we will test
8080
JDK_UNDER_TEST := $(JDK_IMAGE_DIR)
81+
# The JDK used to compile jtreg test code. By default it is the same as
82+
# JDK_UNDER_TEST.
83+
JDK_FOR_COMPILE := $(JDK_IMAGE_DIR)
8184

8285
TEST_RESULTS_DIR := $(OUTPUTDIR)/test-results
8386
TEST_SUPPORT_DIR := $(OUTPUTDIR)/test-support
@@ -979,6 +982,7 @@ define SetupRunJtregTestBody
979982
$$(JTREG_JAVA) $$($1_JTREG_LAUNCHER_OPTIONS) \
980983
-Dprogram=jtreg -jar $$(JT_HOME)/lib/jtreg.jar \
981984
$$($1_JTREG_BASIC_OPTIONS) \
985+
-compilejdk:$$(JDK_FOR_COMPILE) \
982986
-testjdk:$$(JDK_UNDER_TEST) \
983987
-dir:$$(JTREG_TOPDIR) \
984988
-reportDir:$$($1_TEST_RESULTS_DIR) \

make/autoconf/flags-cflags.m4

+9-9
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ AC_DEFUN([FLAGS_SETUP_WARNINGS],
299299
AC_DEFUN([FLAGS_SETUP_QUALITY_CHECKS],
300300
[
301301
# bounds, memory and behavior checking options
302-
if test "x$TOOLCHAIN_TYPE" = xgcc; then
302+
if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then
303303
case $DEBUG_LEVEL in
304304
release )
305305
# no adjustment
@@ -556,12 +556,6 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
556556
-fvisibility=hidden -fno-strict-aliasing -fno-omit-frame-pointer"
557557
fi
558558
559-
if test "x$TOOLCHAIN_TYPE" = xclang && test "x$OPENJDK_TARGET_OS" = xaix; then
560-
# clang compiler on aix needs -ffunction-sections
561-
TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -ffunction-sections -ftls-model -fno-math-errno -fstack-protector"
562-
TOOLCHAIN_CFLAGS_JDK="-ffunction-sections -fsigned-char -fstack-protector"
563-
fi
564-
565559
if test "x$TOOLCHAIN_TYPE" = xgcc; then
566560
TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -fstack-protector"
567561
TOOLCHAIN_CFLAGS_JDK="-fvisibility=hidden -pipe -fstack-protector"
@@ -581,7 +575,7 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
581575
# Restrict the debug information created by Clang to avoid
582576
# too big object files and speed the build up a little bit
583577
# (see http://llvm.org/bugs/show_bug.cgi?id=7554)
584-
TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -flimit-debug-info"
578+
TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -flimit-debug-info -fstack-protector"
585579
586580
# In principle the stack alignment below is cpu- and ABI-dependent and
587581
# should agree with values of StackAlignmentInBytes in various
@@ -599,7 +593,13 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
599593
TOOLCHAIN_CFLAGS_JDK="-pipe"
600594
TOOLCHAIN_CFLAGS_JDK_CONLY="-fno-strict-aliasing" # technically NOT for CXX
601595
fi
602-
TOOLCHAIN_CFLAGS_JDK="$TOOLCHAIN_CFLAGS_JDK -fvisibility=hidden"
596+
597+
if test "x$OPENJDK_TARGET_OS" = xaix; then
598+
TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -ffunction-sections -ftls-model -fno-math-errno"
599+
TOOLCHAIN_CFLAGS_JDK="-ffunction-sections -fsigned-char"
600+
fi
601+
602+
TOOLCHAIN_CFLAGS_JDK="$TOOLCHAIN_CFLAGS_JDK -fvisibility=hidden -fstack-protector"
603603
604604
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
605605
# Suggested additions: -qsrcmsg to get improved error reporting

make/modules/java.desktop/lib/ClientLibraries.gmk

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -371,8 +371,6 @@ else
371371
LIBFONTMANAGER_JDK_LIBS += libfreetype
372372
endif
373373

374-
LIBFONTMANAGER_OPTIMIZATION := HIGHEST
375-
376374
ifneq ($(filter $(TOOLCHAIN_TYPE), gcc clang), )
377375
# gcc (and to an extent clang) is particularly bad at optimizing these files,
378376
# causing a massive spike in compile time. We don't care about these
@@ -383,7 +381,6 @@ endif
383381

384382
ifeq ($(call isTargetOs, windows), true)
385383
LIBFONTMANAGER_EXCLUDE_FILES += X11FontScaler.c X11TextRenderer.c
386-
LIBFONTMANAGER_OPTIMIZATION := HIGHEST
387384
else ifeq ($(call isTargetOs, macosx), true)
388385
LIBFONTMANAGER_EXCLUDE_FILES += X11FontScaler.c X11TextRenderer.c \
389386
fontpath.c lcdglyph.c
@@ -404,7 +401,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBFONTMANAGER, \
404401
AccelGlyphCache.c, \
405402
CFLAGS := $(LIBFONTMANAGER_CFLAGS), \
406403
CXXFLAGS := $(LIBFONTMANAGER_CFLAGS), \
407-
OPTIMIZATION := $(LIBFONTMANAGER_OPTIMIZATION), \
404+
OPTIMIZATION := HIGHEST, \
408405
CFLAGS_windows = -DCC_NOEX, \
409406
EXTRA_HEADER_DIRS := $(LIBFONTMANAGER_EXTRA_HEADER_DIRS), \
410407
EXTRA_SRC := $(LIBFONTMANAGER_EXTRA_SRC), \

src/java.base/share/classes/jdk/internal/util/DecimalDigits.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public final class DecimalDigits {
6262
private static final short[] DIGITS;
6363

6464
static {
65-
short[] digits = new short[10 * 10];
65+
short[] digits = new short[128];
6666

6767
for (int i = 0; i < 10; i++) {
6868
short hi = (short) (i + '0');
@@ -394,7 +394,7 @@ public static int getChars(long i, int index, char[] buf) {
394394
* @param v to convert
395395
*/
396396
public static void putPair(char[] buf, int charPos, int v) {
397-
int packed = DIGITS[v];
397+
int packed = DIGITS[v & 0x7f];
398398
buf[charPos ] = (char) (packed & 0xFF);
399399
buf[charPos + 1] = (char) (packed >> 8);
400400
}
@@ -407,7 +407,7 @@ public static void putPair(char[] buf, int charPos, int v) {
407407
* @param v to convert
408408
*/
409409
public static void putPairLatin1(byte[] buf, int charPos, int v) {
410-
int packed = DIGITS[v];
410+
int packed = DIGITS[v & 0x7f];
411411
putCharLatin1(buf, charPos, packed & 0xFF);
412412
putCharLatin1(buf, charPos + 1, packed >> 8);
413413
}
@@ -420,7 +420,7 @@ public static void putPairLatin1(byte[] buf, int charPos, int v) {
420420
* @param v to convert
421421
*/
422422
public static void putPairUTF16(byte[] buf, int charPos, int v) {
423-
int packed = DIGITS[v];
423+
int packed = DIGITS[v & 0x7f];
424424
putCharUTF16(buf, charPos, packed & 0xFF);
425425
putCharUTF16(buf, charPos + 1, packed >> 8);
426426
}

src/java.base/share/classes/jdk/internal/util/OctalDigits.java

-130
This file was deleted.

src/java.desktop/unix/classes/sun/awt/UNIXToolkit.java

+30-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2004, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2004, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -51,7 +51,6 @@
5151
import java.io.BufferedReader;
5252
import java.io.IOException;
5353
import java.io.InputStreamReader;
54-
import java.util.Arrays;
5554

5655
import sun.awt.X11.XBaseWindow;
5756
import com.sun.java.swing.plaf.gtk.GTKConstants.TextDirection;
@@ -521,6 +520,20 @@ public boolean isRunningOnWayland() {
521520
// application icons).
522521
private static final WindowFocusListener waylandWindowFocusListener;
523522

523+
private static boolean containsWaylandWindowFocusListener(Window window) {
524+
if (window == null) {
525+
return false;
526+
}
527+
528+
for (WindowFocusListener focusListener : window.getWindowFocusListeners()) {
529+
if (focusListener == waylandWindowFocusListener) {
530+
return true;
531+
}
532+
}
533+
534+
return false;
535+
}
536+
524537
static {
525538
if (isOnWayland()) {
526539
waylandWindowFocusListener = new WindowAdapter() {
@@ -530,13 +543,22 @@ public void windowLostFocus(WindowEvent e) {
530543
Window oppositeWindow = e.getOppositeWindow();
531544

532545
// The focus can move between the window calling the popup,
533-
// and the popup window itself.
546+
// and the popup window itself or its children.
534547
// We only dismiss the popup in other cases.
535548
if (oppositeWindow != null) {
536-
if (window == oppositeWindow.getParent() ) {
549+
if (containsWaylandWindowFocusListener(oppositeWindow.getOwner())) {
537550
addWaylandWindowFocusListenerToWindow(oppositeWindow);
538551
return;
539552
}
553+
554+
Window owner = window.getOwner();
555+
while (owner != null) {
556+
if (owner == oppositeWindow) {
557+
return;
558+
}
559+
owner = owner.getOwner();
560+
}
561+
540562
if (window.getParent() == oppositeWindow) {
541563
return;
542564
}
@@ -557,11 +579,11 @@ public void windowLostFocus(WindowEvent e) {
557579
}
558580

559581
private static void addWaylandWindowFocusListenerToWindow(Window window) {
560-
if (!Arrays
561-
.asList(window.getWindowFocusListeners())
562-
.contains(waylandWindowFocusListener)
563-
) {
582+
if (!containsWaylandWindowFocusListener(window)) {
564583
window.addWindowFocusListener(waylandWindowFocusListener);
584+
for (Window ownedWindow : window.getOwnedWindows()) {
585+
addWaylandWindowFocusListenerToWindow(ownedWindow);
586+
}
565587
}
566588
}
567589

0 commit comments

Comments
 (0)