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

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

Issue 10913081: Fix resolution of type parameters in static context, and the use of type parameters in closures. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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/resolver.dart ('k') | tests/language/language.status » ('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 2508 matching lines...) Expand 10 before | Expand all | Expand 10 after
2519 target = new HInvokeSuper(inputs); 2519 target = new HInvokeSuper(inputs);
2520 add(target); 2520 add(target);
2521 inputs = <HInstruction>[target]; 2521 inputs = <HInstruction>[target];
2522 addDynamicSendArgumentsToList(node, inputs); 2522 addDynamicSendArgumentsToList(node, inputs);
2523 push(new HInvokeClosure(selector, inputs)); 2523 push(new HInvokeClosure(selector, inputs));
2524 } 2524 }
2525 } 2525 }
2526 2526
2527 HInstruction analyzeTypeArgument(DartType argument, Node currentNode) { 2527 HInstruction analyzeTypeArgument(DartType argument, Node currentNode) {
2528 if (argument.element.isTypeVariable()) { 2528 if (argument.element.isTypeVariable()) {
2529 if (work.element.isFactoryConstructor() 2529 Element member = work.element;
2530 || work.element.isGenerativeConstructor()) { 2530 if (member.enclosingElement.isClosure()) {
2531 member = (member.enclosingElement as ClosureClassElement).methodElement;
2532 member = member.getOutermostEnclosingMemberOrTopLevel();
2533 }
2534 if (member.isFactoryConstructor()) {
2531 // The type variable is stored in a parameter of the 2535 // The type variable is stored in a parameter of the
2532 // factory. 2536 // factory.
2533 return localsHandler.readLocal(argument.element); 2537 return localsHandler.readLocal(argument.element);
2534 } else if (work.element.isInstanceMember()) { 2538 } else if (member.isInstanceMember()
2539 || member.isGenerativeConstructor()) {
2535 // The type variable is stored in [this]. 2540 // The type variable is stored in [this].
2536 pushInvokeHelper1(interceptors.getGetRuntimeTypeInfo(), 2541 pushInvokeHelper1(interceptors.getGetRuntimeTypeInfo(),
2537 localsHandler.readThis()); 2542 localsHandler.readThis());
2538 HInstruction typeInfo = pop(); 2543 HInstruction typeInfo = pop();
2539 HInstruction foreign = new HForeign( 2544 HInstruction foreign = new HForeign(
2540 new LiteralDartString('#.$argument'), 2545 new LiteralDartString('#.$argument'),
2541 new LiteralDartString('String'), 2546 new LiteralDartString('String'),
2542 <HInstruction>[typeInfo]); 2547 <HInstruction>[typeInfo]);
2543 add(foreign); 2548 add(foreign);
2544 return foreign; 2549 return foreign;
(...skipping 1456 matching lines...) Expand 10 before | Expand all | Expand 10 after
4001 new HSubGraphBlockInformation(elseBranch.graph)); 4006 new HSubGraphBlockInformation(elseBranch.graph));
4002 4007
4003 HBasicBlock conditionStartBlock = conditionBranch.block; 4008 HBasicBlock conditionStartBlock = conditionBranch.block;
4004 conditionStartBlock.setBlockFlow(info, joinBlock); 4009 conditionStartBlock.setBlockFlow(info, joinBlock);
4005 SubGraph conditionGraph = conditionBranch.graph; 4010 SubGraph conditionGraph = conditionBranch.graph;
4006 HIf branch = conditionGraph.end.last; 4011 HIf branch = conditionGraph.end.last;
4007 assert(branch is HIf); 4012 assert(branch is HIf);
4008 branch.blockInformation = conditionStartBlock.blockFlow; 4013 branch.blockInformation = conditionStartBlock.blockFlow;
4009 } 4014 }
4010 } 4015 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/resolver.dart ('k') | tests/language/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698