com php-src: JIT internal functions with return type in debug mode: Zend/tests/return_types/internal_functions001.phpt
ext/opcache/jit/zend_jit_x86.dasc
| From: | Nikita Popov | Date: | Mon, 27 Jul 2020 13:02:59 +0000 |
| Subject: | com php-src: JIT internal functions with return type in debug mode: Zend/tests/return_types/internal_functions001.phpt ext/opcache/jit/zend_jit_x86.dasc |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-112375@lists.php.net to get a copy of this message | ||
Commit: 6d97e7f0e93377ecfe48dc5302b2990ddc429ad3
Author: Nikita Popov <nikita.ppv@gmail.com> Mon, 27 Jul 2020 15:01:29 +0200
Parents: 52cebf65f8594c15904edc11a0b38b4b382a0d5d
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=6d97e7f0e93377ecfe48dc5302b2990ddc429ad3
Log:
JIT internal functions with return type in debug mode
The return type check is just a debug assertion, it's okay if it
is not performed in JIT mode. We already don't perform all the
argument validation in that case. Just disable the one test that
checks for this.
This removes an annoying discrepancy between debug&release mode.
Changed paths:
M Zend/tests/return_types/internal_functions001.phpt
M ext/opcache/jit/zend_jit_x86.dasc
Diff:
diff --git a/Zend/tests/return_types/internal_functions001.phpt
b/Zend/tests/return_types/internal_functions001.phpt
index ebed8515e5..153e32ca6e 100644
--- a/Zend/tests/return_types/internal_functions001.phpt
+++ b/Zend/tests/return_types/internal_functions001.phpt
@@ -6,6 +6,8 @@ if (!extension_loaded('zend-test')) die('skip zend-test extension not
loaded');
// Internal function return types are only checked in debug builds
if (!PHP_DEBUG) die('skip requires debug build');
?>
+--INI--
+opcache.jit=0
--FILE--
<?php
zend_test_array_return();
diff --git a/ext/opcache/jit/zend_jit_x86.dasc b/ext/opcache/jit/zend_jit_x86.dasc
index 6ae7f32508..f9690b3e7c 100644
--- a/ext/opcache/jit/zend_jit_x86.dasc
+++ b/ext/opcache/jit/zend_jit_x86.dasc
@@ -8579,14 +8579,6 @@ static int zend_jit_do_fcall(dasm_State **Dst, const zend_op *opline, const
zend
} else if (func->type == ZEND_INTERNAL_FUNCTION) {
ZEND_ASSERT(opline->opcode != ZEND_DO_UCALL);
call_num_args = call_info->num_args;
-#if ZEND_DEBUG
- if (func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) {
- // TODO: Now most internal functions have type hints ???
- if (!trace) {
- goto fallback;
- }
- }
-#endif
} else {
ZEND_UNREACHABLE();
}
@@ -9112,20 +9104,6 @@ static int zend_jit_do_fcall(dasm_State **Dst, const zend_op *opline, const
zend
}
return 1;
-#if ZEND_DEBUG
-fallback:
- /* fallback to subroutine threading */
- if (trace) {
- return zend_jit_trace_handler(Dst, op_array, opline, /* may_throw */ 1, trace);
- }
- if (opline->opcode == ZEND_DO_FCALL ||
- opline->opcode == ZEND_DO_UCALL ||
- opline->opcode == ZEND_DO_FCALL_BY_NAME ){
- return zend_jit_call(Dst, opline, next_block);
- } else {
- return zend_jit_handler(Dst, opline, /* may_throw */ 1);
- }
-#endif
}
static int zend_jit_send_val(dasm_State **Dst, const zend_op *opline, const zend_op_array
*op_array, uint32_t op1_info, zend_jit_addr op1_addr)