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

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

Issue 3001823002: Revert "Various redemptions" (Closed)
Patch Set: Created 3 years, 4 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 | « pkg/compiler/lib/src/resolution/resolution_strategy.dart ('k') | no next file » | 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, MethodElement; 12 import '../elements/elements.dart'
13 show ClassElement, FieldElement, MethodElement;
13 import '../elements/entities.dart'; 14 import '../elements/entities.dart';
14 import '../elements/resolution_types.dart'; 15 import '../elements/resolution_types.dart';
15 import '../elements/types.dart'; 16 import '../elements/types.dart';
16 import '../js/js.dart' as js; 17 import '../js/js.dart' as js;
17 import '../js_backend/backend.dart'; 18 import '../js_backend/backend.dart';
18 import '../js_backend/native_data.dart' show NativeData; 19 import '../js_backend/native_data.dart' show NativeData;
19 import '../js_backend/runtime_types.dart'; 20 import '../js_backend/runtime_types.dart';
20 import '../native/native.dart' as native; 21 import '../native/native.dart' as native;
21 import '../options.dart'; 22 import '../options.dart';
22 import '../types/types.dart'; 23 import '../types/types.dart';
(...skipping 1000 matching lines...) Expand 10 before | Expand all | Expand 10 after
1023 1024
1024 HInstruction receiver = node.getDartReceiver(_closedWorld); 1025 HInstruction receiver = node.getDartReceiver(_closedWorld);
1025 FieldEntity field = 1026 FieldEntity field =
1026 findConcreteFieldForDynamicAccess(receiver, node.selector); 1027 findConcreteFieldForDynamicAccess(receiver, node.selector);
1027 if (field == null || !field.isAssignable) return node; 1028 if (field == null || !field.isAssignable) return node;
1028 // Use `node.inputs.last` in case the call follows the interceptor calling 1029 // Use `node.inputs.last` in case the call follows the interceptor calling
1029 // convention, but is not a call on an interceptor. 1030 // convention, but is not a call on an interceptor.
1030 HInstruction value = node.inputs.last; 1031 HInstruction value = node.inputs.last;
1031 if (_options.enableTypeAssertions) { 1032 if (_options.enableTypeAssertions) {
1032 // TODO(redemption): Support field entities. 1033 // TODO(redemption): Support field entities.
1033 DartType type = _closedWorld.elementEnvironment.getFieldType(field); 1034 FieldElement element = field;
1035 DartType type = element.type;
1034 if (!type.treatAsRaw || 1036 if (!type.treatAsRaw ||
1035 type.isTypeVariable || 1037 type.isTypeVariable ||
1036 type.unaliased.isFunctionType) { 1038 type.unaliased.isFunctionType) {
1037 // We cannot generate the correct type representation here, so don't 1039 // We cannot generate the correct type representation here, so don't
1038 // inline this access. 1040 // inline this access.
1039 // TODO(sra): If the input is such that we don't need a type check, we 1041 // TODO(sra): If the input is such that we don't need a type check, we
1040 // can skip the test an generate the HFieldSet. 1042 // can skip the test an generate the HFieldSet.
1041 return node; 1043 return node;
1042 } 1044 }
1043 HInstruction other = value.convertType( 1045 HInstruction other = value.convertType(
(...skipping 1945 matching lines...) Expand 10 before | Expand all | Expand 10 after
2989 2991
2990 keyedValues.forEach((receiver, values) { 2992 keyedValues.forEach((receiver, values) {
2991 result.keyedValues[receiver] = 2993 result.keyedValues[receiver] =
2992 new Map<HInstruction, HInstruction>.from(values); 2994 new Map<HInstruction, HInstruction>.from(values);
2993 }); 2995 });
2994 2996
2995 result.nonEscapingReceivers.addAll(nonEscapingReceivers); 2997 result.nonEscapingReceivers.addAll(nonEscapingReceivers);
2996 return result; 2998 return result;
2997 } 2999 }
2998 } 3000 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/resolution/resolution_strategy.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698