| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 dart2js.serialization.impact; | 5 library dart2js.serialization.impact; |
| 6 | 6 |
| 7 import '../dart_types.dart'; | 7 import '../dart_types.dart'; |
| 8 import '../elements/elements.dart'; | 8 import '../elements/elements.dart'; |
| 9 import '../universe/call_structure.dart'; | 9 import '../universe/call_structure.dart'; |
| 10 import '../universe/selector.dart'; | 10 import '../universe/selector.dart'; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 object.setBool(Key.IS_SETTER, | 40 object.setBool(Key.IS_SETTER, |
| 41 dynamicUse.selector.memberName.isSetter); | 41 dynamicUse.selector.memberName.isSetter); |
| 42 if (dynamicUse.selector.memberName.library != null) { | 42 if (dynamicUse.selector.memberName.library != null) { |
| 43 object.setElement(Key.LIBRARY, | 43 object.setElement(Key.LIBRARY, |
| 44 dynamicUse.selector.memberName.library); | 44 dynamicUse.selector.memberName.library); |
| 45 } | 45 } |
| 46 } | 46 } |
| 47 | 47 |
| 48 @override | 48 @override |
| 49 void visitStaticUse(StaticUse staticUse) { | 49 void visitStaticUse(StaticUse staticUse) { |
| 50 if (staticUse.element.isGenerativeConstructor && |
| 51 staticUse.element.enclosingClass.isUnnamedMixinApplication) { |
| 52 // TODO(johnniwinther): Handle static use of forwarding constructors. |
| 53 return; |
| 54 } |
| 50 ObjectEncoder object = staticUses.createObject(); | 55 ObjectEncoder object = staticUses.createObject(); |
| 51 object.setEnum(Key.KIND, staticUse.kind); | 56 object.setEnum(Key.KIND, staticUse.kind); |
| 52 object.setElement(Key.ELEMENT, staticUse.element); | 57 object.setElement(Key.ELEMENT, staticUse.element); |
| 53 } | 58 } |
| 54 | 59 |
| 55 @override | 60 @override |
| 56 void visitTypeUse(TypeUse typeUse) { | 61 void visitTypeUse(TypeUse typeUse) { |
| 57 ObjectEncoder object = typeUses.createObject(); | 62 ObjectEncoder object = typeUses.createObject(); |
| 58 object.setEnum(Key.KIND, typeUse.kind); | 63 object.setEnum(Key.KIND, typeUse.kind); |
| 59 object.setType(Key.TYPE, typeUse.type); | 64 object.setType(Key.TYPE, typeUse.type); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 ListDecoder typeUses = objectDecoder.getList(Key.TYPE_USES); | 100 ListDecoder typeUses = objectDecoder.getList(Key.TYPE_USES); |
| 96 for (int index = 0; index < typeUses.length; index++) { | 101 for (int index = 0; index < typeUses.length; index++) { |
| 97 ObjectDecoder object = typeUses.getObject(index); | 102 ObjectDecoder object = typeUses.getObject(index); |
| 98 TypeUseKind kind = object.getEnum(Key.KIND, TypeUseKind.values); | 103 TypeUseKind kind = object.getEnum(Key.KIND, TypeUseKind.values); |
| 99 DartType type = object.getType(Key.TYPE); | 104 DartType type = object.getType(Key.TYPE); |
| 100 worldImpact.registerTypeUse(new TypeUse.internal(type, kind)); | 105 worldImpact.registerTypeUse(new TypeUse.internal(type, kind)); |
| 101 } | 106 } |
| 102 return worldImpact; | 107 return worldImpact; |
| 103 } | 108 } |
| 104 } | 109 } |
| OLD | NEW |