cinderx 2026.1.16.2__cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- __static__/__init__.py +641 -0
- __static__/compiler_flags.py +8 -0
- __static__/enum.py +160 -0
- __static__/native_utils.py +77 -0
- __static__/type_code.py +48 -0
- __strict__/__init__.py +39 -0
- _cinderx.so +0 -0
- cinderx/__init__.py +577 -0
- cinderx/__pycache__/__init__.cpython-314.pyc +0 -0
- cinderx/_asyncio.py +156 -0
- cinderx/compileall.py +710 -0
- cinderx/compiler/__init__.py +40 -0
- cinderx/compiler/__main__.py +137 -0
- cinderx/compiler/config.py +7 -0
- cinderx/compiler/consts.py +72 -0
- cinderx/compiler/debug.py +70 -0
- cinderx/compiler/dis_stable.py +283 -0
- cinderx/compiler/errors.py +151 -0
- cinderx/compiler/flow_graph_optimizer.py +1287 -0
- cinderx/compiler/future.py +91 -0
- cinderx/compiler/misc.py +32 -0
- cinderx/compiler/opcode_cinder.py +18 -0
- cinderx/compiler/opcode_static.py +100 -0
- cinderx/compiler/opcodebase.py +158 -0
- cinderx/compiler/opcodes.py +991 -0
- cinderx/compiler/optimizer.py +547 -0
- cinderx/compiler/pyassem.py +3711 -0
- cinderx/compiler/pycodegen.py +7660 -0
- cinderx/compiler/pysourceloader.py +62 -0
- cinderx/compiler/static/__init__.py +1404 -0
- cinderx/compiler/static/compiler.py +629 -0
- cinderx/compiler/static/declaration_visitor.py +335 -0
- cinderx/compiler/static/definite_assignment_checker.py +280 -0
- cinderx/compiler/static/effects.py +160 -0
- cinderx/compiler/static/module_table.py +666 -0
- cinderx/compiler/static/type_binder.py +2176 -0
- cinderx/compiler/static/types.py +10580 -0
- cinderx/compiler/static/util.py +81 -0
- cinderx/compiler/static/visitor.py +91 -0
- cinderx/compiler/strict/__init__.py +69 -0
- cinderx/compiler/strict/class_conflict_checker.py +249 -0
- cinderx/compiler/strict/code_gen_base.py +409 -0
- cinderx/compiler/strict/common.py +507 -0
- cinderx/compiler/strict/compiler.py +352 -0
- cinderx/compiler/strict/feature_extractor.py +130 -0
- cinderx/compiler/strict/flag_extractor.py +97 -0
- cinderx/compiler/strict/loader.py +827 -0
- cinderx/compiler/strict/preprocessor.py +11 -0
- cinderx/compiler/strict/rewriter/__init__.py +5 -0
- cinderx/compiler/strict/rewriter/remove_annotations.py +84 -0
- cinderx/compiler/strict/rewriter/rewriter.py +975 -0
- cinderx/compiler/strict/runtime.py +77 -0
- cinderx/compiler/symbols.py +1754 -0
- cinderx/compiler/unparse.py +414 -0
- cinderx/compiler/visitor.py +194 -0
- cinderx/jit.py +230 -0
- cinderx/opcode.py +202 -0
- cinderx/static.py +113 -0
- cinderx/strictmodule.py +6 -0
- cinderx/test_support.py +341 -0
- cinderx-2026.1.16.2.dist-info/METADATA +15 -0
- cinderx-2026.1.16.2.dist-info/RECORD +68 -0
- cinderx-2026.1.16.2.dist-info/WHEEL +6 -0
- cinderx-2026.1.16.2.dist-info/licenses/LICENSE +21 -0
- cinderx-2026.1.16.2.dist-info/top_level.txt +5 -0
- opcodes/__init__.py +0 -0
- opcodes/assign_opcode_numbers.py +272 -0
- opcodes/cinderx_opcodes.py +121 -0
cinderx/jit.py
ADDED
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
#
|
|
3
|
+
# pyre-strict
|
|
4
|
+
|
|
5
|
+
from contextlib import contextmanager
|
|
6
|
+
from typing import Any, AsyncGenerator, Callable, Coroutine, Generator, TypeVar
|
|
7
|
+
from warnings import catch_warnings, simplefilter, warn
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
# The JIT compiles arbitrary Python functions. Ideally this type would exclude native
|
|
11
|
+
# functions, but that doesn't seem possible yet.
|
|
12
|
+
#
|
|
13
|
+
# pyre-ignore[33]: Not going to add a new type variable for every use of FuncAny.
|
|
14
|
+
FuncAny = Callable[..., Any]
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
try:
|
|
18
|
+
from cinderjit import (
|
|
19
|
+
_deopt_gen,
|
|
20
|
+
append_jit_list,
|
|
21
|
+
auto,
|
|
22
|
+
clear_runtime_stats,
|
|
23
|
+
compile_after_n_calls,
|
|
24
|
+
count_interpreted_calls,
|
|
25
|
+
disable,
|
|
26
|
+
disable_emit_type_annotation_guards,
|
|
27
|
+
disable_hir_inliner,
|
|
28
|
+
disable_specialized_opcodes,
|
|
29
|
+
enable,
|
|
30
|
+
enable_emit_type_annotation_guards,
|
|
31
|
+
enable_hir_inliner,
|
|
32
|
+
enable_specialized_opcodes,
|
|
33
|
+
force_compile,
|
|
34
|
+
force_uncompile,
|
|
35
|
+
get_allocator_stats,
|
|
36
|
+
get_and_clear_inline_cache_stats,
|
|
37
|
+
get_and_clear_runtime_stats,
|
|
38
|
+
get_compilation_time,
|
|
39
|
+
get_compile_after_n_calls,
|
|
40
|
+
get_compiled_functions,
|
|
41
|
+
get_compiled_size,
|
|
42
|
+
get_compiled_spill_stack_size,
|
|
43
|
+
get_compiled_stack_size,
|
|
44
|
+
get_function_compilation_time,
|
|
45
|
+
get_function_hir_opcode_counts,
|
|
46
|
+
get_inlined_functions_stats,
|
|
47
|
+
get_jit_list,
|
|
48
|
+
get_num_inlined_functions,
|
|
49
|
+
is_enabled,
|
|
50
|
+
is_hir_inliner_enabled,
|
|
51
|
+
is_inline_cache_stats_collection_enabled,
|
|
52
|
+
is_jit_compiled,
|
|
53
|
+
jit_suppress,
|
|
54
|
+
jit_unsuppress,
|
|
55
|
+
lazy_compile,
|
|
56
|
+
mlock_profiler_dependencies,
|
|
57
|
+
multithreaded_compile_test,
|
|
58
|
+
page_in_profiler_dependencies,
|
|
59
|
+
precompile_all,
|
|
60
|
+
read_jit_list,
|
|
61
|
+
set_max_code_size,
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
except ImportError:
|
|
65
|
+
TDeoptGenYield = TypeVar("TDeoptGenYield")
|
|
66
|
+
TDeoptGenSend = TypeVar("TDeoptGenSend")
|
|
67
|
+
TDeoptGenReturn = TypeVar("TDeoptGenReturn")
|
|
68
|
+
|
|
69
|
+
def _deopt_gen(
|
|
70
|
+
gen: Generator[TDeoptGenYield, TDeoptGenSend, TDeoptGenReturn]
|
|
71
|
+
| AsyncGenerator[TDeoptGenYield, TDeoptGenSend]
|
|
72
|
+
| Coroutine[TDeoptGenYield, TDeoptGenSend, TDeoptGenReturn],
|
|
73
|
+
) -> bool:
|
|
74
|
+
return False
|
|
75
|
+
|
|
76
|
+
def append_jit_list(entry: str) -> None:
|
|
77
|
+
return None
|
|
78
|
+
|
|
79
|
+
def auto() -> None:
|
|
80
|
+
return None
|
|
81
|
+
|
|
82
|
+
def clear_runtime_stats() -> None:
|
|
83
|
+
return None
|
|
84
|
+
|
|
85
|
+
def compile_after_n_calls(calls: int) -> None:
|
|
86
|
+
return None
|
|
87
|
+
|
|
88
|
+
def count_interpreted_calls(func: FuncAny) -> int:
|
|
89
|
+
return 0
|
|
90
|
+
|
|
91
|
+
def disable(deopt_all: bool = False) -> None:
|
|
92
|
+
return None
|
|
93
|
+
|
|
94
|
+
def disable_emit_type_annotation_guards() -> None:
|
|
95
|
+
return None
|
|
96
|
+
|
|
97
|
+
def disable_hir_inliner() -> None:
|
|
98
|
+
return None
|
|
99
|
+
|
|
100
|
+
def disable_specialized_opcodes() -> None:
|
|
101
|
+
return None
|
|
102
|
+
|
|
103
|
+
def enable() -> None:
|
|
104
|
+
# Warn here because users might think this is function is how to enable the JIT
|
|
105
|
+
# when it is not installed.
|
|
106
|
+
warn(
|
|
107
|
+
"Cinder JIT is not installed, calling cinderx.jit.enable() is doing nothing"
|
|
108
|
+
)
|
|
109
|
+
|
|
110
|
+
def enable_emit_type_annotation_guards() -> None:
|
|
111
|
+
return None
|
|
112
|
+
|
|
113
|
+
def enable_hir_inliner() -> None:
|
|
114
|
+
return None
|
|
115
|
+
|
|
116
|
+
def enable_specialized_opcodes() -> None:
|
|
117
|
+
return None
|
|
118
|
+
|
|
119
|
+
def force_compile(func: FuncAny) -> bool:
|
|
120
|
+
return False
|
|
121
|
+
|
|
122
|
+
def force_uncompile(func: FuncAny) -> bool:
|
|
123
|
+
return False
|
|
124
|
+
|
|
125
|
+
def get_allocator_stats() -> dict[str, int]:
|
|
126
|
+
return {}
|
|
127
|
+
|
|
128
|
+
def get_and_clear_inline_cache_stats() -> dict[str, object]:
|
|
129
|
+
return {}
|
|
130
|
+
|
|
131
|
+
def get_and_clear_runtime_stats() -> dict[str, object]:
|
|
132
|
+
return {}
|
|
133
|
+
|
|
134
|
+
def get_compilation_time() -> int:
|
|
135
|
+
return 0
|
|
136
|
+
|
|
137
|
+
def get_compile_after_n_calls() -> int | None:
|
|
138
|
+
return None
|
|
139
|
+
|
|
140
|
+
def get_compiled_functions() -> list[FuncAny]:
|
|
141
|
+
return []
|
|
142
|
+
|
|
143
|
+
def get_compiled_size(func: FuncAny) -> int:
|
|
144
|
+
return 0
|
|
145
|
+
|
|
146
|
+
def get_compiled_spill_stack_size(func: FuncAny) -> int:
|
|
147
|
+
return 0
|
|
148
|
+
|
|
149
|
+
def get_compiled_stack_size(func: FuncAny) -> int:
|
|
150
|
+
return 0
|
|
151
|
+
|
|
152
|
+
def get_function_compilation_time(func: FuncAny) -> int:
|
|
153
|
+
return 0
|
|
154
|
+
|
|
155
|
+
def get_function_hir_opcode_counts(func: FuncAny) -> dict[str, int] | None:
|
|
156
|
+
return {}
|
|
157
|
+
|
|
158
|
+
def get_inlined_functions_stats(func: FuncAny) -> dict[str, object]:
|
|
159
|
+
return {}
|
|
160
|
+
|
|
161
|
+
def get_jit_list() -> tuple[dict[str, set[str]], dict[str, dict[str, set[int]]]]:
|
|
162
|
+
return ({}, {})
|
|
163
|
+
|
|
164
|
+
def get_num_inlined_functions(func: FuncAny) -> int:
|
|
165
|
+
return 0
|
|
166
|
+
|
|
167
|
+
def is_enabled() -> bool:
|
|
168
|
+
return False
|
|
169
|
+
|
|
170
|
+
def is_hir_inliner_enabled() -> bool:
|
|
171
|
+
return False
|
|
172
|
+
|
|
173
|
+
def is_inline_cache_stats_collection_enabled() -> bool:
|
|
174
|
+
return False
|
|
175
|
+
|
|
176
|
+
def is_jit_compiled(func: FuncAny) -> bool:
|
|
177
|
+
return False
|
|
178
|
+
|
|
179
|
+
def jit_suppress(func: FuncAny) -> FuncAny:
|
|
180
|
+
return func
|
|
181
|
+
|
|
182
|
+
def jit_unsuppress(func: FuncAny) -> FuncAny:
|
|
183
|
+
return func
|
|
184
|
+
|
|
185
|
+
def lazy_compile(func: FuncAny) -> bool:
|
|
186
|
+
return False
|
|
187
|
+
|
|
188
|
+
def mlock_profiler_dependencies() -> None:
|
|
189
|
+
return None
|
|
190
|
+
|
|
191
|
+
def multithreaded_compile_test() -> None:
|
|
192
|
+
return None
|
|
193
|
+
|
|
194
|
+
def page_in_profiler_dependencies() -> list[str]:
|
|
195
|
+
return []
|
|
196
|
+
|
|
197
|
+
def precompile_all(workers: int = 0) -> bool:
|
|
198
|
+
return False
|
|
199
|
+
|
|
200
|
+
def read_jit_list(path: str) -> None:
|
|
201
|
+
return None
|
|
202
|
+
|
|
203
|
+
def set_max_code_size(max_code_size: int) -> None:
|
|
204
|
+
return None
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
@contextmanager
|
|
208
|
+
def pause(deopt_all: bool = False) -> Generator[None, None, None]:
|
|
209
|
+
"""
|
|
210
|
+
Context manager for temporarily pausing the JIT.
|
|
211
|
+
|
|
212
|
+
This will disable the JIT from running on new functions, and if you set
|
|
213
|
+
`deopt_all`, will also de-optimize all currently compiled functions to the
|
|
214
|
+
interpreter. When the JIT is unpaused, the compiled functions will be put
|
|
215
|
+
back.
|
|
216
|
+
"""
|
|
217
|
+
|
|
218
|
+
prev_enabled = is_enabled()
|
|
219
|
+
if prev_enabled:
|
|
220
|
+
disable(deopt_all=deopt_all)
|
|
221
|
+
|
|
222
|
+
try:
|
|
223
|
+
yield
|
|
224
|
+
finally:
|
|
225
|
+
if prev_enabled:
|
|
226
|
+
# Disable the warning from enable() when the JIT is not
|
|
227
|
+
# installed/initialized.
|
|
228
|
+
with catch_warnings():
|
|
229
|
+
simplefilter("ignore")
|
|
230
|
+
enable()
|
cinderx/opcode.py
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
# Generated via assign_opcode_numbers.py, do not edit.
|
|
4
|
+
|
|
5
|
+
# This is an addition to python/3.12/Lib/opcode.py, and is intended to be run
|
|
6
|
+
# via `exec` in generate_opcode_h.py with the globals dict obtained from
|
|
7
|
+
# running Lib/opcode.py.
|
|
8
|
+
|
|
9
|
+
# flake8: noqa
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
# Lib/opcode.py deletes these functions so we need to define them again here.
|
|
13
|
+
# We also need to update opname when we call def_op().
|
|
14
|
+
def init(
|
|
15
|
+
opname,
|
|
16
|
+
opmap,
|
|
17
|
+
hasname,
|
|
18
|
+
hasjrel,
|
|
19
|
+
hasjabs,
|
|
20
|
+
hasconst,
|
|
21
|
+
hasarg,
|
|
22
|
+
cache_format,
|
|
23
|
+
specializations,
|
|
24
|
+
inline_cache_entries,
|
|
25
|
+
interp_only=False,
|
|
26
|
+
):
|
|
27
|
+
def def_op(name, op):
|
|
28
|
+
opmap[name] = op
|
|
29
|
+
opname[op] = name
|
|
30
|
+
|
|
31
|
+
def name_op(name, op):
|
|
32
|
+
def_op(name, op)
|
|
33
|
+
hasname.append(op)
|
|
34
|
+
|
|
35
|
+
def jrel_op(name, op):
|
|
36
|
+
def_op(name, op)
|
|
37
|
+
hasjrel.append(op)
|
|
38
|
+
|
|
39
|
+
def jabs_op(name, op):
|
|
40
|
+
def_op(name, op)
|
|
41
|
+
hasjabs.append(op)
|
|
42
|
+
|
|
43
|
+
def_op("INVOKE_METHOD", 1)
|
|
44
|
+
hasconst.append(1)
|
|
45
|
+
hasarg.append(1)
|
|
46
|
+
def_op("LOAD_FIELD", 2)
|
|
47
|
+
hasconst.append(2)
|
|
48
|
+
hasarg.append(2)
|
|
49
|
+
cache_format["LOAD_FIELD"] = "{'cache': 2}"
|
|
50
|
+
def_op("LOAD_OBJ_FIELD", 4)
|
|
51
|
+
hasconst.append(4)
|
|
52
|
+
hasarg.append(4)
|
|
53
|
+
if "LOAD_FIELD" not in specializations:
|
|
54
|
+
specializations["LOAD_FIELD"] = []
|
|
55
|
+
specializations["LOAD_FIELD"].append("LOAD_OBJ_FIELD")
|
|
56
|
+
def_op("LOAD_PRIMITIVE_FIELD", 5)
|
|
57
|
+
hasconst.append(5)
|
|
58
|
+
hasarg.append(5)
|
|
59
|
+
if "LOAD_FIELD" not in specializations:
|
|
60
|
+
specializations["LOAD_FIELD"] = []
|
|
61
|
+
specializations["LOAD_FIELD"].append("LOAD_PRIMITIVE_FIELD")
|
|
62
|
+
def_op("STORE_FIELD", 6)
|
|
63
|
+
hasconst.append(6)
|
|
64
|
+
hasarg.append(6)
|
|
65
|
+
cache_format["STORE_FIELD"] = "{'cache': 2}"
|
|
66
|
+
def_op("STORE_OBJ_FIELD", 7)
|
|
67
|
+
hasconst.append(7)
|
|
68
|
+
hasarg.append(7)
|
|
69
|
+
if "STORE_FIELD" not in specializations:
|
|
70
|
+
specializations["STORE_FIELD"] = []
|
|
71
|
+
specializations["STORE_FIELD"].append("STORE_OBJ_FIELD")
|
|
72
|
+
def_op("STORE_PRIMITIVE_FIELD", 8)
|
|
73
|
+
hasconst.append(8)
|
|
74
|
+
hasarg.append(8)
|
|
75
|
+
if "STORE_FIELD" not in specializations:
|
|
76
|
+
specializations["STORE_FIELD"] = []
|
|
77
|
+
specializations["STORE_FIELD"].append("STORE_PRIMITIVE_FIELD")
|
|
78
|
+
def_op("BUILD_CHECKED_LIST", 9)
|
|
79
|
+
hasconst.append(9)
|
|
80
|
+
hasarg.append(9)
|
|
81
|
+
cache_format["BUILD_CHECKED_LIST"] = "{'cache': 2}"
|
|
82
|
+
def_op("BUILD_CHECKED_LIST_CACHED", 10)
|
|
83
|
+
hasconst.append(10)
|
|
84
|
+
hasarg.append(10)
|
|
85
|
+
if "BUILD_CHECKED_LIST" not in specializations:
|
|
86
|
+
specializations["BUILD_CHECKED_LIST"] = []
|
|
87
|
+
specializations["BUILD_CHECKED_LIST"].append("BUILD_CHECKED_LIST_CACHED")
|
|
88
|
+
def_op("LOAD_TYPE", 11)
|
|
89
|
+
hasconst.append(11)
|
|
90
|
+
hasarg.append(11)
|
|
91
|
+
def_op("CAST", 12)
|
|
92
|
+
hasconst.append(12)
|
|
93
|
+
hasarg.append(12)
|
|
94
|
+
cache_format["CAST"] = "{'cache': 2}"
|
|
95
|
+
def_op("CAST_CACHED", 13)
|
|
96
|
+
hasconst.append(13)
|
|
97
|
+
hasarg.append(13)
|
|
98
|
+
if "CAST" not in specializations:
|
|
99
|
+
specializations["CAST"] = []
|
|
100
|
+
specializations["CAST"].append("CAST_CACHED")
|
|
101
|
+
def_op("LOAD_LOCAL", 14)
|
|
102
|
+
hasconst.append(14)
|
|
103
|
+
hasarg.append(14)
|
|
104
|
+
def_op("STORE_LOCAL", 15)
|
|
105
|
+
hasconst.append(15)
|
|
106
|
+
hasarg.append(15)
|
|
107
|
+
cache_format["STORE_LOCAL"] = "{'cache': 1}"
|
|
108
|
+
def_op("STORE_LOCAL_CACHED", 16)
|
|
109
|
+
hasconst.append(16)
|
|
110
|
+
hasarg.append(16)
|
|
111
|
+
if "STORE_LOCAL" not in specializations:
|
|
112
|
+
specializations["STORE_LOCAL"] = []
|
|
113
|
+
specializations["STORE_LOCAL"].append("STORE_LOCAL_CACHED")
|
|
114
|
+
def_op("PRIMITIVE_BOX", 17)
|
|
115
|
+
hasarg.append(17)
|
|
116
|
+
jrel_op("POP_JUMP_IF_ZERO", 100)
|
|
117
|
+
hasarg.append(100)
|
|
118
|
+
inline_cache_entries["POP_JUMP_IF_ZERO"] = 1
|
|
119
|
+
jrel_op("POP_JUMP_IF_NONZERO", 103)
|
|
120
|
+
hasarg.append(103)
|
|
121
|
+
inline_cache_entries["POP_JUMP_IF_NONZERO"] = 1
|
|
122
|
+
def_op("PRIMITIVE_UNBOX", 18)
|
|
123
|
+
hasarg.append(18)
|
|
124
|
+
def_op("PRIMITIVE_BINARY_OP", 19)
|
|
125
|
+
hasarg.append(19)
|
|
126
|
+
def_op("PRIMITIVE_UNARY_OP", 20)
|
|
127
|
+
hasarg.append(20)
|
|
128
|
+
def_op("PRIMITIVE_COMPARE_OP", 21)
|
|
129
|
+
hasarg.append(21)
|
|
130
|
+
def_op("LOAD_ITERABLE_ARG", 22)
|
|
131
|
+
hasarg.append(22)
|
|
132
|
+
def_op("LOAD_MAPPING_ARG", 23)
|
|
133
|
+
hasarg.append(23)
|
|
134
|
+
def_op("INVOKE_FUNCTION", 24)
|
|
135
|
+
hasconst.append(24)
|
|
136
|
+
hasarg.append(24)
|
|
137
|
+
cache_format["INVOKE_FUNCTION"] = "{'cache': 4}"
|
|
138
|
+
def_op("INVOKE_FUNCTION_CACHED", 25)
|
|
139
|
+
hasconst.append(25)
|
|
140
|
+
hasarg.append(25)
|
|
141
|
+
if "INVOKE_FUNCTION" not in specializations:
|
|
142
|
+
specializations["INVOKE_FUNCTION"] = []
|
|
143
|
+
specializations["INVOKE_FUNCTION"].append("INVOKE_FUNCTION_CACHED")
|
|
144
|
+
def_op("INVOKE_INDIRECT_CACHED", 26)
|
|
145
|
+
hasconst.append(26)
|
|
146
|
+
hasarg.append(26)
|
|
147
|
+
if "INVOKE_FUNCTION" not in specializations:
|
|
148
|
+
specializations["INVOKE_FUNCTION"] = []
|
|
149
|
+
specializations["INVOKE_FUNCTION"].append("INVOKE_INDIRECT_CACHED")
|
|
150
|
+
def_op("FAST_LEN", 27)
|
|
151
|
+
hasarg.append(27)
|
|
152
|
+
def_op("CONVERT_PRIMITIVE", 28)
|
|
153
|
+
hasarg.append(28)
|
|
154
|
+
def_op("INVOKE_NATIVE", 29)
|
|
155
|
+
hasconst.append(29)
|
|
156
|
+
hasarg.append(29)
|
|
157
|
+
def_op("LOAD_CLASS", 30)
|
|
158
|
+
hasconst.append(30)
|
|
159
|
+
hasarg.append(30)
|
|
160
|
+
def_op("BUILD_CHECKED_MAP", 31)
|
|
161
|
+
hasconst.append(31)
|
|
162
|
+
hasarg.append(31)
|
|
163
|
+
cache_format["BUILD_CHECKED_MAP"] = "{'cache': 2}"
|
|
164
|
+
def_op("BUILD_CHECKED_MAP_CACHED", 32)
|
|
165
|
+
hasconst.append(32)
|
|
166
|
+
hasarg.append(32)
|
|
167
|
+
if "BUILD_CHECKED_MAP" not in specializations:
|
|
168
|
+
specializations["BUILD_CHECKED_MAP"] = []
|
|
169
|
+
specializations["BUILD_CHECKED_MAP"].append("BUILD_CHECKED_MAP_CACHED")
|
|
170
|
+
def_op("SEQUENCE_GET", 33)
|
|
171
|
+
hasarg.append(33)
|
|
172
|
+
def_op("SEQUENCE_SET", 34)
|
|
173
|
+
hasarg.append(34)
|
|
174
|
+
def_op("LIST_DEL", 35)
|
|
175
|
+
def_op("REFINE_TYPE", 36)
|
|
176
|
+
hasconst.append(36)
|
|
177
|
+
hasarg.append(36)
|
|
178
|
+
def_op("PRIMITIVE_LOAD_CONST", 37)
|
|
179
|
+
hasconst.append(37)
|
|
180
|
+
hasarg.append(37)
|
|
181
|
+
def_op("RETURN_PRIMITIVE", 40)
|
|
182
|
+
hasarg.append(40)
|
|
183
|
+
def_op("TP_ALLOC", 41)
|
|
184
|
+
hasconst.append(41)
|
|
185
|
+
hasarg.append(41)
|
|
186
|
+
cache_format["TP_ALLOC"] = "{'cache': 2}"
|
|
187
|
+
def_op("TP_ALLOC_CACHED", 42)
|
|
188
|
+
hasconst.append(42)
|
|
189
|
+
hasarg.append(42)
|
|
190
|
+
if "TP_ALLOC" not in specializations:
|
|
191
|
+
specializations["TP_ALLOC"] = []
|
|
192
|
+
specializations["TP_ALLOC"].append("TP_ALLOC_CACHED")
|
|
193
|
+
def_op("LOAD_METHOD_STATIC", 43)
|
|
194
|
+
hasconst.append(43)
|
|
195
|
+
hasarg.append(43)
|
|
196
|
+
cache_format["LOAD_METHOD_STATIC"] = "{'cache': 2}"
|
|
197
|
+
def_op("LOAD_METHOD_STATIC_CACHED", 45)
|
|
198
|
+
hasconst.append(45)
|
|
199
|
+
hasarg.append(45)
|
|
200
|
+
if "LOAD_METHOD_STATIC" not in specializations:
|
|
201
|
+
specializations["LOAD_METHOD_STATIC"] = []
|
|
202
|
+
specializations["LOAD_METHOD_STATIC"].append("LOAD_METHOD_STATIC_CACHED")
|
cinderx/static.py
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
# pyre-strict
|
|
3
|
+
|
|
4
|
+
# pyre-ignore[21]: _cinderx is not using cpp_python_extension() yet.
|
|
5
|
+
from _cinderx import StaticTypeError # noqa: F401
|
|
6
|
+
|
|
7
|
+
# pyre-ignore[21]: _static is defined as part of _cinderx.
|
|
8
|
+
from _static import ( # noqa: F401
|
|
9
|
+
__build_cinder_class__,
|
|
10
|
+
_clear_dlopen_cache,
|
|
11
|
+
_clear_dlsym_cache,
|
|
12
|
+
_property_missing_fget,
|
|
13
|
+
_property_missing_fset,
|
|
14
|
+
_sizeof_dlopen_cache,
|
|
15
|
+
_sizeof_dlsym_cache,
|
|
16
|
+
# Checked Containers
|
|
17
|
+
chkdict,
|
|
18
|
+
chklist,
|
|
19
|
+
FAST_LEN_ARRAY,
|
|
20
|
+
FAST_LEN_DICT,
|
|
21
|
+
FAST_LEN_INEXACT,
|
|
22
|
+
FAST_LEN_LIST,
|
|
23
|
+
FAST_LEN_SET,
|
|
24
|
+
FAST_LEN_STR,
|
|
25
|
+
FAST_LEN_TUPLE,
|
|
26
|
+
init_subclass,
|
|
27
|
+
install_sp_audit_hook,
|
|
28
|
+
is_static_callable,
|
|
29
|
+
is_static_module,
|
|
30
|
+
is_type_static,
|
|
31
|
+
lookup_native_symbol,
|
|
32
|
+
make_context_decorator_wrapper,
|
|
33
|
+
make_recreate_cm,
|
|
34
|
+
posix_clock_gettime_ns,
|
|
35
|
+
PRIM_OP_ADD_DBL,
|
|
36
|
+
PRIM_OP_ADD_INT,
|
|
37
|
+
PRIM_OP_AND_INT,
|
|
38
|
+
PRIM_OP_DIV_DBL,
|
|
39
|
+
PRIM_OP_DIV_INT,
|
|
40
|
+
PRIM_OP_DIV_UN_INT,
|
|
41
|
+
PRIM_OP_EQ_DBL,
|
|
42
|
+
PRIM_OP_EQ_INT,
|
|
43
|
+
PRIM_OP_GE_DBL,
|
|
44
|
+
PRIM_OP_GE_INT,
|
|
45
|
+
PRIM_OP_GE_UN_INT,
|
|
46
|
+
PRIM_OP_GT_DBL,
|
|
47
|
+
PRIM_OP_GT_INT,
|
|
48
|
+
PRIM_OP_GT_UN_INT,
|
|
49
|
+
PRIM_OP_INV_INT,
|
|
50
|
+
PRIM_OP_LE_DBL,
|
|
51
|
+
PRIM_OP_LE_INT,
|
|
52
|
+
PRIM_OP_LE_UN_INT,
|
|
53
|
+
PRIM_OP_LSHIFT_INT,
|
|
54
|
+
PRIM_OP_LT_DBL,
|
|
55
|
+
PRIM_OP_LT_INT,
|
|
56
|
+
PRIM_OP_LT_UN_INT,
|
|
57
|
+
PRIM_OP_MOD_DBL,
|
|
58
|
+
PRIM_OP_MOD_INT,
|
|
59
|
+
PRIM_OP_MOD_UN_INT,
|
|
60
|
+
PRIM_OP_MUL_DBL,
|
|
61
|
+
PRIM_OP_MUL_INT,
|
|
62
|
+
PRIM_OP_NE_DBL,
|
|
63
|
+
PRIM_OP_NE_INT,
|
|
64
|
+
PRIM_OP_NEG_DBL,
|
|
65
|
+
PRIM_OP_NEG_INT,
|
|
66
|
+
PRIM_OP_NOT_INT,
|
|
67
|
+
PRIM_OP_OR_INT,
|
|
68
|
+
PRIM_OP_POW_DBL,
|
|
69
|
+
PRIM_OP_POW_INT,
|
|
70
|
+
PRIM_OP_POW_UN_INT,
|
|
71
|
+
PRIM_OP_RSHIFT_INT,
|
|
72
|
+
PRIM_OP_RSHIFT_UN_INT,
|
|
73
|
+
PRIM_OP_SUB_DBL,
|
|
74
|
+
PRIM_OP_SUB_INT,
|
|
75
|
+
PRIM_OP_XOR_INT,
|
|
76
|
+
rand,
|
|
77
|
+
RAND_MAX,
|
|
78
|
+
resolve_primitive_descr,
|
|
79
|
+
SEQ_ARRAY_INT64,
|
|
80
|
+
SEQ_CHECKED_LIST,
|
|
81
|
+
SEQ_LIST,
|
|
82
|
+
SEQ_LIST_INEXACT,
|
|
83
|
+
SEQ_REPEAT_INEXACT_NUM,
|
|
84
|
+
SEQ_REPEAT_INEXACT_SEQ,
|
|
85
|
+
SEQ_REPEAT_PRIMITIVE_NUM,
|
|
86
|
+
SEQ_REPEAT_REVERSED,
|
|
87
|
+
SEQ_SUBSCR_UNCHECKED,
|
|
88
|
+
SEQ_TUPLE,
|
|
89
|
+
# Static Methods,
|
|
90
|
+
set_type_code,
|
|
91
|
+
set_type_final,
|
|
92
|
+
set_type_static,
|
|
93
|
+
set_type_static_final,
|
|
94
|
+
# Static Classes
|
|
95
|
+
staticarray,
|
|
96
|
+
TYPED_ARRAY,
|
|
97
|
+
TYPED_BOOL,
|
|
98
|
+
TYPED_CHAR,
|
|
99
|
+
TYPED_DOUBLE,
|
|
100
|
+
TYPED_INT16,
|
|
101
|
+
TYPED_INT32,
|
|
102
|
+
TYPED_INT64,
|
|
103
|
+
TYPED_INT8,
|
|
104
|
+
TYPED_INT_16BIT,
|
|
105
|
+
TYPED_INT_32BIT,
|
|
106
|
+
TYPED_INT_64BIT,
|
|
107
|
+
TYPED_OBJECT,
|
|
108
|
+
TYPED_SINGLE,
|
|
109
|
+
TYPED_UINT16,
|
|
110
|
+
TYPED_UINT32,
|
|
111
|
+
TYPED_UINT64,
|
|
112
|
+
TYPED_UINT8,
|
|
113
|
+
)
|