d6eb8c6c27
Originally these passes were a single confusingly named flow_graph_optimizer pass, they later were completely split by duplicating flow_graph_optimizer twice as jit_optimizer.cc and aot_optimizer.cc and tweaking them in few places. Duplication has been done in anticipation that these passes will diverge considerably, however simple diffing reveals that in 2 years they have not actually diverged much at all. Diffing also reveals numerous bugs and inconsistencies between jit_optimizer and aot_optimizer. It does not make sense to keep these files duplicated so this change merges them back together - extracting most of their common behaviour into CallSpecializer base class. The separation is not entirely clean - for simplicity we introduce the knowledge about precompiled_mode into CallSpecializer base class. You can look for FLAG_precompiled_mode and FLAG_use_field_guards in the call_specializer.cc to see where base class has to be aware about both AOT and JIT mode. This change also renames XyzOptimizer to XyzCallSpecializer because the main optimization these classes were doing was specialization of calls based on type feedback or inferred types. Bug: https://github.com/dart-lang/sdk/issues/30575 Change-Id: I0b062c4b7549d08b1bee9303d92a3fb549f54e21 Reviewed-on: https://dart-review.googlesource.com/3640 Reviewed-by: Ryan Macnak <rmacnak@google.com> Reviewed-by: Alexander Markov <alexmarkov@google.com> Reviewed-by: Zach Anderson <zra@google.com>