@@ -118,23 +118,26 @@ protected static boolean isBuiltinDict(PHashingCollection globals, IsBuiltinClas
118
118
return globals instanceof PDict && profile .profileObject (globals , PythonBuiltinClassType .PDict );
119
119
}
120
120
121
- protected static HashingStorage getStorage (Object cachedGlobals ) {
121
+ /**
122
+ * @param module Non-cached parameter to help the DSL produce a guard, not an assertion
123
+ */
124
+ protected static HashingStorage getStorage (Object module , Object cachedGlobals ) {
122
125
return ((PDict ) cachedGlobals ).getDictStorage ();
123
126
}
124
127
125
128
// special case for the very common module attribute read from an unchanging PDict
126
129
@ Specialization (guards = {
127
130
"cachedObject == object" ,
128
131
"lib.getDict(cachedObject) == cachedDict" ,
129
- "getStorage(cachedDict) == cachedStorage" ,
132
+ "getStorage(object, cachedDict) == cachedStorage" ,
130
133
"isBuiltinDict(cachedDict, isBuiltinDict)" ,
131
134
}, assumptions = "singleContextAssumption" , limit = "1" )
132
135
protected Object readFromBuiltinModuleDictUnchanged (@ SuppressWarnings ("unused" ) PythonModule object , String key ,
133
136
@ SuppressWarnings ("unused" ) @ CachedLibrary ("object" ) PythonObjectLibrary lib ,
134
137
@ SuppressWarnings ("unused" ) @ Cached ("object" ) PythonModule cachedObject ,
135
138
@ SuppressWarnings ("unused" ) @ Cached ("lib.getDict(cachedObject)" ) PHashingCollection cachedDict ,
136
139
@ SuppressWarnings ("unused" ) @ Cached ("singleContextAssumption()" ) Assumption singleContextAssumption ,
137
- @ Cached ("getStorage(cachedDict)" ) HashingStorage cachedStorage ,
140
+ @ Cached ("getStorage(object, cachedDict)" ) HashingStorage cachedStorage ,
138
141
@ SuppressWarnings ("unused" ) @ Cached IsBuiltinClassProfile isBuiltinDict ,
139
142
@ Cached HashingStorageNodes .GetItemNode getItemNode ) {
140
143
// note that we don't need to pass the state here - string keys are hashable by definition
0 commit comments