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

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

Issue 2896983002: Lookup const constructor invocation like other constants (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « no previous file | tests/compiler/dart2js_native/dart2js_native.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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; 9 import '../common/codegen.dart' show CodegenRegistry;
10 import '../common/names.dart'; 10 import '../common/names.dart';
(...skipping 2983 matching lines...) Expand 10 before | Expand all | Expand 10 after
2994 void visitSuperMethodInvocation(ir.SuperMethodInvocation invocation) { 2994 void visitSuperMethodInvocation(ir.SuperMethodInvocation invocation) {
2995 List<HInstruction> arguments = _visitArgumentsForStaticTarget( 2995 List<HInstruction> arguments = _visitArgumentsForStaticTarget(
2996 invocation.interfaceTarget.function, invocation.arguments); 2996 invocation.interfaceTarget.function, invocation.arguments);
2997 _buildInvokeSuper(astAdapter.getSelector(invocation), 2997 _buildInvokeSuper(astAdapter.getSelector(invocation),
2998 _containingClass(invocation), invocation.interfaceTarget, arguments); 2998 _containingClass(invocation), invocation.interfaceTarget, arguments);
2999 } 2999 }
3000 3000
3001 @override 3001 @override
3002 void visitConstructorInvocation(ir.ConstructorInvocation invocation) { 3002 void visitConstructorInvocation(ir.ConstructorInvocation invocation) {
3003 ir.Constructor target = invocation.target; 3003 ir.Constructor target = invocation.target;
3004 if (invocation.isConst) {
3005 ConstantValue constant = astAdapter.getConstantFor(invocation);
3006 stack.add(graph.addConstant(constant, closedWorld));
3007 return;
3008 }
3009
3004 // TODO(sra): For JS-interop targets, process arguments differently. 3010 // TODO(sra): For JS-interop targets, process arguments differently.
3005 List<HInstruction> arguments = 3011 List<HInstruction> arguments =
3006 _visitArgumentsForStaticTarget(target.function, invocation.arguments); 3012 _visitArgumentsForStaticTarget(target.function, invocation.arguments);
3007 if (backend.rtiNeed 3013 if (backend.rtiNeed
3008 .classNeedsRti(astAdapter.getClass(target.enclosingClass))) { 3014 .classNeedsRti(astAdapter.getClass(target.enclosingClass))) {
3009 _addTypeArguments(arguments, invocation.arguments); 3015 _addTypeArguments(arguments, invocation.arguments);
3010 } 3016 }
3011 TypeMask typeMask = new TypeMask.nonNullExact( 3017 TypeMask typeMask = new TypeMask.nonNullExact(
3012 astAdapter.getClass(target.enclosingClass), closedWorld); 3018 astAdapter.getClass(target.enclosingClass), closedWorld);
3013 _pushStaticInvocation(target, arguments, typeMask); 3019 _pushStaticInvocation(target, arguments, typeMask);
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
3440 enterBlock.setBlockFlow( 3446 enterBlock.setBlockFlow(
3441 new HTryBlockInformation( 3447 new HTryBlockInformation(
3442 kernelBuilder.wrapStatementGraph(bodyGraph), 3448 kernelBuilder.wrapStatementGraph(bodyGraph),
3443 exception, 3449 exception,
3444 kernelBuilder.wrapStatementGraph(catchGraph), 3450 kernelBuilder.wrapStatementGraph(catchGraph),
3445 kernelBuilder.wrapStatementGraph(finallyGraph)), 3451 kernelBuilder.wrapStatementGraph(finallyGraph)),
3446 exitBlock); 3452 exitBlock);
3447 kernelBuilder.inTryStatement = previouslyInTryStatement; 3453 kernelBuilder.inTryStatement = previouslyInTryStatement;
3448 } 3454 }
3449 } 3455 }
OLDNEW
« no previous file with comments | « no previous file | tests/compiler/dart2js_native/dart2js_native.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698