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 <limits> | 5 #include <limits> |
6 | 6 |
7 #include "src/v8.h" | 7 #include "src/v8.h" |
8 #include "test/cctest/cctest.h" | 8 #include "test/cctest/cctest.h" |
9 #include "test/cctest/compiler/codegen-tester.h" | 9 #include "test/cctest/compiler/codegen-tester.h" |
10 #include "test/cctest/compiler/graph-builder-tester.h" | 10 #include "test/cctest/compiler/graph-builder-tester.h" |
11 #include "test/cctest/compiler/value-helper.h" | 11 #include "test/cctest/compiler/value-helper.h" |
12 | 12 |
13 #include "src/compiler/node-matchers.h" | 13 #include "src/compiler/node-matchers.h" |
14 #include "src/compiler/representation-change.h" | 14 #include "src/compiler/representation-change.h" |
15 | 15 |
16 using namespace v8::internal; | 16 using namespace v8::internal; |
17 using namespace v8::internal::compiler; | 17 using namespace v8::internal::compiler; |
18 | 18 |
19 namespace v8 { // for friendiness. | 19 namespace v8 { // for friendiness. |
20 namespace internal { | 20 namespace internal { |
21 namespace compiler { | 21 namespace compiler { |
22 | 22 |
23 class RepresentationChangerTester : public HandleAndZoneScope, | 23 class RepresentationChangerTester : public HandleAndZoneScope, |
24 public GraphAndBuilders { | 24 public GraphAndBuilders { |
25 public: | 25 public: |
26 explicit RepresentationChangerTester(int num_parameters = 0) | 26 explicit RepresentationChangerTester(int num_parameters = 0) |
27 : GraphAndBuilders(main_zone()), | 27 : GraphAndBuilders(main_zone()), |
28 javascript_(main_zone()), | 28 javascript_(main_zone()), |
29 jsgraph_(main_isolate(), main_graph_, &main_common_, &javascript_, | 29 jsgraph_(main_isolate(), main_graph_, &main_common_, &javascript_, |
30 &main_machine_), | 30 nullptr, &main_machine_), |
31 changer_(&jsgraph_, &main_simplified_, main_isolate()) { | 31 changer_(&jsgraph_, &main_simplified_, main_isolate()) { |
32 Node* s = graph()->NewNode(common()->Start(num_parameters)); | 32 Node* s = graph()->NewNode(common()->Start(num_parameters)); |
33 graph()->SetStart(s); | 33 graph()->SetStart(s); |
34 } | 34 } |
35 | 35 |
36 JSOperatorBuilder javascript_; | 36 JSOperatorBuilder javascript_; |
37 JSGraph jsgraph_; | 37 JSGraph jsgraph_; |
38 RepresentationChanger changer_; | 38 RepresentationChanger changer_; |
39 | 39 |
40 Isolate* isolate() { return main_isolate(); } | 40 Isolate* isolate() { return main_isolate(); } |
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
544 r.CheckTypeError(kRepWord32 | kTypeUint32, kRepWord64); | 544 r.CheckTypeError(kRepWord32 | kTypeUint32, kRepWord64); |
545 | 545 |
546 for (size_t i = 0; i < arraysize(all_reps); i++) { | 546 for (size_t i = 0; i < arraysize(all_reps); i++) { |
547 for (size_t j = 0; j < arraysize(all_reps); j++) { | 547 for (size_t j = 0; j < arraysize(all_reps); j++) { |
548 if (i == j) continue; | 548 if (i == j) continue; |
549 // Only a single from representation is allowed. | 549 // Only a single from representation is allowed. |
550 r.CheckTypeError(all_reps[i] | all_reps[j], kRepTagged); | 550 r.CheckTypeError(all_reps[i] | all_reps[j], kRepTagged); |
551 } | 551 } |
552 } | 552 } |
553 } | 553 } |
OLD | NEW |