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 "test/cctest/cctest.h" | 7 #include "test/cctest/cctest.h" |
8 #include "test/cctest/compiler/codegen-tester.h" | 8 #include "test/cctest/compiler/codegen-tester.h" |
9 #include "test/cctest/compiler/graph-builder-tester.h" | 9 #include "test/cctest/compiler/graph-builder-tester.h" |
10 #include "test/cctest/compiler/value-helper.h" | 10 #include "test/cctest/compiler/value-helper.h" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 CHECK_DOUBLE_EQ(expected, m.Value()); | 77 CHECK_DOUBLE_EQ(expected, m.Value()); |
78 } | 78 } |
79 | 79 |
80 Node* Parameter(int index = 0) { | 80 Node* Parameter(int index = 0) { |
81 Node* n = graph()->NewNode(common()->Parameter(index), graph()->start()); | 81 Node* n = graph()->NewNode(common()->Parameter(index), graph()->start()); |
82 NodeProperties::SetType(n, Type::Any()); | 82 NodeProperties::SetType(n, Type::Any()); |
83 return n; | 83 return n; |
84 } | 84 } |
85 | 85 |
86 Node* Return(Node* input) { | 86 Node* Return(Node* input) { |
87 Node* n = graph()->NewNode(common()->Return(), input, graph()->start(), | 87 Node* n = graph()->NewNode(common()->Return(), jsgraph()->Int32Constant(0), |
88 graph()->start()); | 88 input, graph()->start(), graph()->start()); |
89 return n; | 89 return n; |
90 } | 90 } |
91 | 91 |
92 void CheckTypeError(MachineRepresentation from, Type* from_type, | 92 void CheckTypeError(MachineRepresentation from, Type* from_type, |
93 MachineRepresentation to) { | 93 MachineRepresentation to) { |
94 changer()->testing_type_errors_ = true; | 94 changer()->testing_type_errors_ = true; |
95 changer()->type_error_ = false; | 95 changer()->type_error_ = false; |
96 Node* n = Parameter(0); | 96 Node* n = Parameter(0); |
97 Node* use = Return(n); | 97 Node* use = Return(n); |
98 Node* c = changer()->GetRepresentationFor(n, from, from_type, use, | 98 Node* c = changer()->GetRepresentationFor(n, from, from_type, use, |
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 MachineRepresentation::kWord64); | 531 MachineRepresentation::kWord64); |
532 r.CheckTypeError(MachineRepresentation::kWord32, Type::Signed32(), | 532 r.CheckTypeError(MachineRepresentation::kWord32, Type::Signed32(), |
533 MachineRepresentation::kWord64); | 533 MachineRepresentation::kWord64); |
534 r.CheckTypeError(MachineRepresentation::kWord32, Type::Unsigned32(), | 534 r.CheckTypeError(MachineRepresentation::kWord32, Type::Unsigned32(), |
535 MachineRepresentation::kWord64); | 535 MachineRepresentation::kWord64); |
536 } | 536 } |
537 | 537 |
538 } // namespace compiler | 538 } // namespace compiler |
539 } // namespace internal | 539 } // namespace internal |
540 } // namespace v8 | 540 } // namespace v8 |
OLD | NEW |