[dart2js] Adding program-level info to dump info tests

Change-Id: I3df11ad508259ac12080bab6595377550124c8a2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243023
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
diff --git a/pkg/compiler/test/dump_info/data/deferred/main.dart b/pkg/compiler/test/dump_info/data/deferred/main.dart
index 7e1cee2..58ffa26 100644
--- a/pkg/compiler/test/dump_info/data/deferred/main.dart
+++ b/pkg/compiler/test/dump_info/data/deferred/main.dart
@@ -4,7 +4,92 @@
 
 // @dart = 2.7
 
-/*library: library=[{
+/*library: 
+ constant=[
+  {
+  "id": "constant/B.C_Deferred = A.lib__funky$closure();\n",
+  "kind": "constant",
+  "name": null,
+  "size": 39,
+  "outputUnit": "outputUnit/1",
+  "code": "B.C_Deferred = A.lib__funky$closure();\n"
+},
+  {
+  "id": "constant/B.C_JS_CONST = function getTagFallback(o) {\n  var s = Object.prototype.toString.call(o);\n  return s.substring(8, s.length - 1);\n};\n",
+  "kind": "constant",
+  "name": null,
+  "size": 131,
+  "outputUnit": "outputUnit/main",
+  "code": "B.C_JS_CONST = function getTagFallback(o) {\n  var s = Object.prototype.toString.call(o);\n  return s.substring(8, s.length - 1);\n};\n"
+},
+  {
+  "id": "constant/B.C__RootZone = new A._RootZone();\n",
+  "kind": "constant",
+  "name": null,
+  "size": 35,
+  "outputUnit": "outputUnit/main",
+  "code": "B.C__RootZone = new A._RootZone();\n"
+},
+  {
+  "id": "constant/B.C__StringStackTrace = new A._StringStackTrace();\n",
+  "kind": "constant",
+  "name": null,
+  "size": 51,
+  "outputUnit": "outputUnit/main",
+  "code": "B.C__StringStackTrace = new A._StringStackTrace();\n"
+},
+  {
+  "id": "constant/B.Interceptor_methods = J.Interceptor.prototype;\n",
+  "kind": "constant",
+  "name": null,
+  "size": 49,
+  "outputUnit": "outputUnit/main",
+  "code": "B.Interceptor_methods = J.Interceptor.prototype;\n"
+},
+  {
+  "id": "constant/B.JSArray_methods = J.JSArray.prototype;\n",
+  "kind": "constant",
+  "name": null,
+  "size": 41,
+  "outputUnit": "outputUnit/main",
+  "code": "B.JSArray_methods = J.JSArray.prototype;\n"
+},
+  {
+  "id": "constant/B.JSInt_methods = J.JSInt.prototype;\n",
+  "kind": "constant",
+  "name": null,
+  "size": 37,
+  "outputUnit": "outputUnit/main",
+  "code": "B.JSInt_methods = J.JSInt.prototype;\n"
+},
+  {
+  "id": "constant/B.JSString_methods = J.JSString.prototype;\n",
+  "kind": "constant",
+  "name": null,
+  "size": 43,
+  "outputUnit": "outputUnit/main",
+  "code": "B.JSString_methods = J.JSString.prototype;\n"
+},
+  {
+  "id": "constant/B.JavaScriptObject_methods = J.JavaScriptObject.prototype;\n",
+  "kind": "constant",
+  "name": null,
+  "size": 59,
+  "outputUnit": "outputUnit/main",
+  "code": "B.JavaScriptObject_methods = J.JavaScriptObject.prototype;\n"
+}],
+ deferredFiles=[{
+  "main.dart": {
+    "name": "<unnamed>",
+    "imports": {
+      "lib": [
+        "out_1.part.js"
+      ]
+    }
+  }
+}],
+ dependencies=[{}],
+ library=[{
   "id": "library/memory:sdk/tests/web/native/main.dart::",
   "kind": "library",
   "name": "<unnamed>",
@@ -13,7 +98,27 @@
     "function/memory:sdk/tests/web/native/main.dart::main"
   ],
   "canonicalUri": "memory:sdk/tests/web/native/main.dart"
-}]*/
+}],
+ outputUnits=[
+  {
+  "id": "outputUnit/1",
+  "kind": "outputUnit",
+  "name": "1",
+  "size": 1063,
+  "filename": "out_1.part.js",
+  "imports": [
+    "lib"
+  ]
+},
+  {
+  "id": "outputUnit/main",
+  "kind": "outputUnit",
+  "name": "main",
+  "size": 183730,
+  "filename": "out",
+  "imports": []
+}]
+*/
 
 import 'lib.dart' deferred as lib;
 
diff --git a/pkg/compiler/test/dump_info/data/deferred_future/main.dart b/pkg/compiler/test/dump_info/data/deferred_future/main.dart
index 10e2e599..5500fb6 100644
--- a/pkg/compiler/test/dump_info/data/deferred_future/main.dart
+++ b/pkg/compiler/test/dump_info/data/deferred_future/main.dart
@@ -2,7 +2,100 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-/*library: library=[{
+/*library: 
+ constant=[
+  {
+  "id": "constant/B.C_A = new A.A();\n",
+  "kind": "constant",
+  "name": null,
+  "size": 19,
+  "outputUnit": "outputUnit/1",
+  "code": "B.C_A = new A.A();\n"
+},
+  {
+  "id": "constant/B.C_Deferred = B.C_A;\n",
+  "kind": "constant",
+  "name": null,
+  "size": 22,
+  "outputUnit": "outputUnit/1",
+  "code": "B.C_Deferred = B.C_A;\n"
+},
+  {
+  "id": "constant/B.C_JS_CONST = function getTagFallback(o) {\n  var s = Object.prototype.toString.call(o);\n  return s.substring(8, s.length - 1);\n};\n",
+  "kind": "constant",
+  "name": null,
+  "size": 131,
+  "outputUnit": "outputUnit/main",
+  "code": "B.C_JS_CONST = function getTagFallback(o) {\n  var s = Object.prototype.toString.call(o);\n  return s.substring(8, s.length - 1);\n};\n"
+},
+  {
+  "id": "constant/B.C__RootZone = new A._RootZone();\n",
+  "kind": "constant",
+  "name": null,
+  "size": 35,
+  "outputUnit": "outputUnit/main",
+  "code": "B.C__RootZone = new A._RootZone();\n"
+},
+  {
+  "id": "constant/B.C__StringStackTrace = new A._StringStackTrace();\n",
+  "kind": "constant",
+  "name": null,
+  "size": 51,
+  "outputUnit": "outputUnit/main",
+  "code": "B.C__StringStackTrace = new A._StringStackTrace();\n"
+},
+  {
+  "id": "constant/B.Interceptor_methods = J.Interceptor.prototype;\n",
+  "kind": "constant",
+  "name": null,
+  "size": 49,
+  "outputUnit": "outputUnit/main",
+  "code": "B.Interceptor_methods = J.Interceptor.prototype;\n"
+},
+  {
+  "id": "constant/B.JSArray_methods = J.JSArray.prototype;\n",
+  "kind": "constant",
+  "name": null,
+  "size": 41,
+  "outputUnit": "outputUnit/main",
+  "code": "B.JSArray_methods = J.JSArray.prototype;\n"
+},
+  {
+  "id": "constant/B.JSInt_methods = J.JSInt.prototype;\n",
+  "kind": "constant",
+  "name": null,
+  "size": 37,
+  "outputUnit": "outputUnit/main",
+  "code": "B.JSInt_methods = J.JSInt.prototype;\n"
+},
+  {
+  "id": "constant/B.JSString_methods = J.JSString.prototype;\n",
+  "kind": "constant",
+  "name": null,
+  "size": 43,
+  "outputUnit": "outputUnit/main",
+  "code": "B.JSString_methods = J.JSString.prototype;\n"
+},
+  {
+  "id": "constant/B.JavaScriptObject_methods = J.JavaScriptObject.prototype;\n",
+  "kind": "constant",
+  "name": null,
+  "size": 59,
+  "outputUnit": "outputUnit/main",
+  "code": "B.JavaScriptObject_methods = J.JavaScriptObject.prototype;\n"
+}],
+ deferredFiles=[{
+  "main.dart": {
+    "name": "<unnamed>",
+    "imports": {
+      "lib1": [
+        "out_1.part.js"
+      ]
+    }
+  }
+}],
+ dependencies=[{}],
+ library=[{
   "id": "library/memory:sdk/tests/web/native/main.dart::",
   "kind": "library",
   "name": "<unnamed>",
@@ -11,7 +104,27 @@
     "function/memory:sdk/tests/web/native/main.dart::main"
   ],
   "canonicalUri": "memory:sdk/tests/web/native/main.dart"
-}]*/
+}],
+ outputUnits=[
+  {
+  "id": "outputUnit/1",
+  "kind": "outputUnit",
+  "name": "1",
+  "size": 846,
+  "filename": "out_1.part.js",
+  "imports": [
+    "lib1"
+  ]
+},
+  {
+  "id": "outputUnit/main",
+  "kind": "outputUnit",
+  "name": "main",
+  "size": 190176,
+  "filename": "out",
+  "imports": []
+}]
+*/
 
 // @dart = 2.7
 
diff --git a/pkg/compiler/test/dump_info/data/js_members.dart b/pkg/compiler/test/dump_info/data/js_members.dart
index 6f18324..46efe6b 100644
--- a/pkg/compiler/test/dump_info/data/js_members.dart
+++ b/pkg/compiler/test/dump_info/data/js_members.dart
@@ -1,4 +1,128 @@
-/*library: library=[{
+/*library: 
+ constant=[
+  {
+  "id": "constant/B.C_JS_CONST = function getTagFallback(o) {\n  var s = Object.prototype.toString.call(o);\n  return s.substring(8, s.length - 1);\n};\n",
+  "kind": "constant",
+  "name": null,
+  "size": 131,
+  "outputUnit": "outputUnit/main",
+  "code": "B.C_JS_CONST = function getTagFallback(o) {\n  var s = Object.prototype.toString.call(o);\n  return s.substring(8, s.length - 1);\n};\n"
+},
+  {
+  "id": "constant/B.C_JS_CONST0 = function() {\n  var toStringFunction = Object.prototype.toString;\n  function getTag(o) {\n    var s = toStringFunction.call(o);\n    return s.substring(8, s.length - 1);\n  }\n  function getUnknownTag(object, tag) {\n    if (/^HTML[A-Z].*Element$/.test(tag)) {\n      var name = toStringFunction.call(object);\n      if (name == \"[object Object]\") return null;\n      return \"HTMLElement\";\n    }\n  }\n  function getUnknownTagGenericBrowser(object, tag) {\n    if (self.HTMLElement && object instanceof HTMLElement) return \"HTMLElement\";\n    return getUnknownTag(object, tag);\n  }\n  function prototypeForTag(tag) {\n    if (typeof window == \"undefined\") return null;\n    if (typeof window[tag] == \"undefined\") return null;\n    var constructor = window[tag];\n    if (typeof constructor != \"function\") return null;\n    return constructor.prototype;\n  }\n  function discriminator(tag) { return null; }\n  var isBrowser = typeof navigator == \"object\";\n  return {\n    getTag: getTag,\n    getUnknownTag: isBrowser ? getUnknownTagGenericBrowser : getUnknownTag,\n    prototypeForTag: prototypeForTag,\n    discriminator: discriminator };\n};\n",
+  "kind": "constant",
+  "name": null,
+  "size": 1133,
+  "outputUnit": "outputUnit/main",
+  "code": "B.C_JS_CONST0 = function() {\n  var toStringFunction = Object.prototype.toString;\n  function getTag(o) {\n    var s = toStringFunction.call(o);\n    return s.substring(8, s.length - 1);\n  }\n  function getUnknownTag(object, tag) {\n    if (/^HTML[A-Z].*Element$/.test(tag)) {\n      var name = toStringFunction.call(object);\n      if (name == \"[object Object]\") return null;\n      return \"HTMLElement\";\n    }\n  }\n  function getUnknownTagGenericBrowser(object, tag) {\n    if (self.HTMLElement && object instanceof HTMLElement) return \"HTMLElement\";\n    return getUnknownTag(object, tag);\n  }\n  function prototypeForTag(tag) {\n    if (typeof window == \"undefined\") return null;\n    if (typeof window[tag] == \"undefined\") return null;\n    var constructor = window[tag];\n    if (typeof constructor != \"function\") return null;\n    return constructor.prototype;\n  }\n  function discriminator(tag) { return null; }\n  var isBrowser = typeof navigator == \"object\";\n  return {\n    getTag: getTag,\n    getUnknownTag: isBrowser ? getUnknownTagGenericBrowser : getUnknownTag,\n    prototypeForTag: prototypeForTag,\n    discriminator: discriminator };\n};\n"
+},
+  {
+  "id": "constant/B.C_JS_CONST1 = function(hooks) {\n  if (typeof dartExperimentalFixupGetTag != \"function\") return hooks;\n  hooks.getTag = dartExperimentalFixupGetTag(hooks.getTag);\n};\n",
+  "kind": "constant",
+  "name": null,
+  "size": 167,
+  "outputUnit": "outputUnit/main",
+  "code": "B.C_JS_CONST1 = function(hooks) {\n  if (typeof dartExperimentalFixupGetTag != \"function\") return hooks;\n  hooks.getTag = dartExperimentalFixupGetTag(hooks.getTag);\n};\n"
+},
+  {
+  "id": "constant/B.C_JS_CONST2 = function(hooks) {\n  var getTag = hooks.getTag;\n  var prototypeForTag = hooks.prototypeForTag;\n  function getTagFixed(o) {\n    var tag = getTag(o);\n    if (tag == \"Document\") {\n      if (!!o.xmlVersion) return \"!Document\";\n      return \"!HTMLDocument\";\n    }\n    return tag;\n  }\n  function prototypeForTagFixed(tag) {\n    if (tag == \"Document\") return null;\n    return prototypeForTag(tag);\n  }\n  hooks.getTag = getTagFixed;\n  hooks.prototypeForTag = prototypeForTagFixed;\n};\n",
+  "kind": "constant",
+  "name": null,
+  "size": 491,
+  "outputUnit": "outputUnit/main",
+  "code": "B.C_JS_CONST2 = function(hooks) {\n  var getTag = hooks.getTag;\n  var prototypeForTag = hooks.prototypeForTag;\n  function getTagFixed(o) {\n    var tag = getTag(o);\n    if (tag == \"Document\") {\n      if (!!o.xmlVersion) return \"!Document\";\n      return \"!HTMLDocument\";\n    }\n    return tag;\n  }\n  function prototypeForTagFixed(tag) {\n    if (tag == \"Document\") return null;\n    return prototypeForTag(tag);\n  }\n  hooks.getTag = getTagFixed;\n  hooks.prototypeForTag = prototypeForTagFixed;\n};\n"
+},
+  {
+  "id": "constant/B.C_JS_CONST3 = function(hooks) { return hooks; }\n;\n",
+  "kind": "constant",
+  "name": null,
+  "size": 52,
+  "outputUnit": "outputUnit/main",
+  "code": "B.C_JS_CONST3 = function(hooks) { return hooks; }\n;\n"
+},
+  {
+  "id": "constant/B.C_JS_CONST4 = function(hooks) {\n  var userAgent = typeof navigator == \"object\" ? navigator.userAgent : \"\";\n  if (userAgent.indexOf(\"Trident/\") == -1) return hooks;\n  var getTag = hooks.getTag;\n  var quickMap = {\n    \"BeforeUnloadEvent\": \"Event\",\n    \"DataTransfer\": \"Clipboard\",\n    \"HTMLDDElement\": \"HTMLElement\",\n    \"HTMLDTElement\": \"HTMLElement\",\n    \"HTMLPhraseElement\": \"HTMLElement\",\n    \"Position\": \"Geoposition\"\n  };\n  function getTagIE(o) {\n    var tag = getTag(o);\n    var newTag = quickMap[tag];\n    if (newTag) return newTag;\n    if (tag == \"Object\") {\n      if (window.DataView && (o instanceof window.DataView)) return \"DataView\";\n    }\n    return tag;\n  }\n  function prototypeForTagIE(tag) {\n    var constructor = window[tag];\n    if (constructor == null) return null;\n    return constructor.prototype;\n  }\n  hooks.getTag = getTagIE;\n  hooks.prototypeForTag = prototypeForTagIE;\n};\n",
+  "kind": "constant",
+  "name": null,
+  "size": 900,
+  "outputUnit": "outputUnit/main",
+  "code": "B.C_JS_CONST4 = function(hooks) {\n  var userAgent = typeof navigator == \"object\" ? navigator.userAgent : \"\";\n  if (userAgent.indexOf(\"Trident/\") == -1) return hooks;\n  var getTag = hooks.getTag;\n  var quickMap = {\n    \"BeforeUnloadEvent\": \"Event\",\n    \"DataTransfer\": \"Clipboard\",\n    \"HTMLDDElement\": \"HTMLElement\",\n    \"HTMLDTElement\": \"HTMLElement\",\n    \"HTMLPhraseElement\": \"HTMLElement\",\n    \"Position\": \"Geoposition\"\n  };\n  function getTagIE(o) {\n    var tag = getTag(o);\n    var newTag = quickMap[tag];\n    if (newTag) return newTag;\n    if (tag == \"Object\") {\n      if (window.DataView && (o instanceof window.DataView)) return \"DataView\";\n    }\n    return tag;\n  }\n  function prototypeForTagIE(tag) {\n    var constructor = window[tag];\n    if (constructor == null) return null;\n    return constructor.prototype;\n  }\n  hooks.getTag = getTagIE;\n  hooks.prototypeForTag = prototypeForTagIE;\n};\n"
+},
+  {
+  "id": "constant/B.C_JS_CONST5 = function(hooks) {\n  var userAgent = typeof navigator == \"object\" ? navigator.userAgent : \"\";\n  if (userAgent.indexOf(\"Firefox\") == -1) return hooks;\n  var getTag = hooks.getTag;\n  var quickMap = {\n    \"BeforeUnloadEvent\": \"Event\",\n    \"DataTransfer\": \"Clipboard\",\n    \"GeoGeolocation\": \"Geolocation\",\n    \"Location\": \"!Location\",\n    \"WorkerMessageEvent\": \"MessageEvent\",\n    \"XMLDocument\": \"!Document\"};\n  function getTagFirefox(o) {\n    var tag = getTag(o);\n    return quickMap[tag] || tag;\n  }\n  hooks.getTag = getTagFirefox;\n};\n",
+  "kind": "constant",
+  "name": null,
+  "size": 548,
+  "outputUnit": "outputUnit/main",
+  "code": "B.C_JS_CONST5 = function(hooks) {\n  var userAgent = typeof navigator == \"object\" ? navigator.userAgent : \"\";\n  if (userAgent.indexOf(\"Firefox\") == -1) return hooks;\n  var getTag = hooks.getTag;\n  var quickMap = {\n    \"BeforeUnloadEvent\": \"Event\",\n    \"DataTransfer\": \"Clipboard\",\n    \"GeoGeolocation\": \"Geolocation\",\n    \"Location\": \"!Location\",\n    \"WorkerMessageEvent\": \"MessageEvent\",\n    \"XMLDocument\": \"!Document\"};\n  function getTagFirefox(o) {\n    var tag = getTag(o);\n    return quickMap[tag] || tag;\n  }\n  hooks.getTag = getTagFirefox;\n};\n"
+},
+  {
+  "id": "constant/B.C_JS_CONST6 = function(getTagFallback) {\n  return function(hooks) {\n    if (typeof navigator != \"object\") return hooks;\n    var ua = navigator.userAgent;\n    if (ua.indexOf(\"DumpRenderTree\") >= 0) return hooks;\n    if (ua.indexOf(\"Chrome\") >= 0) {\n      function confirm(p) {\n        return typeof window == \"object\" && window[p] && window[p].name == p;\n      }\n      if (confirm(\"Window\") && confirm(\"HTMLElement\")) return hooks;\n    }\n    hooks.getTag = getTagFallback;\n  };\n};\n",
+  "kind": "constant",
+  "name": null,
+  "size": 482,
+  "outputUnit": "outputUnit/main",
+  "code": "B.C_JS_CONST6 = function(getTagFallback) {\n  return function(hooks) {\n    if (typeof navigator != \"object\") return hooks;\n    var ua = navigator.userAgent;\n    if (ua.indexOf(\"DumpRenderTree\") >= 0) return hooks;\n    if (ua.indexOf(\"Chrome\") >= 0) {\n      function confirm(p) {\n        return typeof window == \"object\" && window[p] && window[p].name == p;\n      }\n      if (confirm(\"Window\") && confirm(\"HTMLElement\")) return hooks;\n    }\n    hooks.getTag = getTagFallback;\n  };\n};\n"
+},
+  {
+  "id": "constant/B.Interceptor_methods = J.Interceptor.prototype;\n",
+  "kind": "constant",
+  "name": null,
+  "size": 49,
+  "outputUnit": "outputUnit/main",
+  "code": "B.Interceptor_methods = J.Interceptor.prototype;\n"
+},
+  {
+  "id": "constant/B.JSArray_methods = J.JSArray.prototype;\n",
+  "kind": "constant",
+  "name": null,
+  "size": 41,
+  "outputUnit": "outputUnit/main",
+  "code": "B.JSArray_methods = J.JSArray.prototype;\n"
+},
+  {
+  "id": "constant/B.JSString_methods = J.JSString.prototype;\n",
+  "kind": "constant",
+  "name": null,
+  "size": 43,
+  "outputUnit": "outputUnit/main",
+  "code": "B.JSString_methods = J.JSString.prototype;\n"
+},
+  {
+  "id": "constant/B.JavaScriptFunction_methods = J.JavaScriptFunction.prototype;\n",
+  "kind": "constant",
+  "name": null,
+  "size": 63,
+  "outputUnit": "outputUnit/main",
+  "code": "B.JavaScriptFunction_methods = J.JavaScriptFunction.prototype;\n"
+},
+  {
+  "id": "constant/B.JavaScriptObject_methods = J.JavaScriptObject.prototype;\n",
+  "kind": "constant",
+  "name": null,
+  "size": 59,
+  "outputUnit": "outputUnit/main",
+  "code": "B.JavaScriptObject_methods = J.JavaScriptObject.prototype;\n"
+},
+  {
+  "id": "constant/B.PlainJavaScriptObject_methods = J.PlainJavaScriptObject.prototype;\n",
+  "kind": "constant",
+  "name": null,
+  "size": 69,
+  "outputUnit": "outputUnit/main",
+  "code": "B.PlainJavaScriptObject_methods = J.PlainJavaScriptObject.prototype;\n"
+},
+  {
+  "id": "constant/B.UnknownJavaScriptObject_methods = J.UnknownJavaScriptObject.prototype;\n",
+  "kind": "constant",
+  "name": null,
+  "size": 73,
+  "outputUnit": "outputUnit/main",
+  "code": "B.UnknownJavaScriptObject_methods = J.UnknownJavaScriptObject.prototype;\n"
+}],
+ deferredFiles=[{}],
+ dependencies=[{}],
+ library=[{
   "id": "library/memory:sdk/tests/web/native/main.dart::",
   "kind": "library",
   "name": "js_parameters_test",
@@ -9,7 +133,16 @@
     "function/memory:sdk/tests/web/native/main.dart::main"
   ],
   "canonicalUri": "memory:sdk/tests/web/native/main.dart"
-}]*/
+}],
+ outputUnits=[{
+  "id": "outputUnit/main",
+  "kind": "outputUnit",
+  "name": "main",
+  "size": 112396,
+  "filename": "out",
+  "imports": []
+}]
+*/
 @JS()
 library js_parameters_test;
 
diff --git a/pkg/compiler/test/dump_info/data/members.dart b/pkg/compiler/test/dump_info/data/members.dart
index 6494321..4ac2296 100644
--- a/pkg/compiler/test/dump_info/data/members.dart
+++ b/pkg/compiler/test/dump_info/data/members.dart
@@ -1,4 +1,64 @@
-/*library: library=[{
+/*library: 
+ constant=[
+  {
+  "id": "constant/B.C_A = new A.A();\n",
+  "kind": "constant",
+  "name": null,
+  "size": 19,
+  "outputUnit": "outputUnit/main",
+  "code": "B.C_A = new A.A();\n"
+},
+  {
+  "id": "constant/B.C_JS_CONST = function getTagFallback(o) {\n  var s = Object.prototype.toString.call(o);\n  return s.substring(8, s.length - 1);\n};\n",
+  "kind": "constant",
+  "name": null,
+  "size": 131,
+  "outputUnit": "outputUnit/main",
+  "code": "B.C_JS_CONST = function getTagFallback(o) {\n  var s = Object.prototype.toString.call(o);\n  return s.substring(8, s.length - 1);\n};\n"
+},
+  {
+  "id": "constant/B.Interceptor_methods = J.Interceptor.prototype;\n",
+  "kind": "constant",
+  "name": null,
+  "size": 49,
+  "outputUnit": "outputUnit/main",
+  "code": "B.Interceptor_methods = J.Interceptor.prototype;\n"
+},
+  {
+  "id": "constant/B.JSArray_methods = J.JSArray.prototype;\n",
+  "kind": "constant",
+  "name": null,
+  "size": 41,
+  "outputUnit": "outputUnit/main",
+  "code": "B.JSArray_methods = J.JSArray.prototype;\n"
+},
+  {
+  "id": "constant/B.JSString_methods = J.JSString.prototype;\n",
+  "kind": "constant",
+  "name": null,
+  "size": 43,
+  "outputUnit": "outputUnit/main",
+  "code": "B.JSString_methods = J.JSString.prototype;\n"
+},
+  {
+  "id": "constant/B.JavaScriptObject_methods = J.JavaScriptObject.prototype;\n",
+  "kind": "constant",
+  "name": null,
+  "size": 59,
+  "outputUnit": "outputUnit/main",
+  "code": "B.JavaScriptObject_methods = J.JavaScriptObject.prototype;\n"
+},
+  {
+  "id": "constant/B.List_A = A._setArrayType(makeConstList([B.C_A]), A.findType(\"JSArray<A>\"));\n",
+  "kind": "constant",
+  "name": null,
+  "size": 78,
+  "outputUnit": "outputUnit/main",
+  "code": "B.List_A = A._setArrayType(makeConstList([B.C_A]), A.findType(\"JSArray<A>\"));\n"
+}],
+ deferredFiles=[{}],
+ dependencies=[{}],
+ library=[{
   "id": "library/memory:sdk/tests/web/native/main.dart::",
   "kind": "library",
   "name": "<unnamed>",
@@ -12,7 +72,16 @@
     "function/memory:sdk/tests/web/native/main.dart::main"
   ],
   "canonicalUri": "memory:sdk/tests/web/native/main.dart"
-}]*/
+}],
+ outputUnits=[{
+  "id": "outputUnit/main",
+  "kind": "outputUnit",
+  "name": "main",
+  "size": 91101,
+  "filename": "out",
+  "imports": []
+}]
+*/
 /*class: C:class=[{
   "id": "class/memory:sdk/tests/web/native/main.dart::C",
   "kind": "class",
diff --git a/pkg/compiler/test/dump_info/dump_info_test.dart b/pkg/compiler/test/dump_info/dump_info_test.dart
index 411f65f..87e0585 100644
--- a/pkg/compiler/test/dump_info/dump_info_test.dart
+++ b/pkg/compiler/test/dump_info/dump_info_test.dart
@@ -66,6 +66,23 @@
     features.addElement(
         Tags.library, indentedEncoder.convert(libraryInfo.accept(converter)));
 
+    // Store program-wide information on the main library.
+    var name = '${library.canonicalUri.pathSegments.last}';
+    if (name.startsWith('main')) {
+      for (final constantInfo in dumpInfoState.info.constants) {
+        features.addElement(Tags.constant,
+            indentedEncoder.convert(constantInfo.accept(converter)));
+      }
+      features.addElement(Tags.dependencies,
+          indentedEncoder.convert(dumpInfoState.info.dependencies));
+      for (final outputUnit in dumpInfoState.info.outputUnits) {
+        features.addElement(Tags.outputUnits,
+            indentedEncoder.convert(outputUnit.accept(converter)));
+      }
+      features.addElement(Tags.deferredFiles,
+          indentedEncoder.convert(dumpInfoState.info.deferredFiles));
+    }
+
     final id = LibraryId(library.canonicalUri);
     actualMap[id] =
         ActualData<Features>(id, features, library.canonicalUri, -1, library);