Dmitry Stogov
be8dfa7751
Merge branch 'PHP-8.0' into PHP-8.1
...
* PHP-8.0:
JIT: Split zend_jit_hash_index_lookup_rw() into zend_jit_hash_index_lookup_rw() and zend_jit_hash_index_lookup_rw_no_packed().
2021-09-27 22:14:27 +03:00
Dmitry Stogov
325865d750
JIT: Split zend_jit_hash_index_lookup_rw() into zend_jit_hash_index_lookup_rw() and zend_jit_hash_index_lookup_rw_no_packed().
...
The previous version might fail if zend_jit_hash_index_lookup_rw() was called for packed array.
2021-09-27 22:09:51 +03:00
Dmitry Stogov
97da90e85e
Merge branch 'PHP-8.0' into PHP-8.1
...
* PHP-8.0:
JIT: Fixed missed zval type initialization
2021-09-27 20:15:51 +03:00
Dmitry Stogov
9ce388b41b
JIT: Fixed missed zval type initialization
2021-09-27 20:05:50 +03:00
Dmitry Stogov
7981d48aca
JIT: Fixed missing type load
2021-09-27 17:44:36 +03:00
Nikita Popov
7d483418e2
Fix relative offsets when copying JMPZNZ
...
This was doing a plain copy of JMPZNZ, even though it encodes
offsets relative to the opline. As such, the offsets would be
relative to target, while they should be relative to opline.
Fix this by recomputing them.
Fixes oss-fuzz #39295 .
2021-09-27 16:18:40 +02:00
Dmitry Stogov
35ff71f048
JIT: Improve property access (Avoid unnecessary property address loading and exception check).
2021-09-27 15:59:52 +03:00
Dmitry Stogov
dbdef5980f
JIT: Wrong register
2021-09-27 13:00:40 +03:00
Nikita Popov
823888c472
Start block at loop var free
...
This ensures that code directly before the loop var free is
separated out (and will generally be eliminated as unreachable).
This fixes some assumptions we have that unreachable loop var free
blocks start with the loop var free.
Fixes oss-fuzz #39395 .
2021-09-27 11:56:37 +02:00
Dmitry Stogov
3e706536d9
JIT: Remove FETCH_THIS+FETCH_OBJ_* optimizations for closures for
...
functon JIT introduced in d1a0b93c64 .
They caused failure of Zend/tests/closure_038.phpt with -d opcache.jit=1215
2021-09-27 12:52:34 +03:00
Nikita Popov
ddf8910237
Fix DCE of unreachable phi in cycle
...
We can't remove a trivial phi of the form x = phi(x), because we
don't have a replacement value. We could drop the whole block
though. SCCP would normally do this, but in this particular case
we only determine non-reachability based on type information.
Fixes oss-fuzz #39316 .
2021-09-27 11:26:31 +02:00
Nikita Popov
038bc27787
Handle pi nodes in replace_predecessor
...
If we're removing a predecessor because it already exists during
replacement, we should also drop pi nodes for that predecessor.
Fixes oss-fuzz #39276 .
2021-09-27 10:47:47 +02:00
Dmitry Stogov
bec1d2f290
JIT: Avoid property type reloading
2021-09-24 19:57:20 +03:00
Dmitry Stogov
ec0f2c6ea1
JIT: Eliminate useless exception check
2021-09-24 16:52:06 +03:00
Dmitry Stogov
d1a0b93c64
JIT: Improve $this->property access in closures
2021-09-24 15:55:29 +03:00
Nikita Popov
2b0288b220
Merge branch 'PHP-8.0' into PHP-8.1
...
* PHP-8.0:
Fix bug #81472 : Support large device major/minor number
2021-09-24 09:58:22 +02:00
Lin Yang
9ad8fadcbb
Fix bug #81472 : Support large device major/minor number
...
Latest linux kernel use large number (12 bits for major device, 20
bits for minor device). Current code only supports previous standard
(5 chars), which means 8 bits for major and 8 bits for minor device.
It will fail if device number is out of that range. So this patch
increases device number read from /proc/self/maps file.
Closes GH-7512.
2021-09-24 09:57:32 +02:00
Dmitry Stogov
92d0abd075
Fixed typo
2021-09-24 09:20:57 +03:00
Dmitry Stogov
c7c7620918
Merge branch 'PHP-8.0' into PHP-8.1
...
* PHP-8.0:
Tracing JIT: Fixed possible incorrect megamorphic call from a trait
2021-09-23 23:41:11 +03:00
Dmitry Stogov
3e6919cfb3
Tracing JIT: Fixed possible incorrect megamorphic call from a trait
2021-09-23 23:38:03 +03:00
Dmitry Stogov
a0bea10e5b
JIT: Fixed register clobbering
2021-09-23 15:04:05 +03:00
Dmitry Stogov
5eb3e30867
Merge branch 'PHP-8.0' into PHP-8.1
...
* PHP-8.0:
Tracing JIT: Remove incorrect assertion
2021-09-23 12:15:05 +03:00
Dmitry Stogov
430454268f
Tracing JIT: Remove incorrect assertion
2021-09-23 12:14:33 +03:00
Dmitry Stogov
757c1277eb
Merge branch 'PHP-8.0' into PHP-8.1
...
* PHP-8.0:
Tracing JIT: Fixed possible stack-buffer-overflow.
2021-09-23 10:52:17 +03:00
Dmitry Stogov
08100e81e5
Tracing JIT: Fixed possible stack-buffer-overflow.
2021-09-23 10:51:20 +03:00
Dmitry Stogov
0f084387f8
Fixed use-after-free introduced in f2ceb639b8
2021-09-23 10:37:25 +03:00
Dmitry Stogov
4317da35d3
Remove weird condition
2021-09-23 01:12:49 +03:00
Dmitry Stogov
114a0ffd19
Merge branch 'PHP-8.0' into PHP-8.1
...
* PHP-8.0:
Check for zend_shared_alloc() failures
2021-09-23 01:01:26 +03:00
Dmitry Stogov
17a99f2b11
Check for zend_shared_alloc() failures
2021-09-23 01:00:50 +03:00
Dmitry Stogov
b9f12d628f
Merge branch 'PHP-8.0' into PHP-8.1
...
* PHP-8.0:
JIT: Fixed possible memory leak
2021-09-22 22:58:57 +03:00
Dmitry Stogov
09d4037a17
JIT: Fixed possible memory leak
2021-09-22 22:57:57 +03:00
Nikita Popov
2dc8c7b3a7
Merge branch 'PHP-8.0' into PHP-8.1
...
* PHP-8.0:
Fix ASSIGN_STATIC_PROP_REF type inference
2021-09-22 15:55:42 +02:00
Nikita Popov
983a4fc4a3
Fix ASSIGN_STATIC_PROP_REF type inference
...
We were not inferring anything for the ASSIGN_STATIC_PROP_REF
result type at all, leaving it as an empty type. In the test
case this results in a live range being incorrectly eliminated,
but this could break in all kinds of other ways as well..
2021-09-22 15:55:25 +02:00
Dmitry Stogov
c77c79a093
JIT: Fixed memory leak when opperand of ADD IS_VAR and IS_REFERENCE
2021-09-22 16:37:48 +03:00
Nikita Popov
560dafb50f
Merge branch 'PHP-8.0' into PHP-8.1
...
* PHP-8.0:
Fix JIT typed property inc/dec
2021-09-22 15:32:59 +02:00
Nikita Popov
770879702a
Fix JIT typed property inc/dec
...
This was leaking memory for pre-inc/dec of a refcounted typed
property if the result was not used.
The code to do this was unnecessarily complicated, we can base
this on the zend_jit_inc/dec_typed_prop() helper and copy to the
result afterwards.
2021-09-22 15:32:19 +02:00
Dmitry Stogov
cffba945e5
Merge branch 'PHP-8.0' into PHP-8.1
...
* PHP-8.0:
Fixed type inference
2021-09-22 15:32:16 +03:00
Dmitry Stogov
e588f24276
Fixed type inference
2021-09-22 15:30:30 +03:00
Dmitry Stogov
5860a390d5
Merge branch 'PHP-8.0' into PHP-8.1
...
* PHP-8.0:
JIT: Fixed JIT for FETCH_OBJ when op1 is a reference of non-object
2021-09-22 14:55:02 +03:00
Dmitry Stogov
7a93a8a6fd
JIT: Fixed JIT for FETCH_OBJ when op1 is a reference of non-object
2021-09-22 14:52:25 +03:00
Dmitry Stogov
f2ceb639b8
Tracing JIT: Record information about types of defined object properties and use it to optimize code for ASSIGN_OBJ_OP, PRE/POST_INC/DEC_OBJ and FETCH_OBJ_R/IS
2021-09-22 14:08:31 +03:00
Dmitry Stogov
4d4a175dc0
Tracing JIT: Fixed FETCH_DIM_R with packed array and negative key
2021-09-22 02:05:05 +03:00
Dmitry Stogov
a86ed2df4f
Merge branch 'PHP-8.0' into PHP-8.1
...
* PHP-8.0:
Tracing JIT: Fixed bug in register allocator.
2021-09-22 00:46:45 +03:00
Dmitry Stogov
19854371ed
Tracing JIT: Fixed bug in register allocator.
...
Type of variable might need to be checked (using type guard) before loading to register.
2021-09-22 00:43:56 +03:00
Nikita Popov
a846547ed4
Fix range() return type inference for undef operand
...
This results in a long range.
2021-09-21 17:03:18 +02:00
Nikita Popov
37337507ec
Merge branch 'PHP-8.0' into PHP-8.1
...
* PHP-8.0:
Don't unconditionally add array value type for undef
2021-09-21 14:54:34 +02:00
Nikita Popov
61445248cb
Don't unconditionally add array value type for undef
...
We have an invariant that an array value type is set if and only
if an array key type is set, which is violated for the case of
undef values for always invalid keys.
2021-09-21 14:54:16 +02:00
Dmitry Stogov
6d04d165b6
JIT: Disable recursive call optimization for VM without global register variables (ARM64 part)
2021-09-21 15:16:06 +03:00
Nikita Popov
4c31edb44e
Merge branch 'PHP-8.0' into PHP-8.1
...
* PHP-8.0:
Check for undef var in typed property assignment
2021-09-21 14:11:56 +02:00
Nikita Popov
f4bcf8c393
Check for undef var in typed property assignment
...
Without this check the assignment would actually silently succeed,
not just skip the warning.
2021-09-21 14:09:26 +02:00