Skip to content

Commit b6cab55

Browse files
Bump minimum JDK distribution version needed for builds to 24
Co-authored-by: Jatin Bhateja <[email protected]>
1 parent ed13810 commit b6cab55

File tree

10 files changed

+26
-26
lines changed

10 files changed

+26
-26
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88

99
strategy:
1010
matrix:
11-
version: [ 18, 19, 20, 21, 22, 23 ]
11+
version: [ 24 ]
1212
vector-length: [ 256, 512 ]
1313

1414
steps:

.github/workflows/publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ jobs:
1717

1818
- uses: gradle/actions/wrapper-validation@v3
1919

20-
- name: Set up JDK 18
20+
- name: Set up JDK 24
2121
uses: actions/setup-java@v4
2222
with:
2323
distribution: temurin
24-
java-version: 18
24+
java-version: 24
2525

2626
- name: Setup Gradle
2727
uses: gradle/actions/setup-gradle@v3

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ Please remember about specifying the desired version.
7373
Note that simdjson-java follows the [SemVer specification](https://semver.org/), which means, for example, that a major
7474
version of zero indicates initial development, so the library's API should not be considered stable.
7575

76-
We require Java 18 or better.
76+
We require Java 24 or better.
7777

7878
## Benchmarks
7979

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ java {
3333
// It seems that specifying the minimum supported Java version while allowing the use of newer
3434
// ones isn't possible in Gradle. To test the library against multiple Java versions, the
3535
// workaround proposed in https://github.com/gradle/gradle/issues/16256 has been applied:
36-
if (!JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_18)) {
36+
if (!JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_24)) {
3737
toolchain {
38-
languageVersion = JavaLanguageVersion.of(18)
38+
languageVersion = JavaLanguageVersion.of(24)
3939
}
4040
}
4141
withJavadocJar()

gradle/wrapper/gradle-wrapper.jar

59 Bytes
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

gradlew

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ case "$( uname )" in #(
114114
NONSTOP* ) nonstop=true ;;
115115
esac
116116

117-
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
117+
CLASSPATH="\\\"\\\""
118118

119119

120120
# Determine the Java command to use to start the JVM.
@@ -213,7 +213,7 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
213213
set -- \
214214
"-Dorg.gradle.appname=$APP_BASE_NAME" \
215215
-classpath "$CLASSPATH" \
216-
org.gradle.wrapper.GradleWrapperMain \
216+
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
217217
"$@"
218218

219219
# Stop when "xargs" is not available.

gradlew.bat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@ goto fail
7070
:execute
7171
@rem Setup the command line
7272

73-
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73+
set CLASSPATH=
7474

7575

7676
@rem Execute Gradle
77-
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
77+
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
7878

7979
:end
8080
@rem End local scope for the variables with windows NT shell

src/main/java/org/simdjson/StructuralIndexer.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import static jdk.incubator.vector.ByteVector.SPECIES_256;
99
import static jdk.incubator.vector.ByteVector.SPECIES_512;
10-
import static jdk.incubator.vector.VectorOperators.UNSIGNED_LE;
10+
import static jdk.incubator.vector.VectorOperators.ULE;
1111

1212
class StructuralIndexer {
1313

@@ -88,8 +88,8 @@ private void index256(byte[] buffer, int length) {
8888
escaped = (EVEN_BITS_MASK ^ invertMask) & followsEscape;
8989
}
9090

91-
long unescaped0 = chunk0.compare(UNSIGNED_LE, LAST_CONTROL_CHARACTER).toLong();
92-
long unescaped1 = chunk1.compare(UNSIGNED_LE, LAST_CONTROL_CHARACTER).toLong();
91+
long unescaped0 = chunk0.compare(ULE, LAST_CONTROL_CHARACTER).toLong();
92+
long unescaped1 = chunk1.compare(ULE, LAST_CONTROL_CHARACTER).toLong();
9393
long unescaped = unescaped0 | (unescaped1 << 32);
9494

9595
long quote0 = chunk0.eq(QUOTE).toLong();
@@ -148,8 +148,8 @@ private void index256(byte[] buffer, int length) {
148148
escaped = (EVEN_BITS_MASK ^ invertMask) & followsEscape;
149149
}
150150

151-
long unescaped0 = chunk0.compare(UNSIGNED_LE, LAST_CONTROL_CHARACTER).toLong();
152-
long unescaped1 = chunk1.compare(UNSIGNED_LE, LAST_CONTROL_CHARACTER).toLong();
151+
long unescaped0 = chunk0.compare(ULE, LAST_CONTROL_CHARACTER).toLong();
152+
long unescaped1 = chunk1.compare(ULE, LAST_CONTROL_CHARACTER).toLong();
153153
long unescaped = unescaped0 | (unescaped1 << 32);
154154

155155
long quote0 = chunk0.eq(QUOTE).toLong();
@@ -228,7 +228,7 @@ private void index512(byte[] buffer, int length) {
228228
escaped = (EVEN_BITS_MASK ^ invertMask) & followsEscape;
229229
}
230230

231-
long unescaped = chunk.compare(UNSIGNED_LE, LAST_CONTROL_CHARACTER).toLong();
231+
long unescaped = chunk.compare(ULE, LAST_CONTROL_CHARACTER).toLong();
232232
long quote = chunk.eq(QUOTE).toLong() & ~escaped;
233233
long inString = prefixXor(quote) ^ prevInString;
234234
prevInString = inString >> 63;
@@ -271,7 +271,7 @@ private void index512(byte[] buffer, int length) {
271271
escaped = (EVEN_BITS_MASK ^ invertMask) & followsEscape;
272272
}
273273

274-
long unescaped = chunk.compare(UNSIGNED_LE, LAST_CONTROL_CHARACTER).toLong();
274+
long unescaped = chunk.compare(ULE, LAST_CONTROL_CHARACTER).toLong();
275275
long quote = chunk.eq(QUOTE).toLong() & ~escaped;
276276
long inString = prefixXor(quote) ^ prevInString;
277277
prevInString = inString >> 63;

src/main/java/org/simdjson/Utf8Validator.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
import static jdk.incubator.vector.VectorOperators.LSHL;
1212
import static jdk.incubator.vector.VectorOperators.LSHR;
1313
import static jdk.incubator.vector.VectorOperators.NE;
14-
import static jdk.incubator.vector.VectorOperators.UNSIGNED_GE;
15-
import static jdk.incubator.vector.VectorOperators.UNSIGNED_GT;
14+
import static jdk.incubator.vector.VectorOperators.UGE;
15+
import static jdk.incubator.vector.VectorOperators.UGT;
1616
import static jdk.incubator.vector.VectorShuffle.iota;
1717
import static org.simdjson.VectorUtils.BYTE_SPECIES;
1818
import static org.simdjson.VectorUtils.INT_SPECIES;
@@ -65,7 +65,7 @@ static void validate(byte[] buffer, int length) {
6565
if (chunk.and(ALL_ASCII_MASK).compare(EQ, 0).allTrue()) {
6666
errors |= previousIncomplete;
6767
} else {
68-
previousIncomplete = chunk.compare(UNSIGNED_GE, INCOMPLETE_CHECK).toLong();
68+
previousIncomplete = chunk.compare(UGE, INCOMPLETE_CHECK).toLong();
6969
// Shift the input forward by four bytes to make space for the previous four bytes.
7070
// The previous three bytes are required for validation, pulling in the last integer
7171
// will give the previous four bytes. The switch to integer vectors is to allow for
@@ -97,13 +97,13 @@ static void validate(byte[] buffer, int length) {
9797
.or(chunkWithPreviousFourBytes.lanewise(LSHR, TWO_BYTES_SIZE))
9898
.reinterpretAsBytes();
9999
// The minimum leading byte of 3-byte sequences is always greater than the maximum leading byte of 2-byte sequences.
100-
VectorMask<Byte> is3ByteLead = previousTwoBytes.compare(UNSIGNED_GT, MAX_2_LEADING_BYTE);
100+
VectorMask<Byte> is3ByteLead = previousTwoBytes.compare(UGT, MAX_2_LEADING_BYTE);
101101
ByteVector previousThreeBytes = chunkAsInts
102102
.lanewise(LSHL, THREE_BYTES_SIZE)
103103
.or(chunkWithPreviousFourBytes.lanewise(LSHR, Byte.SIZE))
104104
.reinterpretAsBytes();
105105
// The minimum leading byte of 4-byte sequences is always greater than the maximum leading byte of 3-byte sequences.
106-
VectorMask<Byte> is4ByteLead = previousThreeBytes.compare(UNSIGNED_GT, MAX_3_LEADING_BYTE);
106+
VectorMask<Byte> is4ByteLead = previousThreeBytes.compare(UGT, MAX_3_LEADING_BYTE);
107107
// The firstCheck vector contains 0x80 values on continuation byte indexes.
108108
// The leading bytes of 3 and 4-byte sequences should match up with these indexes and zero them out.
109109
ByteVector secondCheck = firstCheck.add((byte) 0x80, is3ByteLead.or(is4ByteLead));
@@ -117,7 +117,7 @@ static void validate(byte[] buffer, int length) {
117117
ByteVector chunk = ByteVector.fromArray(BYTE_SPECIES, buffer, offset, remainingBytes);
118118
if (!chunk.and(ALL_ASCII_MASK).compare(EQ, 0).allTrue()) {
119119
IntVector chunkAsInts = chunk.reinterpretAsInts();
120-
previousIncomplete = chunk.compare(UNSIGNED_GE, INCOMPLETE_CHECK).toLong();
120+
previousIncomplete = chunk.compare(UGE, INCOMPLETE_CHECK).toLong();
121121
// Shift the input forward by four bytes to make space for the previous four bytes.
122122
// The previous three bytes are required for validation, pulling in the last integer
123123
// will give the previous four bytes. The switch to integer vectors is to allow for
@@ -149,13 +149,13 @@ static void validate(byte[] buffer, int length) {
149149
.or(chunkWithPreviousFourBytes.lanewise(LSHR, TWO_BYTES_SIZE))
150150
.reinterpretAsBytes();
151151
// The minimum leading byte of 3-byte sequences is always greater than the maximum leading byte of 2-byte sequences.
152-
VectorMask<Byte> is3ByteLead = previousTwoBytes.compare(UNSIGNED_GT, MAX_2_LEADING_BYTE);
152+
VectorMask<Byte> is3ByteLead = previousTwoBytes.compare(UGT, MAX_2_LEADING_BYTE);
153153
ByteVector previousThreeBytes = chunkAsInts
154154
.lanewise(LSHL, THREE_BYTES_SIZE)
155155
.or(chunkWithPreviousFourBytes.lanewise(LSHR, Byte.SIZE))
156156
.reinterpretAsBytes();
157157
// The minimum leading byte of 4-byte sequences is always greater than the maximum leading byte of 3-byte sequences.
158-
VectorMask<Byte> is4ByteLead = previousThreeBytes.compare(UNSIGNED_GT, MAX_3_LEADING_BYTE);
158+
VectorMask<Byte> is4ByteLead = previousThreeBytes.compare(UGT, MAX_3_LEADING_BYTE);
159159
// The firstCheck vector contains 0x80 values on continuation byte indexes.
160160
// The leading bytes of 3 and 4-byte sequences should match up with these indexes and zero them out.
161161
ByteVector secondCheck = firstCheck.add((byte) 0x80, is3ByteLead.or(is4ByteLead));

0 commit comments

Comments
 (0)