1
0
mirror of https://github.com/php/php-src.git synced 2026-04-19 22:11:12 +02:00
Commit Graph

2961 Commits

Author SHA1 Message Date
Nikita Popov
1ed132e2e5 Unify checks for binary operator errors for ct eval
Move everything into one function and share it with opcache.
This fixes some discrepancies.
2020-04-01 14:42:58 +02:00
Nikita Popov
56b18d478e Don't convert binop operand types in opcache
This may produce different behavior if operator overloading is
involved, and may change the error message.

If there's strong interest, this could be done in the DFA pass
with available type information. It does not look particularly
practically useful to me though.
2020-04-01 14:39:41 +02:00
Nikita Popov
2d8f9f34dd Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix literal compaction collision between string and double
2020-04-01 14:23:07 +02:00
Nikita Popov
59c8d6a863 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix literal compaction collision between string and double
2020-04-01 14:22:27 +02:00
Nikita Popov
14b770d407 Fix literal compaction collision between string and double
For the sake of simplicity I'm using a separate hashtable, rather
than trying to do hash perturabation on the double strings.
2020-04-01 14:20:59 +02:00
Máté Kocsis
36935e42ea Improve undefined variable error messages
Closes GH-5312
2020-03-31 13:02:32 +02:00
Tyson Andre
47ddd95836 Do constant evaluation for str_contains in opcache
Both arguments must be strings.
str_contains deliberately does not emit a warning for an empty needle.

Closes GH-5324
2020-03-30 09:54:38 -04:00
Dmitry Stogov
44390beb42 cleanup 2020-03-30 14:27:01 +03:00
Dmitry Stogov
4c9ee6a8ca Initialize variable numbers 2020-03-30 12:50:19 +03:00
Nikita Popov
a34480ec82 SCCP: Optimize strpos with empty needle
This is no longer special cases in PHP 8.
2020-03-30 10:37:22 +02:00
Dmitry Stogov
099ffc2169 BIND_GLOBAL and BIND_STATIC don't use value of the first operand 2020-03-27 15:20:21 +03:00
Dmitry Stogov
150df5b17c Removed useless variable 2020-03-27 12:24:15 +03:00
Nikita Popov
97cb81ead5 Remove HAVE_REALPATH checks
We do not actually use realpath(), but a custom implementation.
Make sure the realpath() function is always available.

Closes GH-5290.
2020-03-26 11:46:00 +01:00
George Peter Banyard
3e6667d338 Fix -Wtype-limits warning by using correct type declaration in JIT trace
Namely int as that is the type of 'definition'

Closes GH-5299
2020-03-26 00:01:59 +01:00
Dmitry Stogov
51a305d2a4 Separate zend_jit_var_supports_reg() and cleanup 2020-03-25 23:09:32 +03:00
Dmitry Stogov
40fa6284eb Fixed incorrect "TSSA start" headers 2020-03-25 23:07:21 +03:00
Dmitry Stogov
5a05fef2af Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed bug #79412 (Opcache chokes and uses 100% CPU on specific script).
2020-03-25 17:38:08 +03:00
Dmitry Stogov
91ee85c20c Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #79412 (Opcache chokes and uses 100% CPU on specific script).
2020-03-25 17:31:33 +03:00
Dmitry Stogov
65120cfc09 Fixed bug #79412 (Opcache chokes and uses 100% CPU on specific script). 2020-03-25 17:31:06 +03:00
Dmitry Stogov
b7c6244dfc Add new line before basic-block labels (except for the first BB0) 2020-03-25 14:26:42 +03:00
Dmitry Stogov
0684b9fcdc Always print numeric opline numbers 2020-03-25 14:26:42 +03:00
Dmitry Stogov
ce8202f996 Rename "var" to "stack". This is an abstract stack that holds TSSA variable numbers. 2020-03-25 10:49:01 +03:00
Dmitry Stogov
af3142daaf Make SSA dump format controlled by opcache.jit_debug more readable (always print opcode number).
This doesn't affect dumps controlled by opcache.opt_debug_level.
2020-03-24 22:44:11 +03:00
Nikita Popov
568592f1e9 Merge branch 'PHP-7.4'
* PHP-7.4:
  Add test file
2020-03-23 17:14:42 +01:00
Nikita Popov
534e15b477 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Add test file
2020-03-23 17:14:16 +01:00
Nikita Popov
2e8db5d6be Add test file
Forgot the git add again...
2020-03-23 17:13:57 +01:00
Nikita Popov
dcbdcf87c8 Merge branch 'PHP-7.4'
* PHP-7.4:
  Handle NULL caller_call_opline
2020-03-23 17:12:55 +01:00
Nikita Popov
dd9b5c8680 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Handle NULL caller_call_opline
2020-03-23 17:12:12 +01:00
Nikita Popov
34f1266a9c Handle NULL caller_call_opline
This can happen if there is an EXIT in the call arguments, in which
case the DO_CALL opcode may be eliminated as unreachable.
2020-03-23 17:12:01 +01:00
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