OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/compilation-dependencies.h" | 5 #include "src/compilation-dependencies.h" |
6 #include "src/compiler/js-graph.h" | 6 #include "src/compiler/js-graph.h" |
7 #include "src/compiler/js-typed-lowering.h" | 7 #include "src/compiler/js-typed-lowering.h" |
8 #include "src/compiler/machine-operator.h" | 8 #include "src/compiler/machine-operator.h" |
9 #include "src/compiler/node-properties.h" | 9 #include "src/compiler/node-properties.h" |
10 #include "src/compiler/opcodes.h" | 10 #include "src/compiler/opcodes.h" |
(...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
817 Node* p1 = j == 1 ? l : r; | 817 Node* p1 = j == 1 ? l : r; |
818 | 818 |
819 { | 819 { |
820 const Operator* op = | 820 const Operator* op = |
821 strict ? R->javascript.StrictEqual(CompareOperationHint::kAny) | 821 strict ? R->javascript.StrictEqual(CompareOperationHint::kAny) |
822 : R->javascript.Equal(CompareOperationHint::kAny); | 822 : R->javascript.Equal(CompareOperationHint::kAny); |
823 Node* eq = R->Binop(op, p0, p1); | 823 Node* eq = R->Binop(op, p0, p1); |
824 Node* r = R->reduce(eq); | 824 Node* r = R->reduce(eq); |
825 R->CheckBinop(expected, r); | 825 R->CheckBinop(expected, r); |
826 } | 826 } |
827 | |
828 { | |
829 const Operator* op = | |
830 strict ? R->javascript.StrictNotEqual(CompareOperationHint::kAny) | |
831 : R->javascript.NotEqual(CompareOperationHint::kAny); | |
832 Node* ne = R->Binop(op, p0, p1); | |
833 Node* n = R->reduce(ne); | |
834 CHECK_EQ(IrOpcode::kBooleanNot, n->opcode()); | |
835 Node* r = n->InputAt(0); | |
836 R->CheckBinop(expected, r); | |
837 } | |
838 } | 827 } |
839 } | 828 } |
840 | 829 |
841 | 830 |
842 TEST(EqualityForNumbers) { | 831 TEST(EqualityForNumbers) { |
843 JSTypedLoweringTester R; | 832 JSTypedLoweringTester R; |
844 | 833 |
845 Type* simple_number_types[] = {Type::UnsignedSmall(), Type::SignedSmall(), | 834 Type* simple_number_types[] = {Type::UnsignedSmall(), Type::SignedSmall(), |
846 Type::Signed32(), Type::Unsigned32(), | 835 Type::Signed32(), Type::Unsigned32(), |
847 Type::Number()}; | 836 Type::Number()}; |
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1243 CHECK_EQ(p1, r->InputAt(1)); | 1232 CHECK_EQ(p1, r->InputAt(1)); |
1244 } | 1233 } |
1245 } | 1234 } |
1246 } | 1235 } |
1247 } | 1236 } |
1248 } | 1237 } |
1249 | 1238 |
1250 } // namespace compiler | 1239 } // namespace compiler |
1251 } // namespace internal | 1240 } // namespace internal |
1252 } // namespace v8 | 1241 } // namespace v8 |
OLD | NEW |