Skip to content

Commit 450c7c6

Browse files
committed
set add missing fallback case for __and__
- add a truffle boundary around AtomicLong operations in getNextGlobalId
1 parent aaa39be commit 450c7c6

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/set/FrozenSetBuiltins.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ abstract static class AndNode extends PythonBinaryBuiltinNode {
154154
@Child private HashingStorageNodes.IntersectNode intersectNode;
155155

156156
@TruffleBoundary
157-
private HashingStorage getStringAsHashingStorage(String str) {
157+
private static HashingStorage getStringAsHashingStorage(String str) {
158158
HashingStorage storage = EconomicMapStorage.create(str.length(), true);
159159
for (int i = 0; i < str.length(); i++) {
160160
String key = String.valueOf(str.charAt(i));
@@ -192,6 +192,11 @@ PBaseSet doPBaseSet(PFrozenSet left, PBaseSet right) {
192192
HashingStorage intersectedStorage = getIntersectNode().execute(left.getDictStorage(), right.getDictStorage());
193193
return factory().createFrozenSet(intersectedStorage);
194194
}
195+
196+
@Fallback
197+
Object doAnd(Object self, Object other) {
198+
throw raise(PythonErrorType.TypeError, "unsupported operand type(s) for &=: '%p' and '%p'", self, other);
199+
}
195200
}
196201

197202
@Builtin(name = __SUB__, fixedNumOfArguments = 2)

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/argument/positional/ExecutePositionalStarargsNode.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363

6464
@NodeChildren({@NodeChild(value = "splat", type = PNode.class)})
6565
public abstract class ExecutePositionalStarargsNode extends PNode {
66+
@Override
6667
public abstract Object[] execute(VirtualFrame frame);
6768

6869
public abstract Object[] executeWith(Object starargs);

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/PythonContext.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ public long getEmptyImmutableObjectGlobalId(PythonImmutableBuiltinType immutable
106106
return emptyImmutableObjectsIdCache[idx];
107107
}
108108

109+
@TruffleBoundary(allowInlining = true)
109110
public long getNextGlobalId() {
110111
return globalId.incrementAndGet();
111112
}

0 commit comments

Comments
 (0)