Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In place string ops #117

Open
wants to merge 3,824 commits into
base: master
Choose a base branch
from
Open

In place string ops #117

wants to merge 3,824 commits into from

Conversation

nielsdos
Copy link
Owner

@nielsdos nielsdos commented Oct 22, 2024

Note: we should also check that the CV gets overwritten afterwards

DanielEScherzer and others added 30 commits October 7, 2024 14:17
* PHP-8.4:
  Fix phpGH-16162: No ReflectionProperty::IS_VIRTUAL
* JIT for INIT_STATIC_METHOD_CALL

* Fixed typo

* Fix missing LOAD

* Separate zend_get_known_class()
IR commit: eff4b4109aed08d4864bd5bd7228575d8fd01158
* PHP-8.4:
  Update IR
* PHP-8.3:
  NEWS for phpGH-16196
  NEWS for phpGH-16196
  Handle references properties of the Exception class
* PHP-8.4:
  NEWS for phpGH-16196
  NEWS for phpGH-16196
  NEWS for phpGH-16196
  Handle references properties of the Exception class
* PHP-8.3:
  Fixed phpGH-16233: Observer segfault when calling user function in internal function via trampoline
* PHP-8.4:
  Fixed phpGH-16233: Observer segfault when calling user function in internal function via trampoline
* PHP-8.3:
  Fix phpGH-16259: Soap segfault when classmap instantiation fails
* PHP-8.4:
  Fix phpGH-16259: Soap segfault when classmap instantiation fails
* PHP-8.3:
  Fix phpGH-16261: Reference invariant broken in mb_convert_variables()
* PHP-8.4:
  Fix phpGH-16261: Reference invariant broken in mb_convert_variables()
zend_jit() assumes that Closure op_arrays have no scope, but this is not true
when using the hot counters, first exec, or trace triggers as they use the
executed op_array, which is in case of Closures is a copy, with a scope.

In the tracing JIT this problem is avoided as we fetch the original op_array
when compiling a Closure. Here I replicate this for the hot counters and first
exec triggers.

Fixes phpGH-16186
Closes phpGH-16200
* PHP-8.4:
  NEWS for phpGH-16200
  Use original op_array when JIT compiling a Closure
These tests are failing because the integers are too large to be cast
to a PHP int.  We fix this by expecting either an int or a string.

Closes phpGH-16278.
* PHP-8.4:
  Fix PDO_Firebird tests for 32bit
IR commit: 88c71c9572bdd9dd8aed99c80ad4a54fcbcfe082
* PHP-8.4:
  Update IR
* PHP-8.4:
  Fix various hooked object iterator issues
…l_free (php#16297)

Given that the lifecycle of the `slist` HashTable exactly matches the lifecycle
of the `_php_curl_free` struct, we might as well embed the HashTable directly
and avoid a pointer indirection.
php#16285)

The check called an API only available with this def set.
Gate the check behind ifdef and change control flow to better fit it.

Co-authored-by: Arnaud Le Blanc <[email protected]>
* PHP-8.4:
  Fix regression on platforms without `ZEND_CHECK_STACK_LIMIT` set (8.4) (php#16285)
* PHP-8.3:
  PHP-8.2 is now for PHP 8.2.26-dev
* PHP-8.4:
  PHP-8.2 is now for PHP 8.2.26-dev
  [ci skip] Update NEWS for PHP 8.4.0RC2
Sync up to lexbor/lexbor@72236d3.
Reason: pulling in mainly
lexbor/lexbor@cbf1263 for the WHATWG
encoding update.
cmb69 and others added 24 commits October 22, 2024 00:17
libxml2 2.13.0 introduced some relevant changes regarding the treatment
of file paths on Windows[1].  Thus we un-xfail bug69753.phpt and its
companion, and we adjust dom004.phpt.  And we also disable the
workaround for erroneous file:/ URIs on Windows.

[1] <https://gitlab.gnome.org/GNOME/libxml2/-/commit/8ab1b122c47bfced2b59f52351507ebc1eb50218>

Closes phpGH-16536.
* PHP-8.4:
  Updates for libxml2 >= 2.13.0
* Use a direct call for decoding the UTF-8 buffer

* Add fast path for UTF-8 HTML serialization

This patch adds a fast path to the HTML serialization encoding that has
to encode to UTF-8. Because the DOM internally represents all strings
using UTF-8, we only need to validate here.

Tested on Wikipedia English home page on an i7-4790:
```
Benchmark 1: ./sapi/cli/php x.php
  Time (mean ± σ):     516.0 ms ±   6.4 ms    [User: 511.2 ms, System: 3.5 ms]
  Range (min … max):   506.0 ms … 527.1 ms    10 runs

Benchmark 2: ./sapi/cli/php_old x.php
  Time (mean ± σ):     682.8 ms ±   6.5 ms    [User: 676.8 ms, System: 3.8 ms]
  Range (min … max):   675.8 ms … 695.6 ms    10 runs

Summary
  ./sapi/cli/php x.php ran
    1.32 ± 0.02 times faster than ./sapi/cli/php_old x.php
```

(And if you're interested: it takes over a second on my machine using the old DOMDocument class)

Future optimizations are certainly possible, but let's start here.
…6520)

It stopped being able to return false since PHP 8.0 when all warnings and false returns were converted to ValueErrors and TypeErrors
If a lazy object is created for a class whose constants can not be updated, then
we have created an instance of a non-instantiable class. This breaks the
expectations of clone.

Here I ensure that a class has its constants updated before creating a lazy
instance of it.

Fixes OSS-Fuzz #71407
Closes phpGH-15856
* PHP-8.4:
  Lazy objects: Update class constants earlier
A follow-up of 9ee9c0e.

The mbstring extension is added as ZEND_MOD_OPTIONAL dependency at
runtime, so INI directives configuration order here is no longer
relevant and can be done in any way.
* PHP-8.3:
  Fix propagation of ZEND_ACC_RETURN_REFERENCE for call trampoline
* PHP-8.4:
  Fix propagation of ZEND_ACC_RETURN_REFERENCE for call trampoline
* PHP-8.3:
  Fix handling of nested generator in zend_test observer
* PHP-8.4:
  Fix handling of nested generator in zend_test observer
* PHP-8.3:
  Fix lineno in function redeclaration error
* PHP-8.4:
  Fix lineno in function redeclaration error
* PHP-8.3:
  Fix lineno for inheritance errors of early bound classes
* PHP-8.4:
  Fix lineno for inheritance errors of early bound classes
* PHP-8.4:
  [skip ci] Fix test expectation of gh16508.phpt for 8.4+
* PHP-8.3:
  [skip ci] Fix overwritten observer ini setting for gh16514.phpt
* PHP-8.4:
  [skip ci] Fix overwritten observer ini setting for gh16514.phpt
* PHP-8.3:
  [ci skip] Update EXTENSIONS and CODEOWNERS for ext/soap (php#16542)
* PHP-8.4:
  [ci skip] Update EXTENSIONS and CODEOWNERS for ext/soap (php#16542)
  [ci skip] Update NEWS for PHP 8.4.0RC4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.