Skip to content

php-in-php: delete InArrayNativeLlvm + ArrayIsListNativeLlvm — route __in_array__contains / __array_is_list__check through JitVmHelperLink PHP (#18153 phase 4) #18990

Description

@PurHur

Category

php-in-PHP · runtime-shrink

Problem

InArrayRuntime and ArrayIsListRuntime still emit hand-written packed-table LLVM in InArrayNativeLlvm.php (~89 LOC) and ArrayIsListNativeLlvm.php (~112 LOC) for __in_array__contains / __array_is_list__check. Phase 3 (#18153) deleted the ArrayBuiltinHelper monolith; ArraySearchRuntime already routes through JitVmHelperLink::ensureBridge + ArraySearchJitHelper PHP. The native LLVM scan duplicates InArrayJitHelper::contains / ArrayIsListJitHelper::isList.

php-src reference

PHP implementation target

  • lib/JIT/Builtin/InArrayRuntime.php — JitVmHelperLink::ensureBridge to InArrayJitHelper::contains (pattern: ArraySearchRuntime)
  • lib/JIT/Builtin/ArrayIsListRuntime.php — same for ArrayIsListJitHelper::isList
  • Delete lib/JIT/Builtin/InArrayNativeLlvm.php, lib/JIT/Builtin/ArrayIsListNativeLlvm.php

Repro

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
vendor/bin/phpunit --filter InArrayRuntimeShrinkTest
vendor/bin/phpunit --filter ArrayIsListRuntimeShrinkTest
'

Done when

  • Native LLVM files deleted; runtime bridges use JitVmHelperLink::ensureBridge
  • Shrink tests assert no InArrayNativeLlvm / ArrayIsListNativeLlvm references
  • make bootstrap-selfhost-vm-driver-execute-probe green

Refs #12503, #13645, #18153, #1492

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:compilerCompiler / CFG / JITenhancementNew feature or requestimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-0:FoundationPhase 0 – foundation & DevEx

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions