Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(721)

Unified Diff: pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart

Issue 1558353002: cpsir: add support for deferred code (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart
diff --git a/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart
index 76b2d22836b48fcda12ea0bdc3d66493d1bc2bfb..c6783b52c910011c54205d592c3c7e8f65d6d2b9 100644
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart
@@ -1055,9 +1055,18 @@ class IrBuilder {
/// Create a getter invocation of the static [getter].
ir.Primitive buildStaticGetterGet(MethodElement getter,
SourceInformation sourceInformation) {
- Selector selector = new Selector.getter(getter.memberName);
- return _buildInvokeStatic(
- getter, selector, const <ir.Primitive>[], sourceInformation);
+ if (getter.isDeferredLoaderGetter) {
+ PrefixElement prefix = getter.enclosingElement;
+ ir.Primitive loadId =
+ buildStringConstant(program.getImportDeferName(prefix));
+ return buildStaticFunctionInvocation(program.loadLibraryFunction,
+ CallStructure.ONE_ARG, <ir.Primitive>[loadId],
+ sourceInformation: sourceInformation);
+ } else {
+ Selector selector = new Selector.getter(getter.memberName);
+ return _buildInvokeStatic(
+ getter, selector, const <ir.Primitive>[], sourceInformation);
+ }
}
/// Create a read access of the static [function], i.e. a closurization of
« no previous file with comments | « no previous file | pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart » ('j') | tests/language/language_dart2js.status » ('J')

Powered by Google App Engine
This is Rietveld 408576698