[dart2js] Handle ConstantExpression in InlineWeeder.

With constant-update-2018 enabled, ConstantExpression nodes are added to the AST. The defaultNode() implementation increments each node count by 1 whenever we see a ConstantExpression and then does it again when we visit the child DartType, resulting in each ConstantExpression being counted twice. Instead, we should just increment the node counts when we see a ConstantExpression and not visit the children.

Change-Id: Ifdbda2913420eea1463790cab2e477e7552d1394
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106727
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
diff --git a/pkg/compiler/lib/src/ssa/builder_kernel.dart b/pkg/compiler/lib/src/ssa/builder_kernel.dart
index 257c019..1c0a232 100644
--- a/pkg/compiler/lib/src/ssa/builder_kernel.dart
+++ b/pkg/compiler/lib/src/ssa/builder_kernel.dart
@@ -6876,6 +6876,12 @@
   }
 
   @override
+  visitConstantExpression(ir.ConstantExpression node) {
+    registerRegularNode();
+    registerReductiveNode();
+  }
+
+  @override
   visitReturnStatement(ir.ReturnStatement node) {
     registerRegularNode();
     node.visitChildren(this);