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/compiler/js-graph.h" | 5 #include "src/compiler/js-graph.h" |
6 #include "src/compiler/js-typed-lowering.h" | 6 #include "src/compiler/js-typed-lowering.h" |
7 #include "src/compiler/machine-operator.h" | 7 #include "src/compiler/machine-operator.h" |
8 #include "src/compiler/node-properties.h" | 8 #include "src/compiler/node-properties.h" |
9 #include "src/compiler/opcodes.h" | 9 #include "src/compiler/opcodes.h" |
10 #include "src/compiler/operator-properties.h" | 10 #include "src/compiler/operator-properties.h" |
(...skipping 924 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
935 TEST(OrderNumberBinopEffects1) { | 935 TEST(OrderNumberBinopEffects1) { |
936 JSTypedLoweringTester R; | 936 JSTypedLoweringTester R; |
937 | 937 |
938 const Operator* ops[] = { | 938 const Operator* ops[] = { |
939 R.javascript.Subtract(LanguageMode::SLOPPY), | 939 R.javascript.Subtract(LanguageMode::SLOPPY), |
940 R.simplified.NumberSubtract(), | 940 R.simplified.NumberSubtract(), |
941 R.javascript.Multiply(LanguageMode::SLOPPY), | 941 R.javascript.Multiply(LanguageMode::SLOPPY), |
942 R.simplified.NumberMultiply(), | 942 R.simplified.NumberMultiply(), |
943 R.javascript.Divide(LanguageMode::SLOPPY), | 943 R.javascript.Divide(LanguageMode::SLOPPY), |
944 R.simplified.NumberDivide(), | 944 R.simplified.NumberDivide(), |
945 R.javascript.Modulus(LanguageMode::SLOPPY), | |
946 R.simplified.NumberModulus(), | |
947 }; | 945 }; |
948 | 946 |
949 for (size_t j = 0; j < arraysize(ops); j += 2) { | 947 for (size_t j = 0; j < arraysize(ops); j += 2) { |
950 BinopEffectsTester B(ops[j], Type::Symbol(), Type::Symbol()); | 948 BinopEffectsTester B(ops[j], Type::Symbol(), Type::Symbol()); |
951 CHECK_EQ(ops[j + 1]->opcode(), B.result->op()->opcode()); | 949 CHECK_EQ(ops[j + 1]->opcode(), B.result->op()->opcode()); |
952 | 950 |
953 Node* i0 = B.CheckConvertedInput(IrOpcode::kJSToNumber, 0, true); | 951 Node* i0 = B.CheckConvertedInput(IrOpcode::kJSToNumber, 0, true); |
954 Node* i1 = B.CheckConvertedInput(IrOpcode::kJSToNumber, 1, true); | 952 Node* i1 = B.CheckConvertedInput(IrOpcode::kJSToNumber, 1, true); |
955 | 953 |
956 CHECK_EQ(B.p0, i0->InputAt(0)); | 954 CHECK_EQ(B.p0, i0->InputAt(0)); |
(...skipping 10 matching lines...) Expand all Loading... |
967 | 965 |
968 const Operator* ops[] = { | 966 const Operator* ops[] = { |
969 R.javascript.Add(LanguageMode::SLOPPY), | 967 R.javascript.Add(LanguageMode::SLOPPY), |
970 R.simplified.NumberAdd(), | 968 R.simplified.NumberAdd(), |
971 R.javascript.Subtract(LanguageMode::SLOPPY), | 969 R.javascript.Subtract(LanguageMode::SLOPPY), |
972 R.simplified.NumberSubtract(), | 970 R.simplified.NumberSubtract(), |
973 R.javascript.Multiply(LanguageMode::SLOPPY), | 971 R.javascript.Multiply(LanguageMode::SLOPPY), |
974 R.simplified.NumberMultiply(), | 972 R.simplified.NumberMultiply(), |
975 R.javascript.Divide(LanguageMode::SLOPPY), | 973 R.javascript.Divide(LanguageMode::SLOPPY), |
976 R.simplified.NumberDivide(), | 974 R.simplified.NumberDivide(), |
977 R.javascript.Modulus(LanguageMode::SLOPPY), | |
978 R.simplified.NumberModulus(), | |
979 }; | 975 }; |
980 | 976 |
981 for (size_t j = 0; j < arraysize(ops); j += 2) { | 977 for (size_t j = 0; j < arraysize(ops); j += 2) { |
982 BinopEffectsTester B(ops[j], Type::Number(), Type::Symbol()); | 978 BinopEffectsTester B(ops[j], Type::Number(), Type::Symbol()); |
983 | 979 |
984 Node* i0 = B.CheckNoOp(0); | 980 Node* i0 = B.CheckNoOp(0); |
985 Node* i1 = B.CheckConvertedInput(IrOpcode::kJSToNumber, 1, true); | 981 Node* i1 = B.CheckConvertedInput(IrOpcode::kJSToNumber, 1, true); |
986 | 982 |
987 CHECK_EQ(B.p0, i0); | 983 CHECK_EQ(B.p0, i0); |
988 CHECK_EQ(B.p1, i1->InputAt(0)); | 984 CHECK_EQ(B.p1, i1->InputAt(0)); |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1262 CHECK_EQ(p1, r->InputAt(0)); | 1258 CHECK_EQ(p1, r->InputAt(0)); |
1263 CHECK_EQ(p0, r->InputAt(1)); | 1259 CHECK_EQ(p0, r->InputAt(1)); |
1264 } else { | 1260 } else { |
1265 CHECK_EQ(p0, r->InputAt(0)); | 1261 CHECK_EQ(p0, r->InputAt(0)); |
1266 CHECK_EQ(p1, r->InputAt(1)); | 1262 CHECK_EQ(p1, r->InputAt(1)); |
1267 } | 1263 } |
1268 } | 1264 } |
1269 } | 1265 } |
1270 } | 1266 } |
1271 } | 1267 } |
OLD | NEW |