Skip to content

Commit ff0e39b

Browse files
committed
Remove @jit Docblock support for now due to dev-time constraints
1 parent c8d47cf commit ff0e39b

File tree

1 file changed

+2
-53
lines changed

1 file changed

+2
-53
lines changed

ext/opcache/jit/zend_jit.c

Lines changed: 2 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -3518,24 +3518,6 @@ static int zend_jit_setup_hot_counters(zend_op_array *op_array)
35183518
return SUCCESS;
35193519
}
35203520

3521-
static int zend_needs_manual_jit(const zend_op_array *op_array)
3522-
{
3523-
if (op_array->doc_comment) {
3524-
const char *s = ZSTR_VAL(op_array->doc_comment);
3525-
const char *p = strstr(s, "@jit");
3526-
3527-
if (p) {
3528-
size_t l = ZSTR_LEN(op_array->doc_comment);
3529-
3530-
if ((p == s + 3 || *(p-1) <= ' ') &&
3531-
(p + 6 == s + l || *(p+4) <= ' ')) {
3532-
return 1;
3533-
}
3534-
}
3535-
}
3536-
return 0;
3537-
}
3538-
35393521
#include "jit/zend_jit_trace.c"
35403522

35413523
ZEND_EXT_API int zend_jit_op_array(zend_op_array *op_array, zend_script *script)
@@ -3589,12 +3571,6 @@ ZEND_EXT_API int zend_jit_op_array(zend_op_array *op_array, zend_script *script)
35893571
return zend_jit_setup_hot_trace_counters(op_array);
35903572
} else if (JIT_G(trigger) == ZEND_JIT_ON_SCRIPT_LOAD) {
35913573
return zend_real_jit_func(op_array, script, NULL);
3592-
} else if (JIT_G(trigger) == ZEND_JIT_ON_DOC_COMMENT) {
3593-
if (zend_needs_manual_jit(op_array)) {
3594-
return zend_real_jit_func(op_array, script, NULL);
3595-
} else {
3596-
return SUCCESS;
3597-
}
35983574
} else {
35993575
ZEND_UNREACHABLE();
36003576
}
@@ -3629,21 +3605,7 @@ ZEND_EXT_API int zend_jit_script(zend_script *script)
36293605
goto jit_failure;
36303606
}
36313607
}
3632-
} else if (JIT_G(trigger) == ZEND_JIT_ON_SCRIPT_LOAD ||
3633-
JIT_G(trigger) == ZEND_JIT_ON_DOC_COMMENT) {
3634-
3635-
if (JIT_G(trigger) == ZEND_JIT_ON_DOC_COMMENT) {
3636-
int do_jit = 0;
3637-
for (i = 0; i < call_graph.op_arrays_count; i++) {
3638-
if (zend_needs_manual_jit(call_graph.op_arrays[i])) {
3639-
do_jit = 1;
3640-
break;
3641-
}
3642-
}
3643-
if (!do_jit) {
3644-
goto jit_failure;
3645-
}
3646-
}
3608+
} else if (JIT_G(trigger) == ZEND_JIT_ON_SCRIPT_LOAD) {
36473609
for (i = 0; i < call_graph.op_arrays_count; i++) {
36483610
info = ZEND_FUNC_INFO(call_graph.op_arrays[i]);
36493611
if (info) {
@@ -3665,10 +3627,6 @@ ZEND_EXT_API int zend_jit_script(zend_script *script)
36653627
}
36663628

36673629
for (i = 0; i < call_graph.op_arrays_count; i++) {
3668-
if (JIT_G(trigger) == ZEND_JIT_ON_DOC_COMMENT &&
3669-
!zend_needs_manual_jit(call_graph.op_arrays[i])) {
3670-
continue;
3671-
}
36723630
info = ZEND_FUNC_INFO(call_graph.op_arrays[i]);
36733631
if (info) {
36743632
if (zend_jit_op_array_analyze2(call_graph.op_arrays[i], script, &info->ssa, ZCG(accel_directives).optimization_level) != SUCCESS) {
@@ -3680,10 +3638,6 @@ ZEND_EXT_API int zend_jit_script(zend_script *script)
36803638

36813639
if (JIT_G(debug) & ZEND_JIT_DEBUG_SSA) {
36823640
for (i = 0; i < call_graph.op_arrays_count; i++) {
3683-
if (JIT_G(trigger) == ZEND_JIT_ON_DOC_COMMENT &&
3684-
!zend_needs_manual_jit(call_graph.op_arrays[i])) {
3685-
continue;
3686-
}
36873641
info = ZEND_FUNC_INFO(call_graph.op_arrays[i]);
36883642
if (info) {
36893643
zend_dump_op_array(call_graph.op_arrays[i], ZEND_DUMP_HIDE_UNREACHABLE|ZEND_DUMP_RC_INFERENCE|ZEND_DUMP_SSA, "JIT", &info->ssa);
@@ -3692,10 +3646,6 @@ ZEND_EXT_API int zend_jit_script(zend_script *script)
36923646
}
36933647

36943648
for (i = 0; i < call_graph.op_arrays_count; i++) {
3695-
if (JIT_G(trigger) == ZEND_JIT_ON_DOC_COMMENT &&
3696-
!zend_needs_manual_jit(call_graph.op_arrays[i])) {
3697-
continue;
3698-
}
36993649
info = ZEND_FUNC_INFO(call_graph.op_arrays[i]);
37003650
if (info) {
37013651
if (zend_jit(call_graph.op_arrays[i], &info->ssa, NULL) != SUCCESS) {
@@ -3736,8 +3686,7 @@ ZEND_EXT_API int zend_jit_script(zend_script *script)
37363686
return SUCCESS;
37373687

37383688
jit_failure:
3739-
if (JIT_G(trigger) == ZEND_JIT_ON_SCRIPT_LOAD ||
3740-
JIT_G(trigger) == ZEND_JIT_ON_DOC_COMMENT) {
3689+
if (JIT_G(trigger) == ZEND_JIT_ON_SCRIPT_LOAD) {
37413690
for (i = 0; i < call_graph.op_arrays_count; i++) {
37423691
ZEND_SET_FUNC_INFO(call_graph.op_arrays[i], NULL);
37433692
}

0 commit comments

Comments
 (0)