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

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

Issue 14636002: Make TypeMask an interface and start hiding implementation details of FlatTypeMask. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 7 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 class SsaCodeGeneratorTask extends CompilerTask { 7 class SsaCodeGeneratorTask extends CompilerTask {
8 8
9 final JavaScriptBackend backend; 9 final JavaScriptBackend backend;
10 10
(...skipping 1675 matching lines...) Expand 10 before | Expand all | Expand 10 after
1686 visitLocalGet(HLocalGet node) { 1686 visitLocalGet(HLocalGet node) {
1687 use(node.receiver); 1687 use(node.receiver);
1688 } 1688 }
1689 1689
1690 visitLocalSet(HLocalSet node) { 1690 visitLocalSet(HLocalSet node) {
1691 use(node.value); 1691 use(node.value);
1692 assignVariable(variableNames.getName(node.receiver), pop()); 1692 assignVariable(variableNames.getName(node.receiver), pop());
1693 } 1693 }
1694 1694
1695 void registerForeignType(HType type) { 1695 void registerForeignType(HType type) {
1696 // TODO(kasperl): This looks shaky. It makes sense if the type is 1696 // TODO(kasperl): This looks shaky. It makes sense if the type is
kasperl 2013/05/01 13:01:04 Should we remove the TODO?
ngeoffray 2013/05/01 13:16:40 Done.
1697 // exact, but otherwise we should be registering more types as 1697 // exact, but otherwise we should be registering more types as
1698 // instantiated. We should find a way of using something along the 1698 // instantiated. We should find a way of using something along the
1699 // lines of the NativeEnqueuerBase.processNativeBehavior method. 1699 // lines of the NativeEnqueuerBase.processNativeBehavior method.
1700 if (type.isUnknown()) return; 1700 if (type.isUnknown()) return;
1701 TypeMask mask = type.computeMask(compiler); 1701 TypeMask mask = type.computeMask(compiler);
1702 world.registerInstantiatedClass(mask.base.element, work.resolutionTree); 1702 for (ClassElement cls in mask.containedClasses(compiler)) {
1703 world.registerInstantiatedClass(cls, work.resolutionTree);
1704 }
1703 } 1705 }
1704 1706
1705 visitForeign(HForeign node) { 1707 visitForeign(HForeign node) {
1706 String code = node.code.slowToString(); 1708 String code = node.code.slowToString();
1707 List<HInstruction> inputs = node.inputs; 1709 List<HInstruction> inputs = node.inputs;
1708 if (node.isJsStatement()) { 1710 if (node.isJsStatement()) {
1709 if (!inputs.isEmpty) { 1711 if (!inputs.isEmpty) {
1710 compiler.internalError("foreign statement with inputs: $code", 1712 compiler.internalError("foreign statement with inputs: $code",
1711 instruction: node); 1713 instruction: node);
1712 } 1714 }
(...skipping 1269 matching lines...) Expand 10 before | Expand all | Expand 10 after
2982 if (leftType.canBeNull() && rightType.canBeNull()) { 2984 if (leftType.canBeNull() && rightType.canBeNull()) {
2983 if (left.isConstantNull() || right.isConstantNull() || 2985 if (left.isConstantNull() || right.isConstantNull() ||
2984 (leftType.isPrimitive() && leftType == rightType)) { 2986 (leftType.isPrimitive() && leftType == rightType)) {
2985 return '=='; 2987 return '==';
2986 } 2988 }
2987 return null; 2989 return null;
2988 } else { 2990 } else {
2989 return '==='; 2991 return '===';
2990 } 2992 }
2991 } 2993 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698