6c9a830fda
Write barriers should not be eliminated for a StoreInstanceField if there is a Dart call between store and object allocation. This is implemented using Instruction::CanCallDart() predicate, which is overridden for TemplateDartCall. However, LoadField instructions for late fields with initializers can also call initializer function directly without entering runtime. This change introduces LoadFieldInstr::CanCallDart() to avoid incorrect write barrier elimination across such LoadField instructions. TEST=vm/cc/IRTest_WriteBarrierElimination_LoadLateField Bug: b/204355807 Change-Id: Ibd9fe61e9723f1f4ecc9e4f5cedc3024d9d03c75 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/218583 Reviewed-by: Slava Egorov <vegorov@google.com> Commit-Queue: Alexander Markov <alexmarkov@google.com>