Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Side by Side Diff: pkg/compiler/lib/src/ssa/builder_kernel.dart

Issue 2620023002: Use elements/types in constants/values (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698