Skip to content

[codex] Cache tagged-template objects per call site#4234

Merged
proggeramlug merged 1 commit into
PerryTS:mainfrom
andrewtdiz:codex/node-compat-runtime-tagged-template-cache
Jun 3, 2026
Merged

[codex] Cache tagged-template objects per call site#4234
proggeramlug merged 1 commit into
PerryTS:mainfrom
andrewtdiz:codex/node-compat-runtime-tagged-template-cache

Conversation

@andrewtdiz
Copy link
Copy Markdown
Contributor

Closes #2855.

Summary

  • assign stable HIR call-site ids to tagged template sites and route codegen through a runtime template-object cache
  • freeze cooked/raw template arrays, install non-enumerable immutable .raw, and guard array mutation paths against frozen template objects
  • add a focused Node parity fixture for call-site identity, .raw, frozen/extensible state, and mutation resistance

Validation

  • cargo fmt --all -- --check
  • git diff --check origin/main..HEAD
  • ./scripts/check_file_size.sh
  • CARGO_TARGET_DIR=/root/perry-worktrees/perry-runtime-tagged-template-cache/target cargo check -p perry-hir -p perry-codegen -p perry-runtime
  • CARGO_TARGET_DIR=/root/perry-worktrees/perry-runtime-tagged-template-cache/target npm exec --package=node@25 -- bash -lc 'node --version; ./run_parity_tests.sh --suite node-suite --module globals --filter tagged-template-cache-freeze'\n

@andrewtdiz andrewtdiz force-pushed the codex/node-compat-runtime-tagged-template-cache branch from 65265b1 to 255c05d Compare June 3, 2026 08:16
@proggeramlug proggeramlug force-pushed the codex/node-compat-runtime-tagged-template-cache branch from 255c05d to 93e3153 Compare June 3, 2026 08:28
@proggeramlug proggeramlug marked this pull request as ready for review June 3, 2026 08:28
@proggeramlug proggeramlug merged commit d16f9c8 into PerryTS:main Jun 3, 2026
1 check passed
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.

runtime: cache and freeze tagged-template string arrays

2 participants