summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2020-07-27 15:01:29 +0200
committerNikita Popov <nikita.ppv@gmail.com>2020-07-27 15:02:59 +0200
commit6d97e7f0e93377ecfe48dc5302b2990ddc429ad3 (patch)
tree7467517380e6cafc93ebac30802114ec41e93c62
parent52cebf65f8594c15904edc11a0b38b4b382a0d5d (diff)
downloadphp-git-6d97e7f0e93377ecfe48dc5302b2990ddc429ad3.tar.gz
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.
-rw-r--r--Zend/tests/return_types/internal_functions001.phpt2
-rw-r--r--ext/opcache/jit/zend_jit_x86.dasc22
2 files changed, 2 insertions, 22 deletions
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)