Skip to content

[GR-66705][GR-66912]: Backport to 25.0: GraalPy backports. #11739

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion graal-common.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"README": "This file contains definitions that are useful for the jsonnet CI files of the graal and graal-enterprise repositories.",
"ci": {
"overlay": "2a8921f5fd0a66b67c5988e802b883b8f6a6c26d"
"overlay": "907f84a98fe5736824d2964e8815d75d0511d39d"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -403,9 +403,9 @@ abstract static class SerializeSerializableNode extends SerializeArgumentNode {
super(type);
}

@Specialization(limit = "3", guards = "serialize.isSerializable(arg)")
@Specialization(guards = "serialize.isSerializable(arg)")
void doSerializable(Object arg, NativeArgumentBuffer buffer,
@CachedLibrary("arg") SerializableLibrary serialize) {
@CachedLibrary(limit = "4") SerializableLibrary serialize) {
BufferSlice b = new BufferSlice(buffer, buffer.position(), type.size);
try {
serialize.serialize(arg, b);
Expand All @@ -422,21 +422,21 @@ abstract static class SerializePointerNode extends SerializeArgumentNode {
super(type);
}

@Specialization(limit = "3", guards = "interop.isPointer(arg)", rewriteOn = UnsupportedMessageException.class)
@Specialization(guards = "interop.isPointer(arg)", rewriteOn = UnsupportedMessageException.class)
void putPointer(Object arg, NativeArgumentBuffer buffer,
@CachedLibrary("arg") InteropLibrary interop) throws UnsupportedMessageException {
@Shared @CachedLibrary(limit = "3") InteropLibrary interop) throws UnsupportedMessageException {
buffer.putPointerKeepalive(arg, interop.asPointer(arg), type.size);
}

@Specialization(limit = "3", guards = {"!interop.isPointer(arg)", "interop.isNull(arg)"})
@Specialization(guards = {"!interop.isPointer(arg)", "interop.isNull(arg)"})
void putNull(@SuppressWarnings("unused") Object arg, NativeArgumentBuffer buffer,
@SuppressWarnings("unused") @CachedLibrary("arg") InteropLibrary interop) {
@SuppressWarnings("unused") @Shared @CachedLibrary(limit = "3") InteropLibrary interop) {
buffer.putPointer(0, type.size);
}

@Specialization(limit = "3", replaces = {"putPointer", "putNull"})
@Specialization(replaces = {"putPointer", "putNull"})
static void putGeneric(Object arg, NativeArgumentBuffer buffer,
@CachedLibrary("arg") InteropLibrary interop,
@Shared @CachedLibrary(limit = "3") InteropLibrary interop,
@Bind Node node,
@Bind("type.size") int size,
@Cached InlinedBranchProfile exception) throws UnsupportedTypeException {
Expand Down Expand Up @@ -483,27 +483,27 @@ abstract static class SerializeStringNode extends SerializeArgumentNode {
super(type);
}

@Specialization(limit = "3", guards = "interop.isPointer(value)", rewriteOn = UnsupportedMessageException.class)
@Specialization(guards = "interop.isPointer(value)", rewriteOn = UnsupportedMessageException.class)
void putPointer(Object value, NativeArgumentBuffer buffer,
@CachedLibrary("value") InteropLibrary interop) throws UnsupportedMessageException {
@Shared @CachedLibrary(limit = "3") InteropLibrary interop) throws UnsupportedMessageException {
buffer.putPointerKeepalive(value, interop.asPointer(value), type.size);
}

@Specialization(limit = "3", guards = {"!interop.isPointer(value)", "interop.isString(value)"}, rewriteOn = UnsupportedMessageException.class)
@Specialization(guards = {"!interop.isPointer(value)", "interop.isString(value)"}, rewriteOn = UnsupportedMessageException.class)
void putString(Object value, NativeArgumentBuffer buffer,
@CachedLibrary("value") InteropLibrary interop) throws UnsupportedMessageException {
@Shared @CachedLibrary(limit = "3") InteropLibrary interop) throws UnsupportedMessageException {
buffer.putObject(TypeTag.STRING, interop.asString(value), type.size);
}

@Specialization(limit = "3", guards = {"!interop.isPointer(value)", "!interop.isString(value)", "interop.isNull(value)"})
@Specialization(guards = {"!interop.isPointer(value)", "!interop.isString(value)", "interop.isNull(value)"})
void putNull(@SuppressWarnings("unused") Object value, NativeArgumentBuffer buffer,
@SuppressWarnings("unused") @CachedLibrary("value") InteropLibrary interop) {
@SuppressWarnings("unused") @Shared @CachedLibrary(limit = "3") InteropLibrary interop) {
buffer.putPointer(0, type.size);
}

@Specialization(limit = "3", replaces = {"putPointer", "putString", "putNull"})
@Specialization(replaces = {"putPointer", "putString", "putNull"})
static void putGeneric(Object value, NativeArgumentBuffer buffer,
@CachedLibrary("value") InteropLibrary interop,
@Shared @CachedLibrary(limit = "3") InteropLibrary interop,
@Bind Node node,
@Bind("type.size") int size,
@Cached InlinedBranchProfile exception) throws UnsupportedTypeException {
Expand Down Expand Up @@ -555,9 +555,9 @@ abstract static class SerializeNullableNode extends SerializeArgumentNode {
super(type);
}

@Specialization(limit = "3")
@Specialization
void putObject(Object value, NativeArgumentBuffer buffer,
@CachedLibrary("value") InteropLibrary interop) {
@CachedLibrary(limit = "3") InteropLibrary interop) {
if (interop.isNull(value)) {
buffer.putPointer(0L, type.size);
} else {
Expand Down
Loading