Skip to content

JIT: ldap_compare() via LdapResultJitHelper bridge (#32121) - #32127

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-32121-ldap-compare-jit
Aug 18, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-32121-ldap-compare-jit

Conversation

@PurHur

@PurHur PurHur commented Aug 18, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add LdapResultJitHelper::compareArgv + JitLdapResult::invokeCompare so compiled ldap_compare() delegates to existing VmLdapCore::compare() semantics (php-src ext/ldap/ldap.c).
  • Register __compiler_ldap_compare bridge in LdapRuntime.php via JitVmHelperLink::ensureBridge — no new runtime/*.c logic.
  • Replace the JIT LogicException stub in ldap_compare::call().

C runtime shrink

No C added. Behavior lives entirely in ext/ldap/ + lib/JIT/Builtin/LdapRuntime.php.

Test plan

./script/phpunit.sh --filter 'LdapCompareJitHelperTest|LdapRuntimeShrinkTest'
# OK (4 tests, 37 assertions)

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && export PHP_COMPILER_ENABLE_LDAP=1 && php bin/jit.php test/repro/issue_ldap_compare_jit.php 2>&1 | grep -v Deprecated'
# fn=1
# result=-1
# ok

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && export PHP_COMPILER_ENABLE_LDAP=1 PHP_COMPILER_PROFILE=8.4 && php bin/jit.php test/compliance/cases/ext/ldap_compare_parse.phpt 2>&1 | tail -12'
# ldap_compare=1 … compare_error_int … (matches --EXPECT)

Not run: full compliance shard, bootstrap-selfhost-link, differential-sweep (no lowering/CFG change beyond ldap_compare bridge).

Closes #32121

Made with Cursor

Route compiled ldap_compare through PHP helper + JitVmHelperLink in
LdapRuntime instead of the LogicException stub; semantics stay in
ext/ldap/VmLdapCore with no new C runtime surface.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit 84d1805 into master Aug 18, 2026
1 check failed
@PurHur
PurHur deleted the agent/issue-32121-ldap-compare-jit branch August 18, 2026 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stdlib: ldap_compare() JIT lowering missing — VM path only (ext/ldap/ldap.c)

1 participant