[pull] master from php:master#309
Merged
Merged
Conversation
* PHP-8.3: Fix signed int overflow in scanner
* PHP-8.4: Fix signed int overflow in scanner
…purposes Since cbf67e4, the GC needs to find all WeakMaps referencing a weakly referenced object. Doing so, it treats all ZEND_WEAKREF_TAG_MAP as WeakMap instances. However, a ZEND_WEAKREF_TAG_MAP reference may be a bare HashTable when zend_weakrefs_hash_add() is used. Introduce a new tag, ZEND_WEAKREF_TAG_BARE_HT, and use this tag when weakly referencing an object from a bare HashTable. Ignore such references in GC. Fixes GH-19543 Closes GH-19544 Co-authored-by: Tim Düsterhus <tim@tideways-gmbh.com>
* PHP-8.3: Differenciate WeakMaps from bare HashTables used as weak maps for GC purposes
* PHP-8.4: Differenciate WeakMaps from bare HashTables used as weak maps for GC purposes
Introduce the TAILCALL VM, a more efficient variant of the CALL VM: * Each opcode handler tailcalls the next opcode handler directly instead of returning to the interpreter loop. This eliminates call and interpreter loop overhead. * Opcode handlers use the preserve_none calling convention to eliminate register saving overhead. * preserve_none uses non-volatile registers for its first arguments, so execute_data and opline are usually kept in these registers and no code is required to forward them to the next handlers. Generated machine code is similar to a direct-threaded VM with register pinning, like the HYBRID VM. JIT+TAILCALL VM also benefits from this compared to JIT+CALL VM: * JIT uses the registers of the execute_data and opline args as fixed regs, eliminating the need to move them in prologue. * Traces exit by tailcalling the next handler. No code is needed to forward execute_data and opline. * No register saving/restoring in epilogue/prologue. The TAILCALL VM is used when the HYBRID VM is not supported, and the compiler supports the musttail and preserve_none attributes: The HYBRID VM is used when compiling with GCC, the TAILCALL VM when compiling with Clang>=19 on x86_64 or aarch64, and the CALL VM otherwise. This makes binaries built with Clang>=19 as fast as binaries built with GCC. Before, these were considerably slower (by 2.8% to 44% depending on benchmark, and by 5% to 77% before 76d7c61). Closes GH-17849 Closes GH-18720
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.3)
Can you help keep this open source service alive? 💖 Please sponsor : )