hash: JIT/AOT incremental hash_init/update/final/copy (#3357)#17087
Open
PurHur wants to merge 3 commits into
Open
hash: JIT/AOT incremental hash_init/update/final/copy (#3357)#17087PurHur wants to merge 3 commits into
PurHur wants to merge 3 commits into
Conversation
Wire hash_init/update/final/copy through JitHashContext with HashContext object property buffering and JitHash::hash for finalize. Fix StringHashCryptoPhp bridge i32→i1 coercion for AOT module verify. VM + AOT compile verified; AOT execute still under investigation when update/final are linked in the same binary (startup segfault in Docker). php-src: ext/hash/hash.c Co-authored-by: Cursor <cursoragent@cursor.com>
Open
6 tasks
Store __hcAlgo/__hcData/__hcLive on HashContext as native string property slots (not TYPE_VALUE boxes) so propertyFetch round-trips for hash_final(). Deep-copy strings in hash_copy(); defer StringHashCrypto link to hash_final. VM/JIT repro green; AOT execute still empty output (follow-up on #3357). Co-authored-by: Cursor <cursoragent@cursor.com>
Owner
Author
|
Maintainer triage: VM repro + compile green per PR body; AOT execute still segfaults/empty — holding merge until |
49 tasks
Pre-register __hcAlgo/__hcData/__hcLive on HashContext before allocate() so JIT objects get three string property slots. Read/write digest buffers via direct slot load/store instead of propertyFetch (avoids double __string__separate on store). VM repro green; AOT still segfaults on hash_update/hash_copy/hash_final (read path) — next: bisect loadStringPtrProperty vs StringHashCrypto init. Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Summary
hash_init(),hash_update(),hash_final(), andhash_copy()viaJitHashContext(php-srcext/hash/hash.c).HashContextobject properties (__hcAlgo,__hcData,__hcLive); finalize through existingJitHash::hash()/__compiler_hash.StringHashCryptoPhpbridge to coerce ABIi32raw flags to helperi1(JitNestedHelperCoerce) — unblocks AOT module verify for hash crypto.php-src reference
ext/hash/hash.c—php_hash_init/update/final/copyPHP implementation
ext/hash/JitHashContext.php— LLVM loweringext/hash/HashContextJitSupport.php— internal property nameslib/JIT/Builtin/HashContextRuntime.php— linksStringHashCryptoonce fromhash_initlib/JIT/Builtin/StringHashCryptoPhp.php— i32→i1 bridge coercion (php-in-php: JIT StringHashCrypto — route hash()/hash_hmac() through VmHash PHP not __compiler_hash_* LLVM (#1492) #9164)Verification
hash_init()alone AOT-runs; combininghash_update/hash_finalin one binary currently segfaults at standalone main before user PHP. Next step: bisect LLVM IR fromhash_updateproperty concat +JitHash::hashfinalize path.Closes #3357 when AOT execute is green.
Made with Cursor