bpo-46329: Change calling sequence (again) (GH-31373)

* Change calling sequence: Add PUSH_NULL. Merge PRECALL_FUNCTION and PRECALL_METHOD into PRECALL.
This commit is contained in:
Mark Shannon 2022-02-18 17:19:08 +00:00 committed by GitHub
parent e2c28616ce
commit cf345e945f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 365 additions and 344 deletions

View file

@ -178,8 +178,7 @@ print_spec_stats(FILE *out, OpcodeStats *stats)
/* Mark some opcodes as specializable for stats,
* even though we don't specialize them yet. */
fprintf(out, "opcode[%d].specializable : 1\n", FOR_ITER);
fprintf(out, "opcode[%d].specializable : 1\n", PRECALL_FUNCTION);
fprintf(out, "opcode[%d].specializable : 1\n", PRECALL_METHOD);
fprintf(out, "opcode[%d].specializable : 1\n", PRECALL);
fprintf(out, "opcode[%d].specializable : 1\n", UNPACK_SEQUENCE);
for (int i = 0; i < 256; i++) {
if (adaptive_opcodes[i]) {
@ -1528,7 +1527,7 @@ specialize_method_descriptor(
}
assert(_list_append != NULL);
if (nargs == 2 && descr == _list_append) {
assert(_Py_OPCODE(instr[-1]) == PRECALL_METHOD);
assert(_Py_OPCODE(instr[-1]) == PRECALL);
cache[-1].obj.obj = (PyObject *)_list_append;
*instr = _Py_MAKECODEUNIT(CALL_NO_KW_LIST_APPEND, _Py_OPARG(*instr));
return 0;