Skip to content
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
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021, 2026, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* The Universal Permissive License (UPL), Version 1.0
Expand Down Expand Up @@ -139,7 +139,6 @@ 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,
@Cached DynamicObject.GetShapeFlagsNode getShapeFlagsNode,
@Cached DynamicObject.SetShapeFlagsNode setShapeFlagsNode,
@Cached CallNode callTypeNewNode,
@Bind PythonLanguage language) {
Expand All @@ -149,7 +148,7 @@ Object doGeneric(TruffleString typeName, TruffleString typeDoc, Object fields, i
Object cls = callTypeNewNode.executeWithoutFrame(typeBuiltin, typeName, bases, namespace);
initNode.execute(cls, fields, nInSequence);
if (cls instanceof PythonClass pythonClass) {
pythonClass.makeStaticBase(getShapeFlagsNode, setShapeFlagsNode);
pythonClass.makeStaticBase(setShapeFlagsNode);
}
return cls;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,4 @@ public String toString() {
public static int getCallSiteInlineCacheMaxDepth() {
return PythonOptions.getCallSiteInlineCacheMaxDepth();
}

public final void addShapeFlag(int flag, DynamicObject.GetShapeFlagsNode getShapeFlagsNode, DynamicObject.SetShapeFlagsNode setShapeFlagsNode) {
int oldFlags = getShapeFlagsNode.execute(this);
int newFlags = oldFlags | flag;
if (newFlags != oldFlags) {
setShapeFlagsNode.execute(this, newFlags);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2025, Oracle and/or its affiliates.
* Copyright (c) 2017, 2026, Oracle and/or its affiliates.
* Copyright (c) 2013, Regents of the University of California
*
* All rights reserved.
Expand Down Expand Up @@ -217,8 +217,8 @@ public void setDictHiddenProp(Node inliningTarget, HiddenAttr.WriteNode writeNod
}
}

public void makeStaticBase(DynamicObject.GetShapeFlagsNode getShapeFlagsNode, DynamicObject.SetShapeFlagsNode setShapeFlagsNode) {
addShapeFlag(IS_STATIC_BASE, getShapeFlagsNode, setShapeFlagsNode);
public void makeStaticBase(DynamicObject.SetShapeFlagsNode setShapeFlagsNode) {
setShapeFlagsNode.executeAdd(this, IS_STATIC_BASE);
}

public boolean isStaticBase() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2024, 2026, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* The Universal Permissive License (UPL), Version 1.0
Expand Down Expand Up @@ -233,7 +233,9 @@
import com.oracle.truffle.api.dsl.Specialization;
import com.oracle.truffle.api.interop.InteropLibrary;
import com.oracle.truffle.api.interop.UnsupportedMessageException;
import com.oracle.truffle.api.nodes.DenyReplace;
import com.oracle.truffle.api.nodes.Node;
import com.oracle.truffle.api.nodes.UnadoptableNode;
import com.oracle.truffle.api.object.DynamicObject;
import com.oracle.truffle.api.profiles.InlinedBranchProfile;
import com.oracle.truffle.api.strings.TruffleString;
Expand Down Expand Up @@ -2024,8 +2026,9 @@ static TpSlots doOtherCached(Node inliningTarget, Object klass,
return weakValueProfile.execute(inliningTarget, getSlots.execute(inliningTarget, klass));
}

@DenyReplace
@GenerateCached(false)
private static final class Uncached extends GetCachedTpSlotsNode {
private static final class Uncached extends GetCachedTpSlotsNode implements UnadoptableNode {
private static final Uncached INSTANCE = new Uncached();

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2026, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* The Universal Permissive License (UPL), Version 1.0
Expand Down Expand Up @@ -205,6 +205,7 @@
import com.oracle.graal.python.nodes.object.GetOrCreateDictNode;
import com.oracle.graal.python.nodes.util.CannotCastException;
import com.oracle.graal.python.nodes.util.CastToTruffleStringNode;
import com.oracle.graal.python.nodes.util.LazyInteropLibrary;
import com.oracle.graal.python.runtime.ExecutionContext.BoundaryCallContext;
import com.oracle.graal.python.runtime.IndirectCallData.BoundaryCallData;
import com.oracle.graal.python.runtime.PythonContext;
Expand Down Expand Up @@ -1510,10 +1511,15 @@ static boolean doNative(PythonAbstractNativeObject left, PythonAbstractNativeObj
return lib.isIdentical(left.getPtr(), right.getPtr(), lib);
}

@Specialization(guards = {"isForeignObject(left)", "isForeignObject(right)"})
@Fallback
@InliningCutoff
static boolean doOther(Object left, Object right,
@CachedLibrary(limit = "2") InteropLibrary lib) {
static boolean doOther(Node inliningTarget, Object left, Object right,
@Cached LazyInteropLibrary lazyInterop) {
if (!(PGuards.isForeignObject(left) && PGuards.isForeignObject(right))) {
return false;
}

InteropLibrary lib = lazyInterop.get(inliningTarget);
if (lib.isMetaObject(left) && lib.isMetaObject(right)) {
if (left == right) {
return true;
Expand All @@ -1540,11 +1546,6 @@ static boolean doOther(Object left, Object right,
}
return false;
}

@Fallback
static boolean doOther(@SuppressWarnings("unused") Object left, @SuppressWarnings("unused") Object right) {
return false;
}
}

@GenerateUncached
Expand Down
Loading
Loading