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

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

Issue 10826204: Revert "estimating parameter types" optimization due to failure on browser (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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 | Annotate | Revision Log
« no previous file with comments | « lib/compiler/implementation/ssa/builder.dart ('k') | lib/compiler/implementation/universe.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 1713 matching lines...) Expand 10 before | Expand all | Expand 10 after
1724 1724
1725 // TODO(ahe): The constructor name was statically resolved in 1725 // TODO(ahe): The constructor name was statically resolved in
1726 // SsaBuilder.buildFactory. Is there a cleaner way to do this? 1726 // SsaBuilder.buildFactory. Is there a cleaner way to do this?
1727 node.name.printOn(buffer); 1727 node.name.printOn(buffer);
1728 visitArguments(node.inputs); 1728 visitArguments(node.inputs);
1729 } else { 1729 } else {
1730 buffer.add(compiler.namer.instanceMethodInvocationName( 1730 buffer.add(compiler.namer.instanceMethodInvocationName(
1731 currentLibrary, node.name, node.selector)); 1731 currentLibrary, node.name, node.selector));
1732 visitArguments(node.inputs); 1732 visitArguments(node.inputs);
1733 bool inLoop = node.block.enclosingLoopHeader !== null; 1733 bool inLoop = node.block.enclosingLoopHeader !== null;
1734
1735 // Register this invocation to collect the types used at all call sites.
1736 Selector selector = getOptimizedSelectorFor(node, node.selector);
1737 backend.registerDynamicInvocation(node, selector);
1738
1739 if (node.element !== null) { 1734 if (node.element !== null) {
1740 // If we know we're calling a specific method, register that 1735 // If we know we're calling a specific method, register that
1741 // method only. 1736 // method only.
1742 if (inLoop) backend.builder.functionsCalledInLoop.add(node.element); 1737 if (inLoop) {
1738 backend.builder.functionsCalledInLoop.add(node.element);
1739 }
1743 world.registerDynamicInvocationOf(node.element); 1740 world.registerDynamicInvocationOf(node.element);
1744 } else { 1741 } else {
1742 Selector selector = getOptimizedSelectorFor(node, node.selector);
1743 world.registerDynamicInvocation(node.name, selector);
1745 if (inLoop) backend.builder.selectorsCalledInLoop[node.name] = selector; 1744 if (inLoop) backend.builder.selectorsCalledInLoop[node.name] = selector;
1746 world.registerDynamicInvocation(node.name, selector);
1747 } 1745 }
1748 } 1746 }
1749 endExpression(JSPrecedence.CALL_PRECEDENCE); 1747 endExpression(JSPrecedence.CALL_PRECEDENCE);
1750 } 1748 }
1751 1749
1752 Selector getOptimizedSelectorFor(HInvoke node, Selector defaultSelector) { 1750 Selector getOptimizedSelectorFor(HInvoke node, Selector defaultSelector) {
1753 Type receiverType = node.inputs[0].propagatedType.computeType(compiler); 1751 Type receiverType = node.inputs[0].propagatedType.computeType(compiler);
1754 if (receiverType !== null) { 1752 if (receiverType !== null) {
1755 return new TypedSelector(receiverType, defaultSelector); 1753 return new TypedSelector(receiverType, defaultSelector);
1756 } else { 1754 } else {
(...skipping 1437 matching lines...) Expand 10 before | Expand all | Expand 10 after
3194 if (leftType.canBeNull() && rightType.canBeNull()) { 3192 if (leftType.canBeNull() && rightType.canBeNull()) {
3195 if (left.isConstantNull() || right.isConstantNull() || 3193 if (left.isConstantNull() || right.isConstantNull() ||
3196 (leftType.isPrimitive() && leftType == rightType)) { 3194 (leftType.isPrimitive() && leftType == rightType)) {
3197 return '=='; 3195 return '==';
3198 } 3196 }
3199 return null; 3197 return null;
3200 } else { 3198 } else {
3201 return '==='; 3199 return '===';
3202 } 3200 }
3203 } 3201 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/ssa/builder.dart ('k') | lib/compiler/implementation/universe.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698