| 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" | 
| 11 #include "test/unittests/compiler/node-test-utils.h" | 11 #include "test/unittests/compiler/node-test-utils.h" | 
| 12 | 12 | 
| 13 using testing::MakeMatcher; | 13 using testing::MakeMatcher; | 
| 14 using testing::MatcherInterface; | 14 using testing::MatcherInterface; | 
| 15 using testing::MatchResultListener; | 15 using testing::MatchResultListener; | 
| 16 using testing::StringMatchResultListener; | 16 using testing::StringMatchResultListener; | 
| 17 | 17 | 
| 18 namespace v8 { | 18 namespace v8 { | 
| 19 namespace internal { | 19 namespace internal { | 
| 20 namespace compiler { | 20 namespace compiler { | 
| 21 | 21 | 
| 22 class LivenessAnalysisTest : public GraphTest { | 22 class LivenessAnalysisTest : public GraphTest { | 
| 23  public: | 23  public: | 
| 24   explicit LivenessAnalysisTest(int locals_count = 4) | 24   explicit LivenessAnalysisTest(int locals_count = 4) | 
| 25       : locals_count_(locals_count), | 25       : locals_count_(locals_count), | 
| 26         machine_(zone(), kRepWord32), | 26         machine_(zone(), kRepWord32), | 
| 27         javascript_(zone()), | 27         javascript_(zone()), | 
| 28         jsgraph_(isolate(), graph(), common(), &javascript_, &machine_), | 28         jsgraph_(isolate(), graph(), common(), &javascript_, nullptr, | 
|  | 29                  &machine_), | 
| 29         analyzer_(locals_count, zone()), | 30         analyzer_(locals_count, zone()), | 
| 30         empty_values_(graph()->NewNode(common()->StateValues(0), 0, nullptr)), | 31         empty_values_(graph()->NewNode(common()->StateValues(0), 0, nullptr)), | 
| 31         next_checkpoint_id_(0), | 32         next_checkpoint_id_(0), | 
| 32         current_block_(nullptr) {} | 33         current_block_(nullptr) {} | 
| 33 | 34 | 
| 34 | 35 | 
| 35  protected: | 36  protected: | 
| 36   JSGraph* jsgraph() { return &jsgraph_; } | 37   JSGraph* jsgraph() { return &jsgraph_; } | 
| 37 | 38 | 
| 38   LivenessAnalyzer* analyzer() { return &analyzer_; } | 39   LivenessAnalyzer* analyzer() { return &analyzer_; } | 
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 369   EXPECT_THAT(c1_in_loop, IsCheckpointModuloLiveness(".L.L")); | 370   EXPECT_THAT(c1_in_loop, IsCheckpointModuloLiveness(".L.L")); | 
| 370   EXPECT_THAT(c2_in_loop, IsCheckpointModuloLiveness("LL.L")); | 371   EXPECT_THAT(c2_in_loop, IsCheckpointModuloLiveness("LL.L")); | 
| 371 | 372 | 
| 372   EXPECT_THAT(c1_end, IsCheckpointModuloLiveness(".LL.")); | 373   EXPECT_THAT(c1_end, IsCheckpointModuloLiveness(".LL.")); | 
| 373   EXPECT_THAT(c2_end, IsCheckpointModuloLiveness("....")); | 374   EXPECT_THAT(c2_end, IsCheckpointModuloLiveness("....")); | 
| 374 } | 375 } | 
| 375 | 376 | 
| 376 }  // namespace compiler | 377 }  // namespace compiler | 
| 377 }  // namespace internal | 378 }  // namespace internal | 
| 378 }  // namespace v8 | 379 }  // namespace v8 | 
| OLD | NEW | 
|---|