@@ -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" );
@@ -531,9 +524,6 @@ _PyJIT_Compile(_PyExecutorObject *executor, const _PyUOpInstruction trace[], siz
531524 if (memory == NULL ) {
532525 return -1 ;
533526 }
534- #ifdef MAP_JIT
535- pthread_jit_write_protect_np (0 );
536- #endif
537527 // Collect memory stats
538528 OPT_STAT_ADD (jit_total_memory_size , total_size );
539529 OPT_STAT_ADD (jit_code_size , code_size );
@@ -571,9 +561,6 @@ _PyJIT_Compile(_PyExecutorObject *executor, const _PyUOpInstruction trace[], siz
571561 data += group -> data_size ;
572562 assert (code == memory + code_size );
573563 assert (data == memory + code_size + state .trampolines .size + code_padding + data_size );
574- #ifdef MAP_JIT
575- pthread_jit_write_protect_np (1 );
576- #endif
577564 if (mark_executable (memory , total_size )) {
578565 jit_free (memory , total_size );
579566 return -1 ;
0 commit comments