[vm/compiler] Reduce flow graph checks for common constants

This change disables certain debug mode checks for commonly used
constants which were enabled in https://dart-review.googlesource.com/c/sdk/+/253840.

It turns out they affect compilation time considerably in debug mode,
especially if low optimization threshold is used and kernel service
snapshot is not used (for example in debug/ia32 mode).

Time of running standalone_2/regress31114_test in debug/ia32 mode:
78s -> 34s.

TEST=CQ + a few debug bots
Fixes https://github.com/dart-lang/sdk/issues/49676

Change-Id: I9e09d6e5b9c1c86d9026a924a367301e0dac85b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255500
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
diff --git a/runtime/vm/compiler/backend/flow_graph_checker.cc b/runtime/vm/compiler/backend/flow_graph_checker.cc
index 66d2dad..e3f8fdd 100644
--- a/runtime/vm/compiler/backend/flow_graph_checker.cc
+++ b/runtime/vm/compiler/backend/flow_graph_checker.cc
@@ -401,6 +401,8 @@
     // Initial definitions are partially linked into graph, but some
     // constants are fully linked into graph (so no next() assert).
     ASSERT1(def->previous() != nullptr, def);
+    // Skip checks below for common constants as checking them could be slow.
+    if (IsCommonConstant(def)) return;
   } else {
     // Others are fully linked into graph.
     ASSERT1(def->next() != nullptr, def);