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

Side by Side Diff: lib/compiler/implementation/ssa/codegen.dart

Issue 10584009: Refactor the collection of initializer list types (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed last round of comments Created 8 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « lib/compiler/implementation/enqueue.dart ('k') | lib/compiler/implementation/ssa/optimize.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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 class SsaCodeGeneratorTask extends CompilerTask { 5 class SsaCodeGeneratorTask extends CompilerTask {
6 final JavaScriptBackend backend; 6 final JavaScriptBackend backend;
7 SsaCodeGeneratorTask(JavaScriptBackend backend) 7 SsaCodeGeneratorTask(JavaScriptBackend backend)
8 : this.backend = backend, 8 : this.backend = backend,
9 super(backend.compiler); 9 super(backend.compiler);
10 String get name() => 'SSA code generator'; 10 String get name() => 'SSA code generator';
(...skipping 1712 matching lines...) Expand 10 before | Expand all | Expand 10 after
1723 } 1723 }
1724 1724
1725 visitFieldSet(HFieldSet node) { 1725 visitFieldSet(HFieldSet node) {
1726 String name = compiler.namer.getName(node.element); 1726 String name = compiler.namer.getName(node.element);
1727 beginExpression(JSPrecedence.ASSIGNMENT_PRECEDENCE); 1727 beginExpression(JSPrecedence.ASSIGNMENT_PRECEDENCE);
1728 use(node.receiver, JSPrecedence.MEMBER_PRECEDENCE); 1728 use(node.receiver, JSPrecedence.MEMBER_PRECEDENCE);
1729 buffer.add('.'); 1729 buffer.add('.');
1730 buffer.add(name); 1730 buffer.add(name);
1731 Type type = node.receiver.propagatedType.computeType(compiler); 1731 Type type = node.receiver.propagatedType.computeType(compiler);
1732 if (type != null) { 1732 if (type != null) {
1733 world.registerFieldSetter(node.element.name, 1733 world.registerFieldSetter(node.element.name, type);
1734 type, 1734 backend.updateFieldIntegerSetters(node.element,
1735 node.value.isInteger()); 1735 node.value.isInteger());
1736 } 1736 }
1737 buffer.add(' = '); 1737 buffer.add(' = ');
1738 use(node.value, JSPrecedence.ASSIGNMENT_PRECEDENCE); 1738 use(node.value, JSPrecedence.ASSIGNMENT_PRECEDENCE);
1739 endExpression(JSPrecedence.ASSIGNMENT_PRECEDENCE); 1739 endExpression(JSPrecedence.ASSIGNMENT_PRECEDENCE);
1740 } 1740 }
1741 1741
1742 visitLocalGet(HLocalGet node) { 1742 visitLocalGet(HLocalGet node) {
1743 use(node.receiver, JSPrecedence.EXPRESSION_PRECEDENCE); 1743 use(node.receiver, JSPrecedence.EXPRESSION_PRECEDENCE);
1744 } 1744 }
1745 1745
(...skipping 19 matching lines...) Expand all
1765 } 1765 }
1766 endExpression(JSPrecedence.EXPRESSION_PRECEDENCE); 1766 endExpression(JSPrecedence.EXPRESSION_PRECEDENCE);
1767 } 1767 }
1768 1768
1769 visitForeignNew(HForeignNew node) { 1769 visitForeignNew(HForeignNew node) {
1770 var i = 0; 1770 var i = 0;
1771 node.element.forEachInstanceField( 1771 node.element.forEachInstanceField(
1772 includeBackendMembers: true, 1772 includeBackendMembers: true,
1773 includeSuperMembers: true, 1773 includeSuperMembers: true,
1774 f: (ClassElement enclosingClass, Element member) { 1774 f: (ClassElement enclosingClass, Element member) {
1775 world.registerFieldInitializer(member.name, 1775 backend.updateFieldInitializers(member,
1776 enclosingClass.computeType(compiler), 1776 node.inputs[i].propagatedType);
1777 node.inputs[i].isInteger());
1778
1779 i++; 1777 i++;
1780 }); 1778 });
1781 String jsClassReference = compiler.namer.isolateAccess(node.element); 1779 String jsClassReference = compiler.namer.isolateAccess(node.element);
1782 beginExpression(JSPrecedence.MEMBER_PRECEDENCE); 1780 beginExpression(JSPrecedence.MEMBER_PRECEDENCE);
1783 buffer.add('new $jsClassReference('); 1781 buffer.add('new $jsClassReference(');
1784 // We can't use 'visitArguments', since our arguments start at input[0]. 1782 // We can't use 'visitArguments', since our arguments start at input[0].
1785 List<HInstruction> inputs = node.inputs; 1783 List<HInstruction> inputs = node.inputs;
1786 for (int i = 0; i < inputs.length; i++) { 1784 for (int i = 0; i < inputs.length; i++) {
1787 if (i != 0) buffer.add(', '); 1785 if (i != 0) buffer.add(', ');
1788 use(inputs[i], JSPrecedence.ASSIGNMENT_PRECEDENCE); 1786 use(inputs[i], JSPrecedence.ASSIGNMENT_PRECEDENCE);
(...skipping 1128 matching lines...) Expand 10 before | Expand all | Expand 10 after
2917 startBailoutSwitch(); 2915 startBailoutSwitch();
2918 } 2916 }
2919 } 2917 }
2920 2918
2921 void endLabeledBlock(HLabeledBlockInformation labeledBlockInfo) { 2919 void endLabeledBlock(HLabeledBlockInformation labeledBlockInfo) {
2922 if (labeledBlockInfo.body.start.hasGuards()) { 2920 if (labeledBlockInfo.body.start.hasGuards()) {
2923 endBailoutSwitch(); 2921 endBailoutSwitch();
2924 } 2922 }
2925 } 2923 }
2926 } 2924 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/enqueue.dart ('k') | lib/compiler/implementation/ssa/optimize.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698