static size_t dasm_size = 0;
+static zend_long jit_bisect_pos = 0;
+
static const void *zend_jit_runtime_jit_handler = NULL;
static const void *zend_jit_profile_jit_handler = NULL;
static const void *zend_jit_func_counter_handler = NULL;
zend_bool is_terminated = 1; /* previous basic block is terminated by jump */
zend_bool recv_emitted = 0; /* emitted at least one RECV opcode */
+ if (ZCG(accel_directives).jit_bisect_limit) {
+ jit_bisect_pos++;
+ if (jit_bisect_pos >= ZCG(accel_directives).jit_bisect_limit) {
+ if (jit_bisect_pos == ZCG(accel_directives).jit_bisect_limit) {
+ fprintf(stderr, "Not JITing %s%s%s in %s:%d and after due to jit_bisect_limit\n",
+ op_array->scope ? ZSTR_VAL(op_array->scope->name) : "",
+ op_array->scope ? "::" : "",
+ op_array->function_name ? ZSTR_VAL(op_array->function_name) : "{main}",
+ ZSTR_VAL(op_array->filename), op_array->line_start);
+ }
+ return FAILURE;
+ }
+ }
+
if (zend_jit_reg_alloc) {
checkpoint = zend_arena_checkpoint(CG(arena));
ra = zend_jit_allocate_registers(op_array, ssa);
STD_PHP_INI_ENTRY("opcache.jit" , ZEND_JIT_DEFAULT, PHP_INI_SYSTEM, OnUpdateLong, accel_directives.jit, zend_accel_globals, accel_globals)
STD_PHP_INI_ENTRY("opcache.jit_buffer_size" , "0" , PHP_INI_SYSTEM, OnUpdateLong, accel_directives.jit_buffer_size, zend_accel_globals, accel_globals)
STD_PHP_INI_ENTRY("opcache.jit_debug" , "0" , PHP_INI_SYSTEM, OnUpdateLong, accel_directives.jit_debug, zend_accel_globals, accel_globals)
+ STD_PHP_INI_ENTRY("opcache.jit_bisect_limit" , "0" , PHP_INI_SYSTEM, OnUpdateLong, accel_directives.jit_bisect_limit, zend_accel_globals, accel_globals)
#endif
ZEND_INI_END()
add_assoc_long(&directives, "opcache.jit", ZCG(accel_directives).jit);
add_assoc_long(&directives, "opcache.jit_buffer_size", ZCG(accel_directives).jit_buffer_size);
add_assoc_long(&directives, "opcache.jit_debug", ZCG(accel_directives).jit_debug);
+ add_assoc_long(&directives, "opcache.jit_bisect_limit", ZCG(accel_directives).jit_bisect_limit);
#endif
add_assoc_zval(return_value, "directives", &directives);