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/code-factory.h" | 5 #include "src/code-factory.h" |
6 #include "src/compiler/pipeline.h" | 6 #include "src/compiler/pipeline.h" |
7 #include "src/compiler/raw-machine-assembler.h" | 7 #include "src/compiler/raw-machine-assembler.h" |
8 #include "src/compiler/scheduler.h" | 8 #include "src/compiler/scheduler.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 21 matching lines...) Expand all Loading... |
32 parameters_[i] = | 32 parameters_[i] = |
33 NewNode(common()->Parameter(static_cast<int>(i)), graph->start()); | 33 NewNode(common()->Parameter(static_cast<int>(i)), graph->start()); |
34 } | 34 } |
35 } | 35 } |
36 | 36 |
37 | 37 |
38 Schedule* RawMachineAssembler::Export() { | 38 Schedule* RawMachineAssembler::Export() { |
39 // Compute the correct codegen order. | 39 // Compute the correct codegen order. |
40 DCHECK(schedule_->rpo_order()->empty()); | 40 DCHECK(schedule_->rpo_order()->empty()); |
41 Scheduler::ComputeSpecialRPO(zone(), schedule_); | 41 Scheduler::ComputeSpecialRPO(zone(), schedule_); |
42 // Invalidate MachineAssembler. | 42 // Invalidate RawMachineAssembler. |
43 Schedule* schedule = schedule_; | 43 Schedule* schedule = schedule_; |
44 schedule_ = NULL; | 44 schedule_ = NULL; |
45 return schedule; | 45 return schedule; |
46 } | 46 } |
47 | 47 |
48 | 48 |
49 Node* RawMachineAssembler::Parameter(size_t index) { | 49 Node* RawMachineAssembler::Parameter(size_t index) { |
50 DCHECK(index < parameter_count()); | 50 DCHECK(index < parameter_count()); |
51 return parameters_[index]; | 51 return parameters_[index]; |
52 } | 52 } |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 | 236 |
237 | 237 |
238 BasicBlock* RawMachineAssembler::CurrentBlock() { | 238 BasicBlock* RawMachineAssembler::CurrentBlock() { |
239 DCHECK(current_block_); | 239 DCHECK(current_block_); |
240 return current_block_; | 240 return current_block_; |
241 } | 241 } |
242 | 242 |
243 | 243 |
244 Node* RawMachineAssembler::MakeNode(const Operator* op, int input_count, | 244 Node* RawMachineAssembler::MakeNode(const Operator* op, int input_count, |
245 Node** inputs) { | 245 Node** inputs) { |
246 DCHECK(ScheduleValid()); | 246 DCHECK_NOT_NULL(schedule_); |
247 DCHECK(current_block_ != NULL); | 247 DCHECK(current_block_ != NULL); |
248 Node* node = graph()->NewNode(op, input_count, inputs); | 248 Node* node = graph()->NewNode(op, input_count, inputs); |
249 BasicBlock* block = op->opcode() == IrOpcode::kParameter ? schedule()->start() | 249 BasicBlock* block = op->opcode() == IrOpcode::kParameter ? schedule()->start() |
250 : CurrentBlock(); | 250 : CurrentBlock(); |
251 if (op->opcode() != IrOpcode::kReturn) { | 251 if (op->opcode() != IrOpcode::kReturn) { |
252 schedule()->AddNode(block, node); | 252 schedule()->AddNode(block, node); |
253 } | 253 } |
254 return node; | 254 return node; |
255 } | 255 } |
256 | 256 |
257 } // namespace compiler | 257 } // namespace compiler |
258 } // namespace internal | 258 } // namespace internal |
259 } // namespace v8 | 259 } // namespace v8 |
OLD | NEW |