@@ -323,35 +323,35 @@ translate_bytecode_to_trace(
323
323
code -> co_firstlineno ,
324
324
(long )(instr - (_Py_CODEUNIT * )code -> co_code_adaptive ));
325
325
}
326
- #define ADD_TO_TRACE (OPCODE , OPARG ) \
326
+ #define ADD_TO_TRACE (OPCODE , OPERAND ) \
327
327
if (lltrace >= 2) { \
328
328
const char *opname = (OPCODE) < 256 ? _PyOpcode_OpName[(OPCODE)] : ""; \
329
- fprintf(stderr, " ADD_TO_TRACE(%s %d, %d )\n", opname, (OPCODE), (OPARG )); \
329
+ fprintf(stderr, " ADD_TO_TRACE(%s %d, %llu )\n", opname, (OPCODE), (uint64_t)(OPERAND )); \
330
330
} \
331
331
trace[trace_length].opcode = (OPCODE); \
332
- trace[trace_length].oparg = (OPARG ); \
332
+ trace[trace_length].operand = (OPERAND ); \
333
333
trace_length++;
334
334
#else
335
- #define ADD_TO_TRACE (OPCODE , OPARG ) \
335
+ #define ADD_TO_TRACE (OPCODE , OPERAND ) \
336
336
trace[trace_length].opcode = (OPCODE); \
337
- trace[trace_length].oparg = (OPARG ); \
337
+ trace[trace_length].operand = (OPERAND ); \
338
338
trace_length++;
339
339
#endif
340
340
341
341
int trace_length = 0 ;
342
342
// Always reserve space for one uop, plus SET_UP, plus EXIT_TRACE
343
343
while (trace_length + 3 <= max_length ) {
344
344
int opcode = instr -> op .code ;
345
- int oparg = instr -> op .arg ;
345
+ uint64_t operand = instr -> op .arg ;
346
346
switch (opcode ) {
347
347
case LOAD_FAST_LOAD_FAST :
348
348
{
349
349
// Reserve space for two uops (+ SETUP + EXIT_TRACE)
350
350
if (trace_length + 4 > max_length ) {
351
351
goto done ;
352
352
}
353
- int oparg1 = oparg >> 4 ;
354
- int oparg2 = oparg & 15 ;
353
+ uint64_t oparg1 = operand >> 4 ;
354
+ uint64_t oparg2 = operand & 15 ;
355
355
ADD_TO_TRACE (LOAD_FAST , oparg1 );
356
356
ADD_TO_TRACE (LOAD_FAST , oparg2 );
357
357
break ;
@@ -371,23 +371,23 @@ translate_bytecode_to_trace(
371
371
case 0 :
372
372
break ;
373
373
case 1 :
374
- oparg = read_u16 (& instr [offset ].cache );
374
+ operand = read_u16 (& instr [offset ].cache );
375
375
break ;
376
376
case 2 :
377
- oparg = read_u32 (& instr [offset ].cache );
377
+ operand = read_u32 (& instr [offset ].cache );
378
378
break ;
379
379
case 4 :
380
- oparg = read_u64 (& instr [offset ].cache );
380
+ operand = read_u64 (& instr [offset ].cache );
381
381
break ;
382
382
default :
383
383
fprintf (stderr ,
384
- "opcode=%d, oparg=%d ; nuops=%d, i=%d; size=%d, offset=%d\n" ,
385
- opcode , oparg , nuops , i ,
384
+ "opcode=%d, operand=%llu ; nuops=%d, i=%d; size=%d, offset=%d\n" ,
385
+ opcode , operand , nuops , i ,
386
386
expansion -> uops [i ].size ,
387
387
expansion -> uops [i ].offset );
388
388
Py_FatalError ("garbled expansion" );
389
389
}
390
- ADD_TO_TRACE (expansion -> uops [i ].uop , oparg );
390
+ ADD_TO_TRACE (expansion -> uops [i ].uop , operand );
391
391
assert (expansion -> uops [0 ].size == 0 ); // TODO
392
392
}
393
393
break ;
0 commit comments