| 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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 "Unexpected async marker: ${asyncMarker}"); | 158 "Unexpected async marker: ${asyncMarker}"); |
| 159 } | 159 } |
| 160 } | 160 } |
| 161 | 161 |
| 162 ResolutionImpact buildProcedure(ir.Procedure procedure) { | 162 ResolutionImpact buildProcedure(ir.Procedure procedure) { |
| 163 handleSignature(procedure.function); | 163 handleSignature(procedure.function); |
| 164 visitNode(procedure.function.body); | 164 visitNode(procedure.function.body); |
| 165 handleAsyncMarker(procedure.function.asyncMarker); | 165 handleAsyncMarker(procedure.function.asyncMarker); |
| 166 if (procedure.isExternal && | 166 if (procedure.isExternal && |
| 167 !elementAdapter.isForeignLibrary(procedure.enclosingLibrary)) { | 167 !elementAdapter.isForeignLibrary(procedure.enclosingLibrary)) { |
| 168 // TODO(redemption): Provide the correct value for [isJsInterop]. | 168 MemberEntity member = elementAdapter.getMember(procedure); |
| 169 bool isJsInterop = |
| 170 elementAdapter.nativeBasicData.isJsInteropMember(member); |
| 169 impactBuilder.registerNativeData(elementAdapter | 171 impactBuilder.registerNativeData(elementAdapter |
| 170 .getNativeBehaviorForMethod(procedure, isJsInterop: false)); | 172 .getNativeBehaviorForMethod(procedure, isJsInterop: isJsInterop)); |
| 171 } | 173 } |
| 172 return impactBuilder; | 174 return impactBuilder; |
| 173 } | 175 } |
| 174 | 176 |
| 175 void visitNode(ir.Node node) => node?.accept(this); | 177 void visitNode(ir.Node node) => node?.accept(this); |
| 176 | 178 |
| 177 void visitNodes(Iterable<ir.Node> nodes) { | 179 void visitNodes(Iterable<ir.Node> nodes) { |
| 178 nodes.forEach(visitNode); | 180 nodes.forEach(visitNode); |
| 179 } | 181 } |
| 180 | 182 |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 612 ConstructorEntity target = elementAdapter.getConstructor(node.target); | 614 ConstructorEntity target = elementAdapter.getConstructor(node.target); |
| 613 impactBuilder.registerStaticUse(new StaticUse.superConstructorInvoke( | 615 impactBuilder.registerStaticUse(new StaticUse.superConstructorInvoke( |
| 614 target, elementAdapter.getCallStructure(node.arguments))); | 616 target, elementAdapter.getCallStructure(node.arguments))); |
| 615 } | 617 } |
| 616 | 618 |
| 617 // TODO(johnniwinther): Make this throw and visit child nodes explicitly | 619 // TODO(johnniwinther): Make this throw and visit child nodes explicitly |
| 618 // instead to ensure that we don't visit unwanted parts of the ir. | 620 // instead to ensure that we don't visit unwanted parts of the ir. |
| 619 @override | 621 @override |
| 620 void defaultNode(ir.Node node) => node.visitChildren(this); | 622 void defaultNode(ir.Node node) => node.visitChildren(this); |
| 621 } | 623 } |
| OLD | NEW |