Commit Graph

2319 Commits

Author SHA1 Message Date
Nikita Popov
b7a6430a52 Don't JIT functions with many blocks
Avoids a stack overflow in Zend/tests/runtime_compile_time_binary_operands.php
that happens in recursive RPO calculation. We could make that code
non-recursive, but I don't think it makes sense to JIT this kind of
function in the first place.
2019-05-29 11:49:44 +02:00
Nikita Popov
4d1d5babde Respect optimization_level when running JIT inference
Don't enable unsafe type inference by default -- we'll segfault on
some FFI tests.
2019-05-28 17:29:28 +02:00
Nikita Popov
e1c903230e Merge branch 'PHP-7.4' 2019-05-28 16:41:30 +02:00
Nikita Popov
071b389bc6 Merge branch 'PHP-7.3' into PHP-7.4 2019-05-28 16:41:17 +02:00
Nikita Popov
817b50826e Merge branch 'PHP-7.2' into PHP-7.3 2019-05-28 16:41:08 +02:00
Nikita Popov
59dfaa3f99 Fix type inference of SEND_UNPACK with empty array
An empty array will not be turned into an array of references.
This violated the invariant than an array has values iff it has
keys.
2019-05-28 16:40:56 +02:00
Nikita Popov
0d744f78e6 Merge branch 'PHP-7.4' 2019-05-28 16:15:54 +02:00
Nikita Popov
f19dd674e0 SCCP: Fix handling of ASSIGN_OBJ_REF
The generic BOT handling is not away of OP_DATA, so need to handle
this opcode before we get to that.
2019-05-28 16:15:37 +02:00
Nikita Popov
8b3a71f904 Merge branch 'PHP-7.4' 2019-05-28 15:46:15 +02:00
Nikita Popov
6893f1f98e SCCP: Don't perform partial object propagation for typed props 2019-05-28 15:46:03 +02:00
Nikita Popov
0bd1fc225d JIT: Fix SWITCH_LONG/STRING codegen with exact type
We were not loading the operand if the type was known exactly.
2019-05-28 15:25:19 +02:00
Nikita Popov
7791784bc9 Revert accidental changes
These MAY_BE_FALSE should not have been dropped...
2019-05-28 13:14:58 +02:00
Nikita Popov
4da316d189 hebrev/hebrevc: Don't return false for empty string
There is nothing special about the empty string in this context,
we should pass it through unchanged.
2019-05-28 13:12:38 +02:00
Nikita Popov
0d79c70cf3 Update MAY_BE_NULL info for more ext/standard functions 2019-05-28 13:12:38 +02:00
Nikita Popov
d95c15e371 Update MAY_BE_NULL for parts of ext/standard
Also update proto comments to be more accurate.
2019-05-28 12:11:32 +02:00
Nikita Popov
1493c73582 Update MAY_BE_NULL func_info for Zend functions
These cannot return NULL anymore in PHP 8.
2019-05-28 11:43:23 +02:00
Dmitry Stogov
38c75f8fd3 Fixed register allocation 2019-05-28 12:39:13 +03:00
Nikita Popov
8126658444 Remove FUNC_MAY_WARN
We are no longer constructing the local symbol table when calling
error handlers since 2f1f34952e,
which was the original motivation for having this information and
was used in an earlier version of the JIT.
2019-05-28 11:23:02 +02:00
Nikita Popov
bd4c9bce68 zend_func_info: Remove unnecessary type callbacks
In PHP 8 these functions will throw on invalid arguments, so there
is no need to distinguish the error cases.
2019-05-28 10:42:12 +02:00
Nikita Popov
a1284b4241 Remove special handling of zero-arg funcs in func_info
In PHP 8 we always throw on zpp failure, so we can always return the
type for the valid argument case only. We'll want to also adjust the
return type listings based on that (and drop MAY_BE_NULL/MAY_BE_FALSE
where possible).
2019-05-27 17:16:56 +02:00
Nikita Popov
45c663a9d3 Merge branch 'PHP-7.4' 2019-05-27 17:13:00 +02:00
Nikita Popov
fd23f9104a BIND_STATIC of implicit binding may be undef
Even though we don't need it at runtime, add the BIND_IMPLICIT
flag to BIND_STATIC as well, so we can distinguish this case in
type inference.

This fixes a JIT miscompile in arrow_functions/002.phpt.
2019-05-27 17:12:20 +02:00
Nikita Popov
31ce1cbbb9 Func info: Fix calls to zero-arg varargs
The num_args does not include variadics, so a "zero-arg" function
may accept additional arguments through that. No functions seem
to be affected right now, but they will be after #4175.
2019-05-27 16:14:51 +02:00
Nikita Popov
9d4c35e250 Merge branch 'PHP-7.4' 2019-05-27 16:14:25 +02:00
Nikita Popov
7cc17c4aac Merge branch 'PHP-7.3' into PHP-7.4 2019-05-27 16:14:16 +02:00
Nikita Popov
62f339c8d5 Func info: Fix calls to zero-arg varargs
The num_args does not include variadics, so a "zero-arg" function
may accept additional arguments through that. No functions seem
to be affected right now, but they will be after #4175.
2019-05-27 16:12:42 +02:00
Dmitry Stogov
b22cd2284d Merge branch 'PHP-7.4'
* PHP-7.4:
  Align .text segment for better huge pages usage
2019-05-27 13:38:07 +03:00
Dmitry Stogov
62ded6efbc Align .text segment for better huge pages usage 2019-05-27 13:37:19 +03:00
Jakub Zelenka
6166e2578e Merge branch 'PHP-7.4' 2019-05-26 18:51:39 +01:00
Jakub Zelenka
cd6b7ebb68 Merge branch 'PHP-7.3' into PHP-7.4 2019-05-26 18:51:10 +01:00
Jakub Zelenka
209b12e064 Merge branch 'PHP-7.2' into PHP-7.3 2019-05-26 18:49:52 +01:00
Jakub Zelenka
8baf3ffde6 Add fpmi to the opcache supported sapis 2019-05-26 18:47:22 +01:00
Nikita Popov
e06ec226bc Merge branch 'PHP-7.4' 2019-05-24 09:33:58 +02:00
Nikita Popov
49a3b03e9f Implement basic variance support
This is a minimal variance implementation: It does not support any
cyclic type dependencies. Additionally the preloading requirements
are much more restrictive than necessary. Hopefully we can relax
these in the future.
2019-05-24 09:30:37 +02:00
Dmitry Stogov
b63cb67421 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed double mutex unlock
2019-05-23 11:21:15 +03:00
Dmitry Stogov
fdb7fc6153 Fixed double mutex unlock 2019-05-23 11:20:46 +03:00
Nikita Popov
200f5b407e Merge branch 'PHP-7.4' 2019-05-23 10:01:46 +02:00
Nikita Popov
dcccdc471d Don't require NO_ESCAPE for partial arrays in SCCP 2019-05-23 09:59:25 +02:00
Dmitry Stogov
89a7e94f05 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed race condition in opcache restart
2019-05-23 00:21:26 +03:00
Dmitry Stogov
5de750f41c Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed race condition in opcache restart
2019-05-23 00:21:15 +03:00
Dmitry Stogov
d4867e099e Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fixed race condition in opcache restart
2019-05-23 00:21:04 +03:00
Dmitry Stogov
fa6a4483e6 Fixed race condition in opcache restart 2019-05-23 00:20:35 +03:00
Dmitry Stogov
26c348b3a5 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed dump of constant flags
2019-05-22 23:02:18 +03:00
Dmitry Stogov
fe1db0c3d7 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed dump of constant flags
2019-05-22 23:00:26 +03:00
Dmitry Stogov
aa9c76d027 Fixed dump of constant flags 2019-05-22 22:59:40 +03:00
Dmitry Stogov
3a76ef3d5d Merge branch 'PHP-7.4'
* PHP-7.4:
  .text segment may be not the first one
2019-05-22 12:21:07 +03:00
Dmitry Stogov
7c99589be2 .text segment may be not the first one 2019-05-22 12:20:34 +03:00
Nikita Popov
c06f07f55b Merge branch 'PHP-7.4' 2019-05-22 09:35:49 +02:00
Nikita Popov
ff4b0ce0e8 Fix bug #78034
Don't def non-cv variables in assign_obj_ref data operand.
2019-05-22 09:35:38 +02:00
Nikita Popov
69517d037b Merge branch 'PHP-7.4' 2019-05-21 17:35:33 +02:00