Skip to content

JIT: keep CONST_FETCH literals under INCLUDE_SCOPE_REMAP=0 (#29111) - #29120

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-29111-tz-abbreviations-const-fetch
Aug 8, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-29111-tz-abbreviations-const-fetch

Conversation

@PurHur

@PurHur PurHur commented Aug 8, 2026

Copy link
Copy Markdown
Owner

Summary

php-src reference

N/A (compiler lowering). Prior: #16866 / #16873.

Verification

# Unit (inheritScopeFrom collision)
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php -d memory_limit=1536M vendor/bin/phpunit --filter IncludeScopeConstFetchLiteralTest'
# OK (2 tests, 11 assertions)

# Mini-spine + real TZ after defined() with REMAP=0 (IncludeHelper path)
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && export PHP_COMPILER_INCLUDE_SCOPE_REMAP=0 && php -d memory_limit=1536M bin/compile.php -o /tmp/issue29111_mini test/selfhost/issue_29111_const_fetch_spine/main.php && php -d memory_limit=1536M bin/compile.php -o /tmp/issue29111_realtz test/selfhost/issue_29111_const_fetch_spine/main_real_tz.php'
# both EXIT 0; no "Undefined constant \"defined\""

# Related phpunit filter
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php -d memory_limit=1536M vendor/bin/phpunit --filter "IncludeScopeConstFetchLiteralTest|IncludeBindingNestedAppNameTest|testConstFetchSpineRemapOffCompiles|testTimezoneAbbreviationsDataRequireCompiles"'
# OK (7 tests, 108 assertions)

Not covered this PR: full exclusive gen-0 spine refresh (~hours). After merge, #28998 can re-run ./script/bootstrap-gen0-refresh-exclusive-docker.sh and skip re-deferring TimezoneAbbreviationsData (or un-defer if already deferred on that branch).

Pre-triage gates

Made with Cursor

Spine AOT with remapping disabled aliased parent defined() name Literals
onto callee slots, so TimezoneAbbreviationsData CONST_FETCH resolved
"defined" instead of "true". Remap colliding Literals even when Var
indices stay shared, and prefer the first Literal in getOperand.

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

Regression: TimezoneAbbreviationsData top-level spine require — Undefined constant "defined" at bundle scale (re-#16866, lib/JIT.php)

1 participant