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

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

Issue 2608273002: Reduce use of Element in optimize.dart (Closed)
Patch Set: Fix. Created 3 years, 11 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/backend_api.dart' show BackendClasses; 5 import '../common/backend_api.dart' show BackendClasses;
6 import '../compiler.dart' show Compiler; 6 import '../compiler.dart' show Compiler;
7 import '../constants/constant_system.dart'; 7 import '../constants/constant_system.dart';
8 import '../constants/values.dart'; 8 import '../constants/values.dart';
9 import '../elements/elements.dart'; 9 import '../elements/elements.dart';
10 import '../js_backend/backend.dart'; 10 import '../js_backend/backend.dart';
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 // interceptor directly. 168 // interceptor directly.
169 169
170 // TODO(sra): Key DOM classes like Node, Element and Event are not leaf 170 // TODO(sra): Key DOM classes like Node, Element and Event are not leaf
171 // classes. When the receiver type is not a leaf class, we might still be 171 // classes. When the receiver type is not a leaf class, we might still be
172 // able to use the receiver class as a constant interceptor. It is 172 // able to use the receiver class as a constant interceptor. It is
173 // usually the case that methods defined on a non-leaf class don't test 173 // usually the case that methods defined on a non-leaf class don't test
174 // for a subclass or call methods defined on a subclass. Provided the 174 // for a subclass or call methods defined on a subclass. Provided the
175 // code is completely insensitive to the specific instance subclasses, we 175 // code is completely insensitive to the specific instance subclasses, we
176 // can use the non-leaf class directly. 176 // can use the non-leaf class directly.
177 ClassElement element = type.singleClass(closedWorld); 177 ClassElement element = type.singleClass(closedWorld);
178 if (element != null && backendClasses.isNative(element)) { 178 if (element != null && backendClasses.isNativeClass(element)) {
179 return element; 179 return element;
180 } 180 }
181 } 181 }
182 182
183 return null; 183 return null;
184 } 184 }
185 185
186 HInstruction findDominator(Iterable<HInstruction> instructions) { 186 HInstruction findDominator(Iterable<HInstruction> instructions) {
187 HInstruction result; 187 HInstruction result;
188 L1: 188 L1:
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 instruction = new HInvokeDynamicMethod( 419 instruction = new HInvokeDynamicMethod(
420 selector, mask, inputs, node.instructionType, true); 420 selector, mask, inputs, node.instructionType, true);
421 } 421 }
422 422
423 HBasicBlock block = node.block; 423 HBasicBlock block = node.block;
424 block.addAfter(node, instruction); 424 block.addAfter(node, instruction);
425 block.rewrite(node, instruction); 425 block.rewrite(node, instruction);
426 return true; 426 return true;
427 } 427 }
428 } 428 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698