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

Side by Side Diff: pkg/compiler/lib/src/js_backend/backend.dart

Issue 2387353002: Eagerly compute closure classes (Closed)
Patch Set: Add comments. Created 4 years, 2 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
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 library js_backend.backend; 5 library js_backend.backend;
6 6
7 import 'dart:async' show Future; 7 import 'dart:async' show Future;
8 8
9 import 'package:js_runtime/shared/embedded_names.dart' as embeddedNames; 9 import 'package:js_runtime/shared/embedded_names.dart' as embeddedNames;
10 10
(...skipping 2148 matching lines...) Expand 10 before | Expand all | Expand 10 after
2159 assert(invariant(cls, cls.isResolved)); 2159 assert(invariant(cls, cls.isResolved));
2160 reflectableMembers.add(cls); 2160 reflectableMembers.add(cls);
2161 // 2) its constructors (if resolved) 2161 // 2) its constructors (if resolved)
2162 cls.constructors.forEach((Element constructor) { 2162 cls.constructors.forEach((Element constructor) {
2163 if (resolution.hasBeenProcessed(constructor)) { 2163 if (resolution.hasBeenProcessed(constructor)) {
2164 reflectableMembers.add(constructor); 2164 reflectableMembers.add(constructor);
2165 } 2165 }
2166 }); 2166 });
2167 // 3) all members, including fields via getter/setters (if resolved) 2167 // 3) all members, including fields via getter/setters (if resolved)
2168 cls.forEachClassMember((Member member) { 2168 cls.forEachClassMember((Member member) {
2169 if (resolution.hasBeenProcessed(member.element)) { 2169 MemberElement element = member.element;
2170 if (resolution.hasBeenProcessed(element)) {
2170 memberNames.add(member.name); 2171 memberNames.add(member.name);
2171 reflectableMembers.add(member.element); 2172 reflectableMembers.add(element);
2173 element.nestedClosures
2174 .forEach((SynthesizedCallMethodElementX callFunction) {
2175 reflectableMembers.add(callFunction);
2176 reflectableMembers.add(callFunction.closureClass);
2177 });
2172 } 2178 }
2173 }); 2179 });
2174 // 4) all overriding members of subclasses/subtypes (should be resolved) 2180 // 4) all overriding members of subclasses/subtypes (should be resolved)
2175 if (compiler.closedWorld.hasAnyStrictSubtype(cls)) { 2181 if (compiler.closedWorld.hasAnyStrictSubtype(cls)) {
2176 compiler.closedWorld.forEachStrictSubtypeOf(cls, 2182 compiler.closedWorld.forEachStrictSubtypeOf(cls,
2177 (ClassElement subcls) { 2183 (ClassElement subcls) {
2178 subcls.forEachClassMember((Member member) { 2184 subcls.forEachClassMember((Member member) {
2179 if (memberNames.contains(member.name)) { 2185 if (memberNames.contains(member.name)) {
2180 // TODO(20993): find out why this assertion fails. 2186 // TODO(20993): find out why this assertion fails.
2181 // assert(invariant(member.element, 2187 // assert(invariant(member.element,
(...skipping 1083 matching lines...) Expand 10 before | Expand all | Expand 10 after
3265 ClassElement get mapImplementation => helpers.mapLiteralClass; 3271 ClassElement get mapImplementation => helpers.mapLiteralClass;
3266 ClassElement get constMapImplementation => helpers.constMapLiteralClass; 3272 ClassElement get constMapImplementation => helpers.constMapLiteralClass;
3267 ClassElement get typeImplementation => helpers.typeLiteralClass; 3273 ClassElement get typeImplementation => helpers.typeLiteralClass;
3268 ClassElement get boolImplementation => helpers.jsBoolClass; 3274 ClassElement get boolImplementation => helpers.jsBoolClass;
3269 ClassElement get nullImplementation => helpers.jsNullClass; 3275 ClassElement get nullImplementation => helpers.jsNullClass;
3270 ClassElement get syncStarIterableImplementation => helpers.syncStarIterable; 3276 ClassElement get syncStarIterableImplementation => helpers.syncStarIterable;
3271 ClassElement get asyncFutureImplementation => helpers.futureImplementation; 3277 ClassElement get asyncFutureImplementation => helpers.futureImplementation;
3272 ClassElement get asyncStarStreamImplementation => helpers.controllerStream; 3278 ClassElement get asyncStarStreamImplementation => helpers.controllerStream;
3273 ClassElement get functionImplementation => helpers.coreClasses.functionClass; 3279 ClassElement get functionImplementation => helpers.coreClasses.functionClass;
3274 } 3280 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart ('k') | pkg/compiler/lib/src/js_emitter/runtime_type_generator.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698