Skip to content

Commit

Permalink
Merge branch 'upstream-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Datadog Syncup Service committed Aug 8, 2024
2 parents 6b3ac81 + 4b740d8 commit 663df42
Show file tree
Hide file tree
Showing 34 changed files with 435 additions and 3,481 deletions.
34 changes: 31 additions & 3 deletions make/RunTests.gmk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -748,8 +748,6 @@ define SetupRunJtregTestBody
# we may end up with a lot of JVM's
$1_JTREG_MAX_RAM_PERCENTAGE := $$(shell $(AWK) 'BEGIN { print 25 / $$($1_JTREG_JOBS); }')

JTREG_TIMEOUT_FACTOR ?= 4

JTREG_VERBOSE ?= fail,error,summary
JTREG_RETAIN ?= fail,error
JTREG_TEST_THREAD_FACTORY ?=
Expand Down Expand Up @@ -837,6 +835,24 @@ define SetupRunJtregTestBody
$1_JTREG_BASIC_OPTIONS += $$(addprefix $$(JTREG_PROBLEM_LIST_PREFIX), $$($1_JTREG_PROBLEM_LIST))
endif

JTREG_ALL_OPTIONS := $$(JTREG_JAVA_OPTIONS) $$(JTREG_VM_OPTIONS)

JTREG_AUTO_PROBLEM_LISTS :=
JTREG_AUTO_TIMEOUT_FACTOR := 4

ifneq ($$(findstring -Xcomp, $$(JTREG_ALL_OPTIONS)), )
JTREG_AUTO_PROBLEM_LISTS += ProblemList-Xcomp.txt
JTREG_AUTO_TIMEOUT_FACTOR := 10
endif

ifneq ($$(findstring -XX:+UseZGC, $$(JTREG_ALL_OPTIONS)), )
ifneq ($$(findstring -XX:-ZGenerational, $$(JTREG_ALL_OPTIONS)), )
JTREG_AUTO_PROBLEM_LISTS += ProblemList-zgc.txt
else
JTREG_AUTO_PROBLEM_LISTS += ProblemList-generational-zgc.txt
endif
endif

ifneq ($$(JTREG_EXTRA_PROBLEM_LISTS), )
# Accept both absolute paths as well as relative to the current test root.
$1_JTREG_BASIC_OPTIONS += $$(addprefix $$(JTREG_PROBLEM_LIST_PREFIX), $$(wildcard \
Expand Down Expand Up @@ -868,6 +884,18 @@ define SetupRunJtregTestBody

$$(eval $$(call SetupRunJtregTestCustom, $1))

# SetupRunJtregTestCustom might also adjust JTREG_AUTO_ variables
# so set the final results after setting values from custom setup
ifneq ($$(JTREG_AUTO_PROBLEM_LISTS), )
# Accept both absolute paths as well as relative to the current test root.
$1_JTREG_BASIC_OPTIONS += $$(addprefix $$(JTREG_PROBLEM_LIST_PREFIX), $$(wildcard \
$$(JTREG_AUTO_PROBLEM_LISTS) \
$$(addprefix $$($1_TEST_ROOT)/, $$(JTREG_AUTO_PROBLEM_LISTS)) \
))
endif

JTREG_TIMEOUT_FACTOR ?= $$(JTREG_AUTO_TIMEOUT_FACTOR)

clean-outputdirs-$1:
$$(RM) -r $$($1_TEST_SUPPORT_DIR)
$$(RM) -r $$($1_TEST_RESULTS_DIR)
Expand Down
4 changes: 0 additions & 4 deletions make/modules/java.desktop/lib/AwtLibraries.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,6 @@ ifeq ($(call isTargetOs, windows macosx)+$(ENABLE_HEADLESS_ONLY), false+false)
DISABLED_WARNINGS_gcc := int-to-pointer-cast, \
DISABLED_WARNINGS_gcc_awt_Taskbar.c := parentheses, \
DISABLED_WARNINGS_gcc_GLXSurfaceData.c := unused-function, \
DISABLED_WARNINGS_gcc_gtk2_interface.c := parentheses type-limits, \
DISABLED_WARNINGS_gcc_gtk3_interface.c := parentheses type-limits \
unused-function, \
DISABLED_WARNINGS_gcc_OGLBufImgOps.c := format-nonliteral, \
Expand All @@ -252,7 +251,6 @@ ifeq ($(call isTargetOs, windows macosx)+$(ENABLE_HEADLESS_ONLY), false+false)
DISABLED_WARNINGS_gcc_XToolkit.c := unused-result, \
DISABLED_WARNINGS_gcc_XWindow.c := unused-function, \
DISABLED_WARNINGS_clang_awt_Taskbar.c := parentheses, \
DISABLED_WARNINGS_clang_gtk2_interface.c := parentheses, \
DISABLED_WARNINGS_clang_gtk3_interface.c := parentheses, \
DISABLED_WARNINGS_clang_OGLBufImgOps.c := format-nonliteral, \
DISABLED_WARNINGS_clang_OGLPaints.c := format-nonliteral, \
Expand All @@ -262,8 +260,6 @@ ifeq ($(call isTargetOs, windows macosx)+$(ENABLE_HEADLESS_ONLY), false+false)
DISABLED_WARNINGS_clang_aix_awt_Taskbar.c := parentheses, \
DISABLED_WARNINGS_clang_aix_OGLPaints.c := format-nonliteral, \
DISABLED_WARNINGS_clang_aix_OGLBufImgOps.c := format-nonliteral, \
DISABLED_WARNINGS_clang_aix_gtk2_interface.c := parentheses \
logical-op-parentheses, \
DISABLED_WARNINGS_clang_aix_gtk3_interface.c := parentheses \
logical-op-parentheses, \
DISABLED_WARNINGS_clang_aix_sun_awt_X11_GtkFileDialogPeer.c := \
Expand Down
2 changes: 0 additions & 2 deletions src/hotspot/share/memory/metaspace/blockTree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,6 @@ void BlockTree::verify() const {
// (which also verifies that we visited every node, or at least
// as many nodes as are in this tree)
_counter.check(counter);

#undef assrt0n
}

void BlockTree::zap_range(MetaWord* p, size_t word_size) {
Expand Down
4 changes: 3 additions & 1 deletion src/hotspot/share/prims/jvmtiEventController.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -982,6 +982,8 @@ JvmtiEventControllerPrivate::change_field_watch(jvmtiEvent event_type, bool adde
added? "add" : "remove",
*count_addr));

JvmtiVTMSTransitionDisabler disabler;

if (added) {
(*count_addr)++;
if (*count_addr == 1) {
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/runtime/mutexLocker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,6 @@ void mutex_init() {

MUTEX_DEFN(JvmtiThreadState_lock , PaddedMutex , safepoint); // Used by JvmtiThreadState/JvmtiEventController
MUTEX_DEFN(EscapeBarrier_lock , PaddedMonitor, nosafepoint); // Used to synchronize object reallocation/relocking triggered by JVMTI
MUTEX_DEFN(JvmtiVTMSTransition_lock , PaddedMonitor, safepoint); // used for Virtual Thread Mount State transition management
MUTEX_DEFN(Management_lock , PaddedMutex , safepoint); // used for JVM management

MUTEX_DEFN(ConcurrentGCBreakpoints_lock , PaddedMonitor, safepoint, true);
Expand Down Expand Up @@ -355,6 +354,7 @@ void mutex_init() {
// JVMCIRuntime_lock must be acquired before JVMCI_lock to avoid deadlock
MUTEX_DEFL(JVMCI_lock , PaddedMonitor, JVMCIRuntime_lock);
#endif
MUTEX_DEFL(JvmtiVTMSTransition_lock , PaddedMonitor, JvmtiThreadState_lock); // used for Virtual Thread Mount State transition management

// Allocate RecursiveMutex
MultiArray_lock = new RecursiveMutex();
Expand Down
2 changes: 1 addition & 1 deletion src/java.base/share/classes/java/util/Deque.java
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@
* </tr>
* <tr>
* <th scope="row">{@link #peek() peek()}</th>
* <td>{@link #getFirst() getFirst()}</td>
* <td>{@link #peekFirst() peekFirst()}</td>
* </tr>
* </tbody>
* </table>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -62,6 +62,7 @@
import java.util.regex.Pattern;
import java.util.stream.Stream;

import jdk.internal.util.StaticProperty;
import sun.security.action.GetPropertyAction;
import sun.util.resources.LocaleData;
import sun.util.resources.OpenListResourceBundle;
Expand Down Expand Up @@ -289,6 +290,16 @@ public String getCurrencyName(String key) {
}

public String getLocaleName(String key) {
// Get names for old ISO codes with new ISO code resources
if (StaticProperty.javaLocaleUseOldISOCodes().equalsIgnoreCase("true")) {
key = switch (key) {
case "iw" -> "he";
case "in" -> "id";
case "ji" -> "yi";
default -> key;
};
}

Object localeName = null;
String cacheKey = LOCALE_NAMES + key;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -61,7 +61,7 @@ class GTKEngine {
/** Size of the image cache */
private static final int CACHE_SIZE = 50;

/** This enum mirrors that in gtk2_interface.h */
/** This enum mirrors that in gtk_interface.h */
static enum WidgetType {
BUTTON, CHECK_BOX, CHECK_BOX_MENU_ITEM, COLOR_CHOOSER,
COMBO_BOX, COMBO_BOX_ARROW_BUTTON, COMBO_BOX_TEXT_FIELD,
Expand Down Expand Up @@ -493,13 +493,13 @@ public void paintShadow(Graphics g, SynthContext context,
GTKLookAndFeel.synthStateToGTKStateType(state).ordinal();
int synthState = context.getComponentState();
Container parent = context.getComponent().getParent();
if(GTKLookAndFeel.is3()) {
if (parent != null && parent.getParent() instanceof JComboBox) {
if (parent.getParent().hasFocus()) {
synthState |= SynthConstants.FOCUSED;
}

if (parent != null && parent.getParent() instanceof JComboBox) {
if (parent.getParent().hasFocus()) {
synthState |= SynthConstants.FOCUSED;
}
}

int dir = getTextDirection(context);
int widget = getWidgetType(context.getComponent(), id).ordinal();
native_paint_shadow(widget, gtkState, shadowType.ordinal(), detail,
Expand Down Expand Up @@ -628,7 +628,7 @@ public void themeChanged() {
cache.flush();
}

/* GtkSettings enum mirrors that in gtk2_interface.h */
/* GtkSettings enum mirrors that in gtk_interface.h */
public Object getSetting(Settings property) {
synchronized(sun.awt.UNIXToolkit.GTK_LOCK) {
return native_get_gtk_setting(property.ordinal());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -44,7 +44,7 @@ class GTKIconFactory {
static final int CHECK_ICON_EXTRA_INSET = 1;
static final int DEFAULT_ICON_SPACING = 2;
static final int DEFAULT_ICON_SIZE = 13;
static final int DEFAULT_TOGGLE_MENU_ITEM_SIZE = 12; // For pre-gtk2.4
static final int DEFAULT_TOGGLE_MENU_ITEM_SIZE = 12;

private static final String RADIO_BUTTON_ICON = "paintRadioButtonIcon";
private static final String CHECK_BOX_ICON = "paintCheckBoxIcon";
Expand Down Expand Up @@ -214,7 +214,7 @@ int getIconDimension(SynthContext context) {

Region region = context.getRegion();
GTKStyle style = (GTKStyle) context.getStyle();
if (GTKLookAndFeel.is3() && region == Region.MENU) {
if (region == Region.MENU) {
Object value = style.getClassSpecificValue("arrow-scaling");
if (value instanceof Number) {
iconDimension = (int)(((Number) value).floatValue() *
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@
*/
@SuppressWarnings("serial") // Superclass not serializable
public class GTKLookAndFeel extends SynthLookAndFeel {
private static boolean IS_22;
private static boolean IS_3;

/**
Expand Down Expand Up @@ -124,17 +123,6 @@ public class GTKLookAndFeel extends SynthLookAndFeel {
*/
private static String gtkThemeName = "Default";

/**
* Returns true if running on system containing at least 2.2.
*/
static boolean is2_2() {
// NOTE: We're currently hard coding to use 2.2.
// If we want to support both GTK 2.0 and 2.2, we'll
// need to get the major/minor/micro version from the .so.
// Refer to bug 4912613 for details.
return IS_22;
}

static boolean is3() {
return IS_3;
}
Expand Down Expand Up @@ -1454,17 +1442,7 @@ public void initialize() {
throw new InternalError("Unable to load native GTK libraries");
}

if (UNIXToolkit.getGtkVersion() == UNIXToolkit.GtkVersions.GTK2) {
@SuppressWarnings("removal")
String version = AccessController.doPrivileged(
new GetPropertyAction("jdk.gtk.version"));
if (version != null) {
IS_22 = version.equals("2.2");
} else {
IS_22 = true;
}
} else if (UNIXToolkit.getGtkVersion() ==
UNIXToolkit.GtkVersions.GTK3) {
if (UNIXToolkit.getGtkVersion() == UNIXToolkit.GtkVersions.GTK3) {
IS_3 = true;
}

Expand Down
Loading

0 comments on commit 663df42

Please sign in to comment.