Skip to content

Commit 1509a3f

Browse files
committed
Fix DefaultPythonIntegerExports#EqualsWithState for PInt and style fixes
1 parent 10be668 commit 1509a3f

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/common/DynamicObjectStorage.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ static class Length {
142142
static int cachedLen(DynamicObjectStorage self,
143143
@SuppressWarnings("unused") @Cached("self.store.getShape()") Shape cachedShape,
144144
@Cached(value = "keyArray(self)", dimensions = 1) Object[] keys,
145-
@Cached ReadAttributeFromDynamicObjectNode readNode) {
145+
@Exclusive @Cached ReadAttributeFromDynamicObjectNode readNode) {
146146
int len = 0;
147147
for (int i = 0; i < keys.length; i++) {
148148
Object key = keys[i];
@@ -155,7 +155,7 @@ static int cachedLen(DynamicObjectStorage self,
155155
static int cachedKeys(DynamicObjectStorage self,
156156
@SuppressWarnings("unused") @Cached("self.store.getShape()") Shape cachedShape,
157157
@Cached(value = "keyArray(self)", dimensions = 1) Object[] keys,
158-
@Cached ReadAttributeFromDynamicObjectNode readNode) {
158+
@Exclusive @Cached ReadAttributeFromDynamicObjectNode readNode) {
159159
int len = 0;
160160
for (int i = 0; i < keys.length; i++) {
161161
Object key = keys[i];
@@ -379,7 +379,7 @@ static class ForEachUntyped {
379379
static Object cachedLen(DynamicObjectStorage self, ForEachNode<Object> node, Object firstValue,
380380
@Exclusive @SuppressWarnings("unused") @Cached("self.store.getShape()") Shape cachedShape,
381381
@Cached(value = "keyArray(self)", dimensions = 1) Object[] keys,
382-
@Cached ReadAttributeFromDynamicObjectNode readNode) {
382+
@Exclusive @Cached ReadAttributeFromDynamicObjectNode readNode) {
383383
Object result = firstValue;
384384
for (int i = 0; i < keys.length; i++) {
385385
Object key = keys[i];
@@ -392,7 +392,7 @@ static Object cachedLen(DynamicObjectStorage self, ForEachNode<Object> node, Obj
392392
static Object cachedKeys(DynamicObjectStorage self, ForEachNode<Object> node, Object firstValue,
393393
@Exclusive @SuppressWarnings("unused") @Cached("self.store.getShape()") Shape cachedShape,
394394
@Cached(value = "keyArray(self)", dimensions = 1) Object[] keys,
395-
@Cached ReadAttributeFromDynamicObjectNode readNode) {
395+
@Exclusive @Cached ReadAttributeFromDynamicObjectNode readNode) {
396396
Object result = firstValue;
397397
for (int i = 0; i < keys.length; i++) {
398398
Object key = keys[i];
@@ -403,7 +403,7 @@ static Object cachedKeys(DynamicObjectStorage self, ForEachNode<Object> node, Ob
403403

404404
@Specialization(replaces = "cachedKeys")
405405
static Object addAll(DynamicObjectStorage self, ForEachNode<Object> node, Object firstValue,
406-
@Cached ReadAttributeFromDynamicObjectNode readNode) {
406+
@Exclusive @Cached ReadAttributeFromDynamicObjectNode readNode) {
407407
return cachedKeys(self, node, firstValue, self.store.getShape(), keyArray(self), readNode);
408408
}
409409

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/common/HashMapStorage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ private static Object get(LinkedHashMap<Object, Object> values, Object key) {
134134
}
135135

136136
@Specialization(guards = "!isSupportedKey(key, profile)", limit = "3")
137-
static Object getItemNotSupportedKey(HashMapStorage self, Object key, @SuppressWarnings("unused") ThreadState state,
137+
static Object getItemNotSupportedKey(@SuppressWarnings("unused") HashMapStorage self, Object key, @SuppressWarnings("unused") ThreadState state,
138138
@SuppressWarnings("unused") @Cached IsBuiltinClassProfile profile,
139139
@CachedLibrary("key") PythonObjectLibrary lib,
140140
@Exclusive @Cached("createBinaryProfile()") ConditionProfile gotState) {

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/object/DefaultPythonIntegerExports.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ static boolean il(Integer receiver, long other, PythonObjectLibrary oLib, Thread
213213

214214
@Specialization
215215
static boolean iI(Integer receiver, PInt other, PythonObjectLibrary oLib, ThreadState threadState) {
216-
return oLib.equals(other, receiver, oLib);
216+
return other.compareTo((long) receiver) == 0;
217217
}
218218

219219
@Specialization

0 commit comments

Comments
 (0)