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

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

Issue 2933363003: Add ClosureRepresentationInfo, the new public face of ClosureClassMap (Closed)
Patch Set: . 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:js_runtime/shared/embedded_names.dart'; 5 import 'package:js_runtime/shared/embedded_names.dart';
6 import 'package:kernel/ast.dart' as ir; 6 import 'package:kernel/ast.dart' as ir;
7 7
8 import '../closure.dart'; 8 import '../closure.dart';
9 import '../common.dart'; 9 import '../common.dart';
10 import '../compiler.dart'; 10 import '../compiler.dart';
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 } 117 }
118 if (originTarget is MethodElement) { 118 if (originTarget is MethodElement) {
119 if (originTarget is ConstructorBodyElement) { 119 if (originTarget is ConstructorBodyElement) {
120 ConstructorBodyElement body = originTarget; 120 ConstructorBodyElement body = originTarget;
121 originTarget = body.constructor; 121 originTarget = body.constructor;
122 } 122 }
123 target = kernel.functions[originTarget]; 123 target = kernel.functions[originTarget];
124 // Closures require a lookup one level deeper in the closure class mapper. 124 // Closures require a lookup one level deeper in the closure class mapper.
125 if (target == null) { 125 if (target == null) {
126 MethodElement originTargetFunction = originTarget; 126 MethodElement originTargetFunction = originTarget;
127 ClosureClassMap classMap = _compiler.closureToClassMapper 127 ClosureRepresentationInfo classMap = _compiler.closureToClassMapper
128 .getClosureToClassMapping(originTargetFunction); 128 .getClosureRepresentationInfo(originTargetFunction);
129 if (classMap.closureElement != null) { 129 if (classMap.closureEntity != null) {
130 target = kernel.localFunctions[classMap.closureElement]; 130 target = kernel.localFunctions[classMap.closureEntity];
131 } 131 }
132 } 132 }
133 } else if (originTarget is FieldElement) { 133 } else if (originTarget is FieldElement) {
134 target = kernel.fields[originTarget]; 134 target = kernel.fields[originTarget];
135 } 135 }
136 assert(target != null); 136 assert(target != null);
137 return target; 137 return target;
138 } 138 }
139 139
140 @override 140 @override
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after
635 TypeMask selectorTypeOf(Selector selector, TypeMask mask) { 635 TypeMask selectorTypeOf(Selector selector, TypeMask mask) {
636 return TypeMaskFactory.inferredTypeForSelector( 636 return TypeMaskFactory.inferredTypeForSelector(
637 selector, mask, _globalInferenceResults); 637 selector, mask, _globalInferenceResults);
638 } 638 }
639 639
640 TypeMask typeFromNativeBehavior( 640 TypeMask typeFromNativeBehavior(
641 native.NativeBehavior nativeBehavior, ClosedWorld closedWorld) { 641 native.NativeBehavior nativeBehavior, ClosedWorld closedWorld) {
642 return TypeMaskFactory.fromNativeBehavior(nativeBehavior, closedWorld); 642 return TypeMaskFactory.fromNativeBehavior(nativeBehavior, closedWorld);
643 } 643 }
644 } 644 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698