pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/python/cpython/commit/c50d6cd01215b72282221845ea4831a104f12c4c

gh-148078: Fix uses of sym_is_not_null in JIT optimizer (GH-148079) · python/cpython@c50d6cd · GitHub
Skip to content

Commit c50d6cd

Browse files
gh-148078: Fix uses of sym_is_not_null in JIT optimizer (GH-148079)
1 parent e7bf8ea commit c50d6cd

2 files changed

Lines changed: 24 additions & 14 deletions

File tree

Python/optimizer_bytecodes.c

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -979,7 +979,7 @@ dummy_func(void) {
979979
if (sym_is_null(self_or_null) || sym_is_not_null(self_or_null)) {
980980
PyFunctionObject *func = (PyFunctionObject *)sym_get_const(ctx, callable);
981981
PyCodeObject *co = (PyCodeObject *)func->func_code;
982-
if (co->co_argcount == oparg + !sym_is_null(self_or_null)) {
982+
if (co->co_argcount == oparg + sym_is_not_null(self_or_null)) {
983983
ADD_OP(_NOP, 0 ,0);
984984
}
985985
}
@@ -1266,9 +1266,10 @@ dummy_func(void) {
12661266

12671267
op(_GUARD_CALLABLE_BUILTIN_O, (callable, self_or_null, args[oparg] -- callable, self_or_null, args[oparg])) {
12681268
PyObject *callable_o = sym_get_const(ctx, callable);
1269-
if (callable_o && sym_matches_type(callable, &PyCFunction_Type)) {
1269+
if (callable_o && sym_matches_type(callable, &PyCFunction_Type) &&
1270+
(sym_is_not_null(self_or_null) || sym_is_null(self_or_null))) {
12701271
int total_args = oparg;
1271-
if (!sym_is_null(self_or_null)) {
1272+
if (sym_is_not_null(self_or_null)) {
12721273
total_args++;
12731274
}
12741275
if (total_args == 1 && PyCFunction_GET_FLAGS(callable_o) == METH_O) {
@@ -1321,7 +1322,8 @@ dummy_func(void) {
13211322

13221323
op(_GUARD_CALLABLE_METHOD_DESCRIPTOR_O, (callable, self_or_null, args[oparg] -- callable, self_or_null, args[oparg])) {
13231324
PyObject *callable_o = sym_get_const(ctx, callable);
1324-
if (callable_o && sym_matches_type(callable, &PyMethodDescr_Type)) {
1325+
if (callable_o && sym_matches_type(callable, &PyMethodDescr_Type) &&
1326+
(sym_is_not_null(self_or_null) || sym_is_null(self_or_null))) {
13251327
int total_args = oparg;
13261328
if (sym_is_not_null(self_or_null)) {
13271329
total_args++;
@@ -1347,7 +1349,8 @@ dummy_func(void) {
13471349

13481350
op(_GUARD_CALLABLE_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS, (callable, self_or_null, args[oparg] -- callable, self_or_null, args[oparg])) {
13491351
PyObject *callable_o = sym_get_const(ctx, callable);
1350-
if (callable_o && sym_matches_type(callable, &PyMethodDescr_Type)) {
1352+
if (callable_o && sym_matches_type(callable, &PyMethodDescr_Type) &&
1353+
(sym_is_not_null(self_or_null) || sym_is_null(self_or_null))) {
13511354
int total_args = oparg;
13521355
if (sym_is_not_null(self_or_null)) {
13531356
total_args++;
@@ -1373,7 +1376,8 @@ dummy_func(void) {
13731376

13741377
op(_GUARD_CALLABLE_METHOD_DESCRIPTOR_NOARGS, (callable, self_or_null, args[oparg] -- callable, self_or_null, args[oparg])) {
13751378
PyObject *callable_o = sym_get_const(ctx, callable);
1376-
if (callable_o && sym_matches_type(callable, &PyMethodDescr_Type)) {
1379+
if (callable_o && sym_matches_type(callable, &PyMethodDescr_Type) &&
1380+
(sym_is_not_null(self_or_null) || sym_is_null(self_or_null))) {
13771381
int total_args = oparg;
13781382
if (sym_is_not_null(self_or_null)) {
13791383
total_args++;
@@ -1439,7 +1443,8 @@ dummy_func(void) {
14391443

14401444
op(_GUARD_CALLABLE_METHOD_DESCRIPTOR_FAST, (callable, self_or_null, args[oparg] -- callable, self_or_null, args[oparg])) {
14411445
PyObject *callable_o = sym_get_const(ctx, callable);
1442-
if (callable_o && sym_matches_type(callable, &PyMethodDescr_Type)) {
1446+
if (callable_o && sym_matches_type(callable, &PyMethodDescr_Type) &&
1447+
(sym_is_not_null(self_or_null) || sym_is_null(self_or_null))) {
14431448
int total_args = oparg;
14441449
if (sym_is_not_null(self_or_null)) {
14451450
total_args++;

Python/optimizer_cases.c.h

Lines changed: 12 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy