OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 <functional> | 5 #include <functional> |
6 | 6 |
7 #include "src/codegen.h" | 7 #include "src/codegen.h" |
8 #include "src/compiler/js-operator.h" | 8 #include "src/compiler/js-operator.h" |
9 #include "src/compiler/node-properties.h" | 9 #include "src/compiler/node-properties.h" |
10 #include "src/compiler/operator-properties.h" | 10 #include "src/compiler/operator-properties.h" |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 } while (!subtype->Is(type)); | 205 } while (!subtype->Is(type)); |
206 return subtype; | 206 return subtype; |
207 } | 207 } |
208 | 208 |
209 void TestBinaryMonotonicity(const Operator* op) { | 209 void TestBinaryMonotonicity(const Operator* op) { |
210 for (int i = 0; i < 50; ++i) { | 210 for (int i = 0; i < 50; ++i) { |
211 Type* type1 = types_.Fuzz(); | 211 Type* type1 = types_.Fuzz(); |
212 Type* type2 = types_.Fuzz(); | 212 Type* type2 = types_.Fuzz(); |
213 Type* type = TypeBinaryOp(op, type1, type2); | 213 Type* type = TypeBinaryOp(op, type1, type2); |
214 Type* subtype1 = RandomSubtype(type1); | 214 Type* subtype1 = RandomSubtype(type1); |
215 ; | |
216 Type* subtype2 = RandomSubtype(type2); | 215 Type* subtype2 = RandomSubtype(type2); |
217 ; | |
218 Type* subtype = TypeBinaryOp(op, subtype1, subtype2); | 216 Type* subtype = TypeBinaryOp(op, subtype1, subtype2); |
219 EXPECT_TRUE(subtype->Is(type)); | 217 EXPECT_TRUE(subtype->Is(type)); |
220 } | 218 } |
221 } | 219 } |
222 }; | 220 }; |
223 | 221 |
224 | 222 |
225 namespace { | 223 namespace { |
226 | 224 |
227 int32_t shift_left(int32_t x, int32_t y) { return x << y; } | 225 int32_t shift_left(int32_t x, int32_t y) { return x << y; } |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 | 410 |
413 | 411 |
414 TEST_F(TyperTest, TypeRegressInt32Constant) { | 412 TEST_F(TyperTest, TypeRegressInt32Constant) { |
415 int values[] = {-5, 10}; | 413 int values[] = {-5, 10}; |
416 for (auto i : values) { | 414 for (auto i : values) { |
417 Node* c = graph()->NewNode(common()->Int32Constant(i)); | 415 Node* c = graph()->NewNode(common()->Int32Constant(i)); |
418 Type* type = NodeProperties::GetType(c); | 416 Type* type = NodeProperties::GetType(c); |
419 EXPECT_TRUE(type->Is(NewRange(i, i))); | 417 EXPECT_TRUE(type->Is(NewRange(i, i))); |
420 } | 418 } |
421 } | 419 } |
OLD | NEW |