@@ -2854,6 +2854,10 @@ static int accel_startup(zend_extension *extension)
2854
2854
accel_globals_ctor (& accel_globals );
2855
2855
#endif
2856
2856
2857
+ #ifdef HAVE_JIT
2858
+ zend_jit_init ();
2859
+ #endif
2860
+
2857
2861
#ifdef ZEND_WIN32
2858
2862
# if !defined(__has_feature ) || !__has_feature (address_sanitizer )
2859
2863
_setmaxstdio (2048 ); /* The default configuration is limited to 512 stdio files */
@@ -2937,8 +2941,7 @@ static int accel_post_startup(void)
2937
2941
size_t jit_size = 0 ;
2938
2942
zend_bool reattached = 0 ;
2939
2943
2940
- if (ZCG (accel_directives ).jit &&
2941
- ZCG (accel_directives ).jit_buffer_size ) {
2944
+ if (JIT_G (enabled ) && JIT_G (buffer_size )) {
2942
2945
size_t page_size ;
2943
2946
2944
2947
# ifdef _WIN32
@@ -2952,12 +2955,9 @@ static int accel_post_startup(void)
2952
2955
zend_accel_error (ACCEL_LOG_FATAL , "Failure to initialize shared memory structures - can't get page size." );
2953
2956
abort ();
2954
2957
}
2955
- jit_size = ZCG ( accel_directives ). jit_buffer_size ;
2958
+ jit_size = JIT_G ( buffer_size ) ;
2956
2959
jit_size = ZEND_MM_ALIGNED_SIZE_EX (jit_size , page_size );
2957
2960
shm_size += jit_size ;
2958
- } else {
2959
- ZCG (accel_directives ).jit = 0 ;
2960
- ZCG (accel_directives ).jit_buffer_size = 0 ;
2961
2961
}
2962
2962
2963
2963
switch (zend_shared_alloc_startup (shm_size , jit_size )) {
@@ -3010,13 +3010,13 @@ static int accel_post_startup(void)
3010
3010
3011
3011
zend_shared_alloc_lock ();
3012
3012
#ifdef HAVE_JIT
3013
- if (ZCG ( accel_directives ). jit &&
3014
- ZCG ( accel_directives ). jit_buffer_size &&
3015
- ZSMMG (reserved ) &&
3016
- zend_jit_startup (ZCG ( accel_directives ). jit , ZSMMG (reserved ), jit_size , reattached ) = = SUCCESS ) {
3017
- ZCG ( jit_enabled ) = 1 ;
3018
- } else {
3019
- ZCG ( jit_enabled ) = 0 ;
3013
+ if (JIT_G ( enabled )) {
3014
+ if ( JIT_G ( buffer_size ) == 0
3015
+ || ! ZSMMG (reserved )
3016
+ || zend_jit_startup (ZSMMG (reserved ), jit_size , reattached ) ! = SUCCESS ) {
3017
+ JIT_G ( enabled ) = 0 ;
3018
+ JIT_G ( on ) = 0 ;
3019
+ }
3020
3020
}
3021
3021
#endif
3022
3022
zend_shared_alloc_save_state ();
0 commit comments