Skip to content

Keep int32 class fields beside Buffer.from over an ArrayBuffer range - #2070

Merged
ctate merged 1 commit into
mainfrom
ctate/keep-int32-class-8c124f
Oct 24, 2026
Merged

ctate merged 1 commit into
mainfrom
ctate/keep-int32-class-8c124f

Conversation

@ctate

@ctate ctate commented Oct 24, 2026

Copy link
Copy Markdown
Collaborator
  • Buffer.from(arrayBuffer, byteOffset, length) passes its operands as checked values, and the int32 slot analysis treated that helper as a possible store into any class field, so one such call dropped every int32 class field in the program.
  • The two range helpers only read their operands, so they are listed as read-only; a unit test covers it.
  • tsc-ts's int32 variants go from 934 back to 1,324.

Buffer.from(arrayBuffer, byteOffset[, length]) lowers to
buffer.poolFromDynRange with its operands as checked values. The int32
slot analysis treats any runtime helper with a checked-value argument
as a possible store into a live class instance unless the helper is
listed as read-only, so one such call dropped every int32 class field
fact in the program (tsc-ts's scanner makes one).

buffer.poolFromDynRange and buffer.poolFromDynOffset read their
operands (the ArrayBuffer's view after Node's offset and length
conversions, or a copy of a string's, array-like's or typed array's
values) and store into no class instance, so they join DYN_READ_ONLY.
@vercel

vercel Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
scriptc Ready Ready Preview, v0 Oct 24, 2026 2:49am UTC

@ctate
ctate merged commit cc4428a into main Oct 24, 2026
124 of 126 checks passed
@ctate
ctate deleted the ctate/keep-int32-class-8c124f branch October 24, 2026 04:02

This branch was successfully deployed

1 active deployment
Preview — 96dbc620 Deployed Oct 24, 2026 by vercel[bot]
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.

1 participant