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

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

Issue 2871583002: Pass InterceptorData through ResolutionWorldBuilder and access it through ClosedWorld (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 | « pkg/compiler/lib/src/ssa/builder.dart ('k') | pkg/compiler/lib/src/ssa/codegen.dart » ('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, CodegenWorkItem; 9 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem;
10 import '../common/names.dart'; 10 import '../common/names.dart';
(...skipping 2712 matching lines...) Expand 10 before | Expand all | Expand 10 after
2723 push(instruction); 2723 push(instruction);
2724 } 2724 }
2725 2725
2726 void _pushDynamicInvocation( 2726 void _pushDynamicInvocation(
2727 ir.Node node, TypeMask mask, List<HInstruction> arguments, 2727 ir.Node node, TypeMask mask, List<HInstruction> arguments,
2728 {Selector selector}) { 2728 {Selector selector}) {
2729 HInstruction receiver = arguments.first; 2729 HInstruction receiver = arguments.first;
2730 List<HInstruction> inputs = <HInstruction>[]; 2730 List<HInstruction> inputs = <HInstruction>[];
2731 2731
2732 selector ??= astAdapter.getSelector(node); 2732 selector ??= astAdapter.getSelector(node);
2733 bool isIntercepted = astAdapter.isInterceptedSelector(selector); 2733
2734 bool isIntercepted =
2735 closedWorld.interceptorData.isInterceptedSelector(selector);
2734 2736
2735 if (isIntercepted) { 2737 if (isIntercepted) {
2736 HInterceptor interceptor = _interceptorFor(receiver); 2738 HInterceptor interceptor = _interceptorFor(receiver);
2737 inputs.add(interceptor); 2739 inputs.add(interceptor);
2738 } 2740 }
2739 inputs.addAll(arguments); 2741 inputs.addAll(arguments);
2740 2742
2741 TypeMask type = astAdapter.selectorTypeOf(selector, mask); 2743 TypeMask type = astAdapter.selectorTypeOf(selector, mask);
2742 if (selector.isGetter) { 2744 if (selector.isGetter) {
2743 push(new HInvokeDynamicGetter(selector, mask, null, inputs, type)); 2745 push(new HInvokeDynamicGetter(selector, mask, null, inputs, type));
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
2925 _buildInvokeSuper(Selectors.noSuchMethod_, _containingClass(invocation), 2927 _buildInvokeSuper(Selectors.noSuchMethod_, _containingClass(invocation),
2926 noSuchMethod, <HInstruction>[pop()]); 2928 noSuchMethod, <HInstruction>[pop()]);
2927 } 2929 }
2928 2930
2929 HInstruction _buildInvokeSuper(Selector selector, ir.Class containingClass, 2931 HInstruction _buildInvokeSuper(Selector selector, ir.Class containingClass,
2930 ir.Member interfaceTarget, List<HInstruction> arguments) { 2932 ir.Member interfaceTarget, List<HInstruction> arguments) {
2931 // TODO(efortuna): Add source information. 2933 // TODO(efortuna): Add source information.
2932 HInstruction receiver = localsHandler.readThis(); 2934 HInstruction receiver = localsHandler.readThis();
2933 2935
2934 List<HInstruction> inputs = <HInstruction>[]; 2936 List<HInstruction> inputs = <HInstruction>[];
2935 if (astAdapter.isInterceptedSelector(selector)) { 2937 if (closedWorld.interceptorData.isInterceptedSelector(selector)) {
2936 inputs.add(_interceptorFor(receiver)); 2938 inputs.add(_interceptorFor(receiver));
2937 } 2939 }
2938 inputs.add(receiver); 2940 inputs.add(receiver);
2939 inputs.addAll(arguments); 2941 inputs.addAll(arguments);
2940 2942
2941 TypeMask typeMask; 2943 TypeMask typeMask;
2942 if (interfaceTarget is ir.Procedure) { 2944 if (interfaceTarget is ir.Procedure) {
2943 typeMask = astAdapter.returnTypeOf(interfaceTarget); 2945 typeMask = astAdapter.returnTypeOf(interfaceTarget);
2944 } else { 2946 } else {
2945 typeMask = closedWorld.commonMasks.dynamicType; 2947 typeMask = closedWorld.commonMasks.dynamicType;
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after
3421 enterBlock.setBlockFlow( 3423 enterBlock.setBlockFlow(
3422 new HTryBlockInformation( 3424 new HTryBlockInformation(
3423 kernelBuilder.wrapStatementGraph(bodyGraph), 3425 kernelBuilder.wrapStatementGraph(bodyGraph),
3424 exception, 3426 exception,
3425 kernelBuilder.wrapStatementGraph(catchGraph), 3427 kernelBuilder.wrapStatementGraph(catchGraph),
3426 kernelBuilder.wrapStatementGraph(finallyGraph)), 3428 kernelBuilder.wrapStatementGraph(finallyGraph)),
3427 exitBlock); 3429 exitBlock);
3428 kernelBuilder.inTryStatement = previouslyInTryStatement; 3430 kernelBuilder.inTryStatement = previouslyInTryStatement;
3429 } 3431 }
3430 } 3432 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/ssa/builder.dart ('k') | pkg/compiler/lib/src/ssa/codegen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698