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

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
1697 // exact, but otherwise we should be registering more types as
1698 // instantiated. We should find a way of using something along the
1699 // lines of the NativeEnqueuerBase.processNativeBehavior method.
1700 if (type.isUnknown()) return; 1696 if (type.isUnknown()) return;
1701 TypeMask mask = type.computeMask(compiler); 1697 TypeMask mask = type.computeMask(compiler);
1702 world.registerInstantiatedClass(mask.base.element, work.resolutionTree); 1698 for (ClassElement cls in mask.containedClasses(compiler)) {
1699 world.registerInstantiatedClass(cls, work.resolutionTree);
1700 }
1703 } 1701 }
1704 1702
1705 visitForeign(HForeign node) { 1703 visitForeign(HForeign node) {
1706 String code = node.code.slowToString(); 1704 String code = node.code.slowToString();
1707 List<HInstruction> inputs = node.inputs; 1705 List<HInstruction> inputs = node.inputs;
1708 if (node.isJsStatement()) { 1706 if (node.isJsStatement()) {
1709 if (!inputs.isEmpty) { 1707 if (!inputs.isEmpty) {
1710 compiler.internalError("foreign statement with inputs: $code", 1708 compiler.internalError("foreign statement with inputs: $code",
1711 instruction: node); 1709 instruction: node);
1712 } 1710 }
(...skipping 1269 matching lines...) Expand 10 before | Expand all | Expand 10 after
2982 if (leftType.canBeNull() && rightType.canBeNull()) { 2980 if (leftType.canBeNull() && rightType.canBeNull()) {
2983 if (left.isConstantNull() || right.isConstantNull() || 2981 if (left.isConstantNull() || right.isConstantNull() ||
2984 (leftType.isPrimitive() && leftType == rightType)) { 2982 (leftType.isPrimitive() && leftType == rightType)) {
2985 return '=='; 2983 return '==';
2986 } 2984 }
2987 return null; 2985 return null;
2988 } else { 2986 } else {
2989 return '==='; 2987 return '===';
2990 } 2988 }
2991 } 2989 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698