09d22a0509
This fixes the case where a late local var initializer allocates variables or temporaries. It's not clear where they should be allocated, since the initializer could be called anywhere the late variable is accessed. So we wrap the initializer in a closure, since calling a closure only requires a single temporary. So then we just need to allocate that temp everywhere the late var is accessed. Since temporaries are associated with specific AST nodes, we also need to add the ability to swap out the temporaries associated with a node, so that we can use the getter's temp when the getter visits the initializer. This will also reduce code bloat for large initializers. Bug: https://github.com/dart-lang/sdk/issues/38841 Change-Id: Ice8c16babc0e56368657088edf1b51b422ee0241 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125762 Commit-Queue: Liam Appelbe <liama@google.com> Reviewed-by: Alexander Markov <alexmarkov@google.com> Reviewed-by: Régis Crelier <regis@google.com>