Skip to content
Open
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
14 changes: 7 additions & 7 deletions ci/graal/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"Jsonnet files should not include this file directly but use ci/common.jsonnet instead."
],

"mx_version": "7.67.0",
"mx_version": "7.67.2",

"COMMENT.jdks": "When adding or removing JDKs keep in sync with JDKs in ci/common.jsonnet",
"jdks": {
Expand Down Expand Up @@ -49,12 +49,12 @@
"graalvm-ee-25-ea": {"name": "graalvm-jdk", "version": "25.0.0", "ea": "36", "platformspecific": true },

"oraclejdk-latest": {"name": "jpg-jdk", "version": "25", "build_id": "jdk-25.0.1+8", "platformspecific": true, "extrabundles": ["static-libs"]},
"labsjdk-ce-latest": {"name": "labsjdk", "version": "ce-25.0.1+8-jvmci-25.1-b08", "platformspecific": true },
"labsjdk-ce-latestDebug": {"name": "labsjdk", "version": "ce-25.0.1+8-jvmci-25.1-b08-debug", "platformspecific": true },
"labsjdk-ce-latest-llvm": {"name": "labsjdk", "version": "ce-25.0.1+8-jvmci-25.1-b08-sulong", "platformspecific": true },
"labsjdk-ee-latest": {"name": "labsjdk", "version": "ee-25.0.1+8-jvmci-25.1-b08", "platformspecific": true },
"labsjdk-ee-latestDebug": {"name": "labsjdk", "version": "ee-25.0.1+8-jvmci-25.1-b08-debug", "platformspecific": true },
"labsjdk-ee-latest-llvm": {"name": "labsjdk", "version": "ee-25.0.1+8-jvmci-25.1-b08-sulong", "platformspecific": true }
"labsjdk-ce-latest": {"name": "labsjdk", "version": "ce-25.0.1+8-jvmci-25.1-b09", "platformspecific": true },
"labsjdk-ce-latestDebug": {"name": "labsjdk", "version": "ce-25.0.1+8-jvmci-25.1-b09-debug", "platformspecific": true },
"labsjdk-ce-latest-llvm": {"name": "labsjdk", "version": "ce-25.0.1+8-jvmci-25.1-b09-sulong", "platformspecific": true },
"labsjdk-ee-latest": {"name": "labsjdk", "version": "ee-25.0.1+8-jvmci-25.1-b09", "platformspecific": true },
"labsjdk-ee-latestDebug": {"name": "labsjdk", "version": "ee-25.0.1+8-jvmci-25.1-b09-debug", "platformspecific": true },
"labsjdk-ee-latest-llvm": {"name": "labsjdk", "version": "ee-25.0.1+8-jvmci-25.1-b09-sulong", "platformspecific": true }
},

"eclipse": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,8 @@
import com.oracle.truffle.api.dsl.Cached;
import com.oracle.truffle.api.dsl.Cached.Shared;
import com.oracle.truffle.api.dsl.Specialization;
import com.oracle.truffle.api.library.CachedLibrary;
import com.oracle.truffle.api.nodes.Node;
import com.oracle.truffle.api.object.DynamicObjectLibrary;
import com.oracle.truffle.api.object.DynamicObject;

public final class PythonCextNamespaceBuiltins {

Expand All @@ -78,20 +77,20 @@ static Object impDict(PDict dict,
@Shared("itNext") @Cached HashingStorageIteratorNext itNext,
@Shared("itKey") @Cached HashingStorageIteratorKey itKey,
@Shared("itVal") @Cached HashingStorageIteratorValue itValue,
@Shared("dylib") @CachedLibrary(limit = "1") DynamicObjectLibrary dyLib) {
@Shared @Cached DynamicObject.PutNode putNode) {
HashingStorage storage = dict.getDictStorage();
return impl(inliningTarget, storage, getIterator, itNext, itKey, itValue, dyLib);
return impl(inliningTarget, storage, getIterator, itNext, itKey, itValue, putNode);
}

private static Object impl(Node inliningTarget, HashingStorage storage, HashingStorageGetIterator getIterator, HashingStorageIteratorNext itNext,
HashingStorageIteratorKey itKey, HashingStorageIteratorValue itValue,
DynamicObjectLibrary dyLib) {
DynamicObject.PutNode putNode) {
PSimpleNamespace ns = PFactory.createSimpleNamespace(PythonLanguage.get(inliningTarget));
HashingStorageNodes.HashingStorageIterator it = getIterator.execute(inliningTarget, storage);
while (itNext.execute(inliningTarget, storage, it)) {
Object key = itKey.execute(inliningTarget, storage, it);
Object value = itValue.execute(inliningTarget, storage, it);
dyLib.put(ns, assertNoJavaString(key), value);
putNode.execute(ns, assertNoJavaString(key), value);
}
return ns;
}
Expand All @@ -104,9 +103,9 @@ static Object impGeneric(Object dict,
@Shared("itNext") @Cached HashingStorageIteratorNext itNext,
@Shared("itKey") @Cached HashingStorageIteratorKey itKey,
@Shared("itVal") @Cached HashingStorageIteratorValue itValue,
@Shared("dylib") @CachedLibrary(limit = "1") DynamicObjectLibrary dyLib) {
@Shared @Cached DynamicObject.PutNode putNode) {
HashingStorage hs = initNode.execute(null, dict, PKeyword.EMPTY_KEYWORDS);
return impl(inliningTarget, hs, getIterator, itNext, itKey, itValue, dyLib);
return impl(inliningTarget, hs, getIterator, itNext, itKey, itValue, putNode);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
import com.oracle.truffle.api.interop.InteropLibrary;
import com.oracle.truffle.api.library.CachedLibrary;
import com.oracle.truffle.api.nodes.Node;
import com.oracle.truffle.api.object.DynamicObjectLibrary;
import com.oracle.truffle.api.object.DynamicObject;
import com.oracle.truffle.api.strings.TruffleString;

public final class PythonCextStructSeqBuiltins {
Expand Down Expand Up @@ -139,16 +139,17 @@ abstract static class GraalPyPrivate_StructSequence_NewType extends CApiQuaterna
Object doGeneric(TruffleString typeName, TruffleString typeDoc, Object fields, int nInSequence,
@Cached GraalPyPrivate_StructSequence_InitType2 initNode,
@Cached ReadAttributeFromModuleNode readTypeBuiltinNode,
@CachedLibrary(limit = "1") DynamicObjectLibrary dylib,
@Cached DynamicObject.GetShapeFlagsNode getShapeFlagsNode,
@Cached DynamicObject.SetShapeFlagsNode setShapeFlagsNode,
@Cached CallNode callTypeNewNode,
@Bind PythonLanguage language) {
Object typeBuiltin = readTypeBuiltinNode.execute(getCore().getBuiltins(), BuiltinNames.T_TYPE);
PTuple bases = PFactory.createTuple(language, new Object[]{PythonBuiltinClassType.PTuple});
PDict namespace = PFactory.createDict(language, new PKeyword[]{new PKeyword(SpecialAttributeNames.T___DOC__, typeDoc)});
Object cls = callTypeNewNode.executeWithoutFrame(typeBuiltin, typeName, bases, namespace);
initNode.execute(cls, fields, nInSequence);
if (cls instanceof PythonClass) {
((PythonClass) cls).makeStaticBase(dylib);
if (cls instanceof PythonClass pythonClass) {
pythonClass.makeStaticBase(getShapeFlagsNode, setShapeFlagsNode);
}
return cls;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@
import com.oracle.truffle.api.nodes.Node;
import com.oracle.truffle.api.nodes.RootNode;
import com.oracle.truffle.api.object.DynamicObject;
import com.oracle.truffle.api.object.DynamicObjectLibrary;
import com.oracle.truffle.api.object.Shape;
import com.oracle.truffle.api.strings.TruffleString;
import com.oracle.truffle.api.utilities.CyclicAssumption;
Expand All @@ -143,7 +142,8 @@ Object doGeneric(Object type, Object name,
@Cached PythonCextBuiltins.PromoteBorrowedValue promoteBorrowedValue,
@Cached CStructAccess.ReadObjectNode getNativeDict,
@Cached GetDictIfExistsNode getDictIfExistsNode,
@CachedLibrary(limit = "3") DynamicObjectLibrary dylib,
@Cached DynamicObject.GetNode getNode,
@Cached DynamicObject.PutNode putNode,
@Cached PyDictGetItem getItem,
@Cached PyDictSetItem setItem) {
TruffleString key = castToTruffleStringNode.castKnownString(inliningTarget, name);
Expand All @@ -165,15 +165,15 @@ Object doGeneric(Object type, Object name,
}
Object value;
if (dict == null) {
value = dylib.getOrDefault((DynamicObject) cls, key, null);
value = getNode.execute((PythonManagedClass) cls, key, null);
} else {
value = getItem.execute(null, inliningTarget, dict, key);
}
if (value != null && value != PNone.NO_VALUE) {
Object promoted = promoteBorrowedValue.execute(inliningTarget, value);
if (promoted != null) {
if (dict == null) {
dylib.put((DynamicObject) cls, key, promoted);
putNode.execute((PythonManagedClass) cls, key, promoted);
} else {
setItem.execute(null, inliningTarget, dict, key, promoted);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,12 @@
import com.oracle.truffle.api.dsl.GenerateInline;
import com.oracle.truffle.api.dsl.GenerateUncached;
import com.oracle.truffle.api.dsl.ImportStatic;
import com.oracle.truffle.api.dsl.NeverDefault;
import com.oracle.truffle.api.dsl.Specialization;
import com.oracle.truffle.api.frame.Frame;
import com.oracle.truffle.api.library.CachedLibrary;
import com.oracle.truffle.api.nodes.ExplodeLoop;
import com.oracle.truffle.api.nodes.ExplodeLoop.LoopExplosionKind;
import com.oracle.truffle.api.nodes.Node;
import com.oracle.truffle.api.object.DynamicObject;
import com.oracle.truffle.api.object.DynamicObjectLibrary;
import com.oracle.truffle.api.object.Shape;
import com.oracle.truffle.api.profiles.InlinedBranchProfile;
import com.oracle.truffle.api.profiles.InlinedConditionProfile;
Expand Down Expand Up @@ -296,8 +293,8 @@ private static void invalidateAttributeInMROFinalAssumptions(MroSequenceStorage
}
}

void setStringKey(TruffleString key, Object value, DynamicObjectLibrary dylib, Node inliningTarget, InlinedBranchProfile invalidateMroProfile) {
dylib.put(store, key, assertNoJavaString(value));
void setStringKey(TruffleString key, Object value, DynamicObject.PutNode putNode, Node inliningTarget, InlinedBranchProfile invalidateMroProfile) {
putNode.execute(store, key, assertNoJavaString(value));
invalidateAttributeInMROFinalAssumption(key, inliningTarget, invalidateMroProfile);
}

Expand All @@ -322,8 +319,8 @@ abstract static class ClearNode extends Node {

@Specialization(guards = "!isPythonObject(receiver.getStore())")
static HashingStorage clearPlain(DynamicObjectStorage receiver,
@CachedLibrary(limit = "3") DynamicObjectLibrary dylib) {
dylib.resetShape(receiver.getStore(), PythonLanguage.get(dylib).getEmptyShape());
@Cached DynamicObject.ResetShapeNode resetShapeNode) {
resetShapeNode.execute(receiver.getStore(), PythonLanguage.get(resetShapeNode).getEmptyShape());
return receiver;
}

Expand Down Expand Up @@ -351,39 +348,12 @@ static HashingStorage clearObjectBacked(Node inliningTarget, DynamicObjectStorag
abstract static class Copy extends Node {
abstract DynamicObjectStorage execute(Node node, DynamicObjectStorage receiver);

@NeverDefault
static DynamicObjectLibrary[] createAccess(int length) {
DynamicObjectLibrary[] result = new DynamicObjectLibrary[length];
for (int i = 0; i < length; i++) {
result[i] = DynamicObjectLibrary.getFactory().createDispatched(1);
}
return result;
}

@ExplodeLoop
@Specialization(limit = "1", guards = {"cachedLength < EXPLODE_LOOP_SIZE_LIMIT", "keys.length == cachedLength"})
@Specialization
public static DynamicObjectStorage copy(DynamicObjectStorage receiver,
@SuppressWarnings("unused") @Bind("receiver.store") DynamicObject store,
@SuppressWarnings("unused") @CachedLibrary("store") DynamicObjectLibrary dylib,
@Bind("dylib.getKeyArray(store)") Object[] keys,
@Cached(value = "keys.length") int cachedLength,
@Cached("createAccess(cachedLength)") DynamicObjectLibrary[] readLib,
@Cached("createAccess(cachedLength)") DynamicObjectLibrary[] writeLib) {
DynamicObject copy = new Store(PythonLanguage.get(dylib).getEmptyShape());
for (int i = 0; i < cachedLength; i++) {
writeLib[i].put(copy, keys[i], readLib[i].getOrDefault(receiver.store, keys[i], PNone.NO_VALUE));
}
return new DynamicObjectStorage(copy);
}

@Specialization(replaces = "copy")
public static DynamicObjectStorage copyGeneric(DynamicObjectStorage receiver,
@CachedLibrary(limit = "3") DynamicObjectLibrary dylib) {
DynamicObject copy = new Store(PythonLanguage.get(dylib).getEmptyShape());
Object[] keys = dylib.getKeyArray(receiver.store);
for (Object key : keys) {
dylib.put(copy, key, dylib.getOrDefault(receiver.store, key, PNone.NO_VALUE));
}
@Bind Node inliningTarget,
@Cached DynamicObject.CopyPropertiesNode copyPropertiesNode) {
DynamicObject copy = new Store(PythonLanguage.get(inliningTarget).getEmptyShape());
copyPropertiesNode.execute(receiver.store, copy);
return new DynamicObjectStorage(copy);
}
}
Expand All @@ -394,9 +364,9 @@ public static DynamicObjectStorage copyGeneric(DynamicObjectStorage receiver,
public abstract static class DynamicObjectStorageSetStringKey extends SpecializedSetStringKey {
@Specialization
static void doIt(Node inliningTarget, HashingStorage self, TruffleString key, Object value,
@CachedLibrary(limit = "3") DynamicObjectLibrary dylib,
@Cached DynamicObject.PutNode putNode,
@Cached InlinedBranchProfile invalidateMro) {
((DynamicObjectStorage) self).setStringKey(key, value, dylib, inliningTarget, invalidateMro);
((DynamicObjectStorage) self).setStringKey(key, value, putNode, inliningTarget, invalidateMro);
}
}
}
Loading