mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-26 06:34:20 +08:00
A checked-dynamic method call looked its name up in the method table on every call: a strlen, a hash and a byte comparison of the name. The compiler now gives each method-name constant an i32 slot that starts at -1 and passes it with the call (scr_dyn_invoke_prepared_id, and the Buffer method entries, which forward it). The first call stores the name's id in the slot, and later calls read it. Ids stay the runtime's own, so the slot holds whatever this runtime's table says. Names are still matched by content on the first call, and the slot is written with a relaxed atomic store, since every thread writes the same id. The runtime ABI is now 28.