cpython: a6241b2073c6 (original) (raw)

Mercurial > cpython

changeset 106165:a6241b2073c6

Issue #26110: Add document for LOAD_METHOD and CALL_METHOD opcode. Changed stack layout bit for "easy to explain." [#26110]

INADA Naoki songofacandy@gmail.com
date Mon, 16 Jan 2017 17:23:30 +0900
parents 1add5cb46692
children 27dc9a1c061e
files Doc/library/dis.rst Doc/whatsnew/3.7.rst Python/ceval.c
diffstat 3 files changed, 63 insertions(+), 42 deletions(-)[+] [-] Doc/library/dis.rst 22 Doc/whatsnew/3.7.rst 7 Python/ceval.c 76

line wrap: on

line diff

--- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -957,6 +957,28 @@ All of the following opcodes use their a value. +.. opcode:: LOAD_METHOD (namei) +

+ +.. opcode:: CALL_METHOD (argc) +

+ .. opcode:: MAKE_FUNCTION (argc) Pushes a new function object on the stack. From bottom to top, the consumed

--- a/Doc/whatsnew/3.7.rst +++ b/Doc/whatsnew/3.7.rst @@ -170,3 +170,10 @@ Changes in the Python API Assigning to them was deprecated in Python 3.5. Use the :meth:~http.cookies.Morsel.set method for setting them. (Contributed by Serhiy Storchaka in :issue:29192.) + + +CPython bytecode changes +------------------------ + +* Added two new opcodes: :opcode:LOAD_METHOD`` and :opcode:CALL_METHOD`.

--- a/Python/ceval.c +++ b/Python/ceval.c @@ -3236,81 +3236,73 @@ PyObject* _Py_HOT_FUNCTION int meth_found = _PyObject_GetMethod(obj, name, &meth);

if (meth_found) {

-

+

TARGET(CALL_METHOD) { /* Designed to work in tamdem with LOAD_METHOD. */

sp = stack_pointer;

Stack layout:

-

-

-

+

-

+