| 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 '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem; | 9 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem; |
| 10 import '../common/names.dart'; | 10 import '../common/names.dart'; |
| (...skipping 1845 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1856 if (_unexpectedForeignArguments(invocation, 1, 1)) { | 1856 if (_unexpectedForeignArguments(invocation, 1, 1)) { |
| 1857 // Result expected on stack. | 1857 // Result expected on stack. |
| 1858 stack.add(graph.addConstantNull(closedWorld)); | 1858 stack.add(graph.addConstantNull(closedWorld)); |
| 1859 return; | 1859 return; |
| 1860 } | 1860 } |
| 1861 ir.Expression argument = invocation.arguments.positional.single; | 1861 ir.Expression argument = invocation.arguments.positional.single; |
| 1862 argument.accept(this); | 1862 argument.accept(this); |
| 1863 HInstruction argumentInstruction = pop(); | 1863 HInstruction argumentInstruction = pop(); |
| 1864 if (argumentInstruction is HConstant) { | 1864 if (argumentInstruction is HConstant) { |
| 1865 ConstantValue argumentConstant = argumentInstruction.constant; | 1865 ConstantValue argumentConstant = argumentInstruction.constant; |
| 1866 if (argumentConstant is TypeConstantValue) { | 1866 if (argumentConstant is TypeConstantValue && |
| 1867 argumentConstant.representedType is ResolutionInterfaceType) { |
| 1868 ResolutionInterfaceType type = argumentConstant.representedType; |
| 1867 // TODO(sra): Check that type is a subclass of [Interceptor]. | 1869 // TODO(sra): Check that type is a subclass of [Interceptor]. |
| 1868 ConstantValue constant = | 1870 ConstantValue constant = new InterceptorConstantValue(type.element); |
| 1869 new InterceptorConstantValue(argumentConstant.representedType); | |
| 1870 HInstruction instruction = graph.addConstant(constant, closedWorld); | 1871 HInstruction instruction = graph.addConstant(constant, closedWorld); |
| 1871 stack.add(instruction); | 1872 stack.add(instruction); |
| 1872 return; | 1873 return; |
| 1873 } | 1874 } |
| 1874 } | 1875 } |
| 1875 | 1876 |
| 1876 compiler.reporter.reportErrorMessage(astAdapter.getNode(invocation), | 1877 compiler.reporter.reportErrorMessage(astAdapter.getNode(invocation), |
| 1877 MessageKind.WRONG_ARGUMENT_FOR_JS_INTERCEPTOR_CONSTANT); | 1878 MessageKind.WRONG_ARGUMENT_FOR_JS_INTERCEPTOR_CONSTANT); |
| 1878 stack.add(graph.addConstantNull(closedWorld)); | 1879 stack.add(graph.addConstantNull(closedWorld)); |
| 1879 } | 1880 } |
| (...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2486 kernelBuilder.open(exitBlock); | 2487 kernelBuilder.open(exitBlock); |
| 2487 enterBlock.setBlockFlow( | 2488 enterBlock.setBlockFlow( |
| 2488 new HTryBlockInformation( | 2489 new HTryBlockInformation( |
| 2489 kernelBuilder.wrapStatementGraph(bodyGraph), | 2490 kernelBuilder.wrapStatementGraph(bodyGraph), |
| 2490 exception, | 2491 exception, |
| 2491 kernelBuilder.wrapStatementGraph(catchGraph), | 2492 kernelBuilder.wrapStatementGraph(catchGraph), |
| 2492 kernelBuilder.wrapStatementGraph(finallyGraph)), | 2493 kernelBuilder.wrapStatementGraph(finallyGraph)), |
| 2493 exitBlock); | 2494 exitBlock); |
| 2494 } | 2495 } |
| 2495 } | 2496 } |
| OLD | NEW |