@@ -1146,6 +1146,8 @@ dummy_func(
1146
1146
PyObject * name = GETITEM (names , oparg );
1147
1147
next_instr -- ;
1148
1148
if (_Py_Specialize_StoreAttr (owner , next_instr , name )) {
1149
+ // "undo" the rewind so end up in the correct handler:
1150
+ next_instr ++ ;
1149
1151
goto error ;
1150
1152
}
1151
1153
DISPATCH_SAME_OPARG ();
@@ -1725,6 +1727,8 @@ dummy_func(
1725
1727
PyObject * name = GETITEM (names , oparg >>1 );
1726
1728
next_instr -- ;
1727
1729
if (_Py_Specialize_LoadAttr (owner , next_instr , name )) {
1730
+ // "undo" the rewind so end up in the correct handler:
1731
+ next_instr ++ ;
1728
1732
goto error ;
1729
1733
}
1730
1734
DISPATCH_SAME_OPARG ();
@@ -3113,7 +3117,6 @@ dummy_func(
3113
3117
PyObject * callable = PEEK (2 );
3114
3118
DEOPT_IF (callable != (PyObject * )& PyUnicode_Type , CALL );
3115
3119
STAT_INC (CALL , hit );
3116
- JUMPBY (INLINE_CACHE_ENTRIES_CALL );
3117
3120
PyObject * arg = TOP ();
3118
3121
PyObject * res = PyObject_Str (arg );
3119
3122
Py_DECREF (arg );
@@ -3123,6 +3126,7 @@ dummy_func(
3123
3126
if (res == NULL ) {
3124
3127
goto error ;
3125
3128
}
3129
+ JUMPBY (INLINE_CACHE_ENTRIES_CALL );
3126
3130
CHECK_EVAL_BREAKER ();
3127
3131
}
3128
3132
@@ -3134,7 +3138,6 @@ dummy_func(
3134
3138
PyObject * callable = PEEK (2 );
3135
3139
DEOPT_IF (callable != (PyObject * )& PyTuple_Type , CALL );
3136
3140
STAT_INC (CALL , hit );
3137
- JUMPBY (INLINE_CACHE_ENTRIES_CALL );
3138
3141
PyObject * arg = TOP ();
3139
3142
PyObject * res = PySequence_Tuple (arg );
3140
3143
Py_DECREF (arg );
@@ -3144,6 +3147,7 @@ dummy_func(
3144
3147
if (res == NULL ) {
3145
3148
goto error ;
3146
3149
}
3150
+ JUMPBY (INLINE_CACHE_ENTRIES_CALL );
3147
3151
CHECK_EVAL_BREAKER ();
3148
3152
}
3149
3153
@@ -3157,7 +3161,6 @@ dummy_func(
3157
3161
PyTypeObject * tp = (PyTypeObject * )callable ;
3158
3162
DEOPT_IF (tp -> tp_vectorcall == NULL , CALL );
3159
3163
STAT_INC (CALL , hit );
3160
- JUMPBY (INLINE_CACHE_ENTRIES_CALL );
3161
3164
STACK_SHRINK (total_args );
3162
3165
PyObject * res = tp -> tp_vectorcall ((PyObject * )tp , stack_pointer ,
3163
3166
total_args - kwnames_len , kwnames );
@@ -3172,6 +3175,7 @@ dummy_func(
3172
3175
if (res == NULL ) {
3173
3176
goto error ;
3174
3177
}
3178
+ JUMPBY (INLINE_CACHE_ENTRIES_CALL );
3175
3179
CHECK_EVAL_BREAKER ();
3176
3180
}
3177
3181
@@ -3187,7 +3191,6 @@ dummy_func(
3187
3191
DEOPT_IF (!PyCFunction_CheckExact (callable ), CALL );
3188
3192
DEOPT_IF (PyCFunction_GET_FLAGS (callable ) != METH_O , CALL );
3189
3193
STAT_INC (CALL , hit );
3190
- JUMPBY (INLINE_CACHE_ENTRIES_CALL );
3191
3194
PyCFunction cfunc = PyCFunction_GET_FUNCTION (callable );
3192
3195
// This is slower but CPython promises to check all non-vectorcall
3193
3196
// function calls.
@@ -3206,6 +3209,7 @@ dummy_func(
3206
3209
if (res == NULL ) {
3207
3210
goto error ;
3208
3211
}
3212
+ JUMPBY (INLINE_CACHE_ENTRIES_CALL );
3209
3213
CHECK_EVAL_BREAKER ();
3210
3214
}
3211
3215
@@ -3221,7 +3225,6 @@ dummy_func(
3221
3225
DEOPT_IF (PyCFunction_GET_FLAGS (callable ) != METH_FASTCALL ,
3222
3226
CALL );
3223
3227
STAT_INC (CALL , hit );
3224
- JUMPBY (INLINE_CACHE_ENTRIES_CALL );
3225
3228
PyCFunction cfunc = PyCFunction_GET_FUNCTION (callable );
3226
3229
STACK_SHRINK (total_args );
3227
3230
/* res = func(self, args, nargs) */
@@ -3246,6 +3249,7 @@ dummy_func(
3246
3249
*/
3247
3250
goto error ;
3248
3251
}
3252
+ JUMPBY (INLINE_CACHE_ENTRIES_CALL );
3249
3253
CHECK_EVAL_BREAKER ();
3250
3254
}
3251
3255
@@ -3260,7 +3264,6 @@ dummy_func(
3260
3264
DEOPT_IF (PyCFunction_GET_FLAGS (callable ) !=
3261
3265
(METH_FASTCALL | METH_KEYWORDS ), CALL );
3262
3266
STAT_INC (CALL , hit );
3263
- JUMPBY (INLINE_CACHE_ENTRIES_CALL );
3264
3267
STACK_SHRINK (total_args );
3265
3268
/* res = func(self, args, nargs, kwnames) */
3266
3269
_PyCFunctionFastWithKeywords cfunc =
@@ -3285,6 +3288,7 @@ dummy_func(
3285
3288
if (res == NULL ) {
3286
3289
goto error ;
3287
3290
}
3291
+ JUMPBY (INLINE_CACHE_ENTRIES_CALL );
3288
3292
CHECK_EVAL_BREAKER ();
3289
3293
}
3290
3294
@@ -3300,7 +3304,6 @@ dummy_func(
3300
3304
PyInterpreterState * interp = _PyInterpreterState_GET ();
3301
3305
DEOPT_IF (callable != interp -> callable_cache .len , CALL );
3302
3306
STAT_INC (CALL , hit );
3303
- JUMPBY (INLINE_CACHE_ENTRIES_CALL );
3304
3307
PyObject * arg = TOP ();
3305
3308
Py_ssize_t len_i = PyObject_Length (arg );
3306
3309
if (len_i < 0 ) {
@@ -3316,6 +3319,7 @@ dummy_func(
3316
3319
if (res == NULL ) {
3317
3320
goto error ;
3318
3321
}
3322
+ JUMPBY (INLINE_CACHE_ENTRIES_CALL );
3319
3323
}
3320
3324
3321
3325
// stack effect: (__0, __array[oparg] -- )
@@ -3330,7 +3334,6 @@ dummy_func(
3330
3334
PyInterpreterState * interp = _PyInterpreterState_GET ();
3331
3335
DEOPT_IF (callable != interp -> callable_cache .isinstance , CALL );
3332
3336
STAT_INC (CALL , hit );
3333
- JUMPBY (INLINE_CACHE_ENTRIES_CALL );
3334
3337
PyObject * cls = POP ();
3335
3338
PyObject * inst = TOP ();
3336
3339
int retval = PyObject_IsInstance (inst , cls );
@@ -3349,6 +3352,7 @@ dummy_func(
3349
3352
if (res == NULL ) {
3350
3353
goto error ;
3351
3354
}
3355
+ JUMPBY (INLINE_CACHE_ENTRIES_CALL );
3352
3356
}
3353
3357
3354
3358
// stack effect: (__0, __array[oparg] -- )
@@ -3362,16 +3366,16 @@ dummy_func(
3362
3366
PyObject * list = SECOND ();
3363
3367
DEOPT_IF (!PyList_Check (list ), CALL );
3364
3368
STAT_INC (CALL , hit );
3365
- // CALL + POP_TOP
3366
- JUMPBY (INLINE_CACHE_ENTRIES_CALL + 1 );
3367
- assert (_Py_OPCODE (next_instr [-1 ]) == POP_TOP );
3368
3369
PyObject * arg = POP ();
3369
3370
if (_PyList_AppendTakeRef ((PyListObject * )list , arg ) < 0 ) {
3370
3371
goto error ;
3371
3372
}
3372
3373
STACK_SHRINK (2 );
3373
3374
Py_DECREF (list );
3374
3375
Py_DECREF (callable );
3376
+ // CALL + POP_TOP
3377
+ JUMPBY (INLINE_CACHE_ENTRIES_CALL + 1 );
3378
+ assert (_Py_OPCODE (next_instr [-1 ]) == POP_TOP );
3375
3379
}
3376
3380
3377
3381
// stack effect: (__0, __array[oparg] -- )
@@ -3389,7 +3393,6 @@ dummy_func(
3389
3393
PyObject * self = SECOND ();
3390
3394
DEOPT_IF (!Py_IS_TYPE (self , callable -> d_common .d_type ), CALL );
3391
3395
STAT_INC (CALL , hit );
3392
- JUMPBY (INLINE_CACHE_ENTRIES_CALL );
3393
3396
PyCFunction cfunc = meth -> ml_meth ;
3394
3397
// This is slower but CPython promises to check all non-vectorcall
3395
3398
// function calls.
@@ -3407,6 +3410,7 @@ dummy_func(
3407
3410
if (res == NULL ) {
3408
3411
goto error ;
3409
3412
}
3413
+ JUMPBY (INLINE_CACHE_ENTRIES_CALL );
3410
3414
CHECK_EVAL_BREAKER ();
3411
3415
}
3412
3416
@@ -3423,7 +3427,6 @@ dummy_func(
3423
3427
PyObject * self = PEEK (total_args );
3424
3428
DEOPT_IF (!Py_IS_TYPE (self , d_type ), CALL );
3425
3429
STAT_INC (CALL , hit );
3426
- JUMPBY (INLINE_CACHE_ENTRIES_CALL );
3427
3430
int nargs = total_args - 1 ;
3428
3431
STACK_SHRINK (nargs );
3429
3432
_PyCFunctionFastWithKeywords cfunc =
@@ -3444,6 +3447,7 @@ dummy_func(
3444
3447
if (res == NULL ) {
3445
3448
goto error ;
3446
3449
}
3450
+ JUMPBY (INLINE_CACHE_ENTRIES_CALL );
3447
3451
CHECK_EVAL_BREAKER ();
3448
3452
}
3449
3453
@@ -3461,7 +3465,6 @@ dummy_func(
3461
3465
DEOPT_IF (!Py_IS_TYPE (self , callable -> d_common .d_type ), CALL );
3462
3466
DEOPT_IF (meth -> ml_flags != METH_NOARGS , CALL );
3463
3467
STAT_INC (CALL , hit );
3464
- JUMPBY (INLINE_CACHE_ENTRIES_CALL );
3465
3468
PyCFunction cfunc = meth -> ml_meth ;
3466
3469
// This is slower but CPython promises to check all non-vectorcall
3467
3470
// function calls.
@@ -3478,6 +3481,7 @@ dummy_func(
3478
3481
if (res == NULL ) {
3479
3482
goto error ;
3480
3483
}
3484
+ JUMPBY (INLINE_CACHE_ENTRIES_CALL );
3481
3485
CHECK_EVAL_BREAKER ();
3482
3486
}
3483
3487
@@ -3495,7 +3499,6 @@ dummy_func(
3495
3499
PyObject * self = PEEK (total_args );
3496
3500
DEOPT_IF (!Py_IS_TYPE (self , callable -> d_common .d_type ), CALL );
3497
3501
STAT_INC (CALL , hit );
3498
- JUMPBY (INLINE_CACHE_ENTRIES_CALL );
3499
3502
_PyCFunctionFast cfunc =
3500
3503
(_PyCFunctionFast )(void (* )(void ))meth -> ml_meth ;
3501
3504
int nargs = total_args - 1 ;
@@ -3513,6 +3516,7 @@ dummy_func(
3513
3516
if (res == NULL ) {
3514
3517
goto error ;
3515
3518
}
3519
+ JUMPBY (INLINE_CACHE_ENTRIES_CALL );
3516
3520
CHECK_EVAL_BREAKER ();
3517
3521
}
3518
3522
0 commit comments