| 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 2262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2273 isNot = true; | 2273 isNot = true; |
| 2274 } | 2274 } |
| 2275 | 2275 |
| 2276 DartType type = elements.getType(typeAnnotation); | 2276 DartType type = elements.getType(typeAnnotation); |
| 2277 HInstruction typeInfo = null; | 2277 HInstruction typeInfo = null; |
| 2278 if (compiler.codegenWorld.rti.hasTypeArguments(type)) { | 2278 if (compiler.codegenWorld.rti.hasTypeArguments(type)) { |
| 2279 pushInvokeHelper1(interceptors.getGetRuntimeTypeInfo(), expression); | 2279 pushInvokeHelper1(interceptors.getGetRuntimeTypeInfo(), expression); |
| 2280 typeInfo = pop(); | 2280 typeInfo = pop(); |
| 2281 } | 2281 } |
| 2282 if (type.element.isTypeVariable()) { | 2282 if (type.element.isTypeVariable()) { |
| 2283 // TODO(karlklose): We emulate the behavior of the old frog | 2283 // TODO(karlklose): We currently answer true to any is check |
| 2284 // compiler and answer true to any is check involving a type variable | 2284 // involving a type variable -- both is T and is !T -- until |
| 2285 // -- both is T and is !T -- until we have a proper implementation of | 2285 // we have a proper implementation of reified generics. |
| 2286 // reified generics. | |
| 2287 stack.add(graph.addConstantBool(true, constantSystem)); | 2286 stack.add(graph.addConstantBool(true, constantSystem)); |
| 2288 } else { | 2287 } else { |
| 2289 HInstruction instruction; | 2288 HInstruction instruction; |
| 2290 if (typeInfo !== null) { | 2289 if (typeInfo !== null) { |
| 2291 instruction = new HIs.withTypeInfoCall(type, expression, typeInfo); | 2290 instruction = new HIs.withTypeInfoCall(type, expression, typeInfo); |
| 2292 } else { | 2291 } else { |
| 2293 instruction = new HIs(type, expression); | 2292 instruction = new HIs(type, expression); |
| 2294 } | 2293 } |
| 2295 if (isNot) { | 2294 if (isNot) { |
| 2296 add(instruction); | 2295 add(instruction); |
| (...skipping 2030 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4327 new HSubGraphBlockInformation(elseBranch.graph)); | 4326 new HSubGraphBlockInformation(elseBranch.graph)); |
| 4328 | 4327 |
| 4329 HBasicBlock conditionStartBlock = conditionBranch.block; | 4328 HBasicBlock conditionStartBlock = conditionBranch.block; |
| 4330 conditionStartBlock.setBlockFlow(info, joinBlock); | 4329 conditionStartBlock.setBlockFlow(info, joinBlock); |
| 4331 SubGraph conditionGraph = conditionBranch.graph; | 4330 SubGraph conditionGraph = conditionBranch.graph; |
| 4332 HIf branch = conditionGraph.end.last; | 4331 HIf branch = conditionGraph.end.last; |
| 4333 assert(branch is HIf); | 4332 assert(branch is HIf); |
| 4334 branch.blockInformation = conditionStartBlock.blockFlow; | 4333 branch.blockInformation = conditionStartBlock.blockFlow; |
| 4335 } | 4334 } |
| 4336 } | 4335 } |
| OLD | NEW |