summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
Diffstat (limited to 'Include')
-rw-r--r--Include/internal/pycore_code.h7
-rw-r--r--Include/opcode.h22
2 files changed, 20 insertions, 9 deletions
diff --git a/Include/internal/pycore_code.h b/Include/internal/pycore_code.h
index 282089c..6289acd 100644
--- a/Include/internal/pycore_code.h
+++ b/Include/internal/pycore_code.h
@@ -30,6 +30,11 @@ typedef struct {
uint32_t builtin_keys_version;
} _PyLoadGlobalCache;
+typedef struct {
+ /* Borrowed ref in LOAD_METHOD */
+ PyObject *obj;
+} _PyObjectCache;
+
/* Add specialized versions of entries to this union.
*
* Do not break the invariant: sizeof(SpecializedCacheEntry) == 8
@@ -45,6 +50,7 @@ typedef union {
_PyAdaptiveEntry adaptive;
_PyAttrCache attr;
_PyLoadGlobalCache load_global;
+ _PyObjectCache obj;
} SpecializedCacheEntry;
#define INSTRUCTIONS_PER_ENTRY (sizeof(SpecializedCacheEntry)/sizeof(_Py_CODEUNIT))
@@ -299,6 +305,7 @@ cache_backoff(_PyAdaptiveEntry *entry) {
int _Py_Specialize_LoadAttr(PyObject *owner, _Py_CODEUNIT *instr, PyObject *name, SpecializedCacheEntry *cache);
int _Py_Specialize_StoreAttr(PyObject *owner, _Py_CODEUNIT *instr, PyObject *name, SpecializedCacheEntry *cache);
int _Py_Specialize_LoadGlobal(PyObject *globals, PyObject *builtins, _Py_CODEUNIT *instr, PyObject *name, SpecializedCacheEntry *cache);
+int _Py_Specialize_LoadMethod(PyObject *owner, _Py_CODEUNIT *instr, PyObject *name, SpecializedCacheEntry *cache);
int _Py_Specialize_BinarySubscr(PyObject *sub, PyObject *container, _Py_CODEUNIT *instr);
#define PRINT_SPECIALIZATION_STATS 0
diff --git a/Include/opcode.h b/Include/opcode.h
index 3334242..6b02982 100644
--- a/Include/opcode.h
+++ b/Include/opcode.h
@@ -149,15 +149,19 @@ extern "C" {
#define LOAD_GLOBAL_ADAPTIVE 41
#define LOAD_GLOBAL_MODULE 42
#define LOAD_GLOBAL_BUILTIN 43
-#define STORE_ATTR_ADAPTIVE 44
-#define STORE_ATTR_SPLIT_KEYS 45
-#define STORE_ATTR_SLOT 46
-#define STORE_ATTR_WITH_HINT 47
-#define LOAD_FAST__LOAD_FAST 48
-#define STORE_FAST__LOAD_FAST 58
-#define LOAD_FAST__LOAD_CONST 80
-#define LOAD_CONST__LOAD_FAST 81
-#define STORE_FAST__STORE_FAST 87
+#define LOAD_METHOD_ADAPTIVE 44
+#define LOAD_METHOD_CACHED 45
+#define LOAD_METHOD_CLASS 46
+#define LOAD_METHOD_MODULE 47
+#define STORE_ATTR_ADAPTIVE 48
+#define STORE_ATTR_SPLIT_KEYS 58
+#define STORE_ATTR_SLOT 80
+#define STORE_ATTR_WITH_HINT 81
+#define LOAD_FAST__LOAD_FAST 87
+#define STORE_FAST__LOAD_FAST 88
+#define LOAD_FAST__LOAD_CONST 120
+#define LOAD_CONST__LOAD_FAST 122
+#define STORE_FAST__STORE_FAST 123
#ifdef NEED_OPCODE_JUMP_TABLES
static uint32_t _PyOpcode_RelativeJump[8] = {
0U,