OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 class Interceptors { | 5 class Interceptors { |
6 Compiler compiler; | 6 Compiler compiler; |
7 Interceptors(Compiler this.compiler); | 7 Interceptors(Compiler this.compiler); |
8 | 8 |
9 SourceString mapOperatorToMethodName(Operator op) { | 9 SourceString mapOperatorToMethodName(Operator op) { |
10 String name = op.source.stringValue; | 10 String name = op.source.stringValue; |
(...skipping 2174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2185 } | 2185 } |
2186 | 2186 |
2187 visitDynamicSend(Send node) { | 2187 visitDynamicSend(Send node) { |
2188 Selector selector = elements.getSelector(node); | 2188 Selector selector = elements.getSelector(node); |
2189 var inputs = <HInstruction>[]; | 2189 var inputs = <HInstruction>[]; |
2190 | 2190 |
2191 SourceString dartMethodName; | 2191 SourceString dartMethodName; |
2192 bool isNotEquals = false; | 2192 bool isNotEquals = false; |
2193 if (node.isIndex && !node.arguments.tail.isEmpty()) { | 2193 if (node.isIndex && !node.arguments.tail.isEmpty()) { |
2194 dartMethodName = Elements.constructOperatorName( | 2194 dartMethodName = Elements.constructOperatorName( |
2195 const SourceString('operator'), | 2195 const SourceString('[]='), false); |
2196 const SourceString('[]=')); | |
2197 } else if (node.selector.asOperator() != null) { | 2196 } else if (node.selector.asOperator() != null) { |
2198 SourceString name = node.selector.asIdentifier().source; | 2197 SourceString name = node.selector.asIdentifier().source; |
2199 isNotEquals = name.stringValue === '!='; | 2198 isNotEquals = name.stringValue === '!='; |
2200 dartMethodName = Elements.constructOperatorName( | 2199 dartMethodName = Elements.constructOperatorName( |
2201 const SourceString('operator'), | 2200 name, node.argumentsNode is Prefix); |
2202 name, | |
2203 node.argumentsNode is Prefix); | |
2204 } else { | 2201 } else { |
2205 dartMethodName = node.selector.asIdentifier().source; | 2202 dartMethodName = node.selector.asIdentifier().source; |
2206 } | 2203 } |
2207 | 2204 |
2208 Element interceptor = null; | 2205 Element interceptor = null; |
2209 if (methodInterceptionEnabled && node.receiver !== null) { | 2206 if (methodInterceptionEnabled && node.receiver !== null) { |
2210 interceptor = interceptors.getStaticInterceptor(dartMethodName, | 2207 interceptor = interceptors.getStaticInterceptor(dartMethodName, |
2211 node.argumentCount()); | 2208 node.argumentCount()); |
2212 } | 2209 } |
2213 if (interceptor != null) { | 2210 if (interceptor != null) { |
(...skipping 1722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3936 new HSubGraphBlockInformation(elseBranch.graph)); | 3933 new HSubGraphBlockInformation(elseBranch.graph)); |
3937 | 3934 |
3938 HBasicBlock conditionStartBlock = conditionBranch.block; | 3935 HBasicBlock conditionStartBlock = conditionBranch.block; |
3939 conditionStartBlock.setBlockFlow(info, joinBlock); | 3936 conditionStartBlock.setBlockFlow(info, joinBlock); |
3940 SubGraph conditionGraph = conditionBranch.graph; | 3937 SubGraph conditionGraph = conditionBranch.graph; |
3941 HIf branch = conditionGraph.end.last; | 3938 HIf branch = conditionGraph.end.last; |
3942 assert(branch is HIf); | 3939 assert(branch is HIf); |
3943 branch.blockInformation = conditionStartBlock.blockFlow; | 3940 branch.blockInformation = conditionStartBlock.blockFlow; |
3944 } | 3941 } |
3945 } | 3942 } |
OLD | NEW |