diff options
Diffstat (limited to 'Python/bytecodes.c')
-rw-r--r-- | Python/bytecodes.c | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/Python/bytecodes.c b/Python/bytecodes.c index 9fcf69b..bd40369 100644 --- a/Python/bytecodes.c +++ b/Python/bytecodes.c @@ -201,6 +201,15 @@ dummy_func( GETLOCAL(oparg) = NULL; } + inst(LOAD_FAST_LOAD_FAST, ( -- value1, value2)) { + uint32_t oparg1 = oparg >> 4; + uint32_t oparg2 = oparg & 15; + value1 = GETLOCAL(oparg1); + value2 = GETLOCAL(oparg2); + Py_INCREF(value1); + Py_INCREF(value2); + } + inst(LOAD_CONST, (-- value)) { value = GETITEM(frame->f_code->co_consts, oparg); Py_INCREF(value); @@ -210,10 +219,22 @@ dummy_func( SETLOCAL(oparg, value); } - super(LOAD_FAST__LOAD_FAST) = LOAD_FAST + LOAD_FAST; + inst(STORE_FAST_LOAD_FAST, (value1 -- value2)) { + uint32_t oparg1 = oparg >> 4; + uint32_t oparg2 = oparg & 15; + SETLOCAL(oparg1, value1); + value2 = GETLOCAL(oparg2); + Py_INCREF(value2); + } + + inst(STORE_FAST_STORE_FAST, (value2, value1 --)) { + uint32_t oparg1 = oparg >> 4; + uint32_t oparg2 = oparg & 15; + SETLOCAL(oparg1, value1); + SETLOCAL(oparg2, value2); + } + super(LOAD_FAST__LOAD_CONST) = LOAD_FAST + LOAD_CONST; - super(STORE_FAST__LOAD_FAST) = STORE_FAST + LOAD_FAST; - super(STORE_FAST__STORE_FAST) = STORE_FAST + STORE_FAST; super(LOAD_CONST__LOAD_FAST) = LOAD_CONST + LOAD_FAST; inst(POP_TOP, (value --)) { @@ -386,8 +407,7 @@ dummy_func( // At the end we just skip over the STORE_FAST. op(_BINARY_OP_INPLACE_ADD_UNICODE, (left, right --)) { _Py_CODEUNIT true_next = next_instr[INLINE_CACHE_ENTRIES_BINARY_OP]; - assert(true_next.op.code == STORE_FAST || - true_next.op.code == STORE_FAST__LOAD_FAST); + assert(true_next.op.code == STORE_FAST); PyObject **target_local = &GETLOCAL(true_next.op.arg); DEOPT_IF(*target_local != left, BINARY_OP); STAT_INC(BINARY_OP, hit); @@ -3484,5 +3504,3 @@ dummy_func( } // Future families go below this point // - -family(store_fast) = { STORE_FAST, STORE_FAST__LOAD_FAST, STORE_FAST__STORE_FAST }; |