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

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

Issue 2814973003: Extract ClosedWorldRefiner implementation from ClosedWorldImpl to ClosedWorldBase (Closed)
Patch Set: Created 3 years, 8 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) 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 simple_types_inferrer; 5 library simple_types_inferrer;
6 6
7 import '../closure.dart' show ClosureClassMap; 7 import '../closure.dart' show ClosureClassMap;
8 import '../common.dart'; 8 import '../common.dart';
9 import '../common/names.dart' show Identifiers, Selectors; 9 import '../common/names.dart' show Identifiers, Selectors;
10 import '../compiler.dart' show Compiler; 10 import '../compiler.dart' show Compiler;
(...skipping 1052 matching lines...) Expand 10 before | Expand all | Expand 10 after
1063 break; 1063 break;
1064 1064
1065 case AsyncMarker.ASYNC_STAR: 1065 case AsyncMarker.ASYNC_STAR:
1066 returnType = inferrer.addReturnTypeFor( 1066 returnType = inferrer.addReturnTypeFor(
1067 analyzedElement, returnType, types.asyncStarStreamType); 1067 analyzedElement, returnType, types.asyncStarStreamType);
1068 break; 1068 break;
1069 } 1069 }
1070 } 1070 }
1071 1071
1072 inferrer.closedWorldRefiner 1072 inferrer.closedWorldRefiner
1073 .registerSideEffects(analyzedElement, sideEffects); 1073 .registerSideEffects(analyzedElement.declaration, sideEffects);
1074 assert(breaksFor.isEmpty); 1074 assert(breaksFor.isEmpty);
1075 assert(continuesFor.isEmpty); 1075 assert(continuesFor.isEmpty);
1076 return returnType; 1076 return returnType;
1077 } 1077 }
1078 1078
1079 TypeInformation visitFunctionExpression(ast.FunctionExpression node) { 1079 TypeInformation visitFunctionExpression(ast.FunctionExpression node) {
1080 // We loose track of [this] in closures (see issue 20840). To be on 1080 // We loose track of [this] in closures (see issue 20840). To be on
1081 // the safe side, we mark [this] as exposed here. We could do better by 1081 // the safe side, we mark [this] as exposed here. We could do better by
1082 // analyzing the closure. 1082 // analyzing the closure.
1083 // TODO(herhut): Analyze whether closure exposes this. 1083 // TODO(herhut): Analyze whether closure exposes this.
(...skipping 1858 matching lines...) Expand 10 before | Expand all | Expand 10 after
2942 Selector moveNextSelector = Selectors.moveNext; 2942 Selector moveNextSelector = Selectors.moveNext;
2943 TypeMask moveNextMask = inTreeData.typeOfIteratorMoveNext(node); 2943 TypeMask moveNextMask = inTreeData.typeOfIteratorMoveNext(node);
2944 2944
2945 TypeInformation iteratorType = handleDynamicSend(node, iteratorSelector, 2945 TypeInformation iteratorType = handleDynamicSend(node, iteratorSelector,
2946 iteratorMask, expressionType, new ArgumentsTypes.empty()); 2946 iteratorMask, expressionType, new ArgumentsTypes.empty());
2947 2947
2948 return handleForInLoop(node, iteratorType, currentSelector, currentMask, 2948 return handleForInLoop(node, iteratorType, currentSelector, currentMask,
2949 moveNextSelector, moveNextMask); 2949 moveNextSelector, moveNextMask);
2950 } 2950 }
2951 } 2951 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698