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/v8.h" | 5 #include "src/v8.h" |
6 #include "test/cctest/cctest.h" | 6 #include "test/cctest/cctest.h" |
7 | 7 |
8 #include "src/compiler/code-generator.h" | 8 #include "src/compiler/code-generator.h" |
9 #include "src/compiler/common-operator.h" | 9 #include "src/compiler/common-operator.h" |
10 #include "src/compiler/graph.h" | 10 #include "src/compiler/graph.h" |
11 #include "src/compiler/instruction.h" | 11 #include "src/compiler/instruction.h" |
12 #include "src/compiler/linkage.h" | 12 #include "src/compiler/linkage.h" |
13 #include "src/compiler/machine-operator.h" | 13 #include "src/compiler/machine-operator.h" |
14 #include "src/compiler/node.h" | 14 #include "src/compiler/node.h" |
15 #include "src/compiler/operator.h" | 15 #include "src/compiler/operator.h" |
16 #include "src/compiler/schedule.h" | 16 #include "src/compiler/schedule.h" |
17 #include "src/compiler/scheduler.h" | 17 #include "src/compiler/scheduler.h" |
18 #include "src/lithium.h" | 18 #include "src/lithium.h" |
19 | 19 |
20 using namespace v8::internal; | 20 using namespace v8::internal; |
21 using namespace v8::internal::compiler; | 21 using namespace v8::internal::compiler; |
22 | 22 |
23 typedef v8::internal::compiler::Instruction TestInstr; | 23 typedef v8::internal::compiler::Instruction TestInstr; |
24 typedef v8::internal::compiler::InstructionSequence TestInstrSeq; | 24 typedef v8::internal::compiler::InstructionSequence TestInstrSeq; |
25 | 25 |
26 // A testing helper for the register code abstraction. | 26 // A testing helper for the register code abstraction. |
27 class InstructionTester : public HandleAndZoneScope { | 27 class InstructionTester : public HandleAndZoneScope { |
28 public: // We're all friends here. | 28 public: // We're all friends here. |
29 InstructionTester() | 29 InstructionTester() |
30 : isolate(main_isolate()), | 30 : graph(zone()), |
31 graph(zone()), | |
32 schedule(zone()), | 31 schedule(zone()), |
33 fake_stub(main_isolate()), | |
34 info(&fake_stub, main_isolate()), | |
35 common(zone()), | 32 common(zone()), |
36 machine(zone()), | 33 machine(zone()), |
37 code(NULL) {} | 34 code(NULL) {} |
38 | 35 |
39 Isolate* isolate; | |
40 Graph graph; | 36 Graph graph; |
41 Schedule schedule; | 37 Schedule schedule; |
42 FakeStubForTesting fake_stub; | |
43 CompilationInfoWithZone info; | |
44 CommonOperatorBuilder common; | 38 CommonOperatorBuilder common; |
45 MachineOperatorBuilder machine; | 39 MachineOperatorBuilder machine; |
46 TestInstrSeq* code; | 40 TestInstrSeq* code; |
47 | 41 |
48 Zone* zone() { return main_zone(); } | 42 Zone* zone() { return main_zone(); } |
49 | 43 |
50 void allocCode() { | 44 void allocCode() { |
51 if (schedule.rpo_order()->size() == 0) { | 45 if (schedule.rpo_order()->size() == 0) { |
52 // Compute the RPO order. | 46 // Compute the RPO order. |
53 Scheduler::ComputeSpecialRPO(main_zone(), &schedule); | 47 Scheduler::ComputeSpecialRPO(main_zone(), &schedule); |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 CHECK(inputs[z].Equals(m->InputAt(z))); | 328 CHECK(inputs[z].Equals(m->InputAt(z))); |
335 } | 329 } |
336 | 330 |
337 for (size_t z = 0; z < k; z++) { | 331 for (size_t z = 0; z < k; z++) { |
338 CHECK(temps[z].Equals(m->TempAt(z))); | 332 CHECK(temps[z].Equals(m->TempAt(z))); |
339 } | 333 } |
340 } | 334 } |
341 } | 335 } |
342 } | 336 } |
343 } | 337 } |
OLD | NEW |