From b5b24b904a68432153e8fa5c10cab5c27e871722 Mon Sep 17 00:00:00 2001
From: Semyon Sadetsky
Date: Mon, 3 Jun 2019 08:13:18 -0700
Subject: [PATCH 001/109] 8196096:
javax/swing/JPopupMenu/6580930/bug6580930.java fails
Reviewed-by: serb
---
test/jdk/ProblemList.txt | 2 +-
.../swing/JPopupMenu/6580930/bug6580930.java | 19 ++++++++++++++-----
2 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt
index 7904f4f399f..7b7f69cbc26 100644
--- a/test/jdk/ProblemList.txt
+++ b/test/jdk/ProblemList.txt
@@ -735,7 +735,7 @@ javax/swing/JFileChooser/DeserializedJFileChooser/DeserializedJFileChooserTest.j
javax/swing/JFileChooser/6396844/TwentyThousandTest.java 8198003 generic-all
javax/swing/JFrame/8175301/ScaledFrameBackgroundTest.java 8193942 generic-all
javax/swing/JList/6462008/bug6462008.java 7156347 generic-all
-javax/swing/JPopupMenu/6580930/bug6580930.java 8196096 windows-all,macosx-all
+javax/swing/JPopupMenu/6580930/bug6580930.java 7124313 macosx-all
javax/swing/JPopupMenu/6800513/bug6800513.java 7184956 macosx-all
javax/swing/JPopupMenu/6675802/bug6675802.java 8196097 windows-all
javax/swing/JTabbedPane/8007563/Test8007563.java 8051591 generic-all
diff --git a/test/jdk/javax/swing/JPopupMenu/6580930/bug6580930.java b/test/jdk/javax/swing/JPopupMenu/6580930/bug6580930.java
index c545d8191f1..6e935e72d8e 100644
--- a/test/jdk/javax/swing/JPopupMenu/6580930/bug6580930.java
+++ b/test/jdk/javax/swing/JPopupMenu/6580930/bug6580930.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2019, 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
@@ -42,6 +42,8 @@ public class bug6580930 {
private static JPopupMenu popup;
private static Toolkit toolkit;
private static volatile boolean skipTest = false;
+ private static Point loc;
+ private static int y;
private static void createGui() {
frame = new JFrame();
@@ -93,12 +95,15 @@ public class bug6580930 {
if(skipTest) {
return;
}
- Point loc = frame.getLocationOnScreen();
+
+ SwingUtilities.invokeAndWait(() -> loc = frame.getLocationOnScreen());
+ robot.waitForIdle();
robot.mouseMove(loc.x, loc.y);
showPopup();
robot.waitForIdle();
- if (isHeavyWeightMenuVisible()) {
+ if (!System.getProperty("os.name").startsWith("Mac")
+ && isHeavyWeightMenuVisible()) {
throw new RuntimeException("HeavyWeightPopup is unexpectedly visible");
}
@@ -106,12 +111,16 @@ public class bug6580930 {
robot.keyRelease(KeyEvent.VK_ESCAPE);
int x = loc.x;
- int y = loc.y + (frame.getHeight() - popup.getPreferredSize().height) + 1;
+ SwingUtilities.invokeAndWait( () -> y = loc.y + (frame.getHeight() -
+ popup.getPreferredSize().height) + 1);
+ robot.waitForIdle();
robot.mouseMove(x, y);
showPopup();
+ SwingUtilities.invokeAndWait(() -> loc = popup.getLocationOnScreen());
+ robot.waitForIdle();
- if (!popup.getLocationOnScreen().equals(new Point(x, y))) {
+ if (!loc.equals(new Point(x, y))) {
throw new RuntimeException("Popup is unexpectedly shifted");
}
From 427e1e28b1e43e5ee494482eb55049b80b7952d1 Mon Sep 17 00:00:00 2001
From: Prasanta Sadhukhan
Date: Tue, 4 Jun 2019 14:43:57 +0530
Subject: [PATCH 002/109] 8224876:
javax/swing/JWindow/ShapedAndTranslucentWindows/ShapedPerPixelTranslucentGradient.java
fails on linux-x64
Reviewed-by: serb, jdv
---
.../swing/JWindow/ShapedAndTranslucentWindows/Common.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/test/jdk/javax/swing/JWindow/ShapedAndTranslucentWindows/Common.java b/test/jdk/javax/swing/JWindow/ShapedAndTranslucentWindows/Common.java
index e43365bba9f..a79b62df432 100644
--- a/test/jdk/javax/swing/JWindow/ShapedAndTranslucentWindows/Common.java
+++ b/test/jdk/javax/swing/JWindow/ShapedAndTranslucentWindows/Common.java
@@ -385,13 +385,13 @@ public abstract class Common {
// Drag
Point location = window.getLocationOnScreen();
robot.dragAndDrop(location.x + 30, location.y + 5, location.x + dl + random.nextInt(dl), location.y + random.nextInt(dl));
- robot.waitForIdle(delay);
+ robot.waitForIdle(2*delay);
checkDynamicShape();
// Resize
location = window.getLocationOnScreen();
robot.dragAndDrop(location.x + 4, location.y + 4, location.x + random.nextInt(2*dl)-dl, location.y + random.nextInt(2*dl)-dl);
- robot.waitForIdle(delay);
+ robot.waitForIdle(2*delay);
checkDynamicShape();
EventQueue.invokeAndWait(this::dispose);
From eb555dec7793d380e98ef27c9175e83561496f55 Mon Sep 17 00:00:00 2001
From: Anton Tarasov
Date: Thu, 6 Jun 2019 15:46:36 +0300
Subject: [PATCH 003/109] 8225118: Robot.createScreenCapture() returns black
image on HiDPI linux with gtk3
Reviewed-by: serb
---
.../unix/native/libawt_xawt/awt/gtk3_interface.c | 11 ++++++++---
.../unix/native/libawt_xawt/awt/gtk3_interface.h | 1 +
.../HiDPIRobotScreenCaptureTest.java | 14 ++++++++------
3 files changed, 17 insertions(+), 9 deletions(-)
diff --git a/src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.c b/src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.c
index f5cf4914ef8..62da2a7edf2 100644
--- a/src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.c
+++ b/src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.c
@@ -324,6 +324,8 @@ GtkApi* gtk3_load(JNIEnv *env, const char* lib_name)
/* GDK */
fp_gdk_get_default_root_window =
dl_symbol("gdk_get_default_root_window");
+ fp_gdk_window_get_scale_factor =
+ dl_symbol("gdk_window_get_scale_factor");
/* Pixbuf */
fp_gdk_pixbuf_new = dl_symbol("gdk_pixbuf_new");
@@ -2888,7 +2890,10 @@ static gboolean gtk3_get_drawable_data(JNIEnv *env, jintArray pixelArray,
jint *ary;
GdkWindow *root = (*fp_gdk_get_default_root_window)();
- pixbuf = (*fp_gdk_pixbuf_get_from_drawable)(root, x, y, width, height);
+ int win_scale = (*fp_gdk_window_get_scale_factor)(root);
+ pixbuf = (*fp_gdk_pixbuf_get_from_drawable)(
+ root, x, y, (int)(width / (float)win_scale + 0.5), (int)(height / (float)win_scale + 0.5));
+
if (pixbuf && scale != 1) {
GdkPixbuf *scaledPixbuf;
x /= scale;
@@ -2906,8 +2911,8 @@ static gboolean gtk3_get_drawable_data(JNIEnv *env, jintArray pixelArray,
if (pixbuf) {
int nchan = (*fp_gdk_pixbuf_get_n_channels)(pixbuf);
int stride = (*fp_gdk_pixbuf_get_rowstride)(pixbuf);
- if ((*fp_gdk_pixbuf_get_width)(pixbuf) == width
- && (*fp_gdk_pixbuf_get_height)(pixbuf) == height
+ if ((*fp_gdk_pixbuf_get_width)(pixbuf) >= width
+ && (*fp_gdk_pixbuf_get_height)(pixbuf) >= height
&& (*fp_gdk_pixbuf_get_bits_per_sample)(pixbuf) == 8
&& (*fp_gdk_pixbuf_get_colorspace)(pixbuf) == GDK_COLORSPACE_RGB
&& nchan >= 3
diff --git a/src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.h b/src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.h
index 62a81252176..44c0db7086e 100644
--- a/src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.h
+++ b/src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.h
@@ -253,6 +253,7 @@ static gchar* (*fp_gtk_check_version)(guint required_major, guint
static void (*fp_g_free)(gpointer mem);
static void (*fp_g_object_unref)(gpointer object);
static GdkWindow *(*fp_gdk_get_default_root_window) (void);
+static int (*fp_gdk_window_get_scale_factor) (GdkWindow *window);
static int (*fp_gdk_pixbuf_get_bits_per_sample)(const GdkPixbuf *pixbuf);
static guchar *(*fp_gdk_pixbuf_get_pixels)(const GdkPixbuf *pixbuf);
diff --git a/test/jdk/java/awt/Robot/HiDPIScreenCapture/HiDPIRobotScreenCaptureTest.java b/test/jdk/java/awt/Robot/HiDPIScreenCapture/HiDPIRobotScreenCaptureTest.java
index f99437208e3..85378f00ad6 100644
--- a/test/jdk/java/awt/Robot/HiDPIScreenCapture/HiDPIRobotScreenCaptureTest.java
+++ b/test/jdk/java/awt/Robot/HiDPIScreenCapture/HiDPIRobotScreenCaptureTest.java
@@ -38,7 +38,7 @@ import javax.swing.UIManager;
* @bug 8073320
* @summary Windows HiDPI support
* @author Alexander Scherbatiy
- * @requires (os.family == "windows")
+ * @requires (os.family == "linux" | os.family == "windows")
* @run main/othervm -Dsun.java2d.win.uiScaleX=3 -Dsun.java2d.win.uiScaleY=2
* HiDPIRobotScreenCaptureTest
*/
@@ -50,11 +50,13 @@ public class HiDPIRobotScreenCaptureTest {
public static void main(String[] args) throws Exception {
- try {
- UIManager.setLookAndFeel(
- "com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
- } catch (Exception e) {
- return;
+ if (System.getProperty("os.name").toLowerCase().contains("win")) {
+ try {
+ UIManager.setLookAndFeel(
+ "com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
+ } catch (Exception e) {
+ return;
+ }
}
Frame frame = new Frame();
From 4a53af6cbc5889f386e8ed8958c2f04f5166133a Mon Sep 17 00:00:00 2001
From: Sergey Bylokhov
Date: Sun, 9 Jun 2019 14:12:18 -0700
Subject: [PATCH 004/109] 8222083: Support of "64-bit IEEE floating point"
encoding for the AU file format
Reviewed-by: prr
---
.../com/sun/media/sound/AuFileFormat.java | 6 +-
.../com/sun/media/sound/AuFileReader.java | 12 +-
.../spi/AudioFileReader/RecognizeAuFloat.java | 707 ++++++++++++++++++
3 files changed, 717 insertions(+), 8 deletions(-)
create mode 100644 test/jdk/javax/sound/sampled/spi/AudioFileReader/RecognizeAuFloat.java
diff --git a/src/java.desktop/share/classes/com/sun/media/sound/AuFileFormat.java b/src/java.desktop/share/classes/com/sun/media/sound/AuFileFormat.java
index dc425e40a65..a684cfb970f 100644
--- a/src/java.desktop/share/classes/com/sun/media/sound/AuFileFormat.java
+++ b/src/java.desktop/share/classes/com/sun/media/sound/AuFileFormat.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2019, 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
@@ -45,8 +45,8 @@ final class AuFileFormat extends StandardFileFormat {
static final int AU_LINEAR_24 = 4; /* 24-bit linear PCM */
static final int AU_LINEAR_32 = 5; /* 32-bit linear PCM */
static final int AU_FLOAT = 6; /* 32-bit IEEE floating point */
+ static final int AU_DOUBLE = 7; /* 64-bit IEEE floating point */
// we don't support these ...
-// static final int AU_DOUBLE = 7; /* 64-bit IEEE floating point */
// static final int AU_ADPCM_G721 = 23; /* 4-bit CCITT g.721 ADPCM */
// static final int AU_ADPCM_G722 = 24; /* CCITT g.722 ADPCM */
// static final int AU_ADPCM_G723_3 = 25; /* CCITT g.723 3-bit ADPCM */
@@ -93,6 +93,8 @@ final class AuFileFormat extends StandardFileFormat {
} else if (AudioFormat.Encoding.PCM_FLOAT.equals(encoding)) {
if (format.getSampleSizeInBits() == 32) {
auType = AU_FLOAT;
+ } else if (format.getSampleSizeInBits() == 64) {
+ auType = AU_DOUBLE;
}
}
}
diff --git a/src/java.desktop/share/classes/com/sun/media/sound/AuFileReader.java b/src/java.desktop/share/classes/com/sun/media/sound/AuFileReader.java
index 8ca5e796f04..ccc74771b0c 100644
--- a/src/java.desktop/share/classes/com/sun/media/sound/AuFileReader.java
+++ b/src/java.desktop/share/classes/com/sun/media/sound/AuFileReader.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2019, 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
@@ -101,12 +101,12 @@ public final class AuFileReader extends SunFileReader {
encoding = AudioFormat.Encoding.PCM_FLOAT;
sampleSizeInBits = 32;
break;
+ case AuFileFormat.AU_DOUBLE:
+ encoding = AudioFormat.Encoding.PCM_FLOAT;
+ sampleSizeInBits = 64;
+ break;
// we don't support these ...
- /* case AuFileFormat.AU_DOUBLE:
- encoding = new AudioFormat.DOUBLE;
- sampleSizeInBits = 8;
- break;
- case AuFileFormat.AU_ADPCM_G721:
+ /* case AuFileFormat.AU_ADPCM_G721:
encoding = new AudioFormat.G721_ADPCM;
sampleSizeInBits = 16;
break;
diff --git a/test/jdk/javax/sound/sampled/spi/AudioFileReader/RecognizeAuFloat.java b/test/jdk/javax/sound/sampled/spi/AudioFileReader/RecognizeAuFloat.java
new file mode 100644
index 00000000000..fdf901157b5
--- /dev/null
+++ b/test/jdk/javax/sound/sampled/spi/AudioFileReader/RecognizeAuFloat.java
@@ -0,0 +1,707 @@
+/*
+ * Copyright (c) 2019, 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.
+ */
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStream;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.Arrays;
+
+import javax.sound.sampled.AudioFileFormat;
+import javax.sound.sampled.AudioFormat;
+import javax.sound.sampled.AudioInputStream;
+import javax.sound.sampled.AudioSystem;
+
+/**
+ * @test
+ * @bug 8146239
+ * @summary Tests that AU_FLOAT and AU_DOUBLE formats are supported
+ */
+public final class RecognizeAuFloat {
+ // Create the audio file
+ // $sox -c 2 -n -b 32 -e floating-point -r 32000 --comment '' tmp.au synth 0.01 sine 1-90000 sine 90000-1
+ // sndfile will remove the optional information chunk
+ // $sndfile-convert tmp.au data.au
+ private static final byte[] data32 =
+ new byte[]{46, 115, 110, 100, 0, 0, 0, 24, 0, 0, 10, 0, 0, 0, 0, 6,
+ 0, 0, 125, 0, 0, 0, 0, 2, 55, 30, 0, 0, -66, 83, 22, 72, 57,
+ 20, 0, 0, -66, -22, -69, 4, 57, -100, -96, 0, 62, -119, 4,
+ -42, 57, -15, -80, 0, -67, -102, -15, -24, 58, 39, -84, 0,
+ -68, 77, 29, 64, 58, 88, -104, 0, 61, 39, -13, -64, 58,
+ -122, -16, 0, -69, -74, -27, -128, 58, -94, -26, 0, -66, 42,
+ 16, 116, 58, -63, 38, 0, 63, 5, 27, -95, 58, -32, -6, 0,
+ -65, 25, 104, -34, 59, 1, -98, 0, -66, -67, -43, 98, 59, 19,
+ -85, 0, 62, -37, 121, -120, 59, 39, 4, 0, 63, 21, 30, 50,
+ 59, 59, 110, 0, 63, 65, 109, 87, 59, 81, 60, 0, 63, 11, 74,
+ 112, 59, 104, 67, 0, 62, -36, 123, -48, 59, -128, 100, 0,
+ -66, -50, -18, -128, 59, -115, 88, -128, -65, 20, -62, 90,
+ 59, -101, 27, -128, -67, -122, 39, -88, 59, -87, -89, -128,
+ 63, 81, 60, -32, 59, -71, 18, -128, -65, 52, -14, 17, 59,
+ -55, 95, -128, 62, 91, 110, -100, 59, -38, -97, 0, 62, 36,
+ 28, -120, 59, -20, -38, 0, -66, -97, 28, -24, 60, 0, 15, 0,
+ 62, -95, 14, 112, 60, 10, 60, -128, -66, -125, -38, 104, 60,
+ 20, -5, 0, 62, 64, -85, -72, 60, 32, 83, -64, -66, 0, -88,
+ -124, 60, 44, 75, -128, 61, -104, -68, -104, 60, 56, -19,
+ 64, -67, 11, -80, 16, 60, 70, 62, 0, 59, 12, 0, 0, 60, 84,
+ 73, 64, 60, -72, 108, -128, 60, 99, 21, 0, -67, 6, -91, 32,
+ 60, 114, -83, -128, 61, 110, -11, 32, 60, -127, -116, -64,
+ -67, 73, -87, -64, 60, -118, 51, 64, 61, -71, 28, -96, 60,
+ -109, 77, -32, -67, -66, 26, -72, 60, -100, -29, -96, 61,
+ -101, 24, -112, 60, -90, -7, 32, -67, 110, -4, -64, 60, -79,
+ -107, -96, 61, -85, -41, 112, 60, -68, -66, 64, -67, -117,
+ 85, 8, 60, -56, 122, -96, 61, 119, 33, -128, 60, -44, -48,
+ -32, -67, -123, -116, 104, 60, -31, -56, -64, 60, -101, -65,
+ -128, 60, -17, 105, 96, 60, 71, 29, -128, 60, -3, -70, -32,
+ -67, -121, -72, 32, 61, 6, 98, -80, 62, 17, 12, -52, 61, 14,
+ 72, -96, -66, 98, -7, 120, 61, 22, -109, -48, 62, -89, -123,
+ -114, 61, 31, 72, -64, -66, -46, -27, -126, 61, 40, 108,
+ 112, 62, -24, 13, -98, 61, 50, 3, -64, -66, -49, -111, -118,
+ 61, 60, 20, 32, 62, 65, -50, 0, 61, 70, -94, -48, 62, 7,
+ -53, -92, 61, 81, -75, -80, -65, 15, 22, 51, 61, 93, 82,
+ -112, 63, 75, 122, 6, 61, 105, 127, -64, -65, 39, -103, 108,
+ 61, 118, 67, -128, 61, 102, -22, 32, 61, -127, -46, 80, 63,
+ 3, -8, 3, 61, -120, -44, -16, -65, 13, 31, -78, 61, -112,
+ 45, 88, -66, 26, 95, 88, 61, -105, -33, 40, 63, 56, 1, -51,
+ 61, -97, -18, 104, -66, -87, 96, -96, 61, -88, 94, -24, -65,
+ 14, -12, 116, 61, -79, 53, 8, 62, -28, 8, -68, 61, -70, 116,
+ -16, 62, -11, -35, 8, 61, -60, 35, 48, -65, 7, -110, 47, 61,
+ -50, 68, 96, -65, 4, 62, -13, 61, -40, -35, 48, 62, -54,
+ -54, 70, 61, -29, -14, -64, 63, 28, -19, -10, 61, -17, -119,
+ -80, -66, 74, 117, -88, 61, -5, -89, -24, -65, 55, 82, 2,
+ 62, 4, 40, -40, -66, 119, -21, -24, 62, 10, -58, -4, 62, -8,
+ 108, 110, 62, 17, -80, 40, 63, 38, 48, 49, 62, 24, -24,
+ -112, -67, 110, -90, 32, 62, 32, 113, 92, -65, 29, -111,
+ -11, 62, 40, 79, -92, -65, 31, 111, 119, 62, 48, -125, -68,
+ -67, -99, -66, -80, 62, 57, 19, -60, 62, -13, -69, 100, 62,
+ 65, -1, 16, 63, 53, 109, -123, 62, 75, 76, -64, 62, -112,
+ 45, 8, 62, 84, -5, 36, -66, -117, -58, -90, 62, 95, 18, 24,
+ -65, 43, -15, -111, 62, 105, -113, 36, -65, 37, -126, 17,
+ 62, 116, 122, 72, -66, -71, 7, 124, 62, 127, -48, -48, 61,
+ -80, 58, 104, 62, -123, -52, -22, 63, 10, -42, -96, 62,
+ -117, -23, -88, 63, 53, 17, -15, 62, -110, 64, -8, 63, 4,
+ -33, -105, 62, -104, -46, -42, 62, 14, -16, 16, 62, -97,
+ -97, 98, -66, -120, -100, 48, 62, -90, -88, 106, -65, 16,
+ -55, 65, 62, -83, -22, -104, -65, 50, 111, 94, 62, -75, 106,
+ 126, -65, 43, -76, -4, 62, -67, 31, -16, -65, 5, 60, 84, 62,
+ -59, 19, 34, -66, -101, 116, -118, 62, -51, 53, -64, -67,
+ -114, -112, 112, 62, -43, -108, 62, 62, 124, 61, 4, 62, -34,
+ 25, 4, 63, 12, -46, 66, 62, -26, -44, -28, 63, 46, -89, -62,
+ 62, -17, -86, 94, 63, 49, -118, -31, 62, -8, -83, -6, 63,
+ 18, 74, -70, 63, 0, -35, 49, 62, -57, -13, -10, 63, 5, 115,
+ 21, 62, 39, 28, -108, 63, 10, 2, -109, -67, 91, 2, -48, 63,
+ 14, -106, 126, -66, -125, -114, 6, 63, 19, 22, 108, -66,
+ -43, -29, 52, 63, 23, -118, -117, -65, 11, 119, -38, 63, 27,
+ -39, -51, -65, 32, -43, 72, 63, 32, 6, -41, -65, 46, 64,
+ -64, 63, 35, -6, 65, -65, 51, -67, -118, 63, 39, -83, -78,
+ -65, 51, -12, -67, 63, 43, 14, 38, -65, 47, -33, -17, 63,
+ 46, 8, 121, -65, 41, 19, 46, 63, 48, -111, 23, -65, 32, -60,
+ -18, 63, 50, -124, 76, -65, 23, -122, -109, 63, 51, -31, 5,
+ -65, 14, -121, 38, 63, 52, 111, -48, -65, 5, -96, -7, 63,
+ 52, 60, -30, -66, -5, -52, -60, 63, 50, -5, 32, -66, -19,
+ -110, -102, 63, 48, -58, 58, -66, -30, 112, -76, 63, 45, 59,
+ -112, -66, -40, -12, 36, 63, 40, -121, -76, -66, -46, -85,
+ 120, 63, 34, 53, -105, -66, -50, 29, 12, 63, 26, -125, 46,
+ -66, -52, -124, 104, 63, 16, -17, -11, -66, -52, -114, 12,
+ 63, 5, -54, -26, -66, -49, 34, 40, 62, -15, 39, -124, -66,
+ -45, 38, -34, 62, -45, 83, 6, -66, -39, 53, 112, 62, -79,
+ 58, -88, -66, -32, 113, 10, 62, -117, -71, 118, -66, -23,
+ 44, -72, 62, 68, -124, 88, -66, -14, -61, 36, 61, -41, 35,
+ -48, -66, -3, 76, -16, 60, 73, 21, 64, -65, 4, 41, 121, -67,
+ -84, -32, 56, -65, 9, -32, 97, -66, 59, -16, -68, -65, 15,
+ -95, -73, -66, -112, -19, 104, -65, 21, 83, -106, -66, -62,
+ 84, 28, -65, 26, -38, 66, -66, -15, 61, -70, -65, 32, 18,
+ -104, -65, 13, 91, 117, -65, 36, -21, 35, -65, 31, 24, -23,
+ -65, 41, 61, 53, -65, 43, -67, -83, -65, 44, -1, 47, -65,
+ 51, 118, 20, -65, 48, 11, 126, -65, 51, -106, -70, -65, 50,
+ 94, -68, -65, 45, 55, 12, -65, 51, -40, 0, -65, 29, 54, 57,
+ -65, 52, 121, 12, -65, 6, 103, 50, -65, 52, 40, 15, -66,
+ -54, 55, 44, -65, 50, -21, 51, -66, 126, 66, -44, -65, 48,
+ -79, 26, -67, 117, 95, -48, -65, 45, -125, -61, 61, -106,
+ 52, -96, -65, 41, 90, -97, 61, -57, 113, -120, -65, 36, 66,
+ -15, 62, 12, -23, 24, -65, 30, 60, -115, 62, 48, 125, 20,
+ -65, 23, 87, 95, 62, 90, -59, 68, -65, 15, -102, -111, 62,
+ -127, -1, 112, -65, 7, 24, 12, 62, -104, 94, -106, -66, -5,
+ -71, -60, 62, -82, -25, -76, -66, -25, -8, -128, 62, -58,
+ 53, -84, -66, -45, 14, -22, 62, -35, -81, -96, -66, -67, 36,
+ -120, 62, -11, 6, -66, -66, -90, 97, 4, 63, 6, 3, 127, -66,
+ -114, -21, -84, 63, 16, -20, 40, -66, 109, -36, 56, 63, 27,
+ 40, 41, -66, 61, 28, 72, 63, 36, 33, -103, -66, 11, -23, 72,
+ 63, 43, -83, 65, -67, -75, 19, 40, 63, 49, 27, 71, -67, 37,
+ 37, 48, 63, 52, 32, -92, 59, -13, 9, 0, 63, 51, -1, -36, 61,
+ 95, 94, -112, 63, 48, 88, -114, 61, -50, 123, -8, 63, 40,
+ 111, -36, 62, 21, -110, 52, 63, 27, -12, -26, 62, 66, -90,
+ -48, 63, 10, 76, 35, 62, 110, 78, 0, 62, -26, -13, -12, 62,
+ -116, 49, -14, 62, -82, 100, -112, 62, -96, 99, 6, 62, 88,
+ -35, 60, 62, -77, -83, 18, 61, -122, 105, 8, 62, -58, 4, 54,
+ -67, -72, 110, -32, 62, -41, 95, -40, -66, -128, -100, 68,
+ 62, -25, -72, -8, -66, -50, -95, -10, 62, -9, 11, 32, -65,
+ 10, 90, -74, 63, 2, -87, -56, -65, 36, 41, 100, 63, 9, 72,
+ -63, -65, 51, 48, -12, 63, 15, 98, -30, -65, 49, 114, 53,
+ 63, 20, -7, 86, -65, 31, -51, 3, 63, 26, 13, -7, -66, -14,
+ -93, 4, 63, 30, -93, 56, -66, -118, -69, 76, 63, 34, -68,
+ 16, -70, -82, 44, 0, 63, 38, 91, -23, 62, 94, 113, -52, 63,
+ 41, -122, -105, 62, -89, -122, -42, 63, 44, 64, 56, 62, -28,
+ 76, -10, 63, 46, -115, 50, 63, 12, 66, 105, 63, 48, 114, 28,
+ 63, 34, 21, 2, 63, 49, -13, -73, 63, 48, 66, -126, 63, 51,
+ 22, -34, 63, 52, 69, -91, 63, 51, -32, 123, 63, 44, 33, -96,
+ 63, 52, 85, -126, 63, 21, 55, -35, 63, 52, 122, -32, 62,
+ -33, -42, 72, 63, 52, 85, 123, 62, 113, 54, 96, 63, 51, -22,
+ 37, -69, 84, -27, 0, 63, 51, 61, -98, -66, -125, -34, -80,
+ 63, 50, 84, -124, -66, -7, -59, 56, 63, 49, 51, 90, -65, 38,
+ -69, 12, 63, 47, -34, 124, -65, 52, 120, -13, 63, 46, 90,
+ 32, -65, 28, -48, -75, 63, 44, -86, 84, -66, -62, -122, 2,
+ 63, 42, -46, -4, -68, -66, 18, -64, 63, 40, -41, -49, 62,
+ -125, 39, -32, 63, 38, -68, 89, 62, -23, 125, -60, 63, 36,
+ -125, -7, 63, 32, 56, 64, 63, 34, 49, -32, 63, 51, -95, -58,
+ 63, 31, -55, 21, 63, 41, -75, 70, 63, 29, 76, 114, 62, -7,
+ -33, -98, 63, 26, -66, -91, 62, 65, -30, 76, 63, 24, 34, 52,
+ -66, 48, 71, -116, 63, 21, 121, 124, -65, 2, -67, 114, 63,
+ 18, -58, -80, -65, 49, 29, -36, 63, 16, 11, -32, -65, 34,
+ -68, -19, 63, 13, 74, -12, -66, -104, 24, -26, 63, 10, -123,
+ -76, 62, 51, 28, -80, 63, 7, -67, -61, 63, 2, 89, -28, 63,
+ 4, -12, -89, 63, 47, -73, -62, 63, 2, 43, -61, 63, 39, 28,
+ 20, 62, -2, -56, -64, 62, -77, 8, -104, 62, -7, 63, 86, -67,
+ -19, -18, -96, 62, -13, -67, 110, -65, 14, -31, -41, 62,
+ -18, 68, -10, -65, 50, -108, 124, 62, -24, -41, -72, -66,
+ -51, -101, 100, 62, -29, 119, 74, 62, 81, -23, -92, 62, -34,
+ 37, 28, 63, 35, 19, -90, 62, -40, -30, 118, 63, 42, 75, 0,
+ 62, -45, -80, -126, 62, -101, 23, -2, 62, -50, -112, 60,
+ -66, -92, 113, 88, 62, -55, -126, -110, -65, 48, 57, -75,
+ 62, -60, -120, 62, -66, -18, 109, -36, 62, -65, -95, -2, 62,
+ -122, 46, -94, 62, -70, -48, 80, 63, 43, -78, 92, 62, -74,
+ 19, -56, 63, 8, -56, 59, 62, -79, 108, -82, -66, 53, 9, -12,
+ 62, -84, -37, 124, -65, 45, -38, -43, 62, -88, 96, 68, -66,
+ -64, 66, -114, 62, -93, -5, 104, 62, -5, -24, -122, 62, -97,
+ -84, -46, 63, 37, -56, 106, 62, -101, 116, -52, -69, -51,
+ 74, 0, 62, -105, 83, 38, -65, 52, 39, 12, 62, -109, 72, 12,
+ -66, 105, -56, -88, 62, -113, 83, 68, 63, 34, 28, -23, 62,
+ -117, 116, -54, 62, -41, 27, -96, 62, -121, -84, 124, -65,
+ 6, 56, 36, 62, -125, -6, 18, -66, -24, -78, 120, 62, -128,
+ 93, -98, 63, 26, -115, 55, 62, 121, -84, -36, 62, -72, -90,
+ 88, 62, 114, -54, 0, -65, 24, -101, -10, 62, 108, 16, 20,
+ -66, 52, -39, -8, 62, 101, -127, 68, 63, 69, 45, 6, 62, 95,
+ 25, 120, -66, -68, 112, 34, 62, 88, -36, 112, -66, -63,
+ -116, 94, 62, 82, -60, 72, 63, 28, 61, 0, 62, 76, -42, -116,
+ -66, 27, 72, 116, 62, 71, 11, 104, -66, -7, -1, -124, 62,
+ 65, 106, 68, 63, 84, 48, 84, 62, 59, -23, 120, -65, 42, 107,
+ 50, 62, 54, -110, 16, 62, -125, -115, -8, 62, 49, 89, 0, 62,
+ 57, -24, -4, 62, 44, 72, 60, -66, -35, -117, 4, 62, 39, 84,
+ 100, 63, 1, -103, 34, 62, 34, -121, 12, -66, -17, 116, 4,
+ 62, 29, -42, 0, 62, -65, -115, 24, 62, 25, 72, -72, -66,
+ 120, -42, -28, 62, 20, -40, 64, 62, 26, 47, 8, 62, 16, -121,
+ -112, -67, 77, -2, 32, 62, 12, 85, -124, 59, 64, 93, 0, 62,
+ 8, 61, -16, 61, 73, 86, -80, 62, 4, 72, 80, -67, -102, 14,
+ 0, 62, 0, 102, 100, 61, -76, -35, 112, 61, -7, 86, 72, -67,
+ 121, 104, -96, 61, -15, -9, 56, 61, 123, -75, 16, 61, -22,
+ -15, 64, -67, 115, -85, 64, 61, -29, -15, 8, 61, -125, -102,
+ 40, 61, -35, 86, -16, -68, -17, 52, 32, 61, -42, -80, -128,
+ 61, 30, -101, 112, 61, -48, 124, -16, 60, 14, -37, 0, 61,
+ -54, 44, 88, -67, 38, 97, 112, 61, -60, 89, 8, 61, 79, -37,
+ -96, 61, -66, 91, -64, -67, 76, 109, 80, 61, -72, -31, 72,
+ 61, -73, -94, -88, 61, -77, 54, 72, -67, -4, 114, -24, 61,
+ -82, 12, 32, 62, 5, 28, 48, 61, -88, -77, -8, -66, 37, 7,
+ 20, 61, -93, -48, 88, 62, 36, -101, 8, 61, -98, -52, -16,
+ -67, -40, 80, 112, 61, -102, 37, 64, -67, -91, -60, 104, 61,
+ -107, 121, -88, 62, -47, 16, 34, 61, -111, 2, -72, -65, 69,
+ 50, -82, 61, -116, -78, -96, 63, 20, -70, 1, 61, -120, 97,
+ 56, 62, -127, -67, -36, 61, -124, 112, 96, -65, 33, -9, -43,
+ 61, -128, 57, -16, -66, -7, -70, 72, 61, 121, 86, -32, 62,
+ 41, -78, 116, 61, 113, 13, -80, 63, 18, -75, -76, 61, 106,
+ -72, 112, 63, 48, 90, 88, 61, 98, -123, 48, 63, 52, 13, -69,
+ 61, 92, -10, 16, 63, 45, 31, -18, 61, 84, -47, 48, 62, -32,
+ 12, 26, 61, 80, 0, 48, -66, 38, -81, 88, 61, 71, -23, -16,
+ -65, 63, -24, 61, 61, 67, -57, 0, 62, -106, -40, 110, 61,
+ 59, -55, 48, 62, 116, 6, 44, 61, 56, 58, 80, -66, -67, 31,
+ 42, 61, 48, 106, 64, 62, -88, 121, 104, 61, 45, 73, 16, -66,
+ -115, -11, -110, 61, 37, -53, 48, 62, -128, -110, -42, 61,
+ 34, -33, -80, -66, 121, 84, -44, 61, 27, -17, 48, 62, 79,
+ -38, 28, 61, 24, -30, -16, 61, 91, 108, 16, 61, 18, -23, 32,
+ -65, 38, 12, 43, 61, 15, 26, -64, 62, 59, -92, -104, 61, 11,
+ 11, 96, 62, -37, 45, 18, 61, 4, -81, -48, 61, 74, 69, -16,
+ 61, 6, -67, 80,};
+
+ // Create the audio file
+ // $sox -c 2 -n -b 64 -e floating-point -r 32000 --comment '' tmp.au synth 0.01 sine 1-90000 sine 90000-1
+ // sndfile will remove the optional information chunk
+ // $sndfile-convert tmp.au data.au
+ private static final byte[] data64 =
+ new byte[]{46, 115, 110, 100, 0, 0, 0, 24, 0, 0, 20, 0, 0, 0, 0, 7,
+ 0, 0, 125, 0, 0, 0, 0, 2, 62, -29, -76, -128, 0, 0, 0, 0,
+ -65, -54, 98, -55, 10, 0, 0, 0, 63, 34, 127, 32, 0, 0, 0, 0,
+ -65, -35, 87, 96, -84, -128, 0, 0, 63, 51, -108, 34, 0, 0,
+ 0, 0, 63, -47, 32, -102, -49, -128, 0, 0, 63, 62, 54, 74, 0,
+ 0, 0, 0, -65, -77, 94, 60, -84, 0, 0, 0, 63, 68, -11, 79, 0,
+ 0, 0, 0, -65, -119, -93, -86, 48, 0, 0, 0, 63, 75, 19, 0, 0,
+ 0, 0, 0, 63, -92, -2, 120, 56, 0, 0, 0, 63, 80, -34, 23,
+ -128, 0, 0, 0, -65, 118, -36, -82, 0, 0, 0, 0, 63, 84, 92,
+ -63, -128, 0, 0, 0, -65, -59, 66, 14, 115, 0, 0, 0, 63, 88,
+ 36, -38, 0, 0, 0, 0, 63, -32, -93, 116, 32, 0, 0, 0, 63, 92,
+ 31, 46, -128, 0, 0, 0, -65, -29, 45, 27, -52, 64, 0, 0, 63,
+ 96, 51, -72, -64, 0, 0, 0, -65, -41, -70, -84, 58, -128, 0,
+ 0, 63, 98, 117, 82, -128, 0, 0, 0, 63, -37, 111, 49, 18, 0,
+ 0, 0, 63, 100, -32, 114, -128, 0, 0, 0, 63, -30, -93, -58,
+ 66, -64, 0, 0, 63, 103, 109, -69, -64, 0, 0, 0, 63, -24, 45,
+ -86, -27, -128, 0, 0, 63, 106, 39, 113, 0, 0, 0, 0, 63, -31,
+ 105, 78, 14, 0, 0, 0, 63, 109, 8, 89, 0, 0, 0, 0, 63, -37,
+ -113, 121, -3, -128, 0, 0, 63, 112, 12, 124, 96, 0, 0, 0,
+ -65, -39, -35, -48, 29, -128, 0, 0, 63, 113, -85, 22, -32,
+ 0, 0, 0, -65, -30, -104, 75, 72, -64, 0, 0, 63, 115, 99,
+ 111, 64, 0, 0, 0, -65, -80, -60, -11, 82, 0, 0, 0, 63, 117,
+ 52, -17, -128, 0, 0, 0, 63, -22, 39, -100, 28, 64, 0, 0, 63,
+ 119, 34, 84, -32, 0, 0, 0, -65, -26, -98, 66, 30, 0, 0, 0,
+ 63, 121, 43, -20, -96, 0, 0, 0, 63, -53, 109, -45, 127, 0,
+ 0, 0, 63, 123, 83, -34, 0, 0, 0, 0, 63, -60, -125, -111, 35,
+ 0, 0, 0, 63, 125, -101, 60, 64, 0, 0, 0, -65, -45, -29, -99,
+ 28, -128, 0, 0, 63, -128, 1, -33, 0, 0, 0, 0, 63, -44, 33,
+ -50, 29, 0, 0, 0, 63, -127, 71, -115, -80, 0, 0, 0, -65,
+ -48, 123, 77, 30, 0, 0, 0, 63, -126, -97, 96, -96, 0, 0, 0,
+ 63, -56, 21, 119, 58, 0, 0, 0, 63, -124, 10, 118, 80, 0, 0,
+ 0, -65, -64, 21, 16, -60, 0, 0, 0, 63, -123, -119, 115, -96,
+ 0, 0, 0, 63, -77, 23, -109, 98, 0, 0, 0, 63, -121, 29, -87,
+ -16, 0, 0, 0, -65, -95, 118, 1, 44, 0, 0, 0, 63, -120, -57,
+ -66, -128, 0, 0, 0, 63, 97, 127, -7, 0, 0, 0, 0, 63, -118,
+ -119, 40, -96, 0, 0, 0, 63, -105, 13, -111, 56, 0, 0, 0, 63,
+ -116, 98, -99, -96, 0, 0, 0, -65, -96, -44, -92, 100, 0, 0,
+ 0, 63, -114, 85, -80, 32, 0, 0, 0, 63, -83, -34, -93, -24,
+ 0, 0, 0, 63, -112, 49, -103, 80, 0, 0, 0, -65, -87, 53, 56,
+ 100, 0, 0, 0, 63, -111, 70, 102, 32, 0, 0, 0, 63, -73, 35,
+ -108, 44, 0, 0, 0, 63, -110, 105, -69, 40, 0, 0, 0, -65,
+ -73, -61, 87, -118, 0, 0, 0, 63, -109, -100, 116, 88, 0, 0,
+ 0, 63, -77, 99, 17, -86, 0, 0, 0, 63, -108, -33, 37, 80, 0,
+ 0, 0, -65, -83, -33, -104, -20, 0, 0, 0, 63, -106, 50, -78,
+ 8, 0, 0, 0, 63, -75, 122, -19, -18, 0, 0, 0, 63, -105, -105,
+ -57, 104, 0, 0, 0, -65, -79, 106, -95, 80, 0, 0, 0, 63,
+ -103, 15, 82, 104, 0, 0, 0, 63, -82, -28, 47, -68, 0, 0, 0,
+ 63, -102, -102, 26, 96, 0, 0, 0, -65, -80, -79, -115, -122,
+ 0, 0, 0, 63, -100, 57, 23, 96, 0, 0, 0, 63, -109, 119, -17,
+ 0, 0, 0, 0, 63, -99, -19, 43, -8, 0, 0, 0, 63, -120, -29,
+ -81, -32, 0, 0, 0, 63, -97, -73, 93, -96, 0, 0, 0, -65, -80,
+ -9, 3, -100, 0, 0, 0, 63, -96, -52, 85, 76, 0, 0, 0, 63,
+ -62, 33, -103, -109, 0, 0, 0, 63, -95, -55, 20, 116, 0, 0,
+ 0, -65, -52, 95, 46, -25, 0, 0, 0, 63, -94, -46, 121, 84, 0,
+ 0, 0, 63, -44, -16, -79, -41, -128, 0, 0, 63, -93, -23, 24,
+ -80, 0, 0, 0, -65, -38, 92, -80, 77, 0, 0, 0, 63, -91, 13,
+ -115, -32, 0, 0, 0, 63, -35, 1, -77, -25, 0, 0, 0, 63, -90,
+ 64, 120, -56, 0, 0, 0, -65, -39, -14, 49, 104, -128, 0, 0,
+ 63, -89, -126, -125, -120, 0, 0, 0, 63, -56, 57, -65, -19,
+ 0, 0, 0, 63, -88, -44, 90, 108, 0, 0, 0, 63, -64, -7, 116,
+ 100, 0, 0, 0, 63, -86, 54, -74, -12, 0, 0, 0, -65, -31, -30,
+ -58, 100, -64, 0, 0, 63, -85, -86, 83, 0, 0, 0, 0, 63, -23,
+ 111, 64, -60, -64, 0, 0, 63, -83, 47, -8, 120, 0, 0, 0, -65,
+ -28, -13, 45, -110, -128, 0, 0, 63, -82, -56, 111, -100, 0,
+ 0, 0, 63, -84, -35, 68, 16, 0, 0, 0, 63, -80, 58, 73, -36,
+ 0, 0, 0, 63, -32, 127, 0, 107, 64, 0, 0, 63, -79, 26, -98,
+ 4, 0, 0, 0, -65, -31, -93, -10, 83, 64, 0, 0, 63, -78, 5,
+ -85, 102, 0, 0, 0, -65, -61, 75, -21, 38, 0, 0, 0, 63, -78,
+ -5, -27, 50, 0, 0, 0, 63, -25, 0, 57, -88, -128, 0, 0, 63,
+ -77, -3, -52, -102, 0, 0, 0, -65, -43, 44, 20, 8, -128, 0,
+ 0, 63, -75, 11, -36, -46, 0, 0, 0, -65, -31, -34, -114,
+ -106, -128, 0, 0, 63, -74, 38, -95, 8, 0, 0, 0, 63, -36,
+ -127, 23, -107, 0, 0, 0, 63, -73, 78, -99, -84, 0, 0, 0, 63,
+ -34, -69, -95, 14, 0, 0, 0, 63, -72, -124, 102, 120, 0, 0,
+ 0, -65, -32, -14, 69, -38, 64, 0, 0, 63, -71, -56, -117,
+ -40, 0, 0, 0, -65, -32, -121, -34, 103, -64, 0, 0, 63, -69,
+ 27, -90, 118, 0, 0, 0, 63, -39, 89, 72, -38, 0, 0, 0, 63,
+ -68, 126, 87, -94, 0, 0, 0, 63, -29, -99, -66, -42, 0, 0, 0,
+ 63, -67, -15, 54, 116, 0, 0, 0, -65, -55, 78, -76, -34, 0,
+ 0, 0, 63, -65, 116, -4, -82, 0, 0, 0, -65, -26, -22, 64, 89,
+ -64, 0, 0, 63, -64, -123, 27, 3, 0, 0, 0, -65, -50, -3, 125,
+ 21, 0, 0, 0, 63, -63, 88, -33, 109, 0, 0, 0, 63, -33, 13,
+ -115, -60, 0, 0, 0, 63, -62, 54, 5, 67, 0, 0, 0, 63, -28,
+ -58, 6, 53, 64, 0, 0, 63, -61, 29, 17, -18, 0, 0, 0, -65,
+ -83, -44, -61, -116, 0, 0, 0, 63, -60, 14, 43, 126, 0, 0, 0,
+ -65, -29, -78, 62, -76, -64, 0, 0, 63, -59, 9, -12, 83, 0,
+ 0, 0, -65, -29, -19, -18, -10, -64, 0, 0, 63, -58, 16, 119,
+ -96, 0, 0, 0, -65, -77, -73, -42, 14, 0, 0, 0, 63, -57, 34,
+ 120, -123, 0, 0, 0, 63, -34, 119, 108, -99, 0, 0, 0, 63,
+ -56, 63, -30, 64, 0, 0, 0, 63, -26, -83, -80, -100, -64, 0,
+ 0, 63, -55, 105, -105, -2, 0, 0, 0, 63, -46, 5, -96, -15,
+ -128, 0, 0, 63, -54, -97, 100, -116, 0, 0, 0, -65, -47, 120,
+ -44, -83, -128, 0, 0, 63, -53, -30, 66, -15, 0, 0, 0, -65,
+ -27, 126, 50, 30, 0, 0, 0, 63, -51, 49, -28, -110, 0, 0, 0,
+ -65, -28, -80, 66, 35, 0, 0, 0, 63, -50, -113, 73, 47, 0, 0,
+ 0, -65, -41, 32, -17, 119, -128, 0, 0, 63, -49, -6, 26, 31,
+ 0, 0, 0, 63, -74, 7, 77, 102, 0, 0, 0, 63, -48, -71, -99,
+ 98, 0, 0, 0, 63, -31, 90, -44, 17, 64, 0, 0, 63, -47, 125,
+ 53, 14, -128, 0, 0, 63, -26, -94, 62, 29, 0, 0, 0, 63, -46,
+ 72, 31, 11, 0, 0, 0, 63, -32, -101, -14, -11, 64, 0, 0, 63,
+ -45, 26, 90, -23, 0, 0, 0, 63, -63, -34, 1, -36, 0, 0, 0,
+ 63, -45, -13, -20, 70, -128, 0, 0, -65, -47, 19, -123, -14,
+ -128, 0, 0, 63, -44, -43, 13, 101, -128, 0, 0, -65, -30, 25,
+ 40, 47, -128, 0, 0, 63, -43, -67, 83, 25, 0, 0, 0, -65, -26,
+ 77, -21, -50, -64, 0, 0, 63, -42, -83, 79, -58, 0, 0, 0,
+ -65, -27, 118, -97, -120, -64, 0, 0, 63, -41, -93, -2, 15,
+ 0, 0, 0, -65, -32, -89, -118, 122, -128, 0, 0, 63, -40, -94,
+ 100, 65, 0, 0, 0, -65, -45, 110, -111, 82, -128, 0, 0, 63,
+ -39, -90, -72, 34, -128, 0, 0, -65, -79, -46, 14, 48, 0, 0,
+ 0, 63, -38, -78, -121, -43, -128, 0, 0, 63, -49, -121, -96,
+ 108, 0, 0, 0, 63, -37, -61, 32, -94, -128, 0, 0, 63, -31,
+ -102, 72, 77, 0, 0, 0, 63, -36, -38, -100, -100, 0, 0, 0,
+ 63, -27, -44, -8, 75, 64, 0, 0, 63, -35, -11, 75, -73, -128,
+ 0, 0, 63, -26, 49, 92, 55, 0, 0, 0, 63, -33, 21, -65, 93,
+ -128, 0, 0, 63, -30, 73, 87, 61, 64, 0, 0, 63, -32, 27, -90,
+ 45, -64, 0, 0, 63, -40, -2, 126, -69, 0, 0, 0, 63, -32, -82,
+ 98, -88, 0, 0, 0, 63, -60, -29, -110, 102, 0, 0, 0, 63, -31,
+ 64, 82, 94, -64, 0, 0, -65, -85, 96, 91, 4, 0, 0, 0, 63,
+ -31, -46, -49, -65, -64, 0, 0, -65, -48, 113, -64, -42, 0,
+ 0, 0, 63, -30, 98, -51, -112, 64, 0, 0, -65, -38, -68, 102,
+ -91, -128, 0, 0, 63, -30, -15, 81, 95, 0, 0, 0, -65, -31,
+ 110, -5, 67, 0, 0, 0, 63, -29, 123, 57, -90, -128, 0, 0,
+ -65, -28, 26, -87, 15, -64, 0, 0, 63, -28, 0, -38, -22,
+ -128, 0, 0, -65, -27, -56, 24, 7, 0, 0, 0, 63, -28, 127, 72,
+ 54, -128, 0, 0, -65, -26, 119, -79, 75, 0, 0, 0, 63, -28,
+ -11, -74, 71, 64, 0, 0, -65, -26, 126, -105, -79, 64, 0, 0,
+ 63, -27, 97, -60, -41, -64, 0, 0, -65, -27, -5, -3, -16, 64,
+ 0, 0, 63, -27, -63, 15, 40, -64, 0, 0, -65, -27, 34, 101,
+ -55, 64, 0, 0, 63, -26, 18, 34, -27, -64, 0, 0, -65, -28,
+ 24, -99, -49, 0, 0, 0, 63, -26, 80, -119, -121, 0, 0, 0,
+ -65, -30, -16, -46, 103, 0, 0, 0, 63, -26, 124, 32, -98,
+ -64, 0, 0, -65, -31, -48, -28, -55, -64, 0, 0, 63, -26,
+ -115, -6, 10, 0, 0, 0, -65, -32, -76, 31, 26, -64, 0, 0, 63,
+ -26, -121, -100, 75, 64, 0, 0, -65, -33, 121, -104, -99, 0,
+ 0, 0, 63, -26, 95, 100, 7, -128, 0, 0, -65, -35, -78, 83,
+ 60, 0, 0, 0, 63, -26, 24, -57, 81, 0, 0, 0, -65, -36, 78,
+ 22, -86, -128, 0, 0, 63, -27, -89, 113, -4, -64, 0, 0, -65,
+ -37, 30, -124, -87, -128, 0, 0, 63, -27, 16, -10, 127, -64,
+ 0, 0, -65, -38, 85, 111, 36, -128, 0, 0, 63, -28, 70, -78,
+ -26, -128, 0, 0, -65, -39, -61, -95, 119, 0, 0, 0, 63, -29,
+ 80, 101, -46, 64, 0, 0, -65, -39, -112, -115, 43, -128, 0,
+ 0, 63, -30, 29, -2, -81, 64, 0, 0, -65, -39, -111, -63, 125,
+ 0, 0, 0, 63, -32, -71, 92, -46, 0, 0, 0, -65, -39, -28, 69,
+ 16, 0, 0, 0, 63, -34, 36, -16, 122, -128, 0, 0, -65, -38,
+ 100, -37, -65, 0, 0, 0, 63, -38, 106, 96, -55, 0, 0, 0, -65,
+ -37, 38, -82, 17, 0, 0, 0, 63, -42, 39, 85, 33, 0, 0, 0,
+ -65, -36, 14, 33, 82, 0, 0, 0, 63, -47, 119, 46, -80, -128,
+ 0, 0, -65, -35, 37, -105, 5, -128, 0, 0, 63, -56, -112,
+ -118, -42, 0, 0, 0, -65, -34, 88, 100, -116, -128, 0, 0, 63,
+ -70, -28, 121, -10, 0, 0, 0, -65, -33, -87, -98, 26, -128,
+ 0, 0, 63, -119, 34, -92, 64, 0, 0, 0, -65, -32, -123, 47,
+ 53, 64, 0, 0, -65, -75, -100, 7, 12, 0, 0, 0, -65, -31, 60,
+ 12, 44, 0, 0, 0, -65, -57, 126, 23, -88, 0, 0, 0, -65, -31,
+ -12, 54, -30, -128, 0, 0, -65, -46, 29, -83, 7, -128, 0, 0,
+ -65, -30, -86, 114, -44, 64, 0, 0, -65, -40, 74, -125, 121,
+ -128, 0, 0, -65, -29, 91, 72, 77, 64, 0, 0, -65, -34, 39,
+ -73, 65, -128, 0, 0, -65, -28, 2, 83, 7, 64, 0, 0, -65, -31,
+ -85, 110, -101, -64, 0, 0, -65, -28, -99, 100, 118, 64, 0,
+ 0, -65, -29, -29, 29, 57, 64, 0, 0, -65, -27, 39, -90, -96,
+ 0, 0, 0, -65, -27, 119, -75, -92, 0, 0, 0, -65, -27, -97,
+ -27, -34, -128, 0, 0, -65, -26, 110, -62, -112, 64, 0, 0,
+ -65, -26, 1, 111, -67, 64, 0, 0, -65, -26, 114, -41, 64,
+ -128, 0, 0, -65, -26, 75, -41, -118, -64, 0, 0, -65, -27,
+ -90, -31, -123, -64, 0, 0, -65, -26, 123, 0, 25, 64, 0, 0,
+ -65, -29, -90, -57, 30, 64, 0, 0, -65, -26, -113, 33, -103,
+ 0, 0, 0, -65, -32, -52, -26, 84, -128, 0, 0, -65, -26, -123,
+ 1, -28, 64, 0, 0, -65, -39, 70, -27, 117, 0, 0, 0, -65, -26,
+ 93, 102, 118, 0, 0, 0, -65, -49, -56, 90, 97, 0, 0, 0, -65,
+ -26, 22, 35, 81, -64, 0, 0, -65, -82, -85, -7, -92, 0, 0, 0,
+ -65, -27, -80, 120, 104, 0, 0, 0, 63, -78, -58, -109, -68,
+ 0, 0, 0, -65, -27, 43, 83, -31, 64, 0, 0, 63, -72, -18, 49,
+ 104, 0, 0, 0, -65, -28, -120, 94, 42, 0, 0, 0, 63, -63, -99,
+ 35, 2, 0, 0, 0, -65, -29, -57, -111, -85, 64, 0, 0, 63, -58,
+ 15, -94, 118, 0, 0, 0, -65, -30, -22, -21, -37, 64, 0, 0,
+ 63, -53, 88, -88, -60, 0, 0, 0, -65, -31, -13, 82, 55, 64,
+ 0, 0, 63, -48, 63, -18, 34, 0, 0, 0, -65, -32, -29, 1, 122,
+ -64, 0, 0, 63, -45, 11, -46, -68, 0, 0, 0, -65, -33, 119,
+ 56, 126, 0, 0, 0, 63, -43, -36, -10, -87, -128, 0, 0, -65,
+ -36, -1, 15, -10, 0, 0, 0, 63, -40, -58, -75, -91, 0, 0, 0,
+ -65, -38, 97, -35, 81, -128, 0, 0, 63, -37, -75, -12, 36, 0,
+ 0, 0, -65, -41, -92, -111, 21, -128, 0, 0, 63, -34, -96,
+ -41, -42, 0, 0, 0, -65, -44, -52, 32, -107, -128, 0, 0, 63,
+ -32, -64, 111, -10, 64, 0, 0, -65, -47, -35, 117, 127, 0, 0,
+ 0, 63, -30, 29, -123, 22, -128, 0, 0, -65, -51, -69, -121,
+ 60, 0, 0, 0, 63, -29, 101, 5, 56, -128, 0, 0, -65, -57, -93,
+ -119, 56, 0, 0, 0, 63, -28, -124, 51, 40, 0, 0, 0, -65, -63,
+ 125, 41, 21, 0, 0, 0, 63, -27, 117, -88, 29, -128, 0, 0,
+ -65, -74, -94, 100, -80, 0, 0, 0, 63, -26, 35, 104, -15,
+ -128, 0, 0, -65, -92, -92, -91, -16, 0, 0, 0, 63, -26, -124,
+ 20, -119, -64, 0, 0, 63, 126, 97, 28, 32, 0, 0, 0, 63, -26,
+ 127, -5, 123, -128, 0, 0, 63, -85, -21, -46, -32, 0, 0, 0,
+ 63, -26, 11, 17, -44, -128, 0, 0, 63, -71, -49, 126, -70, 0,
+ 0, 0, 63, -27, 13, -5, -122, 64, 0, 0, 63, -62, -78, 70,
+ -80, 0, 0, 0, 63, -29, 126, -100, -51, -64, 0, 0, 63, -56,
+ 84, -39, -32, 0, 0, 0, 63, -31, 73, -124, 104, -64, 0, 0,
+ 63, -51, -55, -65, -14, 0, 0, 0, 63, -36, -34, 126, -95, 0,
+ 0, 0, 63, -47, -122, 62, 92, 0, 0, 0, 63, -43, -52, -110,
+ 13, -128, 0, 0, 63, -44, 12, 96, -44, -128, 0, 0, 63, -53,
+ 27, -89, -108, 0, 0, 0, 63, -42, 117, -94, 70, 0, 0, 0, 63,
+ -80, -51, 33, 86, 0, 0, 0, 63, -40, -64, -122, -40, 0, 0, 0,
+ -65, -73, 13, -37, -72, 0, 0, 0, 63, -38, -21, -5, 36, -128,
+ 0, 0, -65, -48, 19, -120, -98, -128, 0, 0, 63, -36, -9, 31,
+ 1, 0, 0, 0, -65, -39, -44, 62, -40, 0, 0, 0, 63, -34, -31,
+ 100, 1, 0, 0, 0, -65, -31, 75, 86, -55, 64, 0, 0, 63, -32,
+ 85, 57, 23, 64, 0, 0, -65, -28, -123, 44, -111, 0, 0, 0, 63,
+ -31, 41, 24, 30, -64, 0, 0, -65, -26, 102, 30, -108, 64, 0,
+ 0, 63, -31, -20, 92, 76, 64, 0, 0, -65, -26, 46, 70, -87,
+ -128, 0, 0, 63, -30, -97, 42, -49, -128, 0, 0, -65, -29, -7,
+ -96, 121, -128, 0, 0, 63, -29, 65, -65, 33, 0, 0, 0, -65,
+ -34, 84, 96, -90, -128, 0, 0, 63, -29, -44, 103, 5, 0, 0, 0,
+ -65, -47, 87, 105, 113, -128, 0, 0, 63, -28, 87, -126, 5,
+ -128, 0, 0, -65, 85, -59, 122, 0, 0, 0, 0, 63, -28, -53,
+ 125, 53, -128, 0, 0, 63, -53, -50, 57, 82, 0, 0, 0, 63, -27,
+ 48, -46, -10, 64, 0, 0, 63, -44, -16, -38, -63, 0, 0, 0, 63,
+ -27, -120, 7, 2, -64, 0, 0, 63, -36, -119, -98, -76, -128,
+ 0, 0, 63, -27, -47, -90, 68, 64, 0, 0, 63, -31, -120, 77,
+ 53, 0, 0, 0, 63, -26, 14, 67, 126, -128, 0, 0, 63, -28, 66,
+ -96, 73, 64, 0, 0, 63, -26, 62, 118, -24, 64, 0, 0, 63, -26,
+ 8, 80, 66, -64, 0, 0, 63, -26, 98, -37, -67, -64, 0, 0, 63,
+ -26, -120, -76, -79, 0, 0, 0, 63, -26, 124, 15, 117, -128,
+ 0, 0, 63, -27, -124, 51, -4, 0, 0, 0, 63, -26, -118, -80,
+ 71, 0, 0, 0, 63, -30, -90, -5, -78, 0, 0, 0, 63, -26, -113,
+ 92, 0, -64, 0, 0, 63, -37, -6, -56, -2, -128, 0, 0, 63, -26,
+ -118, -81, 92, -64, 0, 0, 63, -50, 38, -52, 64, 0, 0, 0, 63,
+ -26, 125, 68, -75, 64, 0, 0, -65, 106, -100, -111, -64, 0,
+ 0, 0, 63, -26, 103, -77, -59, 0, 0, 0, -65, -48, 123, -43,
+ -12, 0, 0, 0, 63, -26, 74, -112, -108, 0, 0, 0, -65, -33,
+ 56, -89, 1, -128, 0, 0, 63, -26, 38, 107, 71, 64, 0, 0, -65,
+ -28, -41, 97, -115, -128, 0, 0, 63, -27, -5, -49, 123, -64,
+ 0, 0, -65, -26, -113, 30, 103, -64, 0, 0, 63, -27, -53, 67,
+ -4, -64, 0, 0, -65, -29, -102, 22, -80, -64, 0, 0, 63, -27,
+ -107, 74, -114, -64, 0, 0, -65, -40, 80, -64, 70, 0, 0, 0,
+ 63, -27, 90, 95, -120, -64, 0, 0, -65, -105, -62, 88, -64,
+ 0, 0, 0, 63, -27, 26, -7, -6, 0, 0, 0, 63, -48, 100, -4, 29,
+ 0, 0, 0, 63, -28, -41, -117, 54, 0, 0, 0, 63, -35, 47, -72,
+ -117, 0, 0, 0, 63, -28, -112, 127, 49, -128, 0, 0, 63, -28,
+ 7, 8, 0, -64, 0, 0, 63, -28, 70, 60, 21, 0, 0, 0, 63, -26,
+ 116, 56, -39, -128, 0, 0, 63, -29, -7, 34, -72, 0, 0, 0, 63,
+ -27, 54, -88, -53, -128, 0, 0, 63, -29, -87, -114, 65, -128,
+ 0, 0, 63, -33, 59, -13, -32, 0, 0, 0, 63, -29, 87, -44, -80,
+ -64, 0, 0, 63, -56, 60, 73, -112, 0, 0, 0, 63, -29, 4, 70,
+ -111, 64, 0, 0, -65, -58, 8, -15, 84, 0, 0, 0, 63, -30, -81,
+ 47, -124, 0, 0, 0, -65, -32, 87, -82, 61, 64, 0, 0, 63, -30,
+ 88, -42, 9, 0, 0, 0, -65, -26, 35, -69, -119, -64, 0, 0, 63,
+ -30, 1, 124, 2, -64, 0, 0, -65, -28, 87, -99, -98, 64, 0, 0,
+ 63, -31, -87, 94, -111, 64, 0, 0, -65, -45, 3, 28, -55, 0,
+ 0, 0, 63, -31, 80, -74, -114, -128, 0, 0, 63, -58, 99, -107,
+ -26, 0, 0, 0, 63, -32, -9, -72, 118, -128, 0, 0, 63, -32,
+ 75, 60, -115, 64, 0, 0, 63, -32, -98, -108, -34, 64, 0, 0,
+ 63, -27, -10, -8, 88, -64, 0, 0, 63, -32, 69, 120, 96, -128,
+ 0, 0, 63, -28, -29, -126, 123, 64, 0, 0, 63, -33, -39, 24,
+ 37, -128, 0, 0, 63, -42, 97, 18, -1, 0, 0, 0, 63, -33, 39,
+ -22, -25, 0, 0, 0, -65, -67, -67, -45, -14, 0, 0, 0, 63,
+ -34, 119, -83, -70, 0, 0, 0, -65, -31, -36, 58, -38, -64, 0,
+ 0, 63, -35, -56, -98, -35, -128, 0, 0, -65, -26, 82, -113,
+ -127, 0, 0, 0, 63, -35, 26, -9, 16, -128, 0, 0, -65, -39,
+ -77, 108, 121, 0, 0, 0, 63, -36, 110, -23, 49, -128, 0, 0,
+ 63, -54, 61, 52, -56, 0, 0, 0, 63, -37, -60, -93, -119, 0,
+ 0, 0, 63, -28, 98, 116, -68, -64, 0, 0, 63, -37, 28, 78,
+ -53, -128, 0, 0, 63, -27, 73, 96, 4, -64, 0, 0, 63, -38,
+ 118, 16, 65, -128, 0, 0, 63, -45, 98, -1, -37, -128, 0, 0,
+ 63, -39, -46, 7, -128, 0, 0, 0, -65, -44, -114, 42, -15,
+ -128, 0, 0, 63, -39, 48, 82, 66, -128, 0, 0, -65, -26, 7,
+ 54, -101, -64, 0, 0, 63, -40, -111, 7, -40, 0, 0, 0, -65,
+ -35, -51, -69, -109, 0, 0, 0, 63, -41, -12, 63, -39, -128,
+ 0, 0, 63, -48, -59, -44, 99, -128, 0, 0, 63, -41, 90, 10, 1,
+ -128, 0, 0, 63, -27, 118, 75, -116, 0, 0, 0, 63, -42, -62,
+ 121, 24, -128, 0, 0, 63, -31, 25, 7, 100, 64, 0, 0, 63, -42,
+ 45, -107, -23, 0, 0, 0, -65, -58, -95, 62, 125, 0, 0, 0, 63,
+ -43, -101, 111, -122, -128, 0, 0, -65, -27, -69, 90, -76,
+ -128, 0, 0, 63, -43, 12, 8, -126, -128, 0, 0, -65, -40, 8,
+ 81, -41, -128, 0, 0, 63, -44, 127, 108, -11, 0, 0, 0, 63,
+ -33, 125, 16, -56, -128, 0, 0, 63, -45, -11, -102, 68, 0, 0,
+ 0, 63, -28, -71, 13, 81, 64, 0, 0, 63, -45, 110, -103, -94,
+ 0, 0, 0, -65, 121, -87, 70, -96, 0, 0, 0, 63, -46, -22, 100,
+ -25, -128, 0, 0, -65, -26, -124, -31, -123, 0, 0, 0, 63,
+ -46, 105, 1, -108, -128, 0, 0, -65, -51, 57, 21, 0, 0, 0, 0,
+ 63, -47, -22, 104, 115, -128, 0, 0, 63, -28, 67, -99, 49,
+ -64, 0, 0, 63, -47, 110, -103, 96, 0, 0, 0, 63, -38, -29,
+ 115, -19, -128, 0, 0, 63, -48, -11, -113, -88, 0, 0, 0, -65,
+ -32, -57, 4, -111, -64, 0, 0, 63, -48, 127, 66, 73, -128, 0,
+ 0, -65, -35, 22, 79, 22, -128, 0, 0, 63, -48, 11, -77, -49,
+ -128, 0, 0, 63, -29, 81, -90, -35, 0, 0, 0, 63, -49, 53,
+ -101, -54, 0, 0, 0, 63, -41, 20, -53, 34, 0, 0, 0, 63, -50,
+ 89, 64, 25, 0, 0, 0, -65, -29, 19, 126, -68, 64, 0, 0, 63,
+ -51, -126, 2, 123, 0, 0, 0, -65, -58, -101, 63, 23, 0, 0, 0,
+ 63, -52, -80, 40, 91, 0, 0, 0, 63, -24, -91, -96, -50, 0, 0,
+ 0, 63, -53, -29, 47, 22, 0, 0, 0, -65, -41, -114, 4, 95,
+ -128, 0, 0, 63, -53, 27, -114, 46, 0, 0, 0, -65, -40, 49,
+ -117, -81, 0, 0, 0, 63, -54, 88, -119, 16, 0, 0, 0, 63, -29,
+ -121, -96, 15, -128, 0, 0, 63, -55, -102, -47, -87, 0, 0, 0,
+ -65, -61, 105, 14, -83, 0, 0, 0, 63, -56, -31, 108, -33, 0,
+ 0, 0, -65, -33, 63, -16, -111, -128, 0, 0, 63, -56, 45, 72,
+ -84, 0, 0, 0, 63, -22, -122, 10, -109, -128, 0, 0, 63, -57,
+ 125, 47, 67, 0, 0, 0, -65, -27, 77, 102, 63, -64, 0, 0, 63,
+ -58, -46, 65, -16, 0, 0, 0, 63, -48, 113, -66, -14, -128, 0,
+ 0, 63, -58, 43, 32, 18, 0, 0, 0, 63, -57, 61, 31, -100, 0,
+ 0, 0, 63, -59, -119, 7, -105, 0, 0, 0, -65, -37, -79, 96,
+ -95, -128, 0, 0, 63, -60, -22, -116, 96, 0, 0, 0, 63, -32,
+ 51, 36, 61, -64, 0, 0, 63, -60, 80, -31, 125, 0, 0, 0, -65,
+ -35, -18, -128, -112, -128, 0, 0, 63, -61, -70, -64, 56, 0,
+ 0, 0, 63, -41, -15, -93, 33, -128, 0, 0, 63, -61, 41, 23,
+ 61, 0, 0, 0, -65, -49, 26, -36, -127, 0, 0, 0, 63, -62,
+ -101, 7, -36, 0, 0, 0, 63, -61, 69, -32, -25, 0, 0, 0, 63,
+ -62, 16, -14, 0, 0, 0, 0, -65, -87, -65, -61, -96, 0, 0, 0,
+ 63, -63, -118, -80, -78, 0, 0, 0, 63, 104, 11, -91, 64, 0,
+ 0, 0, 63, -63, 7, -66, 20, 0, 0, 0, 63, -87, 42, -43, -36,
+ 0, 0, 0, 63, -64, -119, 9, -46, 0, 0, 0, -65, -77, 65, -65,
+ -116, 0, 0, 0, 63, -64, 12, -52, 89, 0, 0, 0, 63, -74, -101,
+ -83, -58, 0, 0, 0, 63, -65, 42, -56, -30, 0, 0, 0, -65, -81,
+ 45, 20, -48, 0, 0, 0, 63, -66, 62, -26, -48, 0, 0, 0, 63,
+ -81, 118, -95, -108, 0, 0, 0, 63, -67, 94, 40, 80, 0, 0, 0,
+ -65, -82, 117, 104, -28, 0, 0, 0, 63, -68, 126, 32, -26, 0,
+ 0, 0, 63, -80, 115, 69, 50, 0, 0, 0, 63, -69, -86, -34, 124,
+ 0, 0, 0, -65, -99, -26, -124, 32, 0, 0, 0, 63, -70, -42, 15,
+ -78, 0, 0, 0, 63, -93, -45, 109, -44, 0, 0, 0, 63, -70, 15,
+ -98, 2, 0, 0, 0, 63, -127, -37, 95, 16, 0, 0, 0, 63, -71,
+ 69, -118, -82, 0, 0, 0, -65, -92, -52, 45, 36, 0, 0, 0, 63,
+ -72, -117, 32, -84, 0, 0, 0, 63, -87, -5, 115, 84, 0, 0, 0,
+ 63, -73, -53, 119, -96, 0, 0, 0, -65, -87, -115, -86, -80,
+ 0, 0, 0, 63, -73, 28, 40, -26, 0, 0, 0, 63, -74, -12, 85,
+ 22, 0, 0, 0, 63, -74, 102, -55, -126, 0, 0, 0, -65, -65,
+ -114, 92, -36, 0, 0, 0, 63, -75, -63, -125, -78, 0, 0, 0,
+ 63, -64, -93, -123, -55, 0, 0, 0, 63, -75, 22, 126, -110, 0,
+ 0, 0, -65, -60, -96, -30, 79, 0, 0, 0, 63, -76, 122, 11, 0,
+ 0, 0, 0, 63, -60, -109, 97, 47, 0, 0, 0, 63, -77, -39, -99,
+ -18, 0, 0, 0, -65, -69, 10, 14, 2, 0, 0, 0, 63, -77, 68,
+ -88, 54, 0, 0, 0, -65, -76, -72, -116, -102, 0, 0, 0, 63,
+ -78, -81, 52, -44, 0, 0, 0, 63, -38, 34, 4, 75, -128, 0, 0,
+ 63, -78, 32, 86, -46, 0, 0, 0, -65, -24, -90, 85, -58, 0, 0,
+ 0, 63, -79, -106, 83, -40, 0, 0, 0, 63, -30, -105, 64, 26,
+ -64, 0, 0, 63, -79, 12, 38, -62, 0, 0, 0, 63, -48, 55, -69,
+ 121, -128, 0, 0, 63, -80, -114, 12, 80, 0, 0, 0, -65, -28,
+ 62, -6, -92, -64, 0, 0, 63, -80, 7, 62, 66, 0, 0, 0, -65,
+ -33, 55, 73, 0, 0, 0, 0, 63, -81, 42, -36, -104, 0, 0, 0,
+ 63, -59, 54, 78, 79, 0, 0, 0, 63, -82, 33, -74, 44, 0, 0, 0,
+ 63, -30, 86, -74, -109, 0, 0, 0, 63, -83, 87, 14, 100, 0, 0,
+ 0, 63, -26, 11, 75, 15, 64, 0, 0, 63, -84, 80, -91, -68, 0,
+ 0, 0, 63, -26, -127, -73, 103, -128, 0, 0, 63, -85, -98,
+ -62, 84, 0, 0, 0, 63, -27, -93, -3, -41, 64, 0, 0, 63, -86,
+ -102, 37, -108, 0, 0, 0, 63, -36, 1, -125, 75, -128, 0, 0,
+ 63, -86, 0, 5, -4, 0, 0, 0, -65, -60, -43, -22, -40, 0, 0,
+ 0, 63, -88, -3, 61, -8, 0, 0, 0, -65, -25, -3, 7, -90, -64,
+ 0, 0, 63, -88, 120, -33, 124, 0, 0, 0, 63, -46, -37, 13,
+ -62, -128, 0, 0, 63, -89, 121, 37, -104, 0, 0, 0, 63, -50,
+ -128, -59, -125, 0, 0, 0, 63, -89, 7, 73, 52, 0, 0, 0, -65,
+ -41, -93, -27, 70, 0, 0, 0, 63, -90, 13, 72, -32, 0, 0, 0,
+ 63, -43, 15, 45, 20, 0, 0, 0, 63, -91, -87, 33, 104, 0, 0,
+ 0, -65, -47, -66, -78, 59, 0, 0, 0, 63, -92, -71, 101, -36,
+ 0, 0, 0, 63, -48, 18, 90, -72, -128, 0, 0, 63, -92, 91, -10,
+ 92, 0, 0, 0, -65, -49, 42, -102, -49, 0, 0, 0, 63, -93, 125,
+ -26, -36, 0, 0, 0, 63, -55, -5, 67, 105, 0, 0, 0, 63, -93,
+ 28, 93, -20, 0, 0, 0, 63, -85, 109, -126, -76, 0, 0, 0, 63,
+ -94, 93, 36, -20, 0, 0, 0, -65, -28, -63, -123, 118, 0, 0,
+ 0, 63, -95, -29, 88, 16, 0, 0, 0, 63, -57, 116, -110, -20,
+ 0, 0, 0, 63, -95, 97, 107, 88, 0, 0, 0, 63, -37, 101, -94,
+ 50, 0, 0, 0, 63, -96, -107, -6, 36, 0, 0, 0, 63, -87, 72,
+ -66, 4, 0, 0, 0, 63, -96, -41, -86, 72, 0, 0, 0};
+
+ public static void main(final String[] args) throws Exception {
+ test(data32, 32);
+ test(data64, 64);
+ }
+
+ private static void test(final byte[] data, final int bits)
+ throws Exception {
+
+ // Audio data should contain the same format as a command lines above
+ checkAudioStream(new ByteArrayInputStream(data), data, bits);
+
+ // Checks that the data will be preserved when we save audio data to the
+ // file and read it again
+ final File file = File.createTempFile("sound", "test");
+ try (final InputStream fis = new FileInputStream(file);
+ final InputStream is = new ByteArrayInputStream(data);
+ final AudioInputStream ais = AudioSystem.getAudioInputStream(is)) {
+ AudioSystem.write(ais, AudioFileFormat.Type.AU, file);
+ if (!Arrays.equals(data, fis.readAllBytes())) {
+ throw new RuntimeException("Wrong data in the file");
+ }
+ } finally {
+ Files.delete(Paths.get(file.getAbsolutePath()));
+ }
+
+ // Checks that the data will be preserved when we save audio data to the
+ // stream and read it again
+ try (final ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ final InputStream is = new ByteArrayInputStream(data);
+ final AudioInputStream ais = AudioSystem.getAudioInputStream(is)) {
+ AudioSystem.write(ais, AudioFileFormat.Type.AU, baos);
+ if (!Arrays.equals(data, baos.toByteArray())) {
+ throw new RuntimeException("Wrong data in the stream");
+ }
+ }
+ }
+
+ /**
+ * Tests that audio data is the same format as a command lines above.
+ */
+ private static void checkAudioStream(final InputStream is,
+ final byte[] data, final int bits)
+ throws Exception {
+ final AudioFileFormat aff = AudioSystem.getAudioFileFormat(is);
+ final int byteLength = aff.getByteLength();
+ if (byteLength != data.length) {
+ throw new RuntimeException("Wrong byteLength: " + byteLength);
+ }
+ final AudioFileFormat.Type type = aff.getType();
+ if (!type.equals(AudioFileFormat.Type.AU)) {
+ throw new RuntimeException("Wrong type: " + type);
+ }
+ final int frameLength = aff.getFrameLength();
+ if (frameLength != 0.01f * aff.getFormat().getFrameRate()) {
+ throw new RuntimeException("Wrong frameLength: " + frameLength);
+ }
+ checkAudioFormat(aff.getFormat(), bits);
+ try (AudioInputStream ais = AudioSystem.getAudioInputStream(is)) {
+ final AudioFormat format = ais.getFormat();
+ if (ais.getFrameLength() != 0.01f * format.getFrameRate()) {
+ throw new RuntimeException(
+ "Wrong frameLength: " + ais.getFrameLength());
+ }
+ checkAudioFormat(format, bits);
+ }
+ }
+
+ /**
+ * Tests that audio data is the same format as a command lines above.
+ */
+ private static void checkAudioFormat(final AudioFormat audioFormat,
+ final int bits) {
+ final int channels = audioFormat.getChannels();
+ if (channels != 2) {
+ throw new RuntimeException("Wrong channels: " + channels);
+ }
+ final int sizeInBits = audioFormat.getSampleSizeInBits();
+ if (sizeInBits != bits) {
+ throw new RuntimeException("Wrong sizeInBits: " + sizeInBits);
+ }
+ final int frameSize = audioFormat.getFrameSize();
+ if (frameSize != sizeInBits * channels / 8) {
+ throw new RuntimeException("Wrong frameSize: " + frameSize);
+ }
+ final AudioFormat.Encoding encoding = audioFormat.getEncoding();
+ if (!encoding.equals(AudioFormat.Encoding.PCM_FLOAT)) {
+ throw new RuntimeException("Wrong encoding: " + encoding);
+ }
+ final float frameRate = audioFormat.getFrameRate();
+ if (frameRate != 32000) {
+ throw new RuntimeException("Wrong frameRate: " + frameRate);
+ }
+ final float sampleRate = audioFormat.getSampleRate();
+ if (sampleRate != 32000) {
+ throw new RuntimeException("Wrong sampleRate: " + sampleRate);
+ }
+ }
+}
From cb5aa60f49e55f5d2eb28a5c967fd77ad24de1c3 Mon Sep 17 00:00:00 2001
From: Sergey Bylokhov
Date: Sun, 9 Jun 2019 17:46:05 -0700
Subject: [PATCH 005/109] 8223045: GraphicsEnvironment does not detect
resolution changes in multiscreen systems
Reviewed-by: prr
---
.../native/libawt_xawt/awt/awt_GraphicsEnv.c | 68 ++++++++++---------
1 file changed, 36 insertions(+), 32 deletions(-)
diff --git a/src/java.desktop/unix/native/libawt_xawt/awt/awt_GraphicsEnv.c b/src/java.desktop/unix/native/libawt_xawt/awt/awt_GraphicsEnv.c
index 174e9b69745..93506e2f7ef 100644
--- a/src/java.desktop/unix/native/libawt_xawt/awt/awt_GraphicsEnv.c
+++ b/src/java.desktop/unix/native/libawt_xawt/awt/awt_GraphicsEnv.c
@@ -119,9 +119,8 @@ typedef struct {
} XineramaScreenInfo;
typedef XineramaScreenInfo* XineramaQueryScreensFunc(Display*, int*);
-
+static XineramaQueryScreensFunc* XineramaQueryScreens = NULL;
Bool usingXinerama = False;
-XRectangle fbrects[MAXFRAMEBUFFERS];
JNIEXPORT void JNICALL
Java_sun_awt_X11GraphicsConfig_initIDs (JNIEnv *env, jclass cls)
@@ -586,7 +585,6 @@ static void xineramaInit(void) {
int32_t locNumScr = 0;
XineramaScreenInfo *xinInfo;
char* XineramaQueryScreensName = "XineramaQueryScreens";
- XineramaQueryScreensFunc* XineramaQueryScreens = NULL;
gotXinExt = XQueryExtension(awt_display, XinExtName, &major_opcode,
&first_event, &first_error);
@@ -612,36 +610,27 @@ static void xineramaInit(void) {
XineramaQueryScreens = (XineramaQueryScreensFunc*)
dlsym(libHandle, XineramaQueryScreensName);
- if (XineramaQueryScreens != NULL) {
+ if (XineramaQueryScreens == NULL) {
+ DTRACE_PRINTLN("couldn't load XineramaQueryScreens symbol");
+ dlclose(libHandle);
+ } else {
DTRACE_PRINTLN("calling XineramaQueryScreens func");
xinInfo = (*XineramaQueryScreens)(awt_display, &locNumScr);
- if (xinInfo != NULL && locNumScr > XScreenCount(awt_display)) {
- int32_t idx;
- DTRACE_PRINTLN("Enabling Xinerama support");
- usingXinerama = True;
- /* set global number of screens */
- DTRACE_PRINTLN1(" num screens = %i\n", locNumScr);
- awt_numScreens = locNumScr;
-
- /* stuff values into fbrects */
- for (idx = 0; idx < awt_numScreens; idx++) {
- DASSERT(xinInfo[idx].screen_number == idx);
-
- fbrects[idx].width = xinInfo[idx].width;
- fbrects[idx].height = xinInfo[idx].height;
- fbrects[idx].x = xinInfo[idx].x_org;
- fbrects[idx].y = xinInfo[idx].y_org;
+ if (xinInfo != NULL) {
+ if (locNumScr > XScreenCount(awt_display)) {
+ DTRACE_PRINTLN("Enabling Xinerama support");
+ usingXinerama = True;
+ /* set global number of screens */
+ DTRACE_PRINTLN1(" num screens = %i\n", locNumScr);
+ awt_numScreens = locNumScr;
+ } else {
+ DTRACE_PRINTLN("XineramaQueryScreens <= XScreenCount");
}
+ XFree(xinInfo);
} else {
- DTRACE_PRINTLN((xinInfo == NULL) ?
- "calling XineramaQueryScreens didn't work" :
- "XineramaQueryScreens <= XScreenCount"
- );
+ DTRACE_PRINTLN("calling XineramaQueryScreens didn't work");
}
- } else {
- DTRACE_PRINTLN("couldn't load XineramaQueryScreens symbol");
}
- dlclose(libHandle);
} else {
DTRACE_PRINTLN1("\ncouldn't open shared library: %s\n", dlerror());
}
@@ -1303,6 +1292,8 @@ Java_sun_awt_X11GraphicsConfig_pGetBounds(JNIEnv *env, jobject this, jint screen
jmethodID mid;
jobject bounds = NULL;
AwtGraphicsConfigDataPtr adata;
+ int32_t locNumScr = 0;
+ XineramaScreenInfo *xinInfo;
adata = (AwtGraphicsConfigDataPtr)
JNU_GetLongFieldAsPtr(env, this, x11GraphicsConfigIDs.aData);
@@ -1313,17 +1304,30 @@ Java_sun_awt_X11GraphicsConfig_pGetBounds(JNIEnv *env, jobject this, jint screen
if (mid != NULL) {
if (usingXinerama) {
if (0 <= screen && screen < awt_numScreens) {
- bounds = (*env)->NewObject(env, clazz, mid, fbrects[screen].x,
- fbrects[screen].y,
- fbrects[screen].width,
- fbrects[screen].height);
+ AWT_LOCK();
+ xinInfo = (*XineramaQueryScreens)(awt_display, &locNumScr);
+ AWT_UNLOCK();
+ if (xinInfo != NULL && locNumScr > 0) {
+ if (screen >= locNumScr) {
+ screen = 0; // fallback to the main screen
+ }
+ DASSERT(xinInfo[screen].screen_number == screen);
+ bounds = (*env)->NewObject(env, clazz, mid,
+ xinInfo[screen].x_org,
+ xinInfo[screen].y_org,
+ xinInfo[screen].width,
+ xinInfo[screen].height);
+ XFree(xinInfo);
+ }
} else {
jclass exceptionClass = (*env)->FindClass(env, "java/lang/IllegalArgumentException");
if (exceptionClass != NULL) {
(*env)->ThrowNew(env, exceptionClass, "Illegal screen index");
}
}
- } else {
+ }
+ if (!bounds) {
+ // Xinerama cannot provide correct bounds, will try X11
XWindowAttributes xwa;
memset(&xwa, 0, sizeof(xwa));
From 024c62ce0c3b3e8995374b98966e4c566cc0fe97 Mon Sep 17 00:00:00 2001
From: Prasanta Sadhukhan
Date: Mon, 10 Jun 2019 10:52:11 +0530
Subject: [PATCH 006/109] 8225368: broken links in java.desktop files
Reviewed-by: serb
---
src/java.desktop/share/classes/java/awt/Font.java | 7 ++++---
src/java.desktop/share/classes/java/awt/FontMetrics.java | 5 +++--
.../classes/java/awt/doc-files/DesktopProperties.html | 4 ++--
.../javax/imageio/metadata/doc-files/tiff_metadata.html | 2 +-
src/java.desktop/share/classes/javax/print/DocFlavor.java | 6 +++---
.../share/classes/javax/print/attribute/package-info.java | 2 +-
6 files changed, 14 insertions(+), 12 deletions(-)
diff --git a/src/java.desktop/share/classes/java/awt/Font.java b/src/java.desktop/share/classes/java/awt/Font.java
index e25557f0e25..7c3c7874dbf 100644
--- a/src/java.desktop/share/classes/java/awt/Font.java
+++ b/src/java.desktop/share/classes/java/awt/Font.java
@@ -2144,9 +2144,10 @@ public class Font implements java.io.Serializable
* Checks if this {@code Font} has a glyph for the specified
* character.
*
- * Note: This method cannot handle supplementary
- * characters . To support all Unicode characters, including
+ *
Note: This method cannot handle
+ *
+ * supplementary characters .
+ * To support all Unicode characters, including
* supplementary characters, use the {@link #canDisplay(int)}
* method or {@code canDisplayUpTo} methods.
*
diff --git a/src/java.desktop/share/classes/java/awt/FontMetrics.java b/src/java.desktop/share/classes/java/awt/FontMetrics.java
index 7ec69f77b61..2f6a1af22d3 100644
--- a/src/java.desktop/share/classes/java/awt/FontMetrics.java
+++ b/src/java.desktop/share/classes/java/awt/FontMetrics.java
@@ -317,8 +317,9 @@ public abstract class FontMetrics implements java.io.Serializable {
* of its characters.
*
*
Note: This method cannot handle supplementary
- * characters . To support all Unicode characters, including
+ * href="../../../java.base/java/lang/Character.html#supplementary">
+ * supplementary characters.
+ * To support all Unicode characters, including
* supplementary characters, use the {@link #charWidth(int)} method.
*
* @param ch the character to be measured
diff --git a/src/java.desktop/share/classes/java/awt/doc-files/DesktopProperties.html b/src/java.desktop/share/classes/java/awt/doc-files/DesktopProperties.html
index c24a507dfc3..478a0238a8e 100644
--- a/src/java.desktop/share/classes/java/awt/doc-files/DesktopProperties.html
+++ b/src/java.desktop/share/classes/java/awt/doc-files/DesktopProperties.html
@@ -65,12 +65,12 @@ here, and their value types.
awt.font.desktophints
-java.util.Map
+{@link java.util.Map java.util.Map}
Font smoothing (text antialiasing) settings.
sun.awt.enableExtraMouseButtons
-java.lang.Boolean
+{@link java.lang.Boolean java.lang.Boolean}
Controls if mouse events from extra buttons are to be generated or not
diff --git a/src/java.desktop/share/classes/javax/imageio/metadata/doc-files/tiff_metadata.html b/src/java.desktop/share/classes/javax/imageio/metadata/doc-files/tiff_metadata.html
index f88555f7881..4b9644fcc99 100644
--- a/src/java.desktop/share/classes/javax/imageio/metadata/doc-files/tiff_metadata.html
+++ b/src/java.desktop/share/classes/javax/imageio/metadata/doc-files/tiff_metadata.html
@@ -191,7 +191,7 @@ and set the ImageTypeSpecifier
using
with the ICC profile-based color space, then a second
ImageTypeSpecifier
derived from this inferred color
space will be included in the
-Iterator returned by
+{@link java.util.Iterator Iterator} returned by
ImageReader.getImageTypes
. If the iterator contains
more than one type, the first one will be based on the ICC profile and the
second on the inferred color space.
diff --git a/src/java.desktop/share/classes/javax/print/DocFlavor.java b/src/java.desktop/share/classes/javax/print/DocFlavor.java
index 9556bb2bac4..a52b0e18852 100644
--- a/src/java.desktop/share/classes/javax/print/DocFlavor.java
+++ b/src/java.desktop/share/classes/javax/print/DocFlavor.java
@@ -44,9 +44,9 @@ import java.io.Serializable;
* the IANA MIME-preferred name, or its canonical name if no preferred name is
* specified. Additionally a few historical names supported by earlier
* versions of the Java platform may be recognized. See
- * character encodings
- * for more information on the character encodings supported on the Java
- * platform.
+ *
+ * character encodings for more information on the character encodings
+ * supported on the Java platform.
* Representation class name. This specifies the fully-qualified
* name of the class of the object from which the actual print data comes, as
* returned by the {@link Class#getName() Class.getName()} method. (Thus the
diff --git a/src/java.desktop/share/classes/javax/print/attribute/package-info.java b/src/java.desktop/share/classes/javax/print/attribute/package-info.java
index 3e796fe0927..2470175ec21 100644
--- a/src/java.desktop/share/classes/javax/print/attribute/package-info.java
+++ b/src/java.desktop/share/classes/javax/print/attribute/package-info.java
@@ -137,7 +137,7 @@
* AttributeSet interface.
*
* The {@code AttributeSet} interface is similar to the
- * Map interface: it provides a map of
+ * {@link java.util.Map Map} interface: it provides a map of
* key to values, in which each key is unique and can contain no more than one
* value. However, the {@code AttributeSet} interface is designed to
* specifically support the needs of the Java Print Service API. An
From fa85fe2012d35120ff6274756d5b98167125afdd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Per=20Lid=C3=A9n?=
Date: Mon, 10 Jun 2019 12:52:56 +0200
Subject: [PATCH 007/109] 8224966: ZGC: Don't skip oop verification in
OopMapSet::all_do()
Reviewed-by: stefank, eosterlund
---
src/hotspot/share/compiler/oopMap.cpp | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/src/hotspot/share/compiler/oopMap.cpp b/src/hotspot/share/compiler/oopMap.cpp
index f8ab97bedd2..5426dd24222 100644
--- a/src/hotspot/share/compiler/oopMap.cpp
+++ b/src/hotspot/share/compiler/oopMap.cpp
@@ -379,12 +379,8 @@ void OopMapSet::all_do(const frame *fr, const RegisterMap *reg_map,
continue;
}
#ifdef ASSERT
- // We can not verify the oop here if we are using ZGC, the oop
- // will be bad in case we had a safepoint between a load and a
- // load barrier.
- if (!UseZGC &&
- ((((uintptr_t)loc & (sizeof(*loc)-1)) != 0) ||
- !Universe::heap()->is_in_or_null(*loc))) {
+ if ((((uintptr_t)loc & (sizeof(*loc)-1)) != 0) ||
+ !Universe::heap()->is_in_or_null(*loc)) {
tty->print_cr("# Found non oop pointer. Dumping state at failure");
// try to dump out some helpful debugging information
trace_codeblob_maps(fr, reg_map);
From 797a62e9385e8ffaa63c23251abf794aae512a96 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Per=20Lid=C3=A9n?=
Date: Mon, 10 Jun 2019 12:52:57 +0200
Subject: [PATCH 008/109] 8225227: ZGC: Be exact in what load barrier to use in
ZHeapIterator
Reviewed-by: stefank
---
src/hotspot/share/gc/z/zHeap.cpp | 4 +-
src/hotspot/share/gc/z/zHeapIterator.cpp | 105 ++++++++++++-----------
src/hotspot/share/gc/z/zHeapIterator.hpp | 13 +--
3 files changed, 65 insertions(+), 57 deletions(-)
diff --git a/src/hotspot/share/gc/z/zHeap.cpp b/src/hotspot/share/gc/z/zHeap.cpp
index df2c5c4b3fb..cb585e0ffa8 100644
--- a/src/hotspot/share/gc/z/zHeap.cpp
+++ b/src/hotspot/share/gc/z/zHeap.cpp
@@ -471,8 +471,8 @@ void ZHeap::relocate() {
void ZHeap::object_iterate(ObjectClosure* cl, bool visit_referents) {
assert(SafepointSynchronize::is_at_safepoint(), "Should be at safepoint");
- ZHeapIterator iter(visit_referents);
- iter.objects_do(cl);
+ ZHeapIterator iter;
+ iter.objects_do(cl, visit_referents);
}
void ZHeap::serviceability_initialize() {
diff --git a/src/hotspot/share/gc/z/zHeapIterator.cpp b/src/hotspot/share/gc/z/zHeapIterator.cpp
index 6c95bfd93cd..13d57837729 100644
--- a/src/hotspot/share/gc/z/zHeapIterator.cpp
+++ b/src/hotspot/share/gc/z/zHeapIterator.cpp
@@ -51,18 +51,29 @@ public:
}
};
+template
class ZHeapIteratorRootOopClosure : public ZRootsIteratorClosure {
private:
ZHeapIterator* const _iter;
+ oop load_oop(oop* p) {
+ if (Weak) {
+ return NativeAccess::oop_load(p);
+ }
+
+ if (Concurrent) {
+ return NativeAccess::oop_load(p);
+ }
+
+ return RawAccess<>::oop_load(p);
+ }
+
public:
ZHeapIteratorRootOopClosure(ZHeapIterator* iter) :
_iter(iter) {}
virtual void do_oop(oop* p) {
- // Load barrier needed here, even on non-concurrent strong roots,
- // for the same reason we need fixup_partial_loads() in ZHeap::mark_end().
- const oop obj = NativeAccess::oop_load(p);
+ const oop obj = load_oop(p);
_iter->push(obj);
}
@@ -71,28 +82,27 @@ public:
}
};
+template
class ZHeapIteratorOopClosure : public BasicOopIterateClosure {
private:
ZHeapIterator* const _iter;
const oop _base;
- const bool _visit_referents;
- oop load_oop(oop* p) const {
- if (_visit_referents) {
- return HeapAccess::oop_load_at(_base, _base->field_offset(p));
- } else {
- return HeapAccess::oop_load(p);
+ oop load_oop(oop* p) {
+ if (VisitReferents) {
+ return HeapAccess::oop_load_at(_base, _base->field_offset(p));
}
+
+ return HeapAccess::oop_load(p);
}
public:
- ZHeapIteratorOopClosure(ZHeapIterator* iter, oop base, bool visit_referents) :
+ ZHeapIteratorOopClosure(ZHeapIterator* iter, oop base) :
_iter(iter),
- _base(base),
- _visit_referents(visit_referents) {}
+ _base(base) {}
virtual ReferenceIterationMode reference_iteration_mode() {
- return _visit_referents ? DO_FIELDS : DO_FIELDS_EXCEPT_REFERENT;
+ return VisitReferents ? DO_FIELDS : DO_FIELDS_EXCEPT_REFERENT;
}
virtual void do_oop(oop* p) {
@@ -111,10 +121,9 @@ public:
#endif
};
-ZHeapIterator::ZHeapIterator(bool visit_referents) :
+ZHeapIterator::ZHeapIterator() :
_visit_stack(),
- _visit_map(),
- _visit_referents(visit_referents) {}
+ _visit_map() {}
ZHeapIterator::~ZHeapIterator() {
ZVisitMapIterator iter(&_visit_map);
@@ -162,49 +171,45 @@ void ZHeapIterator::push(oop obj) {
_visit_stack.push(obj);
}
+template
+void ZHeapIterator::push_roots() {
+ ZHeapIteratorRootOopClosure cl(this);
+ RootsIterator roots;
+ roots.oops_do(&cl);
+}
+
+template
+void ZHeapIterator::push_fields(oop obj) {
+ ZHeapIteratorOopClosure cl(this, obj);
+ obj->oop_iterate(&cl);
+}
+
+template
void ZHeapIterator::objects_do(ObjectClosure* cl) {
- // Note that the heap iterator visits all reachable objects, including
- // objects that might be unreachable from the application, such as a
- // not yet cleared JNIWeakGloablRef. However, also note that visiting
- // the JVMTI tag map is a requirement to make sure we visit all tagged
- // objects, even those that might now have become phantom reachable.
- // If we didn't do this the application would have expected to see
- // ObjectFree events for phantom reachable objects in the tag map.
-
ZStatTimerDisable disable;
- ZHeapIteratorRootOopClosure root_cl(this);
- // Push strong roots onto stack
- {
- ZRootsIterator roots;
- roots.oops_do(&root_cl);
- }
-
- {
- ZConcurrentRootsIterator roots;
- roots.oops_do(&root_cl);
- }
-
- // Push weak roots onto stack
- {
- ZWeakRootsIterator roots;
- roots.oops_do(&root_cl);
- }
-
- {
- ZConcurrentWeakRootsIterator roots;
- roots.oops_do(&root_cl);
- }
+ // Push roots to visit
+ push_roots ();
+ push_roots ();
+ push_roots ();
+ push_roots ();
// Drain stack
while (!_visit_stack.is_empty()) {
const oop obj = _visit_stack.pop();
- // Visit
+ // Visit object
cl->do_object(obj);
- // Push members to visit
- ZHeapIteratorOopClosure push_cl(this, obj, _visit_referents);
- obj->oop_iterate(&push_cl);
+ // Push fields to visit
+ push_fields(obj);
+ }
+}
+
+void ZHeapIterator::objects_do(ObjectClosure* cl, bool visit_referents) {
+ if (visit_referents) {
+ objects_do (cl);
+ } else {
+ objects_do (cl);
}
}
diff --git a/src/hotspot/share/gc/z/zHeapIterator.hpp b/src/hotspot/share/gc/z/zHeapIterator.hpp
index f04f655ab54..c32fad4f9ab 100644
--- a/src/hotspot/share/gc/z/zHeapIterator.hpp
+++ b/src/hotspot/share/gc/z/zHeapIterator.hpp
@@ -32,8 +32,8 @@ class ObjectClosure;
class ZHeapIteratorBitMap;
class ZHeapIterator : public StackObj {
- friend class ZHeapIteratorRootOopClosure;
- friend class ZHeapIteratorOopClosure;
+ template friend class ZHeapIteratorRootOopClosure;
+ template friend class ZHeapIteratorOopClosure;
private:
typedef ZGranuleMap ZVisitMap;
@@ -42,16 +42,19 @@ private:
ZVisitStack _visit_stack;
ZVisitMap _visit_map;
- const bool _visit_referents;
ZHeapIteratorBitMap* object_map(oop obj);
void push(oop obj);
+ template void push_roots();
+ template void push_fields(oop obj);
+ template void objects_do(ObjectClosure* cl);
+
public:
- ZHeapIterator(bool visit_referents);
+ ZHeapIterator();
~ZHeapIterator();
- void objects_do(ObjectClosure* cl);
+ void objects_do(ObjectClosure* cl, bool visit_referents);
};
#endif // SHARE_GC_Z_ZHEAPITERATOR_HPP
From 6d3f5f851eb001f8ee124404618d4dcc98d4923d Mon Sep 17 00:00:00 2001
From: Philipp Kunz
Date: Mon, 10 Jun 2019 20:38:15 +0800
Subject: [PATCH 009/109] 8221719: Jarsigner fails to verify signed by alias if
alias given in wrong case
Reviewed-by: weijun
---
.../sun/security/tools/jarsigner/Main.java | 48 ++++---
.../JavaKeyStoreAliasCaseInsensitive.java | 135 ++++++++++++++++++
2 files changed, 162 insertions(+), 21 deletions(-)
create mode 100644 test/jdk/sun/security/tools/jarsigner/JavaKeyStoreAliasCaseInsensitive.java
diff --git a/src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Main.java b/src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Main.java
index bbb2eb274af..742caf79374 100644
--- a/src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Main.java
+++ b/src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Main.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2019, 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
@@ -1300,7 +1300,7 @@ public class Main {
String alias = storeHash.get(c);
if (alias != null) {
- certStr.append(space).append(alias);
+ certStr.append(space).append("(").append(alias).append(")");
}
if (x509Cert != null) {
@@ -1425,37 +1425,43 @@ public class Main {
}
int result = 0;
- List extends Certificate> certs = signer.getSignerCertPath().getCertificates();
- for (Certificate c : certs) {
- String alias = storeHash.get(c);
- if (alias != null) {
- if (alias.startsWith("(")) {
- result |= IN_KEYSTORE;
- }
- if (ckaliases.contains(alias.substring(1, alias.length() - 1))) {
- result |= SIGNED_BY_ALIAS;
- }
- } else {
- if (store != null) {
- try {
+ if (store != null) {
+ try {
+ List extends Certificate> certs =
+ signer.getSignerCertPath().getCertificates();
+ for (Certificate c : certs) {
+ String alias = storeHash.get(c);
+ if (alias == null) {
alias = store.getCertificateAlias(c);
- } catch (KeyStoreException kse) {
- // never happens, because keystore has been loaded
+ if (alias != null) {
+ storeHash.put(c, alias);
+ }
}
if (alias != null) {
- storeHash.put(c, "(" + alias + ")");
result |= IN_KEYSTORE;
}
+ for (String ckalias : ckaliases) {
+ if (c.equals(store.getCertificate(ckalias))) {
+ result |= SIGNED_BY_ALIAS;
+ // must continue with next certificate c and cannot
+ // return or break outer loop because has to fill
+ // storeHash for printCert
+ break;
+ }
+ }
}
- if (ckaliases.contains(alias)) {
- result |= SIGNED_BY_ALIAS;
- }
+ } catch (KeyStoreException kse) {
+ // never happens, because keystore has been loaded
}
}
cacheForInKS.put(signer, result);
return result;
}
+ /**
+ * Maps certificates (as keys) to alias names associated in the keystore
+ * {@link #store} (as values).
+ */
Hashtable storeHash = new Hashtable<>();
int inKeyStore(CodeSigner[] signers) {
diff --git a/test/jdk/sun/security/tools/jarsigner/JavaKeyStoreAliasCaseInsensitive.java b/test/jdk/sun/security/tools/jarsigner/JavaKeyStoreAliasCaseInsensitive.java
new file mode 100644
index 00000000000..7f05dd30587
--- /dev/null
+++ b/test/jdk/sun/security/tools/jarsigner/JavaKeyStoreAliasCaseInsensitive.java
@@ -0,0 +1,135 @@
+/*
+ * Copyright (c) 2019, 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 8221719
+ * @library /test/lib
+ * @run testng JavaKeyStoreAliasCaseInsensitive
+ * @summary Checks that jarsigner verifies a signed jar with the same alias as
+ * was specified for signing, particularly regarding upper and lower case and
+ * its conversion to lower case by JKS
+ * ({@link sun.security.provider.JavaKeyStore.JKS#convertAlias(String)}).
+ */
+
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import jdk.test.lib.util.JarUtils;
+import jdk.test.lib.SecurityTools;
+import org.testng.annotations.Test;
+
+public class JavaKeyStoreAliasCaseInsensitive {
+
+ /**
+ * Alias for certificates in the keystore with letters in different
+ * (upper and lower) cases.
+ */
+ static final String ALIAS = "AlIaS";
+
+ @Test
+ public void testAliasCase() throws Exception {
+ final String KEYSTORE_OPTIONS = "-storetype JKS -keystore "
+ + "test-alias-case.jks -storepass changeit";
+ SecurityTools.keytool(KEYSTORE_OPTIONS + " -genkeypair"
+ + " -keypass changeit -alias " + ALIAS + " -dname CN=" + ALIAS)
+ .shouldHaveExitValue(0);
+ String jarFilename = "test-alias-case.jar";
+ JarUtils.createJarFile(Paths.get(jarFilename), Paths.get("."),
+ Files.write(Paths.get("aFile"), new byte[1]));
+
+ SecurityTools.jarsigner(KEYSTORE_OPTIONS + " -verbose -debug " +
+ jarFilename + " " + ALIAS).shouldHaveExitValue(0);
+
+ SecurityTools.jarsigner("-verify -strict " + KEYSTORE_OPTIONS +
+ " -debug -verbose " + jarFilename + " " + ALIAS)
+ .shouldHaveExitValue(0)
+ .shouldNotContain(
+ "This jar contains signed entries which are not "
+ + "signed by the specified alias(es).");
+ }
+
+ /**
+ * This test essentially covers compatibility with the previous version of
+ * {@link sun.security.tools.jarsigner.Main#inKeyStoreForOneSigner} in case
+ * a certificate and alias entry is already in
+ * {@link sun.security.tools.jarsigner.Main#storeHash} when
+ * {@link sun.security.tools.jarsigner.Main#inKeyStoreForOneSigner} is
+ * invoked from a previous invocation of it.
+ * It passed with the previous {@code jarsigner} version with a lowercase
+ * alias {@link #ALIAS} and basically covers the duplicated portions of
+ * code in {@link sun.security.tools.jarsigner.Main#inKeyStoreForOneSigner}
+ * near {@code IN_KEYSTORE} and {@code SIGNED_BY_ALIAS} before having
+ * refactored and re-unified them in order to demonstrate identical
+ * behavior.
+ */
+ @Test
+ public void testAliasCaseStoreHash() throws Exception {
+ // Create a keystore with a certificate associated with ALIAS + "2"
+ // signed by another certificate associated with ALIAS + "1".
+ final String KEYSTORE_OPTIONS = "-storetype JKS -keystore"
+ + " test-alias-storeHash-case.jks -storepass changeit";
+ SecurityTools.keytool(KEYSTORE_OPTIONS + " -genkeypair"
+ + " -keypass changeit -alias " + ALIAS + "1 -dname CN=" +
+ ALIAS + "1").shouldHaveExitValue(0);
+ SecurityTools.keytool(KEYSTORE_OPTIONS + " -genkeypair"
+ + " -keypass changeit -alias " + ALIAS + "2 -dname CN="
+ + ALIAS + "2").shouldHaveExitValue(0);
+ String certReq = SecurityTools.keytool(KEYSTORE_OPTIONS +
+ " -certreq -keypass changeit -alias " + ALIAS + "2")
+ .shouldHaveExitValue(0).getStdout();
+ SecurityTools.setResponse(certReq);
+ String cert = SecurityTools.keytool(KEYSTORE_OPTIONS +
+ " -gencert -rfc -keypass changeit -alias " + ALIAS + "1")
+ .shouldHaveExitValue(0).getOutput();
+ SecurityTools.setResponse(cert);
+ SecurityTools.keytool(KEYSTORE_OPTIONS +
+ " -importcert -keypass changeit -alias " + ALIAS + "2")
+ .shouldHaveExitValue(0);
+
+ // Create a jar file signed by ALIAS + "2" and then add another file to
+ // that same jar and sign it by ALIAS + "1", ALIAS + "1" being an alias
+ // for a certificate which is part of the certificate chain of ALIAS +
+ // "2" but not the certificate ALIAS + "2" points to directly.
+ String jarFilename = "test-alias-storeHash-case.jar";
+ JarUtils.createJarFile(Paths.get(jarFilename), Paths.get("."));
+ SecurityTools.jarsigner(KEYSTORE_OPTIONS + " -verbose -debug " +
+ jarFilename + " " + ALIAS + "2").shouldHaveExitValue(0);
+ JarUtils.updateJarFile(Paths.get(jarFilename), Paths.get("."),
+ Files.write(Paths.get("added-file"), new byte[1]));
+ SecurityTools.jarsigner(KEYSTORE_OPTIONS + " -verbose -debug " +
+ jarFilename + " " + ALIAS + "1").shouldHaveExitValue(0);
+
+ // The later added file "added-file" is signed by the certificate
+ // associated with alias ALIAS + "1" directly while the other jarfile
+ // contents is signed by a certificate associated with alias ALIAS + "2"
+ // which includes the certificate associated with alias ALIAS + "1" in
+ // its certification path.
+ SecurityTools.jarsigner("-verify -strict " + KEYSTORE_OPTIONS +
+ " -debug -verbose " + jarFilename + " " + ALIAS + "1")
+ .shouldHaveExitValue(0)
+ .shouldNotContain(
+ "This jar contains signed entries which are not "
+ + "signed by the specified alias(es).");
+ }
+
+}
From 9ee5ab51243c9dfe7775e0277c65a6d17d76ef23 Mon Sep 17 00:00:00 2001
From: Harold Seigel
Date: Mon, 10 Jun 2019 09:52:04 -0400
Subject: [PATCH 010/109] 8224952: RI deviates from JVMS - non-zero
minor_version for class files throws UnsupportedClassVersionError
Change the JVM to follow the JVM Spec and accept non-zero minor_version for appropriate older class file versions.
Reviewed-by: acorn, dholmes, iignatyev
---
.../share/classfile/classFileParser.cpp | 102 +++++++++---------
.../runtime/ClassFile/PreviewVersion.java | 14 +--
2 files changed, 59 insertions(+), 57 deletions(-)
diff --git a/src/hotspot/share/classfile/classFileParser.cpp b/src/hotspot/share/classfile/classFileParser.cpp
index 417de672bf2..1583441e7e1 100644
--- a/src/hotspot/share/classfile/classFileParser.cpp
+++ b/src/hotspot/share/classfile/classFileParser.cpp
@@ -4754,60 +4754,62 @@ static bool has_illegal_visibility(jint flags) {
// A legal major_version.minor_version must be one of the following:
//
-// Major_version = 45, any minor_version.
-// Major_version >= 46 and major_version <= current_major_version and minor_version = 0.
-// Major_version = current_major_version and minor_version = 65535 and --enable-preview is present.
+// Major_version >= 45 and major_version < 56, any minor_version.
+// Major_version >= 56 and major_version <= JVM_CLASSFILE_MAJOR_VERSION and minor_version = 0.
+// Major_version = JVM_CLASSFILE_MAJOR_VERSION and minor_version = 65535 and --enable-preview is present.
//
static void verify_class_version(u2 major, u2 minor, Symbol* class_name, TRAPS){
+ ResourceMark rm(THREAD);
const u2 max_version = JVM_CLASSFILE_MAJOR_VERSION;
- if (major != JAVA_MIN_SUPPORTED_VERSION) { // All 45.* are ok including 45.65535
- if (minor == JAVA_PREVIEW_MINOR_VERSION) {
- if (major != max_version) {
- ResourceMark rm(THREAD);
- Exceptions::fthrow(
- THREAD_AND_LOCATION,
- vmSymbols::java_lang_UnsupportedClassVersionError(),
- "%s (class file version %u.%u) was compiled with preview features that are unsupported. "
- "This version of the Java Runtime only recognizes preview features for class file version %u.%u",
- class_name->as_C_string(), major, minor, JVM_CLASSFILE_MAJOR_VERSION, JAVA_PREVIEW_MINOR_VERSION);
- return;
- }
+ if (major < JAVA_MIN_SUPPORTED_VERSION) {
+ Exceptions::fthrow(
+ THREAD_AND_LOCATION,
+ vmSymbols::java_lang_UnsupportedClassVersionError(),
+ "%s (class file version %u.%u) was compiled with an invalid major version",
+ class_name->as_C_string(), major, minor);
+ return;
+ }
- if (!Arguments::enable_preview()) {
- ResourceMark rm(THREAD);
- Exceptions::fthrow(
- THREAD_AND_LOCATION,
- vmSymbols::java_lang_UnsupportedClassVersionError(),
- "Preview features are not enabled for %s (class file version %u.%u). Try running with '--enable-preview'",
- class_name->as_C_string(), major, minor);
- return;
- }
+ if (major > max_version) {
+ Exceptions::fthrow(
+ THREAD_AND_LOCATION,
+ vmSymbols::java_lang_UnsupportedClassVersionError(),
+ "%s has been compiled by a more recent version of the Java Runtime (class file version %u.%u), "
+ "this version of the Java Runtime only recognizes class file versions up to %u.0",
+ class_name->as_C_string(), major, minor, JVM_CLASSFILE_MAJOR_VERSION);
+ return;
+ }
- } else { // minor != JAVA_PREVIEW_MINOR_VERSION
- if (major > max_version) {
- ResourceMark rm(THREAD);
- Exceptions::fthrow(
- THREAD_AND_LOCATION,
- vmSymbols::java_lang_UnsupportedClassVersionError(),
- "%s has been compiled by a more recent version of the Java Runtime (class file version %u.%u), "
- "this version of the Java Runtime only recognizes class file versions up to %u.0",
- class_name->as_C_string(), major, minor, JVM_CLASSFILE_MAJOR_VERSION);
- } else if (major < JAVA_MIN_SUPPORTED_VERSION) {
- ResourceMark rm(THREAD);
- Exceptions::fthrow(
- THREAD_AND_LOCATION,
- vmSymbols::java_lang_UnsupportedClassVersionError(),
- "%s (class file version %u.%u) was compiled with an invalid major version",
- class_name->as_C_string(), major, minor);
- } else if (minor != 0) {
- ResourceMark rm(THREAD);
- Exceptions::fthrow(
- THREAD_AND_LOCATION,
- vmSymbols::java_lang_UnsupportedClassVersionError(),
- "%s (class file version %u.%u) was compiled with an invalid non-zero minor version",
- class_name->as_C_string(), major, minor);
- }
+ if (major < JAVA_12_VERSION || minor == 0) {
+ return;
+ }
+
+ if (minor == JAVA_PREVIEW_MINOR_VERSION) {
+ if (major != max_version) {
+ Exceptions::fthrow(
+ THREAD_AND_LOCATION,
+ vmSymbols::java_lang_UnsupportedClassVersionError(),
+ "%s (class file version %u.%u) was compiled with preview features that are unsupported. "
+ "This version of the Java Runtime only recognizes preview features for class file version %u.%u",
+ class_name->as_C_string(), major, minor, JVM_CLASSFILE_MAJOR_VERSION, JAVA_PREVIEW_MINOR_VERSION);
+ return;
}
+
+ if (!Arguments::enable_preview()) {
+ Exceptions::fthrow(
+ THREAD_AND_LOCATION,
+ vmSymbols::java_lang_UnsupportedClassVersionError(),
+ "Preview features are not enabled for %s (class file version %u.%u). Try running with '--enable-preview'",
+ class_name->as_C_string(), major, minor);
+ return;
+ }
+
+ } else { // minor != JAVA_PREVIEW_MINOR_VERSION
+ Exceptions::fthrow(
+ THREAD_AND_LOCATION,
+ vmSymbols::java_lang_UnsupportedClassVersionError(),
+ "%s (class file version %u.%u) was compiled with an invalid non-zero minor version",
+ class_name->as_C_string(), major, minor);
}
}
@@ -5641,11 +5643,11 @@ void ClassFileParser::fill_instance_klass(InstanceKlass* ik, bool changed_by_loa
}
if (ik->minor_version() == JAVA_PREVIEW_MINOR_VERSION &&
- ik->major_version() != JAVA_MIN_SUPPORTED_VERSION &&
+ ik->major_version() == JVM_CLASSFILE_MAJOR_VERSION &&
log_is_enabled(Info, class, preview)) {
ResourceMark rm;
log_info(class, preview)("Loading class %s that depends on preview features (class file version %d.65535)",
- ik->external_name(), ik->major_version());
+ ik->external_name(), JVM_CLASSFILE_MAJOR_VERSION);
}
if (log_is_enabled(Debug, class, resolve)) {
diff --git a/test/hotspot/jtreg/runtime/ClassFile/PreviewVersion.java b/test/hotspot/jtreg/runtime/ClassFile/PreviewVersion.java
index de84800459c..8bd2294fa60 100644
--- a/test/hotspot/jtreg/runtime/ClassFile/PreviewVersion.java
+++ b/test/hotspot/jtreg/runtime/ClassFile/PreviewVersion.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, 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
@@ -73,7 +73,7 @@ public class PreviewVersion {
// Subtract 1 from class's major version. The class should fail to load
// because its major_version does not match the JVM current version.
- int prev_major_version = Runtime.version().feature() - 1;
+ int prev_major_version = (klassbuf[6] << 8 | klassbuf[7]) - 1;
klassbuf[6] = (byte)((prev_major_version >> 8) & 0xff);
klassbuf[7] = (byte)(prev_major_version & 0xff);
try {
@@ -81,8 +81,8 @@ public class PreviewVersion {
throw new RuntimeException("UnsupportedClassVersionError exception not thrown");
} catch (java.lang.UnsupportedClassVersionError e) {
if (!e.getMessage().contains("compiled with preview features that are unsupported")) {
- throw new RuntimeException(
- "Wrong UnsupportedClassVersionError exception: " + e.getMessage());
+ throw new RuntimeException(
+ "Wrong UnsupportedClassVersionError exception: " + e.getMessage());
}
}
@@ -97,10 +97,10 @@ public class PreviewVersion {
"Unexpected UnsupportedClassVersionError exception thrown: " + e.getMessage());
}
- // Check that a class with a recent older major version and a non-zero
- // minor version fails to load.
+ // Check that a class with a recent older major version > JDK-11 and a minor version
+ // that is neither 0 nor 65535 fails to load.
klassbuf[6] = 0;
- klassbuf[7] = 53;
+ klassbuf[7] = 56;
klassbuf[4] = 0;
klassbuf[5] = 2;
try {
From be42d7e20df81242dc2273c095224191d3d6c4c6 Mon Sep 17 00:00:00 2001
From: Dmitrij Pochepko
Date: Mon, 10 Jun 2019 17:02:35 +0300
Subject: [PATCH 011/109] 8222412: AARCH64: multiple instructions encoding
issues
Reviewed-by: aph
---
src/hotspot/cpu/aarch64/aarch64-asmtest.py | 1177 +++++++++
src/hotspot/cpu/aarch64/assembler_aarch64.cpp | 2184 +++++++++--------
src/hotspot/cpu/aarch64/assembler_aarch64.hpp | 125 +-
src/hotspot/cpu/aarch64/register_aarch64.hpp | 2 +-
4 files changed, 2485 insertions(+), 1003 deletions(-)
create mode 100644 src/hotspot/cpu/aarch64/aarch64-asmtest.py
diff --git a/src/hotspot/cpu/aarch64/aarch64-asmtest.py b/src/hotspot/cpu/aarch64/aarch64-asmtest.py
new file mode 100644
index 00000000000..f54903041ed
--- /dev/null
+++ b/src/hotspot/cpu/aarch64/aarch64-asmtest.py
@@ -0,0 +1,1177 @@
+import random
+
+AARCH64_AS = ""
+AARCH64_OBJDUMP = ""
+AARCH64_OBJCOPY = ""
+
+class Operand(object):
+
+ def generate(self):
+ return self
+
+class Register(Operand):
+
+ def generate(self):
+ self.number = random.randint(0, 30)
+ return self
+
+ def astr(self, prefix):
+ return prefix + str(self.number)
+
+class FloatRegister(Register):
+
+ def __str__(self):
+ return self.astr("v")
+
+ def nextReg(self):
+ next = FloatRegister()
+ next.number = (self.number + 1) % 32
+ return next
+
+class GeneralRegister(Register):
+
+ def __str__(self):
+ return self.astr("r")
+
+class GeneralRegisterOrZr(Register):
+
+ def generate(self):
+ self.number = random.randint(0, 31)
+ return self
+
+ def astr(self, prefix = ""):
+ if (self.number == 31):
+ return prefix + "zr"
+ else:
+ return prefix + str(self.number)
+
+ def __str__(self):
+ if (self.number == 31):
+ return self.astr()
+ else:
+ return self.astr("r")
+
+class GeneralRegisterOrSp(Register):
+ def generate(self):
+ self.number = random.randint(0, 31)
+ return self
+
+ def astr(self, prefix = ""):
+ if (self.number == 31):
+ return "sp"
+ else:
+ return prefix + str(self.number)
+
+ def __str__(self):
+ if (self.number == 31):
+ return self.astr()
+ else:
+ return self.astr("r")
+
+class FloatZero(Operand):
+
+ def __str__(self):
+ return "0.0"
+
+ def astr(self, ignored):
+ return "#0.0"
+
+class OperandFactory:
+
+ _modes = {'x' : GeneralRegister,
+ 'w' : GeneralRegister,
+ 's' : FloatRegister,
+ 'd' : FloatRegister,
+ 'z' : FloatZero}
+
+ @classmethod
+ def create(cls, mode):
+ return OperandFactory._modes[mode]()
+
+class ShiftKind:
+
+ def generate(self):
+ self.kind = ["LSL", "LSR", "ASR"][random.randint(0,2)]
+ return self
+
+ def cstr(self):
+ return self.kind
+
+class Instruction(object):
+
+ def __init__(self, name):
+ self._name = name
+ self.isWord = name.endswith("w") | name.endswith("wi")
+ self.asmRegPrefix = ["x", "w"][self.isWord]
+
+ def aname(self):
+ if (self._name.endswith("wi")):
+ return self._name[:len(self._name)-2]
+ else:
+ if (self._name.endswith("i") | self._name.endswith("w")):
+ return self._name[:len(self._name)-1]
+ else:
+ return self._name
+
+ def emit(self) :
+ pass
+
+ def compare(self) :
+ pass
+
+ def generate(self) :
+ return self
+
+ def cstr(self):
+ return '__ %s(' % self.name()
+
+ def astr(self):
+ return '%s\t' % self.aname()
+
+ def name(self):
+ name = self._name
+ if name == "and":
+ name = "andr" # Special case: the name "and" can't be used
+ # in HotSpot, even for a member.
+ return name
+
+ def multipleForms(self):
+ return 0
+
+class InstructionWithModes(Instruction):
+
+ def __init__(self, name, mode):
+ Instruction.__init__(self, name)
+ self.mode = mode
+ self.isFloat = (mode == 'd') | (mode == 's')
+ if self.isFloat:
+ self.isWord = mode != 'd'
+ self.asmRegPrefix = ["d", "s"][self.isWord]
+ else:
+ self.isWord = mode != 'x'
+ self.asmRegPrefix = ["x", "w"][self.isWord]
+
+ def name(self):
+ return self._name + (self.mode if self.mode != 'x' else '')
+
+ def aname(self):
+ return (self._name+mode if (mode == 'b' or mode == 'h')
+ else self._name)
+
+class ThreeRegInstruction(Instruction):
+
+ def generate(self):
+ self.reg = [GeneralRegister().generate(), GeneralRegister().generate(),
+ GeneralRegister().generate()]
+ return self
+
+
+ def cstr(self):
+ return (super(ThreeRegInstruction, self).cstr()
+ + ('%s, %s, %s'
+ % (self.reg[0],
+ self.reg[1], self.reg[2])))
+
+ def astr(self):
+ prefix = self.asmRegPrefix
+ return (super(ThreeRegInstruction, self).astr()
+ + ('%s, %s, %s'
+ % (self.reg[0].astr(prefix),
+ self.reg[1].astr(prefix), self.reg[2].astr(prefix))))
+
+class FourRegInstruction(ThreeRegInstruction):
+
+ def generate(self):
+ self.reg = ThreeRegInstruction.generate(self).reg + [GeneralRegister().generate()]
+ return self
+
+
+ def cstr(self):
+ return (super(FourRegInstruction, self).cstr()
+ + (', %s' % self.reg[3]))
+
+ def astr(self):
+ prefix = self.asmRegPrefix
+ return (super(FourRegInstruction, self).astr()
+ + (', %s' % self.reg[3].astr(prefix)))
+
+class TwoRegInstruction(Instruction):
+
+ def generate(self):
+ self.reg = [GeneralRegister().generate(), GeneralRegister().generate()]
+ return self
+
+ def cstr(self):
+ return (super(TwoRegInstruction, self).cstr()
+ + '%s, %s' % (self.reg[0],
+ self.reg[1]))
+
+ def astr(self):
+ prefix = self.asmRegPrefix
+ return (super(TwoRegInstruction, self).astr()
+ + ('%s, %s'
+ % (self.reg[0].astr(prefix),
+ self.reg[1].astr(prefix))))
+
+class TwoRegImmedInstruction(TwoRegInstruction):
+
+ def generate(self):
+ super(TwoRegImmedInstruction, self).generate()
+ self.immed = random.randint(0, 1<<11 -1)
+ return self
+
+ def cstr(self):
+ return (super(TwoRegImmedInstruction, self).cstr()
+ + ', %su' % self.immed)
+
+ def astr(self):
+ return (super(TwoRegImmedInstruction, self).astr()
+ + ', #%s' % self.immed)
+
+class OneRegOp(Instruction):
+
+ def generate(self):
+ self.reg = GeneralRegister().generate()
+ return self
+
+ def cstr(self):
+ return (super(OneRegOp, self).cstr()
+ + '%s);' % self.reg)
+
+ def astr(self):
+ return (super(OneRegOp, self).astr()
+ + '%s' % self.reg.astr(self.asmRegPrefix))
+
+class ArithOp(ThreeRegInstruction):
+
+ def generate(self):
+ super(ArithOp, self).generate()
+ self.kind = ShiftKind().generate()
+ self.distance = random.randint(0, (1<<5)-1 if self.isWord else (1<<6)-1)
+ return self
+
+ def cstr(self):
+ return ('%s, Assembler::%s, %s);'
+ % (ThreeRegInstruction.cstr(self),
+ self.kind.cstr(), self.distance))
+
+ def astr(self):
+ return ('%s, %s #%s'
+ % (ThreeRegInstruction.astr(self),
+ self.kind.cstr(),
+ self.distance))
+
+class AddSubCarryOp(ThreeRegInstruction):
+
+ def cstr(self):
+ return ('%s);'
+ % (ThreeRegInstruction.cstr(self)))
+
+class AddSubExtendedOp(ThreeRegInstruction):
+
+ uxtb, uxth, uxtw, uxtx, sxtb, sxth, sxtw, sxtx = range(8)
+ optNames = ["uxtb", "uxth", "uxtw", "uxtx", "sxtb", "sxth", "sxtw", "sxtx"]
+
+ def generate(self):
+ super(AddSubExtendedOp, self).generate()
+ self.amount = random.randint(1, 4)
+ self.option = random.randint(0, 7)
+ return self
+
+ def cstr(self):
+ return (super(AddSubExtendedOp, self).cstr()
+ + (", ext::" + AddSubExtendedOp.optNames[self.option]
+ + ", " + str(self.amount) + ");"))
+
+ def astr(self):
+ return (super(AddSubExtendedOp, self).astr()
+ + (", " + AddSubExtendedOp.optNames[self.option]
+ + " #" + str(self.amount)))
+
+class AddSubImmOp(TwoRegImmedInstruction):
+
+ def cstr(self):
+ return super(AddSubImmOp, self).cstr() + ");"
+
+class LogicalImmOp(AddSubImmOp):
+
+ # These tables are legal immediate logical operands
+ immediates32 \
+ = [0x1, 0x3f, 0x1f0, 0x7e0,
+ 0x1c00, 0x3ff0, 0x8000, 0x1e000,
+ 0x3e000, 0x78000, 0xe0000, 0x100000,
+ 0x1fffe0, 0x3fe000, 0x780000, 0x7ffff8,
+ 0xff8000, 0x1800180, 0x1fffc00, 0x3c003c0,
+ 0x3ffff00, 0x7c00000, 0x7fffe00, 0xf000f00,
+ 0xfffe000, 0x18181818, 0x1ffc0000, 0x1ffffffe,
+ 0x3f003f00, 0x3fffe000, 0x60006000, 0x7f807f80,
+ 0x7ffffc00, 0x800001ff, 0x803fffff, 0x9f9f9f9f,
+ 0xc0000fff, 0xc0c0c0c0, 0xe0000000, 0xe003e003,
+ 0xe3ffffff, 0xf0000fff, 0xf0f0f0f0, 0xf80000ff,
+ 0xf83ff83f, 0xfc00007f, 0xfc1fffff, 0xfe0001ff,
+ 0xfe3fffff, 0xff003fff, 0xff800003, 0xff87ff87,
+ 0xffc00fff, 0xffe0000f, 0xffefffef, 0xfff1fff1,
+ 0xfff83fff, 0xfffc0fff, 0xfffe0fff, 0xffff3fff,
+ 0xffffc007, 0xffffe1ff, 0xfffff80f, 0xfffffe07,
+ 0xffffffbf, 0xfffffffd]
+
+ immediates \
+ = [0x1, 0x1f80, 0x3fff0, 0x3ffffc,
+ 0x3fe0000, 0x1ffc0000, 0xf8000000, 0x3ffffc000,
+ 0xffffffe00, 0x3ffffff800, 0xffffc00000, 0x3f000000000,
+ 0x7fffffff800, 0x1fe000001fe0, 0x3ffffff80000, 0xc00000000000,
+ 0x1ffc000000000, 0x3ffff0003ffff, 0x7ffffffe00000, 0xfffffffffc000,
+ 0x1ffffffffffc00, 0x3fffffffffff00, 0x7ffffffffffc00, 0xffffffffff8000,
+ 0x1ffffffff800000, 0x3fffffc03fffffc, 0x7fffc0000000000, 0xff80ff80ff80ff8,
+ 0x1c00000000000000, 0x1fffffffffff0000, 0x3fffff803fffff80, 0x7fc000007fc00000,
+ 0x8000000000000000, 0x803fffff803fffff, 0xc000007fc000007f, 0xe00000000000ffff,
+ 0xe3ffffffffffffff, 0xf007f007f007f007, 0xf80003ffffffffff, 0xfc000003fc000003,
+ 0xfe000000007fffff, 0xff00000000007fff, 0xff800000000003ff, 0xffc00000000000ff,
+ 0xffe00000000003ff, 0xfff0000000003fff, 0xfff80000001fffff, 0xfffc0000fffc0000,
+ 0xfffe003fffffffff, 0xffff3fffffffffff, 0xffffc0000007ffff, 0xffffe01fffffe01f,
+ 0xfffff800000007ff, 0xfffffc0fffffffff, 0xffffff00003fffff, 0xffffffc0000007ff,
+ 0xfffffff0000001ff, 0xfffffffc00003fff, 0xffffffff07ffffff, 0xffffffffe003ffff,
+ 0xfffffffffc01ffff, 0xffffffffffc00003, 0xfffffffffffc000f, 0xffffffffffffe07f]
+
+ def generate(self):
+ AddSubImmOp.generate(self)
+ self.immed = \
+ self.immediates32[random.randint(0, len(self.immediates32)-1)] \
+ if self.isWord \
+ else \
+ self.immediates[random.randint(0, len(self.immediates)-1)]
+
+ return self
+
+ def astr(self):
+ return (super(TwoRegImmedInstruction, self).astr()
+ + ', #0x%x' % self.immed)
+
+ def cstr(self):
+ return super(AddSubImmOp, self).cstr() + "l);"
+
+class MultiOp():
+
+ def multipleForms(self):
+ return 3
+
+ def forms(self):
+ return ["__ pc()", "back", "forth"]
+
+ def aforms(self):
+ return [".", "back", "forth"]
+
+class AbsOp(MultiOp, Instruction):
+
+ def cstr(self):
+ return super(AbsOp, self).cstr() + "%s);"
+
+ def astr(self):
+ return Instruction.astr(self) + "%s"
+
+class RegAndAbsOp(MultiOp, Instruction):
+
+ def multipleForms(self):
+ if self.name() == "adrp":
+ # We can only test one form of adrp because anything other
+ # than "adrp ." requires relocs in the assembler output
+ return 1
+ return 3
+
+ def generate(self):
+ Instruction.generate(self)
+ self.reg = GeneralRegister().generate()
+ return self
+
+ def cstr(self):
+ if self.name() == "adrp":
+ return "__ _adrp(" + "%s, %s);" % (self.reg, "%s")
+ return (super(RegAndAbsOp, self).cstr()
+ + "%s, %s);" % (self.reg, "%s"))
+
+ def astr(self):
+ return (super(RegAndAbsOp, self).astr()
+ + self.reg.astr(self.asmRegPrefix) + ", %s")
+
+class RegImmAbsOp(RegAndAbsOp):
+
+ def cstr(self):
+ return (Instruction.cstr(self)
+ + "%s, %s, %s);" % (self.reg, self.immed, "%s"))
+
+ def astr(self):
+ return (Instruction.astr(self)
+ + ("%s, #%s, %s"
+ % (self.reg.astr(self.asmRegPrefix), self.immed, "%s")))
+
+ def generate(self):
+ super(RegImmAbsOp, self).generate()
+ self.immed = random.randint(0, 1<<5 -1)
+ return self
+
+class MoveWideImmOp(RegImmAbsOp):
+
+ def multipleForms(self):
+ return 0
+
+ def cstr(self):
+ return (Instruction.cstr(self)
+ + "%s, %s, %s);" % (self.reg, self.immed, self.shift))
+
+ def astr(self):
+ return (Instruction.astr(self)
+ + ("%s, #%s, lsl %s"
+ % (self.reg.astr(self.asmRegPrefix),
+ self.immed, self.shift)))
+
+ def generate(self):
+ super(RegImmAbsOp, self).generate()
+ self.immed = random.randint(0, 1<<16 -1)
+ if self.isWord:
+ self.shift = random.randint(0, 1) * 16
+ else:
+ self.shift = random.randint(0, 3) * 16
+ return self
+
+class BitfieldOp(TwoRegInstruction):
+
+ def cstr(self):
+ return (Instruction.cstr(self)
+ + ("%s, %s, %s, %s);"
+ % (self.reg[0], self.reg[1], self.immr, self.imms)))
+
+ def astr(self):
+ return (TwoRegInstruction.astr(self)
+ + (", #%s, #%s"
+ % (self.immr, self.imms)))
+
+ def generate(self):
+ TwoRegInstruction.generate(self)
+ self.immr = random.randint(0, 31)
+ self.imms = random.randint(0, 31)
+ return self
+
+class ExtractOp(ThreeRegInstruction):
+
+ def generate(self):
+ super(ExtractOp, self).generate()
+ self.lsb = random.randint(0, (1<<5)-1 if self.isWord else (1<<6)-1)
+ return self
+
+ def cstr(self):
+ return (ThreeRegInstruction.cstr(self)
+ + (", %s);" % self.lsb))
+
+ def astr(self):
+ return (ThreeRegInstruction.astr(self)
+ + (", #%s" % self.lsb))
+
+class CondBranchOp(MultiOp, Instruction):
+
+ def cstr(self):
+ return "__ br(Assembler::" + self.name() + ", %s);"
+
+ def astr(self):
+ return "b." + self.name() + "\t%s"
+
+class ImmOp(Instruction):
+
+ def cstr(self):
+ return "%s%s);" % (Instruction.cstr(self), self.immed)
+
+ def astr(self):
+ return Instruction.astr(self) + "#" + str(self.immed)
+
+ def generate(self):
+ self.immed = random.randint(0, 1<<16 -1)
+ return self
+
+class Op(Instruction):
+
+ def cstr(self):
+ return Instruction.cstr(self) + ");"
+
+class SystemOp(Instruction):
+
+ def __init__(self, op):
+ Instruction.__init__(self, op[0])
+ self.barriers = op[1]
+
+ def generate(self):
+ Instruction.generate(self)
+ self.barrier \
+ = self.barriers[random.randint(0, len(self.barriers)-1)]
+ return self
+
+ def cstr(self):
+ return Instruction.cstr(self) + "Assembler::" + self.barrier + ");"
+
+ def astr(self):
+ return Instruction.astr(self) + self.barrier
+
+conditionCodes = ["EQ", "NE", "HS", "CS", "LO", "CC", "MI", "PL", "VS", \
+ "VC", "HI", "LS", "GE", "LT", "GT", "LE", "AL", "NV"]
+
+class ConditionalCompareOp(TwoRegImmedInstruction):
+
+ def generate(self):
+ TwoRegImmedInstruction.generate(self)
+ self.cond = random.randint(0, 15)
+ self.immed = random.randint(0, 15)
+ return self
+
+ def cstr(self):
+ return (super(ConditionalCompareOp, self).cstr() + ", "
+ + "Assembler::" + conditionCodes[self.cond] + ");")
+
+ def astr(self):
+ return (super(ConditionalCompareOp, self).astr() +
+ ", " + conditionCodes[self.cond])
+
+class ConditionalCompareImmedOp(Instruction):
+
+ def generate(self):
+ self.reg = GeneralRegister().generate()
+ self.cond = random.randint(0, 15)
+ self.immed2 = random.randint(0, 15)
+ self.immed = random.randint(0, 31)
+ return self
+
+ def cstr(self):
+ return (Instruction.cstr(self) + str(self.reg) + ", "
+ + str(self.immed) + ", "
+ + str(self.immed2) + ", "
+ + "Assembler::" + conditionCodes[self.cond] + ");")
+
+ def astr(self):
+ return (Instruction.astr(self)
+ + self.reg.astr(self.asmRegPrefix)
+ + ", #" + str(self.immed)
+ + ", #" + str(self.immed2)
+ + ", " + conditionCodes[self.cond])
+
+class TwoRegOp(TwoRegInstruction):
+
+ def cstr(self):
+ return TwoRegInstruction.cstr(self) + ");"
+
+class ThreeRegOp(ThreeRegInstruction):
+
+ def cstr(self):
+ return ThreeRegInstruction.cstr(self) + ");"
+
+class FourRegMulOp(FourRegInstruction):
+
+ def cstr(self):
+ return FourRegInstruction.cstr(self) + ");"
+
+ def astr(self):
+ isMaddsub = self.name().startswith("madd") | self.name().startswith("msub")
+ midPrefix = self.asmRegPrefix if isMaddsub else "w"
+ return (Instruction.astr(self)
+ + self.reg[0].astr(self.asmRegPrefix)
+ + ", " + self.reg[1].astr(midPrefix)
+ + ", " + self.reg[2].astr(midPrefix)
+ + ", " + self.reg[3].astr(self.asmRegPrefix))
+
+class ConditionalSelectOp(ThreeRegInstruction):
+
+ def generate(self):
+ ThreeRegInstruction.generate(self)
+ self.cond = random.randint(0, 15)
+ return self
+
+ def cstr(self):
+ return (ThreeRegInstruction.cstr(self) + ", "
+ + "Assembler::" + conditionCodes[self.cond] + ");")
+
+ def astr(self):
+ return (ThreeRegInstruction.astr(self)
+ + ", " + conditionCodes[self.cond])
+
+class LoadStoreExclusiveOp(InstructionWithModes):
+
+ def __init__(self, op): # op is a tuple of ["name", "mode", registers]
+ InstructionWithModes.__init__(self, op[0], op[1])
+ self.num_registers = op[2]
+
+ def astr(self):
+ result = self.aname() + '\t'
+ regs = list(self.regs)
+ index = regs.pop() # The last reg is the index register
+ prefix = ('x' if (self.mode == 'x')
+ & ((self.name().startswith("ld"))
+ | (self.name().startswith("stlr"))) # Ewww :-(
+ else 'w')
+ result = result + regs.pop(0).astr(prefix) + ", "
+ for s in regs:
+ result = result + s.astr(self.asmRegPrefix) + ", "
+ result = result + "[" + index.astr("x") + "]"
+ return result
+
+ def cstr(self):
+ result = InstructionWithModes.cstr(self)
+ regs = list(self.regs)
+ index = regs.pop() # The last reg is the index register
+ for s in regs:
+ result = result + str(s) + ", "
+ result = result + str(index) + ");"
+ return result
+
+ def appendUniqueReg(self):
+ result = 0
+ while result == 0:
+ newReg = GeneralRegister().generate()
+ result = 1
+ for i in self.regs:
+ result = result and (i.number != newReg.number)
+ self.regs.append(newReg)
+
+ def generate(self):
+ self.regs = []
+ for i in range(self.num_registers):
+ self.appendUniqueReg()
+ return self
+
+ def name(self):
+ if self.mode == 'x':
+ return self._name
+ else:
+ return self._name + self.mode
+
+ def aname(self):
+ if (self.mode == 'b') | (self.mode == 'h'):
+ return self._name + self.mode
+ else:
+ return self._name
+
+class Address(object):
+
+ base_plus_unscaled_offset, pre, post, base_plus_reg, \
+ base_plus_scaled_offset, pcrel, post_reg, base_only = range(8)
+ kinds = ["base_plus_unscaled_offset", "pre", "post", "base_plus_reg",
+ "base_plus_scaled_offset", "pcrel", "post_reg", "base_only"]
+ extend_kinds = ["uxtw", "lsl", "sxtw", "sxtx"]
+
+ @classmethod
+ def kindToStr(cls, i):
+ return cls.kinds[i]
+
+ def generate(self, kind, shift_distance):
+ self.kind = kind
+ self.base = GeneralRegister().generate()
+ self.index = GeneralRegister().generate()
+ self.offset = {
+ Address.base_plus_unscaled_offset: random.randint(-1<<8, 1<<8-1) | 1,
+ Address.pre: random.randint(-1<<8, 1<<8-1),
+ Address.post: random.randint(-1<<8, 1<<8-1),
+ Address.pcrel: random.randint(0, 2),
+ Address.base_plus_reg: 0,
+ Address.base_plus_scaled_offset: (random.randint(0, 1<<11-1) | (3 << 9))*8,
+ Address.post_reg: 0,
+ Address.base_only: 0} [kind]
+ self.offset >>= (3 - shift_distance)
+ self.extend_kind = Address.extend_kinds[random.randint(0, 3)]
+ self.shift_distance = random.randint(0, 1) * shift_distance
+ return self
+
+ def __str__(self):
+ result = {
+ Address.base_plus_unscaled_offset: "Address(%s, %s)" \
+ % (str(self.base), self.offset),
+ Address.pre: "Address(__ pre(%s, %s))" % (str(self.base), self.offset),
+ Address.post: "Address(__ post(%s, %s))" % (str(self.base), self.offset),
+ Address.post_reg: "Address(__ post(%s, %s))" % (str(self.base), self.index),
+ Address.base_only: "Address(%s)" % (str(self.base)),
+ Address.pcrel: "",
+ Address.base_plus_reg: "Address(%s, %s, Address::%s(%s))" \
+ % (self.base, self.index, self.extend_kind, self.shift_distance),
+ Address.base_plus_scaled_offset:
+ "Address(%s, %s)" % (self.base, self.offset) } [self.kind]
+ if (self.kind == Address.pcrel):
+ result = ["__ pc()", "back", "forth"][self.offset]
+ return result
+
+ def astr(self, prefix):
+ extend_prefix = prefix
+ if self.kind == Address.base_plus_reg:
+ if self.extend_kind.endswith("w"):
+ extend_prefix = "w"
+ result = {
+ Address.base_plus_unscaled_offset: "[%s, %s]" \
+ % (self.base.astr(prefix), self.offset),
+ Address.pre: "[%s, %s]!" % (self.base.astr(prefix), self.offset),
+ Address.post: "[%s], %s" % (self.base.astr(prefix), self.offset),
+ Address.post_reg: "[%s], %s" % (self.base.astr(prefix), self.index.astr(prefix)),
+ Address.base_only: "[%s]" % (self.base.astr(prefix)),
+ Address.pcrel: "",
+ Address.base_plus_reg: "[%s, %s, %s #%s]" \
+ % (self.base.astr(prefix), self.index.astr(extend_prefix),
+ self.extend_kind, self.shift_distance),
+ Address.base_plus_scaled_offset: \
+ "[%s, %s]" \
+ % (self.base.astr(prefix), self.offset)
+ } [self.kind]
+ if (self.kind == Address.pcrel):
+ result = [".", "back", "forth"][self.offset]
+ return result
+
+class LoadStoreOp(InstructionWithModes):
+
+ def __init__(self, args):
+ name, self.asmname, self.kind, mode = args
+ InstructionWithModes.__init__(self, name, mode)
+
+ def generate(self):
+
+ # This is something of a kludge, but the offset needs to be
+ # scaled by the memory datamode somehow.
+ shift = 3
+ if (self.mode == 'b') | (self.asmname.endswith("b")):
+ shift = 0
+ elif (self.mode == 'h') | (self.asmname.endswith("h")):
+ shift = 1
+ elif (self.mode == 'w') | (self.asmname.endswith("w")) \
+ | (self.mode == 's') :
+ shift = 2
+
+ self.adr = Address().generate(self.kind, shift)
+
+ isFloat = (self.mode == 'd') | (self.mode == 's')
+
+ regMode = FloatRegister if isFloat else GeneralRegister
+ self.reg = regMode().generate()
+ return self
+
+ def cstr(self):
+ if not(self._name.startswith("prfm")):
+ return "%s%s, %s);" % (Instruction.cstr(self), str(self.reg), str(self.adr))
+ else: # No target register for a prefetch
+ return "%s%s);" % (Instruction.cstr(self), str(self.adr))
+
+ def astr(self):
+ if not(self._name.startswith("prfm")):
+ return "%s\t%s, %s" % (self.aname(), self.reg.astr(self.asmRegPrefix),
+ self.adr.astr("x"))
+ else: # No target register for a prefetch
+ return "%s %s" % (self.aname(),
+ self.adr.astr("x"))
+
+ def aname(self):
+ result = self.asmname
+ # if self.kind == Address.base_plus_unscaled_offset:
+ # result = result.replace("ld", "ldu", 1)
+ # result = result.replace("st", "stu", 1)
+ return result
+
+class LoadStorePairOp(InstructionWithModes):
+
+ numRegs = 2
+
+ def __init__(self, args):
+ name, self.asmname, self.kind, mode = args
+ InstructionWithModes.__init__(self, name, mode)
+ self.offset = random.randint(-1<<4, 1<<4-1) << 4
+
+ def generate(self):
+ self.reg = [OperandFactory.create(self.mode).generate()
+ for i in range(self.numRegs)]
+ self.base = OperandFactory.create('x').generate()
+ return self
+
+ def astr(self):
+ address = ["[%s, #%s]", "[%s, #%s]!", "[%s], #%s"][self.kind]
+ address = address % (self.base.astr('x'), self.offset)
+ result = "%s\t%s, %s, %s" \
+ % (self.asmname,
+ self.reg[0].astr(self.asmRegPrefix),
+ self.reg[1].astr(self.asmRegPrefix), address)
+ return result
+
+ def cstr(self):
+ address = {
+ Address.base_plus_unscaled_offset: "Address(%s, %s)" \
+ % (str(self.base), self.offset),
+ Address.pre: "Address(__ pre(%s, %s))" % (str(self.base), self.offset),
+ Address.post: "Address(__ post(%s, %s))" % (str(self.base), self.offset),
+ } [self.kind]
+ result = "__ %s(%s, %s, %s);" \
+ % (self.name(), self.reg[0], self.reg[1], address)
+ return result
+
+class FloatInstruction(Instruction):
+
+ def aname(self):
+ if (self._name.endswith("s") | self._name.endswith("d")):
+ return self._name[:len(self._name)-1]
+ else:
+ return self._name
+
+ def __init__(self, args):
+ name, self.modes = args
+ Instruction.__init__(self, name)
+
+ def generate(self):
+ self.reg = [OperandFactory.create(self.modes[i]).generate()
+ for i in range(self.numRegs)]
+ return self
+
+ def cstr(self):
+ formatStr = "%s%s" + ''.join([", %s" for i in range(1, self.numRegs)] + [");"])
+ return (formatStr
+ % tuple([Instruction.cstr(self)] +
+ [str(self.reg[i]) for i in range(self.numRegs)])) # Yowza
+
+ def astr(self):
+ formatStr = "%s%s" + ''.join([", %s" for i in range(1, self.numRegs)])
+ return (formatStr
+ % tuple([Instruction.astr(self)] +
+ [(self.reg[i].astr(self.modes[i])) for i in range(self.numRegs)]))
+
+class LdStSIMDOp(Instruction):
+ def __init__(self, args):
+ self._name, self.regnum, self.arrangement, self.addresskind = args
+
+ def generate(self):
+ self.address = Address().generate(self.addresskind, 0)
+ self._firstSIMDreg = FloatRegister().generate()
+ if (self.addresskind == Address.post):
+ if (self._name in ["ld1r", "ld2r", "ld3r", "ld4r"]):
+ elem_size = {"8B" : 1, "16B" : 1, "4H" : 2, "8H" : 2, "2S" : 4, "4S" : 4, "1D" : 8, "2D" : 8} [self.arrangement]
+ self.address.offset = self.regnum * elem_size
+ else:
+ if (self.arrangement in ["8B", "4H", "2S", "1D"]):
+ self.address.offset = self.regnum * 8
+ else:
+ self.address.offset = self.regnum * 16
+ return self
+
+ def cstr(self):
+ buf = super(LdStSIMDOp, self).cstr() + str(self._firstSIMDreg)
+ current = self._firstSIMDreg
+ for cnt in range(1, self.regnum):
+ buf = '%s, %s' % (buf, current.nextReg())
+ current = current.nextReg()
+ return '%s, __ T%s, %s);' % (buf, self.arrangement, str(self.address))
+
+ def astr(self):
+ buf = '%s\t{%s.%s' % (self._name, self._firstSIMDreg, self.arrangement)
+ current = self._firstSIMDreg
+ for cnt in range(1, self.regnum):
+ buf = '%s, %s.%s' % (buf, current.nextReg(), self.arrangement)
+ current = current.nextReg()
+ return '%s}, %s' % (buf, self.address.astr("x"))
+
+ def aname(self):
+ return self._name
+
+class LSEOp(Instruction):
+ def __init__(self, args):
+ self._name, self.asmname, self.size, self.suffix = args
+
+ def generate(self):
+ self._name = "%s%s" % (self._name, self.suffix)
+ self.asmname = "%s%s" % (self.asmname, self.suffix)
+ self.srcReg = GeneralRegisterOrZr().generate()
+ self.tgtReg = GeneralRegisterOrZr().generate()
+ self.adrReg = GeneralRegisterOrSp().generate()
+
+ return self
+
+ def cstr(self):
+ sizeSpec = {"x" : "Assembler::xword", "w" : "Assembler::word"} [self.size]
+ return super(LSEOp, self).cstr() + "%s, %s, %s, %s);" % (sizeSpec, self.srcReg, self.tgtReg, self.adrReg)
+
+ def astr(self):
+ return "%s\t%s, %s, [%s]" % (self.asmname, self.srcReg.astr(self.size), self.tgtReg.astr(self.size), self.adrReg.astr("x"))
+
+ def aname(self):
+ return self.asmname
+
+class TwoRegFloatOp(FloatInstruction):
+ numRegs = 2
+
+class ThreeRegFloatOp(TwoRegFloatOp):
+ numRegs = 3
+
+class FourRegFloatOp(TwoRegFloatOp):
+ numRegs = 4
+
+class FloatConvertOp(TwoRegFloatOp):
+
+ def __init__(self, args):
+ self._cname, self._aname, modes = args
+ TwoRegFloatOp.__init__(self, [self._cname, modes])
+
+ def aname(self):
+ return self._aname
+
+ def cname(self):
+ return self._cname
+
+class SpecialCases(Instruction):
+ def __init__(self, data):
+ self._name = data[0]
+ self._cstr = data[1]
+ self._astr = data[2]
+
+ def cstr(self):
+ return self._cstr
+
+ def astr(self):
+ return self._astr
+
+def generate(kind, names):
+ outfile.write("# " + kind.__name__ + "\n");
+ print "\n// " + kind.__name__
+ for name in names:
+ for i in range(1):
+ op = kind(name).generate()
+ if op.multipleForms():
+ forms = op.forms()
+ aforms = op.aforms()
+ for i in range(op.multipleForms()):
+ cstr = op.cstr() % forms[i]
+ astr = op.astr() % aforms[i]
+ print " %-50s //\t%s" % (cstr, astr)
+ outfile.write("\t" + astr + "\n")
+ else:
+ print " %-50s //\t%s" % (op.cstr(), op.astr())
+ outfile.write("\t" + op.astr() + "\n")
+
+outfile = open("aarch64ops.s", "w")
+
+print "// BEGIN Generated code -- do not edit"
+print "// Generated by aarch64-asmtest.py"
+
+print " Label back, forth;"
+print " __ bind(back);"
+
+outfile.write("back:\n")
+
+generate (ArithOp,
+ [ "add", "sub", "adds", "subs",
+ "addw", "subw", "addsw", "subsw",
+ "and", "orr", "eor", "ands",
+ "andw", "orrw", "eorw", "andsw",
+ "bic", "orn", "eon", "bics",
+ "bicw", "ornw", "eonw", "bicsw" ])
+
+generate (AddSubImmOp,
+ [ "addw", "addsw", "subw", "subsw",
+ "add", "adds", "sub", "subs"])
+generate (LogicalImmOp,
+ [ "andw", "orrw", "eorw", "andsw",
+ "and", "orr", "eor", "ands"])
+
+generate (AbsOp, [ "b", "bl" ])
+
+generate (RegAndAbsOp, ["cbzw", "cbnzw", "cbz", "cbnz", "adr", "adrp"])
+
+generate (RegImmAbsOp, ["tbz", "tbnz"])
+
+generate (MoveWideImmOp, ["movnw", "movzw", "movkw", "movn", "movz", "movk"])
+
+generate (BitfieldOp, ["sbfm", "bfmw", "ubfmw", "sbfm", "bfm", "ubfm"])
+
+generate (ExtractOp, ["extrw", "extr"])
+
+generate (CondBranchOp, ["EQ", "NE", "HS", "CS", "LO", "CC", "MI", "PL", "VS", "VC",
+ "HI", "LS", "GE", "LT", "GT", "LE", "AL", "NV" ])
+
+generate (ImmOp, ["svc", "hvc", "smc", "brk", "hlt", # "dpcs1", "dpcs2", "dpcs3"
+ ])
+
+generate (Op, ["nop", "eret", "drps", "isb"])
+
+barriers = ["OSHLD", "OSHST", "OSH", "NSHLD", "NSHST", "NSH",
+ "ISHLD", "ISHST", "ISH", "LD", "ST", "SY"]
+
+generate (SystemOp, [["dsb", barriers], ["dmb", barriers]])
+
+generate (OneRegOp, ["br", "blr"])
+
+for mode in 'xwhb':
+ generate (LoadStoreExclusiveOp, [["stxr", mode, 3], ["stlxr", mode, 3],
+ ["ldxr", mode, 2], ["ldaxr", mode, 2],
+ ["stlr", mode, 2], ["ldar", mode, 2]])
+
+for mode in 'xw':
+ generate (LoadStoreExclusiveOp, [["ldxp", mode, 3], ["ldaxp", mode, 3],
+ ["stxp", mode, 4], ["stlxp", mode, 4]])
+
+for kind in range(6):
+ print "\n// " + Address.kindToStr(kind),
+ if kind != Address.pcrel:
+ generate (LoadStoreOp,
+ [["str", "str", kind, "x"], ["str", "str", kind, "w"],
+ ["str", "strb", kind, "b"], ["str", "strh", kind, "h"],
+ ["ldr", "ldr", kind, "x"], ["ldr", "ldr", kind, "w"],
+ ["ldr", "ldrb", kind, "b"], ["ldr", "ldrh", kind, "h"],
+ ["ldrsb", "ldrsb", kind, "x"], ["ldrsh", "ldrsh", kind, "x"],
+ ["ldrsh", "ldrsh", kind, "w"], ["ldrsw", "ldrsw", kind, "x"],
+ ["ldr", "ldr", kind, "d"], ["ldr", "ldr", kind, "s"],
+ ["str", "str", kind, "d"], ["str", "str", kind, "s"],
+ ])
+ else:
+ generate (LoadStoreOp,
+ [["ldr", "ldr", kind, "x"], ["ldr", "ldr", kind, "w"]])
+
+
+for kind in (Address.base_plus_unscaled_offset, Address.pcrel, Address.base_plus_reg, \
+ Address.base_plus_scaled_offset):
+ generate (LoadStoreOp,
+ [["prfm", "prfm\tPLDL1KEEP,", kind, "x"]])
+
+generate(AddSubCarryOp, ["adcw", "adcsw", "sbcw", "sbcsw", "adc", "adcs", "sbc", "sbcs"])
+
+generate(AddSubExtendedOp, ["addw", "addsw", "sub", "subsw", "add", "adds", "sub", "subs"])
+
+generate(ConditionalCompareOp, ["ccmnw", "ccmpw", "ccmn", "ccmp"])
+generate(ConditionalCompareImmedOp, ["ccmnw", "ccmpw", "ccmn", "ccmp"])
+generate(ConditionalSelectOp,
+ ["cselw", "csincw", "csinvw", "csnegw", "csel", "csinc", "csinv", "csneg"])
+
+generate(TwoRegOp,
+ ["rbitw", "rev16w", "revw", "clzw", "clsw", "rbit",
+ "rev16", "rev32", "rev", "clz", "cls"])
+generate(ThreeRegOp,
+ ["udivw", "sdivw", "lslvw", "lsrvw", "asrvw", "rorvw", "udiv", "sdiv",
+ "lslv", "lsrv", "asrv", "rorv", "umulh", "smulh"])
+generate(FourRegMulOp,
+ ["maddw", "msubw", "madd", "msub", "smaddl", "smsubl", "umaddl", "umsubl"])
+
+generate(ThreeRegFloatOp,
+ [["fmuls", "sss"], ["fdivs", "sss"], ["fadds", "sss"], ["fsubs", "sss"],
+ ["fmuls", "sss"],
+ ["fmuld", "ddd"], ["fdivd", "ddd"], ["faddd", "ddd"], ["fsubd", "ddd"],
+ ["fmuld", "ddd"]])
+
+generate(FourRegFloatOp,
+ [["fmadds", "ssss"], ["fmsubs", "ssss"], ["fnmadds", "ssss"], ["fnmadds", "ssss"],
+ ["fmaddd", "dddd"], ["fmsubd", "dddd"], ["fnmaddd", "dddd"], ["fnmaddd", "dddd"],])
+
+generate(TwoRegFloatOp,
+ [["fmovs", "ss"], ["fabss", "ss"], ["fnegs", "ss"], ["fsqrts", "ss"],
+ ["fcvts", "ds"],
+ ["fmovd", "dd"], ["fabsd", "dd"], ["fnegd", "dd"], ["fsqrtd", "dd"],
+ ["fcvtd", "sd"],
+ ])
+
+generate(FloatConvertOp, [["fcvtzsw", "fcvtzs", "ws"], ["fcvtzs", "fcvtzs", "xs"],
+ ["fcvtzdw", "fcvtzs", "wd"], ["fcvtzd", "fcvtzs", "xd"],
+ ["scvtfws", "scvtf", "sw"], ["scvtfs", "scvtf", "sx"],
+ ["scvtfwd", "scvtf", "dw"], ["scvtfd", "scvtf", "dx"],
+ ["fmovs", "fmov", "ws"], ["fmovd", "fmov", "xd"],
+ ["fmovs", "fmov", "sw"], ["fmovd", "fmov", "dx"]])
+
+generate(TwoRegFloatOp, [["fcmps", "ss"], ["fcmpd", "dd"],
+ ["fcmps", "sz"], ["fcmpd", "dz"]])
+
+for kind in range(3):
+ generate(LoadStorePairOp, [["stp", "stp", kind, "w"], ["ldp", "ldp", kind, "w"],
+ ["ldpsw", "ldpsw", kind, "x"],
+ ["stp", "stp", kind, "x"], ["ldp", "ldp", kind, "x"]
+ ])
+generate(LoadStorePairOp, [["stnp", "stnp", 0, "w"], ["ldnp", "ldnp", 0, "w"],
+ ["stnp", "stnp", 0, "x"], ["ldnp", "ldnp", 0, "x"]])
+
+generate(LdStSIMDOp, [["ld1", 1, "8B", Address.base_only],
+ ["ld1", 2, "16B", Address.post],
+ ["ld1", 3, "1D", Address.post_reg],
+ ["ld1", 4, "8H", Address.post],
+ ["ld1r", 1, "8B", Address.base_only],
+ ["ld1r", 1, "4S", Address.post],
+ ["ld1r", 1, "1D", Address.post_reg],
+ ["ld2", 2, "2D", Address.base_only],
+ ["ld2", 2, "4H", Address.post],
+ ["ld2r", 2, "16B", Address.base_only],
+ ["ld2r", 2, "2S", Address.post],
+ ["ld2r", 2, "2D", Address.post_reg],
+ ["ld3", 3, "4S", Address.post_reg],
+ ["ld3", 3, "2S", Address.base_only],
+ ["ld3r", 3, "8H", Address.base_only],
+ ["ld3r", 3, "4S", Address.post],
+ ["ld3r", 3, "1D", Address.post_reg],
+ ["ld4", 4, "8H", Address.post],
+ ["ld4", 4, "8B", Address.post_reg],
+ ["ld4r", 4, "8B", Address.base_only],
+ ["ld4r", 4, "4H", Address.post],
+ ["ld4r", 4, "2S", Address.post_reg],
+])
+
+generate(SpecialCases, [["ccmn", "__ ccmn(zr, zr, 3u, Assembler::LE);", "ccmn\txzr, xzr, #3, LE"],
+ ["ccmnw", "__ ccmnw(zr, zr, 5u, Assembler::EQ);", "ccmn\twzr, wzr, #5, EQ"],
+ ["ccmp", "__ ccmp(zr, 1, 4u, Assembler::NE);", "ccmp\txzr, 1, #4, NE"],
+ ["ccmpw", "__ ccmpw(zr, 2, 2, Assembler::GT);", "ccmp\twzr, 2, #2, GT"],
+ ["extr", "__ extr(zr, zr, zr, 0);", "extr\txzr, xzr, xzr, 0"],
+ ["stlxp", "__ stlxp(r0, zr, zr, sp);", "stlxp\tw0, xzr, xzr, [sp]"],
+ ["stlxpw", "__ stlxpw(r2, zr, zr, r3);", "stlxp\tw2, wzr, wzr, [x3]"],
+ ["stxp", "__ stxp(r4, zr, zr, r5);", "stxp\tw4, xzr, xzr, [x5]"],
+ ["stxpw", "__ stxpw(r6, zr, zr, sp);", "stxp\tw6, wzr, wzr, [sp]"],
+ ["dup", "__ dup(v0, __ T16B, zr);", "dup\tv0.16b, wzr"],
+ ["mov", "__ mov(v1, __ T1D, 0, zr);", "mov\tv1.d[0], xzr"],
+ ["mov", "__ mov(v1, __ T2S, 1, zr);", "mov\tv1.s[1], wzr"],
+ ["mov", "__ mov(v1, __ T4H, 2, zr);", "mov\tv1.h[2], wzr"],
+ ["mov", "__ mov(v1, __ T8B, 3, zr);", "mov\tv1.b[3], wzr"],
+ ["ld1", "__ ld1(v31, v0, __ T2D, Address(__ post(r1, r0)));", "ld1\t{v31.2d, v0.2d}, [x1], x0"]])
+
+print "\n// FloatImmediateOp"
+for float in ("2.0", "2.125", "4.0", "4.25", "8.0", "8.5", "16.0", "17.0", "0.125",
+ "0.1328125", "0.25", "0.265625", "0.5", "0.53125", "1.0", "1.0625",
+ "-2.0", "-2.125", "-4.0", "-4.25", "-8.0", "-8.5", "-16.0", "-17.0",
+ "-0.125", "-0.1328125", "-0.25", "-0.265625", "-0.5", "-0.53125", "-1.0", "-1.0625"):
+ astr = "fmov d0, #" + float
+ cstr = "__ fmovd(v0, " + float + ");"
+ print " %-50s //\t%s" % (cstr, astr)
+ outfile.write("\t" + astr + "\n")
+
+# ARMv8.1A
+for size in ("x", "w"):
+ for suffix in ("", "a", "al", "l"):
+ generate(LSEOp, [["swp", "swp", size, suffix],
+ ["ldadd", "ldadd", size, suffix],
+ ["ldbic", "ldclr", size, suffix],
+ ["ldeor", "ldeor", size, suffix],
+ ["ldorr", "ldset", size, suffix],
+ ["ldsmin", "ldsmin", size, suffix],
+ ["ldsmax", "ldsmax", size, suffix],
+ ["ldumin", "ldumin", size, suffix],
+ ["ldumax", "ldumax", size, suffix]]);
+
+print "\n __ bind(forth);"
+outfile.write("forth:\n")
+
+outfile.close()
+
+import subprocess
+import sys
+
+# compile for 8.1 because of lse atomics
+subprocess.check_call([AARCH64_AS, "-march=armv8.1-a", "aarch64ops.s", "-o", "aarch64ops.o"])
+
+print
+print "/*",
+sys.stdout.flush()
+subprocess.check_call([AARCH64_OBJDUMP, "-d", "aarch64ops.o"])
+print "*/"
+
+subprocess.check_call([AARCH64_OBJCOPY, "-O", "binary", "-j", ".text", "aarch64ops.o", "aarch64ops.bin"])
+
+infile = open("aarch64ops.bin", "r")
+bytes = bytearray(infile.read())
+
+print
+print " static const unsigned int insns[] ="
+print " {"
+
+i = 0
+while i < len(bytes):
+ print " 0x%02x%02x%02x%02x," % (bytes[i+3], bytes[i+2], bytes[i+1], bytes[i]),
+ i += 4
+ if i%16 == 0:
+ print
+print "\n };"
+print "// END Generated code -- do not edit"
+
+
diff --git a/src/hotspot/cpu/aarch64/assembler_aarch64.cpp b/src/hotspot/cpu/aarch64/assembler_aarch64.cpp
index b6c08775751..2ce19d962d2 100644
--- a/src/hotspot/cpu/aarch64/assembler_aarch64.cpp
+++ b/src/hotspot/cpu/aarch64/assembler_aarch64.cpp
@@ -103,531 +103,662 @@ void entry(CodeBuffer *cb) {
__ bind(back);
// ArithOp
- __ add(r19, r22, r7, Assembler::LSL, 28); // add x19, x22, x7, LSL #28
- __ sub(r16, r11, r10, Assembler::LSR, 13); // sub x16, x11, x10, LSR #13
- __ adds(r27, r13, r28, Assembler::ASR, 2); // adds x27, x13, x28, ASR #2
- __ subs(r20, r28, r26, Assembler::ASR, 41); // subs x20, x28, x26, ASR #41
- __ addw(r8, r19, r19, Assembler::ASR, 19); // add w8, w19, w19, ASR #19
- __ subw(r4, r9, r10, Assembler::LSL, 14); // sub w4, w9, w10, LSL #14
- __ addsw(r8, r11, r30, Assembler::LSL, 13); // adds w8, w11, w30, LSL #13
- __ subsw(r0, r25, r19, Assembler::LSL, 9); // subs w0, w25, w19, LSL #9
- __ andr(r20, r0, r21, Assembler::LSL, 19); // and x20, x0, x21, LSL #19
- __ orr(r21, r14, r20, Assembler::LSL, 17); // orr x21, x14, x20, LSL #17
- __ eor(r25, r28, r1, Assembler::LSL, 51); // eor x25, x28, x1, LSL #51
- __ ands(r10, r27, r11, Assembler::ASR, 15); // ands x10, x27, x11, ASR #15
- __ andw(r25, r5, r12, Assembler::ASR, 23); // and w25, w5, w12, ASR #23
- __ orrw(r18, r14, r10, Assembler::LSR, 4); // orr w18, w14, w10, LSR #4
- __ eorw(r4, r21, r5, Assembler::ASR, 22); // eor w4, w21, w5, ASR #22
- __ andsw(r21, r0, r5, Assembler::ASR, 29); // ands w21, w0, w5, ASR #29
- __ bic(r26, r30, r6, Assembler::ASR, 37); // bic x26, x30, x6, ASR #37
- __ orn(r3, r1, r13, Assembler::LSR, 29); // orn x3, x1, x13, LSR #29
- __ eon(r0, r28, r9, Assembler::LSL, 47); // eon x0, x28, x9, LSL #47
- __ bics(r29, r5, r28, Assembler::LSL, 46); // bics x29, x5, x28, LSL #46
- __ bicw(r9, r18, r7, Assembler::LSR, 20); // bic w9, w18, w7, LSR #20
- __ ornw(r26, r13, r25, Assembler::ASR, 24); // orn w26, w13, w25, ASR #24
- __ eonw(r25, r4, r19, Assembler::LSL, 6); // eon w25, w4, w19, LSL #6
- __ bicsw(r5, r26, r4, Assembler::LSR, 24); // bics w5, w26, w4, LSR #24
+ __ add(r15, r12, r16, Assembler::LSR, 30); // add x15, x12, x16, LSR #30
+ __ sub(r1, r15, r3, Assembler::LSR, 32); // sub x1, x15, x3, LSR #32
+ __ adds(r13, r25, r5, Assembler::LSL, 13); // adds x13, x25, x5, LSL #13
+ __ subs(r22, r28, r6, Assembler::ASR, 17); // subs x22, x28, x6, ASR #17
+ __ addw(r0, r9, r22, Assembler::ASR, 6); // add w0, w9, w22, ASR #6
+ __ subw(r19, r3, r25, Assembler::LSL, 21); // sub w19, w3, w25, LSL #21
+ __ addsw(r4, r19, r11, Assembler::LSL, 20); // adds w4, w19, w11, LSL #20
+ __ subsw(r24, r7, r19, Assembler::ASR, 0); // subs w24, w7, w19, ASR #0
+ __ andr(r30, r7, r11, Assembler::LSL, 48); // and x30, x7, x11, LSL #48
+ __ orr(r24, r8, r15, Assembler::LSL, 12); // orr x24, x8, x15, LSL #12
+ __ eor(r17, r9, r23, Assembler::LSL, 1); // eor x17, x9, x23, LSL #1
+ __ ands(r14, r11, r4, Assembler::LSR, 55); // ands x14, x11, x4, LSR #55
+ __ andw(r19, r7, r12, Assembler::LSR, 17); // and w19, w7, w12, LSR #17
+ __ orrw(r19, r27, r11, Assembler::ASR, 28); // orr w19, w27, w11, ASR #28
+ __ eorw(r30, r3, r22, Assembler::LSR, 31); // eor w30, w3, w22, LSR #31
+ __ andsw(r19, r26, r28, Assembler::ASR, 0); // ands w19, w26, w28, ASR #0
+ __ bic(r29, r6, r26, Assembler::LSL, 51); // bic x29, x6, x26, LSL #51
+ __ orn(r26, r27, r17, Assembler::LSL, 35); // orn x26, x27, x17, LSL #35
+ __ eon(r21, r4, r14, Assembler::LSL, 5); // eon x21, x4, x14, LSL #5
+ __ bics(r2, r15, r0, Assembler::ASR, 5); // bics x2, x15, x0, ASR #5
+ __ bicw(r2, r7, r2, Assembler::LSL, 29); // bic w2, w7, w2, LSL #29
+ __ ornw(r24, r12, r21, Assembler::LSR, 5); // orn w24, w12, w21, LSR #5
+ __ eonw(r30, r15, r19, Assembler::LSL, 2); // eon w30, w15, w19, LSL #2
+ __ bicsw(r30, r23, r17, Assembler::ASR, 28); // bics w30, w23, w17, ASR #28
// AddSubImmOp
- __ addw(r7, r19, 340u); // add w7, w19, #340
- __ addsw(r8, r0, 401u); // adds w8, w0, #401
- __ subw(r29, r20, 163u); // sub w29, w20, #163
- __ subsw(r8, r23, 759u); // subs w8, w23, #759
- __ add(r1, r12, 523u); // add x1, x12, #523
- __ adds(r2, r11, 426u); // adds x2, x11, #426
- __ sub(r14, r29, 716u); // sub x14, x29, #716
- __ subs(r11, r5, 582u); // subs x11, x5, #582
+ __ addw(r4, r20, 660u); // add w4, w20, #660
+ __ addsw(r2, r10, 710u); // adds w2, w10, #710
+ __ subw(r19, r26, 244u); // sub w19, w26, #244
+ __ subsw(r28, r13, 73u); // subs w28, w13, #73
+ __ add(r2, r30, 862u); // add x2, x30, #862
+ __ adds(r27, r16, 574u); // adds x27, x16, #574
+ __ sub(r22, r9, 589u); // sub x22, x9, #589
+ __ subs(r4, r1, 698u); // subs x4, x1, #698
// LogicalImmOp
- __ andw(r23, r22, 32768ul); // and w23, w22, #0x8000
- __ orrw(r4, r10, 4042322160ul); // orr w4, w10, #0xf0f0f0f0
- __ eorw(r0, r24, 4042322160ul); // eor w0, w24, #0xf0f0f0f0
- __ andsw(r19, r29, 2139127680ul); // ands w19, w29, #0x7f807f80
- __ andr(r5, r10, 4503599627354112ul); // and x5, x10, #0xfffffffffc000
- __ orr(r12, r30, 18445618178097414144ul); // orr x12, x30, #0xfffc0000fffc0000
- __ eor(r30, r5, 262128ul); // eor x30, x5, #0x3fff0
- __ ands(r26, r23, 4194300ul); // ands x26, x23, #0x3ffffc
+ __ andw(r28, r19, 4294709247ul); // and w28, w19, #0xfffc0fff
+ __ orrw(r27, r5, 536870910ul); // orr w27, w5, #0x1ffffffe
+ __ eorw(r30, r20, 4294840319ul); // eor w30, w20, #0xfffe0fff
+ __ andsw(r22, r26, 4294959615ul); // ands w22, w26, #0xffffe1ff
+ __ andr(r5, r7, 4194300ul); // and x5, x7, #0x3ffffc
+ __ orr(r13, r7, 18014398509481728ul); // orr x13, x7, #0x3fffffffffff00
+ __ eor(r7, r9, 18442240474082197503ul); // eor x7, x9, #0xfff0000000003fff
+ __ ands(r3, r0, 18374686479671656447ul); // ands x3, x0, #0xff00000000007fff
// AbsOp
- __ b(__ pc()); // b .
- __ b(back); // b back
- __ b(forth); // b forth
- __ bl(__ pc()); // bl .
- __ bl(back); // bl back
- __ bl(forth); // bl forth
+ __ b(__ pc()); // b .
+ __ b(back); // b back
+ __ b(forth); // b forth
+ __ bl(__ pc()); // bl .
+ __ bl(back); // bl back
+ __ bl(forth); // bl forth
// RegAndAbsOp
- __ cbzw(r12, __ pc()); // cbz w12, .
- __ cbzw(r12, back); // cbz w12, back
- __ cbzw(r12, forth); // cbz w12, forth
- __ cbnzw(r20, __ pc()); // cbnz w20, .
- __ cbnzw(r20, back); // cbnz w20, back
- __ cbnzw(r20, forth); // cbnz w20, forth
- __ cbz(r12, __ pc()); // cbz x12, .
- __ cbz(r12, back); // cbz x12, back
- __ cbz(r12, forth); // cbz x12, forth
- __ cbnz(r24, __ pc()); // cbnz x24, .
- __ cbnz(r24, back); // cbnz x24, back
- __ cbnz(r24, forth); // cbnz x24, forth
- __ adr(r6, __ pc()); // adr x6, .
- __ adr(r6, back); // adr x6, back
- __ adr(r6, forth); // adr x6, forth
- __ _adrp(r21, __ pc()); // adrp x21, .
+ __ cbzw(r16, __ pc()); // cbz w16, .
+ __ cbzw(r16, back); // cbz w16, back
+ __ cbzw(r16, forth); // cbz w16, forth
+ __ cbnzw(r19, __ pc()); // cbnz w19, .
+ __ cbnzw(r19, back); // cbnz w19, back
+ __ cbnzw(r19, forth); // cbnz w19, forth
+ __ cbz(r5, __ pc()); // cbz x5, .
+ __ cbz(r5, back); // cbz x5, back
+ __ cbz(r5, forth); // cbz x5, forth
+ __ cbnz(r4, __ pc()); // cbnz x4, .
+ __ cbnz(r4, back); // cbnz x4, back
+ __ cbnz(r4, forth); // cbnz x4, forth
+ __ adr(r27, __ pc()); // adr x27, .
+ __ adr(r27, back); // adr x27, back
+ __ adr(r27, forth); // adr x27, forth
+ __ _adrp(r16, __ pc()); // adrp x16, .
// RegImmAbsOp
- __ tbz(r1, 1, __ pc()); // tbz x1, #1, .
- __ tbz(r1, 1, back); // tbz x1, #1, back
- __ tbz(r1, 1, forth); // tbz x1, #1, forth
- __ tbnz(r8, 9, __ pc()); // tbnz x8, #9, .
- __ tbnz(r8, 9, back); // tbnz x8, #9, back
- __ tbnz(r8, 9, forth); // tbnz x8, #9, forth
+ __ tbz(r28, 8, __ pc()); // tbz x28, #8, .
+ __ tbz(r28, 8, back); // tbz x28, #8, back
+ __ tbz(r28, 8, forth); // tbz x28, #8, forth
+ __ tbnz(r1, 1, __ pc()); // tbnz x1, #1, .
+ __ tbnz(r1, 1, back); // tbnz x1, #1, back
+ __ tbnz(r1, 1, forth); // tbnz x1, #1, forth
// MoveWideImmOp
- __ movnw(r12, 23175, 0); // movn w12, #23175, lsl 0
- __ movzw(r11, 20476, 16); // movz w11, #20476, lsl 16
- __ movkw(r21, 3716, 0); // movk w21, #3716, lsl 0
- __ movn(r29, 28661, 48); // movn x29, #28661, lsl 48
- __ movz(r3, 6927, 0); // movz x3, #6927, lsl 0
- __ movk(r22, 9828, 16); // movk x22, #9828, lsl 16
+ __ movnw(r20, 8639, 16); // movn w20, #8639, lsl 16
+ __ movzw(r7, 25835, 0); // movz w7, #25835, lsl 0
+ __ movkw(r17, 7261, 0); // movk w17, #7261, lsl 0
+ __ movn(r14, 2097, 32); // movn x14, #2097, lsl 32
+ __ movz(r9, 16082, 0); // movz x9, #16082, lsl 0
+ __ movk(r19, 13962, 16); // movk x19, #13962, lsl 16
// BitfieldOp
- __ sbfm(r12, r8, 6, 22); // sbfm x12, x8, #6, #22
- __ bfmw(r19, r25, 25, 19); // bfm w19, w25, #25, #19
- __ ubfmw(r9, r12, 29, 15); // ubfm w9, w12, #29, #15
- __ sbfm(r28, r25, 16, 16); // sbfm x28, x25, #16, #16
- __ bfm(r12, r5, 4, 25); // bfm x12, x5, #4, #25
- __ ubfm(r0, r10, 6, 8); // ubfm x0, x10, #6, #8
+ __ sbfm(r9, r22, 6, 22); // sbfm x9, x22, #6, #22
+ __ bfmw(r19, r0, 11, 0); // bfm w19, w0, #11, #0
+ __ ubfmw(r10, r19, 11, 19); // ubfm w10, w19, #11, #19
+ __ sbfm(r4, r15, 5, 17); // sbfm x4, x15, #5, #17
+ __ bfm(r3, r5, 19, 28); // bfm x3, x5, #19, #28
+ __ ubfm(r12, r28, 17, 2); // ubfm x12, x28, #17, #2
// ExtractOp
- __ extrw(r4, r13, r26, 24); // extr w4, w13, w26, #24
- __ extr(r23, r30, r24, 31); // extr x23, x30, x24, #31
+ __ extrw(r15, r0, r22, 3); // extr w15, w0, w22, #3
+ __ extr(r6, r14, r14, 55); // extr x6, x14, x14, #55
// CondBranchOp
- __ br(Assembler::EQ, __ pc()); // b.EQ .
- __ br(Assembler::EQ, back); // b.EQ back
- __ br(Assembler::EQ, forth); // b.EQ forth
- __ br(Assembler::NE, __ pc()); // b.NE .
- __ br(Assembler::NE, back); // b.NE back
- __ br(Assembler::NE, forth); // b.NE forth
- __ br(Assembler::HS, __ pc()); // b.HS .
- __ br(Assembler::HS, back); // b.HS back
- __ br(Assembler::HS, forth); // b.HS forth
- __ br(Assembler::CS, __ pc()); // b.CS .
- __ br(Assembler::CS, back); // b.CS back
- __ br(Assembler::CS, forth); // b.CS forth
- __ br(Assembler::LO, __ pc()); // b.LO .
- __ br(Assembler::LO, back); // b.LO back
- __ br(Assembler::LO, forth); // b.LO forth
- __ br(Assembler::CC, __ pc()); // b.CC .
- __ br(Assembler::CC, back); // b.CC back
- __ br(Assembler::CC, forth); // b.CC forth
- __ br(Assembler::MI, __ pc()); // b.MI .
- __ br(Assembler::MI, back); // b.MI back
- __ br(Assembler::MI, forth); // b.MI forth
- __ br(Assembler::PL, __ pc()); // b.PL .
- __ br(Assembler::PL, back); // b.PL back
- __ br(Assembler::PL, forth); // b.PL forth
- __ br(Assembler::VS, __ pc()); // b.VS .
- __ br(Assembler::VS, back); // b.VS back
- __ br(Assembler::VS, forth); // b.VS forth
- __ br(Assembler::VC, __ pc()); // b.VC .
- __ br(Assembler::VC, back); // b.VC back
- __ br(Assembler::VC, forth); // b.VC forth
- __ br(Assembler::HI, __ pc()); // b.HI .
- __ br(Assembler::HI, back); // b.HI back
- __ br(Assembler::HI, forth); // b.HI forth
- __ br(Assembler::LS, __ pc()); // b.LS .
- __ br(Assembler::LS, back); // b.LS back
- __ br(Assembler::LS, forth); // b.LS forth
- __ br(Assembler::GE, __ pc()); // b.GE .
- __ br(Assembler::GE, back); // b.GE back
- __ br(Assembler::GE, forth); // b.GE forth
- __ br(Assembler::LT, __ pc()); // b.LT .
- __ br(Assembler::LT, back); // b.LT back
- __ br(Assembler::LT, forth); // b.LT forth
- __ br(Assembler::GT, __ pc()); // b.GT .
- __ br(Assembler::GT, back); // b.GT back
- __ br(Assembler::GT, forth); // b.GT forth
- __ br(Assembler::LE, __ pc()); // b.LE .
- __ br(Assembler::LE, back); // b.LE back
- __ br(Assembler::LE, forth); // b.LE forth
- __ br(Assembler::AL, __ pc()); // b.AL .
- __ br(Assembler::AL, back); // b.AL back
- __ br(Assembler::AL, forth); // b.AL forth
- __ br(Assembler::NV, __ pc()); // b.NV .
- __ br(Assembler::NV, back); // b.NV back
- __ br(Assembler::NV, forth); // b.NV forth
+ __ br(Assembler::EQ, __ pc()); // b.EQ .
+ __ br(Assembler::EQ, back); // b.EQ back
+ __ br(Assembler::EQ, forth); // b.EQ forth
+ __ br(Assembler::NE, __ pc()); // b.NE .
+ __ br(Assembler::NE, back); // b.NE back
+ __ br(Assembler::NE, forth); // b.NE forth
+ __ br(Assembler::HS, __ pc()); // b.HS .
+ __ br(Assembler::HS, back); // b.HS back
+ __ br(Assembler::HS, forth); // b.HS forth
+ __ br(Assembler::CS, __ pc()); // b.CS .
+ __ br(Assembler::CS, back); // b.CS back
+ __ br(Assembler::CS, forth); // b.CS forth
+ __ br(Assembler::LO, __ pc()); // b.LO .
+ __ br(Assembler::LO, back); // b.LO back
+ __ br(Assembler::LO, forth); // b.LO forth
+ __ br(Assembler::CC, __ pc()); // b.CC .
+ __ br(Assembler::CC, back); // b.CC back
+ __ br(Assembler::CC, forth); // b.CC forth
+ __ br(Assembler::MI, __ pc()); // b.MI .
+ __ br(Assembler::MI, back); // b.MI back
+ __ br(Assembler::MI, forth); // b.MI forth
+ __ br(Assembler::PL, __ pc()); // b.PL .
+ __ br(Assembler::PL, back); // b.PL back
+ __ br(Assembler::PL, forth); // b.PL forth
+ __ br(Assembler::VS, __ pc()); // b.VS .
+ __ br(Assembler::VS, back); // b.VS back
+ __ br(Assembler::VS, forth); // b.VS forth
+ __ br(Assembler::VC, __ pc()); // b.VC .
+ __ br(Assembler::VC, back); // b.VC back
+ __ br(Assembler::VC, forth); // b.VC forth
+ __ br(Assembler::HI, __ pc()); // b.HI .
+ __ br(Assembler::HI, back); // b.HI back
+ __ br(Assembler::HI, forth); // b.HI forth
+ __ br(Assembler::LS, __ pc()); // b.LS .
+ __ br(Assembler::LS, back); // b.LS back
+ __ br(Assembler::LS, forth); // b.LS forth
+ __ br(Assembler::GE, __ pc()); // b.GE .
+ __ br(Assembler::GE, back); // b.GE back
+ __ br(Assembler::GE, forth); // b.GE forth
+ __ br(Assembler::LT, __ pc()); // b.LT .
+ __ br(Assembler::LT, back); // b.LT back
+ __ br(Assembler::LT, forth); // b.LT forth
+ __ br(Assembler::GT, __ pc()); // b.GT .
+ __ br(Assembler::GT, back); // b.GT back
+ __ br(Assembler::GT, forth); // b.GT forth
+ __ br(Assembler::LE, __ pc()); // b.LE .
+ __ br(Assembler::LE, back); // b.LE back
+ __ br(Assembler::LE, forth); // b.LE forth
+ __ br(Assembler::AL, __ pc()); // b.AL .
+ __ br(Assembler::AL, back); // b.AL back
+ __ br(Assembler::AL, forth); // b.AL forth
+ __ br(Assembler::NV, __ pc()); // b.NV .
+ __ br(Assembler::NV, back); // b.NV back
+ __ br(Assembler::NV, forth); // b.NV forth
// ImmOp
- __ svc(12729); // svc #12729
- __ hvc(6788); // hvc #6788
- __ smc(1535); // smc #1535
- __ brk(16766); // brk #16766
- __ hlt(9753); // hlt #9753
+ __ svc(22064); // svc #22064
+ __ hvc(533); // hvc #533
+ __ smc(9942); // smc #9942
+ __ brk(4714); // brk #4714
+ __ hlt(4302); // hlt #4302
// Op
- __ nop(); // nop
- __ eret(); // eret
- __ drps(); // drps
- __ isb(); // isb
+ __ nop(); // nop
+ __ eret(); // eret
+ __ drps(); // drps
+ __ isb(); // isb
// SystemOp
- __ dsb(Assembler::SY); // dsb SY
- __ dmb(Assembler::ISHST); // dmb ISHST
+ __ dsb(Assembler::OSH); // dsb OSH
+ __ dmb(Assembler::NSHLD); // dmb NSHLD
// OneRegOp
- __ br(r2); // br x2
- __ blr(r5); // blr x5
+ __ br(r20); // br x20
+ __ blr(r2); // blr x2
// LoadStoreExclusiveOp
- __ stxr(r20, r21, r2); // stxr w20, x21, [x2]
- __ stlxr(r5, r29, r7); // stlxr w5, x29, [x7]
- __ ldxr(r5, r16); // ldxr x5, [x16]
- __ ldaxr(r27, r29); // ldaxr x27, [x29]
- __ stlr(r0, r29); // stlr x0, [x29]
- __ ldar(r21, r28); // ldar x21, [x28]
+ __ stxr(r18, r23, r0); // stxr w18, x23, [x0]
+ __ stlxr(r30, r5, r22); // stlxr w30, x5, [x22]
+ __ ldxr(r5, r8); // ldxr x5, [x8]
+ __ ldaxr(r20, r16); // ldaxr x20, [x16]
+ __ stlr(r6, r11); // stlr x6, [x11]
+ __ ldar(r6, r27); // ldar x6, [x27]
// LoadStoreExclusiveOp
- __ stxrw(r21, r24, r7); // stxr w21, w24, [x7]
- __ stlxrw(r21, r26, r28); // stlxr w21, w26, [x28]
- __ ldxrw(r21, r6); // ldxr w21, [x6]
- __ ldaxrw(r15, r30); // ldaxr w15, [x30]
- __ stlrw(r19, r3); // stlr w19, [x3]
- __ ldarw(r22, r2); // ldar w22, [x2]
+ __ stxrw(r10, r17, r5); // stxr w10, w17, [x5]
+ __ stlxrw(r22, r9, r12); // stlxr w22, w9, [x12]
+ __ ldxrw(r27, r8); // ldxr w27, [x8]
+ __ ldaxrw(r23, r2); // ldaxr w23, [x2]
+ __ stlrw(r26, r29); // stlr w26, [x29]
+ __ ldarw(r13, r10); // ldar w13, [x10]
// LoadStoreExclusiveOp
- __ stxrh(r18, r15, r0); // stxrh w18, w15, [x0]
- __ stlxrh(r11, r5, r28); // stlxrh w11, w5, [x28]
- __ ldxrh(r29, r6); // ldxrh w29, [x6]
- __ ldaxrh(r18, r7); // ldaxrh w18, [x7]
- __ stlrh(r25, r28); // stlrh w25, [x28]
- __ ldarh(r2, r19); // ldarh w2, [x19]
+ __ stxrh(r25, r28, r27); // stxrh w25, w28, [x27]
+ __ stlxrh(r29, r22, r12); // stlxrh w29, w22, [x12]
+ __ ldxrh(r22, r28); // ldxrh w22, [x28]
+ __ ldaxrh(r3, r30); // ldaxrh w3, [x30]
+ __ stlrh(r24, r15); // stlrh w24, [x15]
+ __ ldarh(r27, r26); // ldarh w27, [x26]
// LoadStoreExclusiveOp
- __ stxrb(r10, r30, r1); // stxrb w10, w30, [x1]
- __ stlxrb(r20, r21, r22); // stlxrb w20, w21, [x22]
- __ ldxrb(r25, r2); // ldxrb w25, [x2]
- __ ldaxrb(r24, r5); // ldaxrb w24, [x5]
- __ stlrb(r16, r3); // stlrb w16, [x3]
- __ ldarb(r22, r29); // ldarb w22, [x29]
+ __ stxrb(r11, r10, r19); // stxrb w11, w10, [x19]
+ __ stlxrb(r23, r27, r22); // stlxrb w23, w27, [x22]
+ __ ldxrb(r24, r16); // ldxrb w24, [x16]
+ __ ldaxrb(r24, r1); // ldaxrb w24, [x1]
+ __ stlrb(r5, r29); // stlrb w5, [x29]
+ __ ldarb(r24, r16); // ldarb w24, [x16]
// LoadStoreExclusiveOp
- __ ldxp(r8, r2, r19); // ldxp x8, x2, [x19]
- __ ldaxp(r7, r19, r14); // ldaxp x7, x19, [x14]
- __ stxp(r8, r27, r28, r5); // stxp w8, x27, x28, [x5]
- __ stlxp(r5, r8, r14, r6); // stlxp w5, x8, x14, [x6]
+ __ ldxp(r25, r24, r17); // ldxp x25, x24, [x17]
+ __ ldaxp(r22, r12, r19); // ldaxp x22, x12, [x19]
+ __ stxp(r0, r26, r21, r25); // stxp w0, x26, x21, [x25]
+ __ stlxp(r1, r6, r11, r5); // stlxp w1, x6, x11, [x5]
// LoadStoreExclusiveOp
- __ ldxpw(r25, r4, r22); // ldxp w25, w4, [x22]
- __ ldaxpw(r13, r14, r15); // ldaxp w13, w14, [x15]
- __ stxpw(r20, r26, r8, r10); // stxp w20, w26, w8, [x10]
- __ stlxpw(r23, r18, r18, r18); // stlxp w23, w18, w18, [x18]
+ __ ldxpw(r13, r14, r4); // ldxp w13, w14, [x4]
+ __ ldaxpw(r17, r2, r6); // ldaxp w17, w2, [x6]
+ __ stxpw(r15, r3, r9, r18); // stxp w15, w3, w9, [x18]
+ __ stlxpw(r18, r17, r4, r9); // stlxp w18, w17, w4, [x9]
// base_plus_unscaled_offset
// LoadStoreOp
- __ str(r30, Address(r11, 99)); // str x30, [x11, 99]
- __ strw(r23, Address(r25, -77)); // str w23, [x25, -77]
- __ strb(r2, Address(r14, 3)); // strb w2, [x14, 3]
- __ strh(r9, Address(r10, 5)); // strh w9, [x10, 5]
- __ ldr(r20, Address(r15, 57)); // ldr x20, [x15, 57]
- __ ldrw(r12, Address(r16, -78)); // ldr w12, [x16, -78]
- __ ldrb(r22, Address(r26, -3)); // ldrb w22, [x26, -3]
- __ ldrh(r30, Address(r19, -47)); // ldrh w30, [x19, -47]
- __ ldrsb(r9, Address(r10, -12)); // ldrsb x9, [x10, -12]
- __ ldrsh(r28, Address(r17, 14)); // ldrsh x28, [x17, 14]
- __ ldrshw(r3, Address(r5, 10)); // ldrsh w3, [x5, 10]
- __ ldrsw(r17, Address(r17, -91)); // ldrsw x17, [x17, -91]
- __ ldrd(v2, Address(r20, -17)); // ldr d2, [x20, -17]
- __ ldrs(v22, Address(r7, -10)); // ldr s22, [x7, -10]
- __ strd(v30, Address(r18, -223)); // str d30, [x18, -223]
- __ strs(v13, Address(r22, 21)); // str s13, [x22, 21]
+ __ str(r23, Address(r21, -49)); // str x23, [x21, -49]
+ __ strw(r21, Address(r2, 63)); // str w21, [x2, 63]
+ __ strb(r27, Address(r28, 11)); // strb w27, [x28, 11]
+ __ strh(r29, Address(r15, -13)); // strh w29, [x15, -13]
+ __ ldr(r14, Address(r30, -45)); // ldr x14, [x30, -45]
+ __ ldrw(r29, Address(r28, 53)); // ldr w29, [x28, 53]
+ __ ldrb(r20, Address(r26, 7)); // ldrb w20, [x26, 7]
+ __ ldrh(r25, Address(r2, -50)); // ldrh w25, [x2, -50]
+ __ ldrsb(r3, Address(r10, -15)); // ldrsb x3, [x10, -15]
+ __ ldrsh(r14, Address(r15, 19)); // ldrsh x14, [x15, 19]
+ __ ldrshw(r29, Address(r11, -5)); // ldrsh w29, [x11, -5]
+ __ ldrsw(r15, Address(r5, -71)); // ldrsw x15, [x5, -71]
+ __ ldrd(v19, Address(r12, 3)); // ldr d19, [x12, 3]
+ __ ldrs(v12, Address(r27, 42)); // ldr s12, [x27, 42]
+ __ strd(v22, Address(r28, 125)); // str d22, [x28, 125]
+ __ strs(v24, Address(r15, -20)); // str s24, [x15, -20]
// pre
// LoadStoreOp
- __ str(r9, Address(__ pre(r18, -112))); // str x9, [x18, -112]!
- __ strw(r29, Address(__ pre(r23, 11))); // str w29, [x23, 11]!
- __ strb(r18, Address(__ pre(r12, -1))); // strb w18, [x12, -1]!
- __ strh(r16, Address(__ pre(r20, -23))); // strh w16, [x20, -23]!
- __ ldr(r3, Address(__ pre(r29, 9))); // ldr x3, [x29, 9]!
- __ ldrw(r25, Address(__ pre(r3, 19))); // ldr w25, [x3, 19]!
- __ ldrb(r1, Address(__ pre(r29, -1))); // ldrb w1, [x29, -1]!
- __ ldrh(r8, Address(__ pre(r29, -57))); // ldrh w8, [x29, -57]!
- __ ldrsb(r5, Address(__ pre(r14, -13))); // ldrsb x5, [x14, -13]!
- __ ldrsh(r10, Address(__ pre(r27, 1))); // ldrsh x10, [x27, 1]!
- __ ldrshw(r11, Address(__ pre(r10, 25))); // ldrsh w11, [x10, 25]!
- __ ldrsw(r4, Address(__ pre(r22, -92))); // ldrsw x4, [x22, -92]!
- __ ldrd(v11, Address(__ pre(r23, 8))); // ldr d11, [x23, 8]!
- __ ldrs(v25, Address(__ pre(r19, 54))); // ldr s25, [x19, 54]!
- __ strd(v1, Address(__ pre(r7, -174))); // str d1, [x7, -174]!
- __ strs(v8, Address(__ pre(r25, 54))); // str s8, [x25, 54]!
+ __ str(r8, Address(__ pre(r28, -24))); // str x8, [x28, -24]!
+ __ strw(r6, Address(__ pre(r15, 37))); // str w6, [x15, 37]!
+ __ strb(r7, Address(__ pre(r1, 7))); // strb w7, [x1, 7]!
+ __ strh(r0, Address(__ pre(r17, 30))); // strh w0, [x17, 30]!
+ __ ldr(r25, Address(__ pre(r29, 84))); // ldr x25, [x29, 84]!
+ __ ldrw(r26, Address(__ pre(r20, -52))); // ldr w26, [x20, -52]!
+ __ ldrb(r26, Address(__ pre(r29, -25))); // ldrb w26, [x29, -25]!
+ __ ldrh(r4, Address(__ pre(r25, 26))); // ldrh w4, [x25, 26]!
+ __ ldrsb(r28, Address(__ pre(r8, -21))); // ldrsb x28, [x8, -21]!
+ __ ldrsh(r17, Address(__ pre(r14, -6))); // ldrsh x17, [x14, -6]!
+ __ ldrshw(r28, Address(__ pre(r23, 10))); // ldrsh w28, [x23, 10]!
+ __ ldrsw(r30, Address(__ pre(r27, -64))); // ldrsw x30, [x27, -64]!
+ __ ldrd(v20, Address(__ pre(r30, -242))); // ldr d20, [x30, -242]!
+ __ ldrs(v17, Address(__ pre(r27, 20))); // ldr s17, [x27, 20]!
+ __ strd(v7, Address(__ pre(r3, 17))); // str d7, [x3, 17]!
+ __ strs(v13, Address(__ pre(r11, -16))); // str s13, [x11, -16]!
// post
// LoadStoreOp
- __ str(r5, Address(__ post(r11, 37))); // str x5, [x11], 37
- __ strw(r24, Address(__ post(r15, 19))); // str w24, [x15], 19
- __ strb(r15, Address(__ post(r26, -1))); // strb w15, [x26], -1
- __ strh(r18, Address(__ post(r18, -6))); // strh w18, [x18], -6
- __ ldr(r7, Address(__ post(r2, -230))); // ldr x7, [x2], -230
- __ ldrw(r27, Address(__ post(r11, -27))); // ldr w27, [x11], -27
- __ ldrb(r18, Address(__ post(r3, -25))); // ldrb w18, [x3], -25
- __ ldrh(r10, Address(__ post(r24, -32))); // ldrh w10, [x24], -32
- __ ldrsb(r22, Address(__ post(r10, 4))); // ldrsb x22, [x10], 4
- __ ldrsh(r17, Address(__ post(r12, 25))); // ldrsh x17, [x12], 25
- __ ldrshw(r8, Address(__ post(r7, -62))); // ldrsh w8, [x7], -62
- __ ldrsw(r23, Address(__ post(r22, -51))); // ldrsw x23, [x22], -51
- __ ldrd(v24, Address(__ post(r25, 48))); // ldr d24, [x25], 48
- __ ldrs(v21, Address(__ post(r12, -10))); // ldr s21, [x12], -10
- __ strd(v18, Address(__ post(r13, -222))); // str d18, [x13], -222
- __ strs(v16, Address(__ post(r1, -41))); // str s16, [x1], -41
+ __ str(r6, Address(__ post(r9, -61))); // str x6, [x9], -61
+ __ strw(r16, Address(__ post(r5, -29))); // str w16, [x5], -29
+ __ strb(r29, Address(__ post(r29, 15))); // strb w29, [x29], 15
+ __ strh(r4, Address(__ post(r20, 18))); // strh w4, [x20], 18
+ __ ldr(r19, Address(__ post(r18, 46))); // ldr x19, [x18], 46
+ __ ldrw(r22, Address(__ post(r2, 23))); // ldr w22, [x2], 23
+ __ ldrb(r7, Address(__ post(r3, -30))); // ldrb w7, [x3], -30
+ __ ldrh(r11, Address(__ post(r12, -29))); // ldrh w11, [x12], -29
+ __ ldrsb(r8, Address(__ post(r6, -29))); // ldrsb x8, [x6], -29
+ __ ldrsh(r24, Address(__ post(r23, 4))); // ldrsh x24, [x23], 4
+ __ ldrshw(r17, Address(__ post(r16, 0))); // ldrsh w17, [x16], 0
+ __ ldrsw(r0, Address(__ post(r20, -8))); // ldrsw x0, [x20], -8
+ __ ldrd(v20, Address(__ post(r2, -126))); // ldr d20, [x2], -126
+ __ ldrs(v19, Address(__ post(r30, -104))); // ldr s19, [x30], -104
+ __ strd(v4, Address(__ post(r17, 118))); // str d4, [x17], 118
+ __ strs(v21, Address(__ post(r19, -112))); // str s21, [x19], -112
// base_plus_reg
// LoadStoreOp
- __ str(r2, Address(r22, r15, Address::sxtw(0))); // str x2, [x22, w15, sxtw #0]
- __ strw(r2, Address(r16, r29, Address::lsl(0))); // str w2, [x16, x29, lsl #0]
- __ strb(r20, Address(r18, r14, Address::uxtw(0))); // strb w20, [x18, w14, uxtw #0]
- __ strh(r6, Address(r19, r20, Address::sxtx(1))); // strh w6, [x19, x20, sxtx #1]
- __ ldr(r14, Address(r29, r14, Address::sxtw(0))); // ldr x14, [x29, w14, sxtw #0]
- __ ldrw(r16, Address(r20, r12, Address::sxtw(2))); // ldr w16, [x20, w12, sxtw #2]
- __ ldrb(r9, Address(r12, r0, Address::sxtw(0))); // ldrb w9, [x12, w0, sxtw #0]
- __ ldrh(r12, Address(r17, r3, Address::lsl(1))); // ldrh w12, [x17, x3, lsl #1]
- __ ldrsb(r2, Address(r17, r3, Address::sxtx(0))); // ldrsb x2, [x17, x3, sxtx #0]
- __ ldrsh(r7, Address(r1, r17, Address::uxtw(1))); // ldrsh x7, [x1, w17, uxtw #1]
- __ ldrshw(r25, Address(r15, r18, Address::sxtw(1))); // ldrsh w25, [x15, w18, sxtw #1]
- __ ldrsw(r23, Address(r21, r12, Address::lsl(0))); // ldrsw x23, [x21, x12, lsl #0]
- __ ldrd(v5, Address(r13, r8, Address::lsl(3))); // ldr d5, [x13, x8, lsl #3]
- __ ldrs(v3, Address(r10, r22, Address::lsl(2))); // ldr s3, [x10, x22, lsl #2]
- __ strd(v14, Address(r2, r27, Address::sxtw(0))); // str d14, [x2, w27, sxtw #0]
- __ strs(v20, Address(r6, r25, Address::lsl(0))); // str s20, [x6, x25, lsl #0]
+ __ str(r26, Address(r2, r19, Address::lsl(3))); // str x26, [x2, x19, lsl #3]
+ __ strw(r9, Address(r0, r15, Address::sxtw(2))); // str w9, [x0, w15, sxtw #2]
+ __ strb(r26, Address(r12, r1, Address::lsl(0))); // strb w26, [x12, x1, lsl #0]
+ __ strh(r21, Address(r11, r10, Address::lsl(1))); // strh w21, [x11, x10, lsl #1]
+ __ ldr(r16, Address(r23, r16, Address::sxtx(0))); // ldr x16, [x23, x16, sxtx #0]
+ __ ldrw(r10, Address(r11, r17, Address::sxtw(2))); // ldr w10, [x11, w17, sxtw #2]
+ __ ldrb(r13, Address(r23, r11, Address::lsl(0))); // ldrb w13, [x23, x11, lsl #0]
+ __ ldrh(r27, Address(r4, r21, Address::lsl(0))); // ldrh w27, [x4, x21, lsl #0]
+ __ ldrsb(r26, Address(r8, r15, Address::sxtw(0))); // ldrsb x26, [x8, w15, sxtw #0]
+ __ ldrsh(r21, Address(r10, r2, Address::sxtw(0))); // ldrsh x21, [x10, w2, sxtw #0]
+ __ ldrshw(r8, Address(r30, r14, Address::lsl(0))); // ldrsh w8, [x30, x14, lsl #0]
+ __ ldrsw(r29, Address(r14, r20, Address::sxtx(2))); // ldrsw x29, [x14, x20, sxtx #2]
+ __ ldrd(v30, Address(r27, r22, Address::sxtx(0))); // ldr d30, [x27, x22, sxtx #0]
+ __ ldrs(v13, Address(r9, r22, Address::lsl(0))); // ldr s13, [x9, x22, lsl #0]
+ __ strd(v8, Address(r25, r17, Address::sxtw(3))); // str d8, [x25, w17, sxtw #3]
+ __ strs(v1, Address(r24, r5, Address::uxtw(2))); // str s1, [x24, w5, uxtw #2]
// base_plus_scaled_offset
// LoadStoreOp
- __ str(r30, Address(r7, 16256)); // str x30, [x7, 16256]
- __ strw(r15, Address(r8, 7588)); // str w15, [x8, 7588]
- __ strb(r11, Address(r0, 1866)); // strb w11, [x0, 1866]
- __ strh(r3, Address(r17, 3734)); // strh w3, [x17, 3734]
- __ ldr(r2, Address(r7, 14224)); // ldr x2, [x7, 14224]
- __ ldrw(r5, Address(r9, 7396)); // ldr w5, [x9, 7396]
- __ ldrb(r28, Address(r9, 1721)); // ldrb w28, [x9, 1721]
- __ ldrh(r2, Address(r20, 3656)); // ldrh w2, [x20, 3656]
- __ ldrsb(r22, Address(r14, 1887)); // ldrsb x22, [x14, 1887]
- __ ldrsh(r8, Address(r0, 4080)); // ldrsh x8, [x0, 4080]
- __ ldrshw(r0, Address(r30, 3916)); // ldrsh w0, [x30, 3916]
- __ ldrsw(r24, Address(r19, 6828)); // ldrsw x24, [x19, 6828]
- __ ldrd(v24, Address(r12, 13032)); // ldr d24, [x12, 13032]
- __ ldrs(v8, Address(r8, 7452)); // ldr s8, [x8, 7452]
- __ strd(v10, Address(r15, 15992)); // str d10, [x15, 15992]
- __ strs(v26, Address(r19, 6688)); // str s26, [x19, 6688]
+ __ str(r10, Address(r21, 14496)); // str x10, [x21, 14496]
+ __ strw(r18, Address(r29, 7228)); // str w18, [x29, 7228]
+ __ strb(r23, Address(r3, 2018)); // strb w23, [x3, 2018]
+ __ strh(r28, Address(r11, 3428)); // strh w28, [x11, 3428]
+ __ ldr(r24, Address(r26, 14376)); // ldr x24, [x26, 14376]
+ __ ldrw(r21, Address(r2, 6972)); // ldr w21, [x2, 6972]
+ __ ldrb(r4, Address(r5, 1848)); // ldrb w4, [x5, 1848]
+ __ ldrh(r14, Address(r14, 3112)); // ldrh w14, [x14, 3112]
+ __ ldrsb(r4, Address(r27, 1959)); // ldrsb x4, [x27, 1959]
+ __ ldrsh(r4, Address(r27, 3226)); // ldrsh x4, [x27, 3226]
+ __ ldrshw(r10, Address(r28, 3286)); // ldrsh w10, [x28, 3286]
+ __ ldrsw(r10, Address(r17, 7912)); // ldrsw x10, [x17, 7912]
+ __ ldrd(v13, Address(r28, 13400)); // ldr d13, [x28, 13400]
+ __ ldrs(v24, Address(r3, 7596)); // ldr s24, [x3, 7596]
+ __ strd(v2, Address(r12, 15360)); // str d2, [x12, 15360]
+ __ strs(v17, Address(r1, 6492)); // str s17, [x1, 6492]
// pcrel
// LoadStoreOp
- __ ldr(r10, forth); // ldr x10, forth
- __ ldrw(r3, __ pc()); // ldr w3, .
+ __ ldr(r16, __ pc()); // ldr x16, .
+ __ ldrw(r13, __ pc()); // ldr w13, .
// LoadStoreOp
- __ prfm(Address(r23, 9)); // prfm PLDL1KEEP, [x23, 9]
+ __ prfm(Address(r18, -127)); // prfm PLDL1KEEP, [x18, -127]
// LoadStoreOp
- __ prfm(back); // prfm PLDL1KEEP, back
+ __ prfm(back); // prfm PLDL1KEEP, back
// LoadStoreOp
- __ prfm(Address(r3, r8, Address::uxtw(0))); // prfm PLDL1KEEP, [x3, w8, uxtw #0]
+ __ prfm(Address(r20, r2, Address::lsl(3))); // prfm PLDL1KEEP, [x20, x2, lsl #3]
// LoadStoreOp
- __ prfm(Address(r11, 15080)); // prfm PLDL1KEEP, [x11, 15080]
+ __ prfm(Address(r9, 13808)); // prfm PLDL1KEEP, [x9, 13808]
// AddSubCarryOp
- __ adcw(r13, r9, r28); // adc w13, w9, w28
- __ adcsw(r27, r19, r28); // adcs w27, w19, w28
- __ sbcw(r19, r18, r6); // sbc w19, w18, w6
- __ sbcsw(r14, r20, r3); // sbcs w14, w20, w3
- __ adc(r16, r14, r8); // adc x16, x14, x8
- __ adcs(r0, r29, r8); // adcs x0, x29, x8
- __ sbc(r8, r24, r20); // sbc x8, x24, x20
- __ sbcs(r12, r28, r0); // sbcs x12, x28, x0
+ __ adcw(r8, r23, r2); // adc w8, w23, w2
+ __ adcsw(r24, r3, r19); // adcs w24, w3, w19
+ __ sbcw(r22, r24, r29); // sbc w22, w24, w29
+ __ sbcsw(r12, r27, r3); // sbcs w12, w27, w3
+ __ adc(r11, r23, r1); // adc x11, x23, x1
+ __ adcs(r29, r5, r23); // adcs x29, x5, x23
+ __ sbc(r9, r25, r12); // sbc x9, x25, x12
+ __ sbcs(r12, r0, r22); // sbcs x12, x0, x22
// AddSubExtendedOp
- __ addw(r23, r6, r16, ext::uxtb, 4); // add w23, w6, w16, uxtb #4
- __ addsw(r25, r25, r23, ext::sxth, 2); // adds w25, w25, w23, sxth #2
- __ sub(r26, r22, r4, ext::uxtx, 1); // sub x26, x22, x4, uxtx #1
- __ subsw(r17, r29, r19, ext::sxtx, 3); // subs w17, w29, w19, sxtx #3
- __ add(r11, r30, r21, ext::uxtb, 3); // add x11, x30, x21, uxtb #3
- __ adds(r16, r19, r0, ext::sxtb, 2); // adds x16, x19, x0, sxtb #2
- __ sub(r11, r9, r25, ext::sxtx, 1); // sub x11, x9, x25, sxtx #1
- __ subs(r17, r20, r12, ext::sxtb, 4); // subs x17, x20, x12, sxtb #4
+ __ addw(r26, r12, r3, ext::uxtw, 1); // add w26, w12, w3, uxtw #1
+ __ addsw(r20, r16, r18, ext::sxtb, 2); // adds w20, w16, w18, sxtb #2
+ __ sub(r30, r30, r7, ext::uxtw, 2); // sub x30, x30, x7, uxtw #2
+ __ subsw(r11, r21, r2, ext::uxth, 3); // subs w11, w21, w2, uxth #3
+ __ add(r2, r26, r1, ext::uxtw, 2); // add x2, x26, x1, uxtw #2
+ __ adds(r18, r29, r20, ext::sxth, 1); // adds x18, x29, x20, sxth #1
+ __ sub(r14, r16, r4, ext::uxtw, 4); // sub x14, x16, x4, uxtw #4
+ __ subs(r0, r17, r23, ext::sxtb, 3); // subs x0, x17, x23, sxtb #3
// ConditionalCompareOp
- __ ccmnw(r13, r11, 3u, Assembler::LE); // ccmn w13, w11, #3, LE
- __ ccmpw(r13, r12, 2u, Assembler::HI); // ccmp w13, w12, #2, HI
- __ ccmn(r3, r2, 12u, Assembler::NE); // ccmn x3, x2, #12, NE
- __ ccmp(r7, r21, 3u, Assembler::VS); // ccmp x7, x21, #3, VS
+ __ ccmnw(r20, r22, 3u, Assembler::PL); // ccmn w20, w22, #3, PL
+ __ ccmpw(r25, r2, 1u, Assembler::EQ); // ccmp w25, w2, #1, EQ
+ __ ccmn(r18, r24, 7u, Assembler::GT); // ccmn x18, x24, #7, GT
+ __ ccmp(r8, r13, 6u, Assembler::PL); // ccmp x8, x13, #6, PL
// ConditionalCompareImmedOp
- __ ccmnw(r2, 14, 4, Assembler::CC); // ccmn w2, #14, #4, CC
- __ ccmpw(r17, 17, 6, Assembler::PL); // ccmp w17, #17, #6, PL
- __ ccmn(r10, 12, 0, Assembler::CS); // ccmn x10, #12, #0, CS
- __ ccmp(r21, 18, 14, Assembler::GE); // ccmp x21, #18, #14, GE
+ __ ccmnw(r9, 2, 4, Assembler::VS); // ccmn w9, #2, #4, VS
+ __ ccmpw(r2, 27, 7, Assembler::EQ); // ccmp w2, #27, #7, EQ
+ __ ccmn(r16, 1, 2, Assembler::CC); // ccmn x16, #1, #2, CC
+ __ ccmp(r17, 31, 3, Assembler::LT); // ccmp x17, #31, #3, LT
// ConditionalSelectOp
- __ cselw(r21, r13, r12, Assembler::GT); // csel w21, w13, w12, GT
- __ csincw(r10, r27, r15, Assembler::LS); // csinc w10, w27, w15, LS
- __ csinvw(r0, r13, r9, Assembler::HI); // csinv w0, w13, w9, HI
- __ csnegw(r18, r4, r26, Assembler::VS); // csneg w18, w4, w26, VS
- __ csel(r12, r29, r7, Assembler::LS); // csel x12, x29, x7, LS
- __ csinc(r6, r7, r20, Assembler::VC); // csinc x6, x7, x20, VC
- __ csinv(r22, r21, r3, Assembler::LE); // csinv x22, x21, x3, LE
- __ csneg(r19, r12, r27, Assembler::LS); // csneg x19, x12, x27, LS
+ __ cselw(r23, r27, r23, Assembler::LS); // csel w23, w27, w23, LS
+ __ csincw(r10, r0, r6, Assembler::VS); // csinc w10, w0, w6, VS
+ __ csinvw(r11, r0, r9, Assembler::CC); // csinv w11, w0, w9, CC
+ __ csnegw(r17, r27, r18, Assembler::LO); // csneg w17, w27, w18, LO
+ __ csel(r12, r16, r11, Assembler::VC); // csel x12, x16, x11, VC
+ __ csinc(r6, r28, r6, Assembler::HI); // csinc x6, x28, x6, HI
+ __ csinv(r13, r27, r26, Assembler::VC); // csinv x13, x27, x26, VC
+ __ csneg(r29, r22, r18, Assembler::PL); // csneg x29, x22, x18, PL
// TwoRegOp
- __ rbitw(r0, r16); // rbit w0, w16
- __ rev16w(r17, r23); // rev16 w17, w23
- __ revw(r17, r14); // rev w17, w14
- __ clzw(r24, r30); // clz w24, w30
- __ clsw(r24, r22); // cls w24, w22
- __ rbit(r3, r17); // rbit x3, x17
- __ rev16(r12, r13); // rev16 x12, x13
- __ rev32(r9, r22); // rev32 x9, x22
- __ rev(r0, r0); // rev x0, x0
- __ clz(r5, r16); // clz x5, x16
- __ cls(r25, r22); // cls x25, x22
+ __ rbitw(r12, r19); // rbit w12, w19
+ __ rev16w(r23, r18); // rev16 w23, w18
+ __ revw(r9, r28); // rev w9, w28
+ __ clzw(r2, r19); // clz w2, w19
+ __ clsw(r25, r29); // cls w25, w29
+ __ rbit(r4, r23); // rbit x4, x23
+ __ rev16(r29, r18); // rev16 x29, x18
+ __ rev32(r7, r8); // rev32 x7, x8
+ __ rev(r13, r17); // rev x13, x17
+ __ clz(r17, r0); // clz x17, x0
+ __ cls(r18, r26); // cls x18, x26
// ThreeRegOp
- __ udivw(r29, r4, r0); // udiv w29, w4, w0
- __ sdivw(r0, r29, r29); // sdiv w0, w29, w29
- __ lslvw(r5, r17, r21); // lslv w5, w17, w21
- __ lsrvw(r9, r9, r18); // lsrv w9, w9, w18
- __ asrvw(r1, r27, r8); // asrv w1, w27, w8
- __ rorvw(r18, r20, r13); // rorv w18, w20, w13
- __ udiv(r8, r25, r12); // udiv x8, x25, x12
- __ sdiv(r7, r5, r28); // sdiv x7, x5, x28
- __ lslv(r5, r17, r27); // lslv x5, x17, x27
- __ lsrv(r23, r26, r20); // lsrv x23, x26, x20
- __ asrv(r28, r8, r28); // asrv x28, x8, x28
- __ rorv(r3, r29, r4); // rorv x3, x29, x4
+ __ udivw(r11, r12, r16); // udiv w11, w12, w16
+ __ sdivw(r4, r9, r7); // sdiv w4, w9, w7
+ __ lslvw(r12, r7, r16); // lslv w12, w7, w16
+ __ lsrvw(r19, r16, r23); // lsrv w19, w16, w23
+ __ asrvw(r7, r4, r6); // asrv w7, w4, w6
+ __ rorvw(r21, r20, r23); // rorv w21, w20, w23
+ __ udiv(r16, r12, r28); // udiv x16, x12, x28
+ __ sdiv(r4, r12, r13); // sdiv x4, x12, x13
+ __ lslv(r9, r13, r7); // lslv x9, x13, x7
+ __ lsrv(r28, r27, r15); // lsrv x28, x27, x15
+ __ asrv(r20, r30, r14); // asrv x20, x30, x14
+ __ rorv(r14, r18, r30); // rorv x14, x18, x30
+ __ umulh(r3, r11, r7); // umulh x3, x11, x7
+ __ smulh(r23, r20, r24); // smulh x23, x20, x24
// FourRegMulOp
- __ maddw(r17, r14, r26, r21); // madd w17, w14, w26, w21
- __ msubw(r1, r30, r11, r11); // msub w1, w30, w11, w11
- __ madd(r1, r17, r6, r28); // madd x1, x17, x6, x28
- __ msub(r30, r6, r30, r8); // msub x30, x6, x30, x8
- __ smaddl(r21, r6, r14, r8); // smaddl x21, w6, w14, x8
- __ smsubl(r10, r10, r24, r19); // smsubl x10, w10, w24, x19
- __ umaddl(r20, r18, r14, r24); // umaddl x20, w18, w14, x24
- __ umsubl(r18, r2, r5, r5); // umsubl x18, w2, w5, x5
+ __ maddw(r2, r5, r21, r9); // madd w2, w5, w21, w9
+ __ msubw(r24, r24, r4, r8); // msub w24, w24, w4, w8
+ __ madd(r11, r12, r15, r19); // madd x11, x12, x15, x19
+ __ msub(r29, r25, r12, r25); // msub x29, x25, x12, x25
+ __ smaddl(r17, r11, r12, r22); // smaddl x17, w11, w12, x22
+ __ smsubl(r28, r3, r20, r18); // smsubl x28, w3, w20, x18
+ __ umaddl(r7, r4, r28, r26); // umaddl x7, w4, w28, x26
+ __ umsubl(r22, r10, r17, r5); // umsubl x22, w10, w17, x5
// ThreeRegFloatOp
- __ fmuls(v8, v18, v13); // fmul s8, s18, s13
- __ fdivs(v2, v14, v28); // fdiv s2, s14, s28
- __ fadds(v15, v12, v28); // fadd s15, s12, s28
- __ fsubs(v0, v12, v1); // fsub s0, s12, s1
- __ fmuls(v15, v29, v4); // fmul s15, s29, s4
- __ fmuld(v12, v1, v23); // fmul d12, d1, d23
- __ fdivd(v27, v8, v18); // fdiv d27, d8, d18
- __ faddd(v23, v20, v11); // fadd d23, d20, d11
- __ fsubd(v8, v12, v18); // fsub d8, d12, d18
- __ fmuld(v26, v24, v23); // fmul d26, d24, d23
+ __ fmuls(v17, v3, v17); // fmul s17, s3, s17
+ __ fdivs(v11, v17, v6); // fdiv s11, s17, s6
+ __ fadds(v29, v7, v9); // fadd s29, s7, s9
+ __ fsubs(v7, v12, v19); // fsub s7, s12, s19
+ __ fmuls(v0, v23, v3); // fmul s0, s23, s3
+ __ fmuld(v26, v3, v21); // fmul d26, d3, d21
+ __ fdivd(v0, v19, v5); // fdiv d0, d19, d5
+ __ faddd(v0, v26, v9); // fadd d0, d26, d9
+ __ fsubd(v25, v21, v21); // fsub d25, d21, d21
+ __ fmuld(v16, v13, v19); // fmul d16, d13, d19
// FourRegFloatOp
- __ fmadds(v21, v23, v13, v25); // fmadd s21, s23, s13, s25
- __ fmsubs(v22, v10, v1, v14); // fmsub s22, s10, s1, s14
- __ fnmadds(v14, v20, v2, v30); // fnmadd s14, s20, s2, s30
- __ fnmadds(v7, v29, v22, v22); // fnmadd s7, s29, s22, s22
- __ fmaddd(v13, v5, v15, v5); // fmadd d13, d5, d15, d5
- __ fmsubd(v14, v12, v5, v10); // fmsub d14, d12, d5, d10
- __ fnmaddd(v10, v19, v0, v1); // fnmadd d10, d19, d0, d1
- __ fnmaddd(v20, v2, v2, v0); // fnmadd d20, d2, d2, d0
+ __ fmadds(v29, v18, v0, v16); // fmadd s29, s18, s0, s16
+ __ fmsubs(v23, v13, v29, v5); // fmsub s23, s13, s29, s5
+ __ fnmadds(v9, v7, v10, v14); // fnmadd s9, s7, s10, s14
+ __ fnmadds(v25, v28, v15, v23); // fnmadd s25, s28, s15, s23
+ __ fmaddd(v6, v13, v21, v17); // fmadd d6, d13, d21, d17
+ __ fmsubd(v3, v21, v2, v7); // fmsub d3, d21, d2, d7
+ __ fnmaddd(v10, v25, v5, v17); // fnmadd d10, d25, d5, d17
+ __ fnmaddd(v14, v14, v20, v18); // fnmadd d14, d14, d20, d18
// TwoRegFloatOp
- __ fmovs(v25, v9); // fmov s25, s9
- __ fabss(v20, v4); // fabs s20, s4
- __ fnegs(v3, v27); // fneg s3, s27
- __ fsqrts(v1, v2); // fsqrt s1, s2
- __ fcvts(v30, v0); // fcvt d30, s0
- __ fmovd(v12, v4); // fmov d12, d4
- __ fabsd(v1, v27); // fabs d1, d27
- __ fnegd(v8, v22); // fneg d8, d22
- __ fsqrtd(v11, v11); // fsqrt d11, d11
- __ fcvtd(v22, v28); // fcvt s22, d28
+ __ fmovs(v15, v2); // fmov s15, s2
+ __ fabss(v18, v7); // fabs s18, s7
+ __ fnegs(v3, v6); // fneg s3, s6
+ __ fsqrts(v12, v1); // fsqrt s12, s1
+ __ fcvts(v9, v0); // fcvt d9, s0
+ __ fmovd(v4, v5); // fmov d4, d5
+ __ fabsd(v3, v15); // fabs d3, d15
+ __ fnegd(v17, v25); // fneg d17, d25
+ __ fsqrtd(v12, v24); // fsqrt d12, d24
+ __ fcvtd(v21, v5); // fcvt s21, d5
// FloatConvertOp
- __ fcvtzsw(r28, v22); // fcvtzs w28, s22
- __ fcvtzs(r20, v27); // fcvtzs x20, s27
- __ fcvtzdw(r14, v0); // fcvtzs w14, d0
- __ fcvtzd(r26, v11); // fcvtzs x26, d11
- __ scvtfws(v28, r22); // scvtf s28, w22
- __ scvtfs(v16, r10); // scvtf s16, x10
- __ scvtfwd(v8, r21); // scvtf d8, w21
- __ scvtfd(v21, r28); // scvtf d21, x28
- __ fmovs(r24, v24); // fmov w24, s24
- __ fmovd(r8, v19); // fmov x8, d19
- __ fmovs(v8, r12); // fmov s8, w12
- __ fmovd(v6, r7); // fmov d6, x7
+ __ fcvtzsw(r4, v21); // fcvtzs w4, s21
+ __ fcvtzs(r27, v3); // fcvtzs x27, s3
+ __ fcvtzdw(r29, v8); // fcvtzs w29, d8
+ __ fcvtzd(r9, v21); // fcvtzs x9, d21
+ __ scvtfws(v20, r29); // scvtf s20, w29
+ __ scvtfs(v7, r8); // scvtf s7, x8
+ __ scvtfwd(v12, r21); // scvtf d12, w21
+ __ scvtfd(v16, r21); // scvtf d16, x21
+ __ fmovs(r18, v5); // fmov w18, s5
+ __ fmovd(r25, v8); // fmov x25, d8
+ __ fmovs(v18, r26); // fmov s18, w26
+ __ fmovd(v0, r11); // fmov d0, x11
// TwoRegFloatOp
- __ fcmps(v30, v16); // fcmp s30, s16
- __ fcmpd(v25, v11); // fcmp d25, d11
- __ fcmps(v11, 0.0); // fcmp s11, #0.0
- __ fcmpd(v11, 0.0); // fcmp d11, #0.0
+ __ fcmps(v16, v6); // fcmp s16, s6
+ __ fcmpd(v16, v29); // fcmp d16, d29
+ __ fcmps(v30, 0.0); // fcmp s30, #0.0
+ __ fcmpd(v9, 0.0); // fcmp d9, #0.0
// LoadStorePairOp
- __ stpw(r29, r12, Address(r17, 128)); // stp w29, w12, [x17, #128]
- __ ldpw(r22, r18, Address(r14, -96)); // ldp w22, w18, [x14, #-96]
- __ ldpsw(r11, r16, Address(r1, 64)); // ldpsw x11, x16, [x1, #64]
- __ stp(r0, r11, Address(r26, 112)); // stp x0, x11, [x26, #112]
- __ ldp(r7, r1, Address(r26, 16)); // ldp x7, x1, [x26, #16]
+ __ stpw(r27, r4, Address(r12, -16)); // stp w27, w4, [x12, #-16]
+ __ ldpw(r3, r9, Address(r10, 80)); // ldp w3, w9, [x10, #80]
+ __ ldpsw(r16, r3, Address(r3, 64)); // ldpsw x16, x3, [x3, #64]
+ __ stp(r10, r28, Address(r19, -192)); // stp x10, x28, [x19, #-192]
+ __ ldp(r19, r18, Address(r7, -192)); // ldp x19, x18, [x7, #-192]
// LoadStorePairOp
- __ stpw(r10, r7, Address(__ pre(r24, 0))); // stp w10, w7, [x24, #0]!
- __ ldpw(r7, r28, Address(__ pre(r24, -256))); // ldp w7, w28, [x24, #-256]!
- __ ldpsw(r25, r28, Address(__ pre(r21, -240))); // ldpsw x25, x28, [x21, #-240]!
- __ stp(r20, r18, Address(__ pre(r14, -16))); // stp x20, x18, [x14, #-16]!
- __ ldp(r8, r10, Address(__ pre(r13, 80))); // ldp x8, x10, [x13, #80]!
+ __ stpw(r10, r16, Address(__ pre(r30, 16))); // stp w10, w16, [x30, #16]!
+ __ ldpw(r2, r4, Address(__ pre(r18, -240))); // ldp w2, w4, [x18, #-240]!
+ __ ldpsw(r24, r19, Address(__ pre(r13, 48))); // ldpsw x24, x19, [x13, #48]!
+ __ stp(r17, r0, Address(__ pre(r24, 0))); // stp x17, x0, [x24, #0]!
+ __ ldp(r14, r26, Address(__ pre(r3, -192))); // ldp x14, x26, [x3, #-192]!
// LoadStorePairOp
- __ stpw(r26, r24, Address(__ post(r2, -128))); // stp w26, w24, [x2], #-128
- __ ldpw(r2, r25, Address(__ post(r21, -192))); // ldp w2, w25, [x21], #-192
- __ ldpsw(r17, r2, Address(__ post(r21, -144))); // ldpsw x17, x2, [x21], #-144
- __ stp(r12, r10, Address(__ post(r11, 96))); // stp x12, x10, [x11], #96
- __ ldp(r24, r6, Address(__ post(r17, -32))); // ldp x24, x6, [x17], #-32
+ __ stpw(r22, r1, Address(__ post(r0, 80))); // stp w22, w1, [x0], #80
+ __ ldpw(r18, r10, Address(__ post(r0, -16))); // ldp w18, w10, [x0], #-16
+ __ ldpsw(r24, r24, Address(__ post(r22, -16))); // ldpsw x24, x24, [x22], #-16
+ __ stp(r12, r12, Address(__ post(r4, 80))); // stp x12, x12, [x4], #80
+ __ ldp(r4, r9, Address(__ post(r19, -240))); // ldp x4, x9, [x19], #-240
// LoadStorePairOp
- __ stnpw(r3, r30, Address(r14, -224)); // stnp w3, w30, [x14, #-224]
- __ ldnpw(r15, r20, Address(r26, -144)); // ldnp w15, w20, [x26, #-144]
- __ stnp(r22, r25, Address(r12, -128)); // stnp x22, x25, [x12, #-128]
- __ ldnp(r27, r22, Address(r17, -176)); // ldnp x27, x22, [x17, #-176]
+ __ stnpw(r18, r26, Address(r6, -224)); // stnp w18, w26, [x6, #-224]
+ __ ldnpw(r21, r20, Address(r1, 112)); // ldnp w21, w20, [x1, #112]
+ __ stnp(r25, r29, Address(r20, -224)); // stnp x25, x29, [x20, #-224]
+ __ ldnp(r1, r5, Address(r23, 112)); // ldnp x1, x5, [x23, #112]
+
+// LdStSIMDOp
+ __ ld1(v4, __ T8B, Address(r20)); // ld1 {v4.8B}, [x20]
+ __ ld1(v24, v25, __ T16B, Address(__ post(r10, 32))); // ld1 {v24.16B, v25.16B}, [x10], 32
+ __ ld1(v24, v25, v26, __ T1D, Address(__ post(r6, r15))); // ld1 {v24.1D, v25.1D, v26.1D}, [x6], x15
+ __ ld1(v3, v4, v5, v6, __ T8H, Address(__ post(r4, 64))); // ld1 {v3.8H, v4.8H, v5.8H, v6.8H}, [x4], 64
+ __ ld1r(v2, __ T8B, Address(r6)); // ld1r {v2.8B}, [x6]
+ __ ld1r(v13, __ T4S, Address(__ post(r14, 4))); // ld1r {v13.4S}, [x14], 4
+ __ ld1r(v15, __ T1D, Address(__ post(r21, r24))); // ld1r {v15.1D}, [x21], x24
+ __ ld2(v9, v10, __ T2D, Address(r21)); // ld2 {v9.2D, v10.2D}, [x21]
+ __ ld2(v29, v30, __ T4H, Address(__ post(r21, 16))); // ld2 {v29.4H, v30.4H}, [x21], 16
+ __ ld2r(v8, v9, __ T16B, Address(r14)); // ld2r {v8.16B, v9.16B}, [x14]
+ __ ld2r(v7, v8, __ T2S, Address(__ post(r20, 8))); // ld2r {v7.2S, v8.2S}, [x20], 8
+ __ ld2r(v28, v29, __ T2D, Address(__ post(r3, r3))); // ld2r {v28.2D, v29.2D}, [x3], x3
+ __ ld3(v27, v28, v29, __ T4S, Address(__ post(r11, r29))); // ld3 {v27.4S, v28.4S, v29.4S}, [x11], x29
+ __ ld3(v16, v17, v18, __ T2S, Address(r10)); // ld3 {v16.2S, v17.2S, v18.2S}, [x10]
+ __ ld3r(v21, v22, v23, __ T8H, Address(r12)); // ld3r {v21.8H, v22.8H, v23.8H}, [x12]
+ __ ld3r(v4, v5, v6, __ T4S, Address(__ post(r29, 12))); // ld3r {v4.4S, v5.4S, v6.4S}, [x29], 12
+ __ ld3r(v24, v25, v26, __ T1D, Address(__ post(r9, r19))); // ld3r {v24.1D, v25.1D, v26.1D}, [x9], x19
+ __ ld4(v10, v11, v12, v13, __ T8H, Address(__ post(r3, 64))); // ld4 {v10.8H, v11.8H, v12.8H, v13.8H}, [x3], 64
+ __ ld4(v27, v28, v29, v30, __ T8B, Address(__ post(r28, r9))); // ld4 {v27.8B, v28.8B, v29.8B, v30.8B}, [x28], x9
+ __ ld4r(v21, v22, v23, v24, __ T8B, Address(r30)); // ld4r {v21.8B, v22.8B, v23.8B, v24.8B}, [x30]
+ __ ld4r(v23, v24, v25, v26, __ T4H, Address(__ post(r14, 8))); // ld4r {v23.4H, v24.4H, v25.4H, v26.4H}, [x14], 8
+ __ ld4r(v4, v5, v6, v7, __ T2S, Address(__ post(r13, r20))); // ld4r {v4.2S, v5.2S, v6.2S, v7.2S}, [x13], x20
+
+// SpecialCases
+ __ ccmn(zr, zr, 3u, Assembler::LE); // ccmn xzr, xzr, #3, LE
+ __ ccmnw(zr, zr, 5u, Assembler::EQ); // ccmn wzr, wzr, #5, EQ
+ __ ccmp(zr, 1, 4u, Assembler::NE); // ccmp xzr, 1, #4, NE
+ __ ccmpw(zr, 2, 2, Assembler::GT); // ccmp wzr, 2, #2, GT
+ __ extr(zr, zr, zr, 0); // extr xzr, xzr, xzr, 0
+ __ stlxp(r0, zr, zr, sp); // stlxp w0, xzr, xzr, [sp]
+ __ stlxpw(r2, zr, zr, r3); // stlxp w2, wzr, wzr, [x3]
+ __ stxp(r4, zr, zr, r5); // stxp w4, xzr, xzr, [x5]
+ __ stxpw(r6, zr, zr, sp); // stxp w6, wzr, wzr, [sp]
+ __ dup(v0, __ T16B, zr); // dup v0.16b, wzr
+ __ mov(v1, __ T1D, 0, zr); // mov v1.d[0], xzr
+ __ mov(v1, __ T2S, 1, zr); // mov v1.s[1], wzr
+ __ mov(v1, __ T4H, 2, zr); // mov v1.h[2], wzr
+ __ mov(v1, __ T8B, 3, zr); // mov v1.b[3], wzr
+ __ ld1(v31, v0, __ T2D, Address(__ post(r1, r0))); // ld1 {v31.2d, v0.2d}, [x1], x0
// FloatImmediateOp
- __ fmovd(v0, 2.0); // fmov d0, #2.0
- __ fmovd(v0, 2.125); // fmov d0, #2.125
- __ fmovd(v0, 4.0); // fmov d0, #4.0
- __ fmovd(v0, 4.25); // fmov d0, #4.25
- __ fmovd(v0, 8.0); // fmov d0, #8.0
- __ fmovd(v0, 8.5); // fmov d0, #8.5
- __ fmovd(v0, 16.0); // fmov d0, #16.0
- __ fmovd(v0, 17.0); // fmov d0, #17.0
- __ fmovd(v0, 0.125); // fmov d0, #0.125
- __ fmovd(v0, 0.1328125); // fmov d0, #0.1328125
- __ fmovd(v0, 0.25); // fmov d0, #0.25
- __ fmovd(v0, 0.265625); // fmov d0, #0.265625
- __ fmovd(v0, 0.5); // fmov d0, #0.5
- __ fmovd(v0, 0.53125); // fmov d0, #0.53125
- __ fmovd(v0, 1.0); // fmov d0, #1.0
- __ fmovd(v0, 1.0625); // fmov d0, #1.0625
- __ fmovd(v0, -2.0); // fmov d0, #-2.0
- __ fmovd(v0, -2.125); // fmov d0, #-2.125
- __ fmovd(v0, -4.0); // fmov d0, #-4.0
- __ fmovd(v0, -4.25); // fmov d0, #-4.25
- __ fmovd(v0, -8.0); // fmov d0, #-8.0
- __ fmovd(v0, -8.5); // fmov d0, #-8.5
- __ fmovd(v0, -16.0); // fmov d0, #-16.0
- __ fmovd(v0, -17.0); // fmov d0, #-17.0
- __ fmovd(v0, -0.125); // fmov d0, #-0.125
- __ fmovd(v0, -0.1328125); // fmov d0, #-0.1328125
- __ fmovd(v0, -0.25); // fmov d0, #-0.25
- __ fmovd(v0, -0.265625); // fmov d0, #-0.265625
- __ fmovd(v0, -0.5); // fmov d0, #-0.5
- __ fmovd(v0, -0.53125); // fmov d0, #-0.53125
- __ fmovd(v0, -1.0); // fmov d0, #-1.0
- __ fmovd(v0, -1.0625); // fmov d0, #-1.0625
+ __ fmovd(v0, 2.0); // fmov d0, #2.0
+ __ fmovd(v0, 2.125); // fmov d0, #2.125
+ __ fmovd(v0, 4.0); // fmov d0, #4.0
+ __ fmovd(v0, 4.25); // fmov d0, #4.25
+ __ fmovd(v0, 8.0); // fmov d0, #8.0
+ __ fmovd(v0, 8.5); // fmov d0, #8.5
+ __ fmovd(v0, 16.0); // fmov d0, #16.0
+ __ fmovd(v0, 17.0); // fmov d0, #17.0
+ __ fmovd(v0, 0.125); // fmov d0, #0.125
+ __ fmovd(v0, 0.1328125); // fmov d0, #0.1328125
+ __ fmovd(v0, 0.25); // fmov d0, #0.25
+ __ fmovd(v0, 0.265625); // fmov d0, #0.265625
+ __ fmovd(v0, 0.5); // fmov d0, #0.5
+ __ fmovd(v0, 0.53125); // fmov d0, #0.53125
+ __ fmovd(v0, 1.0); // fmov d0, #1.0
+ __ fmovd(v0, 1.0625); // fmov d0, #1.0625
+ __ fmovd(v0, -2.0); // fmov d0, #-2.0
+ __ fmovd(v0, -2.125); // fmov d0, #-2.125
+ __ fmovd(v0, -4.0); // fmov d0, #-4.0
+ __ fmovd(v0, -4.25); // fmov d0, #-4.25
+ __ fmovd(v0, -8.0); // fmov d0, #-8.0
+ __ fmovd(v0, -8.5); // fmov d0, #-8.5
+ __ fmovd(v0, -16.0); // fmov d0, #-16.0
+ __ fmovd(v0, -17.0); // fmov d0, #-17.0
+ __ fmovd(v0, -0.125); // fmov d0, #-0.125
+ __ fmovd(v0, -0.1328125); // fmov d0, #-0.1328125
+ __ fmovd(v0, -0.25); // fmov d0, #-0.25
+ __ fmovd(v0, -0.265625); // fmov d0, #-0.265625
+ __ fmovd(v0, -0.5); // fmov d0, #-0.5
+ __ fmovd(v0, -0.53125); // fmov d0, #-0.53125
+ __ fmovd(v0, -1.0); // fmov d0, #-1.0
+ __ fmovd(v0, -1.0625); // fmov d0, #-1.0625
+
+// LSEOp
+ __ swp(Assembler::xword, r21, r5, r24); // swp x21, x5, [x24]
+ __ ldadd(Assembler::xword, r13, r13, r15); // ldadd x13, x13, [x15]
+ __ ldbic(Assembler::xword, r22, r19, r26); // ldclr x22, x19, [x26]
+ __ ldeor(Assembler::xword, r25, r10, r26); // ldeor x25, x10, [x26]
+ __ ldorr(Assembler::xword, r5, r27, r15); // ldset x5, x27, [x15]
+ __ ldsmin(Assembler::xword, r19, r5, r11); // ldsmin x19, x5, [x11]
+ __ ldsmax(Assembler::xword, r26, r0, r4); // ldsmax x26, x0, [x4]
+ __ ldumin(Assembler::xword, r22, r23, r30); // ldumin x22, x23, [x30]
+ __ ldumax(Assembler::xword, r18, r28, r8); // ldumax x18, x28, [x8]
+
+// LSEOp
+ __ swpa(Assembler::xword, r13, r29, r27); // swpa x13, x29, [x27]
+ __ ldadda(Assembler::xword, r11, r5, r13); // ldadda x11, x5, [x13]
+ __ ldbica(Assembler::xword, r1, r24, r21); // ldclra x1, x24, [x21]
+ __ ldeora(Assembler::xword, r27, r17, r24); // ldeora x27, x17, [x24]
+ __ ldorra(Assembler::xword, r18, r30, r5); // ldseta x18, x30, [x5]
+ __ ldsmina(Assembler::xword, r7, r22, r25); // ldsmina x7, x22, [x25]
+ __ ldsmaxa(Assembler::xword, r4, r26, r19); // ldsmaxa x4, x26, [x19]
+ __ ldumina(Assembler::xword, r6, r30, r3); // ldumina x6, x30, [x3]
+ __ ldumaxa(Assembler::xword, r24, r23, r5); // ldumaxa x24, x23, [x5]
+
+// LSEOp
+ __ swpal(Assembler::xword, r24, r18, r28); // swpal x24, x18, [x28]
+ __ ldaddal(Assembler::xword, r19, zr, r7); // ldaddal x19, xzr, [x7]
+ __ ldbical(Assembler::xword, r13, r6, r28); // ldclral x13, x6, [x28]
+ __ ldeoral(Assembler::xword, r8, r15, r21); // ldeoral x8, x15, [x21]
+ __ ldorral(Assembler::xword, r2, r13, r1); // ldsetal x2, x13, [x1]
+ __ ldsminal(Assembler::xword, r17, r29, r25); // ldsminal x17, x29, [x25]
+ __ ldsmaxal(Assembler::xword, r25, r18, r14); // ldsmaxal x25, x18, [x14]
+ __ lduminal(Assembler::xword, zr, r6, r27); // lduminal xzr, x6, [x27]
+ __ ldumaxal(Assembler::xword, r16, r5, r15); // ldumaxal x16, x5, [x15]
+
+// LSEOp
+ __ swpl(Assembler::xword, r11, r18, r3); // swpl x11, x18, [x3]
+ __ ldaddl(Assembler::xword, r26, r20, r2); // ldaddl x26, x20, [x2]
+ __ ldbicl(Assembler::xword, r11, r4, r11); // ldclrl x11, x4, [x11]
+ __ ldeorl(Assembler::xword, r30, r19, r23); // ldeorl x30, x19, [x23]
+ __ ldorrl(Assembler::xword, r3, r15, r14); // ldsetl x3, x15, [x14]
+ __ ldsminl(Assembler::xword, r30, r22, r20); // ldsminl x30, x22, [x20]
+ __ ldsmaxl(Assembler::xword, r7, r5, r24); // ldsmaxl x7, x5, [x24]
+ __ lduminl(Assembler::xword, r23, r16, r15); // lduminl x23, x16, [x15]
+ __ ldumaxl(Assembler::xword, r11, r19, r0); // ldumaxl x11, x19, [x0]
+
+// LSEOp
+ __ swp(Assembler::word, r28, r28, r1); // swp w28, w28, [x1]
+ __ ldadd(Assembler::word, r11, r21, r12); // ldadd w11, w21, [x12]
+ __ ldbic(Assembler::word, r29, r0, r18); // ldclr w29, w0, [x18]
+ __ ldeor(Assembler::word, r5, r0, r25); // ldeor w5, w0, [x25]
+ __ ldorr(Assembler::word, r14, r0, r26); // ldset w14, w0, [x26]
+ __ ldsmin(Assembler::word, r28, r18, r29); // ldsmin w28, w18, [x29]
+ __ ldsmax(Assembler::word, r15, r1, r29); // ldsmax w15, w1, [x29]
+ __ ldumin(Assembler::word, r8, r26, r28); // ldumin w8, w26, [x28]
+ __ ldumax(Assembler::word, r17, r14, r4); // ldumax w17, w14, [x4]
+
+// LSEOp
+ __ swpa(Assembler::word, r24, r25, r1); // swpa w24, w25, [x1]
+ __ ldadda(Assembler::word, r10, r17, r17); // ldadda w10, w17, [x17]
+ __ ldbica(Assembler::word, r29, r20, r21); // ldclra w29, w20, [x21]
+ __ ldeora(Assembler::word, r29, r9, r12); // ldeora w29, w9, [x12]
+ __ ldorra(Assembler::word, r11, r6, r5); // ldseta w11, w6, [x5]
+ __ ldsmina(Assembler::word, r21, r7, r21); // ldsmina w21, w7, [x21]
+ __ ldsmaxa(Assembler::word, r10, r23, r12); // ldsmaxa w10, w23, [x12]
+ __ ldumina(Assembler::word, r21, r5, r10); // ldumina w21, w5, [x10]
+ __ ldumaxa(Assembler::word, r30, r20, r18); // ldumaxa w30, w20, [x18]
+
+// LSEOp
+ __ swpal(Assembler::word, r13, r23, r5); // swpal w13, w23, [x5]
+ __ ldaddal(Assembler::word, r15, r24, r5); // ldaddal w15, w24, [x5]
+ __ ldbical(Assembler::word, r9, r10, r25); // ldclral w9, w10, [x25]
+ __ ldeoral(Assembler::word, r20, r17, r17); // ldeoral w20, w17, [x17]
+ __ ldorral(Assembler::word, r12, r18, r30); // ldsetal w12, w18, [x30]
+ __ ldsminal(Assembler::word, r3, r3, r25); // ldsminal w3, w3, [x25]
+ __ ldsmaxal(Assembler::word, r26, r25, r10); // ldsmaxal w26, w25, [x10]
+ __ lduminal(Assembler::word, r2, r11, sp); // lduminal w2, w11, [sp]
+ __ ldumaxal(Assembler::word, r7, r2, r5); // ldumaxal w7, w2, [x5]
+
+// LSEOp
+ __ swpl(Assembler::word, r0, r7, r20); // swpl w0, w7, [x20]
+ __ ldaddl(Assembler::word, r5, zr, r2); // ldaddl w5, wzr, [x2]
+ __ ldbicl(Assembler::word, r27, r25, r27); // ldclrl w27, w25, [x27]
+ __ ldeorl(Assembler::word, r30, r24, r26); // ldeorl w30, w24, [x26]
+ __ ldorrl(Assembler::word, r15, r2, r22); // ldsetl w15, w2, [x22]
+ __ ldsminl(Assembler::word, r0, r3, sp); // ldsminl w0, w3, [sp]
+ __ ldsmaxl(Assembler::word, r15, r20, r10); // ldsmaxl w15, w20, [x10]
+ __ lduminl(Assembler::word, r22, r21, r14); // lduminl w22, w21, [x14]
+ __ ldumaxl(Assembler::word, r6, r30, r2); // ldumaxl w6, w30, [x2]
__ bind(forth);
@@ -638,542 +769,681 @@ aarch64ops.o: file format elf64-littleaarch64
Disassembly of section .text:
0000000000000000 :
- 0: 8b0772d3 add x19, x22, x7, lsl #28
- 4: cb4a3570 sub x16, x11, x10, lsr #13
- 8: ab9c09bb adds x27, x13, x28, asr #2
- c: eb9aa794 subs x20, x28, x26, asr #41
- 10: 0b934e68 add w8, w19, w19, asr #19
- 14: 4b0a3924 sub w4, w9, w10, lsl #14
- 18: 2b1e3568 adds w8, w11, w30, lsl #13
- 1c: 6b132720 subs w0, w25, w19, lsl #9
- 20: 8a154c14 and x20, x0, x21, lsl #19
- 24: aa1445d5 orr x21, x14, x20, lsl #17
- 28: ca01cf99 eor x25, x28, x1, lsl #51
- 2c: ea8b3f6a ands x10, x27, x11, asr #15
- 30: 0a8c5cb9 and w25, w5, w12, asr #23
- 34: 2a4a11d2 orr w18, w14, w10, lsr #4
- 38: 4a855aa4 eor w4, w21, w5, asr #22
- 3c: 6a857415 ands w21, w0, w5, asr #29
- 40: 8aa697da bic x26, x30, x6, asr #37
- 44: aa6d7423 orn x3, x1, x13, lsr #29
- 48: ca29bf80 eon x0, x28, x9, lsl #47
- 4c: ea3cb8bd bics x29, x5, x28, lsl #46
- 50: 0a675249 bic w9, w18, w7, lsr #20
- 54: 2ab961ba orn w26, w13, w25, asr #24
- 58: 4a331899 eon w25, w4, w19, lsl #6
- 5c: 6a646345 bics w5, w26, w4, lsr #24
- 60: 11055267 add w7, w19, #0x154
- 64: 31064408 adds w8, w0, #0x191
- 68: 51028e9d sub w29, w20, #0xa3
- 6c: 710bdee8 subs w8, w23, #0x2f7
- 70: 91082d81 add x1, x12, #0x20b
- 74: b106a962 adds x2, x11, #0x1aa
- 78: d10b33ae sub x14, x29, #0x2cc
- 7c: f10918ab subs x11, x5, #0x246
- 80: 121102d7 and w23, w22, #0x8000
- 84: 3204cd44 orr w4, w10, #0xf0f0f0f0
- 88: 5204cf00 eor w0, w24, #0xf0f0f0f0
- 8c: 72099fb3 ands w19, w29, #0x7f807f80
- 90: 92729545 and x5, x10, #0xfffffffffc000
- 94: b20e37cc orr x12, x30, #0xfffc0000fffc0000
- 98: d27c34be eor x30, x5, #0x3fff0
- 9c: f27e4efa ands x26, x23, #0x3ffffc
- a0: 14000000 b a0
- a4: 17ffffd7 b 0
- a8: 1400017f b 6a4
- ac: 94000000 bl ac
- b0: 97ffffd4 bl 0
- b4: 9400017c bl 6a4
- b8: 3400000c cbz w12, b8
- bc: 34fffa2c cbz w12, 0
- c0: 34002f2c cbz w12, 6a4
- c4: 35000014 cbnz w20, c4
- c8: 35fff9d4 cbnz w20, 0
- cc: 35002ed4 cbnz w20, 6a4
- d0: b400000c cbz x12, d0
- d4: b4fff96c cbz x12, 0
- d8: b4002e6c cbz x12, 6a4
- dc: b5000018 cbnz x24, dc
- e0: b5fff918 cbnz x24, 0
- e4: b5002e18 cbnz x24, 6a4
- e8: 10000006 adr x6, e8
- ec: 10fff8a6 adr x6, 0
- f0: 10002da6 adr x6, 6a4
- f4: 90000015 adrp x21, 0
- f8: 36080001 tbz w1, #1, f8
- fc: 360ff821 tbz w1, #1, 0
- 100: 36082d21 tbz w1, #1, 6a4
- 104: 37480008 tbnz w8, #9, 104
- 108: 374ff7c8 tbnz w8, #9, 0
- 10c: 37482cc8 tbnz w8, #9, 6a4
- 110: 128b50ec movn w12, #0x5a87
- 114: 52a9ff8b movz w11, #0x4ffc, lsl #16
- 118: 7281d095 movk w21, #0xe84
- 11c: 92edfebd movn x29, #0x6ff5, lsl #48
- 120: d28361e3 movz x3, #0x1b0f
- 124: f2a4cc96 movk x22, #0x2664, lsl #16
- 128: 9346590c sbfx x12, x8, #6, #17
- 12c: 33194f33 bfi w19, w25, #7, #20
- 130: 531d3d89 ubfiz w9, w12, #3, #16
- 134: 9350433c sbfx x28, x25, #16, #1
- 138: b34464ac bfxil x12, x5, #4, #22
- 13c: d3462140 ubfx x0, x10, #6, #3
- 140: 139a61a4 extr w4, w13, w26, #24
- 144: 93d87fd7 extr x23, x30, x24, #31
- 148: 54000000 b.eq 148
- 14c: 54fff5a0 b.eq 0
- 150: 54002aa0 b.eq 6a4
- 154: 54000001 b.ne 154
- 158: 54fff541 b.ne 0
- 15c: 54002a41 b.ne 6a4
- 160: 54000002 b.cs 160
- 164: 54fff4e2 b.cs 0
- 168: 540029e2 b.cs 6a4
- 16c: 54000002 b.cs 16c
- 170: 54fff482 b.cs 0
- 174: 54002982 b.cs 6a4
- 178: 54000003 b.cc 178
- 17c: 54fff423 b.cc 0
- 180: 54002923 b.cc 6a4
- 184: 54000003 b.cc 184
- 188: 54fff3c3 b.cc 0
- 18c: 540028c3 b.cc 6a4
- 190: 54000004 b.mi 190
- 194: 54fff364 b.mi 0
- 198: 54002864 b.mi 6a4
- 19c: 54000005 b.pl 19c
- 1a0: 54fff305 b.pl 0
- 1a4: 54002805 b.pl 6a4
- 1a8: 54000006 b.vs 1a8
- 1ac: 54fff2a6 b.vs 0
- 1b0: 540027a6 b.vs 6a4
- 1b4: 54000007 b.vc 1b4
- 1b8: 54fff247 b.vc 0
- 1bc: 54002747 b.vc 6a4
- 1c0: 54000008 b.hi 1c0
- 1c4: 54fff1e8 b.hi 0
- 1c8: 540026e8 b.hi 6a4
- 1cc: 54000009 b.ls 1cc
- 1d0: 54fff189 b.ls 0
- 1d4: 54002689 b.ls 6a4
- 1d8: 5400000a b.ge 1d8
- 1dc: 54fff12a b.ge 0
- 1e0: 5400262a b.ge 6a4
- 1e4: 5400000b b.lt 1e4
- 1e8: 54fff0cb b.lt 0
- 1ec: 540025cb b.lt 6a4
- 1f0: 5400000c b.gt 1f0
- 1f4: 54fff06c b.gt 0
- 1f8: 5400256c b.gt 6a4
- 1fc: 5400000d b.le 1fc
- 200: 54fff00d b.le 0
- 204: 5400250d b.le 6a4
- 208: 5400000e b.al 208
- 20c: 54ffefae b.al 0
- 210: 540024ae b.al 6a4
- 214: 5400000f b.nv 214
- 218: 54ffef4f b.nv 0
- 21c: 5400244f b.nv 6a4
- 220: d4063721 svc #0x31b9
- 224: d4035082 hvc #0x1a84
- 228: d400bfe3 smc #0x5ff
- 22c: d4282fc0 brk #0x417e
- 230: d444c320 hlt #0x2619
- 234: d503201f nop
- 238: d69f03e0 eret
- 23c: d6bf03e0 drps
- 240: d5033fdf isb
- 244: d5033f9f dsb sy
- 248: d5033abf dmb ishst
- 24c: d61f0040 br x2
- 250: d63f00a0 blr x5
- 254: c8147c55 stxr w20, x21, [x2]
- 258: c805fcfd stlxr w5, x29, [x7]
- 25c: c85f7e05 ldxr x5, [x16]
- 260: c85fffbb ldaxr x27, [x29]
- 264: c89fffa0 stlr x0, [x29]
- 268: c8dfff95 ldar x21, [x28]
- 26c: 88157cf8 stxr w21, w24, [x7]
- 270: 8815ff9a stlxr w21, w26, [x28]
- 274: 885f7cd5 ldxr w21, [x6]
- 278: 885fffcf ldaxr w15, [x30]
- 27c: 889ffc73 stlr w19, [x3]
- 280: 88dffc56 ldar w22, [x2]
- 284: 48127c0f stxrh w18, w15, [x0]
- 288: 480bff85 stlxrh w11, w5, [x28]
- 28c: 485f7cdd ldxrh w29, [x6]
- 290: 485ffcf2 ldaxrh w18, [x7]
- 294: 489fff99 stlrh w25, [x28]
- 298: 48dffe62 ldarh w2, [x19]
- 29c: 080a7c3e stxrb w10, w30, [x1]
- 2a0: 0814fed5 stlxrb w20, w21, [x22]
- 2a4: 085f7c59 ldxrb w25, [x2]
- 2a8: 085ffcb8 ldaxrb w24, [x5]
- 2ac: 089ffc70 stlrb w16, [x3]
- 2b0: 08dfffb6 ldarb w22, [x29]
- 2b4: c87f0a68 ldxp x8, x2, [x19]
- 2b8: c87fcdc7 ldaxp x7, x19, [x14]
- 2bc: c82870bb stxp w8, x27, x28, [x5]
- 2c0: c825b8c8 stlxp w5, x8, x14, [x6]
- 2c4: 887f12d9 ldxp w25, w4, [x22]
- 2c8: 887fb9ed ldaxp w13, w14, [x15]
- 2cc: 8834215a stxp w20, w26, w8, [x10]
- 2d0: 8837ca52 stlxp w23, w18, w18, [x18]
- 2d4: f806317e str x30, [x11,#99]
- 2d8: b81b3337 str w23, [x25,#-77]
- 2dc: 39000dc2 strb w2, [x14,#3]
- 2e0: 78005149 strh w9, [x10,#5]
- 2e4: f84391f4 ldr x20, [x15,#57]
- 2e8: b85b220c ldr w12, [x16,#-78]
- 2ec: 385fd356 ldrb w22, [x26,#-3]
- 2f0: 785d127e ldrh w30, [x19,#-47]
- 2f4: 389f4149 ldrsb x9, [x10,#-12]
- 2f8: 79801e3c ldrsh x28, [x17,#14]
- 2fc: 79c014a3 ldrsh w3, [x5,#10]
- 300: b89a5231 ldrsw x17, [x17,#-91]
- 304: fc5ef282 ldr d2, [x20,#-17]
- 308: bc5f60f6 ldr s22, [x7,#-10]
- 30c: fc12125e str d30, [x18,#-223]
- 310: bc0152cd str s13, [x22,#21]
- 314: f8190e49 str x9, [x18,#-112]!
- 318: b800befd str w29, [x23,#11]!
- 31c: 381ffd92 strb w18, [x12,#-1]!
- 320: 781e9e90 strh w16, [x20,#-23]!
- 324: f8409fa3 ldr x3, [x29,#9]!
- 328: b8413c79 ldr w25, [x3,#19]!
- 32c: 385fffa1 ldrb w1, [x29,#-1]!
- 330: 785c7fa8 ldrh w8, [x29,#-57]!
- 334: 389f3dc5 ldrsb x5, [x14,#-13]!
- 338: 78801f6a ldrsh x10, [x27,#1]!
- 33c: 78c19d4b ldrsh w11, [x10,#25]!
- 340: b89a4ec4 ldrsw x4, [x22,#-92]!
- 344: fc408eeb ldr d11, [x23,#8]!
- 348: bc436e79 ldr s25, [x19,#54]!
- 34c: fc152ce1 str d1, [x7,#-174]!
- 350: bc036f28 str s8, [x25,#54]!
- 354: f8025565 str x5, [x11],#37
- 358: b80135f8 str w24, [x15],#19
- 35c: 381ff74f strb w15, [x26],#-1
- 360: 781fa652 strh w18, [x18],#-6
- 364: f851a447 ldr x7, [x2],#-230
- 368: b85e557b ldr w27, [x11],#-27
- 36c: 385e7472 ldrb w18, [x3],#-25
- 370: 785e070a ldrh w10, [x24],#-32
- 374: 38804556 ldrsb x22, [x10],#4
- 378: 78819591 ldrsh x17, [x12],#25
- 37c: 78dc24e8 ldrsh w8, [x7],#-62
- 380: b89cd6d7 ldrsw x23, [x22],#-51
- 384: fc430738 ldr d24, [x25],#48
- 388: bc5f6595 ldr s21, [x12],#-10
- 38c: fc1225b2 str d18, [x13],#-222
- 390: bc1d7430 str s16, [x1],#-41
- 394: f82fcac2 str x2, [x22,w15,sxtw]
- 398: b83d6a02 str w2, [x16,x29]
- 39c: 382e5a54 strb w20, [x18,w14,uxtw #0]
- 3a0: 7834fa66 strh w6, [x19,x20,sxtx #1]
- 3a4: f86ecbae ldr x14, [x29,w14,sxtw]
- 3a8: b86cda90 ldr w16, [x20,w12,sxtw #2]
- 3ac: 3860d989 ldrb w9, [x12,w0,sxtw #0]
- 3b0: 78637a2c ldrh w12, [x17,x3,lsl #1]
- 3b4: 38a3fa22 ldrsb x2, [x17,x3,sxtx #0]
- 3b8: 78b15827 ldrsh x7, [x1,w17,uxtw #1]
- 3bc: 78f2d9f9 ldrsh w25, [x15,w18,sxtw #1]
- 3c0: b8ac6ab7 ldrsw x23, [x21,x12]
- 3c4: fc6879a5 ldr d5, [x13,x8,lsl #3]
- 3c8: bc767943 ldr s3, [x10,x22,lsl #2]
- 3cc: fc3bc84e str d14, [x2,w27,sxtw]
- 3d0: bc3968d4 str s20, [x6,x25]
- 3d4: f91fc0fe str x30, [x7,#16256]
- 3d8: b91da50f str w15, [x8,#7588]
- 3dc: 391d280b strb w11, [x0,#1866]
- 3e0: 791d2e23 strh w3, [x17,#3734]
- 3e4: f95bc8e2 ldr x2, [x7,#14224]
- 3e8: b95ce525 ldr w5, [x9,#7396]
- 3ec: 395ae53c ldrb w28, [x9,#1721]
- 3f0: 795c9282 ldrh w2, [x20,#3656]
- 3f4: 399d7dd6 ldrsb x22, [x14,#1887]
- 3f8: 799fe008 ldrsh x8, [x0,#4080]
- 3fc: 79de9bc0 ldrsh w0, [x30,#3916]
- 400: b99aae78 ldrsw x24, [x19,#6828]
- 404: fd597598 ldr d24, [x12,#13032]
- 408: bd5d1d08 ldr s8, [x8,#7452]
- 40c: fd1f3dea str d10, [x15,#15992]
- 410: bd1a227a str s26, [x19,#6688]
- 414: 5800148a ldr x10, 6a4
- 418: 18000003 ldr w3, 418
- 41c: f88092e0 prfm pldl1keep, [x23,#9]
- 420: d8ffdf00 prfm pldl1keep, 0
- 424: f8a84860 prfm pldl1keep, [x3,w8,uxtw]
- 428: f99d7560 prfm pldl1keep, [x11,#15080]
- 42c: 1a1c012d adc w13, w9, w28
- 430: 3a1c027b adcs w27, w19, w28
- 434: 5a060253 sbc w19, w18, w6
- 438: 7a03028e sbcs w14, w20, w3
- 43c: 9a0801d0 adc x16, x14, x8
- 440: ba0803a0 adcs x0, x29, x8
- 444: da140308 sbc x8, x24, x20
- 448: fa00038c sbcs x12, x28, x0
- 44c: 0b3010d7 add w23, w6, w16, uxtb #4
- 450: 2b37ab39 adds w25, w25, w23, sxth #2
- 454: cb2466da sub x26, x22, x4, uxtx #1
- 458: 6b33efb1 subs w17, w29, w19, sxtx #3
- 45c: 8b350fcb add x11, x30, w21, uxtb #3
- 460: ab208a70 adds x16, x19, w0, sxtb #2
- 464: cb39e52b sub x11, x9, x25, sxtx #1
- 468: eb2c9291 subs x17, x20, w12, sxtb #4
- 46c: 3a4bd1a3 ccmn w13, w11, #0x3, le
- 470: 7a4c81a2 ccmp w13, w12, #0x2, hi
- 474: ba42106c ccmn x3, x2, #0xc, ne
- 478: fa5560e3 ccmp x7, x21, #0x3, vs
- 47c: 3a4e3844 ccmn w2, #0xe, #0x4, cc
- 480: 7a515a26 ccmp w17, #0x11, #0x6, pl
- 484: ba4c2940 ccmn x10, #0xc, #0x0, cs
- 488: fa52aaae ccmp x21, #0x12, #0xe, ge
- 48c: 1a8cc1b5 csel w21, w13, w12, gt
- 490: 1a8f976a csinc w10, w27, w15, ls
- 494: 5a8981a0 csinv w0, w13, w9, hi
- 498: 5a9a6492 csneg w18, w4, w26, vs
- 49c: 9a8793ac csel x12, x29, x7, ls
- 4a0: 9a9474e6 csinc x6, x7, x20, vc
- 4a4: da83d2b6 csinv x22, x21, x3, le
- 4a8: da9b9593 csneg x19, x12, x27, ls
- 4ac: 5ac00200 rbit w0, w16
- 4b0: 5ac006f1 rev16 w17, w23
- 4b4: 5ac009d1 rev w17, w14
- 4b8: 5ac013d8 clz w24, w30
- 4bc: 5ac016d8 cls w24, w22
- 4c0: dac00223 rbit x3, x17
- 4c4: dac005ac rev16 x12, x13
- 4c8: dac00ac9 rev32 x9, x22
- 4cc: dac00c00 rev x0, x0
- 4d0: dac01205 clz x5, x16
- 4d4: dac016d9 cls x25, x22
- 4d8: 1ac0089d udiv w29, w4, w0
- 4dc: 1add0fa0 sdiv w0, w29, w29
- 4e0: 1ad52225 lsl w5, w17, w21
- 4e4: 1ad22529 lsr w9, w9, w18
- 4e8: 1ac82b61 asr w1, w27, w8
- 4ec: 1acd2e92 ror w18, w20, w13
- 4f0: 9acc0b28 udiv x8, x25, x12
- 4f4: 9adc0ca7 sdiv x7, x5, x28
- 4f8: 9adb2225 lsl x5, x17, x27
- 4fc: 9ad42757 lsr x23, x26, x20
- 500: 9adc291c asr x28, x8, x28
- 504: 9ac42fa3 ror x3, x29, x4
- 508: 1b1a55d1 madd w17, w14, w26, w21
- 50c: 1b0bafc1 msub w1, w30, w11, w11
- 510: 9b067221 madd x1, x17, x6, x28
- 514: 9b1ea0de msub x30, x6, x30, x8
- 518: 9b2e20d5 smaddl x21, w6, w14, x8
- 51c: 9b38cd4a smsubl x10, w10, w24, x19
- 520: 9bae6254 umaddl x20, w18, w14, x24
- 524: 9ba59452 umsubl x18, w2, w5, x5
- 528: 1e2d0a48 fmul s8, s18, s13
- 52c: 1e3c19c2 fdiv s2, s14, s28
- 530: 1e3c298f fadd s15, s12, s28
- 534: 1e213980 fsub s0, s12, s1
- 538: 1e240baf fmul s15, s29, s4
- 53c: 1e77082c fmul d12, d1, d23
- 540: 1e72191b fdiv d27, d8, d18
- 544: 1e6b2a97 fadd d23, d20, d11
- 548: 1e723988 fsub d8, d12, d18
- 54c: 1e770b1a fmul d26, d24, d23
- 550: 1f0d66f5 fmadd s21, s23, s13, s25
- 554: 1f01b956 fmsub s22, s10, s1, s14
- 558: 1f227a8e fnmadd s14, s20, s2, s30
- 55c: 1f365ba7 fnmadd s7, s29, s22, s22
- 560: 1f4f14ad fmadd d13, d5, d15, d5
- 564: 1f45a98e fmsub d14, d12, d5, d10
- 568: 1f60066a fnmadd d10, d19, d0, d1
- 56c: 1f620054 fnmadd d20, d2, d2, d0
- 570: 1e204139 fmov s25, s9
- 574: 1e20c094 fabs s20, s4
- 578: 1e214363 fneg s3, s27
- 57c: 1e21c041 fsqrt s1, s2
- 580: 1e22c01e fcvt d30, s0
- 584: 1e60408c fmov d12, d4
- 588: 1e60c361 fabs d1, d27
- 58c: 1e6142c8 fneg d8, d22
- 590: 1e61c16b fsqrt d11, d11
- 594: 1e624396 fcvt s22, d28
- 598: 1e3802dc fcvtzs w28, s22
- 59c: 9e380374 fcvtzs x20, s27
- 5a0: 1e78000e fcvtzs w14, d0
- 5a4: 9e78017a fcvtzs x26, d11
- 5a8: 1e2202dc scvtf s28, w22
- 5ac: 9e220150 scvtf s16, x10
- 5b0: 1e6202a8 scvtf d8, w21
- 5b4: 9e620395 scvtf d21, x28
- 5b8: 1e260318 fmov w24, s24
- 5bc: 9e660268 fmov x8, d19
- 5c0: 1e270188 fmov s8, w12
- 5c4: 9e6700e6 fmov d6, x7
- 5c8: 1e3023c0 fcmp s30, s16
- 5cc: 1e6b2320 fcmp d25, d11
- 5d0: 1e202168 fcmp s11, #0.0
- 5d4: 1e602168 fcmp d11, #0.0
- 5d8: 2910323d stp w29, w12, [x17,#128]
- 5dc: 297449d6 ldp w22, w18, [x14,#-96]
- 5e0: 6948402b ldpsw x11, x16, [x1,#64]
- 5e4: a9072f40 stp x0, x11, [x26,#112]
- 5e8: a9410747 ldp x7, x1, [x26,#16]
- 5ec: 29801f0a stp w10, w7, [x24,#0]!
- 5f0: 29e07307 ldp w7, w28, [x24,#-256]!
- 5f4: 69e272b9 ldpsw x25, x28, [x21,#-240]!
- 5f8: a9bf49d4 stp x20, x18, [x14,#-16]!
- 5fc: a9c529a8 ldp x8, x10, [x13,#80]!
- 600: 28b0605a stp w26, w24, [x2],#-128
- 604: 28e866a2 ldp w2, w25, [x21],#-192
- 608: 68ee0ab1 ldpsw x17, x2, [x21],#-144
- 60c: a886296c stp x12, x10, [x11],#96
- 610: a8fe1a38 ldp x24, x6, [x17],#-32
- 614: 282479c3 stnp w3, w30, [x14,#-224]
- 618: 286e534f ldnp w15, w20, [x26,#-144]
- 61c: a8386596 stnp x22, x25, [x12,#-128]
- 620: a8755a3b ldnp x27, x22, [x17,#-176]
- 624: 1e601000 fmov d0, #2.000000000000000000e+00
- 628: 1e603000 fmov d0, #2.125000000000000000e+00
- 62c: 1e621000 fmov d0, #4.000000000000000000e+00
- 630: 1e623000 fmov d0, #4.250000000000000000e+00
- 634: 1e641000 fmov d0, #8.000000000000000000e+00
- 638: 1e643000 fmov d0, #8.500000000000000000e+00
- 63c: 1e661000 fmov d0, #1.600000000000000000e+01
- 640: 1e663000 fmov d0, #1.700000000000000000e+01
- 644: 1e681000 fmov d0, #1.250000000000000000e-01
- 648: 1e683000 fmov d0, #1.328125000000000000e-01
- 64c: 1e6a1000 fmov d0, #2.500000000000000000e-01
- 650: 1e6a3000 fmov d0, #2.656250000000000000e-01
- 654: 1e6c1000 fmov d0, #5.000000000000000000e-01
- 658: 1e6c3000 fmov d0, #5.312500000000000000e-01
- 65c: 1e6e1000 fmov d0, #1.000000000000000000e+00
- 660: 1e6e3000 fmov d0, #1.062500000000000000e+00
- 664: 1e701000 fmov d0, #-2.000000000000000000e+00
- 668: 1e703000 fmov d0, #-2.125000000000000000e+00
- 66c: 1e721000 fmov d0, #-4.000000000000000000e+00
- 670: 1e723000 fmov d0, #-4.250000000000000000e+00
- 674: 1e741000 fmov d0, #-8.000000000000000000e+00
- 678: 1e743000 fmov d0, #-8.500000000000000000e+00
- 67c: 1e761000 fmov d0, #-1.600000000000000000e+01
- 680: 1e763000 fmov d0, #-1.700000000000000000e+01
- 684: 1e781000 fmov d0, #-1.250000000000000000e-01
- 688: 1e783000 fmov d0, #-1.328125000000000000e-01
- 68c: 1e7a1000 fmov d0, #-2.500000000000000000e-01
- 690: 1e7a3000 fmov d0, #-2.656250000000000000e-01
- 694: 1e7c1000 fmov d0, #-5.000000000000000000e-01
- 698: 1e7c3000 fmov d0, #-5.312500000000000000e-01
- 69c: 1e7e1000 fmov d0, #-1.000000000000000000e+00
- 6a0: 1e7e3000 fmov d0, #-1.062500000000000000e+00
+ 0: 8b50798f add x15, x12, x16, lsr #30
+ 4: cb4381e1 sub x1, x15, x3, lsr #32
+ 8: ab05372d adds x13, x25, x5, lsl #13
+ c: eb864796 subs x22, x28, x6, asr #17
+ 10: 0b961920 add w0, w9, w22, asr #6
+ 14: 4b195473 sub w19, w3, w25, lsl #21
+ 18: 2b0b5264 adds w4, w19, w11, lsl #20
+ 1c: 6b9300f8 subs w24, w7, w19, asr #0
+ 20: 8a0bc0fe and x30, x7, x11, lsl #48
+ 24: aa0f3118 orr x24, x8, x15, lsl #12
+ 28: ca170531 eor x17, x9, x23, lsl #1
+ 2c: ea44dd6e ands x14, x11, x4, lsr #55
+ 30: 0a4c44f3 and w19, w7, w12, lsr #17
+ 34: 2a8b7373 orr w19, w27, w11, asr #28
+ 38: 4a567c7e eor w30, w3, w22, lsr #31
+ 3c: 6a9c0353 ands w19, w26, w28, asr #0
+ 40: 8a3accdd bic x29, x6, x26, lsl #51
+ 44: aa318f7a orn x26, x27, x17, lsl #35
+ 48: ca2e1495 eon x21, x4, x14, lsl #5
+ 4c: eaa015e2 bics x2, x15, x0, asr #5
+ 50: 0a2274e2 bic w2, w7, w2, lsl #29
+ 54: 2a751598 orn w24, w12, w21, lsr #5
+ 58: 4a3309fe eon w30, w15, w19, lsl #2
+ 5c: 6ab172fe bics w30, w23, w17, asr #28
+ 60: 110a5284 add w4, w20, #0x294
+ 64: 310b1942 adds w2, w10, #0x2c6
+ 68: 5103d353 sub w19, w26, #0xf4
+ 6c: 710125bc subs w28, w13, #0x49
+ 70: 910d7bc2 add x2, x30, #0x35e
+ 74: b108fa1b adds x27, x16, #0x23e
+ 78: d1093536 sub x22, x9, #0x24d
+ 7c: f10ae824 subs x4, x1, #0x2ba
+ 80: 120e667c and w28, w19, #0xfffc0fff
+ 84: 321f6cbb orr w27, w5, #0x1ffffffe
+ 88: 520f6a9e eor w30, w20, #0xfffe0fff
+ 8c: 72136f56 ands w22, w26, #0xffffe1ff
+ 90: 927e4ce5 and x5, x7, #0x3ffffc
+ 94: b278b4ed orr x13, x7, #0x3fffffffffff00
+ 98: d24c6527 eor x7, x9, #0xfff0000000003fff
+ 9c: f2485803 ands x3, x0, #0xff00000000007fff
+ a0: 14000000 b a0
+ a4: 17ffffd7 b 0
+ a8: 140001ee b 860
+ ac: 94000000 bl ac
+ b0: 97ffffd4 bl 0
+ b4: 940001eb bl 860
+ b8: 34000010 cbz w16, b8
+ bc: 34fffa30 cbz w16, 0
+ c0: 34003d10 cbz w16, 860
+ c4: 35000013 cbnz w19, c4
+ c8: 35fff9d3 cbnz w19, 0
+ cc: 35003cb3 cbnz w19, 860
+ d0: b4000005 cbz x5, d0
+ d4: b4fff965 cbz x5, 0
+ d8: b4003c45 cbz x5, 860
+ dc: b5000004 cbnz x4, dc
+ e0: b5fff904 cbnz x4, 0
+ e4: b5003be4 cbnz x4, 860
+ e8: 1000001b adr x27, e8
+ ec: 10fff8bb adr x27, 0
+ f0: 10003b9b adr x27, 860
+ f4: 90000010 adrp x16, 0
+ f8: 3640001c tbz w28, #8, f8
+ fc: 3647f83c tbz w28, #8, 0
+ 100: 36403b1c tbz w28, #8, 860
+ 104: 37080001 tbnz w1, #1, 104
+ 108: 370ff7c1 tbnz w1, #1, 0
+ 10c: 37083aa1 tbnz w1, #1, 860
+ 110: 12a437f4 mov w20, #0xde40ffff // #-566165505
+ 114: 528c9d67 mov w7, #0x64eb // #25835
+ 118: 72838bb1 movk w17, #0x1c5d
+ 11c: 92c1062e mov x14, #0xfffff7ceffffffff // #-9006546419713
+ 120: d287da49 mov x9, #0x3ed2 // #16082
+ 124: f2a6d153 movk x19, #0x368a, lsl #16
+ 128: 93465ac9 sbfx x9, x22, #6, #17
+ 12c: 330b0013 bfi w19, w0, #21, #1
+ 130: 530b4e6a ubfx w10, w19, #11, #9
+ 134: 934545e4 sbfx x4, x15, #5, #13
+ 138: b35370a3 bfxil x3, x5, #19, #10
+ 13c: d3510b8c ubfiz x12, x28, #47, #3
+ 140: 13960c0f extr w15, w0, w22, #3
+ 144: 93ceddc6 ror x6, x14, #55
+ 148: 54000000 b.eq 148 // b.none
+ 14c: 54fff5a0 b.eq 0 // b.none
+ 150: 54003880 b.eq 860 // b.none
+ 154: 54000001 b.ne 154 // b.any
+ 158: 54fff541 b.ne 0 // b.any
+ 15c: 54003821 b.ne 860 // b.any
+ 160: 54000002 b.cs 160 // b.hs, b.nlast
+ 164: 54fff4e2 b.cs 0 // b.hs, b.nlast
+ 168: 540037c2 b.cs 860 // b.hs, b.nlast
+ 16c: 54000002 b.cs 16c // b.hs, b.nlast
+ 170: 54fff482 b.cs 0 // b.hs, b.nlast
+ 174: 54003762 b.cs 860 // b.hs, b.nlast
+ 178: 54000003 b.cc 178 // b.lo, b.ul, b.last
+ 17c: 54fff423 b.cc 0 // b.lo, b.ul, b.last
+ 180: 54003703 b.cc 860 // b.lo, b.ul, b.last
+ 184: 54000003 b.cc 184 // b.lo, b.ul, b.last
+ 188: 54fff3c3 b.cc 0 // b.lo, b.ul, b.last
+ 18c: 540036a3 b.cc 860 // b.lo, b.ul, b.last
+ 190: 54000004 b.mi 190 // b.first
+ 194: 54fff364 b.mi 0 // b.first
+ 198: 54003644 b.mi 860 // b.first
+ 19c: 54000005 b.pl 19c // b.nfrst
+ 1a0: 54fff305 b.pl 0 // b.nfrst
+ 1a4: 540035e5 b.pl 860 // b.nfrst
+ 1a8: 54000006 b.vs 1a8
+ 1ac: 54fff2a6 b.vs 0
+ 1b0: 54003586 b.vs 860
+ 1b4: 54000007 b.vc 1b4
+ 1b8: 54fff247 b.vc 0
+ 1bc: 54003527 b.vc 860
+ 1c0: 54000008 b.hi 1c0 // b.pmore
+ 1c4: 54fff1e8 b.hi 0 // b.pmore
+ 1c8: 540034c8 b.hi 860 // b.pmore
+ 1cc: 54000009 b.ls 1cc // b.plast
+ 1d0: 54fff189 b.ls 0 // b.plast
+ 1d4: 54003469 b.ls 860 // b.plast
+ 1d8: 5400000a b.ge 1d8 // b.tcont
+ 1dc: 54fff12a b.ge 0 // b.tcont
+ 1e0: 5400340a b.ge 860 // b.tcont
+ 1e4: 5400000b b.lt 1e4 // b.tstop
+ 1e8: 54fff0cb b.lt 0 // b.tstop
+ 1ec: 540033ab b.lt 860 // b.tstop
+ 1f0: 5400000c b.gt 1f0
+ 1f4: 54fff06c b.gt 0
+ 1f8: 5400334c b.gt 860
+ 1fc: 5400000d b.le 1fc
+ 200: 54fff00d b.le 0
+ 204: 540032ed b.le 860
+ 208: 5400000e b.al 208
+ 20c: 54ffefae b.al 0
+ 210: 5400328e b.al 860
+ 214: 5400000f b.nv 214
+ 218: 54ffef4f b.nv 0
+ 21c: 5400322f b.nv 860
+ 220: d40ac601 svc #0x5630
+ 224: d40042a2 hvc #0x215
+ 228: d404dac3 smc #0x26d6
+ 22c: d4224d40 brk #0x126a
+ 230: d44219c0 hlt #0x10ce
+ 234: d503201f nop
+ 238: d69f03e0 eret
+ 23c: d6bf03e0 drps
+ 240: d5033fdf isb
+ 244: d503339f dsb osh
+ 248: d50335bf dmb nshld
+ 24c: d61f0280 br x20
+ 250: d63f0040 blr x2
+ 254: c8127c17 stxr w18, x23, [x0]
+ 258: c81efec5 stlxr w30, x5, [x22]
+ 25c: c85f7d05 ldxr x5, [x8]
+ 260: c85ffe14 ldaxr x20, [x16]
+ 264: c89ffd66 stlr x6, [x11]
+ 268: c8dfff66 ldar x6, [x27]
+ 26c: 880a7cb1 stxr w10, w17, [x5]
+ 270: 8816fd89 stlxr w22, w9, [x12]
+ 274: 885f7d1b ldxr w27, [x8]
+ 278: 885ffc57 ldaxr w23, [x2]
+ 27c: 889fffba stlr w26, [x29]
+ 280: 88dffd4d ldar w13, [x10]
+ 284: 48197f7c stxrh w25, w28, [x27]
+ 288: 481dfd96 stlxrh w29, w22, [x12]
+ 28c: 485f7f96 ldxrh w22, [x28]
+ 290: 485fffc3 ldaxrh w3, [x30]
+ 294: 489ffdf8 stlrh w24, [x15]
+ 298: 48dfff5b ldarh w27, [x26]
+ 29c: 080b7e6a stxrb w11, w10, [x19]
+ 2a0: 0817fedb stlxrb w23, w27, [x22]
+ 2a4: 085f7e18 ldxrb w24, [x16]
+ 2a8: 085ffc38 ldaxrb w24, [x1]
+ 2ac: 089fffa5 stlrb w5, [x29]
+ 2b0: 08dffe18 ldarb w24, [x16]
+ 2b4: c87f6239 ldxp x25, x24, [x17]
+ 2b8: c87fb276 ldaxp x22, x12, [x19]
+ 2bc: c820573a stxp w0, x26, x21, [x25]
+ 2c0: c821aca6 stlxp w1, x6, x11, [x5]
+ 2c4: 887f388d ldxp w13, w14, [x4]
+ 2c8: 887f88d1 ldaxp w17, w2, [x6]
+ 2cc: 882f2643 stxp w15, w3, w9, [x18]
+ 2d0: 88329131 stlxp w18, w17, w4, [x9]
+ 2d4: f81cf2b7 stur x23, [x21, #-49]
+ 2d8: b803f055 stur w21, [x2, #63]
+ 2dc: 39002f9b strb w27, [x28, #11]
+ 2e0: 781f31fd sturh w29, [x15, #-13]
+ 2e4: f85d33ce ldur x14, [x30, #-45]
+ 2e8: b843539d ldur w29, [x28, #53]
+ 2ec: 39401f54 ldrb w20, [x26, #7]
+ 2f0: 785ce059 ldurh w25, [x2, #-50]
+ 2f4: 389f1143 ldursb x3, [x10, #-15]
+ 2f8: 788131ee ldursh x14, [x15, #19]
+ 2fc: 78dfb17d ldursh w29, [x11, #-5]
+ 300: b89b90af ldursw x15, [x5, #-71]
+ 304: fc403193 ldur d19, [x12, #3]
+ 308: bc42a36c ldur s12, [x27, #42]
+ 30c: fc07d396 stur d22, [x28, #125]
+ 310: bc1ec1f8 stur s24, [x15, #-20]
+ 314: f81e8f88 str x8, [x28, #-24]!
+ 318: b8025de6 str w6, [x15, #37]!
+ 31c: 38007c27 strb w7, [x1, #7]!
+ 320: 7801ee20 strh w0, [x17, #30]!
+ 324: f8454fb9 ldr x25, [x29, #84]!
+ 328: b85cce9a ldr w26, [x20, #-52]!
+ 32c: 385e7fba ldrb w26, [x29, #-25]!
+ 330: 7841af24 ldrh w4, [x25, #26]!
+ 334: 389ebd1c ldrsb x28, [x8, #-21]!
+ 338: 789fadd1 ldrsh x17, [x14, #-6]!
+ 33c: 78c0aefc ldrsh w28, [x23, #10]!
+ 340: b89c0f7e ldrsw x30, [x27, #-64]!
+ 344: fc50efd4 ldr d20, [x30, #-242]!
+ 348: bc414f71 ldr s17, [x27, #20]!
+ 34c: fc011c67 str d7, [x3, #17]!
+ 350: bc1f0d6d str s13, [x11, #-16]!
+ 354: f81c3526 str x6, [x9], #-61
+ 358: b81e34b0 str w16, [x5], #-29
+ 35c: 3800f7bd strb w29, [x29], #15
+ 360: 78012684 strh w4, [x20], #18
+ 364: f842e653 ldr x19, [x18], #46
+ 368: b8417456 ldr w22, [x2], #23
+ 36c: 385e2467 ldrb w7, [x3], #-30
+ 370: 785e358b ldrh w11, [x12], #-29
+ 374: 389e34c8 ldrsb x8, [x6], #-29
+ 378: 788046f8 ldrsh x24, [x23], #4
+ 37c: 78c00611 ldrsh w17, [x16], #0
+ 380: b89f8680 ldrsw x0, [x20], #-8
+ 384: fc582454 ldr d20, [x2], #-126
+ 388: bc5987d3 ldr s19, [x30], #-104
+ 38c: fc076624 str d4, [x17], #118
+ 390: bc190675 str s21, [x19], #-112
+ 394: f833785a str x26, [x2, x19, lsl #3]
+ 398: b82fd809 str w9, [x0, w15, sxtw #2]
+ 39c: 3821799a strb w26, [x12, x1, lsl #0]
+ 3a0: 782a7975 strh w21, [x11, x10, lsl #1]
+ 3a4: f870eaf0 ldr x16, [x23, x16, sxtx]
+ 3a8: b871d96a ldr w10, [x11, w17, sxtw #2]
+ 3ac: 386b7aed ldrb w13, [x23, x11, lsl #0]
+ 3b0: 7875689b ldrh w27, [x4, x21]
+ 3b4: 38afd91a ldrsb x26, [x8, w15, sxtw #0]
+ 3b8: 78a2c955 ldrsh x21, [x10, w2, sxtw]
+ 3bc: 78ee6bc8 ldrsh w8, [x30, x14]
+ 3c0: b8b4f9dd ldrsw x29, [x14, x20, sxtx #2]
+ 3c4: fc76eb7e ldr d30, [x27, x22, sxtx]
+ 3c8: bc76692d ldr s13, [x9, x22]
+ 3cc: fc31db28 str d8, [x25, w17, sxtw #3]
+ 3d0: bc255b01 str s1, [x24, w5, uxtw #2]
+ 3d4: f91c52aa str x10, [x21, #14496]
+ 3d8: b91c3fb2 str w18, [x29, #7228]
+ 3dc: 391f8877 strb w23, [x3, #2018]
+ 3e0: 791ac97c strh w28, [x11, #3428]
+ 3e4: f95c1758 ldr x24, [x26, #14376]
+ 3e8: b95b3c55 ldr w21, [x2, #6972]
+ 3ec: 395ce0a4 ldrb w4, [x5, #1848]
+ 3f0: 795851ce ldrh w14, [x14, #3112]
+ 3f4: 399e9f64 ldrsb x4, [x27, #1959]
+ 3f8: 79993764 ldrsh x4, [x27, #3226]
+ 3fc: 79d9af8a ldrsh w10, [x28, #3286]
+ 400: b99eea2a ldrsw x10, [x17, #7912]
+ 404: fd5a2f8d ldr d13, [x28, #13400]
+ 408: bd5dac78 ldr s24, [x3, #7596]
+ 40c: fd1e0182 str d2, [x12, #15360]
+ 410: bd195c31 str s17, [x1, #6492]
+ 414: 58000010 ldr x16, 414
+ 418: 1800000d ldr w13, 418
+ 41c: f8981240 prfum pldl1keep, [x18, #-127]
+ 420: d8ffdf00 prfm pldl1keep, 0
+ 424: f8a27a80 prfm pldl1keep, [x20, x2, lsl #3]
+ 428: f99af920 prfm pldl1keep, [x9, #13808]
+ 42c: 1a0202e8 adc w8, w23, w2
+ 430: 3a130078 adcs w24, w3, w19
+ 434: 5a1d0316 sbc w22, w24, w29
+ 438: 7a03036c sbcs w12, w27, w3
+ 43c: 9a0102eb adc x11, x23, x1
+ 440: ba1700bd adcs x29, x5, x23
+ 444: da0c0329 sbc x9, x25, x12
+ 448: fa16000c sbcs x12, x0, x22
+ 44c: 0b23459a add w26, w12, w3, uxtw #1
+ 450: 2b328a14 adds w20, w16, w18, sxtb #2
+ 454: cb274bde sub x30, x30, w7, uxtw #2
+ 458: 6b222eab subs w11, w21, w2, uxth #3
+ 45c: 8b214b42 add x2, x26, w1, uxtw #2
+ 460: ab34a7b2 adds x18, x29, w20, sxth #1
+ 464: cb24520e sub x14, x16, w4, uxtw #4
+ 468: eb378e20 subs x0, x17, w23, sxtb #3
+ 46c: 3a565283 ccmn w20, w22, #0x3, pl // pl = nfrst
+ 470: 7a420321 ccmp w25, w2, #0x1, eq // eq = none
+ 474: ba58c247 ccmn x18, x24, #0x7, gt
+ 478: fa4d5106 ccmp x8, x13, #0x6, pl // pl = nfrst
+ 47c: 3a426924 ccmn w9, #0x2, #0x4, vs
+ 480: 7a5b0847 ccmp w2, #0x1b, #0x7, eq // eq = none
+ 484: ba413a02 ccmn x16, #0x1, #0x2, cc // cc = lo, ul, last
+ 488: fa5fba23 ccmp x17, #0x1f, #0x3, lt // lt = tstop
+ 48c: 1a979377 csel w23, w27, w23, ls // ls = plast
+ 490: 1a86640a csinc w10, w0, w6, vs
+ 494: 5a89300b csinv w11, w0, w9, cc // cc = lo, ul, last
+ 498: 5a923771 csneg w17, w27, w18, cc // cc = lo, ul, last
+ 49c: 9a8b720c csel x12, x16, x11, vc
+ 4a0: 9a868786 csinc x6, x28, x6, hi // hi = pmore
+ 4a4: da9a736d csinv x13, x27, x26, vc
+ 4a8: da9256dd csneg x29, x22, x18, pl // pl = nfrst
+ 4ac: 5ac0026c rbit w12, w19
+ 4b0: 5ac00657 rev16 w23, w18
+ 4b4: 5ac00b89 rev w9, w28
+ 4b8: 5ac01262 clz w2, w19
+ 4bc: 5ac017b9 cls w25, w29
+ 4c0: dac002e4 rbit x4, x23
+ 4c4: dac0065d rev16 x29, x18
+ 4c8: dac00907 rev32 x7, x8
+ 4cc: dac00e2d rev x13, x17
+ 4d0: dac01011 clz x17, x0
+ 4d4: dac01752 cls x18, x26
+ 4d8: 1ad0098b udiv w11, w12, w16
+ 4dc: 1ac70d24 sdiv w4, w9, w7
+ 4e0: 1ad020ec lsl w12, w7, w16
+ 4e4: 1ad72613 lsr w19, w16, w23
+ 4e8: 1ac62887 asr w7, w4, w6
+ 4ec: 1ad72e95 ror w21, w20, w23
+ 4f0: 9adc0990 udiv x16, x12, x28
+ 4f4: 9acd0d84 sdiv x4, x12, x13
+ 4f8: 9ac721a9 lsl x9, x13, x7
+ 4fc: 9acf277c lsr x28, x27, x15
+ 500: 9ace2bd4 asr x20, x30, x14
+ 504: 9ade2e4e ror x14, x18, x30
+ 508: 9bc77d63 umulh x3, x11, x7
+ 50c: 9b587e97 smulh x23, x20, x24
+ 510: 1b1524a2 madd w2, w5, w21, w9
+ 514: 1b04a318 msub w24, w24, w4, w8
+ 518: 9b0f4d8b madd x11, x12, x15, x19
+ 51c: 9b0ce73d msub x29, x25, x12, x25
+ 520: 9b2c5971 smaddl x17, w11, w12, x22
+ 524: 9b34c87c smsubl x28, w3, w20, x18
+ 528: 9bbc6887 umaddl x7, w4, w28, x26
+ 52c: 9bb19556 umsubl x22, w10, w17, x5
+ 530: 1e310871 fmul s17, s3, s17
+ 534: 1e261a2b fdiv s11, s17, s6
+ 538: 1e2928fd fadd s29, s7, s9
+ 53c: 1e333987 fsub s7, s12, s19
+ 540: 1e230ae0 fmul s0, s23, s3
+ 544: 1e75087a fmul d26, d3, d21
+ 548: 1e651a60 fdiv d0, d19, d5
+ 54c: 1e692b40 fadd d0, d26, d9
+ 550: 1e753ab9 fsub d25, d21, d21
+ 554: 1e7309b0 fmul d16, d13, d19
+ 558: 1f00425d fmadd s29, s18, s0, s16
+ 55c: 1f1d95b7 fmsub s23, s13, s29, s5
+ 560: 1f2a38e9 fnmadd s9, s7, s10, s14
+ 564: 1f2f5f99 fnmadd s25, s28, s15, s23
+ 568: 1f5545a6 fmadd d6, d13, d21, d17
+ 56c: 1f429ea3 fmsub d3, d21, d2, d7
+ 570: 1f65472a fnmadd d10, d25, d5, d17
+ 574: 1f7449ce fnmadd d14, d14, d20, d18
+ 578: 1e20404f fmov s15, s2
+ 57c: 1e20c0f2 fabs s18, s7
+ 580: 1e2140c3 fneg s3, s6
+ 584: 1e21c02c fsqrt s12, s1
+ 588: 1e22c009 fcvt d9, s0
+ 58c: 1e6040a4 fmov d4, d5
+ 590: 1e60c1e3 fabs d3, d15
+ 594: 1e614331 fneg d17, d25
+ 598: 1e61c30c fsqrt d12, d24
+ 59c: 1e6240b5 fcvt s21, d5
+ 5a0: 1e3802a4 fcvtzs w4, s21
+ 5a4: 9e38007b fcvtzs x27, s3
+ 5a8: 1e78011d fcvtzs w29, d8
+ 5ac: 9e7802a9 fcvtzs x9, d21
+ 5b0: 1e2203b4 scvtf s20, w29
+ 5b4: 9e220107 scvtf s7, x8
+ 5b8: 1e6202ac scvtf d12, w21
+ 5bc: 9e6202b0 scvtf d16, x21
+ 5c0: 1e2600b2 fmov w18, s5
+ 5c4: 9e660119 fmov x25, d8
+ 5c8: 1e270352 fmov s18, w26
+ 5cc: 9e670160 fmov d0, x11
+ 5d0: 1e262200 fcmp s16, s6
+ 5d4: 1e7d2200 fcmp d16, d29
+ 5d8: 1e2023c8 fcmp s30, #0.0
+ 5dc: 1e602128 fcmp d9, #0.0
+ 5e0: 293e119b stp w27, w4, [x12, #-16]
+ 5e4: 294a2543 ldp w3, w9, [x10, #80]
+ 5e8: 69480c70 ldpsw x16, x3, [x3, #64]
+ 5ec: a934726a stp x10, x28, [x19, #-192]
+ 5f0: a97448f3 ldp x19, x18, [x7, #-192]
+ 5f4: 298243ca stp w10, w16, [x30, #16]!
+ 5f8: 29e21242 ldp w2, w4, [x18, #-240]!
+ 5fc: 69c64db8 ldpsw x24, x19, [x13, #48]!
+ 600: a9800311 stp x17, x0, [x24, #0]!
+ 604: a9f4686e ldp x14, x26, [x3, #-192]!
+ 608: 288a0416 stp w22, w1, [x0], #80
+ 60c: 28fe2812 ldp w18, w10, [x0], #-16
+ 610: 68fe62d8 .inst 0x68fe62d8 ; undefined
+ 614: a885308c stp x12, x12, [x4], #80
+ 618: a8f12664 ldp x4, x9, [x19], #-240
+ 61c: 282468d2 stnp w18, w26, [x6, #-224]
+ 620: 284e5035 ldnp w21, w20, [x1, #112]
+ 624: a8327699 stnp x25, x29, [x20, #-224]
+ 628: a84716e1 ldnp x1, x5, [x23, #112]
+ 62c: 0c407284 ld1 {v4.8b}, [x20]
+ 630: 4cdfa158 ld1 {v24.16b, v25.16b}, [x10], #32
+ 634: 0ccf6cd8 ld1 {v24.1d-v26.1d}, [x6], x15
+ 638: 4cdf2483 ld1 {v3.8h-v6.8h}, [x4], #64
+ 63c: 0d40c0c2 ld1r {v2.8b}, [x6]
+ 640: 4ddfc9cd ld1r {v13.4s}, [x14], #4
+ 644: 0dd8ceaf ld1r {v15.1d}, [x21], x24
+ 648: 4c408ea9 ld2 {v9.2d, v10.2d}, [x21]
+ 64c: 0cdf86bd ld2 {v29.4h, v30.4h}, [x21], #16
+ 650: 4d60c1c8 ld2r {v8.16b, v9.16b}, [x14]
+ 654: 0dffca87 ld2r {v7.2s, v8.2s}, [x20], #8
+ 658: 4de3cc7c ld2r {v28.2d, v29.2d}, [x3], x3
+ 65c: 4cdd497b ld3 {v27.4s-v29.4s}, [x11], x29
+ 660: 0c404950 ld3 {v16.2s-v18.2s}, [x10]
+ 664: 4d40e595 ld3r {v21.8h-v23.8h}, [x12]
+ 668: 4ddfeba4 ld3r {v4.4s-v6.4s}, [x29], #12
+ 66c: 0dd3ed38 ld3r {v24.1d-v26.1d}, [x9], x19
+ 670: 4cdf046a ld4 {v10.8h-v13.8h}, [x3], #64
+ 674: 0cc9039b ld4 {v27.8b-v30.8b}, [x28], x9
+ 678: 0d60e3d5 ld4r {v21.8b-v24.8b}, [x30]
+ 67c: 0dffe5d7 ld4r {v23.4h-v26.4h}, [x14], #8
+ 680: 0df4e9a4 ld4r {v4.2s-v7.2s}, [x13], x20
+ 684: ba5fd3e3 ccmn xzr, xzr, #0x3, le
+ 688: 3a5f03e5 ccmn wzr, wzr, #0x5, eq // eq = none
+ 68c: fa411be4 ccmp xzr, #0x1, #0x4, ne // ne = any
+ 690: 7a42cbe2 ccmp wzr, #0x2, #0x2, gt
+ 694: 93df03ff ror xzr, xzr, #0
+ 698: c820ffff stlxp w0, xzr, xzr, [sp]
+ 69c: 8822fc7f stlxp w2, wzr, wzr, [x3]
+ 6a0: c8247cbf stxp w4, xzr, xzr, [x5]
+ 6a4: 88267fff stxp w6, wzr, wzr, [sp]
+ 6a8: 4e010fe0 dup v0.16b, wzr
+ 6ac: 4e081fe1 mov v1.d[0], xzr
+ 6b0: 4e0c1fe1 mov v1.s[1], wzr
+ 6b4: 4e0a1fe1 mov v1.h[2], wzr
+ 6b8: 4e071fe1 mov v1.b[3], wzr
+ 6bc: 4cc0ac3f ld1 {v31.2d, v0.2d}, [x1], x0
+ 6c0: 1e601000 fmov d0, #2.000000000000000000e+00
+ 6c4: 1e603000 fmov d0, #2.125000000000000000e+00
+ 6c8: 1e621000 fmov d0, #4.000000000000000000e+00
+ 6cc: 1e623000 fmov d0, #4.250000000000000000e+00
+ 6d0: 1e641000 fmov d0, #8.000000000000000000e+00
+ 6d4: 1e643000 fmov d0, #8.500000000000000000e+00
+ 6d8: 1e661000 fmov d0, #1.600000000000000000e+01
+ 6dc: 1e663000 fmov d0, #1.700000000000000000e+01
+ 6e0: 1e681000 fmov d0, #1.250000000000000000e-01
+ 6e4: 1e683000 fmov d0, #1.328125000000000000e-01
+ 6e8: 1e6a1000 fmov d0, #2.500000000000000000e-01
+ 6ec: 1e6a3000 fmov d0, #2.656250000000000000e-01
+ 6f0: 1e6c1000 fmov d0, #5.000000000000000000e-01
+ 6f4: 1e6c3000 fmov d0, #5.312500000000000000e-01
+ 6f8: 1e6e1000 fmov d0, #1.000000000000000000e+00
+ 6fc: 1e6e3000 fmov d0, #1.062500000000000000e+00
+ 700: 1e701000 fmov d0, #-2.000000000000000000e+00
+ 704: 1e703000 fmov d0, #-2.125000000000000000e+00
+ 708: 1e721000 fmov d0, #-4.000000000000000000e+00
+ 70c: 1e723000 fmov d0, #-4.250000000000000000e+00
+ 710: 1e741000 fmov d0, #-8.000000000000000000e+00
+ 714: 1e743000 fmov d0, #-8.500000000000000000e+00
+ 718: 1e761000 fmov d0, #-1.600000000000000000e+01
+ 71c: 1e763000 fmov d0, #-1.700000000000000000e+01
+ 720: 1e781000 fmov d0, #-1.250000000000000000e-01
+ 724: 1e783000 fmov d0, #-1.328125000000000000e-01
+ 728: 1e7a1000 fmov d0, #-2.500000000000000000e-01
+ 72c: 1e7a3000 fmov d0, #-2.656250000000000000e-01
+ 730: 1e7c1000 fmov d0, #-5.000000000000000000e-01
+ 734: 1e7c3000 fmov d0, #-5.312500000000000000e-01
+ 738: 1e7e1000 fmov d0, #-1.000000000000000000e+00
+ 73c: 1e7e3000 fmov d0, #-1.062500000000000000e+00
+ 740: f8358305 swp x21, x5, [x24]
+ 744: f82d01ed ldadd x13, x13, [x15]
+ 748: f8361353 ldclr x22, x19, [x26]
+ 74c: f839234a ldeor x25, x10, [x26]
+ 750: f82531fb ldset x5, x27, [x15]
+ 754: f8335165 ldsmin x19, x5, [x11]
+ 758: f83a4080 ldsmax x26, x0, [x4]
+ 75c: f83673d7 ldumin x22, x23, [x30]
+ 760: f832611c ldumax x18, x28, [x8]
+ 764: f8ad837d swpa x13, x29, [x27]
+ 768: f8ab01a5 ldadda x11, x5, [x13]
+ 76c: f8a112b8 ldclra x1, x24, [x21]
+ 770: f8bb2311 ldeora x27, x17, [x24]
+ 774: f8b230be ldseta x18, x30, [x5]
+ 778: f8a75336 ldsmina x7, x22, [x25]
+ 77c: f8a4427a ldsmaxa x4, x26, [x19]
+ 780: f8a6707e ldumina x6, x30, [x3]
+ 784: f8b860b7 ldumaxa x24, x23, [x5]
+ 788: f8f88392 swpal x24, x18, [x28]
+ 78c: f8f300ff ldaddal x19, xzr, [x7]
+ 790: f8ed1386 ldclral x13, x6, [x28]
+ 794: f8e822af ldeoral x8, x15, [x21]
+ 798: f8e2302d ldsetal x2, x13, [x1]
+ 79c: f8f1533d ldsminal x17, x29, [x25]
+ 7a0: f8f941d2 ldsmaxal x25, x18, [x14]
+ 7a4: f8ff7366 lduminal xzr, x6, [x27]
+ 7a8: f8f061e5 ldumaxal x16, x5, [x15]
+ 7ac: f86b8072 swpl x11, x18, [x3]
+ 7b0: f87a0054 ldaddl x26, x20, [x2]
+ 7b4: f86b1164 ldclrl x11, x4, [x11]
+ 7b8: f87e22f3 ldeorl x30, x19, [x23]
+ 7bc: f86331cf ldsetl x3, x15, [x14]
+ 7c0: f87e5296 ldsminl x30, x22, [x20]
+ 7c4: f8674305 ldsmaxl x7, x5, [x24]
+ 7c8: f87771f0 lduminl x23, x16, [x15]
+ 7cc: f86b6013 ldumaxl x11, x19, [x0]
+ 7d0: b83c803c swp w28, w28, [x1]
+ 7d4: b82b0195 ldadd w11, w21, [x12]
+ 7d8: b83d1240 ldclr w29, w0, [x18]
+ 7dc: b8252320 ldeor w5, w0, [x25]
+ 7e0: b82e3340 ldset w14, w0, [x26]
+ 7e4: b83c53b2 ldsmin w28, w18, [x29]
+ 7e8: b82f43a1 ldsmax w15, w1, [x29]
+ 7ec: b828739a ldumin w8, w26, [x28]
+ 7f0: b831608e ldumax w17, w14, [x4]
+ 7f4: b8b88039 swpa w24, w25, [x1]
+ 7f8: b8aa0231 ldadda w10, w17, [x17]
+ 7fc: b8bd12b4 ldclra w29, w20, [x21]
+ 800: b8bd2189 ldeora w29, w9, [x12]
+ 804: b8ab30a6 ldseta w11, w6, [x5]
+ 808: b8b552a7 ldsmina w21, w7, [x21]
+ 80c: b8aa4197 ldsmaxa w10, w23, [x12]
+ 810: b8b57145 ldumina w21, w5, [x10]
+ 814: b8be6254 ldumaxa w30, w20, [x18]
+ 818: b8ed80b7 swpal w13, w23, [x5]
+ 81c: b8ef00b8 ldaddal w15, w24, [x5]
+ 820: b8e9132a ldclral w9, w10, [x25]
+ 824: b8f42231 ldeoral w20, w17, [x17]
+ 828: b8ec33d2 ldsetal w12, w18, [x30]
+ 82c: b8e35323 ldsminal w3, w3, [x25]
+ 830: b8fa4159 ldsmaxal w26, w25, [x10]
+ 834: b8e273eb lduminal w2, w11, [sp]
+ 838: b8e760a2 ldumaxal w7, w2, [x5]
+ 83c: b8608287 swpl w0, w7, [x20]
+ 840: b865005f staddl w5, [x2]
+ 844: b87b1379 ldclrl w27, w25, [x27]
+ 848: b87e2358 ldeorl w30, w24, [x26]
+ 84c: b86f32c2 ldsetl w15, w2, [x22]
+ 850: b86053e3 ldsminl w0, w3, [sp]
+ 854: b86f4154 ldsmaxl w15, w20, [x10]
+ 858: b87671d5 lduminl w22, w21, [x14]
+ 85c: b866605e ldumaxl w6, w30, [x2]
*/
static const unsigned int insns[] =
{
- 0x8b0772d3, 0xcb4a3570, 0xab9c09bb, 0xeb9aa794,
- 0x0b934e68, 0x4b0a3924, 0x2b1e3568, 0x6b132720,
- 0x8a154c14, 0xaa1445d5, 0xca01cf99, 0xea8b3f6a,
- 0x0a8c5cb9, 0x2a4a11d2, 0x4a855aa4, 0x6a857415,
- 0x8aa697da, 0xaa6d7423, 0xca29bf80, 0xea3cb8bd,
- 0x0a675249, 0x2ab961ba, 0x4a331899, 0x6a646345,
- 0x11055267, 0x31064408, 0x51028e9d, 0x710bdee8,
- 0x91082d81, 0xb106a962, 0xd10b33ae, 0xf10918ab,
- 0x121102d7, 0x3204cd44, 0x5204cf00, 0x72099fb3,
- 0x92729545, 0xb20e37cc, 0xd27c34be, 0xf27e4efa,
- 0x14000000, 0x17ffffd7, 0x1400017f, 0x94000000,
- 0x97ffffd4, 0x9400017c, 0x3400000c, 0x34fffa2c,
- 0x34002f2c, 0x35000014, 0x35fff9d4, 0x35002ed4,
- 0xb400000c, 0xb4fff96c, 0xb4002e6c, 0xb5000018,
- 0xb5fff918, 0xb5002e18, 0x10000006, 0x10fff8a6,
- 0x10002da6, 0x90000015, 0x36080001, 0x360ff821,
- 0x36082d21, 0x37480008, 0x374ff7c8, 0x37482cc8,
- 0x128b50ec, 0x52a9ff8b, 0x7281d095, 0x92edfebd,
- 0xd28361e3, 0xf2a4cc96, 0x9346590c, 0x33194f33,
- 0x531d3d89, 0x9350433c, 0xb34464ac, 0xd3462140,
- 0x139a61a4, 0x93d87fd7, 0x54000000, 0x54fff5a0,
- 0x54002aa0, 0x54000001, 0x54fff541, 0x54002a41,
- 0x54000002, 0x54fff4e2, 0x540029e2, 0x54000002,
- 0x54fff482, 0x54002982, 0x54000003, 0x54fff423,
- 0x54002923, 0x54000003, 0x54fff3c3, 0x540028c3,
- 0x54000004, 0x54fff364, 0x54002864, 0x54000005,
- 0x54fff305, 0x54002805, 0x54000006, 0x54fff2a6,
- 0x540027a6, 0x54000007, 0x54fff247, 0x54002747,
- 0x54000008, 0x54fff1e8, 0x540026e8, 0x54000009,
- 0x54fff189, 0x54002689, 0x5400000a, 0x54fff12a,
- 0x5400262a, 0x5400000b, 0x54fff0cb, 0x540025cb,
- 0x5400000c, 0x54fff06c, 0x5400256c, 0x5400000d,
- 0x54fff00d, 0x5400250d, 0x5400000e, 0x54ffefae,
- 0x540024ae, 0x5400000f, 0x54ffef4f, 0x5400244f,
- 0xd4063721, 0xd4035082, 0xd400bfe3, 0xd4282fc0,
- 0xd444c320, 0xd503201f, 0xd69f03e0, 0xd6bf03e0,
- 0xd5033fdf, 0xd5033f9f, 0xd5033abf, 0xd61f0040,
- 0xd63f00a0, 0xc8147c55, 0xc805fcfd, 0xc85f7e05,
- 0xc85fffbb, 0xc89fffa0, 0xc8dfff95, 0x88157cf8,
- 0x8815ff9a, 0x885f7cd5, 0x885fffcf, 0x889ffc73,
- 0x88dffc56, 0x48127c0f, 0x480bff85, 0x485f7cdd,
- 0x485ffcf2, 0x489fff99, 0x48dffe62, 0x080a7c3e,
- 0x0814fed5, 0x085f7c59, 0x085ffcb8, 0x089ffc70,
- 0x08dfffb6, 0xc87f0a68, 0xc87fcdc7, 0xc82870bb,
- 0xc825b8c8, 0x887f12d9, 0x887fb9ed, 0x8834215a,
- 0x8837ca52, 0xf806317e, 0xb81b3337, 0x39000dc2,
- 0x78005149, 0xf84391f4, 0xb85b220c, 0x385fd356,
- 0x785d127e, 0x389f4149, 0x79801e3c, 0x79c014a3,
- 0xb89a5231, 0xfc5ef282, 0xbc5f60f6, 0xfc12125e,
- 0xbc0152cd, 0xf8190e49, 0xb800befd, 0x381ffd92,
- 0x781e9e90, 0xf8409fa3, 0xb8413c79, 0x385fffa1,
- 0x785c7fa8, 0x389f3dc5, 0x78801f6a, 0x78c19d4b,
- 0xb89a4ec4, 0xfc408eeb, 0xbc436e79, 0xfc152ce1,
- 0xbc036f28, 0xf8025565, 0xb80135f8, 0x381ff74f,
- 0x781fa652, 0xf851a447, 0xb85e557b, 0x385e7472,
- 0x785e070a, 0x38804556, 0x78819591, 0x78dc24e8,
- 0xb89cd6d7, 0xfc430738, 0xbc5f6595, 0xfc1225b2,
- 0xbc1d7430, 0xf82fcac2, 0xb83d6a02, 0x382e5a54,
- 0x7834fa66, 0xf86ecbae, 0xb86cda90, 0x3860d989,
- 0x78637a2c, 0x38a3fa22, 0x78b15827, 0x78f2d9f9,
- 0xb8ac6ab7, 0xfc6879a5, 0xbc767943, 0xfc3bc84e,
- 0xbc3968d4, 0xf91fc0fe, 0xb91da50f, 0x391d280b,
- 0x791d2e23, 0xf95bc8e2, 0xb95ce525, 0x395ae53c,
- 0x795c9282, 0x399d7dd6, 0x799fe008, 0x79de9bc0,
- 0xb99aae78, 0xfd597598, 0xbd5d1d08, 0xfd1f3dea,
- 0xbd1a227a, 0x5800148a, 0x18000003, 0xf88092e0,
- 0xd8ffdf00, 0xf8a84860, 0xf99d7560, 0x1a1c012d,
- 0x3a1c027b, 0x5a060253, 0x7a03028e, 0x9a0801d0,
- 0xba0803a0, 0xda140308, 0xfa00038c, 0x0b3010d7,
- 0x2b37ab39, 0xcb2466da, 0x6b33efb1, 0x8b350fcb,
- 0xab208a70, 0xcb39e52b, 0xeb2c9291, 0x3a4bd1a3,
- 0x7a4c81a2, 0xba42106c, 0xfa5560e3, 0x3a4e3844,
- 0x7a515a26, 0xba4c2940, 0xfa52aaae, 0x1a8cc1b5,
- 0x1a8f976a, 0x5a8981a0, 0x5a9a6492, 0x9a8793ac,
- 0x9a9474e6, 0xda83d2b6, 0xda9b9593, 0x5ac00200,
- 0x5ac006f1, 0x5ac009d1, 0x5ac013d8, 0x5ac016d8,
- 0xdac00223, 0xdac005ac, 0xdac00ac9, 0xdac00c00,
- 0xdac01205, 0xdac016d9, 0x1ac0089d, 0x1add0fa0,
- 0x1ad52225, 0x1ad22529, 0x1ac82b61, 0x1acd2e92,
- 0x9acc0b28, 0x9adc0ca7, 0x9adb2225, 0x9ad42757,
- 0x9adc291c, 0x9ac42fa3, 0x1b1a55d1, 0x1b0bafc1,
- 0x9b067221, 0x9b1ea0de, 0x9b2e20d5, 0x9b38cd4a,
- 0x9bae6254, 0x9ba59452, 0x1e2d0a48, 0x1e3c19c2,
- 0x1e3c298f, 0x1e213980, 0x1e240baf, 0x1e77082c,
- 0x1e72191b, 0x1e6b2a97, 0x1e723988, 0x1e770b1a,
- 0x1f0d66f5, 0x1f01b956, 0x1f227a8e, 0x1f365ba7,
- 0x1f4f14ad, 0x1f45a98e, 0x1f60066a, 0x1f620054,
- 0x1e204139, 0x1e20c094, 0x1e214363, 0x1e21c041,
- 0x1e22c01e, 0x1e60408c, 0x1e60c361, 0x1e6142c8,
- 0x1e61c16b, 0x1e624396, 0x1e3802dc, 0x9e380374,
- 0x1e78000e, 0x9e78017a, 0x1e2202dc, 0x9e220150,
- 0x1e6202a8, 0x9e620395, 0x1e260318, 0x9e660268,
- 0x1e270188, 0x9e6700e6, 0x1e3023c0, 0x1e6b2320,
- 0x1e202168, 0x1e602168, 0x2910323d, 0x297449d6,
- 0x6948402b, 0xa9072f40, 0xa9410747, 0x29801f0a,
- 0x29e07307, 0x69e272b9, 0xa9bf49d4, 0xa9c529a8,
- 0x28b0605a, 0x28e866a2, 0x68ee0ab1, 0xa886296c,
- 0xa8fe1a38, 0x282479c3, 0x286e534f, 0xa8386596,
- 0xa8755a3b, 0x1e601000, 0x1e603000, 0x1e621000,
- 0x1e623000, 0x1e641000, 0x1e643000, 0x1e661000,
- 0x1e663000, 0x1e681000, 0x1e683000, 0x1e6a1000,
- 0x1e6a3000, 0x1e6c1000, 0x1e6c3000, 0x1e6e1000,
- 0x1e6e3000, 0x1e701000, 0x1e703000, 0x1e721000,
- 0x1e723000, 0x1e741000, 0x1e743000, 0x1e761000,
- 0x1e763000, 0x1e781000, 0x1e783000, 0x1e7a1000,
- 0x1e7a3000, 0x1e7c1000, 0x1e7c3000, 0x1e7e1000,
- 0x1e7e3000,
+ 0x8b50798f, 0xcb4381e1, 0xab05372d, 0xeb864796,
+ 0x0b961920, 0x4b195473, 0x2b0b5264, 0x6b9300f8,
+ 0x8a0bc0fe, 0xaa0f3118, 0xca170531, 0xea44dd6e,
+ 0x0a4c44f3, 0x2a8b7373, 0x4a567c7e, 0x6a9c0353,
+ 0x8a3accdd, 0xaa318f7a, 0xca2e1495, 0xeaa015e2,
+ 0x0a2274e2, 0x2a751598, 0x4a3309fe, 0x6ab172fe,
+ 0x110a5284, 0x310b1942, 0x5103d353, 0x710125bc,
+ 0x910d7bc2, 0xb108fa1b, 0xd1093536, 0xf10ae824,
+ 0x120e667c, 0x321f6cbb, 0x520f6a9e, 0x72136f56,
+ 0x927e4ce5, 0xb278b4ed, 0xd24c6527, 0xf2485803,
+ 0x14000000, 0x17ffffd7, 0x140001ee, 0x94000000,
+ 0x97ffffd4, 0x940001eb, 0x34000010, 0x34fffa30,
+ 0x34003d10, 0x35000013, 0x35fff9d3, 0x35003cb3,
+ 0xb4000005, 0xb4fff965, 0xb4003c45, 0xb5000004,
+ 0xb5fff904, 0xb5003be4, 0x1000001b, 0x10fff8bb,
+ 0x10003b9b, 0x90000010, 0x3640001c, 0x3647f83c,
+ 0x36403b1c, 0x37080001, 0x370ff7c1, 0x37083aa1,
+ 0x12a437f4, 0x528c9d67, 0x72838bb1, 0x92c1062e,
+ 0xd287da49, 0xf2a6d153, 0x93465ac9, 0x330b0013,
+ 0x530b4e6a, 0x934545e4, 0xb35370a3, 0xd3510b8c,
+ 0x13960c0f, 0x93ceddc6, 0x54000000, 0x54fff5a0,
+ 0x54003880, 0x54000001, 0x54fff541, 0x54003821,
+ 0x54000002, 0x54fff4e2, 0x540037c2, 0x54000002,
+ 0x54fff482, 0x54003762, 0x54000003, 0x54fff423,
+ 0x54003703, 0x54000003, 0x54fff3c3, 0x540036a3,
+ 0x54000004, 0x54fff364, 0x54003644, 0x54000005,
+ 0x54fff305, 0x540035e5, 0x54000006, 0x54fff2a6,
+ 0x54003586, 0x54000007, 0x54fff247, 0x54003527,
+ 0x54000008, 0x54fff1e8, 0x540034c8, 0x54000009,
+ 0x54fff189, 0x54003469, 0x5400000a, 0x54fff12a,
+ 0x5400340a, 0x5400000b, 0x54fff0cb, 0x540033ab,
+ 0x5400000c, 0x54fff06c, 0x5400334c, 0x5400000d,
+ 0x54fff00d, 0x540032ed, 0x5400000e, 0x54ffefae,
+ 0x5400328e, 0x5400000f, 0x54ffef4f, 0x5400322f,
+ 0xd40ac601, 0xd40042a2, 0xd404dac3, 0xd4224d40,
+ 0xd44219c0, 0xd503201f, 0xd69f03e0, 0xd6bf03e0,
+ 0xd5033fdf, 0xd503339f, 0xd50335bf, 0xd61f0280,
+ 0xd63f0040, 0xc8127c17, 0xc81efec5, 0xc85f7d05,
+ 0xc85ffe14, 0xc89ffd66, 0xc8dfff66, 0x880a7cb1,
+ 0x8816fd89, 0x885f7d1b, 0x885ffc57, 0x889fffba,
+ 0x88dffd4d, 0x48197f7c, 0x481dfd96, 0x485f7f96,
+ 0x485fffc3, 0x489ffdf8, 0x48dfff5b, 0x080b7e6a,
+ 0x0817fedb, 0x085f7e18, 0x085ffc38, 0x089fffa5,
+ 0x08dffe18, 0xc87f6239, 0xc87fb276, 0xc820573a,
+ 0xc821aca6, 0x887f388d, 0x887f88d1, 0x882f2643,
+ 0x88329131, 0xf81cf2b7, 0xb803f055, 0x39002f9b,
+ 0x781f31fd, 0xf85d33ce, 0xb843539d, 0x39401f54,
+ 0x785ce059, 0x389f1143, 0x788131ee, 0x78dfb17d,
+ 0xb89b90af, 0xfc403193, 0xbc42a36c, 0xfc07d396,
+ 0xbc1ec1f8, 0xf81e8f88, 0xb8025de6, 0x38007c27,
+ 0x7801ee20, 0xf8454fb9, 0xb85cce9a, 0x385e7fba,
+ 0x7841af24, 0x389ebd1c, 0x789fadd1, 0x78c0aefc,
+ 0xb89c0f7e, 0xfc50efd4, 0xbc414f71, 0xfc011c67,
+ 0xbc1f0d6d, 0xf81c3526, 0xb81e34b0, 0x3800f7bd,
+ 0x78012684, 0xf842e653, 0xb8417456, 0x385e2467,
+ 0x785e358b, 0x389e34c8, 0x788046f8, 0x78c00611,
+ 0xb89f8680, 0xfc582454, 0xbc5987d3, 0xfc076624,
+ 0xbc190675, 0xf833785a, 0xb82fd809, 0x3821799a,
+ 0x782a7975, 0xf870eaf0, 0xb871d96a, 0x386b7aed,
+ 0x7875689b, 0x38afd91a, 0x78a2c955, 0x78ee6bc8,
+ 0xb8b4f9dd, 0xfc76eb7e, 0xbc76692d, 0xfc31db28,
+ 0xbc255b01, 0xf91c52aa, 0xb91c3fb2, 0x391f8877,
+ 0x791ac97c, 0xf95c1758, 0xb95b3c55, 0x395ce0a4,
+ 0x795851ce, 0x399e9f64, 0x79993764, 0x79d9af8a,
+ 0xb99eea2a, 0xfd5a2f8d, 0xbd5dac78, 0xfd1e0182,
+ 0xbd195c31, 0x58000010, 0x1800000d, 0xf8981240,
+ 0xd8ffdf00, 0xf8a27a80, 0xf99af920, 0x1a0202e8,
+ 0x3a130078, 0x5a1d0316, 0x7a03036c, 0x9a0102eb,
+ 0xba1700bd, 0xda0c0329, 0xfa16000c, 0x0b23459a,
+ 0x2b328a14, 0xcb274bde, 0x6b222eab, 0x8b214b42,
+ 0xab34a7b2, 0xcb24520e, 0xeb378e20, 0x3a565283,
+ 0x7a420321, 0xba58c247, 0xfa4d5106, 0x3a426924,
+ 0x7a5b0847, 0xba413a02, 0xfa5fba23, 0x1a979377,
+ 0x1a86640a, 0x5a89300b, 0x5a923771, 0x9a8b720c,
+ 0x9a868786, 0xda9a736d, 0xda9256dd, 0x5ac0026c,
+ 0x5ac00657, 0x5ac00b89, 0x5ac01262, 0x5ac017b9,
+ 0xdac002e4, 0xdac0065d, 0xdac00907, 0xdac00e2d,
+ 0xdac01011, 0xdac01752, 0x1ad0098b, 0x1ac70d24,
+ 0x1ad020ec, 0x1ad72613, 0x1ac62887, 0x1ad72e95,
+ 0x9adc0990, 0x9acd0d84, 0x9ac721a9, 0x9acf277c,
+ 0x9ace2bd4, 0x9ade2e4e, 0x9bc77d63, 0x9b587e97,
+ 0x1b1524a2, 0x1b04a318, 0x9b0f4d8b, 0x9b0ce73d,
+ 0x9b2c5971, 0x9b34c87c, 0x9bbc6887, 0x9bb19556,
+ 0x1e310871, 0x1e261a2b, 0x1e2928fd, 0x1e333987,
+ 0x1e230ae0, 0x1e75087a, 0x1e651a60, 0x1e692b40,
+ 0x1e753ab9, 0x1e7309b0, 0x1f00425d, 0x1f1d95b7,
+ 0x1f2a38e9, 0x1f2f5f99, 0x1f5545a6, 0x1f429ea3,
+ 0x1f65472a, 0x1f7449ce, 0x1e20404f, 0x1e20c0f2,
+ 0x1e2140c3, 0x1e21c02c, 0x1e22c009, 0x1e6040a4,
+ 0x1e60c1e3, 0x1e614331, 0x1e61c30c, 0x1e6240b5,
+ 0x1e3802a4, 0x9e38007b, 0x1e78011d, 0x9e7802a9,
+ 0x1e2203b4, 0x9e220107, 0x1e6202ac, 0x9e6202b0,
+ 0x1e2600b2, 0x9e660119, 0x1e270352, 0x9e670160,
+ 0x1e262200, 0x1e7d2200, 0x1e2023c8, 0x1e602128,
+ 0x293e119b, 0x294a2543, 0x69480c70, 0xa934726a,
+ 0xa97448f3, 0x298243ca, 0x29e21242, 0x69c64db8,
+ 0xa9800311, 0xa9f4686e, 0x288a0416, 0x28fe2812,
+ 0x68fe62d8, 0xa885308c, 0xa8f12664, 0x282468d2,
+ 0x284e5035, 0xa8327699, 0xa84716e1, 0x0c407284,
+ 0x4cdfa158, 0x0ccf6cd8, 0x4cdf2483, 0x0d40c0c2,
+ 0x4ddfc9cd, 0x0dd8ceaf, 0x4c408ea9, 0x0cdf86bd,
+ 0x4d60c1c8, 0x0dffca87, 0x4de3cc7c, 0x4cdd497b,
+ 0x0c404950, 0x4d40e595, 0x4ddfeba4, 0x0dd3ed38,
+ 0x4cdf046a, 0x0cc9039b, 0x0d60e3d5, 0x0dffe5d7,
+ 0x0df4e9a4, 0xba5fd3e3, 0x3a5f03e5, 0xfa411be4,
+ 0x7a42cbe2, 0x93df03ff, 0xc820ffff, 0x8822fc7f,
+ 0xc8247cbf, 0x88267fff, 0x4e010fe0, 0x4e081fe1,
+ 0x4e0c1fe1, 0x4e0a1fe1, 0x4e071fe1, 0x4cc0ac3f,
+ 0x1e601000, 0x1e603000, 0x1e621000, 0x1e623000,
+ 0x1e641000, 0x1e643000, 0x1e661000, 0x1e663000,
+ 0x1e681000, 0x1e683000, 0x1e6a1000, 0x1e6a3000,
+ 0x1e6c1000, 0x1e6c3000, 0x1e6e1000, 0x1e6e3000,
+ 0x1e701000, 0x1e703000, 0x1e721000, 0x1e723000,
+ 0x1e741000, 0x1e743000, 0x1e761000, 0x1e763000,
+ 0x1e781000, 0x1e783000, 0x1e7a1000, 0x1e7a3000,
+ 0x1e7c1000, 0x1e7c3000, 0x1e7e1000, 0x1e7e3000,
+ 0xf8358305, 0xf82d01ed, 0xf8361353, 0xf839234a,
+ 0xf82531fb, 0xf8335165, 0xf83a4080, 0xf83673d7,
+ 0xf832611c, 0xf8ad837d, 0xf8ab01a5, 0xf8a112b8,
+ 0xf8bb2311, 0xf8b230be, 0xf8a75336, 0xf8a4427a,
+ 0xf8a6707e, 0xf8b860b7, 0xf8f88392, 0xf8f300ff,
+ 0xf8ed1386, 0xf8e822af, 0xf8e2302d, 0xf8f1533d,
+ 0xf8f941d2, 0xf8ff7366, 0xf8f061e5, 0xf86b8072,
+ 0xf87a0054, 0xf86b1164, 0xf87e22f3, 0xf86331cf,
+ 0xf87e5296, 0xf8674305, 0xf87771f0, 0xf86b6013,
+ 0xb83c803c, 0xb82b0195, 0xb83d1240, 0xb8252320,
+ 0xb82e3340, 0xb83c53b2, 0xb82f43a1, 0xb828739a,
+ 0xb831608e, 0xb8b88039, 0xb8aa0231, 0xb8bd12b4,
+ 0xb8bd2189, 0xb8ab30a6, 0xb8b552a7, 0xb8aa4197,
+ 0xb8b57145, 0xb8be6254, 0xb8ed80b7, 0xb8ef00b8,
+ 0xb8e9132a, 0xb8f42231, 0xb8ec33d2, 0xb8e35323,
+ 0xb8fa4159, 0xb8e273eb, 0xb8e760a2, 0xb8608287,
+ 0xb865005f, 0xb87b1379, 0xb87e2358, 0xb86f32c2,
+ 0xb86053e3, 0xb86f4154, 0xb87671d5, 0xb866605e,
+
};
// END Generated code -- do not edit
diff --git a/src/hotspot/cpu/aarch64/assembler_aarch64.hpp b/src/hotspot/cpu/aarch64/assembler_aarch64.hpp
index 9788931d4e1..3bb620d52e0 100644
--- a/src/hotspot/cpu/aarch64/assembler_aarch64.hpp
+++ b/src/hotspot/cpu/aarch64/assembler_aarch64.hpp
@@ -306,10 +306,12 @@ public:
};
class Post : public PrePost {
Register _idx;
+ bool _is_postreg;
public:
- Post(Register reg, int o) : PrePost(reg, o) { _idx = NULL; }
- Post(Register reg, Register idx) : PrePost(reg, 0) { _idx = idx; }
+ Post(Register reg, int o) : PrePost(reg, o) { _idx = NULL; _is_postreg = false; }
+ Post(Register reg, Register idx) : PrePost(reg, 0) { _idx = idx; _is_postreg = true; }
Register idx_reg() { return _idx; }
+ bool is_postreg() {return _is_postreg; }
};
namespace ext
@@ -393,7 +395,7 @@ class Address {
: _base(p.reg()), _offset(p.offset()), _mode(pre) { }
Address(Post p)
: _base(p.reg()), _index(p.idx_reg()), _offset(p.offset()),
- _mode(p.idx_reg() == NULL ? post : post_reg), _target(0) { }
+ _mode(p.is_postreg() ? post_reg : post), _target(0) { }
Address(address target, RelocationHolder const& rspec)
: _mode(literal),
_rspec(rspec),
@@ -807,32 +809,34 @@ public:
#undef INSN
// Bitfield
-#define INSN(NAME, opcode) \
+#define INSN(NAME, opcode, size) \
void NAME(Register Rd, Register Rn, unsigned immr, unsigned imms) { \
starti; \
+ guarantee(size == 1 || (immr < 32 && imms < 32), "incorrect immr/imms");\
f(opcode, 31, 22), f(immr, 21, 16), f(imms, 15, 10); \
zrf(Rn, 5), rf(Rd, 0); \
}
- INSN(sbfmw, 0b0001001100);
- INSN(bfmw, 0b0011001100);
- INSN(ubfmw, 0b0101001100);
- INSN(sbfm, 0b1001001101);
- INSN(bfm, 0b1011001101);
- INSN(ubfm, 0b1101001101);
+ INSN(sbfmw, 0b0001001100, 0);
+ INSN(bfmw, 0b0011001100, 0);
+ INSN(ubfmw, 0b0101001100, 0);
+ INSN(sbfm, 0b1001001101, 1);
+ INSN(bfm, 0b1011001101, 1);
+ INSN(ubfm, 0b1101001101, 1);
#undef INSN
// Extract
-#define INSN(NAME, opcode) \
+#define INSN(NAME, opcode, size) \
void NAME(Register Rd, Register Rn, Register Rm, unsigned imms) { \
starti; \
+ guarantee(size == 1 || imms < 32, "incorrect imms"); \
f(opcode, 31, 21), f(imms, 15, 10); \
- rf(Rm, 16), rf(Rn, 5), rf(Rd, 0); \
+ zrf(Rm, 16), zrf(Rn, 5), zrf(Rd, 0); \
}
- INSN(extrw, 0b00010011100);
- INSN(extr, 0b10010011110);
+ INSN(extrw, 0b00010011100, 0);
+ INSN(extr, 0b10010011110, 1);
#undef INSN
@@ -1126,7 +1130,7 @@ public:
Register Rn, enum operand_size sz, int op, bool ordered) {
starti;
f(sz, 31, 30), f(0b001000, 29, 24), f(op, 23, 21);
- rf(Rs, 16), f(ordered, 15), rf(Rt2, 10), srf(Rn, 5), zrf(Rt1, 0);
+ rf(Rs, 16), f(ordered, 15), zrf(Rt2, 10), srf(Rn, 5), zrf(Rt1, 0);
}
void load_exclusive(Register dst, Register addr,
@@ -1255,7 +1259,7 @@ public:
enum operand_size sz, int op1, int op2, bool a, bool r) {
starti;
f(sz, 31, 30), f(0b111000, 29, 24), f(a, 23), f(r, 22), f(1, 21);
- rf(Rs, 16), f(op1, 15), f(op2, 14, 12), f(0, 11, 10), srf(Rn, 5), zrf(Rt, 0);
+ zrf(Rs, 16), f(op1, 15), f(op2, 14, 12), f(0, 11, 10), srf(Rn, 5), zrf(Rt, 0);
}
#define INSN(NAME, NAME_A, NAME_L, NAME_AL, op1, op2) \
@@ -1477,6 +1481,7 @@ public:
void NAME(Register Rd, Register Rn, Register Rm, \
enum shift_kind kind = LSL, unsigned shift = 0) { \
starti; \
+ guarantee(size == 1 || shift < 32, "incorrect shift"); \
f(N, 21); \
zrf(Rm, 16), zrf(Rn, 5), zrf(Rd, 0); \
op_shifted_reg(0b01010, kind, shift, size, op); \
@@ -1539,6 +1544,7 @@ void mvnw(Register Rd, Register Rm,
starti; \
f(0, 21); \
assert_cond(kind != ROR); \
+ guarantee(size == 1 || shift < 32, "incorrect shift");\
zrf(Rd, 0), zrf(Rn, 5), zrf(Rm, 16); \
op_shifted_reg(0b01011, kind, shift, size, op); \
}
@@ -1567,7 +1573,7 @@ void mvnw(Register Rd, Register Rm,
void add_sub_extended_reg(unsigned op, unsigned decode,
Register Rd, Register Rn, Register Rm,
unsigned opt, ext::operation option, unsigned imm) {
- guarantee(imm <= 4, "shift amount must be < 4");
+ guarantee(imm <= 4, "shift amount must be <= 4");
f(op, 31, 29), f(decode, 28, 24), f(opt, 23, 22), f(1, 21);
f(option, 15, 13), f(imm, 12, 10);
}
@@ -1652,7 +1658,7 @@ void mvnw(Register Rd, Register Rm,
f(o2, 10);
f(o3, 4);
f(nzcv, 3, 0);
- f(imm5, 20, 16), rf(Rn, 5);
+ f(imm5, 20, 16), zrf(Rn, 5);
}
#define INSN(NAME, op) \
@@ -2121,7 +2127,12 @@ public:
}
void ld_st(FloatRegister Vt, SIMD_Arrangement T, Register Xn,
int imm, int op1, int op2, int regs) {
- guarantee(T <= T1Q && imm == SIMD_Size_in_bytes[T] * regs, "bad offset");
+
+ bool replicate = op2 >> 2 == 3;
+ // post-index value (imm) is formed differently for replicate/non-replicate ld* instructions
+ int expectedImmediate = replicate ? regs * (1 << (T >> 1)) : SIMD_Size_in_bytes[T] * regs;
+ guarantee(T < T1Q , "incorrect arrangement");
+ guarantee(imm == expectedImmediate, "bad offset");
starti;
f(0,31), f((int)T & 1, 30);
f(op1 | 0b100, 29, 21), f(0b11111, 20, 16), f(op2, 15, 12);
@@ -2228,42 +2239,47 @@ public:
#undef INSN
-#define INSN(NAME, opc, opc2) \
+#define INSN(NAME, opc, opc2, acceptT2D) \
void NAME(FloatRegister Vd, SIMD_Arrangement T, FloatRegister Vn, FloatRegister Vm) { \
+ guarantee(T != T1Q && T != T1D, "incorrect arrangement"); \
+ if (!acceptT2D) guarantee(T != T2D, "incorrect arrangement"); \
starti; \
f(0, 31), f((int)T & 1, 30), f(opc, 29), f(0b01110, 28, 24); \
f((int)T >> 1, 23, 22), f(1, 21), rf(Vm, 16), f(opc2, 15, 10); \
rf(Vn, 5), rf(Vd, 0); \
}
- INSN(addv, 0, 0b100001);
- INSN(subv, 1, 0b100001);
- INSN(mulv, 0, 0b100111);
- INSN(mlav, 0, 0b100101);
- INSN(mlsv, 1, 0b100101);
- INSN(sshl, 0, 0b010001);
- INSN(ushl, 1, 0b010001);
- INSN(umullv, 1, 0b110000);
- INSN(umlalv, 1, 0b100000);
+ INSN(addv, 0, 0b100001, true); // accepted arrangements: T8B, T16B, T4H, T8H, T2S, T4S, T2D
+ INSN(subv, 1, 0b100001, true); // accepted arrangements: T8B, T16B, T4H, T8H, T2S, T4S, T2D
+ INSN(mulv, 0, 0b100111, false); // accepted arrangements: T8B, T16B, T4H, T8H, T2S, T4S
+ INSN(mlav, 0, 0b100101, false); // accepted arrangements: T8B, T16B, T4H, T8H, T2S, T4S
+ INSN(mlsv, 1, 0b100101, false); // accepted arrangements: T8B, T16B, T4H, T8H, T2S, T4S
+ INSN(sshl, 0, 0b010001, true); // accepted arrangements: T8B, T16B, T4H, T8H, T2S, T4S, T2D
+ INSN(ushl, 1, 0b010001, true); // accepted arrangements: T8B, T16B, T4H, T8H, T2S, T4S, T2D
+ INSN(umullv, 1, 0b110000, false); // accepted arrangements: T8B, T16B, T4H, T8H, T2S, T4S
+ INSN(umlalv, 1, 0b100000, false); // accepted arrangements: T8B, T16B, T4H, T8H, T2S, T4S
#undef INSN
-#define INSN(NAME, opc, opc2) \
+#define INSN(NAME, opc, opc2, accepted) \
void NAME(FloatRegister Vd, SIMD_Arrangement T, FloatRegister Vn) { \
+ guarantee(T != T1Q && T != T1D, "incorrect arrangement"); \
+ if (accepted < 2) guarantee(T != T2S && T != T2D, "incorrect arrangement"); \
+ if (accepted == 0) guarantee(T == T8B || T == T16B, "incorrect arrangement"); \
starti; \
f(0, 31), f((int)T & 1, 30), f(opc, 29), f(0b01110, 28, 24); \
f((int)T >> 1, 23, 22), f(opc2, 21, 10); \
rf(Vn, 5), rf(Vd, 0); \
}
- INSN(absr, 0, 0b100000101110);
- INSN(negr, 1, 0b100000101110);
- INSN(notr, 1, 0b100000010110);
- INSN(addv, 0, 0b110001101110);
- INSN(cls, 0, 0b100000010010);
- INSN(clz, 1, 0b100000010010);
- INSN(cnt, 0, 0b100000010110);
- INSN(uaddlv, 1, 0b110000001110);
+ INSN(absr, 0, 0b100000101110, 1); // accepted arrangements: T8B, T16B, T4H, T8H, T4S
+ INSN(negr, 1, 0b100000101110, 2); // accepted arrangements: T8B, T16B, T4H, T8H, T2S, T4S, T2D
+ INSN(notr, 1, 0b100000010110, 0); // accepted arrangements: T8B, T16B
+ INSN(addv, 0, 0b110001101110, 1); // accepted arrangements: T8B, T16B, T4H, T8H, T4S
+ INSN(cls, 0, 0b100000010010, 1); // accepted arrangements: T8B, T16B, T4H, T8H, T4S
+ INSN(clz, 1, 0b100000010010, 1); // accepted arrangements: T8B, T16B, T4H, T8H, T4S
+ INSN(cnt, 0, 0b100000010110, 0); // accepted arrangements: T8B, T16B
+ INSN(uaddlv, 1, 0b110000001110, 1); // accepted arrangements: T8B, T16B, T4H, T8H, T4S
#undef INSN
@@ -2287,7 +2303,7 @@ public:
starti; \
assert(lsl == 0 || \
((T == T4H || T == T8H) && lsl == 8) || \
- ((T == T2S || T == T4S) && ((lsl >> 3) < 4)), "invalid shift"); \
+ ((T == T2S || T == T4S) && ((lsl >> 3) < 4) && ((lsl & 7) == 0)), "invalid shift");\
cmode |= lsl >> 2; \
if (T == T4H || T == T8H) cmode |= 0b1000; \
if (!(T == T4H || T == T8H || T == T2S || T == T4S)) { \
@@ -2448,7 +2464,8 @@ public:
#undef INSN
- void ushll(FloatRegister Vd, SIMD_Arrangement Ta, FloatRegister Vn, SIMD_Arrangement Tb, int shift) {
+private:
+ void _ushll(FloatRegister Vd, SIMD_Arrangement Ta, FloatRegister Vn, SIMD_Arrangement Tb, int shift) {
starti;
/* The encodings for the immh:immb fields (bits 22:16) are
* 0001 xxx 8H, 8B/16b shift = xxx
@@ -2461,8 +2478,16 @@ public:
f(0, 31), f(Tb & 1, 30), f(0b1011110, 29, 23), f((1 << ((Tb>>1)+3))|shift, 22, 16);
f(0b101001, 15, 10), rf(Vn, 5), rf(Vd, 0);
}
+
+public:
+ void ushll(FloatRegister Vd, SIMD_Arrangement Ta, FloatRegister Vn, SIMD_Arrangement Tb, int shift) {
+ assert(Tb == T8B || Tb == T4H || Tb == T2S, "invalid arrangement");
+ _ushll(Vd, Ta, Vn, Tb, shift);
+ }
+
void ushll2(FloatRegister Vd, SIMD_Arrangement Ta, FloatRegister Vn, SIMD_Arrangement Tb, int shift) {
- ushll(Vd, Ta, Vn, Tb, shift);
+ assert(Tb == T16B || Tb == T8H || Tb == T4S, "invalid arrangement");
+ _ushll(Vd, Ta, Vn, Tb, shift);
}
// Move from general purpose register
@@ -2470,19 +2495,21 @@ public:
void mov(FloatRegister Vd, SIMD_Arrangement T, int index, Register Xn) {
starti;
f(0b01001110000, 31, 21), f(((1 << (T >> 1)) | (index << ((T >> 1) + 1))), 20, 16);
- f(0b000111, 15, 10), rf(Xn, 5), rf(Vd, 0);
+ f(0b000111, 15, 10), zrf(Xn, 5), rf(Vd, 0);
}
// Move to general purpose register
// mov Rd, Vn.T[index]
void mov(Register Xd, FloatRegister Vn, SIMD_Arrangement T, int index) {
+ guarantee(T >= T2S && T < T1Q, "only D and S arrangements are supported");
starti;
f(0, 31), f((T >= T1D) ? 1:0, 30), f(0b001110000, 29, 21);
f(((1 << (T >> 1)) | (index << ((T >> 1) + 1))), 20, 16);
f(0b001111, 15, 10), rf(Vn, 5), rf(Xd, 0);
}
- void pmull(FloatRegister Vd, SIMD_Arrangement Ta, FloatRegister Vn, FloatRegister Vm, SIMD_Arrangement Tb) {
+private:
+ void _pmull(FloatRegister Vd, SIMD_Arrangement Ta, FloatRegister Vn, FloatRegister Vm, SIMD_Arrangement Tb) {
starti;
assert((Ta == T1Q && (Tb == T1D || Tb == T2D)) ||
(Ta == T8H && (Tb == T8B || Tb == T16B)), "Invalid Size specifier");
@@ -2490,9 +2517,16 @@ public:
f(0, 31), f(Tb & 1, 30), f(0b001110, 29, 24), f(size, 23, 22);
f(1, 21), rf(Vm, 16), f(0b111000, 15, 10), rf(Vn, 5), rf(Vd, 0);
}
+
+public:
+ void pmull(FloatRegister Vd, SIMD_Arrangement Ta, FloatRegister Vn, FloatRegister Vm, SIMD_Arrangement Tb) {
+ assert(Tb == T1D || Tb == T8B, "pmull assumes T1D or T8B as the second size specifier");
+ _pmull(Vd, Ta, Vn, Vm, Tb);
+ }
+
void pmull2(FloatRegister Vd, SIMD_Arrangement Ta, FloatRegister Vn, FloatRegister Vm, SIMD_Arrangement Tb) {
assert(Tb == T2D || Tb == T16B, "pmull2 assumes T2D or T16B as the second size specifier");
- pmull(Vd, Ta, Vn, Vm, Tb);
+ _pmull(Vd, Ta, Vn, Vm, Tb);
}
void uqxtn(FloatRegister Vd, SIMD_Arrangement Tb, FloatRegister Vn, SIMD_Arrangement Ta) {
@@ -2509,7 +2543,7 @@ public:
starti;
assert(T != T1D, "reserved encoding");
f(0,31), f((int)T & 1, 30), f(0b001110000, 29, 21);
- f((1 << (T >> 1)), 20, 16), f(0b000011, 15, 10), rf(Xs, 5), rf(Vd, 0);
+ f((1 << (T >> 1)), 20, 16), f(0b000011, 15, 10), zrf(Xs, 5), rf(Vd, 0);
}
void dup(FloatRegister Vd, SIMD_Arrangement T, FloatRegister Vn, int index = 0)
@@ -2524,6 +2558,7 @@ public:
// AdvSIMD ZIP/UZP/TRN
#define INSN(NAME, opcode) \
void NAME(FloatRegister Vd, SIMD_Arrangement T, FloatRegister Vn, FloatRegister Vm) { \
+ guarantee(T != T1D && T != T1Q, "invalid arrangement"); \
starti; \
f(0, 31), f(0b001110, 29, 24), f(0, 21), f(0, 15); \
f(opcode, 14, 12), f(0b10, 11, 10); \
diff --git a/src/hotspot/cpu/aarch64/register_aarch64.hpp b/src/hotspot/cpu/aarch64/register_aarch64.hpp
index 1d3e3239df7..3bacd5e10fe 100644
--- a/src/hotspot/cpu/aarch64/register_aarch64.hpp
+++ b/src/hotspot/cpu/aarch64/register_aarch64.hpp
@@ -136,7 +136,7 @@ class FloatRegisterImpl: public AbstractRegisterImpl {
VMReg as_VMReg();
// derived registers, offsets, and addresses
- FloatRegister successor() const { return as_FloatRegister(encoding() + 1); }
+ FloatRegister successor() const { return as_FloatRegister((encoding() + 1) % 32); }
// accessors
int encoding() const { assert(is_valid(), "invalid register"); return (intptr_t)this; }
From 2f1b1de1e84d21429a7f69a90602aba37d0165a7 Mon Sep 17 00:00:00 2001
From: Daniil Titov
Date: Mon, 10 Jun 2019 09:41:09 -0700
Subject: [PATCH 012/109] 8222828:
vmTestbase/nsk/jdi/BScenarios/multithrd/tc02x004/TestDescription.java failed
Reviewed-by: cjplummer, gadams, jcbeyler
---
.../vmTestbase/nsk/jdi/BScenarios/multithrd/tc02x004.java | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/BScenarios/multithrd/tc02x004.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/BScenarios/multithrd/tc02x004.java
index 9806d30f4da..50b7d24a506 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/BScenarios/multithrd/tc02x004.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/BScenarios/multithrd/tc02x004.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2019, 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
@@ -23,6 +23,7 @@
package nsk.jdi.BScenarios.multithrd;
+import jdk.test.lib.Utils;
import nsk.share.*;
import nsk.share.jpda.*;
import nsk.share.jdi.*;
@@ -95,7 +96,7 @@ public class tc02x004 {
ArgumentHandler argHandler = new ArgumentHandler(argv);
log = new Log(out, argHandler);
- waitTime = argHandler.getWaitTime() * 60000;
+ waitTime = Utils.adjustTimeout(argHandler.getWaitTime() * 60000);
Binder binder = new Binder(argHandler, log);
debugee = binder.bindToDebugee(debugeeName);
@@ -114,6 +115,7 @@ public class tc02x004 {
}
display("Test finished. exitStatus = " + exitStatus);
+ debugee.endDebugee();
return exitStatus;
}
From 712996ae87e7f25c995d833a64594ceb5753f7f9 Mon Sep 17 00:00:00 2001
From: Zhengyu Gu
Date: Mon, 10 Jun 2019 13:42:11 -0400
Subject: [PATCH 013/109] 8225514: Shenandoah: ShenandoahCodeRoots should
inherit from AllStatic
Reviewed-by: shade
---
src/hotspot/share/gc/shenandoah/shenandoahCodeRoots.hpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahCodeRoots.hpp b/src/hotspot/share/gc/shenandoah/shenandoahCodeRoots.hpp
index 5b51426dac2..4a9ea36ba90 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahCodeRoots.hpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahCodeRoots.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018, Red Hat, Inc. All rights reserved.
+ * Copyright (c) 2017, 2019, Red Hat, Inc. All rights reserved.
*
* 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
@@ -122,7 +122,7 @@ public:
void possibly_parallel_blobs_do(CodeBlobClosure* f);
};
-class ShenandoahCodeRoots : public CHeapObj {
+class ShenandoahCodeRoots : public AllStatic {
friend class ShenandoahHeap;
friend class ShenandoahCodeRootsIterator;
From 3c5ff8db74f572ffae5b65610d386a359622e17a Mon Sep 17 00:00:00 2001
From: Doug Simon
Date: Mon, 10 Jun 2019 15:55:11 -0700
Subject: [PATCH 014/109] 8225492: Update JVMCI
Reviewed-by: iveresov, kvn
---
src/hotspot/share/jvmci/jvmciRuntime.cpp | 27 ++++++++++---------
.../src/jdk/vm/ci/runtime/JVMCI.java | 2 ++
2 files changed, 16 insertions(+), 13 deletions(-)
diff --git a/src/hotspot/share/jvmci/jvmciRuntime.cpp b/src/hotspot/share/jvmci/jvmciRuntime.cpp
index bcc403412d5..c22d50ca1a8 100644
--- a/src/hotspot/share/jvmci/jvmciRuntime.cpp
+++ b/src/hotspot/share/jvmci/jvmciRuntime.cpp
@@ -1339,6 +1339,18 @@ JVMCI::CodeInstallResult JVMCIRuntime::validate_compile_task_dependencies(Depend
return JVMCI::dependencies_invalid;
}
+// Reports a pending exception and exits the VM.
+static void fatal_exception_in_compile(JVMCIEnv* JVMCIENV, JavaThread* thread, const char* msg) {
+ // Only report a fatal JVMCI compilation exception once
+ static volatile int report_init_failure = 0;
+ if (!report_init_failure && Atomic::cmpxchg(1, &report_init_failure, 0) == 0) {
+ tty->print_cr("%s:", msg);
+ JVMCIENV->describe_pending_exception(true);
+ }
+ JVMCIENV->clear_pending_exception();
+ before_exit(thread);
+ vm_exit(-1);
+}
void JVMCIRuntime::compile_method(JVMCIEnv* JVMCIENV, JVMCICompiler* compiler, const methodHandle& method, int entry_bci) {
JVMCI_EXCEPTION_CONTEXT
@@ -1360,9 +1372,7 @@ void JVMCIRuntime::compile_method(JVMCIEnv* JVMCIENV, JVMCICompiler* compiler, c
HandleMark hm;
JVMCIObject receiver = get_HotSpotJVMCIRuntime(JVMCIENV);
if (JVMCIENV->has_pending_exception()) {
- JVMCIENV->describe_pending_exception(true);
- compile_state->set_failure(false, "exception getting HotSpotJVMCIRuntime object");
- return;
+ fatal_exception_in_compile(JVMCIENV, thread, "Exception during HotSpotJVMCIRuntime initialization");
}
JVMCIObject jvmci_method = JVMCIENV->get_jvmci_method(method, JVMCIENV);
if (JVMCIENV->has_pending_exception()) {
@@ -1397,16 +1407,7 @@ void JVMCIRuntime::compile_method(JVMCIEnv* JVMCIENV, JVMCICompiler* compiler, c
} else {
// An uncaught exception here implies failure during compiler initialization.
// The only sensible thing to do here is to exit the VM.
-
- // Only report initialization failure once
- static volatile int report_init_failure = 0;
- if (!report_init_failure && Atomic::cmpxchg(1, &report_init_failure, 0) == 0) {
- tty->print_cr("Exception during JVMCI compiler initialization:");
- JVMCIENV->describe_pending_exception(true);
- }
- JVMCIENV->clear_pending_exception();
- before_exit((JavaThread*) THREAD);
- vm_exit(-1);
+ fatal_exception_in_compile(JVMCIENV, thread, "Exception during JVMCI compiler initialization");
}
if (compiler->is_bootstrapping()) {
compiler->set_bootstrap_compilation_request_handled();
diff --git a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.runtime/src/jdk/vm/ci/runtime/JVMCI.java b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.runtime/src/jdk/vm/ci/runtime/JVMCI.java
index bd7ef10ea87..12ad2bb30d3 100644
--- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.runtime/src/jdk/vm/ci/runtime/JVMCI.java
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.runtime/src/jdk/vm/ci/runtime/JVMCI.java
@@ -71,6 +71,8 @@ public class JVMCI {
errorMessage.format("Currently used Java home directory is %s.%n", javaHome);
errorMessage.format("Currently used VM configuration is: %s", vmName);
throw new UnsupportedOperationException(errorMessage.toString());
+ } finally {
+ initializing = false;
}
}
}
From ac1a11dfc640726ffc1a513baa5a14c449692bda Mon Sep 17 00:00:00 2001
From: Joe Darcy
Date: Mon, 10 Jun 2019 15:53:35 -0700
Subject: [PATCH 015/109] 8225532: Update source enums to describe 12 and 13
language features
Reviewed-by: jjg
---
.../share/classes/javax/lang/model/SourceVersion.java | 4 ++--
.../share/classes/com/sun/tools/javac/code/Source.java | 9 ++++++---
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/src/java.compiler/share/classes/javax/lang/model/SourceVersion.java b/src/java.compiler/share/classes/javax/lang/model/SourceVersion.java
index 0e37c9d95bc..fd967a0b73e 100644
--- a/src/java.compiler/share/classes/javax/lang/model/SourceVersion.java
+++ b/src/java.compiler/share/classes/javax/lang/model/SourceVersion.java
@@ -58,8 +58,8 @@ public enum SourceVersion {
* 9: modules, small cleanups to 1.7 and 1.8 changes
* 10: local-variable type inference (var)
* 11: local-variable syntax for lambda parameters
- * 12: no changes (switch expressions in preview)
- * 13: TBD
+ * 12: no changes (switch expressions were in preview)
+ * 13: no changes (switch expressions and text blocks in preview)
*/
/**
diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Source.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Source.java
index 311bd4c7d6b..e8c0eb32d76 100644
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Source.java
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Source.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2019, 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
@@ -84,10 +84,13 @@ public enum Source {
/** 1.11 local-variable syntax for lambda parameters */
JDK11("11"),
- /** 12 covers the to be determined language features that will be added in JDK 12. */
+ /** 12, no language features; switch expression were in preview */
JDK12("12"),
- /** 13 covers the to be determined language features that will be added in JDK 13. */
+ /**
+ * 13, no language features; text blocks and revised switch
+ * expressions in preview
+ */
JDK13("13");
private static final Context.Key sourceKey = new Context.Key<>();
From 6758853b547c4958cbffdb1316dd881420fa0631 Mon Sep 17 00:00:00 2001
From: Stuart Marks
Date: Mon, 10 Jun 2019 17:33:11 -0700
Subject: [PATCH 016/109] 8205131: remove Runtime trace methods
Reviewed-by: lancea, rriggs, iklam
---
.../share/classes/java/lang/Runtime.java | 26 -------------------
.../jaxp/unittest/transform/ProcessXSLT.java | 3 ---
.../CommandEnvironment/SetChildEnv.java | 4 +--
.../jdk/sun/rmi/log/ReliableLog/Recovery.java | 8 +-----
4 files changed, 2 insertions(+), 39 deletions(-)
diff --git a/src/java.base/share/classes/java/lang/Runtime.java b/src/java.base/share/classes/java/lang/Runtime.java
index ee83c7abb41..efe3adefb63 100644
--- a/src/java.base/share/classes/java/lang/Runtime.java
+++ b/src/java.base/share/classes/java/lang/Runtime.java
@@ -683,32 +683,6 @@ public class Runtime {
SharedSecrets.getJavaLangRefAccess().runFinalization();
}
- /**
- * Not implemented, does nothing.
- *
- * @deprecated
- * This method was intended to control instruction tracing.
- * It has been superseded by JVM-specific tracing mechanisms.
- * This method is subject to removal in a future version of Java SE.
- *
- * @param on ignored
- */
- @Deprecated(since="9", forRemoval=true)
- public void traceInstructions(boolean on) { }
-
- /**
- * Not implemented, does nothing.
- *
- * @deprecated
- * This method was intended to control method call tracing.
- * It has been superseded by JVM-specific tracing mechanisms.
- * This method is subject to removal in a future version of Java SE.
- *
- * @param on ignored
- */
- @Deprecated(since="9", forRemoval=true)
- public void traceMethodCalls(boolean on) { }
-
/**
* Loads the native library specified by the filename argument. The filename
* argument must be an absolute path name.
diff --git a/test/jaxp/javax/xml/jaxp/unittest/transform/ProcessXSLT.java b/test/jaxp/javax/xml/jaxp/unittest/transform/ProcessXSLT.java
index 3425585fb22..ccaa8c7122b 100644
--- a/test/jaxp/javax/xml/jaxp/unittest/transform/ProcessXSLT.java
+++ b/test/jaxp/javax/xml/jaxp/unittest/transform/ProcessXSLT.java
@@ -145,15 +145,12 @@ public class ProcessXSLT
*/
public static void main(String argv[]) {
- // Runtime.getRuntime().traceMethodCalls(false); // turns Java tracing off
boolean doStackDumpOnError = false;
boolean doDiag = false;
boolean setQuietMode = false;
String msg = null;
boolean isSecureProcessing = false;
- // Runtime.getRuntime().traceMethodCalls(false);
- // Runtime.getRuntime().traceInstructions(false);
/**
* The default diagnostic writer...
*/
diff --git a/test/jdk/java/rmi/activation/CommandEnvironment/SetChildEnv.java b/test/jdk/java/rmi/activation/CommandEnvironment/SetChildEnv.java
index c544c3d526d..1b7b8f6a7f5 100644
--- a/test/jdk/java/rmi/activation/CommandEnvironment/SetChildEnv.java
+++ b/test/jdk/java/rmi/activation/CommandEnvironment/SetChildEnv.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2019, 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
@@ -123,9 +123,7 @@ public class SetChildEnv
"WHO INQUIRE ABOUT MY PARENTS.";
System.out.println(complaint);
- //Runtime.getRuntime().traceMethodCalls(true);
String res = doctor.complain(complaint);
- //Runtime.getRuntime().traceMethodCalls(false);
System.out.println (" => " + res);
// Get debugExec line, allowing 15 seconds for it to flush
diff --git a/test/jdk/sun/rmi/log/ReliableLog/Recovery.java b/test/jdk/sun/rmi/log/ReliableLog/Recovery.java
index 4e45bb11df8..61d9a633ac9 100644
--- a/test/jdk/sun/rmi/log/ReliableLog/Recovery.java
+++ b/test/jdk/sun/rmi/log/ReliableLog/Recovery.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2019, 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
@@ -88,13 +88,7 @@ public class Recovery
Recovery handler = new Recovery();
ReliableLog log;
- if (size == 4 && deathpoint == 6) {
- Runtime.getRuntime().traceMethodCalls(true);
- }
log = new ReliableLog(dir, handler);
- if (size == 4 && deathpoint == 6) {
- Runtime.getRuntime().traceMethodCalls(false);
- }
// Generate a number of updates (size - 1) until failing
int i;
From 6a7c8b3e0181e8ca3511bc859befe8e1834b2a4c Mon Sep 17 00:00:00 2001
From: Igor Ignatyev
Date: Mon, 10 Jun 2019 17:11:04 -0700
Subject: [PATCH 017/109] 8209917: fix TODO in GatherDiagnosticInfoObserver
Reviewed-by: jjg, dholmes
---
.../jtreg/GatherDiagnosticInfoObserver.java | 19 ++++++++-----------
1 file changed, 8 insertions(+), 11 deletions(-)
diff --git a/test/failure_handler/src/share/classes/jdk/test/failurehandler/jtreg/GatherDiagnosticInfoObserver.java b/test/failure_handler/src/share/classes/jdk/test/failurehandler/jtreg/GatherDiagnosticInfoObserver.java
index 045c27a4c98..12dd8a42b44 100644
--- a/test/failure_handler/src/share/classes/jdk/test/failurehandler/jtreg/GatherDiagnosticInfoObserver.java
+++ b/test/failure_handler/src/share/classes/jdk/test/failurehandler/jtreg/GatherDiagnosticInfoObserver.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, 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
@@ -26,7 +26,7 @@ package jdk.test.failurehandler.jtreg;
import com.sun.javatest.Harness;
import com.sun.javatest.Parameters;
import com.sun.javatest.TestResult;
-import com.sun.javatest.InterviewParameters;
+import com.sun.javatest.regtest.config.RegressionParameters;
import jdk.test.failurehandler.*;
import java.io.File;
@@ -46,8 +46,8 @@ public class GatherDiagnosticInfoObserver implements Harness.Observer {
public static final String LOG_FILENAME = "environment.log";
public static final String ENVIRONMENT_OUTPUT = "environment.html";
- private String compileJdk;
- private String testJdk;
+ private Path compileJdk;
+ private Path testJdk;
/*
* The harness calls this method after each test.
@@ -80,7 +80,7 @@ public class GatherDiagnosticInfoObserver implements Harness.Observer {
log.printf("%s ---%n", name);
GathererFactory gathererFactory = new GathererFactory(
OS.current().family, workDir, log,
- Paths.get(testJdk), Paths.get(compileJdk));
+ testJdk, compileJdk);
gatherEnvInfo(workDir, name, log,
gathererFactory.getEnvironmentInfoGatherer());
} catch (Throwable e) {
@@ -117,12 +117,9 @@ public class GatherDiagnosticInfoObserver implements Harness.Observer {
*/
@Override
public void startingTestRun(Parameters params) {
- // TODO find a better way to get JDKs
- InterviewParameters rp = (InterviewParameters) params;
- Map map = new HashMap<>();
- rp.save(map);
- compileJdk = map.get("regtest.compilejdk");
- testJdk = map.get("regtest.testjdk");
+ RegressionParameters rp = (RegressionParameters) params;
+ compileJdk = rp.getCompileJDK().getAbsoluteFile().toPath();
+ testJdk = rp.getTestJDK().getAbsoluteFile().toPath();
}
@Override
From d216c34a434865e9b349f799b90a1300d81fcbcd Mon Sep 17 00:00:00 2001
From: Nils Eliasson
Date: Tue, 11 Jun 2019 09:27:51 +0200
Subject: [PATCH 018/109] 8225509: clean_catch_blocks must add preds first
Reviewed-by: kvn
---
src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp b/src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp
index 887496941ae..867448c4473 100644
--- a/src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp
+++ b/src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp
@@ -1356,6 +1356,14 @@ void ZBarrierSetC2::clean_catch_blocks(PhaseIdealLoop* phase) const {
while(nodeStack.length() > 0) {
Node *n = nodeStack.pop();
+ for (uint i = 0; i < n->len(); i++) {
+ if (n->in(i)) {
+ if (!visited.test_set(n->in(i)->_idx)) {
+ nodeStack.push(n->in(i));
+ }
+ }
+ }
+
bool is_old_node = (n->_idx < new_ids); // don't process nodes that were created during cleanup
if (n->is_Load() && is_old_node) {
LoadNode* load = n->isa_Load();
@@ -1364,14 +1372,6 @@ void ZBarrierSetC2::clean_catch_blocks(PhaseIdealLoop* phase) const {
process_catch_cleanup_candidate(phase, load);
}
}
-
- for (uint i = 0; i < n->len(); i++) {
- if (n->in(i)) {
- if (!visited.test_set(n->in(i)->_idx)) {
- nodeStack.push(n->in(i));
- }
- }
- }
}
C->print_method(PHASE_CALL_CATCH_CLEANUP, 2);
From 98e6903c57b0a75323c4556b79ff2062ad7a22ed Mon Sep 17 00:00:00 2001
From: Martin Doerr
Date: Tue, 11 Jun 2019 09:51:33 +0200
Subject: [PATCH 019/109] 8224826: Implement fast class initialization checks
on PPC64
Reviewed-by: vlivanov, gromero
---
src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp | 14 ++++++-
src/hotspot/cpu/ppc/interp_masm_ppc.hpp | 2 +
src/hotspot/cpu/ppc/interp_masm_ppc_64.cpp | 12 ++++++
src/hotspot/cpu/ppc/macroAssembler_ppc.cpp | 35 +++++++++++++++++
src/hotspot/cpu/ppc/macroAssembler_ppc.hpp | 6 +++
src/hotspot/cpu/ppc/ppc.ad | 18 +++++++++
src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp | 40 +++++++++++++++++++-
src/hotspot/cpu/ppc/templateTable_ppc_64.cpp | 22 ++++++++---
src/hotspot/cpu/ppc/vm_version_ppc.hpp | 3 ++
9 files changed, 145 insertions(+), 7 deletions(-)
diff --git a/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp b/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp
index fb188235673..e22a4c5ee93 100644
--- a/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp
+++ b/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp
@@ -80,7 +80,19 @@ int LIR_Assembler::check_icache() {
}
void LIR_Assembler::clinit_barrier(ciMethod* method) {
- ShouldNotReachHere(); // not implemented
+ assert(!method->holder()->is_not_initialized(), "initialization should have been started");
+
+ Label L_skip_barrier;
+ Register klass = R20;
+
+ metadata2reg(method->holder()->constant_encoding(), klass);
+ __ clinit_barrier(klass, R16_thread, &L_skip_barrier /*L_fast_path*/);
+
+ __ load_const_optimized(klass, SharedRuntime::get_handle_wrong_method_stub(), R0);
+ __ mtctr(klass);
+ __ bctr();
+
+ __ bind(L_skip_barrier);
}
void LIR_Assembler::osr_entry() {
diff --git a/src/hotspot/cpu/ppc/interp_masm_ppc.hpp b/src/hotspot/cpu/ppc/interp_masm_ppc.hpp
index 0522422e9e4..d58740d5a74 100644
--- a/src/hotspot/cpu/ppc/interp_masm_ppc.hpp
+++ b/src/hotspot/cpu/ppc/interp_masm_ppc.hpp
@@ -82,6 +82,8 @@ class InterpreterMacroAssembler: public MacroAssembler {
// load cpool->resolved_klass_at(index)
void load_resolved_klass_at_offset(Register Rcpool, Register Roffset, Register Rklass);
+ void load_resolved_method_at_index(int byte_no, Register cache, Register method);
+
void load_receiver(Register Rparam_count, Register Rrecv_dst);
// helpers for expression stack
diff --git a/src/hotspot/cpu/ppc/interp_masm_ppc_64.cpp b/src/hotspot/cpu/ppc/interp_masm_ppc_64.cpp
index a8d719a7836..692595859f7 100644
--- a/src/hotspot/cpu/ppc/interp_masm_ppc_64.cpp
+++ b/src/hotspot/cpu/ppc/interp_masm_ppc_64.cpp
@@ -516,6 +516,18 @@ void InterpreterMacroAssembler::load_resolved_klass_at_offset(Register Rcpool, R
ldx(Rklass, Rklass, Roffset);
}
+void InterpreterMacroAssembler::load_resolved_method_at_index(int byte_no,
+ Register cache,
+ Register method) {
+ const int method_offset = in_bytes(
+ ConstantPoolCache::base_offset() +
+ ((byte_no == TemplateTable::f2_byte)
+ ? ConstantPoolCacheEntry::f2_offset()
+ : ConstantPoolCacheEntry::f1_offset()));
+
+ ld(method, method_offset, cache); // get f1 Method*
+}
+
// Generate a subtype check: branch to ok_is_subtype if sub_klass is
// a subtype of super_klass. Blows registers Rsub_klass, tmp1, tmp2.
void InterpreterMacroAssembler::gen_subtype_check(Register Rsub_klass, Register Rsuper_klass, Register Rtmp1,
diff --git a/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp b/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp
index 2af92f4a131..d67c55b8f33 100644
--- a/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp
+++ b/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp
@@ -2011,6 +2011,35 @@ void MacroAssembler::check_klass_subtype(Register sub_klass,
bind(L_failure); // Fallthru if not successful.
}
+void MacroAssembler::clinit_barrier(Register klass, Register thread, Label* L_fast_path, Label* L_slow_path) {
+ assert(L_fast_path != NULL || L_slow_path != NULL, "at least one is required");
+
+ Label L_fallthrough;
+ if (L_fast_path == NULL) {
+ L_fast_path = &L_fallthrough;
+ } else if (L_slow_path == NULL) {
+ L_slow_path = &L_fallthrough;
+ }
+
+ // Fast path check: class is fully initialized
+ lbz(R0, in_bytes(InstanceKlass::init_state_offset()), klass);
+ cmpwi(CCR0, R0, InstanceKlass::fully_initialized);
+ beq(CCR0, *L_fast_path);
+
+ // Fast path check: current thread is initializer thread
+ ld(R0, in_bytes(InstanceKlass::init_thread_offset()), klass);
+ cmpd(CCR0, thread, R0);
+ if (L_slow_path == &L_fallthrough) {
+ beq(CCR0, *L_fast_path);
+ } else if (L_fast_path == &L_fallthrough) {
+ bne(CCR0, *L_slow_path);
+ } else {
+ Unimplemented();
+ }
+
+ bind(L_fallthrough);
+}
+
void MacroAssembler::check_method_handle_type(Register mtype_reg, Register mh_reg,
Register temp_reg,
Label& wrong_method_type) {
@@ -3194,6 +3223,12 @@ void MacroAssembler::load_mirror_from_const_method(Register mirror, Register con
resolve_oop_handle(mirror);
}
+void MacroAssembler::load_method_holder(Register holder, Register method) {
+ ld(holder, in_bytes(Method::const_offset()), method);
+ ld(holder, in_bytes(ConstMethod::constants_offset()), holder);
+ ld(holder, ConstantPool::pool_holder_offset_in_bytes(), holder);
+}
+
// Clear Array
// For very short arrays. tmp == R0 is allowed.
void MacroAssembler::clear_memory_unrolled(Register base_ptr, int cnt_dwords, Register tmp, int offset) {
diff --git a/src/hotspot/cpu/ppc/macroAssembler_ppc.hpp b/src/hotspot/cpu/ppc/macroAssembler_ppc.hpp
index f16538c1682..5a756653fb6 100644
--- a/src/hotspot/cpu/ppc/macroAssembler_ppc.hpp
+++ b/src/hotspot/cpu/ppc/macroAssembler_ppc.hpp
@@ -559,6 +559,11 @@ class MacroAssembler: public Assembler {
Register temp2_reg,
Label& L_success);
+ void clinit_barrier(Register klass,
+ Register thread,
+ Label* L_fast_path = NULL,
+ Label* L_slow_path = NULL);
+
// Method handle support (JSR 292).
void check_method_handle_type(Register mtype_reg, Register mh_reg, Register temp_reg, Label& wrong_method_type);
@@ -722,6 +727,7 @@ class MacroAssembler: public Assembler {
void resolve_oop_handle(Register result);
void load_mirror_from_const_method(Register mirror, Register const_method);
+ void load_method_holder(Register holder, Register method);
static int instr_size_for_decode_klass_not_null();
void decode_klass_not_null(Register dst, Register src = noreg);
diff --git a/src/hotspot/cpu/ppc/ppc.ad b/src/hotspot/cpu/ppc/ppc.ad
index 301a1aa3590..73272a0c1cd 100644
--- a/src/hotspot/cpu/ppc/ppc.ad
+++ b/src/hotspot/cpu/ppc/ppc.ad
@@ -1400,6 +1400,24 @@ void MachPrologNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
___(mflr) mflr(return_pc);
}
+ if (C->clinit_barrier_on_entry()) {
+ assert(!C->method()->holder()->is_not_initialized(), "initialization should have been started");
+
+ Label L_skip_barrier;
+ Register klass = toc_temp;
+
+ // Notify OOP recorder (don't need the relocation)
+ AddressLiteral md = __ constant_metadata_address(C->method()->holder()->constant_encoding());
+ __ load_const_optimized(klass, md.value(), R0);
+ __ clinit_barrier(klass, R16_thread, &L_skip_barrier /*L_fast_path*/);
+
+ __ load_const_optimized(klass, SharedRuntime::get_handle_wrong_method_stub(), R0);
+ __ mtctr(klass);
+ __ bctr();
+
+ __ bind(L_skip_barrier);
+ }
+
// Calls to C2R adapters often do not accept exceptional returns.
// We require that their callers must bang for them. But be
// careful, because some VM calls (such as call site linkage) can
diff --git a/src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp b/src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp
index bbf22fb792c..35bec6eed21 100644
--- a/src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp
+++ b/src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp
@@ -1274,7 +1274,30 @@ AdapterHandlerEntry* SharedRuntime::generate_i2c2i_adapters(MacroAssembler *masm
// entry: c2i
- c2i_entry = gen_c2i_adapter(masm, total_args_passed, comp_args_on_stack, sig_bt, regs, call_interpreter, ientry);
+ c2i_entry = __ pc();
+
+ // Class initialization barrier for static methods
+ if (VM_Version::supports_fast_class_init_checks()) {
+ Label L_skip_barrier;
+
+ { // Bypass the barrier for non-static methods
+ __ lwz(R0, in_bytes(Method::access_flags_offset()), R19_method);
+ __ andi_(R0, R0, JVM_ACC_STATIC);
+ __ beq(CCR0, L_skip_barrier); // non-static
+ }
+
+ Register klass = R11_scratch1;
+ __ load_method_holder(klass, R19_method);
+ __ clinit_barrier(klass, R16_thread, &L_skip_barrier /*L_fast_path*/);
+
+ __ load_const_optimized(klass, SharedRuntime::get_handle_wrong_method_stub(), R0);
+ __ mtctr(klass);
+ __ bctr();
+
+ __ bind(L_skip_barrier);
+ }
+
+ gen_c2i_adapter(masm, total_args_passed, comp_args_on_stack, sig_bt, regs, call_interpreter, ientry);
return AdapterHandlerLibrary::new_entry(fingerprint, i2c_entry, c2i_entry, c2i_unverified_entry);
}
@@ -2106,6 +2129,21 @@ nmethod *SharedRuntime::generate_native_wrapper(MacroAssembler *masm,
__ tabort_();
}
+ if (VM_Version::supports_fast_class_init_checks() && method->needs_clinit_barrier()) {
+ Label L_skip_barrier;
+ Register klass = r_temp_1;
+ // Notify OOP recorder (don't need the relocation)
+ AddressLiteral md = __ constant_metadata_address(method->method_holder());
+ __ load_const_optimized(klass, md.value(), R0);
+ __ clinit_barrier(klass, R16_thread, &L_skip_barrier /*L_fast_path*/);
+
+ __ load_const_optimized(klass, SharedRuntime::get_handle_wrong_method_stub(), R0);
+ __ mtctr(klass);
+ __ bctr();
+
+ __ bind(L_skip_barrier);
+ }
+
__ save_LR_CR(r_temp_1);
__ generate_stack_overflow_check(frame_size_in_bytes); // Check before creating frame.
__ mr(r_callers_sp, R1_SP); // Remember frame pointer.
diff --git a/src/hotspot/cpu/ppc/templateTable_ppc_64.cpp b/src/hotspot/cpu/ppc/templateTable_ppc_64.cpp
index 90cb02ab52a..35feb1df956 100644
--- a/src/hotspot/cpu/ppc/templateTable_ppc_64.cpp
+++ b/src/hotspot/cpu/ppc/templateTable_ppc_64.cpp
@@ -2232,7 +2232,7 @@ void TemplateTable::_return(TosState state) {
void TemplateTable::resolve_cache_and_index(int byte_no, Register Rcache, Register Rscratch, size_t index_size) {
__ get_cache_and_index_at_bcp(Rcache, 1, index_size);
- Label Lresolved, Ldone;
+ Label Lresolved, Ldone, L_clinit_barrier_slow;
Bytecodes::Code code = bytecode();
switch (code) {
@@ -2253,6 +2253,9 @@ void TemplateTable::resolve_cache_and_index(int byte_no, Register Rcache, Regist
__ cmpdi(CCR0, Rscratch, (int)code);
__ beq(CCR0, Lresolved);
+ // Class initialization barrier slow path lands here as well.
+ __ bind(L_clinit_barrier_slow);
+
address entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_from_cache);
__ li(R4_ARG2, code);
__ call_VM(noreg, entry, R4_ARG2, true);
@@ -2263,6 +2266,17 @@ void TemplateTable::resolve_cache_and_index(int byte_no, Register Rcache, Regist
__ bind(Lresolved);
__ isync(); // Order load wrt. succeeding loads.
+
+ // Class initialization barrier for static methods
+ if (VM_Version::supports_fast_class_init_checks() && bytecode() == Bytecodes::_invokestatic) {
+ const Register method = Rscratch;
+ const Register klass = Rscratch;
+
+ __ load_resolved_method_at_index(byte_no, Rcache, method);
+ __ load_method_holder(klass, method);
+ __ clinit_barrier(klass, R16_thread, NULL /*L_fast_path*/, &L_clinit_barrier_slow);
+ }
+
__ bind(Ldone);
}
@@ -2329,7 +2343,7 @@ void TemplateTable::load_invoke_cp_cache_entry(int byte_no,
// Already resolved.
__ get_cache_and_index_at_bcp(Rcache, 1);
} else {
- resolve_cache_and_index(byte_no, Rcache, R0, is_invokedynamic ? sizeof(u4) : sizeof(u2));
+ resolve_cache_and_index(byte_no, Rcache, /* temp */ Rmethod, is_invokedynamic ? sizeof(u4) : sizeof(u2));
}
__ ld(Rmethod, method_offset, Rcache);
@@ -3634,9 +3648,7 @@ void TemplateTable::invokeinterface(int byte_no) {
// Find entry point to call.
// Get declaring interface class from method
- __ ld(Rinterface_klass, in_bytes(Method::const_offset()), Rmethod);
- __ ld(Rinterface_klass, in_bytes(ConstMethod::constants_offset()), Rinterface_klass);
- __ ld(Rinterface_klass, ConstantPool::pool_holder_offset_in_bytes(), Rinterface_klass);
+ __ load_method_holder(Rinterface_klass, Rmethod);
// Get itable index from method
__ lwa(Rindex, in_bytes(Method::itable_index_offset()), Rmethod);
diff --git a/src/hotspot/cpu/ppc/vm_version_ppc.hpp b/src/hotspot/cpu/ppc/vm_version_ppc.hpp
index 787e1474387..8cdee5d0040 100644
--- a/src/hotspot/cpu/ppc/vm_version_ppc.hpp
+++ b/src/hotspot/cpu/ppc/vm_version_ppc.hpp
@@ -95,6 +95,9 @@ public:
// Override Abstract_VM_Version implementation
static bool use_biased_locking();
+ // PPC64 supports fast class initialization checks for static methods.
+ static bool supports_fast_class_init_checks() { return true; }
+
static bool is_determine_features_test_running() { return _is_determine_features_test_running; }
// CPU instruction support
static bool has_fsqrt() { return (_features & fsqrt_m) != 0; }
From b6696bad842a97bf9ff97746e8eabbfccc98071b Mon Sep 17 00:00:00 2001
From: Chris Hegarty
Date: Tue, 11 Jun 2019 09:21:34 +0100
Subject: [PATCH 020/109] 8225426: Replace plain with system-default in Socket
and ServerSocket
Reviewed-by: alanb, dfuchs
---
.../share/classes/java/net/ServerSocket.java | 14 ++++----
.../share/classes/java/net/Socket.java | 36 +++++++++++--------
2 files changed, 30 insertions(+), 20 deletions(-)
diff --git a/src/java.base/share/classes/java/net/ServerSocket.java b/src/java.base/share/classes/java/net/ServerSocket.java
index 70f65061e02..bf399270755 100644
--- a/src/java.base/share/classes/java/net/ServerSocket.java
+++ b/src/java.base/share/classes/java/net/ServerSocket.java
@@ -106,9 +106,10 @@ class ServerSocket implements java.io.Closeable {
* request to connect) is set to {@code 50}. If a connection
* indication arrives when the queue is full, the connection is refused.
*
- * If the application has specified a server socket factory, that
- * factory's {@code createSocketImpl} method is called to create
- * the actual socket implementation. Otherwise a "plain" socket is created.
+ * If the application has specified a server socket implementation
+ * factory, that factory's {@code createSocketImpl} method is called to
+ * create the actual socket implementation. Otherwise a system-default
+ * socket implementation is created.
*
* If there is a security manager,
* its {@code checkListen} method is called
@@ -150,9 +151,10 @@ class ServerSocket implements java.io.Closeable {
* a connection indication arrives when the queue is full, the
* connection is refused.
*
- * If the application has specified a server socket factory, that
- * factory's {@code createSocketImpl} method is called to create
- * the actual socket implementation. Otherwise a "plain" socket is created.
+ * If the application has specified a server socket implementation
+ * factory, that factory's {@code createSocketImpl} method is called to
+ * create the actual socket implementation. Otherwise a system-default
+ * socket implementation is created.
*
* If there is a security manager,
* its {@code checkListen} method is called
diff --git a/src/java.base/share/classes/java/net/Socket.java b/src/java.base/share/classes/java/net/Socket.java
index 7393780adfa..2a2989f89f2 100644
--- a/src/java.base/share/classes/java/net/Socket.java
+++ b/src/java.base/share/classes/java/net/Socket.java
@@ -89,8 +89,12 @@ class Socket implements java.io.Closeable {
}
/**
- * Creates an unconnected socket, with the
- * system-default type of SocketImpl.
+ * Creates an unconnected Socket.
+ *
+ * If the application has specified a client socket implementation
+ * factory, that factory's {@code createSocketImpl} method is called to
+ * create the actual socket implementation. Otherwise a system-default
+ * socket implementation is created.
*
* @since 1.1
* @revised 1.4
@@ -194,9 +198,10 @@ class Socket implements java.io.Closeable {
* In other words, it is equivalent to specifying an address of the
* loopback interface.
*
- * If the application has specified a server socket factory, that
- * factory's {@code createSocketImpl} method is called to create
- * the actual socket implementation. Otherwise a "plain" socket is created.
+ * If the application has specified a client socket implementation
+ * factory, that factory's {@code createSocketImpl} method is called to
+ * create the actual socket implementation. Otherwise a system-default
+ * socket implementation is created.
*
* If there is a security manager, its
* {@code checkConnect} method is called
@@ -232,9 +237,10 @@ class Socket implements java.io.Closeable {
* Creates a stream socket and connects it to the specified port
* number at the specified IP address.
*
- * If the application has specified a socket factory, that factory's
- * {@code createSocketImpl} method is called to create the
- * actual socket implementation. Otherwise a "plain" socket is created.
+ * If the application has specified a client socket implementation
+ * factory, that factory's {@code createSocketImpl} method is called to
+ * create the actual socket implementation. Otherwise a system-default
+ * socket implementation is created.
*
* If there is a security manager, its
* {@code checkConnect} method is called
@@ -358,9 +364,10 @@ class Socket implements java.io.Closeable {
* stream socket. If the stream argument is {@code false}, it
* creates a datagram socket.
*
- * If the application has specified a server socket factory, that
- * factory's {@code createSocketImpl} method is called to create
- * the actual socket implementation. Otherwise a "plain" socket is created.
+ * If the application has specified a client socket implementation
+ * factory, that factory's {@code createSocketImpl} method is called to
+ * create the actual socket implementation. Otherwise a system-default
+ * socket implementation is created.
*
* If there is a security manager, its
* {@code checkConnect} method is called
@@ -400,9 +407,10 @@ class Socket implements java.io.Closeable {
* stream socket. If the stream argument is {@code false}, it
* creates a datagram socket.
*
- * If the application has specified a server socket factory, that
- * factory's {@code createSocketImpl} method is called to create
- * the actual socket implementation. Otherwise a "plain" socket is created.
+ * If the application has specified a client socket implementation
+ * factory, that factory's {@code createSocketImpl} method is called to
+ * create the actual socket implementation. Otherwise a system-default
+ * socket implementation is created.
*
*
If there is a security manager, its
* {@code checkConnect} method is called
From 2f25526470a2e6cb3d4431bee6679b7a02d8090e Mon Sep 17 00:00:00 2001
From: Rahul Raghavan
Date: Tue, 11 Jun 2019 14:33:34 +0530
Subject: [PATCH 021/109] 8225567: Wrong file headers with 8202414 fix
changeset
Corrected source file headers
Reviewed-by: thartmann
---
src/hotspot/share/opto/memnode.cpp | 2 +-
test/hotspot/jtreg/compiler/c2/Test8202414.java | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/hotspot/share/opto/memnode.cpp b/src/hotspot/share/opto/memnode.cpp
index 21610977b65..af0d0a13d59 100644
--- a/src/hotspot/share/opto/memnode.cpp
+++ b/src/hotspot/share/opto/memnode.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2019, 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
diff --git a/test/hotspot/jtreg/compiler/c2/Test8202414.java b/test/hotspot/jtreg/compiler/c2/Test8202414.java
index 1d8ef8d936a..f4a93a12a85 100644
--- a/test/hotspot/jtreg/compiler/c2/Test8202414.java
+++ b/test/hotspot/jtreg/compiler/c2/Test8202414.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, Huawei Technologies Co. Ltd. All rights reserved.
+ * Copyright (c) 2019, 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
From cf7990753682fcc37ab914fe73cf941ced981735 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Erik=20=C3=96sterlund?=
Date: Tue, 11 Jun 2019 10:55:17 +0200
Subject: [PATCH 022/109] 8224871: os::attempt_reserve_memory_at() tries too
hard
Reviewed-by: pliden, coleenp, stuefe
---
src/hotspot/os/bsd/os_bsd.cpp | 50 +-----------
src/hotspot/os/linux/os_linux.cpp | 50 +-----------
src/hotspot/os/solaris/os_solaris.cpp | 106 +-------------------------
3 files changed, 6 insertions(+), 200 deletions(-)
diff --git a/src/hotspot/os/bsd/os_bsd.cpp b/src/hotspot/os/bsd/os_bsd.cpp
index 713a9c0842c..0f50818a9b9 100644
--- a/src/hotspot/os/bsd/os_bsd.cpp
+++ b/src/hotspot/os/bsd/os_bsd.cpp
@@ -2189,11 +2189,6 @@ char* os::pd_attempt_reserve_memory_at(size_t bytes, char* requested_addr, int f
// available (and not reserved for something else).
char* os::pd_attempt_reserve_memory_at(size_t bytes, char* requested_addr) {
- const int max_tries = 10;
- char* base[max_tries];
- size_t size[max_tries];
- const size_t gap = 0x000000;
-
// Assert only that the size is a multiple of the page size, since
// that's all that mmap requires, and since that's all we really know
// about at this low abstraction level. If we need higher alignment,
@@ -2216,50 +2211,7 @@ char* os::pd_attempt_reserve_memory_at(size_t bytes, char* requested_addr) {
anon_munmap(addr, bytes);
}
- int i;
- for (i = 0; i < max_tries; ++i) {
- base[i] = reserve_memory(bytes);
-
- if (base[i] != NULL) {
- // Is this the block we wanted?
- if (base[i] == requested_addr) {
- size[i] = bytes;
- break;
- }
-
- // Does this overlap the block we wanted? Give back the overlapped
- // parts and try again.
-
- size_t top_overlap = requested_addr + (bytes + gap) - base[i];
- if (top_overlap >= 0 && top_overlap < bytes) {
- unmap_memory(base[i], top_overlap);
- base[i] += top_overlap;
- size[i] = bytes - top_overlap;
- } else {
- size_t bottom_overlap = base[i] + bytes - requested_addr;
- if (bottom_overlap >= 0 && bottom_overlap < bytes) {
- unmap_memory(requested_addr, bottom_overlap);
- size[i] = bytes - bottom_overlap;
- } else {
- size[i] = bytes;
- }
- }
- }
- }
-
- // Give back the unused reserved pieces.
-
- for (int j = 0; j < i; ++j) {
- if (base[j] != NULL) {
- unmap_memory(base[j], size[j]);
- }
- }
-
- if (i < max_tries) {
- return requested_addr;
- } else {
- return NULL;
- }
+ return NULL;
}
// Sleep forever; naked call to OS-specific sleep; use with CAUTION
diff --git a/src/hotspot/os/linux/os_linux.cpp b/src/hotspot/os/linux/os_linux.cpp
index 439f6b781d1..ee154e24618 100644
--- a/src/hotspot/os/linux/os_linux.cpp
+++ b/src/hotspot/os/linux/os_linux.cpp
@@ -4105,11 +4105,6 @@ char* os::pd_attempt_reserve_memory_at(size_t bytes, char* requested_addr, int f
// available (and not reserved for something else).
char* os::pd_attempt_reserve_memory_at(size_t bytes, char* requested_addr) {
- const int max_tries = 10;
- char* base[max_tries];
- size_t size[max_tries];
- const size_t gap = 0x000000;
-
// Assert only that the size is a multiple of the page size, since
// that's all that mmap requires, and since that's all we really know
// about at this low abstraction level. If we need higher alignment,
@@ -4132,50 +4127,7 @@ char* os::pd_attempt_reserve_memory_at(size_t bytes, char* requested_addr) {
anon_munmap(addr, bytes);
}
- int i;
- for (i = 0; i < max_tries; ++i) {
- base[i] = reserve_memory(bytes);
-
- if (base[i] != NULL) {
- // Is this the block we wanted?
- if (base[i] == requested_addr) {
- size[i] = bytes;
- break;
- }
-
- // Does this overlap the block we wanted? Give back the overlapped
- // parts and try again.
-
- ptrdiff_t top_overlap = requested_addr + (bytes + gap) - base[i];
- if (top_overlap >= 0 && (size_t)top_overlap < bytes) {
- unmap_memory(base[i], top_overlap);
- base[i] += top_overlap;
- size[i] = bytes - top_overlap;
- } else {
- ptrdiff_t bottom_overlap = base[i] + bytes - requested_addr;
- if (bottom_overlap >= 0 && (size_t)bottom_overlap < bytes) {
- unmap_memory(requested_addr, bottom_overlap);
- size[i] = bytes - bottom_overlap;
- } else {
- size[i] = bytes;
- }
- }
- }
- }
-
- // Give back the unused reserved pieces.
-
- for (int j = 0; j < i; ++j) {
- if (base[j] != NULL) {
- unmap_memory(base[j], size[j]);
- }
- }
-
- if (i < max_tries) {
- return requested_addr;
- } else {
- return NULL;
- }
+ return NULL;
}
// Sleep forever; naked call to OS-specific sleep; use with CAUTION
diff --git a/src/hotspot/os/solaris/os_solaris.cpp b/src/hotspot/os/solaris/os_solaris.cpp
index 4c0ade1d760..9c6d4d6a783 100644
--- a/src/hotspot/os/solaris/os_solaris.cpp
+++ b/src/hotspot/os/solaris/os_solaris.cpp
@@ -2553,17 +2553,6 @@ char* os::pd_attempt_reserve_memory_at(size_t bytes, char* requested_addr, int f
// available (and not reserved for something else).
char* os::pd_attempt_reserve_memory_at(size_t bytes, char* requested_addr) {
- const int max_tries = 10;
- char* base[max_tries];
- size_t size[max_tries];
-
- // Solaris adds a gap between mmap'ed regions. The size of the gap
- // is dependent on the requested size and the MMU. Our initial gap
- // value here is just a guess and will be corrected later.
- bool had_top_overlap = false;
- bool have_adjusted_gap = false;
- size_t gap = 0x400000;
-
// Assert only that the size is a multiple of the page size, since
// that's all that mmap requires, and since that's all we really know
// about at this low abstraction level. If we need higher alignment,
@@ -2572,105 +2561,18 @@ char* os::pd_attempt_reserve_memory_at(size_t bytes, char* requested_addr) {
assert(bytes % os::vm_page_size() == 0, "reserving unexpected size block");
// Since snv_84, Solaris attempts to honor the address hint - see 5003415.
- // Give it a try, if the kernel honors the hint we can return immediately.
char* addr = Solaris::anon_mmap(requested_addr, bytes, 0, false);
volatile int err = errno;
if (addr == requested_addr) {
return addr;
- } else if (addr != NULL) {
+ }
+
+ if (addr != NULL) {
pd_unmap_memory(addr, bytes);
}
- if (log_is_enabled(Warning, os)) {
- char buf[256];
- buf[0] = '\0';
- if (addr == NULL) {
- jio_snprintf(buf, sizeof(buf), ": %s", os::strerror(err));
- }
- log_info(os)("attempt_reserve_memory_at: couldn't reserve " SIZE_FORMAT " bytes at "
- PTR_FORMAT ": reserve_memory_helper returned " PTR_FORMAT
- "%s", bytes, requested_addr, addr, buf);
- }
-
- // Address hint method didn't work. Fall back to the old method.
- // In theory, once SNV becomes our oldest supported platform, this
- // code will no longer be needed.
- //
- // Repeatedly allocate blocks until the block is allocated at the
- // right spot. Give up after max_tries.
- int i;
- for (i = 0; i < max_tries; ++i) {
- base[i] = reserve_memory(bytes);
-
- if (base[i] != NULL) {
- // Is this the block we wanted?
- if (base[i] == requested_addr) {
- size[i] = bytes;
- break;
- }
-
- // check that the gap value is right
- if (had_top_overlap && !have_adjusted_gap) {
- size_t actual_gap = base[i-1] - base[i] - bytes;
- if (gap != actual_gap) {
- // adjust the gap value and retry the last 2 allocations
- assert(i > 0, "gap adjustment code problem");
- have_adjusted_gap = true; // adjust the gap only once, just in case
- gap = actual_gap;
- log_info(os)("attempt_reserve_memory_at: adjusted gap to 0x%lx", gap);
- unmap_memory(base[i], bytes);
- unmap_memory(base[i-1], size[i-1]);
- i-=2;
- continue;
- }
- }
-
- // Does this overlap the block we wanted? Give back the overlapped
- // parts and try again.
- //
- // There is still a bug in this code: if top_overlap == bytes,
- // the overlap is offset from requested region by the value of gap.
- // In this case giving back the overlapped part will not work,
- // because we'll give back the entire block at base[i] and
- // therefore the subsequent allocation will not generate a new gap.
- // This could be fixed with a new algorithm that used larger
- // or variable size chunks to find the requested region -
- // but such a change would introduce additional complications.
- // It's rare enough that the planets align for this bug,
- // so we'll just wait for a fix for 6204603/5003415 which
- // will provide a mmap flag to allow us to avoid this business.
-
- size_t top_overlap = requested_addr + (bytes + gap) - base[i];
- if (top_overlap >= 0 && top_overlap < bytes) {
- had_top_overlap = true;
- unmap_memory(base[i], top_overlap);
- base[i] += top_overlap;
- size[i] = bytes - top_overlap;
- } else {
- size_t bottom_overlap = base[i] + bytes - requested_addr;
- if (bottom_overlap >= 0 && bottom_overlap < bytes) {
- if (bottom_overlap == 0) {
- log_info(os)("attempt_reserve_memory_at: possible alignment bug");
- }
- unmap_memory(requested_addr, bottom_overlap);
- size[i] = bytes - bottom_overlap;
- } else {
- size[i] = bytes;
- }
- }
- }
- }
-
- // Give back the unused reserved pieces.
-
- for (int j = 0; j < i; ++j) {
- if (base[j] != NULL) {
- unmap_memory(base[j], size[j]);
- }
- }
-
- return (i < max_tries) ? requested_addr : NULL;
+ return NULL;
}
bool os::pd_release_memory(char* addr, size_t bytes) {
From 5fa2642f15601a6e9f7e2d7947577f93a9abeb0e Mon Sep 17 00:00:00 2001
From: Nils Eliasson
Date: Tue, 11 Jun 2019 12:39:37 +0200
Subject: [PATCH 023/109] 8225564: Remove wrong assert in clean_catch_blocks
Reviewed-by: thartmann
---
src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp b/src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp
index 867448c4473..9fb4e477111 100644
--- a/src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp
+++ b/src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp
@@ -866,7 +866,6 @@ static bool fixup_uses_in_catch(PhaseIdealLoop *phase, Node *start_ctrl, Node *n
// In some very rare cases a load that doesn't need a barrier will end up here
// Treat it as a LoadP and the insertion of phis will be done correctly.
if (node->is_Load()) {
- assert(node->as_Load()->barrier_data() == 0, "Sanity");
call_catch_cleanup_one(phase, node->as_Load(), phase->get_ctrl(node));
} else {
for (DUIterator_Fast jmax, i = node->fast_outs(jmax); i < jmax; i++) {
From 02f1d4430c8b2436b6c7111c27a7392eadaaa777 Mon Sep 17 00:00:00 2001
From: David Holmes
Date: Tue, 11 Jun 2019 08:03:29 -0400
Subject: [PATCH 024/109] 8225568: ProblemList
compiler/compilercontrol/jcmd/ClearDirectivesFileStackTest.java
Reviewed-by: thartmann
---
test/hotspot/jtreg/ProblemList.txt | 1 +
1 file changed, 1 insertion(+)
diff --git a/test/hotspot/jtreg/ProblemList.txt b/test/hotspot/jtreg/ProblemList.txt
index 2fa1f648ae4..6ca15a71879 100644
--- a/test/hotspot/jtreg/ProblemList.txt
+++ b/test/hotspot/jtreg/ProblemList.txt
@@ -43,6 +43,7 @@
compiler/ciReplay/TestSAServer.java 8029528 generic-all
compiler/codecache/stress/OverloadCompileQueueTest.java 8166554 generic-all
compiler/codegen/Test6896617.java 8193479 generic-all
+compiler/compilercontrol/jcmd/ClearDirectivesFileStackTest.java 8225370 generic-all
compiler/jvmci/compilerToVM/GetFlagValueTest.java 8204459 generic-all
compiler/jvmci/compilerToVM/GetResolvedJavaTypeTest.java 8158860 generic-all
compiler/jvmci/compilerToVM/InvalidateInstalledCodeTest.java 8163894 generic-all
From d571d105ae483cf1acc8d8e460869ecdeb3333cb Mon Sep 17 00:00:00 2001
From: Coleen Phillimore
Date: Tue, 11 Jun 2019 07:31:47 -0400
Subject: [PATCH 025/109] 8224847: gc/stress/TestReclaimStringsLeaksMemory.java
fails with reserved greater than expected
Rehash threshold was too low for StringTable, and rehashed size table was too large.
Reviewed-by: rehn, gziemski
---
src/hotspot/share/classfile/stringTable.cpp | 9 +++++----
src/hotspot/share/classfile/symbolTable.cpp | 9 +++++----
test/hotspot/jtreg/ProblemList.txt | 1 -
.../gc/stress/TestReclaimStringsLeaksMemory.java | 14 ++++++++++++--
4 files changed, 22 insertions(+), 11 deletions(-)
diff --git a/src/hotspot/share/classfile/stringTable.cpp b/src/hotspot/share/classfile/stringTable.cpp
index 35165c1370a..bfe6d07df8a 100644
--- a/src/hotspot/share/classfile/stringTable.cpp
+++ b/src/hotspot/share/classfile/stringTable.cpp
@@ -58,8 +58,8 @@
const double PREF_AVG_LIST_LEN = 2.0;
// 2^24 is max size
const size_t END_SIZE = 24;
-// If a chain gets to 32 something might be wrong
-const size_t REHASH_LEN = 32;
+// If a chain gets to 100 something might be wrong
+const size_t REHASH_LEN = 100;
// If we have as many dead items as 50% of the number of bucket
const double CLEAN_DEAD_HIGH_WATER_MARK = 0.5;
@@ -496,8 +496,9 @@ bool StringTable::do_rehash() {
return false;
}
- // We use max size
- StringTableHash* new_table = new StringTableHash(END_SIZE, END_SIZE, REHASH_LEN);
+ // We use current size, not max size.
+ size_t new_size = _local_table->get_size_log2(Thread::current());
+ StringTableHash* new_table = new StringTableHash(new_size, END_SIZE, REHASH_LEN);
// Use alt hash from now on
_alt_hash = true;
if (!_local_table->try_move_nodes_to(Thread::current(), new_table)) {
diff --git a/src/hotspot/share/classfile/symbolTable.cpp b/src/hotspot/share/classfile/symbolTable.cpp
index 5a36b2ed230..4023e722eee 100644
--- a/src/hotspot/share/classfile/symbolTable.cpp
+++ b/src/hotspot/share/classfile/symbolTable.cpp
@@ -267,7 +267,7 @@ void SymbolTable::symbols_do(SymbolClosure *cl) {
// all symbols from the dynamic table
SymbolsDo sd(cl);
if (!_local_table->try_scan(Thread::current(), sd)) {
- log_info(stringtable)("symbols_do unavailable at this moment");
+ log_info(symboltable)("symbols_do unavailable at this moment");
}
}
@@ -557,7 +557,7 @@ void SymbolTable::verify() {
Thread* thr = Thread::current();
VerifySymbols vs;
if (!_local_table->try_scan(thr, vs)) {
- log_info(stringtable)("verify unavailable at this moment");
+ log_info(symboltable)("verify unavailable at this moment");
}
}
@@ -763,8 +763,9 @@ bool SymbolTable::do_rehash() {
return false;
}
- // We use max size
- SymbolTableHash* new_table = new SymbolTableHash(END_SIZE, END_SIZE, REHASH_LEN);
+ // We use current size
+ size_t new_size = _local_table->get_size_log2(Thread::current());
+ SymbolTableHash* new_table = new SymbolTableHash(new_size, END_SIZE, REHASH_LEN);
// Use alt hash from now on
_alt_hash = true;
if (!_local_table->try_move_nodes_to(Thread::current(), new_table)) {
diff --git a/test/hotspot/jtreg/ProblemList.txt b/test/hotspot/jtreg/ProblemList.txt
index 6ca15a71879..6e7551cf2c9 100644
--- a/test/hotspot/jtreg/ProblemList.txt
+++ b/test/hotspot/jtreg/ProblemList.txt
@@ -77,7 +77,6 @@ gc/stress/gclocker/TestGCLockerWithParallel.java 8180622 generic-all
gc/stress/gclocker/TestGCLockerWithG1.java 8180622 generic-all
gc/stress/TestJNIBlockFullGC/TestJNIBlockFullGC.java 8192647 generic-all
gc/metaspace/CompressedClassSpaceSizeInJmapHeap.java 8193639 solaris-all
-gc/stress/TestReclaimStringsLeaksMemory.java 8224847 generic-all
#############################################################################
diff --git a/test/hotspot/jtreg/gc/stress/TestReclaimStringsLeaksMemory.java b/test/hotspot/jtreg/gc/stress/TestReclaimStringsLeaksMemory.java
index fc8b462c3dc..5de870302a1 100644
--- a/test/hotspot/jtreg/gc/stress/TestReclaimStringsLeaksMemory.java
+++ b/test/hotspot/jtreg/gc/stress/TestReclaimStringsLeaksMemory.java
@@ -57,7 +57,7 @@ public class TestReclaimStringsLeaksMemory {
public static void main(String[] args) throws Exception {
ArrayList baseargs = new ArrayList<>(Arrays.asList("-Xms256M",
"-Xmx256M",
- "-Xlog:gc*",
+ "-Xlog:gc*,stringtable*=debug:gc.log",
"-XX:NativeMemoryTracking=summary",
"-XX:+UnlockDiagnosticVMOptions",
"-XX:+PrintNMTStatistics" ));
@@ -95,9 +95,19 @@ public class TestReclaimStringsLeaksMemory {
lastString = (BaseName + i).intern();
}
if (++iterations % 5 == 0) {
- System.gc();
+ System.gc();
}
}
+ // Do one last GC and sleep to give ServiceThread a chance to run.
+ System.out.println("One last gc");
+ System.gc();
+ for (int i = 0; i < 100; i++) {
+ try {
+ Thread.sleep(10);
+ } catch (InterruptedException ex) {
+ }
+ }
+ System.out.println("End of test");
}
}
}
From 83377c41fffc48ec216738c1f5e1efb91deaefa4 Mon Sep 17 00:00:00 2001
From: Andrew Haley
Date: Mon, 10 Jun 2019 10:11:42 +0100
Subject: [PATCH 026/109] 8225429: Regression in disassembly quality
Reviewed-by: never
---
src/hotspot/share/asm/codeBuffer.hpp | 1 +
src/hotspot/share/compiler/abstractDisassembler.cpp | 8 ++++----
src/hotspot/share/compiler/disassembler.cpp | 5 ++++-
3 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/src/hotspot/share/asm/codeBuffer.hpp b/src/hotspot/share/asm/codeBuffer.hpp
index 0526a394c7e..1b7f1164d2d 100644
--- a/src/hotspot/share/asm/codeBuffer.hpp
+++ b/src/hotspot/share/asm/codeBuffer.hpp
@@ -413,6 +413,7 @@ class CodeBuffer: public StackObj {
|| PrintMethodHandleStubs
|| PrintInterpreter
|| PrintSignatureHandlers
+ || UnlockDiagnosticVMOptions
);
}
diff --git a/src/hotspot/share/compiler/abstractDisassembler.cpp b/src/hotspot/share/compiler/abstractDisassembler.cpp
index 63d8825edac..4fe71179282 100644
--- a/src/hotspot/share/compiler/abstractDisassembler.cpp
+++ b/src/hotspot/share/compiler/abstractDisassembler.cpp
@@ -38,12 +38,12 @@
bool AbstractDisassembler::_show_data_hex = true;
bool AbstractDisassembler::_show_data_int = false;
bool AbstractDisassembler::_show_data_float = false;
-bool AbstractDisassembler::_align_instr = false;
+bool AbstractDisassembler::_align_instr = true;
bool AbstractDisassembler::_show_pc = true;
bool AbstractDisassembler::_show_offset = false;
-bool AbstractDisassembler::_show_structs = false;
-bool AbstractDisassembler::_show_comment = false;
-bool AbstractDisassembler::_show_block_comment = false;
+bool AbstractDisassembler::_show_structs = true;
+bool AbstractDisassembler::_show_comment = true;
+bool AbstractDisassembler::_show_block_comment = true;
// set "true" to see what's in memory bit by bit
// might prove cumbersome on platforms where instr_len is hard to find out
diff --git a/src/hotspot/share/compiler/disassembler.cpp b/src/hotspot/share/compiler/disassembler.cpp
index 49e7db404a7..f4d656c8f70 100644
--- a/src/hotspot/share/compiler/disassembler.cpp
+++ b/src/hotspot/share/compiler/disassembler.cpp
@@ -147,7 +147,10 @@ class decode_env {
if (AbstractDisassembler::show_comment()) {
if ((_nm != NULL) && _nm->has_code_comment(pc0, pc)) {
- _nm->print_code_comment_on(st, _post_decode_alignment, pc0, pc);
+ _nm->print_code_comment_on
+ (st,
+ _post_decode_alignment ? _post_decode_alignment : COMMENT_COLUMN,
+ pc0, pc);
// this calls reloc_string_for which calls oop::print_value_on
}
print_hook_comments(pc0, _nm != NULL);
From 7fc422dd933266afbfc92c6a6ac5bf8939ffac9f Mon Sep 17 00:00:00 2001
From: Prasanta Sadhukhan
Date: Tue, 11 Jun 2019 11:01:22 +0530
Subject: [PATCH 027/109] 8225511:
javax/swing/JWindow/ShapedAndTranslucentWindows/ShapedTranslucentPerPixelTranslucentGradient.java
fails in linux-x64
Reviewed-by: serb, prr
---
.../swing/JWindow/ShapedAndTranslucentWindows/Common.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/test/jdk/javax/swing/JWindow/ShapedAndTranslucentWindows/Common.java b/test/jdk/javax/swing/JWindow/ShapedAndTranslucentWindows/Common.java
index a79b62df432..b177ffc4e6e 100644
--- a/test/jdk/javax/swing/JWindow/ShapedAndTranslucentWindows/Common.java
+++ b/test/jdk/javax/swing/JWindow/ShapedAndTranslucentWindows/Common.java
@@ -367,13 +367,13 @@ public abstract class Common {
// Drag
Point location = window.getLocationOnScreen();
robot.dragAndDrop(location.x + 30, location.y + 5, location.x + dl + random.nextInt(dl), location.y + random.nextInt(dl));
- robot.waitForIdle(delay);
+ robot.waitForIdle(2*delay);
checkTranslucentShape();
// Resize
location = window.getLocationOnScreen();
robot.dragAndDrop(location.x + 4, location.y + 4, location.x + random.nextInt(2*dl)-dl, location.y + random.nextInt(2*dl)-dl);
- robot.waitForIdle(delay);
+ robot.waitForIdle(2*delay);
checkTranslucentShape();
EventQueue.invokeAndWait(this::dispose);
From b99e9165f1bf539fd3b086ce4e233c64316aaa90 Mon Sep 17 00:00:00 2001
From: Daniel Fuchs
Date: Tue, 11 Jun 2019 15:46:26 +0100
Subject: [PATCH 028/109] 8225512: Replace wildcard address with loopback or
local host in tests - part 15
Updates httpserver tests to use the loopback instead of the wildcard wherever possible.
Reviewed-by: michaelm
---
.../net/httpserver/MissingTrailingSpace.java | 17 ++++++++------
test/jdk/com/sun/net/httpserver/Test10.java | 9 +++++---
test/jdk/com/sun/net/httpserver/Test11.java | 19 +++++++++++-----
test/jdk/com/sun/net/httpserver/Test12.java | 16 ++++++++++----
test/jdk/com/sun/net/httpserver/Test13.java | 17 ++++++++++----
test/jdk/com/sun/net/httpserver/Test14.java | 18 +++++++++++----
test/jdk/com/sun/net/httpserver/Test2.java | 19 ++++++++++++----
test/jdk/com/sun/net/httpserver/Test3.java | 9 +++++---
test/jdk/com/sun/net/httpserver/Test4.java | 9 +++++---
test/jdk/com/sun/net/httpserver/Test5.java | 9 +++++---
test/jdk/com/sun/net/httpserver/Test6.java | 19 ++++++++++++----
test/jdk/com/sun/net/httpserver/Test7.java | 18 +++++++++++----
test/jdk/com/sun/net/httpserver/Test7a.java | 19 +++++++++++-----
test/jdk/com/sun/net/httpserver/Test8.java | 19 ++++++++++++----
test/jdk/com/sun/net/httpserver/Test8a.java | 19 +++++++++++-----
test/jdk/com/sun/net/httpserver/Test9.java | 22 ++++++++++++++-----
test/jdk/com/sun/net/httpserver/Test9a.java | 21 +++++++++++++-----
.../com/sun/net/httpserver/TestLogging.java | 9 +++++---
.../com/sun/net/httpserver/bugs/B6339483.java | 18 +++++++++++----
.../com/sun/net/httpserver/bugs/B6341616.java | 18 +++++++++++----
.../com/sun/net/httpserver/bugs/B6393710.java | 9 +++++---
.../com/sun/net/httpserver/bugs/B6526158.java | 18 +++++++++++----
.../com/sun/net/httpserver/bugs/B6526913.java | 18 +++++++++++----
.../com/sun/net/httpserver/bugs/B6529200.java | 8 ++++---
.../com/sun/net/httpserver/bugs/B6744329.java | 19 ++++++++++++----
.../com/sun/net/httpserver/bugs/B6886436.java | 22 ++++++++++++++-----
.../bugs/FixedLengthInputStream.java | 20 +++++++++++++----
.../com/sun/net/httpserver/bugs/HeadTest.java | 21 ++++++++++++++----
.../httpserver/bugs/TruncatedRequestBody.java | 7 +++---
29 files changed, 346 insertions(+), 120 deletions(-)
diff --git a/test/jdk/com/sun/net/httpserver/MissingTrailingSpace.java b/test/jdk/com/sun/net/httpserver/MissingTrailingSpace.java
index 5ecb0745f01..6671105aac4 100644
--- a/test/jdk/com/sun/net/httpserver/MissingTrailingSpace.java
+++ b/test/jdk/com/sun/net/httpserver/MissingTrailingSpace.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, 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
@@ -25,9 +25,12 @@
* @test
* @bug 8068795
* @summary HttpServer missing tailing space for some response codes
+ * @run main MissingTrailingSpace
+ * @run main/othervm -Djava.net.preferIPv6Addresses=true MissingTrailingSpace
* @author lev.priima@oracle.com
*/
+import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.io.InputStreamReader;
import java.io.IOException;
@@ -47,7 +50,8 @@ public class MissingTrailingSpace {
private static final String someContext = "/context";
public static void main(String[] args) throws Exception {
- HttpServer server = HttpServer.create(new InetSocketAddress(0), 0);
+ InetAddress loopback = InetAddress.getLoopbackAddress();
+ HttpServer server = HttpServer.create(new InetSocketAddress(loopback, 0), 0);
try {
server.setExecutor(Executors.newFixedThreadPool(1));
server.createContext(someContext, new HttpHandler() {
@@ -68,7 +72,7 @@ public class MissingTrailingSpace {
System.out.println("Server started at port "
+ server.getAddress().getPort());
- runRawSocketHttpClient("localhost", server.getAddress().getPort());
+ runRawSocketHttpClient(loopback, server.getAddress().getPort());
} finally {
((ExecutorService)server.getExecutor()).shutdown();
server.stop(0);
@@ -76,7 +80,7 @@ public class MissingTrailingSpace {
System.out.println("Server finished.");
}
- static void runRawSocketHttpClient(String hostname, int port)
+ static void runRawSocketHttpClient(InetAddress address, int port)
throws Exception
{
Socket socket = null;
@@ -84,7 +88,7 @@ public class MissingTrailingSpace {
BufferedReader reader = null;
final String CRLF = "\r\n";
try {
- socket = new Socket(hostname, port);
+ socket = new Socket(address, port);
writer = new PrintWriter(new OutputStreamWriter(
socket.getOutputStream()));
System.out.println("Client connected by socket: " + socket);
@@ -93,7 +97,7 @@ public class MissingTrailingSpace {
writer.print("User-Agent: Java/"
+ System.getProperty("java.version")
+ CRLF);
- writer.print("Host: " + hostname + CRLF);
+ writer.print("Host: " + address.getHostName() + CRLF);
writer.print("Accept: */*" + CRLF);
writer.print("Connection: keep-alive" + CRLF);
writer.print(CRLF); // Important, else the server will expect that
@@ -140,4 +144,3 @@ public class MissingTrailingSpace {
System.out.println("Client finished." );
}
}
-
diff --git a/test/jdk/com/sun/net/httpserver/Test10.java b/test/jdk/com/sun/net/httpserver/Test10.java
index 36f2a80e09b..c15ddc48d6f 100644
--- a/test/jdk/com/sun/net/httpserver/Test10.java
+++ b/test/jdk/com/sun/net/httpserver/Test10.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019, 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
@@ -26,6 +26,8 @@
* @bug 7005016
* @summary pit jdk7 b121 sqe test jhttp/HttpServer150013 failing
* @run main/othervm -Dsun.net.httpserver.clockTick=1000 -Dsun.net.httpserver.idleInterval=3 Test10
+ * @run main/othervm -Dsun.net.httpserver.clockTick=1000 -Dsun.net.httpserver.idleInterval=3
+ * -Djava.net.preferIPv6Addresses Test10
*/
import com.sun.net.httpserver.*;
@@ -42,7 +44,8 @@ public class Test10 extends Test {
public static void main (String[] args) throws Exception {
System.out.print ("Test10: ");
Handler handler = new Handler();
- InetSocketAddress addr = new InetSocketAddress (0);
+ InetAddress loopback = InetAddress.getLoopbackAddress();
+ InetSocketAddress addr = new InetSocketAddress(loopback, 0);
HttpServer server = HttpServer.create (addr, 0);
int port = server.getAddress().getPort();
HttpContext c2 = server.createContext ("/test", handler);
@@ -78,7 +81,7 @@ public class Test10 extends Test {
public static void doClient (int port) throws Exception {
String s = "GET /test/1.html HTTP/1.1\r\n\r\n";
- Socket socket = new Socket ("localhost", port);
+ Socket socket = new Socket (InetAddress.getLoopbackAddress(), port);
OutputStream os = socket.getOutputStream();
os.write (s.getBytes());
socket.setSoTimeout (10 * 1000);
diff --git a/test/jdk/com/sun/net/httpserver/Test11.java b/test/jdk/com/sun/net/httpserver/Test11.java
index 67d3a6b65e4..d8a58bb36b0 100644
--- a/test/jdk/com/sun/net/httpserver/Test11.java
+++ b/test/jdk/com/sun/net/httpserver/Test11.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2019, 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
@@ -25,12 +25,16 @@
* @test
* @bug 6270015
* @summary Light weight HTTP server
+ * @library /test/lib
+ * @run main Test11
+ * @run main/othervm -Djava.net.preferIPv6Addresses=true Test11
*/
import java.net.*;
import java.util.concurrent.*;
import java.io.*;
import com.sun.net.httpserver.*;
+import jdk.test.lib.net.URIBuilder;
public class Test11 {
static class Handler implements HttpHandler {
@@ -51,7 +55,8 @@ public class Test11 {
public static void main (String[] args) throws Exception {
System.out.print ("Test 11: ");
- HttpServer server = HttpServer.create(new InetSocketAddress(0), 0);
+ InetAddress loopback = InetAddress.getLoopbackAddress();
+ HttpServer server = HttpServer.create(new InetSocketAddress(loopback, 0), 0);
ExecutorService s = Executors.newCachedThreadPool();
try {
HttpContext ctx = server.createContext (
@@ -59,9 +64,13 @@ public class Test11 {
);
s = Executors.newCachedThreadPool();
server.start ();
- URL url = new URL ("http://localhost:" + server.getAddress().getPort()+
- "/Foo/bar/test.html");
- HttpURLConnection urlc = (HttpURLConnection)url.openConnection();
+ URL url = URIBuilder.newBuilder()
+ .scheme("http")
+ .loopback()
+ .port(server.getAddress().getPort())
+ .path("/Foo/bar/test.html")
+ .toURL();
+ HttpURLConnection urlc = (HttpURLConnection)url.openConnection(Proxy.NO_PROXY);
int r = urlc.getResponseCode();
if (r == 200) {
throw new RuntimeException ("wrong response received");
diff --git a/test/jdk/com/sun/net/httpserver/Test12.java b/test/jdk/com/sun/net/httpserver/Test12.java
index dd724c267ce..95e179db198 100644
--- a/test/jdk/com/sun/net/httpserver/Test12.java
+++ b/test/jdk/com/sun/net/httpserver/Test12.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2019, 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
@@ -27,6 +27,7 @@
* @library /test/lib
* @build jdk.test.lib.net.SimpleSSLContext
* @run main/othervm Test12
+ * @run main/othervm -Djava.net.preferIPv6Addresses=true Test12
* @summary Light weight HTTP server
*/
@@ -37,6 +38,7 @@ import java.io.*;
import java.net.*;
import javax.net.ssl.*;
import jdk.test.lib.net.SimpleSSLContext;
+import jdk.test.lib.net.URIBuilder;
/* basic http/s connectivity test
* Tests:
@@ -56,7 +58,8 @@ public class Test12 extends Test {
try {
String root = System.getProperty ("test.src")+ "/docs";
System.out.print ("Test12: ");
- InetSocketAddress addr = new InetSocketAddress (0);
+ InetAddress loopback = InetAddress.getLoopbackAddress();
+ InetSocketAddress addr = new InetSocketAddress(loopback, 0);
s1 = HttpServer.create (addr, 0);
s2 = HttpsServer.create (addr, 0);
HttpHandler h = new FileServerHandler (root);
@@ -130,8 +133,13 @@ public class Test12 extends Test {
public void run () {
try {
- URL url = new URL (protocol+"://localhost:"+port+"/test1/"+f);
- HttpURLConnection urlc = (HttpURLConnection) url.openConnection();
+ URL url = URIBuilder.newBuilder()
+ .scheme(protocol)
+ .loopback()
+ .port(port)
+ .path("/test1/"+f)
+ .toURL();
+ HttpURLConnection urlc = (HttpURLConnection) url.openConnection(Proxy.NO_PROXY);
if (urlc instanceof HttpsURLConnection) {
HttpsURLConnection urlcs = (HttpsURLConnection) urlc;
urlcs.setHostnameVerifier (new HostnameVerifier () {
diff --git a/test/jdk/com/sun/net/httpserver/Test13.java b/test/jdk/com/sun/net/httpserver/Test13.java
index 6061cc0776c..138acd87105 100644
--- a/test/jdk/com/sun/net/httpserver/Test13.java
+++ b/test/jdk/com/sun/net/httpserver/Test13.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2019, 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
@@ -27,6 +27,7 @@
* @library /test/lib
* @build jdk.test.lib.net.SimpleSSLContext
* @run main/othervm Test13
+ * @run main/othervm -Djava.net.preferIPv6Addresses=true Test13
* @summary Light weight HTTP server
*/
@@ -38,6 +39,7 @@ import java.io.*;
import java.net.*;
import javax.net.ssl.*;
import jdk.test.lib.net.SimpleSSLContext;
+import jdk.test.lib.net.URIBuilder;
/* basic http/s connectivity test
* Tests:
@@ -61,10 +63,12 @@ public class Test13 extends Test {
ha.setLevel(Level.ALL);
l.setLevel(Level.ALL);
l.addHandler(ha);
+ InetAddress loopback = InetAddress.getLoopbackAddress();
+
try {
String root = System.getProperty ("test.src")+ "/docs";
System.out.print ("Test13: ");
- InetSocketAddress addr = new InetSocketAddress (0);
+ InetSocketAddress addr = new InetSocketAddress(loopback, 0);
s1 = HttpServer.create (addr, 0);
s2 = HttpsServer.create (addr, 0);
HttpHandler h = new FileServerHandler (root);
@@ -136,8 +140,13 @@ public class Test13 extends Test {
public void run () {
try {
- URL url = new URL (protocol+"://localhost:"+port+"/test1/"+f);
- HttpURLConnection urlc = (HttpURLConnection) url.openConnection();
+ URL url = URIBuilder.newBuilder()
+ .scheme(protocol)
+ .loopback()
+ .port(port)
+ .path("/test1/"+f)
+ .toURL();
+ HttpURLConnection urlc = (HttpURLConnection) url.openConnection(Proxy.NO_PROXY);
if (urlc instanceof HttpsURLConnection) {
HttpsURLConnection urlcs = (HttpsURLConnection) urlc;
urlcs.setHostnameVerifier (new HostnameVerifier () {
diff --git a/test/jdk/com/sun/net/httpserver/Test14.java b/test/jdk/com/sun/net/httpserver/Test14.java
index b969a558a97..8e023f9cd5a 100644
--- a/test/jdk/com/sun/net/httpserver/Test14.java
+++ b/test/jdk/com/sun/net/httpserver/Test14.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2019, 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
@@ -25,6 +25,9 @@
* @test
* @bug 6270015
* @summary Light weight HTTP server
+ * @library /test/lib
+ * @run main Test14
+ * @run main/othervm -Djava.net.preferIPv6Addresses=true Test14
*/
import com.sun.net.httpserver.*;
@@ -36,6 +39,7 @@ import java.net.*;
import java.security.*;
import javax.security.auth.callback.*;
import javax.net.ssl.*;
+import jdk.test.lib.net.URIBuilder;
/**
* Test filters
@@ -77,7 +81,8 @@ public class Test14 extends Test {
public static void main (String[] args) throws Exception {
Handler handler = new Handler();
- InetSocketAddress addr = new InetSocketAddress (0);
+ InetAddress loopback = InetAddress.getLoopbackAddress();
+ InetSocketAddress addr = new InetSocketAddress(loopback, 0);
HttpServer server = HttpServer.create (addr, 0);
HttpContext ctx = server.createContext ("/test", handler);
@@ -94,9 +99,14 @@ public class Test14 extends Test {
server.setExecutor (executor);
server.start ();
- URL url = new URL ("http://localhost:"+server.getAddress().getPort()+"/test/foo.html");
+ URL url = URIBuilder.newBuilder()
+ .scheme("http")
+ .loopback()
+ .port(server.getAddress().getPort())
+ .path("/test/foo.html")
+ .toURL();
System.out.print ("Test14: " );
- HttpURLConnection urlc = (HttpURLConnection)url.openConnection ();
+ HttpURLConnection urlc = (HttpURLConnection)url.openConnection(Proxy.NO_PROXY);
InputStream is = urlc.getInputStream();
int x = 0;
String output="";
diff --git a/test/jdk/com/sun/net/httpserver/Test2.java b/test/jdk/com/sun/net/httpserver/Test2.java
index 2bd0fc2288c..296d8b4b19d 100644
--- a/test/jdk/com/sun/net/httpserver/Test2.java
+++ b/test/jdk/com/sun/net/httpserver/Test2.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2019, 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
@@ -25,6 +25,9 @@
* @test
* @bug 6270015
* @summary Light weight HTTP server
+ * @library /test/lib
+ * @run main Test2
+ * @run main/othervm -Djava.net.preferIPv6Addresses=true Test2
*/
import com.sun.net.httpserver.*;
@@ -36,6 +39,7 @@ import java.net.*;
import java.security.*;
import javax.security.auth.callback.*;
import javax.net.ssl.*;
+import jdk.test.lib.net.URIBuilder;
/**
* Test authentication
@@ -45,7 +49,8 @@ public class Test2 extends Test {
public static void main (String[] args) throws Exception {
Handler handler = new Handler();
- InetSocketAddress addr = new InetSocketAddress (0);
+ InetAddress loopback = InetAddress.getLoopbackAddress();
+ InetSocketAddress addr = new InetSocketAddress(loopback, 0);
HttpServer server = HttpServer.create (addr, 0);
HttpContext ctx = server.createContext ("/test", handler);
BasicAuthenticator a = new BasicAuthenticator ("foobar@test.realm") {
@@ -60,9 +65,15 @@ public class Test2 extends Test {
server.start ();
java.net.Authenticator.setDefault (new MyAuthenticator());
- URL url = new URL ("http://localhost:"+server.getAddress().getPort()+"/test/foo.html");
+ URL url = URIBuilder.newBuilder()
+ .scheme("http")
+ .loopback()
+ .port(server.getAddress().getPort())
+ .path("/test/foo.html")
+ .toURL();
+
System.out.print ("Test2: " );
- HttpURLConnection urlc = (HttpURLConnection)url.openConnection ();
+ HttpURLConnection urlc = (HttpURLConnection)url.openConnection(Proxy.NO_PROXY);
InputStream is = urlc.getInputStream();
int c = 0;
while (is.read()!= -1) {
diff --git a/test/jdk/com/sun/net/httpserver/Test3.java b/test/jdk/com/sun/net/httpserver/Test3.java
index 03486ec6a6f..7e40b9505fe 100644
--- a/test/jdk/com/sun/net/httpserver/Test3.java
+++ b/test/jdk/com/sun/net/httpserver/Test3.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2019, 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
@@ -26,6 +26,8 @@
* @bug 6270015
* @summary Light weight HTTP server
* @run main/othervm -Dsun.net.httpserver.idleInterval=4 Test3
+ * @run main/othervm -Djava.net.preferIPv6Addresses=true
+ * -Dsun.net.httpserver.idleInterval=4 Test3
*/
import com.sun.net.httpserver.*;
@@ -48,7 +50,8 @@ public class Test3 extends Test {
public static void main (String[] args) throws Exception {
System.out.print ("Test3: ");
Handler handler = new Handler();
- InetSocketAddress addr = new InetSocketAddress (0);
+ InetAddress loopback = InetAddress.getLoopbackAddress();
+ InetSocketAddress addr = new InetSocketAddress(loopback, 0);
HttpServer server = HttpServer.create (addr, 0);
int port = server.getAddress().getPort();
HttpContext c2 = server.createContext ("/test", handler);
@@ -135,7 +138,7 @@ public class Test3 extends Test {
"GET /test/4.html HTTP/1.1\r\nContent-length: 10\r\n"+
"\r\n"+body4;
- Socket socket = new Socket ("localhost", port);
+ Socket socket = new Socket (InetAddress.getLoopbackAddress(), port);
OutputStream os = socket.getOutputStream();
os.write (s.getBytes());
InputStream is = socket.getInputStream();
diff --git a/test/jdk/com/sun/net/httpserver/Test4.java b/test/jdk/com/sun/net/httpserver/Test4.java
index b91d256d6dd..e6527f272db 100644
--- a/test/jdk/com/sun/net/httpserver/Test4.java
+++ b/test/jdk/com/sun/net/httpserver/Test4.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2019, 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
@@ -26,6 +26,8 @@
* @bug 6270015
* @summary Light weight HTTP server
* @run main/othervm -Dsun.net.httpserver.idleInterval=4 Test4
+ * @run main/othervm -Djava.net.preferIPv6Addresses=true
+ * -Dsun.net.httpserver.idleInterval=4 Test4
*/
import com.sun.net.httpserver.*;
@@ -46,7 +48,8 @@ public class Test4 extends Test {
public static void main (String[] args) throws Exception {
System.out.print ("Test4: ");
Handler handler = new Handler();
- InetSocketAddress addr = new InetSocketAddress (0);
+ InetAddress loopback = InetAddress.getLoopbackAddress();
+ InetSocketAddress addr = new InetSocketAddress(loopback, 0);
HttpServer server = HttpServer.create (addr, 0);
int port = server.getAddress().getPort();
HttpContext c2 = server.createContext ("/test", handler);
@@ -133,7 +136,7 @@ public class Test4 extends Test {
"GET /test/4.html HTTP/1.1\r\nContent-length: 10\r\n"+
"\r\n"+body4;
- Socket socket = new Socket ("localhost", port);
+ Socket socket = new Socket (InetAddress.getLoopbackAddress(), port);
OutputStream os = socket.getOutputStream();
os.write (s.getBytes());
InputStream is = socket.getInputStream();
diff --git a/test/jdk/com/sun/net/httpserver/Test5.java b/test/jdk/com/sun/net/httpserver/Test5.java
index f704cf8ef42..31c42f12e72 100644
--- a/test/jdk/com/sun/net/httpserver/Test5.java
+++ b/test/jdk/com/sun/net/httpserver/Test5.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2019, 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
@@ -26,6 +26,8 @@
* @bug 6270015
* @summary Light weight HTTP server
* @run main/othervm -Dsun.net.httpserver.idleInterval=4 Test5
+ * @run main/othervm -Djava.net.preferIPv6Addresses=true
+ * -Dsun.net.httpserver.idleInterval=4 Test5
*/
import com.sun.net.httpserver.*;
@@ -47,7 +49,8 @@ public class Test5 extends Test {
public static void main (String[] args) throws Exception {
System.out.print ("Test5: ");
Handler handler = new Handler();
- InetSocketAddress addr = new InetSocketAddress (0);
+ InetAddress loopback = InetAddress.getLoopbackAddress();
+ InetSocketAddress addr = new InetSocketAddress(loopback, 0);
HttpServer server = HttpServer.create (addr, 0);
int port = server.getAddress().getPort();
HttpContext c2 = server.createContext ("/test", handler);
@@ -132,7 +135,7 @@ public class Test5 extends Test {
"GET /test/4.html HTTP/1.1\r\nContent-length: 10\r\n"+
"\r\n"+body4;
- Socket socket = new Socket ("localhost", port);
+ Socket socket = new Socket (InetAddress.getLoopbackAddress(), port);
OutputStream os = socket.getOutputStream();
os.write (s.getBytes());
InputStream is = socket.getInputStream();
diff --git a/test/jdk/com/sun/net/httpserver/Test6.java b/test/jdk/com/sun/net/httpserver/Test6.java
index 2f502da61b1..f13277e4994 100644
--- a/test/jdk/com/sun/net/httpserver/Test6.java
+++ b/test/jdk/com/sun/net/httpserver/Test6.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2019, 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
@@ -25,6 +25,9 @@
* @test
* @bug 6270015
* @summary Light weight HTTP server
+ * @library /test/lib
+ * @run main Test6
+ * @run main/othervm -Djava.net.preferIPv6Addresses=true Test6
*/
import com.sun.net.httpserver.*;
@@ -36,6 +39,7 @@ import java.net.*;
import java.security.*;
import javax.security.auth.callback.*;
import javax.net.ssl.*;
+import jdk.test.lib.net.URIBuilder;
/**
* Test POST large file via chunked encoding (unusually small chunks)
@@ -45,16 +49,23 @@ public class Test6 extends Test {
public static void main (String[] args) throws Exception {
Handler handler = new Handler();
- InetSocketAddress addr = new InetSocketAddress (0);
+ InetAddress loopback = InetAddress.getLoopbackAddress();
+ InetSocketAddress addr = new InetSocketAddress(loopback, 0);
HttpServer server = HttpServer.create (addr, 0);
HttpContext ctx = server.createContext ("/test", handler);
ExecutorService executor = Executors.newCachedThreadPool();
server.setExecutor (executor);
server.start ();
- URL url = new URL ("http://localhost:"+server.getAddress().getPort()+"/test/foo.html");
+ URL url = URIBuilder.newBuilder()
+ .scheme("http")
+ .loopback()
+ .port(server.getAddress().getPort())
+ .path("/test/foo.html")
+ .toURL();
+
System.out.print ("Test6: " );
- HttpURLConnection urlc = (HttpURLConnection)url.openConnection ();
+ HttpURLConnection urlc = (HttpURLConnection)url.openConnection(Proxy.NO_PROXY);
urlc.setDoOutput (true);
urlc.setRequestMethod ("POST");
urlc.setChunkedStreamingMode (32); // small chunks
diff --git a/test/jdk/com/sun/net/httpserver/Test7.java b/test/jdk/com/sun/net/httpserver/Test7.java
index 28ee0adae31..e022109578d 100644
--- a/test/jdk/com/sun/net/httpserver/Test7.java
+++ b/test/jdk/com/sun/net/httpserver/Test7.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2019, 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
@@ -24,7 +24,10 @@
/**
* @test
* @bug 6270015
+ * @library /test/lib
* @summary Light weight HTTP server
+ * @run main Test7
+ * @run main/othervm -Djava.net.preferIPv6Addresses=true Test7
*/
import com.sun.net.httpserver.*;
@@ -36,6 +39,7 @@ import java.net.*;
import java.security.*;
import javax.security.auth.callback.*;
import javax.net.ssl.*;
+import jdk.test.lib.net.URIBuilder;
/**
* Test POST large file via chunked encoding (large chunks)
@@ -45,16 +49,22 @@ public class Test7 extends Test {
public static void main (String[] args) throws Exception {
Handler handler = new Handler();
- InetSocketAddress addr = new InetSocketAddress (0);
+ InetAddress loopback = InetAddress.getLoopbackAddress();
+ InetSocketAddress addr = new InetSocketAddress(loopback, 0);
HttpServer server = HttpServer.create (addr, 0);
HttpContext ctx = server.createContext ("/test", handler);
ExecutorService executor = Executors.newCachedThreadPool();
server.setExecutor (executor);
server.start ();
- URL url = new URL ("http://localhost:"+server.getAddress().getPort()+"/test/foo.html");
+ URL url = URIBuilder.newBuilder()
+ .scheme("http")
+ .loopback()
+ .port(server.getAddress().getPort())
+ .path("/test/foo.html")
+ .toURL();
System.out.print ("Test7: " );
- HttpURLConnection urlc = (HttpURLConnection)url.openConnection ();
+ HttpURLConnection urlc = (HttpURLConnection)url.openConnection(Proxy.NO_PROXY);
urlc.setDoOutput (true);
urlc.setRequestMethod ("POST");
urlc.setChunkedStreamingMode (16 * 1024); // big chunks
diff --git a/test/jdk/com/sun/net/httpserver/Test7a.java b/test/jdk/com/sun/net/httpserver/Test7a.java
index b170cded2aa..65e8998f9d8 100644
--- a/test/jdk/com/sun/net/httpserver/Test7a.java
+++ b/test/jdk/com/sun/net/httpserver/Test7a.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2019, 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
@@ -25,8 +25,9 @@
* @test
* @bug 6270015
* @library /test/lib
- * @build jdk.test.lib.net.SimpleSSLContext
+ * @build jdk.test.lib.net.SimpleSSLContext jdk.test.lib.net.URIBuilder
* @run main/othervm Test7a
+ * @run main/othervm -Djava.net.preferIPv6Addresses=true Test7a
* @summary Light weight HTTP server
*/
@@ -37,6 +38,7 @@ import java.io.*;
import java.net.*;
import javax.net.ssl.*;
import jdk.test.lib.net.SimpleSSLContext;
+import jdk.test.lib.net.URIBuilder;
/**
* Test POST large file via chunked encoding (large chunks)
@@ -51,7 +53,8 @@ public class Test7a extends Test {
//h.setLevel (Level.ALL);
//log.addHandler (h);
Handler handler = new Handler();
- InetSocketAddress addr = new InetSocketAddress (0);
+ InetAddress loopback = InetAddress.getLoopbackAddress();
+ InetSocketAddress addr = new InetSocketAddress(loopback, 0);
HttpsServer server = HttpsServer.create (addr, 0);
HttpContext ctx = server.createContext ("/test", handler);
ExecutorService executor = Executors.newCachedThreadPool();
@@ -60,9 +63,15 @@ public class Test7a extends Test {
server.setExecutor (executor);
server.start ();
- URL url = new URL ("https://localhost:"+server.getAddress().getPort()+"/test/foo.html");
+ URL url = URIBuilder.newBuilder()
+ .scheme("https")
+ .loopback()
+ .port(server.getAddress().getPort())
+ .path("/test/foo.html")
+ .toURL();
+
System.out.print ("Test7a: " );
- HttpsURLConnection urlc = (HttpsURLConnection)url.openConnection ();
+ HttpsURLConnection urlc = (HttpsURLConnection)url.openConnection(Proxy.NO_PROXY);
urlc.setDoOutput (true);
urlc.setRequestMethod ("POST");
urlc.setChunkedStreamingMode (16 * 1024); // big chunks
diff --git a/test/jdk/com/sun/net/httpserver/Test8.java b/test/jdk/com/sun/net/httpserver/Test8.java
index a30ef00b62d..343421e8adc 100644
--- a/test/jdk/com/sun/net/httpserver/Test8.java
+++ b/test/jdk/com/sun/net/httpserver/Test8.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2019, 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
@@ -24,7 +24,10 @@
/**
* @test
* @bug 6270015
+ * @library /test/lib
* @summary Light weight HTTP server
+ * @run main Test8
+ * @run main/othervm -Djava.net.preferIPv6Addresses=true Test8
*/
import com.sun.net.httpserver.*;
@@ -36,6 +39,7 @@ import java.net.*;
import java.security.*;
import javax.security.auth.callback.*;
import javax.net.ssl.*;
+import jdk.test.lib.net.URIBuilder;
/**
* Test POST large file via fixed len encoding
@@ -45,16 +49,23 @@ public class Test8 extends Test {
public static void main (String[] args) throws Exception {
Handler handler = new Handler();
- InetSocketAddress addr = new InetSocketAddress (0);
+ InetAddress loopback = InetAddress.getLoopbackAddress();
+ InetSocketAddress addr = new InetSocketAddress(loopback, 0);
HttpServer server = HttpServer.create (addr, 0);
HttpContext ctx = server.createContext ("/test", handler);
ExecutorService executor = Executors.newCachedThreadPool();
server.setExecutor (executor);
server.start ();
- URL url = new URL ("http://localhost:"+server.getAddress().getPort()+"/test/foo.html");
+ URL url = URIBuilder.newBuilder()
+ .scheme("http")
+ .loopback()
+ .port(server.getAddress().getPort())
+ .path("/test/foo.html")
+ .toURL();
+
System.out.print ("Test8: " );
- HttpURLConnection urlc = (HttpURLConnection)url.openConnection ();
+ HttpURLConnection urlc = (HttpURLConnection)url.openConnection(Proxy.NO_PROXY);
urlc.setDoOutput (true);
urlc.setRequestMethod ("POST");
OutputStream os = new BufferedOutputStream (urlc.getOutputStream());
diff --git a/test/jdk/com/sun/net/httpserver/Test8a.java b/test/jdk/com/sun/net/httpserver/Test8a.java
index daf65e21fa7..06cffa913aa 100644
--- a/test/jdk/com/sun/net/httpserver/Test8a.java
+++ b/test/jdk/com/sun/net/httpserver/Test8a.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2019, 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
@@ -25,8 +25,9 @@
* @test
* @bug 6270015
* @library /test/lib
- * @build jdk.test.lib.net.SimpleSSLContext
+ * @build jdk.test.lib.net.SimpleSSLContext jdk.test.lib.net.URIBuilder
* @run main/othervm Test8a
+ * @run main/othervm -Djava.net.preferIPv6Addresses=true Test8a
* @summary Light weight HTTP server
*/
@@ -37,6 +38,7 @@ import java.io.*;
import java.net.*;
import javax.net.ssl.*;
import jdk.test.lib.net.SimpleSSLContext;
+import jdk.test.lib.net.URIBuilder;
/**
* Test POST large file via fixed len encoding
@@ -54,7 +56,8 @@ public class Test8a extends Test {
ExecutorService executor = null;
try {
Handler handler = new Handler();
- InetSocketAddress addr = new InetSocketAddress (0);
+ InetAddress loopback = InetAddress.getLoopbackAddress();
+ InetSocketAddress addr = new InetSocketAddress(loopback, 0);
server = HttpsServer.create (addr, 0);
HttpContext ctx = server.createContext ("/test", handler);
executor = Executors.newCachedThreadPool();
@@ -63,9 +66,15 @@ public class Test8a extends Test {
server.setExecutor (executor);
server.start ();
- URL url = new URL ("https://localhost:"+server.getAddress().getPort()+"/test/foo.html");
+ URL url = URIBuilder.newBuilder()
+ .scheme("https")
+ .loopback()
+ .port(server.getAddress().getPort())
+ .path("/test/foo.html")
+ .toURL();
+
System.out.print ("Test8a: " );
- HttpsURLConnection urlc = (HttpsURLConnection)url.openConnection ();
+ HttpsURLConnection urlc = (HttpsURLConnection)url.openConnection(Proxy.NO_PROXY);
urlc.setDoOutput (true);
urlc.setRequestMethod ("POST");
urlc.setHostnameVerifier (new DummyVerifier());
diff --git a/test/jdk/com/sun/net/httpserver/Test9.java b/test/jdk/com/sun/net/httpserver/Test9.java
index fa0588a91fc..d989d7d4d3c 100644
--- a/test/jdk/com/sun/net/httpserver/Test9.java
+++ b/test/jdk/com/sun/net/httpserver/Test9.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2019, 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
@@ -25,8 +25,9 @@
* @test
* @bug 6270015
* @library /test/lib
- * @build jdk.test.lib.net.SimpleSSLContext
+ * @build jdk.test.lib.net.SimpleSSLContext jdk.test.lib.net.URIBuilder
* @run main/othervm Test9
+ * @run main/othervm -Djava.net.preferIPv6Addresses=true Test9
* @summary Light weight HTTP server
*/
@@ -37,6 +38,7 @@ import java.io.*;
import java.net.*;
import javax.net.ssl.*;
import jdk.test.lib.net.SimpleSSLContext;
+import jdk.test.lib.net.URIBuilder;
/* Same as Test1 but requests run in parallel.
*/
@@ -53,7 +55,8 @@ public class Test9 extends Test {
try {
String root = System.getProperty ("test.src")+ "/docs";
System.out.print ("Test9: ");
- InetSocketAddress addr = new InetSocketAddress (0);
+ InetAddress loopback = InetAddress.getLoopbackAddress();
+ InetSocketAddress addr = new InetSocketAddress(loopback, 0);
s1 = HttpServer.create (addr, 0);
s2 = HttpsServer.create (addr, 0);
HttpHandler h = new FileServerHandler (root);
@@ -137,8 +140,14 @@ public class Test9 extends Test {
public void run () {
try {
- URL url = new URL (protocol+"://localhost:"+port+"/test1/"+f);
- HttpURLConnection urlc = (HttpURLConnection) url.openConnection();
+ URL url = URIBuilder.newBuilder()
+ .scheme(protocol)
+ .loopback()
+ .port(port)
+ .path("/test1/" + f)
+ .toURL();
+
+ HttpURLConnection urlc = (HttpURLConnection) url.openConnection(Proxy.NO_PROXY);
if (urlc instanceof HttpsURLConnection) {
HttpsURLConnection urlcs = (HttpsURLConnection) urlc;
urlcs.setHostnameVerifier (new HostnameVerifier () {
@@ -185,7 +194,8 @@ public class Test9 extends Test {
String orig = root + "/" + f;
compare (new File(orig), temp);
temp.delete();
- } catch (IOException e) {
+ } catch (Exception e) {
+ e.printStackTrace();
error = true;
}
}
diff --git a/test/jdk/com/sun/net/httpserver/Test9a.java b/test/jdk/com/sun/net/httpserver/Test9a.java
index ff5be52be0b..66b044e8d9a 100644
--- a/test/jdk/com/sun/net/httpserver/Test9a.java
+++ b/test/jdk/com/sun/net/httpserver/Test9a.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2019, 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
@@ -25,8 +25,9 @@
* @test
* @bug 6270015
* @library /test/lib
- * @build jdk.test.lib.net.SimpleSSLContext
+ * @build jdk.test.lib.net.SimpleSSLContext jdk.test.lib.net.URIBuilder
* @run main/othervm Test9a
+ * @run main/othervm -Djava.net.preferIPv6Addresses=true Test9a
* @summary Light weight HTTP server
*/
@@ -37,6 +38,7 @@ import java.io.*;
import java.net.*;
import javax.net.ssl.*;
import jdk.test.lib.net.SimpleSSLContext;
+import jdk.test.lib.net.URIBuilder;
/* Same as Test1 but requests run in parallel.
*/
@@ -53,7 +55,8 @@ public class Test9a extends Test {
try {
String root = System.getProperty ("test.src")+ "/docs";
System.out.print ("Test9a: ");
- InetSocketAddress addr = new InetSocketAddress (0);
+ InetAddress loopback = InetAddress.getLoopbackAddress();
+ InetSocketAddress addr = new InetSocketAddress(loopback, 0);
server = HttpsServer.create (addr, 0);
HttpHandler h = new FileServerHandler (root);
HttpContext c1 = server.createContext ("/test1", h);
@@ -131,8 +134,14 @@ public class Test9a extends Test {
public void run () {
try {
- URL url = new URL (protocol+"://localhost:"+port+"/test1/"+f);
- HttpURLConnection urlc = (HttpURLConnection) url.openConnection();
+ URL url = URIBuilder.newBuilder()
+ .scheme(protocol)
+ .loopback()
+ .port(port)
+ .path("/test1/" + f)
+ .toURL();
+
+ HttpURLConnection urlc = (HttpURLConnection) url.openConnection(Proxy.NO_PROXY);
if (urlc instanceof HttpsURLConnection) {
HttpsURLConnection urlcs = (HttpsURLConnection) urlc;
urlcs.setHostnameVerifier (new HostnameVerifier () {
@@ -179,7 +188,7 @@ public class Test9a extends Test {
String orig = root + "/" + f;
compare (new File(orig), temp);
temp.delete();
- } catch (IOException e) {
+ } catch (Exception e) {
e.printStackTrace();
error = true;
}
diff --git a/test/jdk/com/sun/net/httpserver/TestLogging.java b/test/jdk/com/sun/net/httpserver/TestLogging.java
index 95399844087..4f45197872c 100644
--- a/test/jdk/com/sun/net/httpserver/TestLogging.java
+++ b/test/jdk/com/sun/net/httpserver/TestLogging.java
@@ -26,6 +26,8 @@
* @bug 6422914
* @library /test/lib
* @summary change httpserver exception printouts
+ * @run main TestLogging
+ * @run main/othervm -Djava.net.preferIPv6Addresses=true TestLogging
*/
import com.sun.net.httpserver.*;
@@ -49,7 +51,8 @@ public class TestLogging extends Test {
try {
System.out.print ("Test9: ");
String root = System.getProperty ("test.src")+ "/docs";
- InetSocketAddress addr = new InetSocketAddress (0);
+ InetAddress loopback = InetAddress.getLoopbackAddress();
+ InetSocketAddress addr = new InetSocketAddress(loopback, 0);
Logger logger = Logger.getLogger ("com.sun.net.httpserver");
logger.setLevel (Level.ALL);
Handler h1 = new ConsoleHandler ();
@@ -70,9 +73,9 @@ public class TestLogging extends Test {
.loopback()
.port(p1)
.path("/test1/smallfile.txt")
- .toURLUnchecked();
+ .toURL();
System.out.println("URL: " + url);
- HttpURLConnection urlc = (HttpURLConnection)url.openConnection();
+ HttpURLConnection urlc = (HttpURLConnection)url.openConnection(Proxy.NO_PROXY);
InputStream is = urlc.getInputStream();
while (is.read() != -1) ;
is.close();
diff --git a/test/jdk/com/sun/net/httpserver/bugs/B6339483.java b/test/jdk/com/sun/net/httpserver/bugs/B6339483.java
index 37febd31579..d2a62155a95 100644
--- a/test/jdk/com/sun/net/httpserver/bugs/B6339483.java
+++ b/test/jdk/com/sun/net/httpserver/bugs/B6339483.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2019, 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
@@ -25,6 +25,9 @@
* @test
* @bug 6339483
* @summary NullPointerException when creating a HttpContext with no handler
+ * @library /test/lib
+ * @run main B6339483
+ * @run main/othervm -Djava.net.preferIPv6Addresses=true B6339483
*/
import com.sun.net.httpserver.*;
@@ -36,19 +39,26 @@ import java.net.*;
import java.security.*;
import java.security.cert.*;
import javax.net.ssl.*;
+import jdk.test.lib.net.URIBuilder;
public class B6339483 {
public static void main (String[] args) throws Exception {
- InetSocketAddress addr = new InetSocketAddress (0);
+ InetAddress loopback = InetAddress.getLoopbackAddress();
+ InetSocketAddress addr = new InetSocketAddress (loopback, 0);
HttpServer server = HttpServer.create (addr, 0);
HttpContext ctx = server.createContext ("/test");
ExecutorService executor = Executors.newCachedThreadPool();
server.setExecutor (executor);
server.start ();
- URL url = new URL ("http://localhost:"+server.getAddress().getPort()+"/test/foo.html");
- HttpURLConnection urlc = (HttpURLConnection)url.openConnection ();
+ URL url = URIBuilder.newBuilder()
+ .scheme("http")
+ .loopback()
+ .port(server.getAddress().getPort())
+ .path("/test/foo.html")
+ .toURL();
+ HttpURLConnection urlc = (HttpURLConnection)url.openConnection(Proxy.NO_PROXY);
try {
InputStream is = urlc.getInputStream();
int c = 0;
diff --git a/test/jdk/com/sun/net/httpserver/bugs/B6341616.java b/test/jdk/com/sun/net/httpserver/bugs/B6341616.java
index 9b81a2d49f3..d8239481c3d 100644
--- a/test/jdk/com/sun/net/httpserver/bugs/B6341616.java
+++ b/test/jdk/com/sun/net/httpserver/bugs/B6341616.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2019, 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
@@ -24,6 +24,9 @@
/**
* @test
* @bug 6341616
+ * @library /test/lib
+ * @run main B6341616
+ * @run main/othervm -Djava.net.preferIPv6Addresses=true B6341616
* @summary Server doesnt send response if there is a RuntimeException in validate of BasicAuthFilter
*/
@@ -36,12 +39,14 @@ import java.net.*;
import java.security.*;
import java.security.cert.*;
import javax.net.ssl.*;
+import jdk.test.lib.net.URIBuilder;
public class B6341616 {
public static void main (String[] args) throws Exception {
Handler handler = new Handler();
- InetSocketAddress addr = new InetSocketAddress (0);
+ InetAddress loopback = InetAddress.getLoopbackAddress();
+ InetSocketAddress addr = new InetSocketAddress (loopback, 0);
HttpServer server = HttpServer.create (addr, 0);
HttpContext ctx = server.createContext ("/test", handler);
BasicAuthenticator filter = new BasicAuthenticator ("foobar@test.realm") {
@@ -56,8 +61,13 @@ public class B6341616 {
server.start ();
java.net.Authenticator.setDefault (new MyAuthenticator());
- URL url = new URL ("http://localhost:"+server.getAddress().getPort()+"/test/foo.html");
- HttpURLConnection urlc = (HttpURLConnection)url.openConnection ();
+ URL url = URIBuilder.newBuilder()
+ .scheme("http")
+ .loopback()
+ .port(server.getAddress().getPort())
+ .path("/test/foo.html")
+ .toURL();
+ HttpURLConnection urlc = (HttpURLConnection)url.openConnection(Proxy.NO_PROXY);
try {
InputStream is = urlc.getInputStream();
int c = 0;
diff --git a/test/jdk/com/sun/net/httpserver/bugs/B6393710.java b/test/jdk/com/sun/net/httpserver/bugs/B6393710.java
index 6eb5a04e296..bea0257295e 100644
--- a/test/jdk/com/sun/net/httpserver/bugs/B6393710.java
+++ b/test/jdk/com/sun/net/httpserver/bugs/B6393710.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2019, 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
@@ -25,6 +25,8 @@
* @test
* @bug 6393710
* @summary Non authenticated call followed by authenticated call never returns
+ * @run main B6393710
+ * @run main/othervm -Djava.net.preferIPv6Addresses=true B6393710
*/
import com.sun.net.httpserver.*;
@@ -65,7 +67,8 @@ public class B6393710 {
public static void main (String[] args) throws Exception {
Handler handler = new Handler();
- InetSocketAddress addr = new InetSocketAddress (0);
+ InetAddress loopback = InetAddress.getLoopbackAddress();
+ InetSocketAddress addr = new InetSocketAddress (loopback, 0);
HttpServer server = HttpServer.create (addr, 0);
HttpContext ctx = server.createContext ("/test", handler);
ctx.setAuthenticator (new BasicAuthenticator ("test") {
@@ -76,7 +79,7 @@ public class B6393710 {
server.start ();
- Socket s = new Socket ("localhost", server.getAddress().getPort());
+ Socket s = new Socket (loopback, server.getAddress().getPort());
s.setSoTimeout (5000);
OutputStream os = s.getOutputStream();
diff --git a/test/jdk/com/sun/net/httpserver/bugs/B6526158.java b/test/jdk/com/sun/net/httpserver/bugs/B6526158.java
index a7af2bbe161..5207d07e7cc 100644
--- a/test/jdk/com/sun/net/httpserver/bugs/B6526158.java
+++ b/test/jdk/com/sun/net/httpserver/bugs/B6526158.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2019, 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
@@ -24,6 +24,9 @@
/**
* @test
* @bug 6526158
+ * @library /test/lib
+ * @run main B6526158
+ * @run main/othervm -Djava.net.preferIPv6Addresses=true B6526158
* @summary HttpExchange.getRequestBody().close() throws Exception
*/
@@ -36,6 +39,7 @@ import java.net.*;
import java.security.*;
import java.security.cert.*;
import javax.net.ssl.*;
+import jdk.test.lib.net.URIBuilder;
public class B6526158 {
@@ -44,7 +48,8 @@ public class B6526158 {
public static void main (String[] args) throws Exception {
Handler handler = new Handler();
- InetSocketAddress addr = new InetSocketAddress (0);
+ InetAddress loopback = InetAddress.getLoopbackAddress();
+ InetSocketAddress addr = new InetSocketAddress (loopback, 0);
HttpServer server = HttpServer.create (addr, 0);
HttpContext ctx = server.createContext ("/test", handler);
@@ -52,8 +57,13 @@ public class B6526158 {
server.setExecutor (executor);
server.start ();
- URL url = new URL ("http://localhost:"+server.getAddress().getPort()+"/test/foo.html");
- HttpURLConnection urlc = (HttpURLConnection)url.openConnection ();
+ URL url = URIBuilder.newBuilder()
+ .scheme("http")
+ .loopback()
+ .port(server.getAddress().getPort())
+ .path("/test/foo.html")
+ .toURL();
+ HttpURLConnection urlc = (HttpURLConnection)url.openConnection(Proxy.NO_PROXY);
urlc.setDoOutput (true);
try {
OutputStream os = new BufferedOutputStream (urlc.getOutputStream());
diff --git a/test/jdk/com/sun/net/httpserver/bugs/B6526913.java b/test/jdk/com/sun/net/httpserver/bugs/B6526913.java
index a8dccd261f0..a8c4fe64f12 100644
--- a/test/jdk/com/sun/net/httpserver/bugs/B6526913.java
+++ b/test/jdk/com/sun/net/httpserver/bugs/B6526913.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2019, 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
@@ -24,7 +24,10 @@
/**
* @test
* @bug 6526913
+ * @library /test/lib
* @run main/othervm -Dhttp.keepAlive=false B6526913
+ * @run main/othervm -Djava.net.preferIPv6Addresses=true
+ * -Dhttp.keepAlive=false B6526913
* @summary HttpExchange.getResponseBody().close() throws Exception
*/
@@ -37,12 +40,14 @@ import java.net.*;
import java.security.*;
import java.security.cert.*;
import javax.net.ssl.*;
+import jdk.test.lib.net.URIBuilder;
public class B6526913 {
public static void main (String[] args) throws Exception {
Handler handler = new Handler();
- InetSocketAddress addr = new InetSocketAddress (0);
+ InetAddress loopback = InetAddress.getLoopbackAddress();
+ InetSocketAddress addr = new InetSocketAddress (loopback, 0);
HttpServer server = HttpServer.create (addr, 0);
HttpContext ctx = server.createContext ("/test", handler);
@@ -50,8 +55,13 @@ public class B6526913 {
server.setExecutor (executor);
server.start ();
- URL url = new URL ("http://localhost:"+server.getAddress().getPort()+"/test/foo.html");
- HttpURLConnection urlc = (HttpURLConnection)url.openConnection ();
+ URL url = URIBuilder.newBuilder()
+ .scheme("http")
+ .loopback()
+ .port(server.getAddress().getPort())
+ .path("/test/foo.html")
+ .toURL();
+ HttpURLConnection urlc = (HttpURLConnection)url.openConnection (Proxy.NO_PROXY);
try {
InputStream is = urlc.getInputStream();
int c ,count = 0;
diff --git a/test/jdk/com/sun/net/httpserver/bugs/B6529200.java b/test/jdk/com/sun/net/httpserver/bugs/B6529200.java
index a5abb947b6f..8c86fc93daa 100644
--- a/test/jdk/com/sun/net/httpserver/bugs/B6529200.java
+++ b/test/jdk/com/sun/net/httpserver/bugs/B6529200.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2019, 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
@@ -25,6 +25,7 @@
* @test
* @bug 6529200
* @run main/othervm B6529200
+ * @run main/othervm -Djava.net.preferIPv6Addresses=true B6529200
* @summary lightweight http server does not work with http1.0 clients
*/
@@ -42,7 +43,8 @@ public class B6529200 {
public static void main (String[] args) throws Exception {
Handler handler = new Handler();
- InetSocketAddress addr = new InetSocketAddress (0);
+ InetAddress loopback = InetAddress.getLoopbackAddress();
+ InetSocketAddress addr = new InetSocketAddress (loopback, 0);
HttpServer server = HttpServer.create (addr, 0);
HttpContext ctx = server.createContext ("/test", handler);
@@ -52,7 +54,7 @@ public class B6529200 {
/* test 1: keep-alive */
- Socket sock = new Socket ("localhost", server.getAddress().getPort());
+ Socket sock = new Socket (loopback, server.getAddress().getPort());
OutputStream os = sock.getOutputStream();
System.out.println ("GET /test/foo HTTP/1.0\r\nConnection: keep-alive\r\n\r\n");
os.write ("GET /test/foo HTTP/1.0\r\nConnection: keep-alive\r\n\r\n".getBytes());
diff --git a/test/jdk/com/sun/net/httpserver/bugs/B6744329.java b/test/jdk/com/sun/net/httpserver/bugs/B6744329.java
index c84e666f425..b0ecc4f480b 100644
--- a/test/jdk/com/sun/net/httpserver/bugs/B6744329.java
+++ b/test/jdk/com/sun/net/httpserver/bugs/B6744329.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2019, 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
@@ -25,6 +25,9 @@
* @test
* @bug 6744329
* @summary Exception in light weight Http server
+ * @library /test/lib
+ * @run main B6744329
+ * @run main/othervm -Djava.net.preferIPv6Addresses=true B6744329
*/
import com.sun.net.httpserver.*;
@@ -36,20 +39,27 @@ import java.net.*;
import java.security.*;
import java.security.cert.*;
import javax.net.ssl.*;
+import jdk.test.lib.net.URIBuilder;
public class B6744329 {
public static void main (String[] args) throws Exception {
Handler handler = new Handler();
- InetSocketAddress addr = new InetSocketAddress (0);
+ InetAddress loopback = InetAddress.getLoopbackAddress();
+ InetSocketAddress addr = new InetSocketAddress (loopback, 0);
HttpServer server = HttpServer.create (addr, 0);
HttpContext ctx = server.createContext ("/test", handler);
ExecutorService executor = Executors.newCachedThreadPool();
server.setExecutor (executor);
server.start ();
- URL url = new URL ("http://localhost:"+server.getAddress().getPort()+"/test/foo.html");
- HttpURLConnection urlc = (HttpURLConnection)url.openConnection ();
+ URL url = URIBuilder.newBuilder()
+ .scheme("http")
+ .loopback()
+ .port(server.getAddress().getPort())
+ .path("/test/foo.html")
+ .toURL();
+ HttpURLConnection urlc = (HttpURLConnection)url.openConnection(Proxy.NO_PROXY);
try {
InputStream is = urlc.getInputStream();
int c = 0;
@@ -59,6 +69,7 @@ public class B6744329 {
System.out.println ("OK");
} catch (IOException e) {
System.out.println ("exception");
+ e.printStackTrace();
error = true;
}
server.stop(2);
diff --git a/test/jdk/com/sun/net/httpserver/bugs/B6886436.java b/test/jdk/com/sun/net/httpserver/bugs/B6886436.java
index 9af17eabcb4..710c27d4daa 100644
--- a/test/jdk/com/sun/net/httpserver/bugs/B6886436.java
+++ b/test/jdk/com/sun/net/httpserver/bugs/B6886436.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2019, 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
@@ -24,7 +24,10 @@
/**
* @test
* @bug 6886436
- * @summary
+ * @summary HttpServer should not send a body with 204 response.
+ * @library /test/lib
+ * @run main B6886436
+ * @run main/othervm -Djava.net.preferIPv6Addresses=true B6886436
*/
import com.sun.net.httpserver.*;
@@ -34,6 +37,7 @@ import java.util.concurrent.*;
import java.util.logging.*;
import java.io.*;
import java.net.*;
+import jdk.test.lib.net.URIBuilder;
public class B6886436 {
@@ -44,20 +48,26 @@ public class B6886436 {
logger.addHandler (c);
logger.setLevel (Level.WARNING);
Handler handler = new Handler();
- InetSocketAddress addr = new InetSocketAddress (0);
+ InetAddress loopback = InetAddress.getLoopbackAddress();
+ InetSocketAddress addr = new InetSocketAddress (loopback, 0);
HttpServer server = HttpServer.create (addr, 0);
HttpContext ctx = server.createContext ("/test", handler);
ExecutorService executor = Executors.newCachedThreadPool();
server.setExecutor (executor);
server.start ();
- URL url = new URL ("http://localhost:"+server.getAddress().getPort()+"/test/foo.html");
- HttpURLConnection urlc = (HttpURLConnection)url.openConnection ();
+ URL url = URIBuilder.newBuilder()
+ .scheme("http")
+ .loopback()
+ .port(server.getAddress().getPort())
+ .path("/test/foo.html")
+ .toURL();
+ HttpURLConnection urlc = (HttpURLConnection)url.openConnection(Proxy.NO_PROXY);
try {
InputStream is = urlc.getInputStream();
while (is.read()!= -1) ;
is.close ();
- urlc = (HttpURLConnection)url.openConnection ();
+ urlc = (HttpURLConnection)url.openConnection(Proxy.NO_PROXY);
urlc.setReadTimeout (3000);
is = urlc.getInputStream();
while (is.read()!= -1);
diff --git a/test/jdk/com/sun/net/httpserver/bugs/FixedLengthInputStream.java b/test/jdk/com/sun/net/httpserver/bugs/FixedLengthInputStream.java
index f9791e007ae..7df66d8e15e 100644
--- a/test/jdk/com/sun/net/httpserver/bugs/FixedLengthInputStream.java
+++ b/test/jdk/com/sun/net/httpserver/bugs/FixedLengthInputStream.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2019, 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
@@ -25,20 +25,26 @@
* @test
* @bug 6756771 6755625
* @summary com.sun.net.httpserver.HttpServer should handle POSTs larger than 2Gig
+ * @library /test/lib
+ * @run main FixedLengthInputStream
+ * @run main/othervm -Djava.net.preferIPv6Addresses=true FixedLengthInputStream
*/
import java.io.InputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
+import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.HttpURLConnection;
+import java.net.Proxy;
import java.net.URL;
import java.net.Socket;
import java.util.logging.*;
import com.sun.net.httpserver.HttpExchange;
import com.sun.net.httpserver.HttpHandler;
import com.sun.net.httpserver.HttpServer;
+import jdk.test.lib.net.URIBuilder;
public class FixedLengthInputStream
{
@@ -48,8 +54,13 @@ public class FixedLengthInputStream
HttpServer httpServer = startHttpServer();
int port = httpServer.getAddress().getPort();
try {
- URL url = new URL("http://localhost:" + port + "/flis/");
- HttpURLConnection uc = (HttpURLConnection)url.openConnection();
+ URL url = URIBuilder.newBuilder()
+ .scheme("http")
+ .loopback()
+ .port(port)
+ .path("/flis/")
+ .toURLUnchecked();
+ HttpURLConnection uc = (HttpURLConnection)url.openConnection(Proxy.NO_PROXY);
uc.setDoOutput(true);
uc.setRequestMethod("POST");
uc.setFixedLengthStreamingMode(POST_SIZE);
@@ -90,7 +101,8 @@ public class FixedLengthInputStream
logger.setLevel(Level.FINEST);
logger.addHandler(outHandler);
}
- HttpServer httpServer = HttpServer.create(new InetSocketAddress(0), 0);
+ InetAddress loopback = InetAddress.getLoopbackAddress();
+ HttpServer httpServer = HttpServer.create(new InetSocketAddress(loopback, 0), 0);
httpServer.createContext("/flis/", new MyHandler(POST_SIZE));
httpServer.start();
return httpServer;
diff --git a/test/jdk/com/sun/net/httpserver/bugs/HeadTest.java b/test/jdk/com/sun/net/httpserver/bugs/HeadTest.java
index b78649014f5..b20b786decf 100644
--- a/test/jdk/com/sun/net/httpserver/bugs/HeadTest.java
+++ b/test/jdk/com/sun/net/httpserver/bugs/HeadTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019, 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
@@ -24,11 +24,16 @@
/**
* @test
* @bug 6886723
+ * @library /test/lib
+ * @run main HeadTest
+ * @run main/othervm -Djava.net.preferIPv6Addresses=true HeadTest
* @summary light weight http server doesn't return correct status code for HEAD requests
*/
+import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.HttpURLConnection;
+import java.net.Proxy;
import java.net.URL;
import java.io.IOException;
import java.util.concurrent.ExecutorService;
@@ -37,6 +42,7 @@ import com.sun.net.httpserver.HttpContext;
import com.sun.net.httpserver.HttpExchange;
import com.sun.net.httpserver.HttpHandler;
import com.sun.net.httpserver.HttpServer;
+import jdk.test.lib.net.URIBuilder;
public class HeadTest {
@@ -45,7 +51,8 @@ public class HeadTest {
}
static void server() throws Exception {
- InetSocketAddress inetAddress = new InetSocketAddress(0);
+ InetAddress loopback = InetAddress.getLoopbackAddress();
+ InetSocketAddress inetAddress = new InetSocketAddress(loopback, 0);
HttpServer server = HttpServer.create(inetAddress, 5);
try {
server.setExecutor(Executors.newFixedThreadPool(5));
@@ -88,7 +95,13 @@ public class HeadTest {
}
});
server.start();
- String urlStr = "http://localhost:" + server.getAddress().getPort() + "/";
+ String urlStr = URIBuilder.newBuilder()
+ .scheme("http")
+ .loopback()
+ .port(server.getAddress().getPort())
+ .path("/")
+ .build()
+ .toString();
System.out.println("Server is at " + urlStr);
// Run the chunked client
@@ -107,7 +120,7 @@ public class HeadTest {
}
static void runClient(String urlStr) throws Exception {
- HttpURLConnection conn = (HttpURLConnection) new URL(urlStr).openConnection();
+ HttpURLConnection conn = (HttpURLConnection) new URL(urlStr).openConnection(Proxy.NO_PROXY);
conn.setRequestMethod("HEAD");
int status = conn.getResponseCode();
if (status != 200) {
diff --git a/test/jdk/com/sun/net/httpserver/bugs/TruncatedRequestBody.java b/test/jdk/com/sun/net/httpserver/bugs/TruncatedRequestBody.java
index f72c828e437..9ceb7108f5c 100644
--- a/test/jdk/com/sun/net/httpserver/bugs/TruncatedRequestBody.java
+++ b/test/jdk/com/sun/net/httpserver/bugs/TruncatedRequestBody.java
@@ -90,7 +90,8 @@ public class TruncatedRequestBody {
logger.setLevel(Level.ALL);
logger.addHandler(h);
- InetSocketAddress addr = new InetSocketAddress(0);
+ InetAddress loopback = InetAddress.getLoopbackAddress();
+ InetSocketAddress addr = new InetSocketAddress(loopback, 0);
HttpServer server = HttpServer.create(addr, 10);
HttpContext ct = server.createContext("/", new Handler());
ExecutorService ex = Executors.newCachedThreadPool();
@@ -101,7 +102,7 @@ public class TruncatedRequestBody {
// Test 1: fixed length
- Socket sock = new Socket(InetAddress.getLoopbackAddress(), port);
+ Socket sock = new Socket(loopback, port);
String s1 = "POST /foo HTTP/1.1\r\nContent-length: 200000\r\n"
+ "\r\nfoo bar99";
@@ -115,7 +116,7 @@ public class TruncatedRequestBody {
String s2 = "POST /foo HTTP/1.1\r\nTransfer-encoding: chunked\r\n\r\n" +
"100\r\nFoo bar";
- sock = new Socket(InetAddress.getLoopbackAddress(), port);
+ sock = new Socket(loopback, port);
os = sock.getOutputStream();
os.write(s2.getBytes(StandardCharsets.ISO_8859_1));
Thread.sleep(500);
From 9115f920d2405d889f5a1176d3488aa77a0322d4 Mon Sep 17 00:00:00 2001
From: Lance Andersen
Date: Tue, 11 Jun 2019 13:04:36 -0400
Subject: [PATCH 029/109] 8225189: Multiple JNI calls within critical region in
ZIP Library
Reviewed-by: alanb
---
src/java.base/share/native/libzip/Deflater.c | 77 ++++++++++++--------
src/java.base/share/native/libzip/Inflater.c | 61 ++++++++++------
2 files changed, 85 insertions(+), 53 deletions(-)
diff --git a/src/java.base/share/native/libzip/Deflater.c b/src/java.base/share/native/libzip/Deflater.c
index bf204f1d68e..2a5791ec62d 100644
--- a/src/java.base/share/native/libzip/Deflater.c
+++ b/src/java.base/share/native/libzip/Deflater.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2019, 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
@@ -76,9 +76,8 @@ Java_java_util_zip_Deflater_init(JNIEnv *env, jclass cls, jint level,
}
}
-static void doSetDictionary(JNIEnv *env, jlong addr, jbyte *buf, jint len)
+static void checkSetDictionaryResult(JNIEnv *env, jlong addr, jint res)
{
- int res = deflateSetDictionary(jlong_to_ptr(addr), (Bytef *) buf, len);
switch (res) {
case Z_OK:
break;
@@ -95,30 +94,33 @@ JNIEXPORT void JNICALL
Java_java_util_zip_Deflater_setDictionary(JNIEnv *env, jclass cls, jlong addr,
jbyteArray b, jint off, jint len)
{
- jbyte *buf = (*env)->GetPrimitiveArrayCritical(env, b, 0);
+ int res;
+ Bytef *buf = (*env)->GetPrimitiveArrayCritical(env, b, 0);
if (buf == NULL) /* out of memory */
return;
- doSetDictionary(env, addr, buf + off, len);
+ res = deflateSetDictionary(jlong_to_ptr(addr), buf, len);
(*env)->ReleasePrimitiveArrayCritical(env, b, buf, 0);
+ checkSetDictionaryResult(env, addr, res);
}
JNIEXPORT void JNICALL
Java_java_util_zip_Deflater_setDictionaryBuffer(JNIEnv *env, jclass cls, jlong addr,
jlong bufferAddr, jint len)
{
- jbyte *buf = jlong_to_ptr(bufferAddr);
- doSetDictionary(env, addr, buf, len);
+ int res;
+ Bytef *buf = jlong_to_ptr(bufferAddr);
+ res = deflateSetDictionary(jlong_to_ptr(addr), buf, len);
+ checkSetDictionaryResult(env, addr, res);
}
-static jlong doDeflate(JNIEnv *env, jobject this, jlong addr,
+static jint doDeflate(JNIEnv *env, jlong addr,
jbyte *input, jint inputLen,
jbyte *output, jint outputLen,
jint flush, jint params)
{
z_stream *strm = jlong_to_ptr(addr);
- jint inputUsed = 0, outputUsed = 0;
- int finished = 0;
int setParams = params & 1;
+ int res;
strm->next_in = (Bytef *) input;
strm->next_out = (Bytef *) output;
@@ -128,7 +130,24 @@ static jlong doDeflate(JNIEnv *env, jobject this, jlong addr,
if (setParams) {
int strategy = (params >> 1) & 3;
int level = params >> 3;
- int res = deflateParams(strm, level, strategy);
+ res = deflateParams(strm, level, strategy);
+ } else {
+ res = deflate(strm, flush);
+ }
+ return res;
+}
+
+static jlong checkDeflateStatus(JNIEnv *env, jlong addr,
+ jint inputLen,
+ jint outputLen,
+ jint params, int res)
+{
+ z_stream *strm = jlong_to_ptr(addr);
+ jint inputUsed = 0, outputUsed = 0;
+ int finished = 0;
+ int setParams = params & 1;
+
+ if (setParams) {
switch (res) {
case Z_OK:
setParams = 0;
@@ -142,7 +161,6 @@ static jlong doDeflate(JNIEnv *env, jobject this, jlong addr,
return 0;
}
} else {
- int res = deflate(strm, flush);
switch (res) {
case Z_STREAM_END:
finished = 1;
@@ -169,6 +187,8 @@ Java_java_util_zip_Deflater_deflateBytesBytes(JNIEnv *env, jobject this, jlong a
jbyte *input = (*env)->GetPrimitiveArrayCritical(env, inputArray, 0);
jbyte *output;
jlong retVal;
+ jint res;
+
if (input == NULL) {
if (inputLen != 0 && (*env)->ExceptionOccurred(env) == NULL)
JNU_ThrowOutOfMemoryError(env, 0);
@@ -182,14 +202,13 @@ Java_java_util_zip_Deflater_deflateBytesBytes(JNIEnv *env, jobject this, jlong a
return 0L;
}
- retVal = doDeflate(env, this, addr,
- input + inputOff, inputLen,
- output + outputOff, outputLen,
- flush, params);
+ res = doDeflate(env, addr, input + inputOff, inputLen,output + outputOff,
+ outputLen, flush, params);
(*env)->ReleasePrimitiveArrayCritical(env, outputArray, output, 0);
(*env)->ReleasePrimitiveArrayCritical(env, inputArray, input, 0);
+ retVal = checkDeflateStatus(env, addr, inputLen, outputLen, params, res);
return retVal;
}
@@ -203,6 +222,7 @@ Java_java_util_zip_Deflater_deflateBytesBuffer(JNIEnv *env, jobject this, jlong
jbyte *input = (*env)->GetPrimitiveArrayCritical(env, inputArray, 0);
jbyte *output;
jlong retVal;
+ jint res;
if (input == NULL) {
if (inputLen != 0 && (*env)->ExceptionOccurred(env) == NULL)
JNU_ThrowOutOfMemoryError(env, 0);
@@ -210,13 +230,12 @@ Java_java_util_zip_Deflater_deflateBytesBuffer(JNIEnv *env, jobject this, jlong
}
output = jlong_to_ptr(outputBuffer);
- retVal = doDeflate(env, this, addr,
- input + inputOff, inputLen,
- output, outputLen,
- flush, params);
+ res = doDeflate(env, addr, input + inputOff, inputLen, output, outputLen,
+ flush, params);
(*env)->ReleasePrimitiveArrayCritical(env, inputArray, input, 0);
+ retVal = checkDeflateStatus(env, addr, inputLen, outputLen, params, res);
return retVal;
}
@@ -229,19 +248,18 @@ Java_java_util_zip_Deflater_deflateBufferBytes(JNIEnv *env, jobject this, jlong
jbyte *input = jlong_to_ptr(inputBuffer);
jbyte *output = (*env)->GetPrimitiveArrayCritical(env, outputArray, 0);
jlong retVal;
+ jint res;
if (output == NULL) {
if (outputLen != 0 && (*env)->ExceptionOccurred(env) == NULL)
JNU_ThrowOutOfMemoryError(env, 0);
return 0L;
}
- retVal = doDeflate(env, this, addr,
- input, inputLen,
- output + outputOff, outputLen,
- flush, params);
-
+ res = doDeflate(env, addr, input, inputLen, output + outputOff, outputLen,
+ flush, params);
(*env)->ReleasePrimitiveArrayCritical(env, outputArray, input, 0);
+ retVal = checkDeflateStatus(env, addr, inputLen, outputLen, params, res);
return retVal;
}
@@ -253,11 +271,12 @@ Java_java_util_zip_Deflater_deflateBufferBuffer(JNIEnv *env, jobject this, jlong
{
jbyte *input = jlong_to_ptr(inputBuffer);
jbyte *output = jlong_to_ptr(outputBuffer);
+ jlong retVal;
+ jint res;
- return doDeflate(env, this, addr,
- input, inputLen,
- output, outputLen,
- flush, params);
+ res = doDeflate(env, addr, input, inputLen, output, outputLen, flush, params);
+ retVal = checkDeflateStatus(env, addr, inputLen, outputLen, params, res);
+ return retVal;
}
JNIEXPORT jint JNICALL
diff --git a/src/java.base/share/native/libzip/Inflater.c b/src/java.base/share/native/libzip/Inflater.c
index 1b1040bd7fb..a41e9775bfa 100644
--- a/src/java.base/share/native/libzip/Inflater.c
+++ b/src/java.base/share/native/libzip/Inflater.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2019, 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
@@ -87,9 +87,8 @@ Java_java_util_zip_Inflater_init(JNIEnv *env, jclass cls, jboolean nowrap)
}
}
-static void doSetDictionary(JNIEnv *env, jlong addr, jbyte *buf, jint len)
+static void checkSetDictionaryResult(JNIEnv *env, jlong addr, int res)
{
- int res = inflateSetDictionary(jlong_to_ptr(addr), (Bytef *) buf, len);
switch (res) {
case Z_OK:
break;
@@ -107,30 +106,31 @@ JNIEXPORT void JNICALL
Java_java_util_zip_Inflater_setDictionary(JNIEnv *env, jclass cls, jlong addr,
jbyteArray b, jint off, jint len)
{
- jbyte *buf = (*env)->GetPrimitiveArrayCritical(env, b, 0);
+ jint res;
+ Bytef *buf = (*env)->GetPrimitiveArrayCritical(env, b, 0);
if (buf == NULL) /* out of memory */
return;
- doSetDictionary(env, addr, buf + off, len);
+ res = inflateSetDictionary(jlong_to_ptr(addr), buf + off, len);
(*env)->ReleasePrimitiveArrayCritical(env, b, buf, 0);
+ checkSetDictionaryResult(env, addr, res);
}
JNIEXPORT void JNICALL
Java_java_util_zip_Inflater_setDictionaryBuffer(JNIEnv *env, jclass cls, jlong addr,
jlong bufferAddr, jint len)
{
- jbyte *buf = jlong_to_ptr(bufferAddr);
- doSetDictionary(env, addr, buf, len);
+ jint res;
+ Bytef *buf = jlong_to_ptr(bufferAddr);
+ res = inflateSetDictionary(jlong_to_ptr(addr), buf, len);
+ checkSetDictionaryResult(env, addr, res);
}
-static jlong doInflate(JNIEnv *env, jobject this, jlong addr,
+static jint doInflate(jlong addr,
jbyte *input, jint inputLen,
jbyte *output, jint outputLen)
{
+ jint ret;
z_stream *strm = jlong_to_ptr(addr);
- jint inputUsed = 0, outputUsed = 0;
- int finished = 0;
- int needDict = 0;
- int ret;
strm->next_in = (Bytef *) input;
strm->next_out = (Bytef *) output;
@@ -138,6 +138,16 @@ static jlong doInflate(JNIEnv *env, jobject this, jlong addr,
strm->avail_out = outputLen;
ret = inflate(strm, Z_PARTIAL_FLUSH);
+ return ret;
+}
+
+static jlong checkInflateStatus(JNIEnv *env, jobject this, jlong addr,
+ jint inputLen, jint outputLen, jint ret )
+{
+ z_stream *strm = jlong_to_ptr(addr);
+ jint inputUsed = 0, outputUsed = 0;
+ int finished = 0;
+ int needDict = 0;
switch (ret) {
case Z_STREAM_END:
@@ -180,6 +190,7 @@ Java_java_util_zip_Inflater_inflateBytesBytes(JNIEnv *env, jobject this, jlong a
{
jbyte *input = (*env)->GetPrimitiveArrayCritical(env, inputArray, 0);
jbyte *output;
+ jint ret;
jlong retVal;
if (input == NULL) {
@@ -195,13 +206,13 @@ Java_java_util_zip_Inflater_inflateBytesBytes(JNIEnv *env, jobject this, jlong a
return 0L;
}
- retVal = doInflate(env, this, addr,
- input + inputOff, inputLen,
- output + outputOff, outputLen);
+ ret = doInflate(addr, input + inputOff, inputLen, output + outputOff,
+ outputLen);
(*env)->ReleasePrimitiveArrayCritical(env, outputArray, output, 0);
(*env)->ReleasePrimitiveArrayCritical(env, inputArray, input, 0);
+ retVal = checkInflateStatus(env, this, addr, inputLen, outputLen, ret );
return retVal;
}
@@ -212,6 +223,7 @@ Java_java_util_zip_Inflater_inflateBytesBuffer(JNIEnv *env, jobject this, jlong
{
jbyte *input = (*env)->GetPrimitiveArrayCritical(env, inputArray, 0);
jbyte *output;
+ jint ret;
jlong retVal;
if (input == NULL) {
@@ -221,11 +233,10 @@ Java_java_util_zip_Inflater_inflateBytesBuffer(JNIEnv *env, jobject this, jlong
}
output = jlong_to_ptr(outputBuffer);
- retVal = doInflate(env, this, addr,
- input + inputOff, inputLen,
- output, outputLen);
+ ret = doInflate(addr, input + inputOff, inputLen, output, outputLen);
(*env)->ReleasePrimitiveArrayCritical(env, inputArray, input, 0);
+ retVal = checkInflateStatus(env, this, addr, inputLen, outputLen, ret );
return retVal;
}
@@ -237,6 +248,7 @@ Java_java_util_zip_Inflater_inflateBufferBytes(JNIEnv *env, jobject this, jlong
{
jbyte *input = jlong_to_ptr(inputBuffer);
jbyte *output = (*env)->GetPrimitiveArrayCritical(env, outputArray, 0);
+ jint ret;
jlong retVal;
if (output == NULL) {
@@ -245,11 +257,10 @@ Java_java_util_zip_Inflater_inflateBufferBytes(JNIEnv *env, jobject this, jlong
return 0L;
}
- retVal = doInflate(env, this, addr,
- input, inputLen,
- output + outputOff, outputLen);
+ ret = doInflate(addr, input, inputLen, output + outputOff, outputLen);
(*env)->ReleasePrimitiveArrayCritical(env, outputArray, output, 0);
+ retVal = checkInflateStatus(env, this, addr, inputLen, outputLen, ret );
return retVal;
}
@@ -261,10 +272,12 @@ Java_java_util_zip_Inflater_inflateBufferBuffer(JNIEnv *env, jobject this, jlong
{
jbyte *input = jlong_to_ptr(inputBuffer);
jbyte *output = jlong_to_ptr(outputBuffer);
+ jint ret;
+ jlong retVal;
- return doInflate(env, this, addr,
- input, inputLen,
- output, outputLen);
+ ret = doInflate(addr, input, inputLen, output, outputLen);
+ retVal = checkInflateStatus(env, this, addr, inputLen, outputLen, ret);
+ return retVal;
}
JNIEXPORT jint JNICALL
From 09efbc41eee291e46fd0e99c1f365c32a10e1eda Mon Sep 17 00:00:00 2001
From: Sergey Bylokhov
Date: Tue, 11 Jun 2019 10:15:30 -0700
Subject: [PATCH 030/109] 8225144: [macos] In Aqua L&F backspace key does not
delete when Shift is pressed
Reviewed-by: psadhukhan
---
.../com/apple/laf/AquaKeyBindings.java | 3 +-
.../JTextComponent/6361367/bug6361367.java | 132 ++++++++++++++++++
2 files changed, 134 insertions(+), 1 deletion(-)
create mode 100644 test/jdk/javax/swing/text/JTextComponent/6361367/bug6361367.java
diff --git a/src/java.desktop/macosx/classes/com/apple/laf/AquaKeyBindings.java b/src/java.desktop/macosx/classes/com/apple/laf/AquaKeyBindings.java
index cb32bfc7978..e8e84f4a7d8 100644
--- a/src/java.desktop/macosx/classes/com/apple/laf/AquaKeyBindings.java
+++ b/src/java.desktop/macosx/classes/com/apple/laf/AquaKeyBindings.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019, 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
@@ -67,6 +67,7 @@ public class AquaKeyBindings {
"DELETE", DefaultEditorKit.deleteNextCharAction,
"alt DELETE", "delete-next-word",
"BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
+ "shift BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
"alt BACK_SPACE", "delete-previous-word",
"LEFT", DefaultEditorKit.backwardAction,
diff --git a/test/jdk/javax/swing/text/JTextComponent/6361367/bug6361367.java b/test/jdk/javax/swing/text/JTextComponent/6361367/bug6361367.java
new file mode 100644
index 00000000000..153e6c7d655
--- /dev/null
+++ b/test/jdk/javax/swing/text/JTextComponent/6361367/bug6361367.java
@@ -0,0 +1,132 @@
+/*
+ * Copyright (c) 2006, 2019, 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 6361367 7109126 8225144
+ @key headful
+ @summary Tests that backspace key does delete when Shift is pressed
+*/
+
+import java.awt.Robot;
+import java.awt.event.KeyEvent;
+import java.util.Arrays;
+import java.util.List;
+import java.util.concurrent.Callable;
+import java.util.concurrent.FutureTask;
+import java.util.concurrent.atomic.AtomicReference;
+
+import javax.swing.JComponent;
+import javax.swing.JEditorPane;
+import javax.swing.JFormattedTextField;
+import javax.swing.JFrame;
+import javax.swing.JPasswordField;
+import javax.swing.JTextArea;
+import javax.swing.JTextField;
+import javax.swing.JTextPane;
+import javax.swing.SwingUtilities;
+import javax.swing.UIManager;
+import javax.swing.text.Caret;
+import javax.swing.text.JTextComponent;
+
+public class bug6361367 {
+ final static String testString = "123 456 789";
+ final static String resultString = "123 456 78";
+ final static List> textClasses = Arrays.asList(
+ JTextArea.class, JEditorPane.class, JTextPane.class,
+ JTextField.class, JFormattedTextField.class, JPasswordField.class);
+
+ public static void main(String[] args) throws Exception {
+ for(UIManager.LookAndFeelInfo info: UIManager.getInstalledLookAndFeels()) {
+ UIManager.setLookAndFeel(info.getClassName());
+ System.out.println(info);
+ for (Class extends JTextComponent> clazz : textClasses) {
+ boolean res = test(clazz);
+ if (! res) {
+ throw new RuntimeException("failed");
+ }
+ }
+ }
+ }
+
+ static boolean test(final Class extends JTextComponent> textComponentClass) throws Exception {
+ final AtomicReference ref = new AtomicReference<>();
+ final JTextComponent textComponent = invokeAndWait(
+ new Callable() {
+ public JTextComponent call() throws Exception {
+ return initialize(textComponentClass, ref);
+ }
+ });
+ waitForFocus(textComponent);
+ Robot robot = new Robot();
+ robot.setAutoWaitForIdle(true);
+ robot.setAutoDelay(250);
+ robot.keyPress(KeyEvent.VK_END);
+ robot.keyRelease(KeyEvent.VK_END);
+ robot.keyPress(KeyEvent.VK_SHIFT);
+ robot.keyPress(KeyEvent.VK_BACK_SPACE);
+ robot.keyRelease(KeyEvent.VK_BACK_SPACE);
+ robot.keyRelease(KeyEvent.VK_SHIFT);
+ String str = invokeAndWait(
+ new Callable() {
+ public String call() throws Exception {
+ JFrame frame = ref.get();
+ if (frame != null) {
+ frame.dispose();
+ }
+ return textComponent.getText();
+ }
+ });
+ return resultString.equals(str);
+ }
+
+ static JTextComponent initialize(
+ Class extends JTextComponent> textComponentClass,
+ AtomicReference ref) throws Exception {
+ JFrame frame = new JFrame("bug6361367");
+ ref.set(frame);
+ JTextComponent textComponent = textComponentClass.newInstance();
+ textComponent.setText(testString);
+ frame.add(textComponent);
+ frame.pack();
+ frame.setLocationRelativeTo(null);
+ frame.setVisible(true);
+ textComponent.requestFocus();
+ Caret caret = textComponent.getCaret();
+ caret.setDot(textComponent.getDocument().getLength());
+ return textComponent;
+ }
+
+ static T invokeAndWait(Callable callable) throws Exception {
+ FutureTask future = new FutureTask(callable);
+ SwingUtilities.invokeLater(future);
+ return future.get();
+ }
+
+ static void waitForFocus(JComponent component) throws Exception {
+ synchronized (component) {
+ while(! component.isFocusOwner()) {
+ component.wait(100);
+ }
+ }
+ }
+}
From f9d8df72532891b2f74ff62b6ddeff6132450930 Mon Sep 17 00:00:00 2001
From: Phil Race
Date: Tue, 11 Jun 2019 10:34:42 -0700
Subject: [PATCH 031/109] 8217731: Font rendering and glyph spacing changed
from jdk-8 to jdk-11
Reviewed-by: serb, neugens
---
.../native/libfontmanager/freetypeScaler.c | 53 ++++++++++++++++++-
1 file changed, 52 insertions(+), 1 deletion(-)
diff --git a/src/java.desktop/share/native/libfontmanager/freetypeScaler.c b/src/java.desktop/share/native/libfontmanager/freetypeScaler.c
index 25427a66644..42fd9e0b8d3 100644
--- a/src/java.desktop/share/native/libfontmanager/freetypeScaler.c
+++ b/src/java.desktop/share/native/libfontmanager/freetypeScaler.c
@@ -29,7 +29,10 @@
#include "sunfontids.h"
#include "sun_font_FreetypeFontScaler.h"
-#include
+#include
+#if !defined(_WIN32) && !defined(__APPLE_)
+#include
+#endif
#include
#include "ft2build.h"
#include FT_FREETYPE_H
@@ -39,6 +42,7 @@
#include FT_OUTLINE_H
#include FT_SYNTHESIS_H
#include FT_LCD_FILTER_H
+#include FT_MODULE_H
#include "fontscaler.h"
@@ -204,6 +208,52 @@ static unsigned long ReadTTFontFileFunc(FT_Stream stream,
}
}
+typedef FT_Error (*FT_Prop_Set_Func)(FT_Library library,
+ const FT_String* module_name,
+ const FT_String* property_name,
+ const void* value );
+
+/**
+ * Prefer the older v35 freetype byte code interpreter.
+ */
+static void setInterpreterVersion(FT_Library library) {
+
+ char* props = getenv("FREETYPE_PROPERTIES");
+ int version = 35;
+ const char* module = "truetype";
+ const char* property = "interpreter-version";
+
+ /* If some one is setting this, don't override it */
+ if (props != NULL && strstr(property, props)) {
+ return;
+ }
+ /*
+ * FT_Property_Set was introduced in 2.4.11.
+ * Some older supported Linux OSes may not include it so look
+ * this up dynamically.
+ * And if its not available it doesn't matter, since the reason
+ * we need it dates from 2.7.
+ * On Windows & Mac the library is always bundled so it is safe
+ * to use directly in those cases.
+ */
+#if defined(_WIN32) || defined(__APPLE__)
+ FT_Property_Set(library, module, property, (void*)(&version));
+#else
+ void *lib = dlopen("libfreetype.so", RTLD_LOCAL|RTLD_LAZY);
+ if (lib == NULL) {
+ lib = dlopen("libfreetype.so.6", RTLD_LOCAL|RTLD_LAZY);
+ if (lib == NULL) {
+ return;
+ }
+ }
+ FT_Prop_Set_Func func = (FT_Prop_Set_Func)dlsym(lib, "FT_Property_Set");
+ if (func != NULL) {
+ func(library, module, property, (void*)(&version));
+ }
+ dlclose(lib);
+#endif
+}
+
/*
* Class: sun_font_FreetypeFontScaler
* Method: initNativeScaler
@@ -243,6 +293,7 @@ Java_sun_font_FreetypeFontScaler_initNativeScaler(
free(scalerInfo);
return 0;
}
+ setInterpreterVersion(scalerInfo->library);
#define TYPE1_FROM_JAVA 2
From 8813b93095b5ca339f5ee54732af00a0135426aa Mon Sep 17 00:00:00 2001
From: Valerie Peng
Date: Tue, 11 Jun 2019 21:30:28 +0000
Subject: [PATCH 032/109] 8080462: Update SunPKCS11 provider with PKCS11 v2.40
support
Added support for GCM, PSS, and other mechanisms
Reviewed-by: jnimeh
---
.../sun/security/util/GCMParameters.java | 153 ++
.../sun/security/pkcs11/P11AEADCipher.java | 750 +++++++
.../sun/security/pkcs11/P11PSSSignature.java | 701 ++++++
.../sun/security/pkcs11/P11RSACipher.java | 9 +-
.../sun/security/pkcs11/SunPKCS11.java | 85 +-
.../pkcs11/wrapper/CK_CCM_PARAMS.java | 83 +
.../pkcs11/wrapper/CK_GCM_PARAMS.java | 75 +
.../security/pkcs11/wrapper/CK_MECHANISM.java | 55 +-
.../wrapper/CK_RSA_PKCS_PSS_PARAMS.java | 141 +-
.../security/pkcs11/wrapper/Functions.java | 289 ++-
.../sun/security/pkcs11/wrapper/PKCS11.java | 118 +-
.../pkcs11/wrapper/PKCS11Constants.java | 786 ++++---
.../pkcs11/wrapper/PKCS11Exception.java | 16 +
.../share/legal/pkcs11cryptotoken.md | 42 +-
.../share/native/libj2pkcs11/p11_convert.c | 1324 +++++------
.../share/native/libj2pkcs11/p11_crypt.c | 172 +-
.../share/native/libj2pkcs11/p11_digest.c | 53 +-
.../share/native/libj2pkcs11/p11_general.c | 26 +-
.../share/native/libj2pkcs11/p11_keymgmt.c | 223 +-
.../share/native/libj2pkcs11/p11_mutex.c | 4 +-
.../share/native/libj2pkcs11/p11_sign.c | 221 +-
.../share/native/libj2pkcs11/p11_util.c | 149 +-
.../share/native/libj2pkcs11/pkcs-11v2-20a3.h | 124 --
.../share/native/libj2pkcs11/pkcs11.h | 82 +-
.../share/native/libj2pkcs11/pkcs11f.h | 215 +-
.../share/native/libj2pkcs11/pkcs11t.h | 1960 ++++++++++-------
.../share/native/libj2pkcs11/pkcs11wrapper.h | 75 +-
.../security/pkcs11/Cipher/Test4512704.java | 76 +
.../pkcs11/Cipher/TestCICOWithGCM.java | 109 +
.../pkcs11/Cipher/TestCICOWithGCMAndAAD.java | 122 +
.../pkcs11/Cipher/TestGCMKeyAndIvCheck.java | 197 ++
.../security/pkcs11/Cipher/TestKATForGCM.java | 322 +++
.../pkcs11/MessageDigest/ByteBuffers.java | 55 +-
.../pkcs11/Signature/InitAgainPSS.java | 87 +
.../Signature/KeyAndParamCheckForPSS.java | 132 ++
.../pkcs11/Signature/SigInteropPSS.java | 121 +
.../pkcs11/Signature/SignatureTestPSS.java | 147 ++
.../security/pkcs11/Signature/TestDSA2.java | 93 +
38 files changed, 6567 insertions(+), 2825 deletions(-)
create mode 100644 src/java.base/share/classes/sun/security/util/GCMParameters.java
create mode 100644 src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11AEADCipher.java
create mode 100644 src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11PSSSignature.java
create mode 100644 src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/CK_CCM_PARAMS.java
create mode 100644 src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/CK_GCM_PARAMS.java
delete mode 100644 src/jdk.crypto.cryptoki/share/native/libj2pkcs11/pkcs-11v2-20a3.h
create mode 100644 test/jdk/sun/security/pkcs11/Cipher/Test4512704.java
create mode 100644 test/jdk/sun/security/pkcs11/Cipher/TestCICOWithGCM.java
create mode 100644 test/jdk/sun/security/pkcs11/Cipher/TestCICOWithGCMAndAAD.java
create mode 100644 test/jdk/sun/security/pkcs11/Cipher/TestGCMKeyAndIvCheck.java
create mode 100644 test/jdk/sun/security/pkcs11/Cipher/TestKATForGCM.java
create mode 100644 test/jdk/sun/security/pkcs11/Signature/InitAgainPSS.java
create mode 100644 test/jdk/sun/security/pkcs11/Signature/KeyAndParamCheckForPSS.java
create mode 100644 test/jdk/sun/security/pkcs11/Signature/SigInteropPSS.java
create mode 100644 test/jdk/sun/security/pkcs11/Signature/SignatureTestPSS.java
create mode 100644 test/jdk/sun/security/pkcs11/Signature/TestDSA2.java
diff --git a/src/java.base/share/classes/sun/security/util/GCMParameters.java b/src/java.base/share/classes/sun/security/util/GCMParameters.java
new file mode 100644
index 00000000000..02390777a03
--- /dev/null
+++ b/src/java.base/share/classes/sun/security/util/GCMParameters.java
@@ -0,0 +1,153 @@
+/*
+ * Copyright (c) 2019, 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.
+ */
+
+package sun.security.util;
+
+import java.io.IOException;
+import java.security.AlgorithmParametersSpi;
+import java.security.spec.AlgorithmParameterSpec;
+import java.security.spec.InvalidParameterSpecException;
+import javax.crypto.spec.GCMParameterSpec;
+import sun.security.util.HexDumpEncoder;
+import sun.security.util.*;
+
+/**
+ * This class implements the parameter set used with
+ * GCM encryption, which is defined in RFC 5084 as follows:
+ *
+ *
+ * GCMParameters ::= SEQUENCE {
+ * aes-iv OCTET STRING, -- recommended size is 12 octets
+ * aes-tLen AES-GCM-ICVlen DEFAULT 12 }
+ *
+ * AES-GCM-ICVlen ::= INTEGER (12 | 13 | 14 | 15 | 16)
+ *
+ *
+ *
+ * @since 13
+ */
+public final class GCMParameters extends AlgorithmParametersSpi {
+
+ // the iv
+ private byte[] iv;
+ // the tag length in bytes
+ private int tLen;
+
+ public GCMParameters() {}
+
+ protected void engineInit(AlgorithmParameterSpec paramSpec)
+ throws InvalidParameterSpecException {
+
+ if (!(paramSpec instanceof GCMParameterSpec)) {
+ throw new InvalidParameterSpecException
+ ("Inappropriate parameter specification");
+ }
+ GCMParameterSpec gps = (GCMParameterSpec) paramSpec;
+ // need to convert from bits to bytes for ASN.1 encoding
+ this.tLen = gps.getTLen()/8;
+ if (this.tLen < 12 || this.tLen > 16 ) {
+ throw new InvalidParameterSpecException
+ ("GCM parameter parsing error: unsupported tag len: " +
+ this.tLen);
+ }
+ this.iv = gps.getIV();
+ }
+
+ protected void engineInit(byte[] encoded) throws IOException {
+ DerValue val = new DerValue(encoded);
+ // check if IV or params
+ if (val.tag == DerValue.tag_Sequence) {
+ byte[] iv = val.data.getOctetString();
+ int tLen;
+ if (val.data.available() != 0) {
+ tLen = val.data.getInteger();
+ if (tLen < 12 || tLen > 16 ) {
+ throw new IOException
+ ("GCM parameter parsing error: unsupported tag len: " +
+ tLen);
+ }
+ if (val.data.available() != 0) {
+ throw new IOException
+ ("GCM parameter parsing error: extra data");
+ }
+ } else {
+ tLen = 12;
+ }
+ this.iv = iv.clone();
+ this.tLen = tLen;
+ } else {
+ throw new IOException("GCM parameter parsing error: no SEQ tag");
+ }
+ }
+
+ protected void engineInit(byte[] encoded, String decodingMethod)
+ throws IOException {
+ engineInit(encoded);
+ }
+
+ protected
+ T engineGetParameterSpec(Class paramSpec)
+ throws InvalidParameterSpecException {
+
+ if (GCMParameterSpec.class.isAssignableFrom(paramSpec)) {
+ return paramSpec.cast(new GCMParameterSpec(tLen * 8, iv));
+ } else {
+ throw new InvalidParameterSpecException
+ ("Inappropriate parameter specification");
+ }
+ }
+
+ protected byte[] engineGetEncoded() throws IOException {
+ DerOutputStream out = new DerOutputStream();
+ DerOutputStream bytes = new DerOutputStream();
+
+ bytes.putOctetString(iv);
+ // Only put non-default values
+ if (tLen != 12) {
+ bytes.putInteger(tLen);
+ }
+ out.write(DerValue.tag_Sequence, bytes);
+ return out.toByteArray();
+ }
+
+ protected byte[] engineGetEncoded(String encodingMethod)
+ throws IOException {
+ return engineGetEncoded();
+ }
+
+ /*
+ * Returns a formatted string describing the parameters.
+ */
+ protected String engineToString() {
+ String LINE_SEP = System.lineSeparator();
+ HexDumpEncoder encoder = new HexDumpEncoder();
+ StringBuilder sb
+ = new StringBuilder(LINE_SEP + " iv:" + LINE_SEP + "["
+ + encoder.encodeBuffer(iv) + "]");
+
+ sb.append(LINE_SEP + "tLen(bits):" + LINE_SEP + tLen*8 + LINE_SEP);
+ return sb.toString();
+ }
+}
diff --git a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11AEADCipher.java b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11AEADCipher.java
new file mode 100644
index 00000000000..97a836cf36c
--- /dev/null
+++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11AEADCipher.java
@@ -0,0 +1,750 @@
+/* Copyright (c) 2019, 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.
+ */
+package sun.security.pkcs11;
+
+import java.io.ByteArrayOutputStream;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import java.util.Locale;
+
+import java.security.*;
+import java.security.spec.*;
+
+import javax.crypto.*;
+import javax.crypto.spec.*;
+
+import sun.nio.ch.DirectBuffer;
+import sun.security.jca.JCAUtil;
+import sun.security.pkcs11.wrapper.*;
+import static sun.security.pkcs11.wrapper.PKCS11Constants.*;
+
+/**
+ * P11 AEAD Cipher implementation class. This class currently supports
+ * AES with GCM mode.
+ *
+ * Note that AEAD modes do not use padding, so this class does not have
+ * its own padding impl. In addition, NSS CKM_AES_GCM only supports single-part
+ * encryption/decryption, thus the current impl uses PKCS#11 C_Encrypt/C_Decrypt
+ * calls and buffers data until doFinal is called.
+ *
+ * Note that PKCS#11 standard currently only supports GCM and CCM AEAD modes.
+ * There are no provisions for other AEAD modes yet.
+ *
+ * @since 13
+ */
+final class P11AEADCipher extends CipherSpi {
+
+ // mode constant for GCM mode
+ private static final int MODE_GCM = 10;
+
+ // default constants for GCM
+ private static final int GCM_DEFAULT_TAG_LEN = 16;
+ private static final int GCM_DEFAULT_IV_LEN = 16;
+
+ private static final String ALGO = "AES";
+
+ // token instance
+ private final Token token;
+
+ // mechanism id
+ private final long mechanism;
+
+ // mode, one of MODE_* above
+ private final int blockMode;
+
+ // acceptable key size, -1 if more than 1 key sizes are accepted
+ private final int fixedKeySize;
+
+ // associated session, if any
+ private Session session = null;
+
+ // key, if init() was called
+ private P11Key p11Key = null;
+
+ // flag indicating whether an operation is initialized
+ private boolean initialized = false;
+
+ // falg indicating encrypt or decrypt mode
+ private boolean encrypt = true;
+
+ // parameters
+ private byte[] iv = null;
+ private int tagLen = -1;
+ private SecureRandom random = JCAUtil.getSecureRandom();
+
+ // dataBuffer is cleared upon doFinal calls
+ private ByteArrayOutputStream dataBuffer = new ByteArrayOutputStream();
+ // aadBuffer is cleared upon successful init calls
+ private ByteArrayOutputStream aadBuffer = new ByteArrayOutputStream();
+ private boolean updateCalled = false;
+
+ private boolean requireReinit = false;
+ private P11Key lastEncKey = null;
+ private byte[] lastEncIv = null;
+
+ P11AEADCipher(Token token, String algorithm, long mechanism)
+ throws PKCS11Exception, NoSuchAlgorithmException {
+ super();
+ this.token = token;
+ this.mechanism = mechanism;
+
+ String[] algoParts = algorithm.split("/");
+ if (algoParts.length != 3) {
+ throw new ProviderException("Unsupported Transformation format: " +
+ algorithm);
+ }
+ if (!algoParts[0].startsWith("AES")) {
+ throw new ProviderException("Only support AES for AEAD cipher mode");
+ }
+ int index = algoParts[0].indexOf('_');
+ if (index != -1) {
+ // should be well-formed since we specify what we support
+ fixedKeySize = Integer.parseInt(algoParts[0].substring(index+1)) >> 3;
+ } else {
+ fixedKeySize = -1;
+ }
+ this.blockMode = parseMode(algoParts[1]);
+ if (!algoParts[2].equals("NoPadding")) {
+ throw new ProviderException("Only NoPadding is supported for AEAD cipher mode");
+ }
+ }
+
+ protected void engineSetMode(String mode) throws NoSuchAlgorithmException {
+ // Disallow change of mode for now since currently it's explicitly
+ // defined in transformation strings
+ throw new NoSuchAlgorithmException("Unsupported mode " + mode);
+ }
+
+ private int parseMode(String mode) throws NoSuchAlgorithmException {
+ mode = mode.toUpperCase(Locale.ENGLISH);
+ int result;
+ if (mode.equals("GCM")) {
+ result = MODE_GCM;
+ } else {
+ throw new NoSuchAlgorithmException("Unsupported mode " + mode);
+ }
+ return result;
+ }
+
+ // see JCE spec
+ protected void engineSetPadding(String padding)
+ throws NoSuchPaddingException {
+ // Disallow change of padding for now since currently it's explicitly
+ // defined in transformation strings
+ throw new NoSuchPaddingException("Unsupported padding " + padding);
+ }
+
+ // see JCE spec
+ protected int engineGetBlockSize() {
+ return 16; // constant; only AES is supported
+ }
+
+ // see JCE spec
+ protected int engineGetOutputSize(int inputLen) {
+ return doFinalLength(inputLen);
+ }
+
+ // see JCE spec
+ protected byte[] engineGetIV() {
+ return (iv == null) ? null : iv.clone();
+ }
+
+ // see JCE spec
+ protected AlgorithmParameters engineGetParameters() {
+ if (encrypt && iv == null && tagLen == -1) {
+ switch (blockMode) {
+ case MODE_GCM:
+ iv = new byte[GCM_DEFAULT_IV_LEN];
+ tagLen = GCM_DEFAULT_TAG_LEN;
+ break;
+ default:
+ throw new ProviderException("Unsupported mode");
+ }
+ random.nextBytes(iv);
+ }
+ try {
+ AlgorithmParameterSpec spec;
+ String apAlgo;
+ switch (blockMode) {
+ case MODE_GCM:
+ apAlgo = "GCM";
+ spec = new GCMParameterSpec(tagLen << 3, iv);
+ break;
+ default:
+ throw new ProviderException("Unsupported mode");
+ }
+ AlgorithmParameters params =
+ AlgorithmParameters.getInstance(apAlgo);
+ params.init(spec);
+ return params;
+ } catch (GeneralSecurityException e) {
+ // NoSuchAlgorithmException, NoSuchProviderException
+ // InvalidParameterSpecException
+ throw new ProviderException("Could not encode parameters", e);
+ }
+ }
+
+ // see JCE spec
+ protected void engineInit(int opmode, Key key, SecureRandom sr)
+ throws InvalidKeyException {
+ if (opmode == Cipher.DECRYPT_MODE) {
+ throw new InvalidKeyException("Parameters required for decryption");
+ }
+ updateCalled = false;
+ try {
+ implInit(opmode, key, null, -1, sr);
+ } catch (InvalidAlgorithmParameterException e) {
+ throw new InvalidKeyException("init() failed", e);
+ }
+ }
+
+ // see JCE spec
+ protected void engineInit(int opmode, Key key,
+ AlgorithmParameterSpec params, SecureRandom sr)
+ throws InvalidKeyException, InvalidAlgorithmParameterException {
+ if (opmode == Cipher.DECRYPT_MODE && params == null) {
+ throw new InvalidAlgorithmParameterException
+ ("Parameters required for decryption");
+ }
+ updateCalled = false;
+ byte[] ivValue = null;
+ int tagLen = -1;
+ if (params != null) {
+ switch (blockMode) {
+ case MODE_GCM:
+ if (!(params instanceof GCMParameterSpec)) {
+ throw new InvalidAlgorithmParameterException
+ ("Only GCMParameterSpec is supported");
+ }
+ ivValue = ((GCMParameterSpec) params).getIV();
+ tagLen = ((GCMParameterSpec) params).getTLen() >> 3;
+ break;
+ default:
+ throw new ProviderException("Unsupported mode");
+ }
+ }
+ implInit(opmode, key, ivValue, tagLen, sr);
+ }
+
+ // see JCE spec
+ protected void engineInit(int opmode, Key key, AlgorithmParameters params,
+ SecureRandom sr)
+ throws InvalidKeyException, InvalidAlgorithmParameterException {
+ if (opmode == Cipher.DECRYPT_MODE && params == null) {
+ throw new InvalidAlgorithmParameterException
+ ("Parameters required for decryption");
+ }
+ updateCalled = false;
+ try {
+ AlgorithmParameterSpec paramSpec = null;
+ if (params != null) {
+ switch (blockMode) {
+ case MODE_GCM:
+ paramSpec =
+ params.getParameterSpec(GCMParameterSpec.class);
+ break;
+ default:
+ throw new ProviderException("Unsupported mode");
+ }
+ }
+ engineInit(opmode, key, paramSpec, sr);
+ } catch (InvalidParameterSpecException ex) {
+ throw new InvalidAlgorithmParameterException(ex);
+ }
+ }
+
+ // actual init() implementation
+ private void implInit(int opmode, Key key, byte[] iv, int tagLen,
+ SecureRandom sr)
+ throws InvalidKeyException, InvalidAlgorithmParameterException {
+ reset(true);
+ if (fixedKeySize != -1 && key.getEncoded().length != fixedKeySize) {
+ throw new InvalidKeyException("Key size is invalid");
+ }
+ P11Key newKey = P11SecretKeyFactory.convertKey(token, key, ALGO);
+ switch (opmode) {
+ case Cipher.ENCRYPT_MODE:
+ encrypt = true;
+ requireReinit = Arrays.equals(iv, lastEncIv) &&
+ (newKey == lastEncKey);
+ if (requireReinit) {
+ throw new InvalidAlgorithmParameterException
+ ("Cannot reuse iv for GCM encryption");
+ }
+ break;
+ case Cipher.DECRYPT_MODE:
+ encrypt = false;
+ requireReinit = false;
+ break;
+ default:
+ throw new InvalidAlgorithmParameterException
+ ("Unsupported mode: " + opmode);
+ }
+
+ // decryption without parameters is checked in all engineInit() calls
+ if (sr != null) {
+ this.random = sr;
+ }
+ if (iv == null && tagLen == -1) {
+ // generate default values
+ switch (blockMode) {
+ case MODE_GCM:
+ iv = new byte[GCM_DEFAULT_IV_LEN];
+ this.random.nextBytes(iv);
+ tagLen = GCM_DEFAULT_TAG_LEN;
+ break;
+ default:
+ throw new ProviderException("Unsupported mode");
+ }
+ }
+ this.iv = iv;
+ this.tagLen = tagLen;
+ this.p11Key = newKey;
+ try {
+ initialize();
+ } catch (PKCS11Exception e) {
+ throw new InvalidKeyException("Could not initialize cipher", e);
+ }
+ }
+
+ private void cancelOperation() {
+ try {
+ if (session.hasObjects() == false) {
+ session = token.killSession(session);
+ return;
+ } else {
+ // cancel operation by finishing it
+ int bufLen = doFinalLength(0);
+ byte[] buffer = new byte[bufLen];
+
+ if (encrypt) {
+ token.p11.C_Encrypt(session.id(), 0, buffer, 0, bufLen,
+ 0, buffer, 0, bufLen);
+ } else {
+ token.p11.C_Decrypt(session.id(), 0, buffer, 0, bufLen,
+ 0, buffer, 0, bufLen);
+ }
+ }
+ } catch (PKCS11Exception e) {
+ throw new ProviderException("Cancel failed", e);
+ }
+ }
+
+ private void ensureInitialized() throws PKCS11Exception {
+ if (initialized && aadBuffer.size() > 0) {
+ // need to cancel first to avoid CKR_OPERATION_ACTIVE
+ reset(true);
+ }
+ if (!initialized) {
+ initialize();
+ }
+ }
+
+ private void initialize() throws PKCS11Exception {
+ if (p11Key == null) {
+ throw new ProviderException(
+ "Operation cannot be performed without"
+ + " calling engineInit first");
+ }
+ if (requireReinit) {
+ throw new IllegalStateException
+ ("Must use either different key or iv for GCM encryption");
+ }
+
+ token.ensureValid();
+
+ byte[] aad = (aadBuffer.size() > 0? aadBuffer.toByteArray() : null);
+
+ long p11KeyID = p11Key.getKeyID();
+ try {
+ if (session == null) {
+ session = token.getOpSession();
+ }
+ CK_MECHANISM mechWithParams;
+ switch (blockMode) {
+ case MODE_GCM:
+ mechWithParams = new CK_MECHANISM(mechanism,
+ new CK_GCM_PARAMS(tagLen << 3, iv, aad));
+ break;
+ default:
+ throw new ProviderException("Unsupported mode: " + blockMode);
+ }
+ if (encrypt) {
+ token.p11.C_EncryptInit(session.id(), mechWithParams,
+ p11KeyID);
+ } else {
+ token.p11.C_DecryptInit(session.id(), mechWithParams,
+ p11KeyID);
+ }
+ } catch (PKCS11Exception e) {
+ //e.printStackTrace();
+ p11Key.releaseKeyID();
+ session = token.releaseSession(session);
+ throw e;
+ } finally {
+ dataBuffer.reset();
+ aadBuffer.reset();
+ }
+ initialized = true;
+ }
+
+ // if doFinal(inLen) is called, how big does the output buffer have to be?
+ private int doFinalLength(int inLen) {
+ if (inLen < 0) {
+ throw new ProviderException("Invalid negative input length");
+ }
+
+ int result = inLen + dataBuffer.size();
+ if (encrypt) {
+ result += tagLen;
+ } else {
+ // PKCS11Exception: CKR_BUFFER_TOO_SMALL
+ //result -= tagLen;
+ }
+ return result;
+ }
+
+ // reset the states to the pre-initialized values
+ private void reset(boolean doCancel) {
+ if (!initialized) {
+ return;
+ }
+ try {
+ if (session == null) {
+ return;
+ }
+ if (doCancel && token.explicitCancel) {
+ cancelOperation();
+ }
+ } finally {
+ p11Key.releaseKeyID();
+ session = token.releaseSession(session);
+ }
+ initialized = false;
+ }
+
+ // see JCE spec
+ protected byte[] engineUpdate(byte[] in, int inOfs, int inLen) {
+ updateCalled = true;
+ int n = implUpdate(in, inOfs, inLen);
+ return new byte[0];
+ }
+
+ // see JCE spec
+ protected int engineUpdate(byte[] in, int inOfs, int inLen, byte[] out,
+ int outOfs) throws ShortBufferException {
+ updateCalled = true;
+ implUpdate(in, inOfs, inLen);
+ return 0;
+ }
+
+ // see JCE spec
+ @Override
+ protected int engineUpdate(ByteBuffer inBuffer, ByteBuffer outBuffer)
+ throws ShortBufferException {
+ updateCalled = true;
+ implUpdate(inBuffer);
+ return 0;
+ }
+
+ // see JCE spec
+ @Override
+ protected synchronized void engineUpdateAAD(byte[] src, int srcOfs, int srcLen)
+ throws IllegalStateException {
+ if ((src == null) || (srcOfs < 0) || (srcOfs + srcLen > src.length)) {
+ throw new IllegalArgumentException("Invalid AAD");
+ }
+ if (requireReinit) {
+ throw new IllegalStateException
+ ("Must use either different key or iv for GCM encryption");
+ }
+ if (p11Key == null) {
+ throw new IllegalStateException("Need to initialize Cipher first");
+ }
+ if (updateCalled) {
+ throw new IllegalStateException
+ ("Update has been called; no more AAD data");
+ }
+ aadBuffer.write(src, srcOfs, srcLen);
+ }
+
+ // see JCE spec
+ @Override
+ protected void engineUpdateAAD(ByteBuffer src)
+ throws IllegalStateException {
+ if (src == null) {
+ throw new IllegalArgumentException("Invalid AAD");
+ }
+ byte[] srcBytes = new byte[src.remaining()];
+ src.get(srcBytes);
+ engineUpdateAAD(srcBytes, 0, srcBytes.length);
+ }
+
+ // see JCE spec
+ protected byte[] engineDoFinal(byte[] in, int inOfs, int inLen)
+ throws IllegalBlockSizeException, BadPaddingException {
+ int minOutLen = doFinalLength(inLen);
+ try {
+ byte[] out = new byte[minOutLen];
+ int n = engineDoFinal(in, inOfs, inLen, out, 0);
+ return P11Util.convert(out, 0, n);
+ } catch (ShortBufferException e) {
+ // convert since the output length is calculated by doFinalLength()
+ throw new ProviderException(e);
+ } finally {
+ updateCalled = false;
+ }
+ }
+ // see JCE spec
+ protected int engineDoFinal(byte[] in, int inOfs, int inLen, byte[] out,
+ int outOfs) throws ShortBufferException, IllegalBlockSizeException,
+ BadPaddingException {
+ try {
+ return implDoFinal(in, inOfs, inLen, out, outOfs, out.length - outOfs);
+ } finally {
+ updateCalled = false;
+ }
+ }
+
+ // see JCE spec
+ @Override
+ protected int engineDoFinal(ByteBuffer inBuffer, ByteBuffer outBuffer)
+ throws ShortBufferException, IllegalBlockSizeException,
+ BadPaddingException {
+ try {
+ return implDoFinal(inBuffer, outBuffer);
+ } finally {
+ updateCalled = false;
+ }
+ }
+
+ private int implUpdate(byte[] in, int inOfs, int inLen) {
+ if (inLen > 0) {
+ updateCalled = true;
+ try {
+ ensureInitialized();
+ } catch (PKCS11Exception e) {
+ //e.printStackTrace();
+ reset(false);
+ throw new ProviderException("update() failed", e);
+ }
+ dataBuffer.write(in, inOfs, inLen);
+ }
+ // always 0 as NSS only supports single-part encryption/decryption
+ return 0;
+ }
+
+ private int implUpdate(ByteBuffer inBuf) {
+ int inLen = inBuf.remaining();
+ if (inLen > 0) {
+ try {
+ ensureInitialized();
+ } catch (PKCS11Exception e) {
+ reset(false);
+ throw new ProviderException("update() failed", e);
+ }
+ byte[] data = new byte[inLen];
+ inBuf.get(data);
+ dataBuffer.write(data, 0, data.length);
+ }
+ // always 0 as NSS only supports single-part encryption/decryption
+ return 0;
+ }
+
+ private int implDoFinal(byte[] in, int inOfs, int inLen,
+ byte[] out, int outOfs, int outLen)
+ throws ShortBufferException, IllegalBlockSizeException,
+ BadPaddingException {
+ int requiredOutLen = doFinalLength(inLen);
+ if (outLen < requiredOutLen) {
+ throw new ShortBufferException();
+ }
+ boolean doCancel = true;
+ try {
+ ensureInitialized();
+ if (dataBuffer.size() > 0) {
+ if (in != null && inOfs > 0 && inLen > 0 &&
+ inOfs < (in.length - inLen)) {
+ dataBuffer.write(in, inOfs, inLen);
+ }
+ in = dataBuffer.toByteArray();
+ inOfs = 0;
+ inLen = in.length;
+ }
+ int k = 0;
+ if (encrypt) {
+ k = token.p11.C_Encrypt(session.id(), 0, in, inOfs, inLen,
+ 0, out, outOfs, outLen);
+ doCancel = false;
+ } else {
+ // Special handling to match SunJCE provider behavior
+ if (inLen == 0) {
+ return 0;
+ }
+ k = token.p11.C_Decrypt(session.id(), 0, in, inOfs, inLen,
+ 0, out, outOfs, outLen);
+ doCancel = false;
+ }
+ return k;
+ } catch (PKCS11Exception e) {
+ doCancel = false;
+ handleException(e);
+ throw new ProviderException("doFinal() failed", e);
+ } finally {
+ if (encrypt) {
+ lastEncKey = this.p11Key;
+ lastEncIv = this.iv;
+ requireReinit = true;
+ }
+ reset(doCancel);
+ }
+ }
+
+ private int implDoFinal(ByteBuffer inBuffer, ByteBuffer outBuffer)
+ throws ShortBufferException, IllegalBlockSizeException,
+ BadPaddingException {
+ int outLen = outBuffer.remaining();
+ int inLen = inBuffer.remaining();
+
+ int requiredOutLen = doFinalLength(inLen);
+ if (outLen < requiredOutLen) {
+ throw new ShortBufferException();
+ }
+
+ boolean doCancel = true;
+ try {
+ ensureInitialized();
+
+ long inAddr = 0;
+ byte[] in = null;
+ int inOfs = 0;
+ if (dataBuffer.size() > 0) {
+ if (inLen > 0) {
+ byte[] temp = new byte[inLen];
+ inBuffer.get(temp);
+ dataBuffer.write(temp, 0, temp.length);
+ }
+ in = dataBuffer.toByteArray();
+ inOfs = 0;
+ inLen = in.length;
+ } else {
+ if (inBuffer instanceof DirectBuffer) {
+ inAddr = ((DirectBuffer) inBuffer).address();
+ inOfs = inBuffer.position();
+ } else {
+ if (inBuffer.hasArray()) {
+ in = inBuffer.array();
+ inOfs = inBuffer.position() + inBuffer.arrayOffset();
+ } else {
+ in = new byte[inLen];
+ inBuffer.get(in);
+ }
+ }
+ }
+ long outAddr = 0;
+ byte[] outArray = null;
+ int outOfs = 0;
+ if (outBuffer instanceof DirectBuffer) {
+ outAddr = ((DirectBuffer) outBuffer).address();
+ outOfs = outBuffer.position();
+ } else {
+ if (outBuffer.hasArray()) {
+ outArray = outBuffer.array();
+ outOfs = outBuffer.position() + outBuffer.arrayOffset();
+ } else {
+ outArray = new byte[outLen];
+ }
+ }
+
+ int k = 0;
+ if (encrypt) {
+ k = token.p11.C_Encrypt(session.id(), inAddr, in, inOfs, inLen,
+ outAddr, outArray, outOfs, outLen);
+ doCancel = false;
+ } else {
+ // Special handling to match SunJCE provider behavior
+ if (inLen == 0) {
+ return 0;
+ }
+ k = token.p11.C_Decrypt(session.id(), inAddr, in, inOfs, inLen,
+ outAddr, outArray, outOfs, outLen);
+ doCancel = false;
+ }
+ outBuffer.position(outBuffer.position() + k);
+ return k;
+ } catch (PKCS11Exception e) {
+ doCancel = false;
+ handleException(e);
+ throw new ProviderException("doFinal() failed", e);
+ } finally {
+ if (encrypt) {
+ lastEncKey = this.p11Key;
+ lastEncIv = this.iv;
+ requireReinit = true;
+ }
+ reset(doCancel);
+ }
+ }
+
+ private void handleException(PKCS11Exception e)
+ throws ShortBufferException, IllegalBlockSizeException,
+ BadPaddingException {
+ long errorCode = e.getErrorCode();
+ if (errorCode == CKR_BUFFER_TOO_SMALL) {
+ throw (ShortBufferException)
+ (new ShortBufferException().initCause(e));
+ } else if (errorCode == CKR_DATA_LEN_RANGE ||
+ errorCode == CKR_ENCRYPTED_DATA_LEN_RANGE) {
+ throw (IllegalBlockSizeException)
+ (new IllegalBlockSizeException(e.toString()).initCause(e));
+ } else if (errorCode == CKR_ENCRYPTED_DATA_INVALID) {
+ throw (BadPaddingException)
+ (new BadPaddingException(e.toString()).initCause(e));
+ }
+ }
+
+ // see JCE spec
+ protected byte[] engineWrap(Key key) throws IllegalBlockSizeException,
+ InvalidKeyException {
+ // XXX key wrapping
+ throw new UnsupportedOperationException("engineWrap()");
+ }
+
+ // see JCE spec
+ protected Key engineUnwrap(byte[] wrappedKey, String wrappedKeyAlgorithm,
+ int wrappedKeyType)
+ throws InvalidKeyException, NoSuchAlgorithmException {
+ // XXX key unwrapping
+ throw new UnsupportedOperationException("engineUnwrap()");
+ }
+
+ // see JCE spec
+ @Override
+ protected int engineGetKeySize(Key key) throws InvalidKeyException {
+ int n = P11SecretKeyFactory.convertKey
+ (token, key, ALGO).length();
+ return n;
+ }
+}
+
diff --git a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11PSSSignature.java b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11PSSSignature.java
new file mode 100644
index 00000000000..c0f48715d80
--- /dev/null
+++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11PSSSignature.java
@@ -0,0 +1,701 @@
+/*
+ * Copyright (c) 2019, 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.
+ */
+
+package sun.security.pkcs11;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import sun.nio.ch.DirectBuffer;
+
+import java.util.Hashtable;
+import java.util.Arrays;
+import java.security.*;
+import java.security.spec.AlgorithmParameterSpec;
+import java.security.spec.MGF1ParameterSpec;
+import java.security.spec.PSSParameterSpec;
+import java.security.interfaces.*;
+import sun.security.pkcs11.wrapper.*;
+import static sun.security.pkcs11.wrapper.PKCS11Constants.*;
+
+
+/**
+ * RSASSA-PSS Signature implementation class. This class currently supports the
+ * following algorithms:
+ *
+ * . RSA-PSS:
+ * . RSASSA-PSS
+ * . SHA1withRSASSA-PSS
+ * . SHA224withRSASSA-PSS
+ * . SHA256withRSASSA-PSS
+ * . SHA384withRSASSA-PSS
+ * . SHA512withRSASSA-PSS
+ *
+ * Note that the underlying PKCS#11 token may support complete signature
+ * algorithm (e.g. CKM__RSA_PKCS_PSS), or it may just
+ * implement the signature algorithm without hashing (i.e. CKM_RSA_PKCS_PSS).
+ * This class uses what is available and adds whatever extra processing
+ * is needed.
+ *
+ * @since 13
+ */
+final class P11PSSSignature extends SignatureSpi {
+
+ private final static boolean DEBUG = false;
+
+ // mappings of digest algorithms and their output length in bytes
+ private static final Hashtable DIGEST_LENGTHS =
+ new Hashtable();
+
+ static {
+ DIGEST_LENGTHS.put("SHA-1", 20);
+ DIGEST_LENGTHS.put("SHA", 20);
+ DIGEST_LENGTHS.put("SHA1", 20);
+ DIGEST_LENGTHS.put("SHA-224", 28);
+ DIGEST_LENGTHS.put("SHA224", 28);
+ DIGEST_LENGTHS.put("SHA-256", 32);
+ DIGEST_LENGTHS.put("SHA256", 32);
+ DIGEST_LENGTHS.put("SHA-384", 48);
+ DIGEST_LENGTHS.put("SHA384", 48);
+ DIGEST_LENGTHS.put("SHA-512", 64);
+ DIGEST_LENGTHS.put("SHA512", 64);
+ DIGEST_LENGTHS.put("SHA-512/224", 28);
+ DIGEST_LENGTHS.put("SHA512/224", 28);
+ DIGEST_LENGTHS.put("SHA-512/256", 32);
+ DIGEST_LENGTHS.put("SHA512/256", 32);
+ }
+
+ // utility method for comparing digest algorithms
+ // NOTE that first argument is assumed to be standard digest name
+ private static boolean isDigestEqual(String stdAlg, String givenAlg) {
+ if (stdAlg == null || givenAlg == null) return false;
+
+ if (givenAlg.indexOf("-") != -1) {
+ return stdAlg.equalsIgnoreCase(givenAlg);
+ } else {
+ if (stdAlg.equals("SHA-1")) {
+ return (givenAlg.equalsIgnoreCase("SHA")
+ || givenAlg.equalsIgnoreCase("SHA1"));
+ } else {
+ StringBuilder sb = new StringBuilder(givenAlg);
+ // case-insensitive check
+ if (givenAlg.regionMatches(true, 0, "SHA", 0, 3)) {
+ givenAlg = sb.insert(3, "-").toString();
+ return stdAlg.equalsIgnoreCase(givenAlg);
+ } else {
+ throw new ProviderException("Unsupported digest algorithm "
+ + givenAlg);
+ }
+ }
+ }
+ }
+
+ // token instance
+ private final Token token;
+
+ // algorithm name
+ private final String algorithm;
+
+ // name of the key algorithm, currently just RSA
+ private static final String KEY_ALGO = "RSA";
+
+ // mechanism id
+ private final CK_MECHANISM mechanism;
+
+ // type, one of T_* below
+ private final int type;
+
+ // key instance used, if init*() was called
+ private P11Key p11Key = null;
+
+ // PSS parameters and the flag controlling its access
+ private PSSParameterSpec sigParams = null;
+ private boolean isActive = false;
+
+ // message digest alg, if implied by the algorithm name
+ private final String mdAlg;
+
+ // message digest, if we do the digesting ourselves
+ private MessageDigest md = null;
+
+ // associated session, if any
+ private Session session;
+
+ // mode, one of M_* below
+ private int mode;
+
+ // flag indicating whether an operation is initialized
+ private boolean initialized = false;
+
+ // buffer, for update(byte)
+ private final byte[] buffer = new byte[1];
+
+ // total number of bytes processed in current operation
+ private int bytesProcessed = 0;
+
+ // constant for signing mode
+ private final static int M_SIGN = 1;
+ // constant for verification mode
+ private final static int M_VERIFY = 2;
+
+ // constant for type digesting, we do the hashing ourselves
+ private final static int T_DIGEST = 1;
+ // constant for type update, token does everything
+ private final static int T_UPDATE = 2;
+
+ P11PSSSignature(Token token, String algorithm, long mechId)
+ throws NoSuchAlgorithmException, PKCS11Exception {
+ super();
+ this.token = token;
+ this.algorithm = algorithm;
+ this.mechanism = new CK_MECHANISM(mechId);
+ int idx = algorithm.indexOf("with");
+ this.mdAlg = (idx == -1? null : algorithm.substring(0, idx));
+ switch ((int)mechId) {
+ case (int)CKM_SHA1_RSA_PKCS_PSS:
+ case (int)CKM_SHA224_RSA_PKCS_PSS:
+ case (int)CKM_SHA256_RSA_PKCS_PSS:
+ case (int)CKM_SHA384_RSA_PKCS_PSS:
+ case (int)CKM_SHA512_RSA_PKCS_PSS:
+ type = T_UPDATE;
+ break;
+ case (int)CKM_RSA_PKCS_PSS:
+ type = T_DIGEST;
+ break;
+ default:
+ throw new ProviderException("Unsupported mechanism: " + mechId);
+ }
+ this.md = null;
+ }
+
+ private void ensureInitialized() throws SignatureException {
+ token.ensureValid();
+ if (this.p11Key == null) {
+ throw new SignatureException("Missing key");
+ }
+ if (this.sigParams == null) {
+ if (this.mdAlg == null) {
+ // PSS Parameters are required for signature verification
+ throw new SignatureException
+ ("Parameters required for RSASSA-PSS signature");
+ } else {
+ int saltLen = DIGEST_LENGTHS.get(this.mdAlg).intValue();
+ // generate default params for both sign and verify?
+ this.sigParams = new PSSParameterSpec(this.mdAlg,
+ "MGF1", new MGF1ParameterSpec(this.mdAlg),
+ saltLen, PSSParameterSpec.TRAILER_FIELD_BC);
+ this.mechanism.setParameter(new CK_RSA_PKCS_PSS_PARAMS(
+ this.mdAlg, "MGF1", this.mdAlg,
+ DIGEST_LENGTHS.get(this.mdAlg).intValue()));
+ }
+ }
+
+ if (initialized == false) {
+ initialize();
+ }
+ }
+
+ // reset the states to the pre-initialized values
+ private void reset(boolean doCancel) {
+ if (!initialized) {
+ return;
+ }
+ initialized = false;
+ try {
+ if (session == null) {
+ return;
+ }
+ if (doCancel && token.explicitCancel) {
+ cancelOperation();
+ }
+ } finally {
+ p11Key.releaseKeyID();
+ mechanism.freeHandle();
+ session = token.releaseSession(session);
+ isActive = false;
+ }
+ }
+
+ private void cancelOperation() {
+ token.ensureValid();
+ if (DEBUG) System.out.print("Cancelling operation");
+
+ if (session.hasObjects() == false) {
+ if (DEBUG) System.out.println(" by killing session");
+ session = token.killSession(session);
+ return;
+ }
+ // "cancel" operation by finishing it
+ if (mode == M_SIGN) {
+ try {
+ if (type == T_UPDATE) {
+ if (DEBUG) System.out.println(" by C_SignFinal");
+ token.p11.C_SignFinal(session.id(), 0);
+ } else {
+ byte[] digest =
+ (md == null? new byte[0] : md.digest());
+ if (DEBUG) System.out.println(" by C_Sign");
+ token.p11.C_Sign(session.id(), digest);
+ }
+ } catch (PKCS11Exception e) {
+ throw new ProviderException("cancel failed", e);
+ }
+ } else { // M_VERIFY
+ try {
+ byte[] signature =
+ new byte[(p11Key.length() + 7) >> 3];
+ if (type == T_UPDATE) {
+ if (DEBUG) System.out.println(" by C_VerifyFinal");
+ token.p11.C_VerifyFinal(session.id(), signature);
+ } else {
+ byte[] digest =
+ (md == null? new byte[0] : md.digest());
+ if (DEBUG) System.out.println(" by C_Verify");
+ token.p11.C_Verify(session.id(), digest, signature);
+ }
+ } catch (PKCS11Exception e) {
+ // will fail since the signature is incorrect
+ // XXX check error code
+ }
+ }
+ }
+
+ // assumes current state is initialized == false
+ private void initialize() {
+ if (DEBUG) System.out.println("Initializing");
+
+ if (p11Key == null) {
+ throw new ProviderException(
+ "No Key found, call initSign/initVerify first");
+ }
+
+ long keyID = p11Key.getKeyID();
+ try {
+ if (session == null) {
+ session = token.getOpSession();
+ }
+ if (mode == M_SIGN) {
+ token.p11.C_SignInit(session.id(), mechanism, keyID);
+ } else {
+ token.p11.C_VerifyInit(session.id(), mechanism, keyID);
+ }
+ } catch (PKCS11Exception e) {
+ p11Key.releaseKeyID();
+ session = token.releaseSession(session);
+ throw new ProviderException("Initialization failed", e);
+ }
+ if (bytesProcessed != 0) {
+ bytesProcessed = 0;
+ if (md != null) {
+ md.reset();
+ }
+ }
+ initialized = true;
+ isActive = false;
+ if (DEBUG) System.out.println("Initialized");
+ }
+
+ private void checkKeySize(Key key) throws InvalidKeyException {
+ if (DEBUG) System.out.print("Checking Key");
+
+ if (!key.getAlgorithm().equals(KEY_ALGO)) {
+ throw new InvalidKeyException("Only " + KEY_ALGO +
+ " keys are supported");
+ }
+
+ CK_MECHANISM_INFO mechInfo = null;
+ try {
+ mechInfo = token.getMechanismInfo(mechanism.mechanism);
+ } catch (PKCS11Exception e) {
+ // should not happen, ignore for now
+ if (DEBUG) {
+ System.out.println("Unexpected exception");
+ e.printStackTrace();
+ }
+ }
+
+ int keySize = 0; // in bytes
+ if (mechInfo != null) {
+ // check against available native info
+ int minKeySize = (int) mechInfo.ulMinKeySize;
+ int maxKeySize = (int) mechInfo.ulMaxKeySize;
+ if (key instanceof P11Key) {
+ keySize = (((P11Key) key).length() + 7) >> 3;
+ } else if (key instanceof RSAKey) {
+ keySize = ((RSAKey) key).getModulus().bitLength() >> 3;
+ } else {
+ throw new InvalidKeyException("Unrecognized key type " + key);
+ }
+ if ((minKeySize != -1) && (keySize < minKeySize)) {
+ throw new InvalidKeyException(KEY_ALGO +
+ " key must be at least " + minKeySize + " bytes");
+ }
+ if ((maxKeySize != -1) && (keySize > maxKeySize)) {
+ throw new InvalidKeyException(KEY_ALGO +
+ " key must be at most " + maxKeySize + " bytes");
+ }
+ }
+ if (this.sigParams != null) {
+ String digestAlg = this.sigParams.getDigestAlgorithm();
+ int sLen = this.sigParams.getSaltLength();
+ int hLen = DIGEST_LENGTHS.get(digestAlg).intValue();
+ int minKeyLen = Math.addExact(Math.addExact(sLen, hLen), 2);
+
+ if (keySize < minKeyLen) {
+ throw new InvalidKeyException
+ ("Key is too short for current params, need min " + minKeyLen);
+ }
+ }
+ }
+
+ private void setSigParams(AlgorithmParameterSpec p)
+ throws InvalidAlgorithmParameterException {
+ if (p == null) {
+ throw new InvalidAlgorithmParameterException("PSS Parameter required");
+ }
+ if (!(p instanceof PSSParameterSpec)) {
+ throw new InvalidAlgorithmParameterException
+ ("Only PSSParameterSpec is supported");
+ }
+ // no need to validate again if same as current signature parameters
+ PSSParameterSpec params = (PSSParameterSpec) p;
+ if (params == this.sigParams) return;
+
+ String digestAlgorithm = params.getDigestAlgorithm();
+ if (this.mdAlg != null && !isDigestEqual(digestAlgorithm, this.mdAlg)) {
+ throw new InvalidAlgorithmParameterException
+ ("Digest algorithm in Signature parameters must be " +
+ this.mdAlg);
+ }
+ Integer digestLen = DIGEST_LENGTHS.get(digestAlgorithm);
+ if (digestLen == null) {
+ throw new InvalidAlgorithmParameterException
+ ("Unsupported digest algorithm in Signature parameters: " +
+ digestAlgorithm);
+ }
+ if (!(params.getMGFAlgorithm().equalsIgnoreCase("MGF1"))) {
+ throw new InvalidAlgorithmParameterException("Only supports MGF1");
+ }
+ if (params.getTrailerField() != PSSParameterSpec.TRAILER_FIELD_BC) {
+ throw new InvalidAlgorithmParameterException
+ ("Only supports TrailerFieldBC(1)");
+ }
+ int saltLen = params.getSaltLength();
+ if (this.p11Key != null) {
+ int maxSaltLen = ((this.p11Key.length() + 7) >> 3) - digestLen.intValue() - 2;
+
+ if (DEBUG) {
+ System.out.println("Max saltLen = " + maxSaltLen);
+ System.out.println("Curr saltLen = " + saltLen);
+ }
+ if (maxSaltLen < 0 || saltLen > maxSaltLen) {
+ throw new InvalidAlgorithmParameterException("Invalid with current key size");
+ }
+ } else {
+ if (DEBUG) System.out.println("No key available for validating saltLen");
+ }
+
+ // validated, now try to store the parameter internally
+ try {
+ this.mechanism.setParameter(
+ new CK_RSA_PKCS_PSS_PARAMS(digestAlgorithm, "MGF1",
+ digestAlgorithm, saltLen));
+ this.sigParams = params;
+ } catch (IllegalArgumentException iae) {
+ throw new InvalidAlgorithmParameterException(iae);
+ }
+ }
+
+ // see JCA spec
+ @Override
+ protected void engineInitVerify(PublicKey publicKey)
+ throws InvalidKeyException {
+
+ if (publicKey == null) {
+ throw new InvalidKeyException("Key must not be null");
+ }
+
+ // Need to check key length whenever a new key is set
+ if (publicKey != p11Key) {
+ checkKeySize(publicKey);
+ }
+
+ reset(true);
+ mode = M_VERIFY;
+ p11Key = P11KeyFactory.convertKey(token, publicKey, KEY_ALGO);
+
+ // For PSS, defer PKCS11 initialization calls to update/doFinal as it
+ // needs both key and params
+ }
+
+ // see JCA spec
+ @Override
+ protected void engineInitSign(PrivateKey privateKey)
+ throws InvalidKeyException {
+
+ if (privateKey == null) {
+ throw new InvalidKeyException("Key must not be null");
+ }
+
+ // Need to check RSA key length whenever a new key is set
+ if (privateKey != p11Key) {
+ checkKeySize(privateKey);
+ }
+
+ reset(true);
+ mode = M_SIGN;
+ p11Key = P11KeyFactory.convertKey(token, privateKey, KEY_ALGO);
+
+ // For PSS, defer PKCS11 initialization calls to update/doFinal as it
+ // needs both key and params
+ }
+
+ // see JCA spec
+ @Override
+ protected void engineUpdate(byte b) throws SignatureException {
+ ensureInitialized();
+ isActive = true;
+ buffer[0] = b;
+ engineUpdate(buffer, 0, 1);
+ }
+
+ // see JCA spec
+ @Override
+ protected void engineUpdate(byte[] b, int ofs, int len)
+ throws SignatureException {
+ ensureInitialized();
+ if (len == 0) {
+ return;
+ }
+ // check for overflow
+ if (len + bytesProcessed < 0) {
+ throw new ProviderException("Processed bytes limits exceeded.");
+ }
+ isActive = true;
+ switch (type) {
+ case T_UPDATE:
+ try {
+ if (mode == M_SIGN) {
+ System.out.println(this + ": Calling C_SignUpdate");
+ token.p11.C_SignUpdate(session.id(), 0, b, ofs, len);
+ } else {
+ System.out.println(this + ": Calling C_VerfifyUpdate");
+ token.p11.C_VerifyUpdate(session.id(), 0, b, ofs, len);
+ }
+ bytesProcessed += len;
+ } catch (PKCS11Exception e) {
+ reset(false);
+ throw new ProviderException(e);
+ }
+ break;
+ case T_DIGEST:
+ // should not happen as this should be covered by earlier checks
+ if (md == null) {
+ throw new ProviderException("PSS Parameters required");
+ }
+ md.update(b, ofs, len);
+ bytesProcessed += len;
+ break;
+ default:
+ throw new ProviderException("Internal error");
+ }
+ }
+
+ // see JCA spec
+ @Override
+ protected void engineUpdate(ByteBuffer byteBuffer) {
+ try {
+ ensureInitialized();
+ } catch (SignatureException se) {
+ throw new ProviderException(se);
+ }
+ int len = byteBuffer.remaining();
+ if (len <= 0) {
+ return;
+ }
+ isActive = true;
+ switch (type) {
+ case T_UPDATE:
+ if (byteBuffer instanceof DirectBuffer == false) {
+ // cannot do better than default impl
+ super.engineUpdate(byteBuffer);
+ return;
+ }
+ long addr = ((DirectBuffer)byteBuffer).address();
+ int ofs = byteBuffer.position();
+ try {
+ if (mode == M_SIGN) {
+ System.out.println(this + ": Calling C_SignUpdate");
+ token.p11.C_SignUpdate
+ (session.id(), addr + ofs, null, 0, len);
+ } else {
+ System.out.println(this + ": Calling C_VerifyUpdate");
+ token.p11.C_VerifyUpdate
+ (session.id(), addr + ofs, null, 0, len);
+ }
+ bytesProcessed += len;
+ byteBuffer.position(ofs + len);
+ } catch (PKCS11Exception e) {
+ reset(false);
+ throw new ProviderException("Update failed", e);
+ }
+ break;
+ case T_DIGEST:
+ // should not happen as this should be covered by earlier checks
+ if (md == null) {
+ throw new ProviderException("PSS Parameters required");
+ }
+ md.update(byteBuffer);
+ bytesProcessed += len;
+ break;
+ default:
+ reset(false);
+ throw new ProviderException("Internal error");
+ }
+ }
+
+ // see JCA spec
+ @Override
+ protected byte[] engineSign() throws SignatureException {
+ ensureInitialized();
+ boolean doCancel = true;
+ if (DEBUG) System.out.print("Generating signature");
+ try {
+ byte[] signature;
+ if (type == T_UPDATE) {
+ if (DEBUG) System.out.println(" by C_SignFinal");
+ signature = token.p11.C_SignFinal(session.id(), 0);
+ } else {
+ if (md == null) {
+ throw new ProviderException("PSS Parameters required");
+ }
+ byte[] digest = md.digest();
+ if (DEBUG) System.out.println(" by C_Sign");
+ signature = token.p11.C_Sign(session.id(), digest);
+ }
+ doCancel = false;
+ return signature;
+ } catch (PKCS11Exception pe) {
+ doCancel = false;
+ throw new ProviderException(pe);
+ } catch (ProviderException e) {
+ throw e;
+ } finally {
+ reset(doCancel);
+ }
+ }
+
+ // see JCA spec
+ @Override
+ protected boolean engineVerify(byte[] signature) throws SignatureException {
+ ensureInitialized();
+ boolean doCancel = true;
+ if (DEBUG) System.out.print("Verifying signature");
+ try {
+ if (type == T_UPDATE) {
+ if (DEBUG) System.out.println(" by C_VerifyFinal");
+ token.p11.C_VerifyFinal(session.id(), signature);
+ } else {
+ if (md == null) {
+ throw new ProviderException("PSS Parameters required");
+ }
+ byte[] digest = md.digest();
+ if (DEBUG) System.out.println(" by C_Verify");
+ token.p11.C_Verify(session.id(), digest, signature);
+ }
+ doCancel = false;
+ return true;
+ } catch (PKCS11Exception pe) {
+ doCancel = false;
+ long errorCode = pe.getErrorCode();
+ if (errorCode == CKR_SIGNATURE_INVALID) {
+ return false;
+ }
+ if (errorCode == CKR_SIGNATURE_LEN_RANGE) {
+ // return false rather than throwing an exception
+ return false;
+ }
+ // ECF bug?
+ if (errorCode == CKR_DATA_LEN_RANGE) {
+ return false;
+ }
+ throw new ProviderException(pe);
+ } catch (ProviderException e) {
+ throw e;
+ } finally {
+ reset(doCancel);
+ }
+ }
+
+ // see JCA spec
+ @SuppressWarnings("deprecation")
+ @Override
+ protected void engineSetParameter(String param, Object value)
+ throws InvalidParameterException {
+ throw new UnsupportedOperationException("setParameter() not supported");
+ }
+
+ // see JCA spec
+ @Override
+ protected void engineSetParameter(AlgorithmParameterSpec params)
+ throws InvalidAlgorithmParameterException {
+ // disallow changing parameters when update has been called
+ if (isActive) {
+ throw new ProviderException
+ ("Cannot set parameters during operations");
+ }
+ setSigParams(params);
+ if (type == T_DIGEST) {
+ try {
+ this.md = MessageDigest.getInstance(sigParams.getDigestAlgorithm());
+ } catch (NoSuchAlgorithmException nsae) {
+ throw new InvalidAlgorithmParameterException(nsae);
+ }
+ }
+ }
+
+ // see JCA spec
+ @SuppressWarnings("deprecation")
+ @Override
+ protected Object engineGetParameter(String param)
+ throws InvalidParameterException {
+ throw new UnsupportedOperationException("getParameter() not supported");
+ }
+
+ // see JCA spec
+ @Override
+ protected AlgorithmParameters engineGetParameters() {
+ if (this.sigParams != null) {
+ try {
+ AlgorithmParameters ap = AlgorithmParameters.getInstance("RSASSA-PSS");
+ ap.init(this.sigParams);
+ return ap;
+ } catch (GeneralSecurityException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ return null;
+ }
+}
diff --git a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11RSACipher.java b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11RSACipher.java
index aff8b34167f..2b8fc211d1b 100644
--- a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11RSACipher.java
+++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11RSACipher.java
@@ -275,10 +275,10 @@ final class P11RSACipher extends CipherSpi {
long sessId = session.id();
switch (mode) {
case MODE_ENCRYPT:
- p11.C_Encrypt(sessId, buffer, 0, inLen, buffer, 0, outLen);
+ p11.C_Encrypt(sessId, 0, buffer, 0, inLen, 0, buffer, 0, outLen);
break;
case MODE_DECRYPT:
- p11.C_Decrypt(sessId, buffer, 0, inLen, buffer, 0, outLen);
+ p11.C_Decrypt(sessId, 0, buffer, 0, inLen, 0, buffer, 0, outLen);
break;
case MODE_SIGN:
byte[] tmpBuffer = new byte[maxInputSize];
@@ -372,11 +372,11 @@ final class P11RSACipher extends CipherSpi {
switch (mode) {
case MODE_ENCRYPT:
n = p11.C_Encrypt
- (session.id(), buffer, 0, bufOfs, out, outOfs, outLen);
+ (session.id(), 0, buffer, 0, bufOfs, 0, out, outOfs, outLen);
break;
case MODE_DECRYPT:
n = p11.C_Decrypt
- (session.id(), buffer, 0, bufOfs, out, outOfs, outLen);
+ (session.id(), 0, buffer, 0, bufOfs, 0, out, outOfs, outLen);
break;
case MODE_SIGN:
byte[] tmpBuffer = new byte[bufOfs];
@@ -552,6 +552,7 @@ final class P11RSACipher extends CipherSpi {
s = token.getObjSession();
long p11KeyType =
P11SecretKeyFactory.getPKCS11KeyType(algorithm);
+
CK_ATTRIBUTE[] attributes = new CK_ATTRIBUTE[] {
new CK_ATTRIBUTE(CKA_CLASS, CKO_SECRET_KEY),
new CK_ATTRIBUTE(CKA_KEY_TYPE, p11KeyType),
diff --git a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/SunPKCS11.java b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/SunPKCS11.java
index 75db3c742c5..de82caa2da6 100644
--- a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/SunPKCS11.java
+++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/SunPKCS11.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2019, 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
@@ -516,7 +516,9 @@ public final class SunPKCS11 extends AuthProvider {
String P11SecretKeyFactory = "sun.security.pkcs11.P11SecretKeyFactory";
String P11Cipher = "sun.security.pkcs11.P11Cipher";
String P11RSACipher = "sun.security.pkcs11.P11RSACipher";
+ String P11AEADCipher = "sun.security.pkcs11.P11AEADCipher";
String P11Signature = "sun.security.pkcs11.P11Signature";
+ String P11PSSSignature = "sun.security.pkcs11.P11PSSSignature";
// XXX register all aliases
@@ -540,6 +542,12 @@ public final class SunPKCS11 extends AuthProvider {
d(MD, "SHA-512", P11Digest,
s("2.16.840.1.101.3.4.2.3", "OID.2.16.840.1.101.3.4.2.3"),
m(CKM_SHA512));
+ d(MD, "SHA-512/224", P11Digest,
+ s("2.16.840.1.101.3.4.2.5", "OID.2.16.840.1.101.3.4.2.5"),
+ m(CKM_SHA512_224));
+ d(MD, "SHA-512/256", P11Digest,
+ s("2.16.840.1.101.3.4.2.6", "OID.2.16.840.1.101.3.4.2.6"),
+ m(CKM_SHA512_256));
d(MAC, "HmacMD5", P11MAC,
m(CKM_MD5_HMAC));
@@ -558,13 +566,22 @@ public final class SunPKCS11 extends AuthProvider {
d(MAC, "HmacSHA512", P11MAC,
s("1.2.840.113549.2.11", "OID.1.2.840.113549.2.11"),
m(CKM_SHA512_HMAC));
+ d(MAC, "HmacSHA512/224", P11MAC,
+ s("1.2.840.113549.2.12", "OID.1.2.840.113549.2.12"),
+ m(CKM_SHA512_224_HMAC));
+ d(MAC, "HmacSHA512/256", P11MAC,
+ s("1.2.840.113549.2.13", "OID.1.2.840.113549.2.13"),
+ m(CKM_SHA512_256_HMAC));
+
d(MAC, "SslMacMD5", P11MAC,
m(CKM_SSL3_MD5_MAC));
d(MAC, "SslMacSHA1", P11MAC,
m(CKM_SSL3_SHA1_MAC));
d(KPG, "RSA", P11KeyPairGenerator,
+ s("1.2.840.113549.1.1", "OID.1.2.840.113549.1.1"),
m(CKM_RSA_PKCS_KEY_PAIR_GEN));
+
d(KPG, "DSA", P11KeyPairGenerator,
s("1.3.14.3.2.12", "1.2.840.10040.4.1", "OID.1.2.840.10040.4.1"),
m(CKM_DSA_KEY_PAIR_GEN));
@@ -587,6 +604,7 @@ public final class SunPKCS11 extends AuthProvider {
// register (Secret)KeyFactories if there are any mechanisms
// for a particular algorithm that we support
d(KF, "RSA", P11RSAKeyFactory,
+ s("1.2.840.113549.1.1", "OID.1.2.840.113549.1.1"),
m(CKM_RSA_PKCS_KEY_PAIR_GEN, CKM_RSA_PKCS, CKM_RSA_X_509));
d(KF, "DSA", P11DSAKeyFactory,
s("1.3.14.3.2.12", "1.2.840.10040.4.1", "OID.1.2.840.10040.4.1"),
@@ -600,10 +618,14 @@ public final class SunPKCS11 extends AuthProvider {
// AlgorithmParameters for EC.
// Only needed until we have an EC implementation in the SUN provider.
d(AGP, "EC", "sun.security.util.ECParameters",
- s("1.2.840.10045.2.1"),
+ s("1.2.840.10045.2.1"),
m(CKM_EC_KEY_PAIR_GEN, CKM_ECDH1_DERIVE,
CKM_ECDSA, CKM_ECDSA_SHA1));
+
+ d(AGP, "GCM", "sun.security.util.GCMParameters",
+ m(CKM_AES_GCM));
+
d(KA, "DH", P11KeyAgreement, s("DiffieHellman"),
m(CKM_DH_PKCS_DERIVE));
d(KA, "ECDH", "sun.security.pkcs11.P11ECDHKeyAgreement",
@@ -669,12 +691,24 @@ public final class SunPKCS11 extends AuthProvider {
m(CKM_AES_ECB));
d(CIP, "AES/CTR/NoPadding", P11Cipher,
m(CKM_AES_CTR));
+
+ d(CIP, "AES/GCM/NoPadding", P11AEADCipher,
+ m(CKM_AES_GCM));
+ d(CIP, "AES_128/GCM/NoPadding", P11AEADCipher,
+ s("2.16.840.1.101.3.4.1.6", "OID.2.16.840.1.101.3.4.1.6"),
+ m(CKM_AES_GCM));
+ d(CIP, "AES_192/GCM/NoPadding", P11AEADCipher,
+ s("2.16.840.1.101.3.4.1.26", "OID.2.16.840.1.101.3.4.1.26"),
+ m(CKM_AES_GCM));
+ d(CIP, "AES_256/GCM/NoPadding", P11AEADCipher,
+ s("2.16.840.1.101.3.4.1.46", "OID.2.16.840.1.101.3.4.1.46"),
+ m(CKM_AES_GCM));
+
d(CIP, "Blowfish/CBC/NoPadding", P11Cipher,
m(CKM_BLOWFISH_CBC));
d(CIP, "Blowfish/CBC/PKCS5Padding", P11Cipher,
m(CKM_BLOWFISH_CBC));
- // XXX RSA_X_509, RSA_OAEP not yet supported
d(CIP, "RSA/ECB/PKCS1Padding", P11RSACipher, s("RSA"),
m(CKM_RSA_PKCS));
d(CIP, "RSA/ECB/NoPadding", P11RSACipher,
@@ -686,12 +720,25 @@ public final class SunPKCS11 extends AuthProvider {
s("SHA1withDSA", "1.3.14.3.2.13", "1.3.14.3.2.27",
"1.2.840.10040.4.3", "OID.1.2.840.10040.4.3"),
m(CKM_DSA_SHA1, CKM_DSA));
+ d(SIG, "SHA224withDSA", P11Signature,
+ s("2.16.840.1.101.3.4.3.1", "OID.2.16.840.1.101.3.4.3.1"),
+ m(CKM_DSA_SHA224));
+ d(SIG, "SHA256withDSA", P11Signature,
+ s("2.16.840.1.101.3.4.3.2", "OID.2.16.840.1.101.3.4.3.2"),
+ m(CKM_DSA_SHA256));
+ d(SIG, "SHA384withDSA", P11Signature,
+ s("2.16.840.1.101.3.4.3.3", "OID.2.16.840.1.101.3.4.3.3"),
+ m(CKM_DSA_SHA384));
+ d(SIG, "SHA512withDSA", P11Signature,
+ s("2.16.840.1.101.3.4.3.4", "OID.2.16.840.1.101.3.4.3.4"),
+ m(CKM_DSA_SHA512));
d(SIG, "RawDSAinP1363Format", P11Signature,
s("NONEwithDSAinP1363Format"),
m(CKM_DSA));
d(SIG, "DSAinP1363Format", P11Signature,
s("SHA1withDSAinP1363Format"),
m(CKM_DSA_SHA1, CKM_DSA));
+
d(SIG, "NONEwithECDSA", P11Signature,
m(CKM_ECDSA));
d(SIG, "SHA1withECDSA", P11Signature,
@@ -743,6 +790,19 @@ public final class SunPKCS11 extends AuthProvider {
d(SIG, "SHA512withRSA", P11Signature,
s("1.2.840.113549.1.1.13", "OID.1.2.840.113549.1.1.13"),
m(CKM_SHA512_RSA_PKCS, CKM_RSA_PKCS, CKM_RSA_X_509));
+ d(SIG, "RSASSA-PSS", P11PSSSignature,
+ s("1.2.840.113549.1.1.10", "OID.1.2.840.113549.1.1.10"),
+ m(CKM_RSA_PKCS_PSS));
+ d(SIG, "SHA1withRSASSA-PSS", P11PSSSignature,
+ m(CKM_SHA1_RSA_PKCS_PSS));
+ d(SIG, "SHA224withRSASSA-PSS", P11PSSSignature,
+ m(CKM_SHA224_RSA_PKCS_PSS));
+ d(SIG, "SHA256withRSASSA-PSS", P11PSSSignature,
+ m(CKM_SHA256_RSA_PKCS_PSS));
+ d(SIG, "SHA384withRSASSA-PSS", P11PSSSignature,
+ m(CKM_SHA384_RSA_PKCS_PSS));
+ d(SIG, "SHA512withRSASSA-PSS", P11PSSSignature,
+ m(CKM_SHA512_RSA_PKCS_PSS));
d(KG, "SunTlsRsaPremasterSecret",
"sun.security.pkcs11.P11TlsRsaPremasterSecretGenerator",
@@ -1008,11 +1068,17 @@ public final class SunPKCS11 extends AuthProvider {
} else if (type == CIP) {
if (algorithm.startsWith("RSA")) {
return new P11RSACipher(token, algorithm, mechanism);
+ } else if (algorithm.endsWith("GCM/NoPadding")) {
+ return new P11AEADCipher(token, algorithm, mechanism);
} else {
return new P11Cipher(token, algorithm, mechanism);
}
} else if (type == SIG) {
- return new P11Signature(token, algorithm, mechanism);
+ if (algorithm.indexOf("RSASSA-PSS") != -1) {
+ return new P11PSSSignature(token, algorithm, mechanism);
+ } else {
+ return new P11Signature(token, algorithm, mechanism);
+ }
} else if (type == MAC) {
return new P11Mac(token, algorithm, mechanism);
} else if (type == KPG) {
@@ -1051,7 +1117,14 @@ public final class SunPKCS11 extends AuthProvider {
} else if (type == KS) {
return token.getKeyStore();
} else if (type == AGP) {
- return new sun.security.util.ECParameters();
+ if (algorithm == "EC") {
+ return new sun.security.util.ECParameters();
+ } else if (algorithm == "GCM") {
+ return new sun.security.util.GCMParameters();
+ } else {
+ throw new NoSuchAlgorithmException("Unsupported algorithm: "
+ + algorithm);
+ }
} else {
throw new NoSuchAlgorithmException("Unknown type: " + type);
}
@@ -1070,7 +1143,7 @@ public final class SunPKCS11 extends AuthProvider {
String keyAlgorithm = key.getAlgorithm();
// RSA signatures and cipher
if (((type == CIP) && algorithm.startsWith("RSA"))
- || (type == SIG) && algorithm.endsWith("RSA")) {
+ || (type == SIG) && (algorithm.indexOf("RSA") != -1)) {
if (keyAlgorithm.equals("RSA") == false) {
return false;
}
diff --git a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/CK_CCM_PARAMS.java b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/CK_CCM_PARAMS.java
new file mode 100644
index 00000000000..e8748d425cd
--- /dev/null
+++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/CK_CCM_PARAMS.java
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 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. 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.
+ */
+
+package sun.security.pkcs11.wrapper;
+
+/**
+ * This class represents the necessary parameters required by
+ * the CKM_AES_CCM mechanism as defined in CK_CCM_PARAMS structure.
+ * PKCS#11 structure:
+ *
+ * typedef struct CK_CCM_PARAMS {
+ * CK_ULONG ulDataLen;
+ * CK_BYTE_PTR pNonce;
+ * CK_ULONG ulNonceLen;
+ * CK_BYTE_PTR pAAD;
+ * CK_ULONG ulAADLen;
+ * CK_ULONG ulMACLen;
+ * } CK_CCM_PARAMS;
+ *
+ *
+ * @since 13
+ */
+public class CK_CCM_PARAMS {
+
+ private final long dataLen;
+ private final byte[] nonce;
+ private final byte[] aad;
+ private final long macLen;
+
+ public CK_CCM_PARAMS(int tagLen, byte[] iv, byte[] aad, int dataLen) {
+ this.dataLen = dataLen;
+ this.nonce = iv;
+ this.aad = aad;
+ this.macLen = tagLen;
+ }
+
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+
+ sb.append(Constants.INDENT);
+ sb.append("ulDataLen: ");
+ sb.append(dataLen);
+ sb.append(Constants.NEWLINE);
+
+ sb.append(Constants.INDENT);
+ sb.append("iv: ");
+ sb.append(Functions.toHexString(nonce));
+ sb.append(Constants.NEWLINE);
+
+ sb.append(Constants.INDENT);
+ sb.append("aad: ");
+ sb.append(Functions.toHexString(aad));
+ sb.append(Constants.NEWLINE);
+
+ sb.append(Constants.INDENT);
+ sb.append("tagLen: ");
+ sb.append(macLen);
+
+ return sb.toString();
+ }
+}
diff --git a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/CK_GCM_PARAMS.java b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/CK_GCM_PARAMS.java
new file mode 100644
index 00000000000..0389dda2818
--- /dev/null
+++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/CK_GCM_PARAMS.java
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2019, 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.
+ */
+
+package sun.security.pkcs11.wrapper;
+
+/**
+ * This class represents the necessary parameters required by
+ * the CKM_AES_GCM mechanism as defined in CK_GCM_PARAMS structure.
+ * PKCS#11 structure:
+ *
+ * typedef struct CK_GCM_PARAMS {
+ * CK_BYTE_PTR pIv;
+ * CK_ULONG ulIvLen;
+ * CK_BYTE_PTR pAAD;
+ * CK_ULONG ulAADLen;
+ * CK_ULONG ulTagBits;
+ * } CK_GCM_PARAMS;
+ *
+ *
+ * @since 10
+ */
+public class CK_GCM_PARAMS {
+
+ private final byte[] iv;
+ private final byte[] aad;
+ private final long tagBits;
+
+ public CK_GCM_PARAMS(int tagLenInBits, byte[] iv, byte[] aad) {
+ this.iv = iv;
+ this.aad = aad;
+ this.tagBits = tagLenInBits;
+ }
+
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+
+ sb.append(Constants.INDENT);
+ sb.append("iv: ");
+ sb.append(Functions.toHexString(iv));
+ sb.append(Constants.NEWLINE);
+
+ sb.append(Constants.INDENT);
+ sb.append("aad: ");
+ sb.append(Functions.toHexString(aad));
+ sb.append(Constants.NEWLINE);
+
+ sb.append(Constants.INDENT);
+ sb.append("tagLen(in bits): ");
+ sb.append(tagBits);
+
+ return sb.toString();
+ }
+}
diff --git a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/CK_MECHANISM.java b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/CK_MECHANISM.java
index 84f8508a3fd..1e546462163 100644
--- a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/CK_MECHANISM.java
+++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/CK_MECHANISM.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
*/
/* Copyright (c) 2002 Graz University of Technology. All rights reserved.
@@ -82,11 +82,15 @@ public class CK_MECHANISM {
* CK_ULONG ulParameterLen;
*
*/
- public Object pParameter;
+ public Object pParameter = null;
- public CK_MECHANISM() {
- // empty
- }
+ // pointer to native CK_MECHANISM structure
+ // For mechanisms which have only mechanism id, the native structure
+ // can be freed right after init and this field will not be used. However,
+ // for mechanisms which have both mechanism id and parameters, it can
+ // only be freed after operation is finished. Thus, the native pointer
+ // will be stored here and then be explicitly freed by caller.
+ private long pHandle = 0L;
public CK_MECHANISM(long mechanism) {
this.mechanism = mechanism;
@@ -95,7 +99,6 @@ public class CK_MECHANISM {
// We don't have a (long,Object) constructor to force type checking.
// This makes sure we don't accidentally pass a class that the native
// code cannot handle.
-
public CK_MECHANISM(long mechanism, byte[] pParameter) {
init(mechanism, pParameter);
}
@@ -144,6 +147,33 @@ public class CK_MECHANISM {
init(mechanism, params);
}
+ public CK_MECHANISM(long mechanism, CK_GCM_PARAMS params) {
+ init(mechanism, params);
+ }
+
+ public CK_MECHANISM(long mechanism, CK_CCM_PARAMS params) {
+ init(mechanism, params);
+ }
+
+ // For PSS. the parameter may be set multiple times, use the
+ // CK_MECHANISM(long) constructor and setParameter(CK_RSA_PKCS_PSS_PARAMS)
+ // methods instead of creating yet another constructor
+ public void setParameter(CK_RSA_PKCS_PSS_PARAMS params) {
+ assert(this.mechanism == CKM_RSA_PKCS_PSS);
+ assert(params != null);
+ if (this.pParameter != null && this.pParameter.equals(params)) {
+ return;
+ }
+ freeHandle();
+ this.pParameter = params;
+ }
+
+ public void freeHandle() {
+ if (this.pHandle != 0L) {
+ this.pHandle = PKCS11.freeMechanism(pHandle);
+ }
+ }
+
private void init(long mechanism, Object pParameter) {
this.mechanism = mechanism;
this.pParameter = pParameter;
@@ -167,12 +197,17 @@ public class CK_MECHANISM {
sb.append(pParameter.toString());
sb.append(Constants.NEWLINE);
+ /*
sb.append(Constants.INDENT);
sb.append("ulParameterLen: ??");
- //buffer.append(pParameter.length);
- //buffer.append(Constants.NEWLINE);
-
+ sb.append(Constants.NEWLINE);
+ */
+ if (pHandle != 0L) {
+ sb.append(Constants.INDENT);
+ sb.append("pHandle: ");
+ sb.append(pHandle);
+ sb.append(Constants.NEWLINE);
+ }
return sb.toString() ;
}
-
}
diff --git a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/CK_RSA_PKCS_PSS_PARAMS.java b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/CK_RSA_PKCS_PSS_PARAMS.java
index fd11493c827..7309f0d2e72 100644
--- a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/CK_RSA_PKCS_PSS_PARAMS.java
+++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/CK_RSA_PKCS_PSS_PARAMS.java
@@ -1,118 +1,105 @@
/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/* Copyright (c) 2002 Graz University of Technology. All rights reserved.
+ * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
+ * 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.
*
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
+ * 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).
*
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
+ * 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.
*
- * 3. The end-user documentation included with the redistribution, if any, must
- * include the following acknowledgment:
- *
- * "This product includes software developed by IAIK of Graz University of
- * Technology."
- *
- * Alternately, this acknowledgment may appear in the software itself, if
- * and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Graz University of Technology" and "IAIK of Graz University of
- * Technology" must not be used to endorse or promote products derived from
- * this software without prior written permission.
- *
- * 5. Products derived from this software may not be called
- * "IAIK PKCS Wrapper", nor may "IAIK" appear in their name, without prior
- * written permission of Graz University of Technology.
- *
- * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE LICENSOR BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
+ * 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.
*/
package sun.security.pkcs11.wrapper;
+import java.security.ProviderException;
+import java.security.spec.PSSParameterSpec;
+import java.security.spec.MGF1ParameterSpec;
/**
- * class CK_RSA_PKCS_PSS_PARAMS provides the parameters to the CKM_RSA_PKCS_OAEP
- * mechanism.
+ * This class represents the necessary parameters required by the
+ * CKM_RSA_PKCS_PSS mechanism as defined in CK_RSA_PKCS_PSS_PARAMS structure.
* PKCS#11 structure:
*
* typedef struct CK_RSA_PKCS_PSS_PARAMS {
- * CK_MECHANISM_TYPE hashAlg;
- * CK_RSA_PKCS_MGF_TYPE mgf;
- * CK_ULONG sLen;
+ * CK_MECHANISM_TYPE hashAlg;
+ * CK_RSA_PKCS_MGF_TYPE mgf;
+ * CK_ULONG sLen;
* } CK_RSA_PKCS_PSS_PARAMS;
*
*
- * @author Karl Scheibelhofer
+ * @since 13
*/
public class CK_RSA_PKCS_PSS_PARAMS {
- /**
- * PKCS#11:
- *
- * CK_MECHANISM_TYPE hashAlg;
- *
- */
- public long hashAlg;
+ private final long hashAlg;
+ private final long mgf;
+ private final long sLen;
- /**
- * PKCS#11:
- *
- * CK_RSA_PKCS_MGF_TYPE mgf;
- *
- */
- public long mgf;
+ public CK_RSA_PKCS_PSS_PARAMS(String hashAlg, String mgfAlg,
+ String mgfHash, int sLen) {
+ this.hashAlg = Functions.getHashMechId(hashAlg);
+ if (!mgfAlg.equals("MGF1")) {
+ throw new ProviderException("Only MGF1 is supported");
+ }
+ // no dash in PKCS#11 mechanism names
+ this.mgf = Functions.getMGFId("CKG_MGF1_" + hashAlg.replaceFirst("-", ""));
+ this.sLen = sLen;
+ }
- /**
- * PKCS#11:
- *
- * CK_ULONG sLen;
- *
- */
- public long sLen;
+ @Override
+ public boolean equals(Object o) {
+ if (o == this) {
+ return true;
+ }
- /**
- * Returns the string representation of CK_PKCS5_PBKD2_PARAMS.
- *
- * @return the string representation of CK_PKCS5_PBKD2_PARAMS
- */
+ if (!(o instanceof CK_RSA_PKCS_PSS_PARAMS)) {
+ return false;
+ }
+
+ CK_RSA_PKCS_PSS_PARAMS other = (CK_RSA_PKCS_PSS_PARAMS) o;
+ return ((other.hashAlg == hashAlg) &&
+ (other.mgf == mgf) &&
+ (other.sLen == sLen));
+ }
+
+ @Override
+ public int hashCode() {
+ return (int)(hashAlg << 2 + mgf << 1 + sLen);
+ }
+
+ @Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(Constants.INDENT);
- sb.append("hashAlg: 0x");
+ sb.append("hashAlg: ");
sb.append(Functions.toFullHexString(hashAlg));
sb.append(Constants.NEWLINE);
sb.append(Constants.INDENT);
- sb.append("mgf: 0x");
+ sb.append("mgf: ");
sb.append(Functions.toFullHexString(mgf));
sb.append(Constants.NEWLINE);
sb.append(Constants.INDENT);
- sb.append("sLen: ");
+ sb.append("sLen(in bytes): ");
sb.append(sLen);
- //buffer.append(Constants.NEWLINE);
return sb.toString();
}
-
}
diff --git a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/Functions.java b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/Functions.java
index b150a126d51..7e5593f8703 100644
--- a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/Functions.java
+++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/Functions.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
*/
/* Copyright (c) 2002 Graz University of Technology. All rights reserved.
@@ -97,6 +97,13 @@ public class Functions {
private static final Map objectClassIds =
new HashMap();
+ // MGFs (CKG_*)
+ private static final Map mgfNames =
+ new HashMap();
+
+ private static final Map mgfIds =
+ new HashMap