diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2019-08-30 12:47:49 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-08-30 14:50:22 +0200 |
commit | 65fa6dac195a859f6b96bdbf06f69645215df9c6 (patch) | |
tree | 0d21e3a1d494a9b40c504da6c4f7e3883ea55923 /ext/opcache/jit | |
parent | 39ab4104ed89d2457742dea4bd68e7e5fa2901c6 (diff) | |
download | php-git-65fa6dac195a859f6b96bdbf06f69645215df9c6.tar.gz |
Add jit_bisect_limit
To help identify which function is being miscompiled.
Diffstat (limited to 'ext/opcache/jit')
-rw-r--r-- | ext/opcache/jit/zend_jit.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/ext/opcache/jit/zend_jit.c b/ext/opcache/jit/zend_jit.c index 6f537da44b..bba076cac7 100644 --- a/ext/opcache/jit/zend_jit.c +++ b/ext/opcache/jit/zend_jit.c @@ -92,6 +92,8 @@ static void **dasm_ptr = NULL; 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; @@ -1972,6 +1974,20 @@ static int zend_jit(zend_op_array *op_array, zend_ssa *ssa, const zend_op *rt_op 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); |