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 library concrete_types_inferrer; | 5 library concrete_types_inferrer; |
6 | 6 |
7 import 'dart:collection' show Queue, IterableBase; | 7 import 'dart:collection' show Queue, IterableBase; |
8 import '../native/native.dart' as native; | 8 import '../native/native.dart' as native; |
9 import '../closure.dart' show BoxFieldElement; | 9 import '../closure.dart' show BoxFieldElement; |
10 import '../dart2jslib.dart' hide Selector, TypedSelector; | 10 import '../dart2jslib.dart' hide Selector, TypedSelector; |
(...skipping 2350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2361 : types.growableListType; | 2361 : types.growableListType; |
2362 return types.allocateList( | 2362 return types.allocateList( |
2363 containerType, | 2363 containerType, |
2364 node, | 2364 node, |
2365 outermostElement, | 2365 outermostElement, |
2366 elementType, | 2366 elementType, |
2367 length); | 2367 length); |
2368 } | 2368 } |
2369 | 2369 |
2370 /** | 2370 /** |
2371 * Same as super.visitGetterSend except it records the type of nodes in test | 2371 * Same as super.handleLocalGet except it records the type of nodes in test |
2372 * mode. | 2372 * mode. |
2373 */ | 2373 */ |
2374 @override | 2374 @override |
2375 ConcreteType visitGetterSend(Send node) { | |
2376 if (inferrer.testMode) { | |
2377 var element = elements[node]; | |
2378 if (element is Local) { | |
2379 internalError(node, "Unhandled local: $element"); | |
2380 } | |
2381 } | |
2382 return super.visitGetterSend(node); | |
2383 } | |
2384 | |
2385 @override | |
2386 ConcreteType handleLocalGet(Send node, LocalElement local) { | 2375 ConcreteType handleLocalGet(Send node, LocalElement local) { |
2387 if (inferrer.testMode) { | 2376 if (inferrer.testMode) { |
2388 ConcreteType type = locals.use(local); | 2377 ConcreteType type = locals.use(local); |
2389 if (type != null) { | 2378 if (type != null) { |
2390 inferrer.augmentInferredType(node, type); | 2379 inferrer.augmentInferredType(node, type); |
2391 } | 2380 } |
2392 } | 2381 } |
2393 return super.handleLocalGet(node, local); | 2382 return super.handleLocalGet(node, local); |
2394 } | 2383 } |
2395 } | 2384 } |
OLD | NEW |