Skip to content

Commit ed33c9c

Browse files
committed
hack around our hack for using HashingStorageNodes.GetItem uncached
1 parent 97b2cb7 commit ed33c9c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1148,10 +1148,15 @@ public static GetItemNode create() {
11481148
@Specialization(guards = "lib.isHashable(key)", limit = "1")
11491149
@SuppressWarnings("unused")
11501150
Object doEmptyStorage(VirtualFrame frame, EmptyStorage storage, Object key,
1151+
@Cached("createBinaryProfile()") ConditionProfile profile,
11511152
@CachedLibrary("key") PythonObjectLibrary lib) {
11521153
// n.b.: we need to call the __hash__ function here for the
11531154
// side-effect to comply with Python semantics.
1154-
lib.hashWithState(key, PArguments.getThreadState(frame));
1155+
if (profile.profile(frame == null)) {
1156+
lib.hash(key);
1157+
} else {
1158+
lib.hashWithState(key, PArguments.getThreadState(frame));
1159+
}
11551160
return null;
11561161
}
11571162

0 commit comments

Comments
 (0)