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

Side by Side Diff: pkg/compiler/lib/src/inferrer/type_graph_inferrer.dart

Issue 1775253004: Revert "dart2js: Destroy some type inference graph edges after type inference." (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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 | « no previous file | pkg/compiler/lib/src/inferrer/type_graph_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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 type_graph_inferrer; 5 library type_graph_inferrer;
6 6
7 import 'dart:collection' show Queue; 7 import 'dart:collection' show Queue;
8 8
9 import '../common.dart'; 9 import '../common.dart';
10 import '../common/names.dart' show 10 import '../common/names.dart' show
(...skipping 1269 matching lines...) Expand 10 before | Expand all | Expand 10 after
1280 1280
1281 List<Element> result = <Element>[]; 1281 List<Element> result = <Element>[];
1282 for (int i = 0; i <= max; i++) { 1282 for (int i = 0; i <= max; i++) {
1283 Setlet<Element> set = methodSizes[i]; 1283 Setlet<Element> set = methodSizes[i];
1284 if (set != null) result.addAll(set); 1284 if (set != null) result.addAll(set);
1285 } 1285 }
1286 return result; 1286 return result;
1287 } 1287 }
1288 1288
1289 void clear() { 1289 void clear() {
1290 void cleanup(TypeInformation info) => info.cleanup();
1291
1292 allocatedCalls.forEach(cleanup);
1293 allocatedCalls.clear(); 1290 allocatedCalls.clear();
1294
1295 defaultTypeOfParameter.clear(); 1291 defaultTypeOfParameter.clear();
1296 1292 types.typeInformations.values.forEach((info) => info.clear());
1297 types.typeInformations.values.forEach(cleanup);
1298
1299 types.allocatedTypes.forEach(cleanup);
1300 types.allocatedTypes.clear(); 1293 types.allocatedTypes.clear();
1301
1302 types.concreteTypes.clear(); 1294 types.concreteTypes.clear();
1303
1304 types.allocatedClosures.forEach(cleanup);
1305 types.allocatedClosures.clear(); 1295 types.allocatedClosures.clear();
1306
1307 analyzedElements.clear(); 1296 analyzedElements.clear();
1308 generativeConstructorsExposingThis.clear(); 1297 generativeConstructorsExposingThis.clear();
1309
1310 types.allocatedMaps.values.forEach(cleanup);
1311 types.allocatedLists.values.forEach(cleanup);
1312 } 1298 }
1313 1299
1314 Iterable<Element> getCallersOf(Element element) { 1300 Iterable<Element> getCallersOf(Element element) {
1315 if (compiler.disableTypeInference) { 1301 if (compiler.disableTypeInference) {
1316 throw new UnsupportedError( 1302 throw new UnsupportedError(
1317 "Cannot query the type inferrer when type inference is disabled."); 1303 "Cannot query the type inferrer when type inference is disabled.");
1318 } 1304 }
1319 MemberTypeInformation info = types.getInferredTypeOf(element); 1305 MemberTypeInformation info = types.getInferredTypeOf(element);
1320 return info.callers; 1306 return info.callers;
1321 } 1307 }
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
1437 bool isCalledOnce(Element element) { 1423 bool isCalledOnce(Element element) {
1438 if (compiler.disableTypeInference) return false; 1424 if (compiler.disableTypeInference) return false;
1439 MemberTypeInformation info = inferrer.types.getInferredTypeOf(element); 1425 MemberTypeInformation info = inferrer.types.getInferredTypeOf(element);
1440 return info.isCalledOnce(); 1426 return info.isCalledOnce();
1441 } 1427 }
1442 1428
1443 void clear() { 1429 void clear() {
1444 inferrer.clear(); 1430 inferrer.clear();
1445 } 1431 }
1446 } 1432 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/inferrer/type_graph_nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698