Parents: #465, #498 Related: #491
Problem
The module runtime gives every declaring module a stable, distinct lazily created import.meta object, but otherwise eligible module functions had no bytecode lowering for .import_meta. Investigation also found a causal activation gap: generator state retained its ImportMetaSlot, while normal async activation creation/resume and generator-family parameter-default evaluation could inherit the caller slot instead of the declaring module slot.
Scope
- Add an owned bytecode operation that loads the active declaring module meta-object through the existing lazy
ImportMetaSlotcontract. - Carry the declaring slot through plain, generator, async, and async-generator creation, parameter evaluation, suspension, and resume boundaries.
- Preserve one null-prototype extensible object per declaring module, stable identity across repeated calls, cross-module distinction, allocation failure, closures, generators, async functions, suspension, and moving/concurrent GC relocation.
- Preserve lexical provenance when an exported function is called from another module or host entry; never substitute the caller module or global realm.
- Keep non-module
import.metasyntax rejection unchanged and retain exact interpreter fallback for unsupported surrounding syntax. - Reject the new operation cleanly from native tiers until they own the same module-root and exception contract.
No-workaround rules
- No global/environment shadow binding, eager object clone, per-read allocation, source/AST rewriting, tree-walker callback presented as bytecode, process-global cache, or global lock serialization.
- No stacks/queues/jobs, Promise/microtask, Worker lifecycle, or Map/Set iterator implementation changes.
Acceptance
- Plain, generator, and async module functions containing
import.metaare bytecode-eligible and return the exact declaring-module object. - Repeated reads are identical within one module and distinct across modules/callers; creation remains lazy and allocation failure is exact.
- Suspension plus confirmed moving-GC relocation preserves the live module meta-object and activation root.
- Forced tree-walker/required-bytecode and automatic native fallback agree without repeated/eager allocation.
- Focused compiler/module/GC tests, applicable TSan, full units, and exact relevant Test262 before → after accounting pass with zero regressions.
- Parent/related issues and landing commit carry quantified evidence links.