[Python-checkins] cpython (2.7): sync opcode prediction code with python 3

benjamin.peterson python-checkins at python.org
Tue Jun 2 01:26:18 CEST 2015


https://hg.python.org/cpython/rev/5e8fa1b13516
changeset: 96454:5e8fa1b13516
branch: 2.7
parent: 96425:cf6e782a7f94
user: Benjamin Peterson <benjamin at python.org>
date: Mon Jun 01 18:24:31 2015 -0500
summary:
 sync opcode prediction code with python 3
files:
 Python/ceval.c | 14 ++++----------
 1 files changed, 4 insertions(+), 10 deletions(-)
diff --git a/Python/ceval.c b/Python/ceval.c
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -900,21 +900,15 @@
 */
 
 
-// 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 */
-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /