OLD | NEW |
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 part of type_graph_inferrer; | 5 part of type_graph_inferrer; |
6 | 6 |
7 /** | 7 /** |
8 * Common class for all nodes in the graph. The current nodes are: | 8 * Common class for all nodes in the graph. The current nodes are: |
9 * | 9 * |
10 * - Concrete types | 10 * - Concrete types |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 // Use the type annotation as the type for native elements. We | 408 // Use the type annotation as the type for native elements. We |
409 // also give up on inferring to make sure this element never | 409 // also give up on inferring to make sure this element never |
410 // goes in the work queue. | 410 // goes in the work queue. |
411 giveUp(inferrer); | 411 giveUp(inferrer); |
412 if (element.isField) { | 412 if (element.isField) { |
413 return inferrer.typeOfNativeBehavior( | 413 return inferrer.typeOfNativeBehavior( |
414 native.NativeBehavior.ofFieldLoad(element, inferrer.compiler)).type; | 414 native.NativeBehavior.ofFieldLoad(element, inferrer.compiler)).type; |
415 } else { | 415 } else { |
416 assert(element.isFunction || | 416 assert(element.isFunction || |
417 element.isGetter || | 417 element.isGetter || |
418 element.isSetter); | 418 element.isSetter || |
| 419 element.isConstructor); |
419 TypedElement typedElement = element; | 420 TypedElement typedElement = element; |
420 var elementType = typedElement.type; | 421 var elementType = typedElement.type; |
421 if (elementType.kind != TypeKind.FUNCTION) { | 422 if (elementType.kind != TypeKind.FUNCTION) { |
422 return safeType(inferrer); | 423 return safeType(inferrer); |
423 } else { | 424 } else { |
424 return inferrer.typeOfNativeBehavior( | 425 return inferrer.typeOfNativeBehavior( |
425 native.NativeBehavior.ofMethod(element, inferrer.compiler)).type; | 426 native.NativeBehavior.ofMethod(element, inferrer.compiler)).type; |
426 } | 427 } |
427 } | 428 } |
428 } | 429 } |
(...skipping 1174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1603 T visitStringLiteralTypeInformation(StringLiteralTypeInformation info); | 1604 T visitStringLiteralTypeInformation(StringLiteralTypeInformation info); |
1604 T visitBoolLiteralTypeInformation(BoolLiteralTypeInformation info); | 1605 T visitBoolLiteralTypeInformation(BoolLiteralTypeInformation info); |
1605 T visitClosureCallSiteTypeInformation(ClosureCallSiteTypeInformation info); | 1606 T visitClosureCallSiteTypeInformation(ClosureCallSiteTypeInformation info); |
1606 T visitStaticCallSiteTypeInformation(StaticCallSiteTypeInformation info); | 1607 T visitStaticCallSiteTypeInformation(StaticCallSiteTypeInformation info); |
1607 T visitDynamicCallSiteTypeInformation(DynamicCallSiteTypeInformation info); | 1608 T visitDynamicCallSiteTypeInformation(DynamicCallSiteTypeInformation info); |
1608 T visitMemberTypeInformation(MemberTypeInformation info); | 1609 T visitMemberTypeInformation(MemberTypeInformation info); |
1609 T visitParameterTypeInformation(ParameterTypeInformation info); | 1610 T visitParameterTypeInformation(ParameterTypeInformation info); |
1610 T visitClosureTypeInformation(ClosureTypeInformation info); | 1611 T visitClosureTypeInformation(ClosureTypeInformation info); |
1611 T visitAwaitTypeInformation(AwaitTypeInformation info); | 1612 T visitAwaitTypeInformation(AwaitTypeInformation info); |
1612 } | 1613 } |
OLD | NEW |