Commit Graph

2343 Commits

Author SHA1 Message Date
Tyson Andre
cbaf37ff75
Delete opcache flags for php 8.0's removed mbereg*() aliases
See UPGRADING for Mbstring.
All of these are aliases of corresponding `mb_*`
functions that existed in php 7 but were removed in php 8.

Other functions such as gzgetss were already removed.
2019-06-11 09:07:42 +02:00
Joe Watkins
6c195fb846
Merge branch 'PHP-7.4'
* PHP-7.4:
  Clean up opcache func flags for set_socket_blocking
2019-06-11 09:06:48 +02:00
Tyson Andre
b921564a35
Clean up opcache func flags for set_socket_blocking
It was removed in php 7.0. See https://php.net/set_socket_blocking
2019-06-11 09:05:57 +02:00
Joe Watkins
0542eb5bd5
Rest of c3e78efecf 2019-06-11 09:05:07 +02:00
Tyson Andre
98b487e244
Fix a typo in opcache func info for "get_parrent_class"
This should only have one r.
http://php.net/get_parent_class mentions that it returns string|false

Also, I'm not 100% sure if this is right - should this include
MAY_BE_NULL to handle the case of too many parameters?
(then again, get_called_class() also returns null in the global scope)

```
php > var_export(get_parent_class(2,3));
Warning: get_parent_class() expects at most 1 parameter, 2 given in php
shell code on line 1
NULL
```
2019-06-11 08:59:12 +02:00
Dmitry Stogov
09a24d0b7c Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed possible misalignment in 32-bit build.
2019-06-10 12:53:34 +03:00
Dmitry Stogov
46df9a858c Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed possible misalignment in 32-bit build.
2019-06-10 12:53:04 +03:00
Dmitry Stogov
a0749fe483 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fixed possible misalignment in 32-bit build.
2019-06-10 12:52:50 +03:00
Dmitry Stogov
199eb2b110 Fixed possible misalignment in 32-bit build. 2019-06-10 12:51:59 +03:00
Nikita Popov
8b2741c1c3 Fix accidentially dropped type
I only meant to drop the MAY_BE_FALSE here, not the MAY_BE_ARRAY...
2019-06-06 10:07:59 +02:00
Nikita Popov
252216b2de Remove possible false return value from get_object_vars()
I'm not sure this one ever happens in practice (and we might want
to forbid NULL return from get_properties), but if it does, return
an empty array instead of false.
2019-06-06 09:49:25 +02:00
Nikita Popov
001d434449 Finish func_info updates for ext/standard 2019-06-03 11:26:25 +02:00
Nikita Popov
fd911a7124 Expect string argument in hexdec, octdec, bindec
Instead of accepting zval and converting to string. Also rewrite the
functions to make it obvious that they cannot return false.
2019-06-03 11:26:25 +02:00
Nikita Popov
321fe88935 Add Z_PARAM_NUMBER and use it for some functions 2019-06-03 10:14:05 +02:00
Nikita Popov
673c70a4ba A few more func info updates 2019-05-31 11:24:47 +02:00
Dmitry Stogov
b4a3b49eab Merge branch 'PHP-7.4'
* PHP-7.4:
  Better hot/cold code splitting
2019-05-31 12:22:08 +03:00
Dmitry Stogov
1df9f238fe Better hot/cold code splitting 2019-05-31 12:20:21 +03:00
Nikita Popov
0ba34824f5 Use TypeError instead of warning in implode()
These are again manual argument type checks.
2019-05-31 11:04:13 +02:00
Nikita Popov
45a0656e95 Remove get() object handler
Now that set() is gone, there is little point in keeping get(), as
it is essentially just a different way of writing cast_object()
now.

Closes GH-4202.
2019-05-29 17:15:19 +02:00
Nikita Popov
07fae1fd6e escapeshellarg/escapeshellcmd: Throw TypeError instead of E_ERROR 2019-05-29 16:57:53 +02:00
Nikita Popov
0d239523a7 Merge branch 'PHP-7.4' 2019-05-29 16:48:37 +02:00
Nikita Popov
029b735a6e Merge branch 'PHP-7.3' into PHP-7.4 2019-05-29 16:48:28 +02:00
Nikita Popov
61a38bb274 SCCP: Fix leak when determining TYPE_CHECK from type info
As TYPE_CHECK is the only opcode where we do something like this,
I'm adding this hack.
2019-05-29 16:47:19 +02:00
Nikita Popov
a1a8d14485 Update more func info information for ext/standard 2019-05-29 15:30:06 +02:00
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