Skip to content

Commit

Permalink
Merge master jdk-17.0.14+2 into openj9-staging
Browse files Browse the repository at this point in the history
Signed-off-by: J9 Build <j9build@ca.ibm.com>
  • Loading branch information
j9build committed Nov 7, 2024
2 parents b841f37 + 5177c04 commit 2d44fdb
Show file tree
Hide file tree
Showing 66 changed files with 2,813 additions and 902 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/build-cross-compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ jobs:
- target-cpu: riscv64
gnu-arch: riscv64
debian-arch: riscv64
debian-repository: https://snapshot.debian.org/archive/debian/20240228T034848Z/
debian-repository: https://httpredir.debian.org/debian/
debian-version: sid
tolerate-sysroot-errors: true

Expand Down Expand Up @@ -131,6 +131,7 @@ jobs:
id: create-sysroot
run: >
sudo debootstrap
--no-merged-usr
--arch=${{ matrix.debian-arch }}
--verbose
--include=fakeroot,symlinks,build-essential,libx11-dev,libxext-dev,libxrender-dev,libxrandr-dev,libxtst-dev,libxt-dev,libcups2-dev,libfontconfig1-dev,libasound2-dev,libfreetype-dev,libpng-dev
Expand All @@ -151,6 +152,9 @@ jobs:
rm -rf sysroot/usr/{sbin,bin,share}
rm -rf sysroot/usr/lib/{apt,gcc,udev,systemd}
rm -rf sysroot/usr/libexec/gcc
# /{bin,sbin,lib}/ are not symbolic links to /usr/{bin,sbin,lib}/ when debootstrap with --no-merged-usr
rm -rf sysroot/{sbin,bin}
rm -rf sysroot/lib/{udev,systemd}
if: steps.create-sysroot.outcome == 'success' && steps.get-cached-sysroot.outputs.cache-hit != 'true'

- name: 'Remove broken sysroot'
Expand Down
14 changes: 14 additions & 0 deletions make/common/NativeCompilation.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,21 @@ DEPENDENCY_TARGET_SED_PATTERN := \
# The fix-deps-file macro is used to adjust the contents of the generated make
# dependency files to contain paths compatible with make.
#
REWRITE_PATHS_RELATIVE = false
ifeq ($(ALLOW_ABSOLUTE_PATHS_IN_OUTPUT)-$(FILE_MACRO_CFLAGS), false-)
REWRITE_PATHS_RELATIVE = true
endif

# CCACHE_BASEDIR needs fix-deps-file as makefiles use absolute filenames for
# object files while CCACHE_BASEDIR will make ccache relativize all paths for
# its compiler. The compiler then produces relative dependency files.
# make does not know a relative and absolute filename is the same so it will
# ignore such dependencies.
ifneq ($(CCACHE), )
REWRITE_PATHS_RELATIVE = true
endif

ifeq ($(REWRITE_PATHS_RELATIVE), true)
# Need to handle -I flags as both '-Ifoo' and '-I foo'.
MakeCommandRelative = \
$(CD) $(WORKSPACE_ROOT) && \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -1764,8 +1764,7 @@ void updateForm(Function<LambdaForm, LambdaForm> updater) {
if (oldForm != newForm) {
assert (newForm.customized == null || newForm.customized == this);
newForm.prepare(); // as in MethodHandle.<init>
UNSAFE.putReference(this, FORM_OFFSET, newForm);
UNSAFE.fullFence();
UNSAFE.putReferenceRelease(this, FORM_OFFSET, newForm); // properly publish newForm
}
} finally {
updateInProgress = false;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand All @@ -25,13 +25,32 @@

package com.apple.laf;

import java.awt.*;

import javax.swing.*;
import java.awt.Color;
import java.awt.Component;
import java.awt.Graphics;
import java.awt.Insets;

import javax.accessibility.AccessibleContext;
import javax.swing.ButtonModel;
import javax.swing.CellRendererPane;
import javax.swing.DefaultButtonModel;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.ListCellRenderer;
import javax.swing.UIManager;
import javax.swing.plaf.UIResource;

import apple.laf.JRSUIConstants.AlignmentHorizontal;
import apple.laf.JRSUIConstants.AlignmentVertical;
import apple.laf.JRSUIConstants.ArrowsOnly;
import apple.laf.JRSUIConstants.Focused;
import apple.laf.JRSUIConstants.IndicatorOnly;
import apple.laf.JRSUIConstants.Size;
import apple.laf.JRSUIConstants.State;
import apple.laf.JRSUIConstants.Widget;
import apple.laf.JRSUIState;
import apple.laf.JRSUIConstants.*;

@SuppressWarnings("serial") // Superclass is not serializable across versions
class AquaComboBoxButton extends JButton {
Expand Down Expand Up @@ -169,12 +188,15 @@ public void paintComponent(final Graphics g) {
}
}

protected void doRendererPaint(final Graphics g, final ButtonModel buttonModel, final boolean editable, final Insets insets, int left, int top, int width, int height) {
private Component getRendererComponent() {
final ListCellRenderer<Object> renderer = comboBox.getRenderer();

return renderer.getListCellRendererComponent(list, comboBox.getSelectedItem(), -1, false, false);
}

protected void doRendererPaint(final Graphics g, final ButtonModel buttonModel, final boolean editable, final Insets insets, int left, int top, int width, int height) {
// fake it out! not renderPressed
final Component c = renderer.getListCellRendererComponent(list, comboBox.getSelectedItem(), -1, false, false);
// System.err.println("Renderer: " + renderer);
final Component c = getRendererComponent();

if (!editable && !AquaComboBoxUI.isTableCellEditor(comboBox)) {
final int indentLeft = 10;
Expand Down Expand Up @@ -233,4 +255,25 @@ protected void doRendererPaint(final Graphics g, final ButtonModel buttonModel,
// Remove component from renderer pane, allowing it to be gc'ed.
rendererPane.remove(c);
}

@Override
public AccessibleContext getAccessibleContext() {
if (accessibleContext == null) {
accessibleContext = new AccessibleAquaComboBoxButton();
}
return accessibleContext;
}

private final class AccessibleAquaComboBoxButton extends AccessibleJButton {
@Override
public String getAccessibleName() {
String name = super.getAccessibleName();
if ((name == null || name.isEmpty())
&& (!comboBox.isEditable() && comboBox.getSelectedItem() != null)) {
Component c = getRendererComponent();
name = c.getAccessibleContext().getAccessibleName();
}
return name;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -729,4 +729,35 @@ public AquaComboBoxUI convertJComponentToTarget(final JComboBox<?> combo) {
static ClientPropertyApplicator<JComboBox<?>, AquaComboBoxUI> getApplicator() {
return APPLICATOR.get();
}

@Override
public int getAccessibleChildrenCount(JComponent c) {
return 2;
}

@Override
public Accessible getAccessibleChild(JComponent c, int i) {
// 0 = the popup
// 1 = the editor for editable combobox and the arrow button for non-editable combobox
switch ( i ) {
case 0:
if (popup instanceof Accessible accessiblePopup) {
AccessibleContext ac = accessiblePopup.getAccessibleContext();
ac.setAccessibleParent(comboBox);
return accessiblePopup;
}
break;
case 1:
if (comboBox.isEditable()
&& (editor instanceof Accessible accessibleEditor)) {
AccessibleContext ac = accessibleEditor.getAccessibleContext();
ac.setAccessibleParent(comboBox);
return accessibleEditor;
} else if (!comboBox.isEditable()) {
return arrowButton;
}
break;
}
return null;
}
}
7 changes: 5 additions & 2 deletions src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
// keyboard layout
static NSString *kbdLayout;

// Constant for keyman layouts
#define KEYMAN_LAYOUT "keyman"

@interface AWTView()
@property (retain) CDropTarget *_dropTarget;
@property (retain) CDragSource *_dragSource;
Expand Down Expand Up @@ -259,7 +262,7 @@ - (void) scrollWheel: (NSEvent*) event {

- (void) keyDown: (NSEvent *)event {
fProcessingKeystroke = YES;
fKeyEventsNeeded = YES;
fKeyEventsNeeded = ![(NSString *)kbdLayout containsString:@KEYMAN_LAYOUT];

// Allow TSM to look at the event and potentially send back NSTextInputClient messages.
[self interpretKeyEvents:[NSArray arrayWithObject:event]];
Expand Down Expand Up @@ -961,7 +964,7 @@ - (void) insertText:(id)aString replacementRange:(NSRange)replacementRange

if ((utf16Length > 2) ||
((utf8Length > 1) && [self isCodePointInUnicodeBlockNeedingIMEvent:codePoint]) ||
((codePoint == 0x5c) && ([(NSString *)kbdLayout containsString:@"Kotoeri"]))) {
[(NSString *)kbdLayout containsString:@KEYMAN_LAYOUT]) {
aStringIsComplex = YES;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand All @@ -25,15 +25,15 @@

package javax.swing;

import javax.swing.*;
import javax.swing.event.*;
import javax.swing.border.*;

import java.awt.Component;
import java.awt.Color;
import java.awt.Component;
import java.awt.Rectangle;

import java.io.Serializable;

import javax.swing.border.Border;
import javax.swing.border.EmptyBorder;
import javax.swing.plaf.synth.SynthListUI;

import sun.swing.DefaultLookup;
import sun.swing.SwingUtilities2;

Expand Down Expand Up @@ -157,7 +157,11 @@ public Component getListCellRendererComponent(
setText((value == null) ? "" : value.toString());
}

setEnabled(list.isEnabled());
if (list.getName() == null || !list.getName().equals("ComboBox.list")
|| !(list.getUI() instanceof SynthListUI)) {
setEnabled(list.isEnabled());
}

setFont(list.getFont());

Border border = null;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -39,6 +39,7 @@

import javax.swing.ComboBoxEditor;
import javax.swing.DefaultButtonModel;
import javax.swing.DefaultListCellRenderer;
import javax.swing.Icon;
import javax.swing.JButton;
import javax.swing.JComboBox;
Expand Down Expand Up @@ -108,6 +109,8 @@ public class SynthComboBoxUI extends BasicComboBoxUI implements
*/
private EditorFocusHandler editorFocusHandler;

private DlcrEnabledHandler dlcrEnabledHandler;

/**
* If true, then the cell renderer will be forced to be non-opaque when
* used for rendering the selected item in the combo box (not in the list),
Expand Down Expand Up @@ -187,6 +190,7 @@ protected void installListeners() {
comboBox.addPropertyChangeListener(this);
comboBox.addMouseListener(buttonHandler);
editorFocusHandler = new EditorFocusHandler(comboBox);
dlcrEnabledHandler = new DlcrEnabledHandler(comboBox);
super.installListeners();
}

Expand Down Expand Up @@ -219,6 +223,7 @@ protected void uninstallDefaults() {
@Override
protected void uninstallListeners() {
editorFocusHandler.unregister();
dlcrEnabledHandler.unregister();
comboBox.removePropertyChangeListener(this);
comboBox.removeMouseListener(buttonHandler);
buttonHandler.pressed = false;
Expand Down Expand Up @@ -794,4 +799,36 @@ public void propertyChange(PropertyChangeEvent evt) {
}
}
}

/**
* Handler for updating combobox enabled status when renderer enabled
* status changes
*/
private static class DlcrEnabledHandler implements PropertyChangeListener {
private JComboBox<?> comboBox;

private DlcrEnabledHandler(JComboBox<?> comboBox) {
this.comboBox = comboBox;
comboBox.addPropertyChangeListener("enabled",this);
}

public void unregister() {
comboBox.removePropertyChangeListener("enabled", this);
}

/**
* Called when the combos enabled status changes
*
* @param evt A PropertyChangeEvent object describing the event source
* and the property that has changed.
*/
public void propertyChange(PropertyChangeEvent evt) {
if (evt.getPropertyName().equals("enabled")) {
if (comboBox.getRenderer() instanceof DefaultListCellRenderer) {
((DefaultListCellRenderer) comboBox.getRenderer())
.setEnabled((boolean) evt.getNewValue());
}
}
}
}
}
1 change: 1 addition & 0 deletions src/java.desktop/unix/classes/sun/awt/X11/XWindowPeer.java
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,7 @@ protected Point getNewLocation(XConfigureEvent xe, int leftInset, int topInset)
// TODO this should be the default for every case.
switch (runningWM) {
case XWM.CDE_WM:
case XWM.KDE2_WM:
case XWM.MOTIF_WM:
case XWM.METACITY_WM:
case XWM.MUTTER_WM:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* 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.
*/

/**
* @test
* @bug 8337066
* @summary Test that MergeMem is skipped when looking for stores
* @compile -encoding UTF-8 TestAntiDependencyForPinnedLoads.java
* @run main/othervm -Xbatch -XX:-TieredCompilation
* -XX:CompileCommand=compileonly,java.lang.StringUTF16::reverse
* compiler.controldependency.TestAntiDependencyForPinnedLoads
*/

package compiler.controldependency;

public class TestAntiDependencyForPinnedLoads {
public static void main(String[] args) {
for(int i = 0; i < 50_000; i++) {
String str = "YYYY年MM月DD日";
StringBuffer strBuffer = new StringBuffer(str);
String revStr = strBuffer.reverse().toString();
if (!revStr.equals("日DD月MM年YYYY")) throw new InternalError("FAIL");
}
}
}
Loading

0 comments on commit 2d44fdb

Please sign in to comment.