Skip to content

Conversation

@steveklabnik
Copy link
Collaborator

Convert all InstData variants that embedded Vec to use the extra array pattern (start: u32, len: u32). This follows the Zig ZIR approach.

Affected variants:

  • Match: arms now in extra array
  • FnDecl: directives and params now in extra array
  • Call, MethodCall, AssocFnCall, Intrinsic: args now in extra array
  • ArrayInit: elements now in extra array
  • StructInit, StructDecl: fields now in extra array
  • EnumDecl: variants now in extra array
  • ImplDecl: methods now in extra array
  • Alloc: directives now in extra array

Benefits:

  • Reduces InstData enum size from ~64+ bytes to ~24 bytes
  • Eliminates per-instruction heap allocations
  • Improves cache locality during IR traversal

🤖 Generated with Claude Code

@steveklabnik steveklabnik force-pushed the steveklabnik/push-smsllxqqozty branch from 03ca018 to ca4e0bc Compare December 28, 2025 13:54
Convert all InstData variants that embedded Vec<T> to use the extra
array pattern (start: u32, len: u32). This follows the Zig ZIR approach.

Affected variants:
- Match: arms now in extra array
- FnDecl: directives and params now in extra array  
- Call, MethodCall, AssocFnCall, Intrinsic: args now in extra array
- ArrayInit: elements now in extra array
- StructInit, StructDecl: fields now in extra array
- EnumDecl: variants now in extra array
- ImplDecl: methods now in extra array
- Alloc: directives now in extra array

Benefits:
- Reduces InstData enum size from ~64+ bytes to ~24 bytes
- Eliminates per-instruction heap allocations
- Improves cache locality during IR traversal

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@steveklabnik steveklabnik force-pushed the steveklabnik/push-smsllxqqozty branch from ca4e0bc to 3181806 Compare December 28, 2025 14:54
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