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

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

Issue 34963002: Fix another closure/type variable error by using analyzeTypeVariables. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 2 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
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 1872 matching lines...) Expand 10 before | Expand all | Expand 10 after
1883 return new HTypeConversion.withTypeRepresentation(type, kind, subtype, 1883 return new HTypeConversion.withTypeRepresentation(type, kind, subtype,
1884 original, typeVariable); 1884 original, typeVariable);
1885 } else if (type.kind == TypeKind.FUNCTION) { 1885 } else if (type.kind == TypeKind.FUNCTION) {
1886 if (backend.rti.isSimpleFunctionType(type)) { 1886 if (backend.rti.isSimpleFunctionType(type)) {
1887 return original.convertType(compiler, type, kind); 1887 return original.convertType(compiler, type, kind);
1888 } 1888 }
1889 HType subtype = original.instructionType; 1889 HType subtype = original.instructionType;
1890 if (type.containsTypeVariables) { 1890 if (type.containsTypeVariables) {
1891 bool contextIsTypeArguments = false; 1891 bool contextIsTypeArguments = false;
1892 HInstruction context; 1892 HInstruction context;
1893 if (currentElement.isInstanceMember()) { 1893 if (!currentElement.enclosingElement.isClosure()
1894 && currentElement.isInstanceMember()) {
1894 context = localsHandler.readThis(); 1895 context = localsHandler.readThis();
1895 } else { 1896 } else {
1896 ClassElement contextClass = Types.getClassContext(type); 1897 ClassElement contextClass = Types.getClassContext(type);
1897 context = buildTypeVariableList(contextClass); 1898 context = buildTypeVariableList(contextClass);
1898 add(context); 1899 add(context);
1899 contextIsTypeArguments = true; 1900 contextIsTypeArguments = true;
1900 } 1901 }
1901 return new HTypeConversion.withContext(type, kind, subtype, 1902 return new HTypeConversion.withContext(type, kind, subtype,
1902 original, context, contextIsTypeArguments: contextIsTypeArguments); 1903 original, context, contextIsTypeArguments: contextIsTypeArguments);
1903 } else { 1904 } else {
(...skipping 1023 matching lines...) Expand 10 before | Expand all | Expand 10 after
2927 node, compiler); 2928 node, compiler);
2928 2929
2929 HInstruction contextName; 2930 HInstruction contextName;
2930 HInstruction context; 2931 HInstruction context;
2931 HInstruction typeArguments; 2932 HInstruction typeArguments;
2932 if (type.containsTypeVariables) { 2933 if (type.containsTypeVariables) {
2933 ClassElement contextClass = Types.getClassContext(type); 2934 ClassElement contextClass = Types.getClassContext(type);
2934 contextName = graph.addConstantString( 2935 contextName = graph.addConstantString(
2935 new DartString.literal(backend.namer.getNameOfClass(contextClass)), 2936 new DartString.literal(backend.namer.getNameOfClass(contextClass)),
2936 node, compiler); 2937 node, compiler);
2937 if (currentElement.isInstanceMember()) { 2938 if (!currentElement.enclosingElement.isClosure()
2939 && currentElement.isInstanceMember()) {
2938 context = localsHandler.readThis(); 2940 context = localsHandler.readThis();
2939 typeArguments = graph.addConstantNull(compiler); 2941 typeArguments = graph.addConstantNull(compiler);
2940 } else { 2942 } else {
2941 context = graph.addConstantNull(compiler); 2943 context = graph.addConstantNull(compiler);
2942 typeArguments = buildTypeVariableList(contextClass); 2944 typeArguments = buildTypeVariableList(contextClass);
2943 add(typeArguments); 2945 add(typeArguments);
2944 } 2946 }
2945 } else { 2947 } else {
2946 contextName = graph.addConstantNull(compiler); 2948 contextName = graph.addConstantNull(compiler);
2947 context = graph.addConstantNull(compiler); 2949 context = graph.addConstantNull(compiler);
(...skipping 2638 matching lines...) Expand 10 before | Expand all | Expand 10 after
5586 new HSubGraphBlockInformation(elseBranch.graph)); 5588 new HSubGraphBlockInformation(elseBranch.graph));
5587 5589
5588 HBasicBlock conditionStartBlock = conditionBranch.block; 5590 HBasicBlock conditionStartBlock = conditionBranch.block;
5589 conditionStartBlock.setBlockFlow(info, joinBlock); 5591 conditionStartBlock.setBlockFlow(info, joinBlock);
5590 SubGraph conditionGraph = conditionBranch.graph; 5592 SubGraph conditionGraph = conditionBranch.graph;
5591 HIf branch = conditionGraph.end.last; 5593 HIf branch = conditionGraph.end.last;
5592 assert(branch is HIf); 5594 assert(branch is HIf);
5593 branch.blockInformation = conditionStartBlock.blockFlow; 5595 branch.blockInformation = conditionStartBlock.blockFlow;
5594 } 5596 }
5595 } 5597 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698