mirror of
https://github.com/dart-lang/sdk
synced 2024-10-14 14:53:37 +00:00
bfd15821a7
List.generate could return both growable and fixed-size lists. This change specializes invocations of List.generate when value of 'growable' argument is known (constant or omitted), so it becomes possible to infer actual type returned by the factory. This becomes more important with null safety as List.generate is used more often to initialize lists of non-nullable elements. Migrated NNBD benchmarks in AOT mode on x64: Sudoku +11% DartMicroBenchMM.{Min,Max}Lib +11-13% DartMicroBenchMM.{Min,Max}Code +19-27% ForInGeneratedLoop +19% ForEachLoop +85% ForInLoop +64% ForLoop +680% This change also includes test for inferred types of various List constructors. Change-Id: I801231b0a70e3aa8fb14ec9fe749f1dd420b1b9c Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153388 Reviewed-by: Aske Simon Christensen <askesc@google.com> Commit-Queue: Alexander Markov <alexmarkov@google.com> |
||
---|---|---|
.. | ||
bin | ||
lib | ||
api_readme.md | ||
BUILD.gn |