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

Side by Side Diff: pkg/compiler/lib/src/ssa/codegen.dart

Issue 2992863002: Support forEachClassMember on closure classes (Closed)
Patch Set: Updated cf. comments Created 3 years, 4 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 unified diff | Download patch
« no previous file with comments | « pkg/compiler/lib/src/ssa/builder_kernel.dart ('k') | pkg/compiler/lib/src/ssa/nodes.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import 'dart:math' as math; 5 import 'dart:math' as math;
6 import 'dart:collection' show Queue; 6 import 'dart:collection' show Queue;
7 import '../common.dart'; 7 import '../common.dart';
8 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem; 8 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem;
9 import '../common/tasks.dart' show CompilerTask; 9 import '../common/tasks.dart' show CompilerTask;
10 import '../constants/constant_system.dart'; 10 import '../constants/constant_system.dart';
(...skipping 2084 matching lines...) Expand 10 before | Expand all | Expand 10 after
2095 // We also use HCreate to instantiate closure classes that belong to 2095 // We also use HCreate to instantiate closure classes that belong to
2096 // function expressions. We have to register their use here, as otherwise 2096 // function expressions. We have to register their use here, as otherwise
2097 // code for them might not be emitted. 2097 // code for them might not be emitted.
2098 if (node.element.isClosure) { 2098 if (node.element.isClosure) {
2099 _registry.registerInstantiatedClass(node.element); 2099 _registry.registerInstantiatedClass(node.element);
2100 } 2100 }
2101 node.instantiatedTypes?.forEach(_registry.registerInstantiation); 2101 node.instantiatedTypes?.forEach(_registry.registerInstantiation);
2102 if (node.callMethod != null) { 2102 if (node.callMethod != null) {
2103 _registry 2103 _registry
2104 ?.registerStaticUse(new StaticUse.implicitInvoke(node.callMethod)); 2104 ?.registerStaticUse(new StaticUse.implicitInvoke(node.callMethod));
2105 } 2105 _registry?.registerInstantiatedClosure(node.callMethod);
2106 if (node.localFunction != null) {
2107 _registry?.registerInstantiatedClosure(node.localFunction);
2108 } 2106 }
2109 } 2107 }
2110 2108
2111 visitCreateBox(HCreateBox node) { 2109 visitCreateBox(HCreateBox node) {
2112 push(new js.ObjectInitializer(<js.Property>[])); 2110 push(new js.ObjectInitializer(<js.Property>[]));
2113 } 2111 }
2114 2112
2115 js.Expression newLiteralBool( 2113 js.Expression newLiteralBool(
2116 bool value, SourceInformation sourceInformation) { 2114 bool value, SourceInformation sourceInformation) {
2117 if (_options.enableMinification) { 2115 if (_options.enableMinification) {
(...skipping 920 matching lines...) Expand 10 before | Expand all | Expand 10 after
3038 return _closedWorld.anyStrictSubclassOf(cls, (ClassEntity subclass) { 3036 return _closedWorld.anyStrictSubclassOf(cls, (ClassEntity subclass) {
3039 return !_rtiSubstitutions.isTrivialSubstitution(subclass, cls); 3037 return !_rtiSubstitutions.isTrivialSubstitution(subclass, cls);
3040 }); 3038 });
3041 } 3039 }
3042 3040
3043 @override 3041 @override
3044 void visitRef(HRef node) { 3042 void visitRef(HRef node) {
3045 visit(node.value); 3043 visit(node.value);
3046 } 3044 }
3047 } 3045 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/ssa/builder_kernel.dart ('k') | pkg/compiler/lib/src/ssa/nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698