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

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

Issue 3010943002: Add ability to look up type parameters that are associated with ClassEntities with the element envi… (Closed)
Patch Set: . Created 3 years, 3 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 | tests/corelib_2/corelib_2.status » ('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) 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 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem; 5 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem;
6 import '../common/names.dart' show Selectors; 6 import '../common/names.dart' show Selectors;
7 import '../common/tasks.dart' show CompilerTask; 7 import '../common/tasks.dart' show CompilerTask;
8 import '../compiler.dart' show Compiler; 8 import '../compiler.dart' show Compiler;
9 import '../constants/constant_system.dart'; 9 import '../constants/constant_system.dart';
10 import '../constants/values.dart'; 10 import '../constants/values.dart';
11 import '../common_elements.dart' show CommonElements; 11 import '../common_elements.dart' show CommonElements;
12 import '../elements/elements.dart' show ClassElement;
13 import '../elements/entities.dart'; 12 import '../elements/entities.dart';
14 import '../elements/resolution_types.dart'; 13 import '../elements/resolution_types.dart';
15 import '../elements/types.dart'; 14 import '../elements/types.dart';
16 import '../js/js.dart' as js; 15 import '../js/js.dart' as js;
17 import '../js_backend/backend.dart'; 16 import '../js_backend/backend.dart';
18 import '../js_backend/native_data.dart' show NativeData; 17 import '../js_backend/native_data.dart' show NativeData;
19 import '../js_backend/runtime_types.dart'; 18 import '../js_backend/runtime_types.dart';
20 import '../native/native.dart' as native; 19 import '../native/native.dart' as native;
21 import '../options.dart'; 20 import '../options.dart';
22 import '../types/types.dart'; 21 import '../types/types.dart';
(...skipping 1185 matching lines...) Expand 10 before | Expand all | Expand 10 after
1208 1207
1209 HInstruction source; 1208 HInstruction source;
1210 int expectedIndex = 0; 1209 int expectedIndex = 0;
1211 1210
1212 for (HInstruction argument in node.inputs) { 1211 for (HInstruction argument in node.inputs) {
1213 if (argument is HTypeInfoReadVariable) { 1212 if (argument is HTypeInfoReadVariable) {
1214 HInstruction nextSource = argument.object; 1213 HInstruction nextSource = argument.object;
1215 if (nextSource is HThis) { 1214 if (nextSource is HThis) {
1216 if (source == null) { 1215 if (source == null) {
1217 source = nextSource; 1216 source = nextSource;
1218 ClassElement contextClass = 1217 ClassEntity contextClass =
1219 nextSource.sourceElement.enclosingClass; 1218 nextSource.sourceElement.enclosingClass;
1220 if (node.inputs.length != contextClass.typeVariables.length) { 1219 if (node.inputs.length !=
1220 _closedWorld.elementEnvironment
1221 .getThisType(contextClass)
1222 .typeArguments
1223 .length) {
1221 return null; 1224 return null;
1222 } 1225 }
1223 if (needsSubstitutionForTypeVariableAccess(contextClass)) { 1226 if (needsSubstitutionForTypeVariableAccess(contextClass)) {
1224 return null; 1227 return null;
1225 } 1228 }
1226 } 1229 }
1227 if (nextSource != source) return null; 1230 if (nextSource != source) return null;
1228 // Check that the index is the one we expect. 1231 // Check that the index is the one we expect.
1229 int index = argument.variable.element.index; 1232 int index = argument.variable.element.index;
1230 if (index != expectedIndex++) return null; 1233 if (index != expectedIndex++) return null;
(...skipping 1754 matching lines...) Expand 10 before | Expand all | Expand 10 after
2985 2988
2986 keyedValues.forEach((receiver, values) { 2989 keyedValues.forEach((receiver, values) {
2987 result.keyedValues[receiver] = 2990 result.keyedValues[receiver] =
2988 new Map<HInstruction, HInstruction>.from(values); 2991 new Map<HInstruction, HInstruction>.from(values);
2989 }); 2992 });
2990 2993
2991 result.nonEscapingReceivers.addAll(nonEscapingReceivers); 2994 result.nonEscapingReceivers.addAll(nonEscapingReceivers);
2992 return result; 2995 return result;
2993 } 2996 }
2994 } 2997 }
OLDNEW
« no previous file with comments | « no previous file | tests/corelib_2/corelib_2.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698