Mark generated literal and cache slot accessors noexcept - #105
Open
yavon007 wants to merge 1 commit into
Open
Conversation
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Generated literal-string and request-cache slot accessors only index existing
arrays and return references, but their cross-translation-unit declarations
currently allow C++ exceptions. Callers consequently retain exception cleanup
metadata for calls that cannot throw.
Add
noexceptconsistently to declarations and definitions ofget_str,get_property_cache,typephp_get_method_call_cache, andtypephp_get_function_call_cache. Keep resolving lookups potentially throwing.Add coverage for the generated declarations and definitions.
Validation: 103 focused PHPUnit tests / 616 assertions, 51 compiled dungeon
behavior assertions matching PHP, and an exception probe covering finally,
previous exception identity, rethrow identity, and invalid throwable handling.
The 11 PHPUnit deprecations also occur on the baseline. Multi-file AOT builds
and output checks pass on Linux ARM64, GCC, PHP 8.5.10 ZTS, PHPX 4b3a472.
In an unchanged exception-heavy dungeon replay, two subsequent alternating
baseline/candidate batches reduce median elapsed time by 4.1% and 4.8%.
Each batch uses one warmup pair and five measured pairs of 20,000 games.
The dungeon translation unit's exception table shrinks from 2,848 to 2,604
bytes; text grows by 196 bytes and unwind-frame data grows by 16 bytes.
These measurements are workload/platform specific, not a general PHP speedup.
Normal-path short measurements vary in both directions. An extended run of
100,000 games per sample is effectively flat: baseline median 2.482272 seconds,
candidate 2.473237 seconds (-0.36%), with overlapping sample ranges. No
normal-path speedup is claimed. An earlier batch under heavy host CPU contention
is retained as inconclusive evidence, not used to substantiate the performance
claim. Windows/macOS and other compiler configurations have not been tested for
this change.