Last active
November 1, 2023 16:58
-
-
Save markshannon/d7de345dcbd5499b8d00f8d6101830cd to your computer and use it in GitHub Desktop.
example.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
op(_BINARY_OP_ADD_INT, (unused/1, left, right -- res)) { | |
if (IS_CONST(left) && IS_CONST(right)) { | |
res = MAKE_CONST(Py_NumberAdd(left->value, right->value)); | |
emit(_LOAD_CONST_INLINE, res->value); | |
} | |
else { | |
res = UNKNOWN(); | |
emit(_BINARY_OP_ADD_INT); | |
} | |
Py_DECREF(left); | |
Py_DECREF(right); | |
} | |
op(_GUARD_GLOBALS_VERSION, (version/1 --)) { | |
PyDictObject *dict = (PyDictObject *)GLOBALS(); | |
PyDict_WatcherAdd(dict, ...); | |
/* Don't emit anything */ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment