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

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

Issue 2938203003: Compute KernelClosureRepresentationInfo.variableIsUsedInTryOrSync (Closed)
Patch Set: Merge KernelClosureConversionTask and KernelClosureDataLookup Created 3 years, 6 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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 'package:kernel/ast.dart' as ir; 5 import 'package:kernel/ast.dart' as ir;
6 6
7 import '../closure.dart'; 7 import '../closure.dart';
8 import '../common.dart'; 8 import '../common.dart';
9 import '../compiler.dart'; 9 import '../compiler.dart';
10 import '../constants/expressions.dart'; 10 import '../constants/expressions.dart';
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 } 116 }
117 if (originTarget is MethodElement) { 117 if (originTarget is MethodElement) {
118 if (originTarget is ConstructorBodyElement) { 118 if (originTarget is ConstructorBodyElement) {
119 ConstructorBodyElement body = originTarget; 119 ConstructorBodyElement body = originTarget;
120 originTarget = body.constructor; 120 originTarget = body.constructor;
121 } 121 }
122 target = kernel.functions[originTarget]; 122 target = kernel.functions[originTarget];
123 // Closures require a lookup one level deeper in the closure class mapper. 123 // Closures require a lookup one level deeper in the closure class mapper.
124 if (target == null) { 124 if (target == null) {
125 MethodElement originTargetFunction = originTarget; 125 MethodElement originTargetFunction = originTarget;
126 ClosureRepresentationInfo classMap = _compiler.closureDataLookup 126 ClosureRepresentationInfo classMap = _compiler
127 .backendStrategy.closureDataLookup
127 .getClosureRepresentationInfo(originTargetFunction); 128 .getClosureRepresentationInfo(originTargetFunction);
128 if (classMap.closureEntity != null) { 129 if (classMap.closureEntity != null) {
129 target = kernel.localFunctions[classMap.closureEntity]; 130 target = kernel.localFunctions[classMap.closureEntity];
130 } 131 }
131 } 132 }
132 } else if (originTarget is FieldElement) { 133 } else if (originTarget is FieldElement) {
133 target = kernel.fields[originTarget]; 134 target = kernel.fields[originTarget];
134 } 135 }
135 assert(target != null); 136 assert(target != null);
136 return target; 137 return target;
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after
612 TypeMask selectorTypeOf(Selector selector, TypeMask mask) { 613 TypeMask selectorTypeOf(Selector selector, TypeMask mask) {
613 return TypeMaskFactory.inferredTypeForSelector( 614 return TypeMaskFactory.inferredTypeForSelector(
614 selector, mask, _globalInferenceResults); 615 selector, mask, _globalInferenceResults);
615 } 616 }
616 617
617 TypeMask typeFromNativeBehavior( 618 TypeMask typeFromNativeBehavior(
618 native.NativeBehavior nativeBehavior, ClosedWorld closedWorld) { 619 native.NativeBehavior nativeBehavior, ClosedWorld closedWorld) {
619 return TypeMaskFactory.fromNativeBehavior(nativeBehavior, closedWorld); 620 return TypeMaskFactory.fromNativeBehavior(nativeBehavior, closedWorld);
620 } 621 }
621 } 622 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698