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 '../compiler.dart'; | 7 import '../compiler.dart'; |
8 import '../constants/values.dart'; | 8 import '../constants/values.dart'; |
9 import '../diagnostics/invariant.dart'; | 9 import '../diagnostics/invariant.dart'; |
10 import '../elements/elements.dart'; | 10 import '../elements/elements.dart'; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 } | 61 } |
62 | 62 |
63 ast.Node getNode(ir.Node node) { | 63 ast.Node getNode(ir.Node node) { |
64 ast.Node result = _nodeToAst[node]; | 64 ast.Node result = _nodeToAst[node]; |
65 assert(result != null); | 65 assert(result != null); |
66 return result; | 66 return result; |
67 } | 67 } |
68 | 68 |
69 bool getCanThrow(ir.Procedure procedure) { | 69 bool getCanThrow(ir.Procedure procedure) { |
70 FunctionElement function = getElement(procedure); | 70 FunctionElement function = getElement(procedure); |
71 return !_compiler.world.getCannotThrow(function); | 71 return !_compiler.closedWorld.getCannotThrow(function); |
72 } | 72 } |
73 | 73 |
74 TypeMask returnTypeOf(ir.Procedure node) { | 74 TypeMask returnTypeOf(ir.Procedure node) { |
75 return TypeMaskFactory.inferredReturnTypeForElement( | 75 return TypeMaskFactory.inferredReturnTypeForElement( |
76 getElement(node), _compiler); | 76 getElement(node), _compiler); |
77 } | 77 } |
78 | 78 |
79 SideEffects getSideEffects(ir.Node node) { | 79 SideEffects getSideEffects(ir.Node node) { |
80 return _compiler.world.getSideEffectsOfElement(getElement(node)); | 80 return _compiler.closedWorld.getSideEffectsOfElement(getElement(node)); |
81 } | 81 } |
82 | 82 |
83 // TODO(het): Create the selector directly from the invocation | 83 // TODO(het): Create the selector directly from the invocation |
84 Selector getSelector(ir.MethodInvocation invocation) { | 84 Selector getSelector(ir.MethodInvocation invocation) { |
85 SelectorKind kind = Elements.isOperatorName(invocation.name.name) | 85 SelectorKind kind = Elements.isOperatorName(invocation.name.name) |
86 ? SelectorKind.OPERATOR | 86 ? SelectorKind.OPERATOR |
87 : SelectorKind.CALL; | 87 : SelectorKind.CALL; |
88 | 88 |
89 ir.Name irName = invocation.name; | 89 ir.Name irName = invocation.name; |
90 Name name = new Name( | 90 Name name = new Name( |
(...skipping 15 matching lines...) Expand all Loading... |
106 | 106 |
107 TypeMask selectorTypeOf(ir.MethodInvocation invocation) { | 107 TypeMask selectorTypeOf(ir.MethodInvocation invocation) { |
108 return TypeMaskFactory.inferredTypeForSelector( | 108 return TypeMaskFactory.inferredTypeForSelector( |
109 getSelector(invocation), getTypeMask(invocation), _compiler); | 109 getSelector(invocation), getTypeMask(invocation), _compiler); |
110 } | 110 } |
111 | 111 |
112 bool isIntercepted(ir.MethodInvocation invocation) { | 112 bool isIntercepted(ir.MethodInvocation invocation) { |
113 return _backend.isInterceptedSelector(getSelector(invocation)); | 113 return _backend.isInterceptedSelector(getSelector(invocation)); |
114 } | 114 } |
115 } | 115 } |
OLD | NEW |