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

Side by Side Diff: frog/leg/ssa/codegen.dart

Issue 9616058: Implement parsing and resolving of type-variables. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 8 years, 9 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 class SsaCodeGeneratorTask extends CompilerTask { 5 class SsaCodeGeneratorTask extends CompilerTask {
6 SsaCodeGeneratorTask(Compiler compiler) : super(compiler); 6 SsaCodeGeneratorTask(Compiler compiler) : super(compiler);
7 String get name() => 'SSA code generator'; 7 String get name() => 'SSA code generator';
8 8
9 String generate(WorkItem work, HGraph graph) { 9 String generate(WorkItem work, HGraph graph) {
10 return measure(() { 10 return measure(() {
(...skipping 953 matching lines...) Expand 10 before | Expand all | Expand 10 after
964 964
965 void checkType(HInstruction input, Element element) { 965 void checkType(HInstruction input, Element element) {
966 buffer.add('!!'); 966 buffer.add('!!');
967 use(input, JSPrecedence.MEMBER_PRECEDENCE); 967 use(input, JSPrecedence.MEMBER_PRECEDENCE);
968 buffer.add('.'); 968 buffer.add('.');
969 buffer.add(compiler.namer.operatorIs(element)); 969 buffer.add(compiler.namer.operatorIs(element));
970 } 970 }
971 971
972 void visitIs(HIs node) { 972 void visitIs(HIs node) {
973 Element element = node.typeExpression; 973 Element element = node.typeExpression;
974 if (node.typeExpression.kind === ElementKind.TYPE_VARIABLE) {
975 compiler.unimplemented("visitIs for type variables");
ngeoffray 2012/03/18 13:40:57 Do we actually end up here if the builder says uni
976 }
974 compiler.registerIsCheck(element); 977 compiler.registerIsCheck(element);
975 LibraryElement coreLibrary = compiler.coreLibrary; 978 LibraryElement coreLibrary = compiler.coreLibrary;
976 ClassElement objectClass = coreLibrary.find(const SourceString('Object')); 979 ClassElement objectClass = coreLibrary.find(const SourceString('Object'));
977 HInstruction input = node.expression; 980 HInstruction input = node.expression;
978 if (node.nullOk) { 981 if (node.nullOk) {
979 beginExpression(JSPrecedence.LOGICAL_OR_PRECEDENCE); 982 beginExpression(JSPrecedence.LOGICAL_OR_PRECEDENCE);
980 checkNull(input); 983 checkNull(input);
981 buffer.add(' || '); 984 buffer.add(' || ');
982 } 985 }
983 if (element == objectClass) { 986 if (element == objectClass) {
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after
1431 startBailoutSwitch(); 1434 startBailoutSwitch();
1432 } 1435 }
1433 } 1436 }
1434 1437
1435 void endElse(HIf node) { 1438 void endElse(HIf node) {
1436 if (node.elseBlock.hasBailouts()) { 1439 if (node.elseBlock.hasBailouts()) {
1437 endBailoutSwitch(); 1440 endBailoutSwitch();
1438 } 1441 }
1439 } 1442 }
1440 } 1443 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698