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

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

Issue 10035032: Give a sourceElement to SSA instructions so that if they end up being 'define' in the codegen (ie n… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 8 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 | « no previous file | lib/compiler/implementation/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) 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 Interceptors { 5 class Interceptors {
6 Compiler compiler; 6 Compiler compiler;
7 Interceptors(Compiler this.compiler); 7 Interceptors(Compiler this.compiler);
8 8
9 SourceString mapOperatorToMethodName(Operator op) { 9 SourceString mapOperatorToMethodName(Operator op) {
10 String name = op.source.stringValue; 10 String name = op.source.stringValue;
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 // the next iteration. 522 // the next iteration.
523 ClosureScope scopeData = closureData.capturingScopes[node]; 523 ClosureScope scopeData = closureData.capturingScopes[node];
524 if (scopeData == null) return; 524 if (scopeData == null) return;
525 if (scopeData.hasBoxedLoopVariables()) { 525 if (scopeData.hasBoxedLoopVariables()) {
526 updateCaptureBox(scopeData.boxElement, scopeData.boxedLoopVariables); 526 updateCaptureBox(scopeData.boxElement, scopeData.boxedLoopVariables);
527 } 527 }
528 } 528 }
529 529
530 void endLoop(HBasicBlock loopEntry) { 530 void endLoop(HBasicBlock loopEntry) {
531 loopEntry.forEachPhi((HPhi phi) { 531 loopEntry.forEachPhi((HPhi phi) {
532 Element element = phi.element; 532 Element element = phi.sourceElement;
533 HInstruction postLoopDefinition = directLocals[element]; 533 HInstruction postLoopDefinition = directLocals[element];
534 phi.addInput(postLoopDefinition); 534 phi.addInput(postLoopDefinition);
535 }); 535 });
536 } 536 }
537 537
538 /** 538 /**
539 * Merge [otherLocals] into this locals handler, creating phi-nodes when 539 * Merge [otherLocals] into this locals handler, creating phi-nodes when
540 * there is a conflict. 540 * there is a conflict.
541 * If a phi node is necessary, it will use the otherLocals instruction as the 541 * If a phi node is necessary, it will use the otherLocals instruction as the
542 * first input, and this handler's instruction as the second. 542 * first input, and this handler's instruction as the second.
(...skipping 1186 matching lines...) Expand 10 before | Expand all | Expand 10 after
1729 } else { 1729 } else {
1730 add(new HStaticStore(element, value)); 1730 add(new HStaticStore(element, value));
1731 } 1731 }
1732 stack.add(value); 1732 stack.add(value);
1733 } else if (element === null || Elements.isInstanceField(element)) { 1733 } else if (element === null || Elements.isInstanceField(element)) {
1734 HInstruction receiver = generateInstanceSendReceiver(send); 1734 HInstruction receiver = generateInstanceSendReceiver(send);
1735 generateInstanceSetterWithCompiledReceiver(send, receiver, value); 1735 generateInstanceSetterWithCompiledReceiver(send, receiver, value);
1736 } else { 1736 } else {
1737 localsHandler.updateLocal(element, value); 1737 localsHandler.updateLocal(element, value);
1738 stack.add(value); 1738 stack.add(value);
1739 // If the value does not already have a name, give it here.
1740 if (value.sourceElement === null) {
1741 value.sourceElement = element;
1742 }
1739 } 1743 }
1740 } 1744 }
1741 1745
1742 visitOperatorSend(node) { 1746 visitOperatorSend(node) {
1743 assert(node.selector is Operator); 1747 assert(node.selector is Operator);
1744 Operator op = node.selector; 1748 Operator op = node.selector;
1745 if (const SourceString("[]") == op.source) { 1749 if (const SourceString("[]") == op.source) {
1746 HStatic target = new HStatic(interceptors.getIndexInterceptor()); 1750 HStatic target = new HStatic(interceptors.getIndexInterceptor());
1747 add(target); 1751 add(target);
1748 visit(node.receiver); 1752 visit(node.receiver);
(...skipping 1341 matching lines...) Expand 10 before | Expand all | Expand 10 after
3090 false, 3094 false,
3091 <HInstruction>[target, input])); 3095 <HInstruction>[target, input]));
3092 return builder.pop(); 3096 return builder.pop();
3093 } 3097 }
3094 3098
3095 HInstruction result() { 3099 HInstruction result() {
3096 flushLiterals(); 3100 flushLiterals();
3097 return prefix; 3101 return prefix;
3098 } 3102 }
3099 } 3103 }
OLDNEW
« no previous file with comments | « no previous file | lib/compiler/implementation/ssa/codegen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698