4646#include " cinderx/Shadowcode/shadowcode.h"
4747#include " cinderx/module_state.h"
4848
49+ #ifndef WIN32
4950#include < dlfcn.h>
51+ #endif
5052#include < fmt/std.h>
5153
5254#include < atomic>
@@ -695,6 +697,7 @@ FlagProcessor initFlagProcessor() {
695697 " Add RefineType instructions to coerce Static Python types to be "
696698 " valid" );
697699
700+ #ifndef WIN32
698701 flag_processor.addOption (
699702 " jit-perfmap" ,
700703 " JIT_PERFMAP" ,
@@ -709,6 +712,7 @@ FlagProcessor initFlagProcessor() {
709712 " absolute path to a <DIRECTORY> that exists. A perf jitdump file "
710713 " will be written to this directory" )
711714 .withFlagParamName (" DIRECTORY" );
715+ #endif
712716
713717 flag_processor.addOption (
714718 " jit-help" , " " , [] {}, " print all available JIT flags and exits" );
@@ -1732,6 +1736,7 @@ int aot_func_visitor(PyObject* obj, void* arg) {
17321736 return kGcVisitContinue ;
17331737}
17341738
1739+ #ifndef WIN32
17351740PyObject* load_aot_bundle (PyObject* /* self */ , PyObject* arg) {
17361741 JIT_CHECK (
17371742 jitCtx () != nullptr ,
@@ -1796,6 +1801,7 @@ PyObject* load_aot_bundle(PyObject* /* self */, PyObject* arg) {
17961801
17971802 Py_RETURN_NONE;
17981803}
1804+ #endif
17991805
18001806PyObject* get_compile_after_n_calls (PyObject* /* self */ , PyObject*) {
18011807 auto limit = getConfig ().compile_after_n_calls ;
@@ -1878,6 +1884,7 @@ PyObject* disassemble(PyObject* /* self */, PyObject* func) {
18781884 Py_RETURN_NONE;
18791885}
18801886
1887+ #ifndef WIN32
18811888PyObject* dump_elf (PyObject* /* self */ , PyObject* arg) {
18821889 JIT_CHECK (
18831890 jitCtx () != nullptr ,
@@ -1916,6 +1923,7 @@ PyObject* dump_elf(PyObject* /* self */, PyObject* arg) {
19161923
19171924 Py_RETURN_NONE;
19181925}
1926+ #endif
19191927
19201928PyObject* get_jit_list (PyObject* /* self */ , PyObject*) {
19211929 if (auto jit_list = cinderx::getModuleState ()->jitList ()) {
@@ -2773,6 +2781,7 @@ PyMethodDef jit_methods[] = {
27732781 " Configure the JIT to automatically compile functions after "
27742782 " they are called a set number of times." )},
27752783 {" disassemble" , disassemble, METH_O , " Disassemble JIT compiled functions." },
2784+ #ifndef WIN32
27762785 {" dump_elf" ,
27772786 dump_elf,
27782787 METH_O ,
@@ -2788,6 +2797,7 @@ PyMethodDef jit_methods[] = {
27882797 " file, whose filepath is passed as the first argument. Note: "
27892798 " This does not actually work yet, it's being used for debugging "
27902799 " purposes." )},
2800+ #endif
27912801 {" get_compile_after_n_calls" ,
27922802 get_compile_after_n_calls,
27932803 METH_NOARGS ,
@@ -3576,7 +3586,9 @@ void finalize() {
35763586 mod_state->setJitContext (nullptr );
35773587 mod_state->setCodeAllocator (nullptr );
35783588
3589+ #ifndef WIN32
35793590 g_aot_ctx.destroy ();
3591+ #endif
35803592
35813593 restoreSysMonitoringRegisterCallback ();
35823594 restoreSysSetProfileAndSetTrace ();
0 commit comments