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

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

Issue 12764005: Get rid of old code for union/intersection in HType. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add comments. Created 7 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 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 1606 matching lines...) Expand 10 before | Expand all | Expand 10 after
1617 // TODO(kasperl): If we have a typed selector for the call, we 1617 // TODO(kasperl): If we have a typed selector for the call, we
1618 // may know something about the types of closures that need 1618 // may know something about the types of closures that need
1619 // the specific closure call method. 1619 // the specific closure call method.
1620 Selector call = new Selector.callClosureFrom(selector); 1620 Selector call = new Selector.callClosureFrom(selector);
1621 world.registerDynamicInvocation(call.name, call); 1621 world.registerDynamicInvocation(call.name, call);
1622 } 1622 }
1623 1623
1624 if (target != null) { 1624 if (target != null) {
1625 // If we know we're calling a specific method, register that 1625 // If we know we're calling a specific method, register that
1626 // method only. 1626 // method only.
1627 assert(selector.mask != null);
1628 world.registerDynamicInvocationOf(target, selector); 1627 world.registerDynamicInvocationOf(target, selector);
1629 } else { 1628 } else {
1630 SourceString name = node.selector.name; 1629 SourceString name = node.selector.name;
1631 world.registerDynamicInvocation(name, selector); 1630 world.registerDynamicInvocation(name, selector);
1632 } 1631 }
1633 registerInvoke(node, selector); 1632 registerInvoke(node, selector);
1634 } 1633 }
1635 1634
1636 void registerSetter(HInvokeDynamic node) { 1635 void registerSetter(HInvokeDynamic node) {
1637 Selector selector = getOptimizedSelectorFor(node, node.selector); 1636 Selector selector = getOptimizedSelectorFor(node, node.selector);
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
1732 DartType type = node.receiver.instructionType.computeType(compiler); 1731 DartType type = node.receiver.instructionType.computeType(compiler);
1733 if (type != null && !identical(type.kind, TypeKind.MALFORMED_TYPE)) { 1732 if (type != null && !identical(type.kind, TypeKind.MALFORMED_TYPE)) {
1734 world.registerFieldGetter(element); 1733 world.registerFieldGetter(element);
1735 } 1734 }
1736 } 1735 }
1737 } 1736 }
1738 1737
1739 visitFieldSet(HFieldSet node) { 1738 visitFieldSet(HFieldSet node) {
1740 Element element = node.element; 1739 Element element = node.element;
1741 String name = _fieldPropertyName(element); 1740 String name = _fieldPropertyName(element);
1742 DartType type = node.receiver.instructionType.computeType(compiler); 1741 if (!node.receiver.instructionType.isUnknown()) {
1743 if (type != null && !identical(type.kind, TypeKind.MALFORMED_TYPE)) {
1744 // Field setters in the generative constructor body are handled in a 1742 // Field setters in the generative constructor body are handled in a
1745 // step "SsaConstructionFieldTypes" in the ssa optimizer. 1743 // step "SsaConstructionFieldTypes" in the ssa optimizer.
1746 if (!work.element.isGenerativeConstructorBody()) { 1744 if (!work.element.isGenerativeConstructorBody()) {
1747 world.registerFieldSetter(element); 1745 world.registerFieldSetter(element);
1748 backend.registerFieldSetter( 1746 backend.registerFieldSetter(
1749 work.element, element, node.value.instructionType); 1747 work.element, element, node.value.instructionType);
1750 } 1748 }
1751 } 1749 }
1752 use(node.receiver); 1750 use(node.receiver);
1753 js.Expression receiver = pop(); 1751 js.Expression receiver = pop();
(...skipping 1213 matching lines...) Expand 10 before | Expand all | Expand 10 after
2967 if (leftType.canBeNull() && rightType.canBeNull()) { 2965 if (leftType.canBeNull() && rightType.canBeNull()) {
2968 if (left.isConstantNull() || right.isConstantNull() || 2966 if (left.isConstantNull() || right.isConstantNull() ||
2969 (leftType.isPrimitive() && leftType == rightType)) { 2967 (leftType.isPrimitive() && leftType == rightType)) {
2970 return '=='; 2968 return '==';
2971 } 2969 }
2972 return null; 2970 return null;
2973 } else { 2971 } else {
2974 return '==='; 2972 return '===';
2975 } 2973 }
2976 } 2974 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698