| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 impactBuilder.registerNativeData( | 130 impactBuilder.registerNativeData( |
| 131 elementAdapter.getNativeBehaviorForFieldStore(field)); | 131 elementAdapter.getNativeBehaviorForFieldStore(field)); |
| 132 } | 132 } |
| 133 return impactBuilder; | 133 return impactBuilder; |
| 134 } | 134 } |
| 135 | 135 |
| 136 ResolutionImpact buildConstructor(ir.Constructor constructor) { | 136 ResolutionImpact buildConstructor(ir.Constructor constructor) { |
| 137 handleSignature(constructor.function, checkReturnType: false); | 137 handleSignature(constructor.function, checkReturnType: false); |
| 138 visitNodes(constructor.initializers); | 138 visitNodes(constructor.initializers); |
| 139 visitNode(constructor.function.body); | 139 visitNode(constructor.function.body); |
| 140 if (constructor.isExternal && |
| 141 !elementAdapter.isForeignLibrary(constructor.enclosingLibrary)) { |
| 142 MemberEntity member = elementAdapter.getMember(constructor); |
| 143 bool isJsInterop = |
| 144 elementAdapter.nativeBasicData.isJsInteropMember(member); |
| 145 impactBuilder.registerNativeData(elementAdapter |
| 146 .getNativeBehaviorForMethod(constructor, isJsInterop: isJsInterop)); |
| 147 } |
| 140 return impactBuilder; | 148 return impactBuilder; |
| 141 } | 149 } |
| 142 | 150 |
| 143 void handleAsyncMarker(ir.AsyncMarker asyncMarker) { | 151 void handleAsyncMarker(ir.AsyncMarker asyncMarker) { |
| 144 switch (asyncMarker) { | 152 switch (asyncMarker) { |
| 145 case ir.AsyncMarker.Sync: | 153 case ir.AsyncMarker.Sync: |
| 146 break; | 154 break; |
| 147 case ir.AsyncMarker.SyncStar: | 155 case ir.AsyncMarker.SyncStar: |
| 148 impactBuilder.registerFeature(Feature.SYNC_STAR); | 156 impactBuilder.registerFeature(Feature.SYNC_STAR); |
| 149 break; | 157 break; |
| (...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 614 ConstructorEntity target = elementAdapter.getConstructor(node.target); | 622 ConstructorEntity target = elementAdapter.getConstructor(node.target); |
| 615 impactBuilder.registerStaticUse(new StaticUse.superConstructorInvoke( | 623 impactBuilder.registerStaticUse(new StaticUse.superConstructorInvoke( |
| 616 target, elementAdapter.getCallStructure(node.arguments))); | 624 target, elementAdapter.getCallStructure(node.arguments))); |
| 617 } | 625 } |
| 618 | 626 |
| 619 // TODO(johnniwinther): Make this throw and visit child nodes explicitly | 627 // TODO(johnniwinther): Make this throw and visit child nodes explicitly |
| 620 // instead to ensure that we don't visit unwanted parts of the ir. | 628 // instead to ensure that we don't visit unwanted parts of the ir. |
| 621 @override | 629 @override |
| 622 void defaultNode(ir.Node node) => node.visitChildren(this); | 630 void defaultNode(ir.Node node) => node.visitChildren(this); |
| 623 } | 631 } |
| OLD | NEW |