| 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 1897 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1908 isNot = true; | 1908 isNot = true; |
| 1909 } | 1909 } |
| 1910 | 1910 |
| 1911 Type type = elements.getType(typeAnnotation); | 1911 Type type = elements.getType(typeAnnotation); |
| 1912 HInstruction typeInfo = null; | 1912 HInstruction typeInfo = null; |
| 1913 if (compiler.codegenWorld.rti.hasTypeArguments(type)) { | 1913 if (compiler.codegenWorld.rti.hasTypeArguments(type)) { |
| 1914 pushInvokeHelper1(interceptors.getGetRuntimeTypeInfo(), expression); | 1914 pushInvokeHelper1(interceptors.getGetRuntimeTypeInfo(), expression); |
| 1915 typeInfo = pop(); | 1915 typeInfo = pop(); |
| 1916 } | 1916 } |
| 1917 if (type.element.kind === ElementKind.TYPE_VARIABLE) { | 1917 if (type.element.kind === ElementKind.TYPE_VARIABLE) { |
| 1918 // TODO(karlklose): We emulate the frog behavior and answer | 1918 // TODO(karlklose): We emulate the behavior of the old frog |
| 1919 // true to any is check involving a type variable -- both is T | 1919 // compiler and answer true to any is check involving a type variable |
| 1920 // and is !T -- until we have a proper implementation of | 1920 // -- both is T and is !T -- until we have a proper implementation of |
| 1921 // reified generics. | 1921 // reified generics. |
| 1922 stack.add(graph.addConstantBool(true)); | 1922 stack.add(graph.addConstantBool(true)); |
| 1923 } else { | 1923 } else { |
| 1924 HInstruction instruction; | 1924 HInstruction instruction; |
| 1925 if (typeInfo !== null) { | 1925 if (typeInfo !== null) { |
| 1926 instruction = new HIs.withTypeInfoCall(type, expression, typeInfo); | 1926 instruction = new HIs.withTypeInfoCall(type, expression, typeInfo); |
| 1927 } else { | 1927 } else { |
| 1928 instruction = new HIs(type, expression); | 1928 instruction = new HIs(type, expression); |
| 1929 } | 1929 } |
| 1930 if (isNot) { | 1930 if (isNot) { |
| (...skipping 1716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3647 new HSubGraphBlockInformation(elseBranch.graph)); | 3647 new HSubGraphBlockInformation(elseBranch.graph)); |
| 3648 | 3648 |
| 3649 HBasicBlock conditionStartBlock = conditionBranch.block; | 3649 HBasicBlock conditionStartBlock = conditionBranch.block; |
| 3650 conditionStartBlock.setBlockFlow(info, joinBlock); | 3650 conditionStartBlock.setBlockFlow(info, joinBlock); |
| 3651 SubGraph conditionGraph = conditionBranch.graph; | 3651 SubGraph conditionGraph = conditionBranch.graph; |
| 3652 HIf branch = conditionGraph.end.last; | 3652 HIf branch = conditionGraph.end.last; |
| 3653 assert(branch is HIf); | 3653 assert(branch is HIf); |
| 3654 branch.blockInformation = conditionStartBlock.blockFlow; | 3654 branch.blockInformation = conditionStartBlock.blockFlow; |
| 3655 } | 3655 } |
| 3656 } | 3656 } |
| OLD | NEW |