#ifdef HAVE_JIT
if (ZCG(accel_directives).jit &&
ZCG(accel_directives).jit_buffer_size &&
- ZSMMG(reserved)) {
- zend_jit_startup(ZCG(accel_directives).jit, ZSMMG(reserved), jit_size, reattached);
+ ZSMMG(reserved) &&
+ zend_jit_startup(ZCG(accel_directives).jit, ZSMMG(reserved), jit_size, reattached) == SUCCESS) {
+ ZCG(jit_enabled) = 1;
} else {
- ZCG(accel_directives).jit = 0;
- ZCG(accel_directives).jit_buffer_size = 0;
+ ZCG(jit_enabled) = 0;
}
#endif
zend_shared_alloc_save_state();
void *arena_mem;
zend_persistent_script *current_persistent_script;
zend_bool is_immutable_class;
+#ifdef HAVE_JIT
+ zend_bool jit_enabled;
+#endif
/* cache to save hash lookup on the same INCLUDE opcode */
const zend_op *cache_opline;
zend_persistent_script *cache_persistent_script;
php_info_print_table_row(2, "File Cache", "Disabled");
}
#if HAVE_JIT
- if (ZCG(accel_directives).jit) {
+ if (ZCG(jit_enabled)) {
php_info_print_table_row(2, "JIT", "Enabled");
} else {
php_info_print_table_row(2, "JIT", "Disabled");
#ifdef HAVE_JIT
/* FIXME: dump jited codes out to file cache? */
- if (ZCG(accel_directives).jit) {
+ if (ZCG(jit_enabled)) {
return FAILURE;
}
#endif
ZCG(mem) = (void*)((char*)ZCG(mem) + ZEND_ALIGNED_SIZE(zend_extensions_op_array_persist(op_array, ZCG(mem))));
#ifdef HAVE_JIT
- if (ZCG(accel_directives).jit &&
+ if (ZCG(jit_enabled) &&
ZEND_JIT_LEVEL(ZCG(accel_directives).jit) <= ZEND_JIT_LEVEL_OPT_FUNCS &&
!ZCG(current_persistent_script)->corrupted) {
zend_jit_op_array(op_array, ZCG(current_persistent_script) ? &ZCG(current_persistent_script)->script : NULL);
ZCG(mem) = (void*)((char*)ZCG(mem) + script->arena_size);
#ifdef HAVE_JIT
- if (ZCG(accel_directives).jit && for_shm) {
+ if (ZCG(jit_enabled) && for_shm) {
zend_jit_unprotect();
}
#endif
ZCSG(map_ptr_last) = CG(map_ptr_last);
#ifdef HAVE_JIT
- if (ZCG(accel_directives).jit && for_shm) {
+ if (ZCG(jit_enabled) && for_shm) {
if (ZEND_JIT_LEVEL(ZCG(accel_directives).jit) >= ZEND_JIT_LEVEL_OPT_SCRIPT) {
zend_jit_script(&script->script);
}