Skip to content

Commit f603929

Browse files
committed
Get JIT working
1 parent 489e510 commit f603929

File tree

8 files changed

+575
-569
lines changed

8 files changed

+575
-569
lines changed

Include/internal/pycore_jit.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ extern "C" {
1515

1616
#ifdef _Py_JIT
1717

18-
typedef _Py_CODEUNIT *(*jit_func)(_PyInterpreterFrame *frame, _PyStackRef *stack_pointer, PyThreadState *tstate);
18+
typedef _Py_CODEUNIT *(*jit_func)(_PyInterpreterFrame *frame, _PyStackRef *stack_pointer, PyThreadState *tstate, _PyStackRef _tos_cache0, _PyStackRef _tos_cache1, _PyStackRef _tos_cache2);
1919

2020
int _PyJIT_Compile(_PyExecutorObject *executor, const _PyUOpInstruction *trace, size_t length);
2121
void _PyJIT_Free(_PyExecutorObject *executor);

Python/ceval_macros.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ do { \
363363
jit_func jitted = _executor->jit_code; \
364364
/* Keep the shim frame alive via the executor: */ \
365365
Py_INCREF(_executor); \
366-
next_instr = jitted(frame, stack_pointer, tstate); \
366+
next_instr = jitted(frame, stack_pointer, tstate, PyStackRef_NULL, PyStackRef_NULL, PyStackRef_NULL); \
367367
Py_DECREF(_executor); \
368368
frame = tstate->current_frame; \
369369
stack_pointer = _PyFrame_GetStackPointer(frame); \
@@ -426,8 +426,10 @@ do { \
426426

427427
#define CONVERSION_FAILED(NAME) ((NAME) == NULL)
428428

429-
#ifdef Py_DEBUG
429+
#if defined(Py_DEBUG) && !defined(_Py_JIT)
430430
#define SET_CURRENT_CACHED_VALUES(N) current_cached_values = (N)
431+
#define CHECK_CURRENT_CACHED_VALUES(N) assert(current_cached_values == (N))
431432
#else
432433
#define SET_CURRENT_CACHED_VALUES(N) ((void)0)
434+
#define CHECK_CURRENT_CACHED_VALUES(N) ((void)0)
433435
#endif

0 commit comments

Comments
 (0)