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

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

Issue 2995113002: Share locals between members (Closed)
Patch Set: Rebased Created 3 years, 4 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; 9 import '../common/codegen.dart' show CodegenRegistry;
10 import '../common/names.dart'; 10 import '../common/names.dart';
(...skipping 2219 matching lines...) Expand 10 before | Expand all | Expand 10 after
2230 2230
2231 @override 2231 @override
2232 void visitVariableGet(ir.VariableGet variableGet) { 2232 void visitVariableGet(ir.VariableGet variableGet) {
2233 ir.VariableDeclaration variable = variableGet.variable; 2233 ir.VariableDeclaration variable = variableGet.variable;
2234 HInstruction letBinding = letBindings[variable]; 2234 HInstruction letBinding = letBindings[variable];
2235 if (letBinding != null) { 2235 if (letBinding != null) {
2236 stack.add(letBinding); 2236 stack.add(letBinding);
2237 return; 2237 return;
2238 } 2238 }
2239 2239
2240 Local local = localsMap.getLocalVariable(variableGet.variable, 2240 Local local = localsMap.getLocalVariable(variableGet.variable);
2241 isClosureCallMethod:
2242 _elementMap.getMemberDefinition(targetElement).kind ==
2243 MemberKind.closureCall);
2244 stack.add(localsHandler.readLocal(local)); 2241 stack.add(localsHandler.readLocal(local));
2245 } 2242 }
2246 2243
2247 @override 2244 @override
2248 void visitPropertySet(ir.PropertySet propertySet) { 2245 void visitPropertySet(ir.PropertySet propertySet) {
2249 propertySet.receiver.accept(this); 2246 propertySet.receiver.accept(this);
2250 HInstruction receiver = pop(); 2247 HInstruction receiver = pop();
2251 propertySet.value.accept(this); 2248 propertySet.value.accept(this);
2252 HInstruction value = pop(); 2249 HInstruction value = pop();
2253 2250
(...skipping 1429 matching lines...) Expand 10 before | Expand all | Expand 10 after
3683 enterBlock.setBlockFlow( 3680 enterBlock.setBlockFlow(
3684 new HTryBlockInformation( 3681 new HTryBlockInformation(
3685 kernelBuilder.wrapStatementGraph(bodyGraph), 3682 kernelBuilder.wrapStatementGraph(bodyGraph),
3686 exception, 3683 exception,
3687 kernelBuilder.wrapStatementGraph(catchGraph), 3684 kernelBuilder.wrapStatementGraph(catchGraph),
3688 kernelBuilder.wrapStatementGraph(finallyGraph)), 3685 kernelBuilder.wrapStatementGraph(finallyGraph)),
3689 exitBlock); 3686 exitBlock);
3690 kernelBuilder.inTryStatement = previouslyInTryStatement; 3687 kernelBuilder.inTryStatement = previouslyInTryStatement;
3691 } 3688 }
3692 } 3689 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/kernel/element_map_impl.dart ('k') | pkg/compiler/lib/src/ssa/locals_handler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698