From cc06dbfc737b1259357ac344752c7eccf356c04d Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Mon, 1 Jun 2015 18:24:31 -0500 Subject: [PATCH] sync opcode prediction code with python 3 --- Python/ceval.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/Python/ceval.c b/Python/ceval.c index c41cbb4bc3..115d2784c8 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -900,21 +900,15 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag) */ -// Next opcode prediction is also enabled for Computed Gotos as well. -#ifdef DYNAMIC_EXECUTION_PROFILE -#define PREDICT(op) //if (0) goto PRED_##op -#define PREDICTED(op) -#define PREDICTED_WITH_ARG(op) +#if defined(DYNAMIC_EXECUTION_PROFILE) || USE_COMPUTED_GOTOS +#define PREDICT(op) if (0) goto PRED_##op +#define PREDICTED(op) PRED_##op: +#define PREDICTED_WITH_ARG(op) PRED_##op: #else #define PREDICT(op) if (*next_instr == op) goto PRED_##op #define PREDICTED(op) PRED_##op: next_instr++ -#ifdef USE_COMPUTED_GOTOS -#define PREDICTED_WITH_ARG(op) PRED_##op: next_instr++ -#else #define PREDICTED_WITH_ARG(op) PRED_##op: oparg = PEEKARG(); next_instr += 3 #endif -#endif - /* Stack manipulation macros */ -- 2.50.1