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

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

Issue 2860733002: Remove ClosedWorld.allFunctions (Closed)
Patch Set: Created 3 years, 7 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 import '../common_elements.dart' show CommonElements; 5 import '../common_elements.dart' show CommonElements;
6 import '../constants/constant_system.dart'; 6 import '../constants/constant_system.dart';
7 import '../constants/values.dart'; 7 import '../constants/values.dart';
8 import '../elements/elements.dart' show Name; 8 import '../elements/elements.dart' show Name;
9 import '../elements/entities.dart'; 9 import '../elements/entities.dart';
10 import '../options.dart'; 10 import '../options.dart';
(...skipping 913 matching lines...) Expand 10 before | Expand all | Expand 10 after
924 CompilerOptions options, 924 CompilerOptions options,
925 CommonElements commonElements, 925 CommonElements commonElements,
926 ClosedWorld closedWorld) { 926 ClosedWorld closedWorld) {
927 HInstruction left = instruction.inputs[1]; 927 HInstruction left = instruction.inputs[1];
928 HInstruction right = instruction.inputs[2]; 928 HInstruction right = instruction.inputs[2];
929 TypeMask instructionType = left.instructionType; 929 TypeMask instructionType = left.instructionType;
930 if (right.isConstantNull() || left.isPrimitiveOrNull(closedWorld)) { 930 if (right.isConstantNull() || left.isPrimitiveOrNull(closedWorld)) {
931 return newBuiltinVariant(instruction, closedWorld); 931 return newBuiltinVariant(instruction, closedWorld);
932 } 932 }
933 Iterable<MemberEntity> matches = 933 Iterable<MemberEntity> matches =
934 closedWorld.allFunctions.filter(instruction.selector, instructionType); 934 closedWorld.locateMembers(instruction.selector, instructionType);
935 // This test relies the on `Object.==` and `Interceptor.==` always being 935 // This test relies the on `Object.==` and `Interceptor.==` always being
936 // implemented because if the selector matches by subtype, it still will be 936 // implemented because if the selector matches by subtype, it still will be
937 // a regular object or an interceptor. 937 // a regular object or an interceptor.
938 if (matches 938 if (matches
939 .every(closedWorld.commonElements.isDefaultEqualityImplementation)) { 939 .every(closedWorld.commonElements.isDefaultEqualityImplementation)) {
940 return newBuiltinVariant(instruction, closedWorld); 940 return newBuiltinVariant(instruction, closedWorld);
941 } 941 }
942 return null; 942 return null;
943 } 943 }
944 944
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
1136 ClosedWorld closedWorld) { 1136 ClosedWorld closedWorld) {
1137 HInstruction receiver = instruction.getDartReceiver(closedWorld); 1137 HInstruction receiver = instruction.getDartReceiver(closedWorld);
1138 if (receiver.isNumberOrNull(closedWorld)) { 1138 if (receiver.isNumberOrNull(closedWorld)) {
1139 // Even if there is no builtin equivalent instruction, we know the 1139 // Even if there is no builtin equivalent instruction, we know the
1140 // instruction does not have any side effect, and that it can be GVN'ed. 1140 // instruction does not have any side effect, and that it can be GVN'ed.
1141 clearAllSideEffects(instruction); 1141 clearAllSideEffects(instruction);
1142 } 1142 }
1143 return null; 1143 return null;
1144 } 1144 }
1145 } 1145 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698