Skip to content

Commit

Permalink
[GR-51006] Merge in tag jdk-22+28.
Browse files Browse the repository at this point in the history
PullRequest: labsjdk-ce-22/2
  • Loading branch information
OracleLabsAutomation committed Dec 21, 2023
2 parents c99eb35 + 32836ab commit df24566
Show file tree
Hide file tree
Showing 27 changed files with 219 additions and 77 deletions.
4 changes: 2 additions & 2 deletions ci.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -246,13 +246,13 @@ local contains(str, needle) = std.findSubstr(needle, str) != [];
# Downstream Graal branch to test against. If you change this value to anything but
# "master", you must create an ol-jira issue to change it back to master once the
# next JVMCI release has been made. Add the issue id as a comment here.
local downstream_branch = "master",
local downstream_branch = "release/graal-vm/24.0",

local clone_graal(defs) = {
# Checkout the graal-enterprise repo to the "_gate" version of the
# named downstream branch. This ensures the graal-enterprise and
# graal repos will be in sync.
local branch = if downstream_branch == "master" then "master" else downstream_branch + "_gate",
local branch = if downstream_branch == "release/graal-vm/24.0" then "release/graal-vm/24.0" else downstream_branch + "_gate",

run+: [
["git", "clone", defs.graal_enterprise_url],
Expand Down
3 changes: 2 additions & 1 deletion src/hotspot/cpu/x86/assembler_x86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -920,6 +920,7 @@ address Assembler::locate_operand(address inst, WhichOperand which) {
case 0x11: // movups
case 0x12: // movlps
case 0x28: // movaps
case 0x29: // movaps
case 0x2E: // ucomiss
case 0x2F: // comiss
case 0x54: // andps
Expand Down Expand Up @@ -969,7 +970,7 @@ address Assembler::locate_operand(address inst, WhichOperand which) {
assert(which == call32_operand, "jcc has no disp32 or imm");
return ip;
default:
ShouldNotReachHere();
fatal("not handled: 0x0F%2X", 0xFF & *(ip-1));
}
break;

Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/cds/cdsConfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class CDSConfig : public AllStatic {
static void initialize() NOT_CDS_RETURN;
static void check_system_property(const char* key, const char* value) NOT_CDS_RETURN;
static void check_unsupported_dumping_properties() NOT_CDS_RETURN;
static bool check_vm_args_consistency(bool patch_mod_javabase, bool mode_flag_cmd_line) NOT_CDS_RETURN_(false);
static bool check_vm_args_consistency(bool patch_mod_javabase, bool mode_flag_cmd_line) NOT_CDS_RETURN_(true);

// Basic CDS features
static bool is_dumping_archive() { return is_dumping_static_archive() || is_dumping_dynamic_archive(); }
Expand Down
5 changes: 4 additions & 1 deletion src/hotspot/share/prims/unsafe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,10 @@ UNSAFE_ENTRY_SCOPED(void, Unsafe_SetMemory0(JNIEnv *env, jobject unsafe, jobject
oop base = JNIHandles::resolve(obj);
void* p = index_oop_from_field_offset_long(base, offset);

Copy::fill_to_memory_atomic(p, sz, value);
{
GuardUnsafeAccess guard(thread);
Copy::fill_to_memory_atomic(p, sz, value);
}
} UNSAFE_END

UNSAFE_ENTRY_SCOPED(void, Unsafe_CopyMemory0(JNIEnv *env, jobject unsafe, jobject srcObj, jlong srcOffset, jobject dstObj, jlong dstOffset, jlong size)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ default ModuleAttributeBuilder moduleFlags(AccessFlag... moduleFlags) {
}

/**
* Sets the module flags
* Sets the module version
* @param version the module version
* @return this builder
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,9 @@ public sealed interface MemoryLayout
* <li>The accessed memory segment must be
* {@link MemorySegment#isAccessibleBy(Thread) accessible} from the thread
* performing the access operation, or a {@link WrongThreadException} is thrown.</li>
* <li>For write operations, the accessed memory segment must not be
* {@link MemorySegment#isReadOnly() read only}, or an
* {@link IllegalArgumentException} is thrown.</li>
* <li>The {@linkplain MemorySegment#scope() scope} associated with the accessed
* segment must be {@linkplain MemorySegment.Scope#isAlive() alive}, or an
* {@link IllegalStateException} is thrown.</li>
Expand Down
52 changes: 30 additions & 22 deletions src/java.base/share/classes/java/lang/foreign/MemorySegment.java
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,7 @@ MemorySegment reinterpret(long newSize,
* this segment is not {@linkplain Scope#isAlive() alive}
* @throws WrongThreadException if this method is called from a thread {@code T},
* such that {@code isAccessibleBy(T) == false}
* @throws UnsupportedOperationException if this segment is
* @throws IllegalArgumentException if this segment is
* {@linkplain #isReadOnly() read-only}
*/
MemorySegment fill(byte value);
Expand All @@ -894,7 +894,7 @@ MemorySegment reinterpret(long newSize,
* {@code src} is not {@linkplain Scope#isAlive() alive}
* @throws WrongThreadException if this method is called from a thread {@code T},
* such that {@code src.isAccessibleBy(T) == false}
* @throws UnsupportedOperationException if this segment is
* @throws IllegalArgumentException if this segment is
* {@linkplain #isReadOnly() read-only}
* @return this segment
*/
Expand Down Expand Up @@ -1269,6 +1269,8 @@ MemorySegment reinterpret(long newSize,
* this segment is not {@linkplain Scope#isAlive() alive}
* @throws WrongThreadException if this method is called from a thread {@code T},
* such that {@code isAccessibleBy(T) == false}
* @throws IllegalArgumentException if this segment is
* {@linkplain #isReadOnly() read-only}
*/
void setString(long offset, String str);

Expand Down Expand Up @@ -1306,6 +1308,8 @@ MemorySegment reinterpret(long newSize,
* such that {@code isAccessibleBy(T) == false}
* @throws IllegalArgumentException if {@code charset} is not a
* {@linkplain StandardCharsets standard charset}
* @throws IllegalArgumentException if this segment is
* {@linkplain #isReadOnly() read-only}
*/
void setString(long offset, String str, Charset charset);

Expand Down Expand Up @@ -1493,7 +1497,7 @@ static MemorySegment ofAddress(long address) {
* @throws IndexOutOfBoundsException if {@code dstOffset > dstSegment.byteSize() - bytes}
* @throws IndexOutOfBoundsException if either {@code srcOffset},
* {@code dstOffset} or {@code bytes} are {@code < 0}
* @throws UnsupportedOperationException if {@code dstSegment} is
* @throws IllegalArgumentException if {@code dstSegment} is
* {@linkplain #isReadOnly() read-only}
*/
@ForceInline
Expand Down Expand Up @@ -1552,7 +1556,7 @@ static void copy(MemorySegment srcSegment, long srcOffset,
* {@code dstSegment} is not {@linkplain Scope#isAlive() alive}
* @throws WrongThreadException if this method is called from a thread {@code T},
* such that {@code dstSegment.isAccessibleBy(T) == false}
* @throws UnsupportedOperationException if {@code dstSegment} is {@linkplain #isReadOnly() read-only}
* @throws IllegalArgumentException if {@code dstSegment} is {@linkplain #isReadOnly() read-only}
* @throws IndexOutOfBoundsException if {@code elementCount * srcLayout.byteSize()} overflows
* @throws IndexOutOfBoundsException if {@code elementCount * dtsLayout.byteSize()} overflows
* @throws IndexOutOfBoundsException if {@code srcOffset > srcSegment.byteSize() - (elementCount * srcLayout.byteSize())}
Expand Down Expand Up @@ -1605,7 +1609,7 @@ static void copy(MemorySegment srcSegment, ValueLayout srcElementLayout, long sr
* <a href="MemorySegment.html#segment-alignment">incompatible with the alignment constraint</a>
* in the provided layout
* @throws IndexOutOfBoundsException if {@code offset > byteSize() - layout.byteSize()}
* @throws UnsupportedOperationException if this segment is
* @throws IllegalArgumentException if this segment is
* {@linkplain #isReadOnly() read-only}
*/
void set(ValueLayout.OfByte layout, long offset, byte value);
Expand Down Expand Up @@ -1643,7 +1647,7 @@ static void copy(MemorySegment srcSegment, ValueLayout srcElementLayout, long sr
* <a href="MemorySegment.html#segment-alignment">incompatible with the alignment constraint</a>
* in the provided layout
* @throws IndexOutOfBoundsException if {@code offset > byteSize() - layout.byteSize()}
* @throws UnsupportedOperationException if this segment is
* @throws IllegalArgumentException if this segment is
* {@linkplain #isReadOnly() read-only}
*/
void set(ValueLayout.OfBoolean layout, long offset, boolean value);
Expand Down Expand Up @@ -1681,7 +1685,7 @@ static void copy(MemorySegment srcSegment, ValueLayout srcElementLayout, long sr
* <a href="MemorySegment.html#segment-alignment">incompatible with the alignment constraint</a>
* in the provided layout
* @throws IndexOutOfBoundsException if {@code offset > byteSize() - layout.byteSize()}
* @throws UnsupportedOperationException if this segment is
* @throws IllegalArgumentException if this segment is
* {@linkplain #isReadOnly() read-only}
*/
void set(ValueLayout.OfChar layout, long offset, char value);
Expand Down Expand Up @@ -1719,7 +1723,7 @@ static void copy(MemorySegment srcSegment, ValueLayout srcElementLayout, long sr
* <a href="MemorySegment.html#segment-alignment">incompatible with the alignment constraint</a>
* in the provided layout
* @throws IndexOutOfBoundsException if {@code offset > byteSize() - layout.byteSize()}
* @throws UnsupportedOperationException if this segment is
* @throws IllegalArgumentException if this segment is
* {@linkplain #isReadOnly() read-only}
*/
void set(ValueLayout.OfShort layout, long offset, short value);
Expand Down Expand Up @@ -1757,7 +1761,7 @@ static void copy(MemorySegment srcSegment, ValueLayout srcElementLayout, long sr
* <a href="MemorySegment.html#segment-alignment">incompatible with the alignment constraint</a>
* in the provided layout
* @throws IndexOutOfBoundsException if {@code offset > byteSize() - layout.byteSize()}
* @throws UnsupportedOperationException if this segment is
* @throws IllegalArgumentException if this segment is
* {@linkplain #isReadOnly() read-only}
*/
void set(ValueLayout.OfInt layout, long offset, int value);
Expand Down Expand Up @@ -1795,7 +1799,7 @@ static void copy(MemorySegment srcSegment, ValueLayout srcElementLayout, long sr
* <a href="MemorySegment.html#segment-alignment">incompatible with the alignment constraint</a>
* in the provided layout
* @throws IndexOutOfBoundsException if {@code offset > byteSize() - layout.byteSize()}
* @throws UnsupportedOperationException if this segment is
* @throws IllegalArgumentException if this segment is
* {@linkplain #isReadOnly() read-only}
*/
void set(ValueLayout.OfFloat layout, long offset, float value);
Expand Down Expand Up @@ -1833,7 +1837,7 @@ static void copy(MemorySegment srcSegment, ValueLayout srcElementLayout, long sr
* <a href="MemorySegment.html#segment-alignment">incompatible with the alignment constraint</a>
* in the provided layout
* @throws IndexOutOfBoundsException if {@code offset > byteSize() - layout.byteSize()}
* @throws UnsupportedOperationException if this segment is
* @throws IllegalArgumentException if this segment is
* {@linkplain #isReadOnly() read-only}
*/
void set(ValueLayout.OfLong layout, long offset, long value);
Expand Down Expand Up @@ -1871,7 +1875,7 @@ static void copy(MemorySegment srcSegment, ValueLayout srcElementLayout, long sr
* <a href="MemorySegment.html#segment-alignment">incompatible with the alignment constraint</a>
* in the provided layout
* @throws IndexOutOfBoundsException if {@code offset > byteSize() - layout.byteSize()}
* @throws UnsupportedOperationException if this segment is
* @throws IllegalArgumentException if this segment is
* {@linkplain #isReadOnly() read-only}
*/
void set(ValueLayout.OfDouble layout, long offset, double value);
Expand Down Expand Up @@ -1921,8 +1925,10 @@ static void copy(MemorySegment srcSegment, ValueLayout srcElementLayout, long sr
* @throws IndexOutOfBoundsException if {@code offset > byteSize() - layout.byteSize()}
* @throws UnsupportedOperationException if this segment is
* {@linkplain #isReadOnly() read-only}
* @throws UnsupportedOperationException if {@code value} is not a
* @throws IllegalArgumentException if {@code value} is not a
* {@linkplain #isNative() native} segment
* @throws IllegalArgumentException if this segment is
* {@linkplain #isReadOnly() read-only}
*/
void set(AddressLayout layout, long offset, MemorySegment value);

Expand Down Expand Up @@ -2055,7 +2061,7 @@ static void copy(MemorySegment srcSegment, ValueLayout srcElementLayout, long sr
* @throws IllegalArgumentException if {@code layout.byteAlignment() > layout.byteSize()}
* @throws IndexOutOfBoundsException if {@code index * layout.byteSize()} overflows
* @throws IndexOutOfBoundsException if {@code index * layout.byteSize() > byteSize() - layout.byteSize()}
* @throws UnsupportedOperationException if this segment is {@linkplain #isReadOnly() read-only}
* @throws IllegalArgumentException if this segment is {@linkplain #isReadOnly() read-only}
*/
void setAtIndex(ValueLayout.OfByte layout, long index, byte value);

Expand All @@ -2078,7 +2084,7 @@ static void copy(MemorySegment srcSegment, ValueLayout srcElementLayout, long sr
* @throws IllegalArgumentException if {@code layout.byteAlignment() > layout.byteSize()}
* @throws IndexOutOfBoundsException if {@code index * layout.byteSize()} overflows
* @throws IndexOutOfBoundsException if {@code index * layout.byteSize() > byteSize() - layout.byteSize()}
* @throws UnsupportedOperationException if this segment is {@linkplain #isReadOnly() read-only}
* @throws IllegalArgumentException if this segment is {@linkplain #isReadOnly() read-only}
*/
void setAtIndex(ValueLayout.OfBoolean layout, long index, boolean value);

Expand All @@ -2101,7 +2107,7 @@ static void copy(MemorySegment srcSegment, ValueLayout srcElementLayout, long sr
* @throws IllegalArgumentException if {@code layout.byteAlignment() > layout.byteSize()}
* @throws IndexOutOfBoundsException if {@code index * layout.byteSize()} overflows
* @throws IndexOutOfBoundsException if {@code index * layout.byteSize() > byteSize() - layout.byteSize()}
* @throws UnsupportedOperationException if this segment is {@linkplain #isReadOnly() read-only}
* @throws IllegalArgumentException if this segment is {@linkplain #isReadOnly() read-only}
*/
void setAtIndex(ValueLayout.OfShort layout, long index, short value);

Expand Down Expand Up @@ -2146,7 +2152,7 @@ static void copy(MemorySegment srcSegment, ValueLayout srcElementLayout, long sr
* @throws IllegalArgumentException if {@code layout.byteAlignment() > layout.byteSize()}
* @throws IndexOutOfBoundsException if {@code index * layout.byteSize()} overflows
* @throws IndexOutOfBoundsException if {@code index * layout.byteSize() > byteSize() - layout.byteSize()}
* @throws UnsupportedOperationException if this segment is {@linkplain #isReadOnly() read-only}
* @throws IllegalArgumentException if this segment is {@linkplain #isReadOnly() read-only}
*/
void setAtIndex(ValueLayout.OfInt layout, long index, int value);

Expand Down Expand Up @@ -2191,7 +2197,7 @@ static void copy(MemorySegment srcSegment, ValueLayout srcElementLayout, long sr
* @throws IllegalArgumentException if {@code layout.byteAlignment() > layout.byteSize()}
* @throws IndexOutOfBoundsException if {@code index * layout.byteSize()} overflows
* @throws IndexOutOfBoundsException if {@code index * layout.byteSize() > byteSize() - layout.byteSize()}
* @throws UnsupportedOperationException if this segment is {@linkplain #isReadOnly() read-only}
* @throws IllegalArgumentException if this segment is {@linkplain #isReadOnly() read-only}
*/
void setAtIndex(ValueLayout.OfFloat layout, long index, float value);

Expand Down Expand Up @@ -2236,7 +2242,7 @@ static void copy(MemorySegment srcSegment, ValueLayout srcElementLayout, long sr
* @throws IllegalArgumentException if {@code layout.byteAlignment() > layout.byteSize()}
* @throws IndexOutOfBoundsException if {@code index * layout.byteSize()} overflows
* @throws IndexOutOfBoundsException if {@code index * layout.byteSize() > byteSize() - layout.byteSize()}
* @throws UnsupportedOperationException if this segment is {@linkplain #isReadOnly() read-only}
* @throws IllegalArgumentException if this segment is {@linkplain #isReadOnly() read-only}
*/
void setAtIndex(ValueLayout.OfLong layout, long index, long value);

Expand Down Expand Up @@ -2281,7 +2287,7 @@ static void copy(MemorySegment srcSegment, ValueLayout srcElementLayout, long sr
* @throws IllegalArgumentException if {@code layout.byteAlignment() > layout.byteSize()}
* @throws IndexOutOfBoundsException if {@code index * layout.byteSize()} overflows
* @throws IndexOutOfBoundsException if {@code index * layout.byteSize() > byteSize() - layout.byteSize()}
* @throws UnsupportedOperationException if this segment is {@linkplain #isReadOnly() read-only}
* @throws IllegalArgumentException if this segment is {@linkplain #isReadOnly() read-only}
*/
void setAtIndex(ValueLayout.OfDouble layout, long index, double value);

Expand Down Expand Up @@ -2336,7 +2342,9 @@ static void copy(MemorySegment srcSegment, ValueLayout srcElementLayout, long sr
* @throws IndexOutOfBoundsException if {@code index * layout.byteSize()} overflows
* @throws IndexOutOfBoundsException if {@code index * layout.byteSize() > byteSize() - layout.byteSize()}
* @throws UnsupportedOperationException if this segment is {@linkplain #isReadOnly() read-only}
* @throws UnsupportedOperationException if {@code value} is not a {@linkplain #isNative() native} segment
* @throws IllegalArgumentException if {@code value} is not a {@linkplain #isNative() native} segment
* @throws IllegalArgumentException if this segment is
* {@linkplain #isReadOnly() read-only}
*/
void setAtIndex(AddressLayout layout, long index, MemorySegment value);

Expand Down Expand Up @@ -2460,7 +2468,7 @@ static void copy(MemorySegment srcSegment, ValueLayout srcLayout, long srcOffset
* <a href="MemorySegment.html#segment-alignment">incompatible with the alignment constraint</a>
* in the source element layout
* @throws IllegalArgumentException if {@code dstLayout.byteAlignment() > dstLayout.byteSize()}
* @throws UnsupportedOperationException if {@code dstSegment} is {@linkplain #isReadOnly() read-only}
* @throws IllegalArgumentException if {@code dstSegment} is {@linkplain #isReadOnly() read-only}
* @throws IndexOutOfBoundsException if {@code elementCount * dstLayout.byteSize()} overflows
* @throws IndexOutOfBoundsException if {@code dstOffset > dstSegment.byteSize() - (elementCount * dstLayout.byteSize())}
* @throws IndexOutOfBoundsException if {@code srcIndex > srcArray.length - elementCount}
Expand Down
Loading

0 comments on commit df24566

Please sign in to comment.