Compare commits

...

10 Commits

Author SHA1 Message Date
Mikhail Grishchenko
a010ad3ade updated JTreg exclude list
exclude some tests from security/infra/java/security/cert/CertPathValidator
JBR-3500 exclude sun/java2d/ClassCastExceptionForInvalidSurface.java for linux-all

(cherry picked from commit a2a2572f78)
2021-07-02 19:30:13 +07:00
Maxim Kartashev
b534647f1d JBR-3568 Backport JDK-8261812 to JBR11
(cherry picked from commit 7b992c7cd7)
2021-07-02 19:23:00 +07:00
Anton Tarasov
1f7adfe26c 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)
2021-06-24 10:51:24 +07:00
Denis Konoplev
e31fc34ea5 JBR-3544: Generate popup invoked instead of New in this directory
Fix logical error

(cherry picked from commit 752c0e5a49)
2021-06-24 10:51:17 +07:00
Denis Konoplev
24eb3d3a8d JBR-3544: Generate popup invoked instead of New in this directory
CR: change duplicate Ctrl to Cmd
(cherry picked from commit 3ea7913eaf)
2021-06-24 10:51:13 +07:00
Anton Tarasov
d1f250c392 JBR-3545 Window.setMinimumSize does not respect DPI scaling
(cherry picked from commit 9b4f72ad18)
2021-06-24 10:51:09 +07:00
Denis Konoplev
89b91d7e52 JBR-3544: Generate popup invoked instead of New in this directory
Fix duplicate system shortcut

(cherry picked from commit d5fa37b63f)
2021-06-24 10:49:51 +07:00
Denis Fokin
984a42b026 JRE-408 JBR-3515 fix NullPointerException in MetalRootPaneUI.installWindowListeners
(cherry picked from commit 584d554af529cff445b0f09bc2d57be55e138b7a)
(cherry picked from commit 6a42bb54bd)
2021-06-24 10:48:05 +07:00
Alexey Ushakov
43d13df4c3 JBR-2207 TitledBorder leaks PropertyChangeListener
Added a separate pass with sending setVisible(false) to the frames holding TitledBorder references in order to get WINDOW_DEACTIVATED (to clear KeyBoardFocusManager.activeWindow field)

(cherry picked from commit 3b03c698ce)
2021-06-24 10:47:44 +07:00
Vitaly Provodin
fb941dd3b7 exclude the test failing because of JDK-8268678
(cherry picked from commit a56060d465)
2021-06-15 05:31:05 +07:00
13 changed files with 202 additions and 45 deletions

View File

@@ -4810,6 +4810,30 @@ bool Compile::randomized_select(int count) {
return (os::random() & RANDOMIZED_DOMAIN_MASK) < (RANDOMIZED_DOMAIN / count);
}
Node* Compile::narrow_value(BasicType bt, Node* value, const Type* type, PhaseGVN* phase, bool transform_res) {
if (type != NULL && phase->type(value)->higher_equal(type)) {
return value;
}
Node* result = NULL;
if (bt == T_BYTE) {
result = phase->transform(new LShiftINode(value, phase->intcon(24)));
result = new RShiftINode(result, phase->intcon(24));
} else if (bt == T_BOOLEAN) {
result = new AndINode(value, phase->intcon(0xFF));
} else if (bt == T_CHAR) {
result = new AndINode(value,phase->intcon(0xFFFF));
} else {
assert(bt == T_SHORT, "unexpected narrow type");
result = phase->transform(new LShiftINode(value, phase->intcon(16)));
result = new RShiftINode(result, phase->intcon(16));
}
if (transform_res) {
result = phase->transform(result);
}
return result;
}
CloneMap& Compile::clone_map() { return _clone_map; }
void Compile::set_clone_map(Dict* d) { _clone_map._dict = d; }

View File

@@ -1380,6 +1380,7 @@ class Compile : public Phase {
#ifdef ASSERT
bool _type_verify_symmetry;
#endif
static Node* narrow_value(BasicType bt, Node* value, const Type* type, PhaseGVN* phase, bool transform_res);
};
#endif // SHARE_VM_OPTO_COMPILE_HPP

View File

@@ -462,16 +462,17 @@ Node *PhaseMacroExpand::value_from_mem_phi(Node *mem, BasicType ft, const Type *
if (val == mem) {
values.at_put(j, mem);
} else if (val->is_Store()) {
#if INCLUDE_SHENANDOAHGC
Node* n = val->in(MemNode::ValueIn);
#if INCLUDE_SHENANDOAHGC
if (UseShenandoahGC) {
BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2();
n = bs->step_over_gc_barrier(n);
}
values.at_put(j, n);
#else
values.at_put(j, val->in(MemNode::ValueIn));
#endif
if (is_subword_type(ft)) {
n = Compile::narrow_value(ft, n, phi_type, &_igvn, true);
}
values.at_put(j, n);
} else if(val->is_Proj() && val->in(0) == alloc) {
values.at_put(j, _igvn.zerocon(ft));
} else if (val->is_Phi()) {

View File

@@ -1995,12 +1995,14 @@ uint LoadNode::match_edge(uint idx) const {
// with the value stored truncated to a byte. If no truncation is
// needed, the replacement is done in LoadNode::Identity().
//
Node *LoadBNode::Ideal(PhaseGVN *phase, bool can_reshape) {
Node* LoadBNode::Ideal(PhaseGVN* phase, bool can_reshape) {
Node* mem = in(MemNode::Memory);
Node* value = can_see_stored_value(mem,phase);
if( value && !phase->type(value)->higher_equal( _type ) ) {
Node *result = phase->transform( new LShiftINode(value, phase->intcon(24)) );
return new RShiftINode(result, phase->intcon(24));
if (value != NULL) {
Node* narrow = Compile::narrow_value(T_BYTE, value, _type, phase, false);
if (narrow != value) {
return narrow;
}
}
// Identity call will handle the case where truncation is not needed.
return LoadNode::Ideal(phase, can_reshape);
@@ -2030,8 +2032,12 @@ const Type* LoadBNode::Value(PhaseGVN* phase) const {
Node* LoadUBNode::Ideal(PhaseGVN* phase, bool can_reshape) {
Node* mem = in(MemNode::Memory);
Node* value = can_see_stored_value(mem, phase);
if (value && !phase->type(value)->higher_equal(_type))
return new AndINode(value, phase->intcon(0xFF));
if (value != NULL) {
Node* narrow = Compile::narrow_value(T_BOOLEAN, value, _type, phase, false);
if (narrow != value) {
return narrow;
}
}
// Identity call will handle the case where truncation is not needed.
return LoadNode::Ideal(phase, can_reshape);
}
@@ -2057,11 +2063,15 @@ const Type* LoadUBNode::Value(PhaseGVN* phase) const {
// with the value stored truncated to a char. If no truncation is
// needed, the replacement is done in LoadNode::Identity().
//
Node *LoadUSNode::Ideal(PhaseGVN *phase, bool can_reshape) {
Node* LoadUSNode::Ideal(PhaseGVN* phase, bool can_reshape) {
Node* mem = in(MemNode::Memory);
Node* value = can_see_stored_value(mem,phase);
if( value && !phase->type(value)->higher_equal( _type ) )
return new AndINode(value,phase->intcon(0xFFFF));
if (value != NULL) {
Node* narrow = Compile::narrow_value(T_CHAR, value, _type, phase, false);
if (narrow != value) {
return narrow;
}
}
// Identity call will handle the case where truncation is not needed.
return LoadNode::Ideal(phase, can_reshape);
}
@@ -2087,12 +2097,14 @@ const Type* LoadUSNode::Value(PhaseGVN* phase) const {
// with the value stored truncated to a short. If no truncation is
// needed, the replacement is done in LoadNode::Identity().
//
Node *LoadSNode::Ideal(PhaseGVN *phase, bool can_reshape) {
Node* LoadSNode::Ideal(PhaseGVN* phase, bool can_reshape) {
Node* mem = in(MemNode::Memory);
Node* value = can_see_stored_value(mem,phase);
if( value && !phase->type(value)->higher_equal( _type ) ) {
Node *result = phase->transform( new LShiftINode(value, phase->intcon(16)) );
return new RShiftINode(result, phase->intcon(16));
if (value != NULL) {
Node* narrow = Compile::narrow_value(T_SHORT, value, _type, phase, false);
if (narrow != value) {
return narrow;
}
}
// Identity call will handle the case where truncation is not needed.
return LoadNode::Ideal(phase, can_reshape);

View File

@@ -2618,19 +2618,18 @@ void Parse::do_one_bytecode() {
case Bytecodes::_i2b:
// Sign extend
a = pop();
a = _gvn.transform( new LShiftINode(a,_gvn.intcon(24)) );
a = _gvn.transform( new RShiftINode(a,_gvn.intcon(24)) );
push( a );
a = Compile::narrow_value(T_BYTE, a, NULL, &_gvn, true);
push(a);
break;
case Bytecodes::_i2s:
a = pop();
a = _gvn.transform( new LShiftINode(a,_gvn.intcon(16)) );
a = _gvn.transform( new RShiftINode(a,_gvn.intcon(16)) );
push( a );
a = Compile::narrow_value(T_SHORT, a, NULL, &_gvn, true);
push(a);
break;
case Bytecodes::_i2c:
a = pop();
push( _gvn.transform( new AndINode(a,_gvn.intcon(0xFFFF)) ) );
a = Compile::narrow_value(T_CHAR, a, NULL, &_gvn, true);
push(a);
break;
case Bytecodes::_i2f:

View File

@@ -369,15 +369,20 @@ extern bool isSystemShortcut_NextWindowInApplication(NSUInteger modifiersMask, N
}
AWTToolkit.latestPerformKeyEquivalentEvent = event;
NSUInteger modFlags = [event modifierFlags] &
(NSCommandKeyMask | NSAlternateKeyMask | NSShiftKeyMask | NSControlKeyMask);
// Workaround for JBR-3544
// When tabbing mode is on, macOS sends "Ctrl N" and "Cmd N" when "Ctrl Opt N" and "Cmd Opt N" are pressed
if ([event keyCode] == 45 && ((modFlags == NSControlKeyMask) || (modFlags == NSCommandKeyMask))) {
return NO;
}
// if IM is active key events should be ignored
if (![self hasMarkedText] && !fInPressAndHold) {
[self deliverJavaKeyEventHelper: event];
}
// Workaround for 8020209: special case for "Cmd =" and "Cmd ."
// because Cocoa calls performKeyEquivalent twice for these keystrokes
NSUInteger modFlags = [event modifierFlags] &
(NSCommandKeyMask | NSAlternateKeyMask | NSShiftKeyMask | NSControlKeyMask);
if (modFlags == NSCommandKeyMask) {
NSString *eventChars = [event charactersIgnoringModifiers];
if ([eventChars length] == 1) {

View File

@@ -210,6 +210,7 @@ public class MetalRootPaneUI extends BasicRootPaneUI
* @param parent The parent of the JRootPane
*/
private void installWindowListeners(JRootPane root, Component parent) {
if (parent == null) return;
if (parent instanceof Window) {
window = (Window)parent;
}

View File

@@ -1968,8 +1968,8 @@ MsgRouting AwtWindow::WmGetMinMaxInfo(LPMINMAXINFO lpmmi)
if ((m_minSize.x == 0) && (m_minSize.y == 0)) {
return r;
}
lpmmi->ptMinTrackSize.x = m_minSize.x;
lpmmi->ptMinTrackSize.y = m_minSize.y;
lpmmi->ptMinTrackSize.x = ScaleUpX(m_minSize.x);
lpmmi->ptMinTrackSize.y = ScaleUpY(m_minSize.y);
return mrConsume;
}

View File

@@ -0,0 +1,108 @@
/*
* Copyright (c) 2021, Red Hat, Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* @test
* @bug 8261812
* @summary C2 compilation fails with assert(!had_error) failed: bad dominance
*
* @run main/othervm -XX:-BackgroundCompilation TestValAtSafepointOverflowsInt
*
*/
public class TestValAtSafepointOverflowsInt {
private static volatile int volatileField;
public static void main(String[] args) {
for (int i = 0; i < 20_000; i++) {
testByte(true, false);
testByte(false, false);
testShort(true, false);
testShort(false, false);
testChar(true, false);
testChar(false, false);
}
testByte(true, true);
testShort(true, true);
testChar(true, true);
}
private static Object testByte(boolean flag, boolean flag2) {
int i;
// loop to delay constant folding
for (i = 0; i < 9; i++) {
}
C obj = new C();
if (flag) {
obj.byteField = (byte)(1 << i);
} else {
obj.byteField = (byte)(1 << (i+1));
}
// Phi for byte here for uncommon trap in never taken path below
// Phi inputs don't fit in a byte. Phi transfomed to top.
if (flag2) {
return obj;
}
return null;
}
private static Object testShort(boolean flag, boolean flag2) {
int i;
for (i = 0; i < 17; i++) {
}
C obj = new C();
if (flag) {
obj.shortField = (short)(1 << i);
} else {
obj.shortField = (short)(1 << (i+1));
}
if (flag2) {
return obj;
}
return null;
}
private static Object testChar(boolean flag, boolean flag2) {
int i;
for (i = 0; i < 17; i++) {
}
C obj = new C();
if (flag) {
obj.charField = (char)(1 << i);
} else {
obj.charField = (char)(1 << (i+1));
}
if (flag2) {
return obj;
}
return null;
}
static class C {
byte byteField;
short shortField;
char charField;
}
}

View File

@@ -66,6 +66,12 @@ public class TestTitledBorderLeak {
System.err.println("TOTAL_TITLEDBORDER != weakRefArrTB.size()");
}
Thread.sleep(3000);
SwingUtilities.invokeAndWait(() -> {
for (int i = 0; i < TOTAL_TITLEDBORDER; i++) {
frame[i].setVisible(false);
}
});
Thread.sleep(3000);
SwingUtilities.invokeAndWait(() -> {
for (int i = 0; i < TOTAL_TITLEDBORDER; i++) {
frame[i].dispose();

View File

@@ -6,6 +6,7 @@ import org.cef.browser.CefMessageRouter;
import org.cef.handler.CefLoadHandlerAdapter;
import org.cef.callback.CefQueryCallback;
import org.cef.handler.CefMessageRouterHandlerAdapter;
import org.cef.network.CefRequest.TransitionType;
import javax.swing.*;
import java.awt.event.WindowAdapter;
@@ -17,7 +18,6 @@ import java.util.concurrent.TimeUnit;
/**
* @test
* @key headful
* @requires (os.arch == "amd64" | os.arch == "x86_64" | (os.arch == "aarch64" & os.family == "mac"))
* @summary Regression test for JBR-2430. The test checks that JS Query is handled in 2nd opened browser.
* @run main/othervm HandleJSQueryTest
*/
@@ -32,10 +32,10 @@ public class HandleJSQueryTest {
try {
SwingUtilities.invokeLater(firstBrowser::initUI);
firstLatch.await(3, TimeUnit.SECONDS);
firstLatch.await(10, TimeUnit.SECONDS);
SwingUtilities.invokeLater(secondBrowser::initUI);
secondLatch.await(3, TimeUnit.SECONDS);
secondLatch.await(10, TimeUnit.SECONDS);
if (CefBrowserFrame.callbackCounter < 2) {
throw new RuntimeException("Test FAILED. JS Query was not handled in 2nd opened browser");
@@ -54,8 +54,8 @@ public class HandleJSQueryTest {
class CefBrowserFrame extends JFrame {
static int callbackCounter;
static int browserNumber;
static volatile int callbackCounter;
static volatile int browserNumber;
private final JBCefBrowser browser = new JBCefBrowser();
@@ -86,9 +86,13 @@ class CefBrowserFrame extends JFrame {
browser.getCefClient().addMessageRouter(msgRouter);
browser.getCefClient().addLoadHandler(new CefLoadHandlerAdapter() {
@Override
public void onLoadStart(CefBrowser browser, CefFrame frame, TransitionType transitionType) {
System.out.println("onLoadStart: Browser " + browserNumber);
}
@Override
public void onLoadEnd(CefBrowser browser, CefFrame frame, int httpStatusCode) {
System.out.println("Browser " + browserNumber + " is loaded.");
System.out.println("onLoadEnd: Browser " + browserNumber);
String jsFunc = "cef_query_" + browserNumber;
String jsQuery = "window." + jsFunc + "({request: '" + jsFunc + "'});";
browser.executeJavaScript(jsQuery, "", 0);

View File

@@ -43,7 +43,7 @@ fi
curdir=$(pwd)
cd ${TESTSRC}
${TESTJAVA}/bin/javac -d ${TESTCLASSES} HandleJSQueryTest.java
${TESTJAVA}/bin/javac -d ${TESTCLASSES} JBCefApp.java JBCefBrowser.java HandleJSQueryTest.java
cd $curdir
i=0

View File

@@ -143,7 +143,6 @@ java/awt/EmbeddedFrame/EmbeddedFrameGrabTest/EmbeddedFrameGrabTest.java
java/awt/EventDispatchThread/HandleExceptionOnEDT/HandleExceptionOnEDT.java 8203047 macosx-all,linux-all,windows-all
java/awt/EventDispatchThread/LoopRobustness/LoopRobustness.html 8073636 macosx-all
java/awt/EventQueue/6980209/bug6980209.java 8198615 macosx-all,linux-all,windows-all
java/awt/FileDialog/8003399/bug8003399.java 8198334 windows-all
java/awt/FileDialog/FileDialogIconTest/FileDialogIconTest.java 8160558 windows-all
java/awt/FileDialog/FilenameFilterTest/FilenameFilterTest.html 8202882 linux-all
java/awt/FileDialog/ModalFocus/FileDialogModalFocusTest.java 8194751 linux-all,macosx-all
@@ -248,12 +247,12 @@ java/awt/Mixing/AWT_Mixing/HierarchyBoundsListenerMixingTest.java
java/awt/Mixing/AWT_Mixing/JButtonInGlassPaneOverlapping.java 8158801 windows-all,macosx-all,linux-all
java/awt/Mixing/AWT_Mixing/JButtonOverlapping.java 8158801 windows-all,macosx-all,linux-all
java/awt/Mixing/AWT_Mixing/JColorChooserOverlapping.java 8158801 windows-all,macosx-all,linux-all
java/awt/Mixing/AWT_Mixing/JComboBoxOverlapping.java 8158801 windows-all,macosx-all,linux-all
java/awt/Mixing/AWT_Mixing/JComboBoxOverlapping.java 8158801,8049405 windows-all,macosx-all,linux-all
java/awt/Mixing/AWT_Mixing/JEditorPaneInGlassPaneOverlapping.java 8158801 windows-all,macosx-all,linux-all
java/awt/Mixing/AWT_Mixing/JEditorPaneOverlapping.java 8158801 windows-all,macosx-all,linux-all
java/awt/Mixing/AWT_Mixing/JGlassPaneInternalFrameOverlapping.java 8158801,8049405 windows-all,macosx-all,linux-all
java/awt/Mixing/AWT_Mixing/JGlassPaneMoveOverlapping.java 8158801 windows-all,macosx-all,linux-all
java/awt/Mixing/AWT_Mixing/JInternalFrameMoveOverlapping.java 8158801 windows-all,macosx-all,linux-all
java/awt/Mixing/AWT_Mixing/JInternalFrameMoveOverlapping.java 8158801,6986109 windows-all,macosx-all,linux-all
java/awt/Mixing/AWT_Mixing/JInternalFrameOverlapping.java 8158801 windows-all,macosx-all,linux-all
java/awt/Mixing/AWT_Mixing/JLabelInGlassPaneOverlapping.java 8158801 windows-all,macosx-all,linux-all
java/awt/Mixing/AWT_Mixing/JLabelOverlapping.java 8158801 windows-all,macosx-all,linux-all
@@ -281,8 +280,6 @@ java/awt/Mixing/AWT_Mixing/JTextFieldInGlassPaneOverlapping.java
java/awt/Mixing/AWT_Mixing/JTextFieldOverlapping.java 8158801 windows-all,macosx-all,linux-all
java/awt/Mixing/AWT_Mixing/JToggleButtonInGlassPaneOverlapping.java 8158801 windows-all,macosx-all,linux-all
java/awt/Mixing/AWT_Mixing/JToggleButtonOverlapping.java 8158801 windows-all,macosx-all,linux-all
java/awt/Mixing/AWT_Mixing/JInternalFrameMoveOverlapping.java 6986109 windows-all
java/awt/Mixing/AWT_Mixing/JComboBoxOverlapping.java 8049405 macosx-all,windows-all
java/awt/Mixing/AWT_Mixing/MixingFrameResizing.java 8049405 generic-all
java/awt/Mixing/AWT_Mixing/MixingPanelsResizing.java 8049405 generic-all
java/awt/Mixing/AWT_Mixing/OpaqueOverlapping.java 8194045 generic-all
@@ -702,7 +699,7 @@ sun/awt/shell/ShellFolderMemoryLeak.java
# Fedora & ArchLinux (Wayland) & Ubuntu 21.04
sun/java2d/AcceleratedXORModeTest.java JBR-3167 linux-5.10.12-200.fc33.x86_64,linux-5.11.6-arch1-1
sun/java2d/ClassCastExceptionForInvalidSurface.java JBR-3167 linux-5.10.12-200.fc33.x86_64,linux-5.11.6-arch1-1,5.11.0-17-generic
sun/java2d/ClassCastExceptionForInvalidSurface.java JBR-3167 linux-all
sun/java2d/DirectX/OnScreenRenderingResizeTest/OnScreenRenderingResizeTest.java 8022403 generic-all
sun/java2d/DirectX/OverriddenInsetsTest/OverriddenInsetsTest.java 8196102 generic-all
@@ -840,14 +837,13 @@ com/sun/nio/sctp/SctpChannel/SocketOptionTests.java
sun/security/lib/cacerts/VerifyCACerts.java 8240268 generic-all
sun/security/pkcs11/ec/TestKeyFactory.java 8026976 generic-all
sun/security/pkcs11/Secmod/AddTrustedCert.java 8180837 generic-all
sun/security/pkcs11/tls/TestKeyMaterial.java 8180837 generic-all
sun/security/pkcs11/KeyStore/SecretKeysBasic.sh 8209398 generic-all
security/infra/java/security/cert/CertPathValidator/certification/ActalisCA.java 8224768 generic-all
security/infra/java/security/cert/CertPathValidator/certification/GlobalSignR6CA.java 8249176 generic-all
security/infra/java/security/cert/CertPathValidator/certification/LuxTrustCA.java 8237888 generic-all
security/infra/java/security/cert/CertPathValidator/certification/BuypassCA.java 8243543 generic-all
security/infra/java/security/cert/CertPathValidator/certification/ComodoCA.java 8263059 generic-all
security/infra/java/security/cert/CertPathValidator/certification/QuoVadisCA.java 8248899 generic-all
############################################################################