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" |
11 #include "test/cctest/types-fuzz.h" | 11 #include "test/cctest/types-fuzz.h" |
12 #include "test/unittests/compiler/graph-unittest.h" | 12 #include "test/unittests/compiler/graph-unittest.h" |
13 | 13 |
14 using namespace v8::internal; | 14 namespace v8 { |
15 using namespace v8::internal::compiler; | 15 namespace internal { |
16 | 16 namespace compiler { |
17 | 17 |
18 // TODO(titzer): generate a large set of deterministic inputs for these tests. | 18 // TODO(titzer): generate a large set of deterministic inputs for these tests. |
19 class TyperTest : public TypedGraphTest { | 19 class TyperTest : public TypedGraphTest { |
20 public: | 20 public: |
21 TyperTest() | 21 TyperTest() |
22 : TypedGraphTest(3), | 22 : TypedGraphTest(3), |
23 types_(zone(), isolate(), random_number_generator()), | 23 types_(zone(), isolate(), random_number_generator()), |
24 javascript_(zone()) { | 24 javascript_(zone()) { |
25 context_node_ = graph()->NewNode(common()->Parameter(2), graph()->start()); | 25 context_node_ = graph()->NewNode(common()->Parameter(2), graph()->start()); |
26 rng_ = random_number_generator(); | 26 rng_ = random_number_generator(); |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 | 410 |
411 | 411 |
412 TEST_F(TyperTest, TypeRegressInt32Constant) { | 412 TEST_F(TyperTest, TypeRegressInt32Constant) { |
413 int values[] = {-5, 10}; | 413 int values[] = {-5, 10}; |
414 for (auto i : values) { | 414 for (auto i : values) { |
415 Node* c = graph()->NewNode(common()->Int32Constant(i)); | 415 Node* c = graph()->NewNode(common()->Int32Constant(i)); |
416 Type* type = NodeProperties::GetType(c); | 416 Type* type = NodeProperties::GetType(c); |
417 EXPECT_TRUE(type->Is(NewRange(i, i))); | 417 EXPECT_TRUE(type->Is(NewRange(i, i))); |
418 } | 418 } |
419 } | 419 } |
| 420 |
| 421 } // namespace compiler |
| 422 } // namespace internal |
| 423 } // namespace v8 |
OLD | NEW |