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" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 return node; | 83 return node; |
84 } | 84 } |
85 | 85 |
86 int NewInstr() { | 86 int NewInstr() { |
87 InstructionCode opcode = static_cast<InstructionCode>(110); | 87 InstructionCode opcode = static_cast<InstructionCode>(110); |
88 TestInstr* instr = TestInstr::New(zone(), opcode); | 88 TestInstr* instr = TestInstr::New(zone(), opcode); |
89 return code->AddInstruction(instr); | 89 return code->AddInstruction(instr); |
90 } | 90 } |
91 | 91 |
92 UnallocatedOperand* NewUnallocated(int vreg) { | 92 UnallocatedOperand* NewUnallocated(int vreg) { |
93 return new (zone()) UnallocatedOperand(UnallocatedOperand::ANY, vreg); | 93 return UnallocatedOperand(UnallocatedOperand::ANY, vreg).Copy(zone()); |
94 } | 94 } |
95 | 95 |
96 InstructionBlock* BlockAt(BasicBlock* block) { | 96 InstructionBlock* BlockAt(BasicBlock* block) { |
97 return code->InstructionBlockAt(block->GetRpoNumber()); | 97 return code->InstructionBlockAt(block->GetRpoNumber()); |
98 } | 98 } |
99 BasicBlock* GetBasicBlock(int instruction_index) { | 99 BasicBlock* GetBasicBlock(int instruction_index) { |
100 const InstructionBlock* block = | 100 const InstructionBlock* block = |
101 code->GetInstructionBlock(instruction_index); | 101 code->GetInstructionBlock(instruction_index); |
102 return schedule.rpo_order()->at(block->rpo_number().ToSize()); | 102 return schedule.rpo_order()->at(block->rpo_number().ToSize()); |
103 } | 103 } |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 CHECK(inputs[z].Equals(m->InputAt(z))); | 331 CHECK(inputs[z].Equals(m->InputAt(z))); |
332 } | 332 } |
333 | 333 |
334 for (size_t z = 0; z < k; z++) { | 334 for (size_t z = 0; z < k; z++) { |
335 CHECK(temps[z].Equals(m->TempAt(z))); | 335 CHECK(temps[z].Equals(m->TempAt(z))); |
336 } | 336 } |
337 } | 337 } |
338 } | 338 } |
339 } | 339 } |
340 } | 340 } |
OLD | NEW |