Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions Python/bytecodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
#define DEOPT_IF(cond, instname) ((void)0)
#define ERROR_IF(cond, labelname) ((void)0)
#define GO_TO_INSTRUCTION(instname) ((void)0)
#define PREDICT(opname) ((void)0)

#define inst(name, ...) case name:
#define op(name, ...) /* NAME is ignored */
Expand Down Expand Up @@ -562,14 +561,12 @@ dummy_func(

inst(LIST_APPEND, (list, unused[oparg-1], v -- list, unused[oparg-1])) {
ERROR_IF(_PyList_AppendTakeRef((PyListObject *)list, v) < 0, error);
PREDICT(JUMP_BACKWARD);
}

inst(SET_ADD, (set, unused[oparg-1], v -- set, unused[oparg-1])) {
int err = PySet_Add(set, v);
DECREF_INPUTS();
ERROR_IF(err, error);
PREDICT(JUMP_BACKWARD);
}

family(store_subscr, INLINE_CACHE_ENTRIES_STORE_SUBSCR) = {
Expand Down Expand Up @@ -824,8 +821,6 @@ dummy_func(
Py_DECREF(next_iter);
}
}

PREDICT(LOAD_CONST);
}

inst(GET_AWAITABLE, (iterable -- iter)) {
Expand All @@ -852,8 +847,6 @@ dummy_func(
}

ERROR_IF(iter == NULL, error);

PREDICT(LOAD_CONST);
}

family(send, INLINE_CACHE_ENTRIES_SEND) = {
Expand Down Expand Up @@ -1611,7 +1604,6 @@ dummy_func(
ERROR_IF(true, error);
}
DECREF_INPUTS();
PREDICT(CALL_FUNCTION_EX);
}

inst(MAP_ADD, (key, value --)) {
Expand All @@ -1620,7 +1612,6 @@ dummy_func(
/* dict[key] = value */
// Do not DECREF INPUTS because the function steals the references
ERROR_IF(_PyDict_SetItem_Take2((PyDictObject *)dict, key, value) != 0, error);
PREDICT(JUMP_BACKWARD);
}

inst(INSTRUMENTED_LOAD_SUPER_ATTR, (unused/9, unused, unused, unused -- unused if (oparg & 1), unused)) {
Expand Down Expand Up @@ -2248,13 +2239,11 @@ dummy_func(
inst(MATCH_MAPPING, (subject -- subject, res)) {
int match = Py_TYPE(subject)->tp_flags & Py_TPFLAGS_MAPPING;
res = match ? Py_True : Py_False;
PREDICT(POP_JUMP_IF_FALSE);
}

inst(MATCH_SEQUENCE, (subject -- subject, res)) {
int match = Py_TYPE(subject)->tp_flags & Py_TPFLAGS_SEQUENCE;
res = match ? Py_True : Py_False;
PREDICT(POP_JUMP_IF_FALSE);
}

inst(MATCH_KEYS, (subject, keys -- subject, keys, values_or_none)) {
Expand Down Expand Up @@ -2295,7 +2284,6 @@ dummy_func(
}
DECREF_INPUTS();
}
PREDICT(LOAD_CONST);
}

// Most members of this family are "secretly" super-instructions.
Expand Down Expand Up @@ -2485,7 +2473,6 @@ dummy_func(
Py_DECREF(exit);
ERROR_IF(true, error);
}
PREDICT(GET_AWAITABLE);
}

inst(BEFORE_WITH, (mgr -- exit, res)) {
Expand Down
15 changes: 0 additions & 15 deletions Python/ceval_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,21 +174,6 @@ GETITEM(PyObject *v, Py_ssize_t i) {
*/

#define PREDICT_ID(op) PRED_##op

#if USE_COMPUTED_GOTOS
#define PREDICT(op) if (0) goto PREDICT_ID(op)
#else
#define PREDICT(next_op) \
do { \
_Py_CODEUNIT word = *next_instr; \
opcode = word.op.code; \
if (opcode == next_op) { \
oparg = word.op.arg; \
INSTRUCTION_START(next_op); \
goto PREDICT_ID(next_op); \
} \
} while(0)
#endif
#define PREDICTED(op) PREDICT_ID(op):


Expand Down
Loading