1
0
mirror of https://github.com/php/php-src.git synced 2026-04-09 17:13:31 +02:00
Commit Graph

124510 Commits

Author SHA1 Message Date
Nikita Popov
0ce2359233 Remove dom_nnodemap dtor_obj handler
Don't see any obvious reason why this would have to happen in a
dtor_obj handler. If there is a reason, we're lacking test
coverage for it.
2021-06-09 12:31:34 +02:00
Nikita Popov
bc8aa7d0e0 Use free_obj in IMAP\Connection
Looks like this incorrect pattern was copied from the FTP
implementation.
2021-06-09 12:14:41 +02:00
Nikita Popov
d982f4eb28 Use free_obj handler in FTPConnection 2021-06-09 12:13:15 +02:00
Nikita Popov
050e13c55e Use free_obj handler in HashContext
Instead of dtor_obj.
2021-06-09 12:12:13 +02:00
Nikita Popov
4c37645acf Disable file_cache_only as well in optimizer pass test 2021-06-09 12:02:55 +02:00
Nikita Popov
e79a8c05ad Convert UConverter dtor_obj to free_obj
An unusal case where free_obj was not specified at all, and only
dtor_obj was used. Use the right handler.
2021-06-09 11:59:51 +02:00
Nikita Popov
cdbf3fdcdd Remove redundant dtor_obj handlers in intl
Both of these just forward to the default implementation, so
just use that directly. This is simpler and benefits from the
special-casing of the default implementation.
2021-06-09 11:47:37 +02:00
Nikita Popov
cde735e630 Remove SimpleXMLElement dtor_obj handler
I don't see any reason why this cleanup needs to happen inside
dtor_obj.

If there is a reason, it's lacking in test coverage...
2021-06-09 11:46:28 +02:00
Dmitry Stogov
3fa0c99a1b JIT/AArch64: Use only reserved TMP registers for EG(vm_interrupt) checks.
This removes limitation of REG0 usage for register-allocation.
2021-06-09 12:43:13 +03:00
Nikita Popov
9d2a466c4b Remove explicit assignments of zend_objects_destroy_object
This is the default handler, no need to set it explicitly. This
makes it easier to see which objects really have a custom dtor_obj.
2021-06-09 11:29:50 +02:00
Nikita Popov
9c18138a71 Support GC for RecursiveIteratorIterator
And move its dtor_obj handler into free_obj, so that cycle leaks
get automatically detected.
2021-06-09 11:25:50 +02:00
Nikita Popov
0643301c75 Don't perform recursive get_gc call
On further consideration, we should be making use of the fact
that zend_object_iterator is also a zend_object here, and let
GC handle the get_gc call on it. Calling get_gc recursively like
this is generally not safe, because there is only one gc_buffer.

This also happens to be much simpler...
2021-06-09 11:15:59 +02:00
Dmitry Stogov
029d06992e JIT/AArch64: Use only reserved TMP registers for EG(jit_trace_num) assignment.
This eliminates a need for checking CPU registers used at the entry to a
side trace.
2021-06-09 12:02:11 +03:00
Nikita Popov
67440dd695 Null out member after releasing
Missed this when changing from zval -> zend_string.
2021-06-09 10:52:27 +02:00
Nikita Popov
b2cf198733 Use zend_string* for RecursiveTreeIterator prefixes
We don't perform any append operations on these strings, they
are fixed. Use zend_string* rather than smart_str for them.
2021-06-09 10:49:59 +02:00
Nikita Popov
6b9ffaff56 Simplify string management in RecursiveTreeIterator
Make use of zend_string rather than zval to clean up the
implementation.
2021-06-09 10:38:58 +02:00
Hao Sun
ac80aeb3ac JIT/AArch64: Use 'tbnz/tbz' to check the signedness (#7123)
'tbnz/tbz' instruction can be used to check whether a given W or X
register value is negative or positive.

For example,
    ```
    tst x0, x0
    blt >1
    ```
can be optimized as `tbnz x0, #63, >1`

It's important to note that the jump range of 'tbnz/tbz' is limited, and
it's better NOT to use 'tbnz/tbz' if the target of 'b.cond' is a label
in section .cold_code or a global label, such as the instruction
sequence `tst RETVALw, RETVALw; blt ->trace_halt` at function
zend_jit_trace_exit_stub(), and the instruction sequence `tst REG0,
  REG0; blt >7` at function zend_jit_incdec_obj().

Minor updates:
Use macros BW_OP_32_WITH_CONST and GC_ADDREF at function
zend_jit_push_call_frame().

Change-Id: I1597609bdabf55ea2f9d24528e7a037bc3e5c3a1
2021-06-09 16:30:25 +08:00
Nikita Popov
ff2fbd0ecb Remove zend_make_printable_zval() use in debug code
This is an awkward API left from the PHP 5 times. Replacing it
with zval_get_string().
2021-06-09 10:19:42 +02:00
Nikita Popov
d7eea8e1be Store cached string as zend_string
This makes the code a bit simpler.
2021-06-09 10:15:36 +02:00
Nikita Popov
88c57df53d Remove dual_it dtor, add more GC roots
Move the dual_it_free call from the dtor_obj into the free_obj
handler, allowing us to drop the dtor_obj handler entirely. This
exposes another leak in bug65387.phpt, which is addressed by
adding more GC roots in the get_gc handler.
2021-06-09 10:04:43 +02:00
David CARLIER
7d5a9dd05d Litespeed sapi OpenBSD build fix (#3999)
attempt to core dump in the proper place.
implement sendfile
2021-06-09 09:11:54 +02:00
Hao Sun
c1bf4b3ed3 JIT/AArch64: Fix codestyle issues (#7125)
Fix codestyle issues, such as aligning comments, changing whitespace to
tab, adding necessary whitespace.

Change-Id: I0c6ae1e5d87a0f6832bc776294558d48a9b5d420
2021-06-09 14:57:09 +08:00
David Carlier
fc147ed8db sockets exposing TC_DEFER_ACCEPT to optimise tcp exchanges. 2021-06-09 06:54:02 +02:00
David CARLIER
e69729f2ba fdatasync disable warning on macOS. (#7122)
The symbol exists and picked up but nowhere to be found on the headers.
tested on gcc/clang from homebrew and clang/Xcode.
2021-06-09 03:51:10 +02:00
Patrick Allaert
87068aead9 Preparing for alpha2 2021-06-08 18:24:06 +02:00
Patrick Allaert
9859e35951 Adapted Travis CI urls 2021-06-08 18:15:49 +02:00
Nikita Popov
15fafcd664 Expose inner dual_it iterator to GC
Moving the zend_iterator_dtor from dual_it_dtor to dual_it_free_storage
exposed this GC leak in an existing test. Forward the result of the
iterator get_gc to the dual_it get_gc.
2021-06-08 16:55:22 +02:00
Christoph M. Becker
64865c6092 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #81092: fflush before stream_filter_remove corrupts stream
2021-06-08 15:41:09 +02:00
Christoph M. Becker
902ec698eb Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #81092: fflush before stream_filter_remove corrupts stream
2021-06-08 15:38:57 +02:00
Christoph M. Becker
a1738d8bd1 Fix #81092: fflush before stream_filter_remove corrupts stream
When doing a non finishing flush, BZ2_bzCompress() returns BZ_FLUSH_OK
(not BZ_FINISH_OK) what requires us to do further flushes right away.

We also refactor the while-loop as do-loop.

Closes GH-7113.
2021-06-08 15:36:37 +02:00
Aaron Piotrowski
2184422adc Merge fiber switching functions (#7106)
Co-authored-by: Martin Schröder <m.schroeder2007@gmail.com>
2021-06-08 08:23:56 -05:00
Nikita Popov
291d8db7c5 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fixed bug #81104
2021-06-08 14:34:08 +02:00
Nikita Popov
d29f15ce5f Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fixed bug #81104
2021-06-08 14:33:29 +02:00
Nikita Popov
d8165c2502 Fixed bug #81104
When the memory limit is restored during shutdown, we may still
be using a lot of memory. Ignore the failure at that point and
set it again after the MM is shut down, at which point memory
usage should be at its lowest point.
2021-06-08 14:31:55 +02:00
Nikita Popov
703fcf0f2f Disable file cache in optimizer_register_pass.phpt 2021-06-08 13:57:19 +02:00
Joe Watkins
27ce269c1b Revert "Fix bug #24214 implement access to skip_last in user API for backtrace"
This reverts commit a5cef84de8.
2021-06-08 11:30:37 +02:00
Nikita Popov
d4b843b2f0 Merge branch 'PHP-8.0'
* PHP-8.0:
  Avoid MSVC unused variable warning in FastZPP
2021-06-08 10:14:58 +02:00
Nikita Popov
3ee6a4b35f Avoid MSVC unused variable warning in FastZPP
MSVC doesn't support __attribute__((unused)), so this can cause
a lot of warnings for extensions. Use the (void) trick instead.
However, this requires us to initialize the variable as well,
to ensure that ubsan does not read a trap representation.
2021-06-08 10:12:21 +02:00
Martin Schröder
b76a9dbcf9 Add fiber type to better support custom fiber APIs (#7105) 2021-06-07 14:21:05 -05:00
Joe Watkins
c220c96c37 fix optimizer pass registration test 2021-06-07 17:58:33 +02:00
Ayesh Karunaratne
b8e380ab09 Update deprecation message for incompatible float to int conversion
Updates the deprecation message for implicit incompatible float to int conversion from:

```
Implicit conversion from non-compatible float %.*H to int in %s on line %d
```

to

```
Implicit conversion from float %.*H to int loses precision in %s on line %d
```

Related: #6661
2021-06-07 14:36:11 +02:00
David Carlier
67b0e435f3 crc32 feature detection from auxiliary vectors on FreeBSD 2021-06-07 14:33:35 +02:00
Nikita Popov
e11468a79b Remove ZVAL_NEW_ARR() macro
This macro is a footgun because it creates an uninitialized array
(only an allocation). This macro is no longer used in php-src,
and we have better alternatives like array_init() or
ZVAL_ARR(arr, zend_new_array(size_hint)).
2021-06-07 12:49:58 +02:00
Remi Collet
3f6a9c9b7b Remove duplicated test
(was previously splitted for <5.3 and >5.3)
2021-06-07 12:11:13 +02:00
Remi Collet
6007bedac2 Merge branch 'PHP-8.0'
* PHP-8.0:
  zip extension is now 1.19.3
2021-06-07 12:10:10 +02:00
Remi Collet
1671996ed7 zip extension is now 1.19.3 2021-06-07 12:10:01 +02:00
Dmitry Stogov
9c7797eb09 JIT/AArch64: Complete logical_immediate_p() using DynAsm helpers 2021-06-07 12:22:58 +03:00
Dmitry Stogov
4e0165e779 JIT/AArch64: Use LSL instruction (DynAsm was fixed by
2963214c15)
2021-06-07 11:24:34 +03:00
Hao Sun
c995a359ff JIT/AArch64: Use 'shifted register' if available (#7108)
One shift instruction can be saved if 'shifted register' is used.

It's worth noting that the destination register of previous shift
instruction doesn't hold the shift result any longer now. And we have to
guarantee that 'shifted register' mode is applied to all the use sites
of this destination register.

Besides, several code-style issues are fixed.

Change-Id: I8bcdd092253d342d383732a926512e761e453808
2021-06-07 15:52:03 +08:00
Hao Sun
28b4f58d3b JIT/AArch64: Optimize add+ldr to ldr (#7109)
This patch is trivial.

Change-Id: I51b8eb5f12446643a53cc569d9398d0941a2f588
2021-06-07 15:51:34 +08:00