| 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 { |
| 11 namespace internal { | 11 namespace internal { |
| 12 namespace compiler { | 12 namespace compiler { |
| 13 | 13 |
| 14 RawMachineAssembler::RawMachineAssembler(Isolate* isolate, Graph* graph, | 14 RawMachineAssembler::RawMachineAssembler(Isolate* isolate, Graph* graph, |
| 15 const MachineSignature* machine_sig, | 15 const MachineSignature* machine_sig, |
| 16 MachineType word, | 16 MachineType word, |
| 17 MachineOperatorBuilder::Flags flags) | 17 MachineOperatorBuilder::Flags flags) |
| 18 : RawMachineAssembler( |
| 19 isolate, graph, machine_sig, word, flags, |
| 20 Linkage::GetSimplifiedCDescriptor(graph->zone(), machine_sig)) {} |
| 21 |
| 22 RawMachineAssembler::RawMachineAssembler(Isolate* isolate, Graph* graph, |
| 23 const MachineSignature* machine_sig, |
| 24 MachineType word, |
| 25 MachineOperatorBuilder::Flags flags, |
| 26 CallDescriptor* call_descriptor) |
| 18 : GraphBuilder(isolate, graph), | 27 : GraphBuilder(isolate, graph), |
| 19 schedule_(new (zone()) Schedule(zone())), | 28 schedule_(new (zone()) Schedule(zone())), |
| 20 machine_(zone(), word, flags), | 29 machine_(zone(), word, flags), |
| 21 common_(zone()), | 30 common_(zone()), |
| 22 machine_sig_(machine_sig), | 31 machine_sig_(machine_sig), |
| 23 call_descriptor_( | 32 call_descriptor_(call_descriptor), |
| 24 Linkage::GetSimplifiedCDescriptor(graph->zone(), machine_sig)), | |
| 25 parameters_(NULL), | 33 parameters_(NULL), |
| 26 current_block_(schedule()->start()) { | 34 current_block_(schedule()->start()) { |
| 27 int param_count = static_cast<int>(parameter_count()); | 35 int param_count = static_cast<int>(parameter_count()); |
| 28 Node* s = graph->NewNode(common_.Start(param_count)); | 36 Node* s = graph->NewNode(common_.Start(param_count)); |
| 29 graph->SetStart(s); | 37 graph->SetStart(s); |
| 30 if (parameter_count() == 0) return; | 38 if (parameter_count() == 0) return; |
| 31 parameters_ = zone()->NewArray<Node*>(param_count); | 39 parameters_ = zone()->NewArray<Node*>(param_count); |
| 32 for (size_t i = 0; i < parameter_count(); ++i) { | 40 for (size_t i = 0; i < parameter_count(); ++i) { |
| 33 parameters_[i] = | 41 parameters_[i] = |
| 34 NewNode(common()->Parameter(static_cast<int>(i)), graph->start()); | 42 NewNode(common()->Parameter(static_cast<int>(i)), graph->start()); |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 : CurrentBlock(); | 259 : CurrentBlock(); |
| 252 if (op->opcode() != IrOpcode::kReturn) { | 260 if (op->opcode() != IrOpcode::kReturn) { |
| 253 schedule()->AddNode(block, node); | 261 schedule()->AddNode(block, node); |
| 254 } | 262 } |
| 255 return node; | 263 return node; |
| 256 } | 264 } |
| 257 | 265 |
| 258 } // namespace compiler | 266 } // namespace compiler |
| 259 } // namespace internal | 267 } // namespace internal |
| 260 } // namespace v8 | 268 } // namespace v8 |
| OLD | NEW |