-
Notifications
You must be signed in to change notification settings - Fork 6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Collect types deeply for deferred loading
Change-Id: I7bbd9499975c78fcdcfa88ceba31cb2e8e5a7cc6 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97639 Commit-Queue: Johnni Winther <johnniwinther@google.com> Reviewed-by: Sigmund Cherem <sigmund@google.com>
- Loading branch information
1 parent
bd99509
commit 8a92d2a
Showing
42 changed files
with
427 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 6 additions & 1 deletion
7
tests/compiler/dart2js/deferred_loading/data/basic_deferred.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,14 @@ | ||
// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | ||
// 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. | ||
|
||
import '../libs/basic_deferred_lib.dart' deferred as lib; | ||
|
||
/*element: main:OutputUnit(main, {})*/ | ||
/*strong.element: main:OutputUnit(main, {})*/ | ||
/*strongConst.element: main: | ||
OutputUnit(main, {}), | ||
constants=[FunctionConstant(funky)=OutputUnit(1, {lib})] | ||
*/ | ||
main() => lib.loadLibrary().then(/*OutputUnit(main, {})*/ (_) { | ||
(lib.funky)(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
tests/compiler/dart2js/deferred_loading/data/future_or.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file | ||
// 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. | ||
|
||
import 'dart:async'; | ||
import '../libs/future_or_lib1.dart' deferred as lib1; | ||
import '../libs/future_or_lib2.dart' as lib2; | ||
|
||
/*strong.element: main:OutputUnit(main, {})*/ | ||
/*strongConst.element: main: | ||
OutputUnit(main, {}), | ||
constants=[ConstructedConstant(A())=OutputUnit(1, {lib1})] | ||
*/ | ||
main() async { | ||
await lib1.loadLibrary(); | ||
lib1.field is FutureOr<lib2.A>; | ||
lib1.field.method(); | ||
} |
24 changes: 24 additions & 0 deletions
24
tests/compiler/dart2js/deferred_loading/data/type_arguments.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file | ||
// 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. | ||
|
||
import '../libs/type_arguments_lib1.dart' deferred as lib1; | ||
import '../libs/type_arguments_lib2.dart' as lib2; | ||
import '../libs/type_arguments_lib3.dart' deferred as lib3; | ||
|
||
/*strong.element: main:OutputUnit(main, {})*/ | ||
/*strongConst.element: main: | ||
OutputUnit(main, {}), | ||
constants=[ | ||
ConstructedConstant(A<B>())=OutputUnit(1, {lib1}), | ||
ConstructedConstant(A<F>())=OutputUnit(1, {lib1}), | ||
ConstructedConstant(C<D>())=OutputUnit(main, {}), | ||
ConstructedConstant(E<F>())=OutputUnit(3, {lib3})] | ||
*/ | ||
main() async { | ||
await lib1.loadLibrary(); | ||
lib1.field1; | ||
lib1.field2; | ||
lib2.field; | ||
lib3.field; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.