@@ -69,10 +69,6 @@ jit_alloc(size_t size)
6969#else
7070 int flags = MAP_ANONYMOUS | MAP_PRIVATE ;
7171 int prot = PROT_READ | PROT_WRITE ;
72- # ifdef MAP_JIT
73- flags |= MAP_JIT ;
74- prot |= PROT_EXEC ;
75- # endif
7672 unsigned char * memory = mmap (NULL , size , prot , flags , -1 , 0 );
7773 int failed = memory == MAP_FAILED ;
7874#endif
@@ -118,11 +114,8 @@ mark_executable(unsigned char *memory, size_t size)
118114 int old ;
119115 int failed = !VirtualProtect (memory , size , PAGE_EXECUTE_READ , & old );
120116#else
121- int failed = 0 ;
122117 __builtin___clear_cache ((char * )memory , (char * )memory + size );
123- #ifndef MAP_JIT
124- failed = mprotect (memory , size , PROT_EXEC | PROT_READ );
125- #endif
118+ int failed = mprotect (memory , size , PROT_EXEC | PROT_READ );
126119#endif
127120 if (failed ) {
128121 jit_error ("unable to protect executable memory" );
@@ -528,9 +521,6 @@ _PyJIT_Compile(_PyExecutorObject *executor, const _PyUOpInstruction trace[], siz
528521 if (memory == NULL ) {
529522 return -1 ;
530523 }
531- #ifdef MAP_JIT
532- pthread_jit_write_protect_np (0 );
533- #endif
534524 // Collect memory stats
535525 OPT_STAT_ADD (jit_total_memory_size , total_size );
536526 OPT_STAT_ADD (jit_code_size , code_size );
@@ -568,9 +558,6 @@ _PyJIT_Compile(_PyExecutorObject *executor, const _PyUOpInstruction trace[], siz
568558 data += group -> data_size ;
569559 assert (code == memory + code_size );
570560 assert (data == memory + code_size + state .trampolines .size + data_size );
571- #ifdef MAP_JIT
572- pthread_jit_write_protect_np (1 );
573- #endif
574561 if (mark_executable (memory , total_size )) {
575562 jit_free (memory , total_size );
576563 return -1 ;
0 commit comments