| 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/linkage.h" | 6 #include "src/compiler/linkage.h" |
| 7 #include "src/compiler/liveness-analyzer.h" | 7 #include "src/compiler/liveness-analyzer.h" |
| 8 #include "src/compiler/node-matchers.h" | 8 #include "src/compiler/node-matchers.h" |
| 9 #include "src/compiler/state-values-utils.h" | 9 #include "src/compiler/state-values-utils.h" |
| 10 #include "test/unittests/compiler/graph-unittest.h" | 10 #include "test/unittests/compiler/graph-unittest.h" |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 << " but should have been " << empty_values_ << " (empty)"; | 108 << " but should have been " << empty_values_ << " (empty)"; |
| 109 return false; | 109 return false; |
| 110 } | 110 } |
| 111 StateValuesAccess locals(frame_state->InputAt(1)); | 111 StateValuesAccess locals(frame_state->InputAt(1)); |
| 112 if (locals_count_ != static_cast<int>(locals.size())) { | 112 if (locals_count_ != static_cast<int>(locals.size())) { |
| 113 *listener << "whose number of locals is " << locals.size() | 113 *listener << "whose number of locals is " << locals.size() |
| 114 << " but should have been " << locals_count_; | 114 << " but should have been " << locals_count_; |
| 115 return false; | 115 return false; |
| 116 } | 116 } |
| 117 int i = 0; | 117 int i = 0; |
| 118 for (Node* value : locals) { | 118 for (StateValuesAccess::TypedNode value : locals) { |
| 119 if (liveness_[i] == 'L') { | 119 if (liveness_[i] == 'L') { |
| 120 StringMatchResultListener value_listener; | 120 StringMatchResultListener value_listener; |
| 121 if (value == replacement_) { | 121 if (value.node == replacement_) { |
| 122 *listener << "whose local #" << i << " was " << value->opcode() | 122 *listener << "whose local #" << i << " was " << value.node->opcode() |
| 123 << " but should have been 'undefined'"; | 123 << " but should have been 'undefined'"; |
| 124 return false; | 124 return false; |
| 125 } else if (!IsInt32Constant(first_const + i) | 125 } else if (!IsInt32Constant(first_const + i) |
| 126 .MatchAndExplain(value, &value_listener)) { | 126 .MatchAndExplain(value.node, &value_listener)) { |
| 127 *listener << "whose local #" << i << " does not match"; | 127 *listener << "whose local #" << i << " does not match"; |
| 128 if (value_listener.str() != "") { | 128 if (value_listener.str() != "") { |
| 129 *listener << ", " << value_listener.str(); | 129 *listener << ", " << value_listener.str(); |
| 130 } | 130 } |
| 131 return false; | 131 return false; |
| 132 } | 132 } |
| 133 } else if (liveness_[i] == '.') { | 133 } else if (liveness_[i] == '.') { |
| 134 if (value != replacement_) { | 134 if (value.node != replacement_) { |
| 135 *listener << "whose local #" << i << " is " << value | 135 *listener << "whose local #" << i << " is " << value.node |
| 136 << " but should have been " << replacement_ | 136 << " but should have been " << replacement_ |
| 137 << " (undefined)"; | 137 << " (undefined)"; |
| 138 return false; | 138 return false; |
| 139 } | 139 } |
| 140 } else { | 140 } else { |
| 141 UNREACHABLE(); | 141 UNREACHABLE(); |
| 142 } | 142 } |
| 143 i++; | 143 i++; |
| 144 } | 144 } |
| 145 return true; | 145 return true; |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 EXPECT_THAT(c1_in_loop, IsCheckpointModuloLiveness(".L.L")); | 364 EXPECT_THAT(c1_in_loop, IsCheckpointModuloLiveness(".L.L")); |
| 365 EXPECT_THAT(c2_in_loop, IsCheckpointModuloLiveness("LL.L")); | 365 EXPECT_THAT(c2_in_loop, IsCheckpointModuloLiveness("LL.L")); |
| 366 | 366 |
| 367 EXPECT_THAT(c1_end, IsCheckpointModuloLiveness(".LL.")); | 367 EXPECT_THAT(c1_end, IsCheckpointModuloLiveness(".LL.")); |
| 368 EXPECT_THAT(c2_end, IsCheckpointModuloLiveness("....")); | 368 EXPECT_THAT(c2_end, IsCheckpointModuloLiveness("....")); |
| 369 } | 369 } |
| 370 | 370 |
| 371 } // namespace compiler | 371 } // namespace compiler |
| 372 } // namespace internal | 372 } // namespace internal |
| 373 } // namespace v8 | 373 } // namespace v8 |
| OLD | NEW |