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

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

Issue 10080003: Revert "Implement interface types." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 8 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 9
10 String generateMethod(WorkItem work, HGraph graph) { 10 String generateMethod(WorkItem work, HGraph graph) {
(...skipping 1447 matching lines...) Expand 10 before | Expand all | Expand 10 after
1458 beginExpression(JSPrecedence.LOGICAL_OR_PRECEDENCE); 1458 beginExpression(JSPrecedence.LOGICAL_OR_PRECEDENCE);
1459 checkArray(input, '==='); 1459 checkArray(input, '===');
1460 buffer.add(' || '); 1460 buffer.add(' || ');
1461 checkType(input, element); 1461 checkType(input, element);
1462 buffer.add(')'); 1462 buffer.add(')');
1463 endExpression(JSPrecedence.LOGICAL_OR_PRECEDENCE); 1463 endExpression(JSPrecedence.LOGICAL_OR_PRECEDENCE);
1464 endExpression(JSPrecedence.LOGICAL_AND_PRECEDENCE); 1464 endExpression(JSPrecedence.LOGICAL_AND_PRECEDENCE);
1465 } 1465 }
1466 1466
1467 void visitIs(HIs node) { 1467 void visitIs(HIs node) {
1468 Type type = node.typeName; 1468 Element element = node.typeExpression;
1469 Element element = type.element;
1470 if (element.kind === ElementKind.TYPE_VARIABLE) { 1469 if (element.kind === ElementKind.TYPE_VARIABLE) {
1471 compiler.unimplemented("visitIs for type variables"); 1470 compiler.unimplemented("visitIs for type variables");
1472 } else if (element.kind === ElementKind.TYPEDEF) {
1473 compiler.unimplemented("visitIs for typedefs");
1474 } 1471 }
1475 compiler.registerIsCheck(element); 1472 compiler.registerIsCheck(element);
1476 LibraryElement coreLibrary = compiler.coreLibrary; 1473 LibraryElement coreLibrary = compiler.coreLibrary;
1477 ClassElement objectClass = compiler.objectClass; 1474 ClassElement objectClass = coreLibrary.find(const SourceString('Object'));
1478 HInstruction input = node.expression; 1475 HInstruction input = node.expression;
1479 if (node.nullOk) { 1476 if (node.nullOk) {
1480 beginExpression(JSPrecedence.LOGICAL_OR_PRECEDENCE); 1477 beginExpression(JSPrecedence.LOGICAL_OR_PRECEDENCE);
1481 checkNull(input); 1478 checkNull(input);
1482 buffer.add(' || '); 1479 buffer.add(' || ');
1483 } 1480 }
1484 1481
1485 if (element === objectClass || element === compiler.dynamicClass) { 1482 if (element === objectClass || element === compiler.dynamicClass) {
1486 // The constant folder also does this optimization, but we make 1483 // The constant folder also does this optimization, but we make
1487 // it safe by assuming it may have not run. 1484 // it safe by assuming it may have not run.
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
1885 startBailoutSwitch(); 1882 startBailoutSwitch();
1886 } 1883 }
1887 } 1884 }
1888 1885
1889 void endElse(HIf node) { 1886 void endElse(HIf node) {
1890 if (node.elseBlock.hasGuards()) { 1887 if (node.elseBlock.hasGuards()) {
1891 endBailoutSwitch(); 1888 endBailoutSwitch();
1892 } 1889 }
1893 } 1890 }
1894 } 1891 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/ssa/builder.dart ('k') | lib/compiler/implementation/ssa/nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698