@@ -2012,9 +2012,10 @@ dummy_func(
2012
2012
DEOPT_IF (!_PyObject_InlineValues (owner_o )-> valid );
2013
2013
}
2014
2014
2015
- split op (_LOAD_ATTR_INSTANCE_VALUE , (index /1 , owner -- attr , null if (oparg & 1 ))) {
2015
+ split op (_LOAD_ATTR_INSTANCE_VALUE , (offset /1 , owner -- attr , null if (oparg & 1 ))) {
2016
2016
PyObject * owner_o = PyStackRef_AsPyObjectBorrow (owner );
2017
- PyObject * attr_o = _PyObject_InlineValues (owner_o )-> values [index ];
2017
+ PyObject * * value_ptr = (PyObject * * )(((char * )owner_o ) + offset );
2018
+ PyObject * attr_o = * value_ptr ;
2018
2019
DEOPT_IF (attr_o == NULL );
2019
2020
STAT_INC (LOAD_ATTR , hit );
2020
2021
Py_INCREF (attr_o );
@@ -2196,16 +2197,17 @@ dummy_func(
2196
2197
EXIT_IF (_PyObject_InlineValues (owner_o )-> valid == 0 );
2197
2198
}
2198
2199
2199
- op (_STORE_ATTR_INSTANCE_VALUE , (index /1 , value , owner -- )) {
2200
+ op (_STORE_ATTR_INSTANCE_VALUE , (offset /1 , value , owner -- )) {
2200
2201
PyObject * owner_o = PyStackRef_AsPyObjectBorrow (owner );
2201
2202
2202
2203
STAT_INC (STORE_ATTR , hit );
2203
2204
assert (_PyObject_GetManagedDict (owner_o ) == NULL );
2204
- PyDictValues * values = _PyObject_InlineValues (owner_o );
2205
-
2206
- PyObject * old_value = values -> values [index ];
2207
- values -> values [index ] = PyStackRef_AsPyObjectSteal (value );
2205
+ PyObject * * value_ptr = (PyObject * * )(((char * )owner_o ) + offset );
2206
+ PyObject * old_value = * value_ptr ;
2207
+ * value_ptr = PyStackRef_AsPyObjectSteal (value );
2208
2208
if (old_value == NULL ) {
2209
+ PyDictValues * values = _PyObject_InlineValues (owner_o );
2210
+ int index = value_ptr - values -> values ;
2209
2211
_PyDictValues_AddToInsertionOrder (values , index );
2210
2212
}
2211
2213
else {
0 commit comments