Skip to content

Commit 845135c

Browse files
authored
Merge pull request #2160 from SAP/pr-jdk-26+32
Merge to tag jdk-26+32
2 parents 420733b + fb6e53e commit 845135c

48 files changed

Lines changed: 1229 additions & 369 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/hotspot/cpu/x86/c2_stubGenerator_x86_64_string.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2024, 2025, Intel Corporation. All rights reserved.
2+
* Copyright (c) 2024, 2026, Intel Corporation. All rights reserved.
33
*
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
@@ -1330,10 +1330,12 @@ static void big_case_loop_helper(bool sizeKnown, int size, Label &noMatch, Label
13301330
// Clarification: The BYTE_K compare above compares haystack[(n-32):(n-1)]. We need to
13311331
// compare haystack[(k-1):(k-1+31)]. Subtracting either index gives shift value of
13321332
// (k + 31 - n): x = (k-1+31)-(n-1) = k-1+31-n+1 = k+31-n.
1333+
// When isU is set, similarly, shift is from haystack[(n-32):(n-1)] to [(k-2):(k-2+31)]
1334+
13331335
if (sizeKnown) {
1334-
__ movl(temp2, 31 + size);
1336+
__ movl(temp2, (isU ? 30 : 31) + size);
13351337
} else {
1336-
__ movl(temp2, 31);
1338+
__ movl(temp2, isU ? 30 : 31);
13371339
__ addl(temp2, needleLen);
13381340
}
13391341
__ subl(temp2, hsLength);

src/java.base/share/classes/java/util/concurrent/CopyOnWriteArraySet.java

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,13 @@
3535

3636
package java.util.concurrent;
3737

38+
import jdk.internal.misc.Unsafe;
39+
40+
import java.io.IOException;
41+
import java.io.ObjectInputStream;
42+
import java.io.ObjectStreamException;
43+
import java.io.Serial;
44+
import java.io.StreamCorruptedException;
3845
import java.util.AbstractSet;
3946
import java.util.Collection;
4047
import java.util.Iterator;
@@ -445,4 +452,38 @@ public Spliterator<E> spliterator() {
445452
return Spliterators.spliterator
446453
(al.getArray(), Spliterator.IMMUTABLE | Spliterator.DISTINCT);
447454
}
455+
456+
/**
457+
* De-serialization without data not supported for this class.
458+
*/
459+
@Serial
460+
private void readObjectNoData() throws ObjectStreamException {
461+
throw new StreamCorruptedException("Deserialized CopyOnWriteArraySet requires data");
462+
}
463+
464+
/**
465+
* Reconstitutes the {@code CopyOnWriteArraySet} instance from a stream
466+
* (that is, deserializes it).
467+
* @throws StreamCorruptedException if the object read from the stream is invalid.
468+
*/
469+
@Serial
470+
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
471+
CopyOnWriteArrayList<E> newAl; // Set during the duplicate check
472+
473+
@SuppressWarnings("unchecked")
474+
CopyOnWriteArrayList<E> inAl = (CopyOnWriteArrayList<E>) in.readFields().get("al", null);
475+
476+
if (inAl == null
477+
|| inAl.getClass() != CopyOnWriteArrayList.class
478+
|| (newAl = new CopyOnWriteArrayList<>()).addAllAbsent(inAl) != inAl.size()) {
479+
throw new StreamCorruptedException("Content is invalid");
480+
}
481+
482+
final Unsafe U = Unsafe.getUnsafe();
483+
U.putReference(
484+
this,
485+
U.objectFieldOffset(CopyOnWriteArraySet.class, "al"),
486+
newAl
487+
);
488+
}
448489
}

0 commit comments

Comments
 (0)