com php-src: Respect optimization_level when running JI T inference: ext/opcache/jit/zend_jit.c
| From: | Nikita Popov | Date: | Tue, 28 May 2019 15:29:28 +0000 |
| Subject: | com php-src: Respect optimization_level when running JI T inference: ext/opcache/jit/zend_jit.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-106405@lists.php.net to get a copy of this message | ||
Commit: 4d1d5babde725febc5fdc7a7ccf576f3d0e3c099
Author: Nikita Popov <nikita.ppv@gmail.com> Tue, 28 May 2019 17:28:33 +0200
Parents: e1c903230e2f2492fa69c93d9adf296ba22e1231
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=4d1d5babde725febc5fdc7a7ccf576f3d0e3c099
Log:
Respect optimization_level when running JIT inference
Don't enable unsafe type inference by default -- we'll segfault on
some FFI tests.
Changed paths:
M ext/opcache/jit/zend_jit.c
Diff:
diff --git a/ext/opcache/jit/zend_jit.c b/ext/opcache/jit/zend_jit.c
index eabdcf3..0d43576 100644
--- a/ext/opcache/jit/zend_jit.c
+++ b/ext/opcache/jit/zend_jit.c
@@ -664,10 +664,8 @@ static int zend_jit_op_array_analyze2(zend_op_array *op_array, zend_script
*scri
&& !(op_array->fn_flags & ZEND_ACC_GENERATOR)
&& !(ssa->cfg.flags & ZEND_FUNC_INDIRECT_VAR_ACCESS)) {
- /* TODO: passing ZEND_OPTIMIZER_ALL_PASSES as optimization_level
- * may break overloaded operators (see ext/gmp/tests/overloading.phpt)
- */
- if (zend_ssa_inference(&CG(arena), op_array, script, ssa, ZEND_OPTIMIZER_ALL_PASSES /*-
ZEND_OPTIMIZER_IGNORE_OVERLOADING*/) != SUCCESS) {
+ uint32_t optimization_level = ZCG(accel_directives).optimization_level;
+ if (zend_ssa_inference(&CG(arena), op_array, script, ssa, optimization_level) != SUCCESS) {
return FAILURE;
}
}