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

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

Issue 10697068: Change dart2js to follow the new spec on the equality operator. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 5 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 interface HVisitor<R> { 5 interface HVisitor<R> {
6 R visitAdd(HAdd node); 6 R visitAdd(HAdd node);
7 R visitBitAnd(HBitAnd node); 7 R visitBitAnd(HBitAnd node);
8 R visitBitNot(HBitNot node); 8 R visitBitNot(HBitNot node);
9 R visitBitOr(HBitOr node); 9 R visitBitOr(HBitOr node);
10 R visitBitXor(HBitXor node); 10 R visitBitXor(HBitXor node);
(...skipping 2024 matching lines...) Expand 10 before | Expand all | Expand 10 after
2035 2035
2036 class HEquals extends HRelational { 2036 class HEquals extends HRelational {
2037 HEquals(HStatic target, HInstruction left, HInstruction right) 2037 HEquals(HStatic target, HInstruction left, HInstruction right)
2038 : super(target, left, right); 2038 : super(target, left, right);
2039 accept(HVisitor visitor) => visitor.visitEquals(this); 2039 accept(HVisitor visitor) => visitor.visitEquals(this);
2040 2040
2041 bool get builtin() { 2041 bool get builtin() {
2042 // All primitive types have === semantics. 2042 // All primitive types have === semantics.
2043 // Note that this includes all constants except the user-constructed 2043 // Note that this includes all constants except the user-constructed
2044 // objects. 2044 // objects.
2045 return left.isConstantNull() || left.propagatedType.isPrimitive(); 2045 return left.propagatedType.isPrimitive() ||
2046 left.isConstantNull() ||
2047 right.isConstantNull();
2046 } 2048 }
2047 2049
2048 HType computeTypeFromInputTypes() { 2050 HType computeTypeFromInputTypes() {
2049 if (builtin || usesBoolifiedInterceptor) return HType.BOOLEAN; 2051 if (builtin || usesBoolifiedInterceptor) return HType.BOOLEAN;
2050 return HType.UNKNOWN; 2052 return HType.UNKNOWN;
2051 } 2053 }
2052 2054
2053 HType computeDesiredTypeForNonTargetInput(HInstruction input) { 2055 HType computeDesiredTypeForNonTargetInput(HInstruction input) {
2054 if (input == left && right.propagatedType.isUseful()) { 2056 if (input == left && right.propagatedType.isUseful()) {
2055 // All our useful types have === semantics. But we don't want to 2057 // All our useful types have === semantics. But we don't want to
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after
2659 HBasicBlock get start() => expression.start; 2661 HBasicBlock get start() => expression.start;
2660 HBasicBlock get end() { 2662 HBasicBlock get end() {
2661 // We don't create a switch block if there are no cases. 2663 // We don't create a switch block if there are no cases.
2662 assert(!statements.isEmpty()); 2664 assert(!statements.isEmpty());
2663 return statements.last().end; 2665 return statements.last().end;
2664 } 2666 }
2665 2667
2666 bool accept(HStatementInformationVisitor visitor) => 2668 bool accept(HStatementInformationVisitor visitor) =>
2667 visitor.visitSwitchInfo(this); 2669 visitor.visitSwitchInfo(this);
2668 } 2670 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698