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 // TODO(jochen): Remove this after the setting is turned on globally. | 5 // TODO(jochen): Remove this after the setting is turned on globally. |
6 #define V8_IMMINENT_DEPRECATION_WARNINGS | 6 #define V8_IMMINENT_DEPRECATION_WARNINGS |
7 | 7 |
8 #include "src/compiler/gap-resolver.h" | 8 #include "src/compiler/gap-resolver.h" |
9 | 9 |
10 #include "src/base/utils/random-number-generator.h" | 10 #include "src/base/utils/random-number-generator.h" |
11 #include "test/cctest/cctest.h" | 11 #include "test/cctest/cctest.h" |
12 | 12 |
13 using namespace v8::internal; | 13 namespace v8 { |
14 using namespace v8::internal::compiler; | 14 namespace internal { |
| 15 namespace compiler { |
15 | 16 |
16 // The state of our move interpreter is the mapping of operands to values. Note | 17 // The state of our move interpreter is the mapping of operands to values. Note |
17 // that the actual values don't really matter, all we care about is equality. | 18 // that the actual values don't really matter, all we care about is equality. |
18 class InterpreterState { | 19 class InterpreterState { |
19 public: | 20 public: |
20 void ExecuteInParallel(const ParallelMove* moves) { | 21 void ExecuteInParallel(const ParallelMove* moves) { |
21 InterpreterState copy(*this); | 22 InterpreterState copy(*this); |
22 for (const auto m : *moves) { | 23 for (const auto m : *moves) { |
23 if (!m->IsRedundant()) write(m->destination(), copy.read(m->source())); | 24 if (!m->IsRedundant()) write(m->destination(), copy.read(m->source())); |
24 } | 25 } |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 mi1.AssembleParallelMove(pm); | 249 mi1.AssembleParallelMove(pm); |
249 | 250 |
250 MoveInterpreter mi2(pmc.main_zone()); | 251 MoveInterpreter mi2(pmc.main_zone()); |
251 GapResolver resolver(&mi2); | 252 GapResolver resolver(&mi2); |
252 resolver.Resolve(pm); | 253 resolver.Resolve(pm); |
253 | 254 |
254 CHECK(mi1.state() == mi2.state()); | 255 CHECK(mi1.state() == mi2.state()); |
255 } | 256 } |
256 } | 257 } |
257 } | 258 } |
| 259 |
| 260 } // namespace compiler |
| 261 } // namespace internal |
| 262 } // namespace v8 |
OLD | NEW |