OLD | NEW |
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 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 if (checkReceiver(instruction)) { | 355 if (checkReceiver(instruction)) { |
356 addAllUsersBut(instruction, instruction.inputs[1]); | 356 addAllUsersBut(instruction, instruction.inputs[1]); |
357 } | 357 } |
358 if (!selector.isUnaryOperator && checkArgument(instruction)) { | 358 if (!selector.isUnaryOperator && checkArgument(instruction)) { |
359 addAllUsersBut(instruction, instruction.inputs[2]); | 359 addAllUsersBut(instruction, instruction.inputs[2]); |
360 } | 360 } |
361 } | 361 } |
362 }); | 362 }); |
363 } | 363 } |
364 | 364 |
365 HInstruction receiver = instruction.getDartReceiver(compiler); | 365 HInstruction receiver = instruction.getDartReceiver(closedWorld); |
366 TypeMask receiverType = receiver.instructionType; | 366 TypeMask receiverType = receiver.instructionType; |
367 instruction.mask = receiverType; | 367 instruction.mask = receiverType; |
368 | 368 |
369 // Try to specialize the receiver after this call by instering a refinement | 369 // Try to specialize the receiver after this call by instering a refinement |
370 // node (HTypeKnown). There are two potentially expensive tests - are there | 370 // node (HTypeKnown). There are two potentially expensive tests - are there |
371 // any uses of the receiver dominated by and following this call?, and what | 371 // any uses of the receiver dominated by and following this call?, and what |
372 // is the refined type? The first is expensive if the receiver has many | 372 // is the refined type? The first is expensive if the receiver has many |
373 // uses, the second is expensive if many classes implement the selector. So | 373 // uses, the second is expensive if many classes implement the selector. So |
374 // we try to do the least expensive test first. | 374 // we try to do the least expensive test first. |
375 const int _MAX_QUICK_USERS = 50; | 375 const int _MAX_QUICK_USERS = 50; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 receiver.replaceAllUsersDominatedBy(converted.next, converted); | 407 receiver.replaceAllUsersDominatedBy(converted.next, converted); |
408 addDependentInstructionsToWorkList(converted); | 408 addDependentInstructionsToWorkList(converted); |
409 } | 409 } |
410 } | 410 } |
411 } | 411 } |
412 | 412 |
413 return instruction.specializer | 413 return instruction.specializer |
414 .computeTypeFromInputTypes(instruction, compiler, closedWorld); | 414 .computeTypeFromInputTypes(instruction, compiler, closedWorld); |
415 } | 415 } |
416 } | 416 } |
OLD | NEW |