Files
sdk/pkg/cfg
Alexander Markov 88496ba1c3 [vm,dart2bytecode,modular_aot] Variable-length closure objects
Extend closure objects with variable number of elements to capture.
This is needed to support capturing multiple independent contexts
after capturing is computed in the front-end.

The following fixed Closure fields are moved into variable-length
elements:
 - delayed type arguments;
 - instantiator type arguments;
 - function type arguments;
 - context.

Number of elements and presence/indices of various type arguments
are encoded into the new length_and_flags field in the Closure.

Most closure objects don't need any of the type arguments so this
change will reduce average Closure object size.

TEST=ci
Issue: https://github.com/dart-lang/sdk/issues/61572
Issue: https://github.com/dart-lang/sdk/issues/61635

Change-Id: I7ca5cec0fd8725c432a01d51781fb14e803997dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/489482
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
2026-04-09 12:22:21 -07:00
..

This package defines control flow graph (CFG) intermediate representation of Dart programs and optimization passes performed on CFG.

This package is intended to be used only by Dart compiler(s) in the Dart SDK.

Structure of the package:

  front_end/  # Translation from kernel AST to CFG.
  ir/         # CFG/SSA IR and computation of its properties.
  passes/     # Optimization passes.
  utils/      # General-purpose utilities.

Status: experimental

NOTE: This package is currently experimental and not published or included in the SDK.

Do not take dependency on this package unless you are prepared for breaking changes and possibly removal of this code at any point in time.