2c97d724df
CloneContext is implemented as a runtime call so it is considerably slower than AllocateContext which leads to performance issues in loops that capture iteration variables in for loops. Lowering CloneContext into AllocateUninitializedContext and a sequence of explicit load&store instructions both improves the performance by avoiding the runtime call and also makes CloneContext semantics exposed to store-load forwarding and allocation sinking. PutIfAbsent benchmark from issue #31113 is improved by 5x, while ForInGeneratedLoop benchmark is improved by 8x. Bug: https://github.com/dart-lang/sdk/issues/31113 Change-Id: I03fdede75f1a85fda92487aa8f9307ce06f23903 Reviewed-on: https://dart-review.googlesource.com/16280 Commit-Queue: Vyacheslav Egorov <vegorov@google.com> Reviewed-by: Alexander Markov <alexmarkov@google.com>