Skip to content

Commit 3834917

Browse files
alexmalyshevmeta-codesync[bot]
authored andcommitted
Add cinderjit.pyi
Summary: Helps type cinderx/jit.py and users of it. Reviewed By: czardoz Differential Revision: D92886068 fbshipit-source-id: dcd4d2da1b6f61a58ecb78062205563d5aa451f4
1 parent 43c0ff1 commit 3834917

1 file changed

Lines changed: 63 additions & 0 deletions

File tree

cinderx/cinderjit.pyi

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
2+
3+
# pyre-strict
4+
5+
from collections.abc import AsyncGenerator, Callable, Coroutine, Generator
6+
from typing import TypeVar
7+
8+
FuncAny = Callable[..., object]
9+
10+
TDeoptGenYield = TypeVar("TDeoptGenYield")
11+
TDeoptGenSend = TypeVar("TDeoptGenSend")
12+
TDeoptGenReturn = TypeVar("TDeoptGenReturn")
13+
14+
def _deopt_gen(
15+
gen: (
16+
Generator[TDeoptGenYield, TDeoptGenSend, TDeoptGenReturn]
17+
| AsyncGenerator[TDeoptGenYield, TDeoptGenSend]
18+
| Coroutine[TDeoptGenYield, TDeoptGenSend, TDeoptGenReturn]
19+
),
20+
) -> bool: ...
21+
def append_jit_list(entry: str) -> None: ...
22+
def auto() -> None: ...
23+
def clear_runtime_stats() -> None: ...
24+
def compile_after_n_calls(calls: int) -> None: ...
25+
def count_interpreted_calls(func: FuncAny) -> int: ...
26+
def disable(deopt_all: bool = False) -> None: ...
27+
def disable(deopt_all: bool = False) -> None: ...
28+
def disable_emit_type_annotation_guards() -> None: ...
29+
def disable_hir_inliner() -> None: ...
30+
def disable_specialized_opcodes() -> None: ...
31+
def enable() -> None: ...
32+
def enable_emit_type_annotation_guards() -> None: ...
33+
def enable_hir_inliner() -> None: ...
34+
def enable_specialized_opcodes() -> None: ...
35+
def force_compile(func: FuncAny) -> bool: ...
36+
def force_uncompile(func: FuncAny) -> bool: ...
37+
def get_allocator_stats() -> dict[str, int]: ...
38+
def get_and_clear_inline_cache_stats() -> dict[str, object]: ...
39+
def get_and_clear_runtime_stats() -> dict[str, object]: ...
40+
def get_compilation_time() -> int: ...
41+
def get_compile_after_n_calls() -> int | None: ...
42+
def get_compiled_functions() -> list[FuncAny]: ...
43+
def get_compiled_size(func: FuncAny) -> int: ...
44+
def get_compiled_spill_stack_size(func: FuncAny) -> int: ...
45+
def get_compiled_stack_size(func: FuncAny) -> int: ...
46+
def get_function_compilation_time(func: FuncAny) -> int: ...
47+
def get_function_hir_opcode_counts(func: FuncAny) -> dict[str, int] | None: ...
48+
def get_inlined_functions_stats(func: FuncAny) -> dict[str, object]: ...
49+
def get_jit_list() -> tuple[dict[str, set[str]], dict[str, dict[str, set[int]]]]: ...
50+
def get_num_inlined_functions(func: FuncAny) -> int: ...
51+
def is_enabled() -> bool: ...
52+
def is_hir_inliner_enabled() -> bool: ...
53+
def is_inline_cache_stats_collection_enabled() -> bool: ...
54+
def is_jit_compiled(func: FuncAny) -> bool: ...
55+
def jit_suppress(func: FuncAny) -> FuncAny: ...
56+
def jit_unsuppress(func: FuncAny) -> FuncAny: ...
57+
def lazy_compile(func: FuncAny) -> bool: ...
58+
def mlock_profiler_dependencies() -> None: ...
59+
def multithreaded_compile_test() -> None: ...
60+
def page_in_profiler_dependencies() -> list[str]: ...
61+
def precompile_all(workers: int = 0) -> bool: ...
62+
def read_jit_list(path: str) -> None: ...
63+
def set_max_code_size(max_code_size: int) -> None: ...

0 commit comments

Comments
 (0)