Nikita Popov
e88c7bf5c7
Fix signed integer overflow UB in dasm
...
Should hopefully fix the ubsan and community builds.
2020-03-23 11:12:42 +01:00
Nikita Popov
6766b5f9bc
Fix pointer UB in dynasm
...
Looks like newer GCC versions started warning about this.
2020-03-23 11:03:56 +01:00
Tyson Andre
26b9780d02
Fix compilation error on mac with -Wshift-negative-value
...
Fix for mac OS build error seen in ccc49ead68
when shifting -1 (max argument count?)
```
ext/opcache/jit/zend_jit_trace.c:1668:2:
error: shifting a negative signed value is undefined
[-Werror,-Wshift-negative-value]
TRACE_FRAME_INIT(frame, op_array, 0, -1);
```
Closes GH-5284.
2020-03-23 09:24:26 +01:00
Dmitry Stogov
4b8171e087
Add tracing JIT guards for INTI_FCALL_BY_NAME and INIT_NS_FCALL_BY_NAME
2020-03-20 16:59:02 +03:00
Dmitry Stogov
3715475381
JIT for INIT_NS_FCALL_BY_NAME
2020-03-20 15:36:40 +03:00
Dmitry Stogov
166bc64caf
CAST to the same type mat be JIT-ed as QM_ASSIGN
2020-03-20 13:31:55 +03:00
Dmitry Stogov
517c30b05f
JIT for FETCH_THIS
2020-03-20 12:33:41 +03:00
Dmitry Stogov
ccc49ead68
Change jit_trace_stack_frame layout
2020-03-20 10:54:45 +03:00
Dmitry Stogov
7283dbba27
ZEND_MAKE_REF can't throw
2020-03-20 01:37:27 +03:00
Dmitry Stogov
9232af91fd
JIT for STRLEN
2020-03-20 01:23:36 +03:00
Dmitry Stogov
3958d5bdc5
JIT for ECHO and variable string operands
2020-03-20 01:01:33 +03:00
Dmitry Stogov
282265bccd
JIT for SEND_FUNC_ARG
2020-03-19 23:59:11 +03:00
Dmitry Stogov
8e879b9f44
JIT for ZEND_CHECK_FUNC_ARG
2020-03-18 23:56:03 +03:00
Dmitry Stogov
c2f1c36e30
Eliminate run-time check
2020-03-18 21:19:31 +03:00
Dmitry Stogov
12cdab2d76
Improved JIT for BIND_GLOBAL
2020-03-18 17:20:40 +03:00
Nikita Popov
70ef2f3817
Use different scratch register in read_obj
...
We already use r0 to hold the zval.
2020-03-18 11:44:34 +01:00
Nikita Popov
69937870da
Explicitly pass scratch register to SAVE_VALID_OPLINE
2020-03-18 11:44:25 +01:00
Dmitry Stogov
f767807986
Result of ASSIGN may be different from the assigned value when LHS is a typed reference
2020-03-18 01:40:41 +03:00
Dmitry Stogov
a8e8c40ad4
Use zend_fetch_arg_info_type()
2020-03-17 18:10:27 +03:00
Dmitry Stogov
29bef78e9f
Use _const_op_type() for converting constant into type info
2020-03-17 17:55:34 +03:00
Nikita Popov
1ba6e66c46
Improve type inference
...
After thinking about this a bit more, the code here was too
conservative. We know that everything but an object is going to
throw, so it's sufficient to restrict the type to MAY_BE_OBJECT.
The change in the test is weird but not incorrect, because it
operates on empty inferred types, in which case the code must be
dead (which it is). We should probably add a more explicit removal
of code working on empty types.
2020-03-17 15:41:47 +01:00
Nikita Popov
41a86a72c4
Clean up a few more places
2020-03-17 15:23:52 +01:00
Nikita Popov
023039fbfc
Remove object auto-vivification leftovers in type-inference
...
undef/null/false no longer get promoted to object in PHP 8.
In fact, we may drop the SSA var defs outside RC inference mode now.
2020-03-17 14:54:11 +01:00
Dmitry Stogov
4b89d96489
Improved JIT for ZEND_ASSIGN
2020-03-17 15:45:54 +03:00
Nikita Popov
b1a082da25
Fix typos
2020-03-17 12:59:37 +01:00
Dmitry Stogov
902e19ddf3
Store informaton about class
2020-03-17 00:25:47 +03:00
Dmitry Stogov
7069b55ba4
Fixed recording classes of object references
2020-03-16 23:08:07 +03:00
Nikita Popov
6a0b59d085
Slightly deduplicate code
...
This code is the same in both branches, extract it.
2020-03-16 17:07:27 +01:00
Nikita Popov
eb7e1df228
Remove "safe" argument from ZVAL_PTR_DTOR
...
This is no longer used
2020-03-16 17:07:27 +01:00
Nikita Popov
cfd79841f4
Fix typos
2020-03-16 17:07:27 +01:00
Nikita Popov
3723985058
Merge EX variants of INFO macros
2020-03-16 13:02:16 +01:00
Nikita Popov
d35ce5d661
Merge EX variants of RANGE macros
...
Only need to create the ssa_op variable in range inference...
2020-03-16 12:36:03 +01:00
Nikita Popov
44b3971b85
Merge zend_may_throw(_ex)
...
Explicitly pass ssa_op in the places that don't do so yet.
2020-03-16 12:24:40 +01:00
Nikita Popov
5c65562ce4
Remove unnecessary cast
2020-03-16 12:24:40 +01:00
Dmitry Stogov
9a8f735c57
Emit warning about type narrowing for tracing JIT as well
2020-03-14 01:29:46 +03:00
Dmitry Stogov
29bf7902b3
Fixed RC inference for ZEND_ASSIGN_STATIC_PROP and removed useless checks during RC inference
2020-03-14 01:17:45 +03:00
Dmitry Stogov
4bf2d09ede
Tracing JIT (it doesn't support register allocation yet)
...
Use opcache.jit=1255 to swith it on (the third digit 5 really matters)
Use opcache.jit_debug=0xff001 to see how it works and what code it generates
2020-03-13 22:11:07 +03:00
Nikita Popov
d15012d5e8
Accept const op_array in zend_build_call_map
2020-03-13 16:25:28 +01:00
Nikita Popov
9e89f91341
Add assertions for DIM_W/RW uses
...
The result should be used only once and on the directly next opline,
otherwise it may not be safe. Add some assertions to that effect.
2020-03-13 13:11:42 +01:00
Nikita Popov
9ab2cb923e
Also remove dead arguments
2020-03-13 12:45:02 +01:00
Nikita Popov
b979e03159
Remove dead type narrowing code
...
Rename handle_type_narrowing() to clarify what it does, and
remove dead code for resetting dependent vars.
2020-03-13 12:27:49 +01:00
Dmitry Stogov
78b64bd4ed
Merge branch 'PHP-7.4'
...
* PHP-7.4:
Check asserts early
identation fix
Call global code of preloaded script in global context
Avoid "Anonymous class wasn't preloaded" error by lazely loading of not preloaded part of a preloaded script
2020-03-13 11:42:07 +03:00
Dmitry Stogov
b6492b4453
identation fix
2020-03-12 22:26:16 +03:00
Dmitry Stogov
3c6e9bed1a
Call global code of preloaded script in global context
2020-03-12 22:19:47 +03:00
Dmitry Stogov
2dddab01ae
Avoid "Anonymous class wasn't preloaded" error by lazely loading of not preloaded part of a preloaded script
2020-03-12 16:31:24 +03:00
Christoph M. Becker
b31f73b1c8
Merge branch 'PHP-7.4'
...
* PHP-7.4:
Enclose INI values containing {TMP} in quotes
2020-03-09 22:53:23 +01:00
Christoph M. Becker
fea2994ff8
Merge branch 'PHP-7.3' into PHP-7.4
...
* PHP-7.3:
Enclose INI values containing {TMP} in quotes
2020-03-09 22:51:11 +01:00
Christoph M. Becker
d5e206620b
Enclose INI values containing {TMP} in quotes
...
At least on Windows, the temporary directory may contain tilde signs,
which would result in an INI parse error.
2020-03-09 22:49:08 +01:00
Nikita Popov
d9c45d86f9
Improve type inference for COALESCE
...
Place a pi node on the non-null edge to remove a spurious
undef/null type.
Additionally, adjust the profitability heuristic to be more
accurate if the "other predecessor" writes to the variable.
Ideally this should not just consider the direct predecessors,
but it's sufficient for this case.
This partially addresses bug #79353 by removing the discrepancy
between ?? and ??=.
2020-03-09 16:19:48 +01:00
Nikita Popov
191451da90
Fix bug #79358 : JIT miscompile in composer
2020-03-09 12:55:14 +01:00