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

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

Issue 17482005: Use the inferred return type of the factory instead of the inferred type. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 | « no previous file | sdk/lib/_internal/compiler/implementation/types/simple_types_inferrer.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 part of ssa; 5 part of ssa;
6 6
7 /** 7 /**
8 * A special element for the extra parameter taken by intercepted 8 * A special element for the extra parameter taken by intercepted
9 * methods. We need to override [Element.computeType] because our 9 * methods. We need to override [Element.computeType] because our
10 * optimizers may look at its declared type. 10 * optimizers may look at its declared type.
(...skipping 3362 matching lines...) Expand 10 before | Expand all | Expand 10 after
3373 } else if (Elements.isGrowableListConstructorCall( 3373 } else if (Elements.isGrowableListConstructorCall(
3374 originalElement, send, compiler)) { 3374 originalElement, send, compiler)) {
3375 isListConstructor = true; 3375 isListConstructor = true;
3376 HType inferred = 3376 HType inferred =
3377 new HType.inferredForNode(currentElement, send, compiler); 3377 new HType.inferredForNode(currentElement, send, compiler);
3378 return inferred.isUnknown() ? backend.extendableArrayType : inferred; 3378 return inferred.isUnknown() ? backend.extendableArrayType : inferred;
3379 } else if (element.isGenerativeConstructor()) { 3379 } else if (element.isGenerativeConstructor()) {
3380 ClassElement cls = element.getEnclosingClass(); 3380 ClassElement cls = element.getEnclosingClass();
3381 return new HType.nonNullExact(cls.thisType, compiler); 3381 return new HType.nonNullExact(cls.thisType, compiler);
3382 } else { 3382 } else {
3383 return new HType.inferredTypeForElement(originalElement, compiler); 3383 return new HType.inferredReturnTypeForElement(
3384 originalElement, compiler);
3384 } 3385 }
3385 } 3386 }
3386 3387
3387 Element constructor = elements[send]; 3388 Element constructor = elements[send];
3388 Selector selector = elements.getSelector(send); 3389 Selector selector = elements.getSelector(send);
3389 if (constructor.isForwardingConstructor) { 3390 if (constructor.isForwardingConstructor) {
3390 compiler.unimplemented('forwarded constructor in named mixin application', 3391 compiler.unimplemented('forwarded constructor in named mixin application',
3391 element: constructor.getEnclosingClass()); 3392 element: constructor.getEnclosingClass());
3392 } 3393 }
3393 if (compiler.enqueuer.resolution.getCachedElements(constructor) == null) { 3394 if (compiler.enqueuer.resolution.getCachedElements(constructor) == null) {
(...skipping 2008 matching lines...) Expand 10 before | Expand all | Expand 10 after
5402 new HSubGraphBlockInformation(elseBranch.graph)); 5403 new HSubGraphBlockInformation(elseBranch.graph));
5403 5404
5404 HBasicBlock conditionStartBlock = conditionBranch.block; 5405 HBasicBlock conditionStartBlock = conditionBranch.block;
5405 conditionStartBlock.setBlockFlow(info, joinBlock); 5406 conditionStartBlock.setBlockFlow(info, joinBlock);
5406 SubGraph conditionGraph = conditionBranch.graph; 5407 SubGraph conditionGraph = conditionBranch.graph;
5407 HIf branch = conditionGraph.end.last; 5408 HIf branch = conditionGraph.end.last;
5408 assert(branch is HIf); 5409 assert(branch is HIf);
5409 branch.blockInformation = conditionStartBlock.blockFlow; 5410 branch.blockInformation = conditionStartBlock.blockFlow;
5410 } 5411 }
5411 } 5412 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/types/simple_types_inferrer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698