| 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 '../closure.dart'; | 7 import '../closure.dart'; |
| 8 import '../common.dart'; | 8 import '../common.dart'; |
| 9 import '../compiler.dart'; | 9 import '../compiler.dart'; |
| 10 import '../constants/expressions.dart'; | 10 import '../constants/expressions.dart'; |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 MethodElement getMethod(ir.Procedure node) => getElement(node).declaration; | 204 MethodElement getMethod(ir.Procedure node) => getElement(node).declaration; |
| 205 | 205 |
| 206 FieldElement getField(ir.Field node) => getElement(node).declaration; | 206 FieldElement getField(ir.Field node) => getElement(node).declaration; |
| 207 | 207 |
| 208 ClassElement getClass(ir.Class node) => getElement(node).declaration; | 208 ClassElement getClass(ir.Class node) => getElement(node).declaration; |
| 209 | 209 |
| 210 LibraryElement getLibrary(ir.Library node) => getElement(node).declaration; | 210 LibraryElement getLibrary(ir.Library node) => getElement(node).declaration; |
| 211 | 211 |
| 212 LocalFunctionElement getLocalFunction(ir.TreeNode node) => getElement(node); | 212 LocalFunctionElement getLocalFunction(ir.TreeNode node) => getElement(node); |
| 213 | 213 |
| 214 /// Returns the uri for the deferred import [node]. |
| 215 String getDeferredUri(ir.LibraryDependency node) { |
| 216 PrefixElement prefixElement = getElement(node); |
| 217 return prefixElement.deferredImport.uri.toString(); |
| 218 } |
| 219 |
| 214 ast.Node getNode(ir.Node node) { | 220 ast.Node getNode(ir.Node node) { |
| 215 ast.Node result = _nodeToAst[node]; | 221 ast.Node result = _nodeToAst[node]; |
| 216 assert(result != null, | 222 assert(result != null, |
| 217 failedAt(CURRENT_ELEMENT_SPANNABLE, "No node found for $node")); | 223 failedAt(CURRENT_ELEMENT_SPANNABLE, "No node found for $node")); |
| 218 return result; | 224 return result; |
| 219 } | 225 } |
| 220 | 226 |
| 221 ast.Node getNodeOrNull(ir.Node node) { | 227 ast.Node getNodeOrNull(ir.Node node) { |
| 222 return _nodeToAst[node]; | 228 return _nodeToAst[node]; |
| 223 } | 229 } |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 InterfaceType getInterfaceType(ir.InterfaceType type) => getDartType(type); | 339 InterfaceType getInterfaceType(ir.InterfaceType type) => getDartType(type); |
| 334 | 340 |
| 335 InterfaceType getThisType(ClassElement cls) => cls.thisType; | 341 InterfaceType getThisType(ClassElement cls) => cls.thisType; |
| 336 | 342 |
| 337 InterfaceType createInterfaceType( | 343 InterfaceType createInterfaceType( |
| 338 ir.Class cls, List<ir.DartType> typeArguments) { | 344 ir.Class cls, List<ir.DartType> typeArguments) { |
| 339 return new ResolutionInterfaceType( | 345 return new ResolutionInterfaceType( |
| 340 getClass(cls), getDartTypes(typeArguments)); | 346 getClass(cls), getDartTypes(typeArguments)); |
| 341 } | 347 } |
| 342 | 348 |
| 343 MemberEntity getConstructorBodyEntity(ir.Constructor constructor) { | 349 MemberEntity getConstructorBody(ir.Constructor constructor) { |
| 344 AstElement element = getElement(constructor); | 350 AstElement element = getElement(constructor); |
| 345 MemberEntity constructorBody = | 351 MemberEntity constructorBody = |
| 346 ConstructorBodyElementX.createFromResolvedAst(element.resolvedAst); | 352 ConstructorBodyElementX.createFromResolvedAst(element.resolvedAst); |
| 347 assert(constructorBody != null); | 353 assert(constructorBody != null); |
| 348 return constructorBody; | 354 return constructorBody; |
| 349 } | 355 } |
| 350 | 356 |
| 351 @override | 357 @override |
| 352 Spannable getSpannable(MemberEntity member, ir.Node node) { | 358 Spannable getSpannable(MemberEntity member, ir.Node node) { |
| 353 return getNode(node); | 359 return getNode(node); |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 680 TypeMask selectorTypeOf(Selector selector, TypeMask mask) { | 686 TypeMask selectorTypeOf(Selector selector, TypeMask mask) { |
| 681 return TypeMaskFactory.inferredTypeForSelector( | 687 return TypeMaskFactory.inferredTypeForSelector( |
| 682 selector, mask, _globalInferenceResults); | 688 selector, mask, _globalInferenceResults); |
| 683 } | 689 } |
| 684 | 690 |
| 685 TypeMask typeFromNativeBehavior( | 691 TypeMask typeFromNativeBehavior( |
| 686 native.NativeBehavior nativeBehavior, ClosedWorld closedWorld) { | 692 native.NativeBehavior nativeBehavior, ClosedWorld closedWorld) { |
| 687 return TypeMaskFactory.fromNativeBehavior(nativeBehavior, closedWorld); | 693 return TypeMaskFactory.fromNativeBehavior(nativeBehavior, closedWorld); |
| 688 } | 694 } |
| 689 } | 695 } |
| OLD | NEW |