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

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

Issue 2497313003: Fix HTypeConversion.checkedInput (Closed)
Patch Set: Add some comments Created 4 years, 1 month 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/ssa/optimize.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 '../compiler.dart' show Compiler; 5 import '../compiler.dart' show Compiler;
6 import '../elements/elements.dart'; 6 import '../elements/elements.dart';
7 import '../js_backend/js_backend.dart'; 7 import '../js_backend/js_backend.dart';
8 import '../types/types.dart'; 8 import '../types/types.dart';
9 import '../universe/selector.dart' show Selector; 9 import '../universe/selector.dart' show Selector;
10 import '../world.dart' show ClosedWorld; 10 import '../world.dart' show ClosedWorld;
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 input.replaceAllUsersDominatedBy(instruction.next, instruction); 226 input.replaceAllUsersDominatedBy(instruction.next, instruction);
227 } 227 }
228 return outputType; 228 return outputType;
229 } 229 }
230 230
231 void convertInput( 231 void convertInput(
232 HInvokeDynamic instruction, HInstruction input, TypeMask type, int kind) { 232 HInvokeDynamic instruction, HInstruction input, TypeMask type, int kind) {
233 Selector selector = (kind == HTypeConversion.RECEIVER_TYPE_CHECK) 233 Selector selector = (kind == HTypeConversion.RECEIVER_TYPE_CHECK)
234 ? instruction.selector 234 ? instruction.selector
235 : null; 235 : null;
236 HTypeConversion converted = 236 HTypeConversion converted = new HTypeConversion(null, kind, type, input,
237 new HTypeConversion(null, kind, type, input, selector) 237 receiverTypeCheckSelector: selector)
238 ..sourceInformation = instruction.sourceInformation; 238 ..sourceInformation = instruction.sourceInformation;
239 instruction.block.addBefore(instruction, converted); 239 instruction.block.addBefore(instruction, converted);
240 input.replaceAllUsersDominatedBy(instruction, converted); 240 input.replaceAllUsersDominatedBy(instruction, converted);
241 } 241 }
242 242
243 bool isCheckEnoughForNsmOrAe(HInstruction instruction, TypeMask type) { 243 bool isCheckEnoughForNsmOrAe(HInstruction instruction, TypeMask type) {
244 // In some cases, we want the receiver to be an integer, 244 // In some cases, we want the receiver to be an integer,
245 // but that does not mean we will get a NoSuchMethodError 245 // but that does not mean we will get a NoSuchMethodError
246 // if it's not: the receiver could be a double. 246 // if it's not: the receiver could be a double.
247 if (type.containsOnlyInt(closedWorld)) { 247 if (type.containsOnlyInt(closedWorld)) {
248 // If the instruction's type is integer or null, the codegen 248 // If the instruction's type is integer or null, the codegen
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 receiver.replaceAllUsersDominatedBy(converted.next, converted); 402 receiver.replaceAllUsersDominatedBy(converted.next, converted);
403 addDependentInstructionsToWorkList(converted); 403 addDependentInstructionsToWorkList(converted);
404 } 404 }
405 } 405 }
406 } 406 }
407 407
408 return instruction.specializer 408 return instruction.specializer
409 .computeTypeFromInputTypes(instruction, compiler); 409 .computeTypeFromInputTypes(instruction, compiler);
410 } 410 }
411 } 411 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/ssa/optimize.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698