| OLD | NEW |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 'package:kernel/ast.dart' as ir; | 5 import 'package:kernel/ast.dart' as ir; |
| 6 | 6 |
| 7 import '../common.dart'; | 7 import '../common.dart'; |
| 8 import '../common/names.dart'; | 8 import '../common/names.dart'; |
| 9 import '../compiler.dart'; | 9 import '../compiler.dart'; |
| 10 import '../constants/expressions.dart'; | 10 import '../constants/expressions.dart'; |
| (...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 574 | 574 |
| 575 void refine() { | 575 void refine() { |
| 576 while (!workQueue.isEmpty) { | 576 while (!workQueue.isEmpty) { |
| 577 if (compiler.shouldPrintProgress) { | 577 if (compiler.shouldPrintProgress) { |
| 578 reporter.log('Inferred $overallRefineCount types.'); | 578 reporter.log('Inferred $overallRefineCount types.'); |
| 579 compiler.progress.reset(); | 579 compiler.progress.reset(); |
| 580 } | 580 } |
| 581 TypeInformation info = workQueue.remove(); | 581 TypeInformation info = workQueue.remove(); |
| 582 TypeMask oldType = info.type; | 582 TypeMask oldType = info.type; |
| 583 TypeMask newType = info.refine(this); | 583 TypeMask newType = info.refine(this); |
| 584 // Check that refinement has not accidentially changed the type. | 584 // Check that refinement has not accidentally changed the type. |
| 585 assert(oldType == info.type); | 585 assert(oldType == info.type); |
| 586 if (info.abandonInferencing) info.doNotEnqueue = true; | 586 if (info.abandonInferencing) info.doNotEnqueue = true; |
| 587 if ((info.type = newType) != oldType) { | 587 if ((info.type = newType) != oldType) { |
| 588 overallRefineCount++; | 588 overallRefineCount++; |
| 589 info.refineCount++; | 589 info.refineCount++; |
| 590 if (info.refineCount > MAX_CHANGE_COUNT) { | 590 if (info.refineCount > MAX_CHANGE_COUNT) { |
| 591 if (debug.ANOMALY_WARN) { | 591 if (debug.ANOMALY_WARN) { |
| 592 print("ANOMALY WARNING: max refinement reached for $info"); | 592 print("ANOMALY WARNING: max refinement reached for $info"); |
| 593 } | 593 } |
| 594 info.giveUp(this); | 594 info.giveUp(this); |
| (...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1075 /** | 1075 /** |
| 1076 * Records that the captured variable [local] is read. | 1076 * Records that the captured variable [local] is read. |
| 1077 */ | 1077 */ |
| 1078 void recordCapturedLocalRead(Local local) {} | 1078 void recordCapturedLocalRead(Local local) {} |
| 1079 | 1079 |
| 1080 /** | 1080 /** |
| 1081 * Records that the variable [local] is being updated. | 1081 * Records that the variable [local] is being updated. |
| 1082 */ | 1082 */ |
| 1083 void recordLocalUpdate(Local local, TypeInformation type) {} | 1083 void recordLocalUpdate(Local local, TypeInformation type) {} |
| 1084 } | 1084 } |
| OLD | NEW |