Skip to content

Commit e2cf766

Browse files
committed
Avoid interrupt cleanup for frameless reentry copies
1 parent 28d83f6 commit e2cf766

5 files changed

Lines changed: 1 addition & 34 deletions

File tree

Zend/zend_execute.c

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1673,19 +1673,6 @@ ZEND_API bool zend_frameless_protect_args_for_reentry(void)
16731673
return true;
16741674
}
16751675

1676-
static bool zend_frameless_reentry_copies_in_use(zend_frameless_reentry_copies *copies)
1677-
{
1678-
for (zend_execute_data *execute_data = EG(current_execute_data);
1679-
execute_data;
1680-
execute_data = execute_data->prev_execute_data) {
1681-
if (execute_data == copies->execute_data && execute_data->opline == copies->opline) {
1682-
return true;
1683-
}
1684-
}
1685-
1686-
return false;
1687-
}
1688-
16891676
static void zend_frameless_free_reentry_copies(zend_frameless_reentry_copies *copies)
16901677
{
16911678
for (uint32_t i = 0; i < 3; i++) {
@@ -1714,33 +1701,18 @@ ZEND_API void zend_frameless_cleanup_reentry_copies_for_handler(zend_execute_dat
17141701
}
17151702
}
17161703

1717-
static void zend_frameless_cleanup_reentry_copies_ex(bool force)
1704+
ZEND_API void zend_frameless_cleanup_reentry_copies_force(void)
17181705
{
17191706
zend_frameless_reentry_copies **next = &EG(frameless_reentry_copies);
17201707

17211708
while (*next) {
17221709
zend_frameless_reentry_copies *copies = *next;
17231710

1724-
if (!force && zend_frameless_reentry_copies_in_use(copies)) {
1725-
next = &copies->prev;
1726-
continue;
1727-
}
1728-
17291711
*next = copies->prev;
17301712
zend_frameless_free_reentry_copies(copies);
17311713
}
17321714
}
17331715

1734-
ZEND_API void zend_frameless_cleanup_reentry_copies(void)
1735-
{
1736-
zend_frameless_cleanup_reentry_copies_ex(false);
1737-
}
1738-
1739-
ZEND_API void zend_frameless_cleanup_reentry_copies_force(void)
1740-
{
1741-
zend_frameless_cleanup_reentry_copies_ex(true);
1742-
}
1743-
17441716
static void frameless_observed_call_copy(zend_execute_data *call, uint32_t arg, zval *zv)
17451717
{
17461718
if (Z_ISUNDEF_P(zv)) {
@@ -4240,7 +4212,6 @@ ZEND_API void ZEND_FASTCALL zend_free_compiled_variables(zend_execute_data *exec
42404212
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_fcall_interrupt(zend_execute_data *call)
42414213
{
42424214
zend_atomic_bool_store_ex(&EG(vm_interrupt), false);
4243-
zend_frameless_cleanup_reentry_copies();
42444215
if (zend_atomic_bool_load_ex(&EG(timed_out))) {
42454216
zend_timeout();
42464217
} else if (zend_interrupt_function) {

Zend/zend_execute.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,6 @@ ZEND_API user_opcode_handler_t zend_get_user_opcode_handler(uint8_t opcode);
430430
ZEND_API zval *zend_get_zval_ptr(const zend_op *opline, int op_type, const znode_op *node, const zend_execute_data *execute_data);
431431
ZEND_API bool zend_frameless_protect_args_for_reentry(void);
432432
ZEND_API void zend_frameless_cleanup_reentry_copies_for_handler(zend_execute_data *execute_data, const zend_op *opline);
433-
ZEND_API void zend_frameless_cleanup_reentry_copies(void);
434433
ZEND_API void zend_frameless_cleanup_reentry_copies_force(void);
435434

436435
ZEND_API void zend_clean_and_cache_symbol_table(zend_array *symbol_table);

Zend/zend_execute_API.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1042,7 +1042,6 @@ zend_result zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_
10421042
/* This flag is regularly checked while running user functions, but not internal
10431043
* So see whether interrupt flag was set while the function was running... */
10441044
if (zend_atomic_bool_exchange_ex(&EG(vm_interrupt), false)) {
1045-
zend_frameless_cleanup_reentry_copies();
10461045
if (zend_atomic_bool_load_ex(&EG(timed_out))) {
10471046
zend_timeout();
10481047
} else if (zend_interrupt_function) {

Zend/zend_vm_def.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10423,7 +10423,6 @@ ZEND_VM_HELPER(zend_interrupt_helper, ANY, ANY)
1042310423
{
1042410424
zend_atomic_bool_store_ex(&EG(vm_interrupt), false);
1042510425
SAVE_OPLINE();
10426-
zend_frameless_cleanup_reentry_copies();
1042710426
if (zend_atomic_bool_load_ex(&EG(timed_out))) {
1042810427
zend_timeout();
1042910428
} else if (zend_interrupt_function) {

Zend/zend_vm_execute.h

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)