summaryrefslogtreecommitdiffstats
path: root/Include/internal
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2023-06-02 10:46:18 (GMT)
committerGitHub <noreply@github.com>2023-06-02 10:46:18 (GMT)
commit4bfa01b9d911ce9358cf1a453bee15554f8e4c07 (patch)
treebd61d8459bf30d42abf0be7258de91360bea434b /Include/internal
parent601ae09f0c8eda213b9050892f5ce9b91f0aa522 (diff)
downloadcpython-4bfa01b9d911ce9358cf1a453bee15554f8e4c07.zip
cpython-4bfa01b9d911ce9358cf1a453bee15554f8e4c07.tar.gz
cpython-4bfa01b9d911ce9358cf1a453bee15554f8e4c07.tar.bz2
GH-104584: Plugin optimizer API (GH-105100)
Diffstat (limited to 'Include/internal')
-rw-r--r--Include/internal/pycore_code.h1
-rw-r--r--Include/internal/pycore_interp.h3
-rw-r--r--Include/internal/pycore_opcode.h5
3 files changed, 7 insertions, 2 deletions
diff --git a/Include/internal/pycore_code.h b/Include/internal/pycore_code.h
index 75a23f3..ef940b5 100644
--- a/Include/internal/pycore_code.h
+++ b/Include/internal/pycore_code.h
@@ -487,6 +487,7 @@ extern int _Py_Instrument(PyCodeObject *co, PyInterpreterState *interp);
extern int _Py_GetBaseOpcode(PyCodeObject *code, int offset);
+extern int _PyInstruction_GetLength(PyCodeObject *code, int offset);
#ifdef __cplusplus
}
diff --git a/Include/internal/pycore_interp.h b/Include/internal/pycore_interp.h
index 04474c1..a6f4677 100644
--- a/Include/internal/pycore_interp.h
+++ b/Include/internal/pycore_interp.h
@@ -160,6 +160,9 @@ struct _is {
struct types_state types;
struct callable_cache callable_cache;
PyCodeObject *interpreter_trampoline;
+ _PyOptimizerObject *optimizer;
+ uint16_t optimizer_resume_threshold;
+ uint16_t optimizer_backedge_threshold;
_Py_Monitors monitors;
bool f_opcode_trace_set;
diff --git a/Include/internal/pycore_opcode.h b/Include/internal/pycore_opcode.h
index 15d9650..15c8dcf 100644
--- a/Include/internal/pycore_opcode.h
+++ b/Include/internal/pycore_opcode.h
@@ -42,6 +42,7 @@ const uint8_t _PyOpcode_Caches[256] = {
[LOAD_GLOBAL] = 4,
[BINARY_OP] = 1,
[SEND] = 1,
+ [JUMP_BACKWARD] = 1,
[LOAD_SUPER_ATTR] = 1,
[CALL] = 3,
};
@@ -114,6 +115,7 @@ const uint8_t _PyOpcode_Deopt[256] = {
[END_ASYNC_FOR] = END_ASYNC_FOR,
[END_FOR] = END_FOR,
[END_SEND] = END_SEND,
+ [ENTER_EXECUTOR] = ENTER_EXECUTOR,
[EXTENDED_ARG] = EXTENDED_ARG,
[FORMAT_VALUE] = FORMAT_VALUE,
[FOR_ITER] = FOR_ITER,
@@ -475,7 +477,7 @@ static const char *const _PyOpcode_OpName[267] = {
[227] = "<227>",
[228] = "<228>",
[229] = "<229>",
- [230] = "<230>",
+ [ENTER_EXECUTOR] = "ENTER_EXECUTOR",
[231] = "<231>",
[232] = "<232>",
[233] = "<233>",
@@ -571,7 +573,6 @@ static const char *const _PyOpcode_OpName[267] = {
case 227: \
case 228: \
case 229: \
- case 230: \
case 231: \
case 232: \
case 233: \