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/base/utils/random-number-generator.h" | 5 #include "src/base/utils/random-number-generator.h" |
6 #include "src/compiler/register-allocator.h" | 6 #include "src/compiler/register-allocator.h" |
7 #include "test/unittests/test-utils.h" | 7 #include "test/unittests/test-utils.h" |
8 #include "testing/gmock/include/gmock/gmock.h" | 8 #include "testing/gmock/include/gmock/gmock.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 Rpo loop_end = Rpo::Invalid()) { | 90 Rpo loop_end = Rpo::Invalid()) { |
91 CHECK(current_block_ == NULL); | 91 CHECK(current_block_ == NULL); |
92 BasicBlock::Id block_id = | 92 BasicBlock::Id block_id = |
93 BasicBlock::Id::FromSize(instruction_blocks_.size()); | 93 BasicBlock::Id::FromSize(instruction_blocks_.size()); |
94 BasicBlock* basic_block = new (zone()) BasicBlock(zone(), block_id); | 94 BasicBlock* basic_block = new (zone()) BasicBlock(zone(), block_id); |
95 basic_block->set_rpo_number(block_id.ToInt()); | 95 basic_block->set_rpo_number(block_id.ToInt()); |
96 basic_block->set_ao_number(block_id.ToInt()); | 96 basic_block->set_ao_number(block_id.ToInt()); |
97 if (loop_header.IsValid()) { | 97 if (loop_header.IsValid()) { |
98 basic_block->set_loop_depth(1); | 98 basic_block->set_loop_depth(1); |
99 basic_block->set_loop_header(basic_blocks_[loop_header.ToSize()]); | 99 basic_block->set_loop_header(basic_blocks_[loop_header.ToSize()]); |
100 basic_block->set_loop_end(loop_end.ToInt()); | 100 basic_block->set_loop_end(basic_blocks_[loop_end.ToSize()]); |
101 } | 101 } |
102 InstructionBlock* instruction_block = | 102 InstructionBlock* instruction_block = |
103 new (zone()) InstructionBlock(zone(), basic_block); | 103 new (zone()) InstructionBlock(zone(), basic_block); |
104 basic_blocks_.push_back(basic_block); | 104 basic_blocks_.push_back(basic_block); |
105 instruction_blocks_.push_back(instruction_block); | 105 instruction_blocks_.push_back(instruction_block); |
106 current_block_ = instruction_block; | 106 current_block_ = instruction_block; |
107 sequence()->StartBlock(basic_block); | 107 sequence()->StartBlock(basic_block); |
108 return instruction_block; | 108 return instruction_block; |
109 } | 109 } |
110 | 110 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 EndBlock(); | 190 EndBlock(); |
191 | 191 |
192 Allocate(); | 192 Allocate(); |
193 | 193 |
194 ASSERT_TRUE(res->OutputAt(0)->IsRegister()); | 194 ASSERT_TRUE(res->OutputAt(0)->IsRegister()); |
195 } | 195 } |
196 | 196 |
197 } // namespace compiler | 197 } // namespace compiler |
198 } // namespace internal | 198 } // namespace internal |
199 } // namespace v8 | 199 } // namespace v8 |
OLD | NEW |