| 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/compiler/raw-machine-assembler.h" | 5 #include "src/compiler/raw-machine-assembler.h" |
| 6 | 6 |
| 7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
| 8 #include "src/compiler/node-properties.h" | 8 #include "src/compiler/node-properties.h" |
| 9 #include "src/compiler/pipeline.h" | 9 #include "src/compiler/pipeline.h" |
| 10 #include "src/compiler/scheduler.h" | 10 #include "src/compiler/scheduler.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 int param_count = static_cast<int>(parameter_count()); | 28 int param_count = static_cast<int>(parameter_count()); |
| 29 // Add an extra input for the JSFunction parameter to the start node. | 29 // Add an extra input for the JSFunction parameter to the start node. |
| 30 graph->SetStart(graph->NewNode(common_.Start(param_count + 1))); | 30 graph->SetStart(graph->NewNode(common_.Start(param_count + 1))); |
| 31 for (size_t i = 0; i < parameter_count(); ++i) { | 31 for (size_t i = 0; i < parameter_count(); ++i) { |
| 32 parameters_[i] = | 32 parameters_[i] = |
| 33 AddNode(common()->Parameter(static_cast<int>(i)), graph->start()); | 33 AddNode(common()->Parameter(static_cast<int>(i)), graph->start()); |
| 34 } | 34 } |
| 35 graph->SetEnd(graph->NewNode(common_.End(0))); | 35 graph->SetEnd(graph->NewNode(common_.End(0))); |
| 36 } | 36 } |
| 37 | 37 |
| 38 Node* RawMachineAssembler::RelocatableIntPtrConstant(intptr_t value, |
| 39 RelocInfo::Mode rmode) { |
| 40 return kPointerSize == 8 |
| 41 ? RelocatableInt64Constant(value, rmode) |
| 42 : RelocatableInt32Constant(static_cast<int>(value), rmode); |
| 43 } |
| 38 | 44 |
| 39 Schedule* RawMachineAssembler::Export() { | 45 Schedule* RawMachineAssembler::Export() { |
| 40 // Compute the correct codegen order. | 46 // Compute the correct codegen order. |
| 41 DCHECK(schedule_->rpo_order()->empty()); | 47 DCHECK(schedule_->rpo_order()->empty()); |
| 42 Scheduler::ComputeSpecialRPO(zone(), schedule_); | 48 Scheduler::ComputeSpecialRPO(zone(), schedule_); |
| 43 // Invalidate RawMachineAssembler. | 49 // Invalidate RawMachineAssembler. |
| 44 Schedule* schedule = schedule_; | 50 Schedule* schedule = schedule_; |
| 45 schedule_ = nullptr; | 51 schedule_ = nullptr; |
| 46 return schedule; | 52 return schedule; |
| 47 } | 53 } |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 479 // The raw machine assembler nodes do not have effect and control inputs, | 485 // The raw machine assembler nodes do not have effect and control inputs, |
| 480 // so we disable checking input counts here. | 486 // so we disable checking input counts here. |
| 481 return graph()->NewNodeUnchecked(op, input_count, inputs); | 487 return graph()->NewNodeUnchecked(op, input_count, inputs); |
| 482 } | 488 } |
| 483 | 489 |
| 484 RawMachineLabel::~RawMachineLabel() { DCHECK(bound_ || !used_); } | 490 RawMachineLabel::~RawMachineLabel() { DCHECK(bound_ || !used_); } |
| 485 | 491 |
| 486 } // namespace compiler | 492 } // namespace compiler |
| 487 } // namespace internal | 493 } // namespace internal |
| 488 } // namespace v8 | 494 } // namespace v8 |
| OLD | NEW |