[dart2js] late field helper need global impacts
[dart2js] late field helper need global impacts

This ensures that the helpers are seen as being part of the main unit
for deferred-load compiles.

Prior to this change, debug dart2js would assert:

$ sdk/bin/dart2js_developer  --test-mode --packages=.packages benchmarks/OmnibusDeferred/dart/OmnibusDeferred.dart  --out=om1c/o.js
org-dartlang-sdk:///lib/_internal/js_runtime/lib/late_helper.dart@343+1:
Internal Error: The compiler crashed when compiling this element.
The compiler is broken.

When compiling the above element, the compiler crashed. It is not
possible to tell if this is caused by a problem in your program or
not. Regardless, the compiler should not crash.

The Dart team would greatly appreciate if you would take a moment to
report this problem at http://dartbug.com/new.

Please include the following information:

* the name and version of your operating system,

* the Dart SDK build number (build number could not be determined), and

* the entire message you see here (including the full stack trace
  below as well as the source location above).

The compiler crashed: 'package:compiler/src/deferred_load/output_unit.dart': Failed assertion: line 272 pos 12: 'unit != null': No output unit for member j:method(throwLateFieldNI)
#0      _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:51:61)
#1      _AssertionError._throwNew (dart:core-patch/errors_patch.dart:40:5)
#2      OutputUnitData.outputUnitForMember (package:compiler/src/deferred_load/output_unit.dart:272:12)
#3      OutputUnitData.hasOnlyNonDeferredImportPaths (package:compiler/src/deferred_load/output_unit.dart:306:33)
#4      KernelSsaGraphBuilder._tryInlineMethod.heuristicSayGoodToGo (package:compiler/src/ssa/builder_kernel.dart:5922:12)


Change-Id: Ic31c4894105a9a22eb0821a489c8dd2a4e3d0110
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241686
Reviewed-by: Mayank Patke <e0355b78204b67a55a952941c68c8f1b40235938@google.com>
Commit-Queue: Stephen Adams <60cb5b73b7e0cb7dcda53302da4fab6ecfc7fa8b@google.com>

dart-lang/sdk,dart-lang/sdk,dart-lang/sdk,dart-lang/sdk,dart-lang/sdk,dart-lang/sdk,dart-lang/sdk,dart-lang/sdk