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

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

Issue 2995113002: Share locals between members (Closed)
Patch Set: 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 2201 matching lines...) Expand 10 before | Expand all | Expand 10 after
2212 2212
2213 @override 2213 @override
2214 void visitVariableGet(ir.VariableGet variableGet) { 2214 void visitVariableGet(ir.VariableGet variableGet) {
2215 ir.VariableDeclaration variable = variableGet.variable; 2215 ir.VariableDeclaration variable = variableGet.variable;
2216 HInstruction letBinding = letBindings[variable]; 2216 HInstruction letBinding = letBindings[variable];
2217 if (letBinding != null) { 2217 if (letBinding != null) {
2218 stack.add(letBinding); 2218 stack.add(letBinding);
2219 return; 2219 return;
2220 } 2220 }
2221 2221
2222 Local local = localsMap.getLocalVariable(variableGet.variable, 2222 Local local = localsMap.getLocalVariable(variableGet.variable);
2223 isClosureCallMethod:
2224 _elementMap.getMemberDefinition(targetElement).kind ==
2225 MemberKind.closureCall);
2226 stack.add(localsHandler.readLocal(local)); 2223 stack.add(localsHandler.readLocal(local));
2227 } 2224 }
2228 2225
2229 @override 2226 @override
2230 void visitPropertySet(ir.PropertySet propertySet) { 2227 void visitPropertySet(ir.PropertySet propertySet) {
2231 propertySet.receiver.accept(this); 2228 propertySet.receiver.accept(this);
2232 HInstruction receiver = pop(); 2229 HInstruction receiver = pop();
2233 propertySet.value.accept(this); 2230 propertySet.value.accept(this);
2234 HInstruction value = pop(); 2231 HInstruction value = pop();
2235 2232
(...skipping 1430 matching lines...) Expand 10 before | Expand all | Expand 10 after
3666 enterBlock.setBlockFlow( 3663 enterBlock.setBlockFlow(
3667 new HTryBlockInformation( 3664 new HTryBlockInformation(
3668 kernelBuilder.wrapStatementGraph(bodyGraph), 3665 kernelBuilder.wrapStatementGraph(bodyGraph),
3669 exception, 3666 exception,
3670 kernelBuilder.wrapStatementGraph(catchGraph), 3667 kernelBuilder.wrapStatementGraph(catchGraph),
3671 kernelBuilder.wrapStatementGraph(finallyGraph)), 3668 kernelBuilder.wrapStatementGraph(finallyGraph)),
3672 exitBlock); 3669 exitBlock);
3673 kernelBuilder.inTryStatement = previouslyInTryStatement; 3670 kernelBuilder.inTryStatement = previouslyInTryStatement;
3674 } 3671 }
3675 } 3672 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698