UnallocatedOperand(UnallocatedOperand::MUST_HAVE_REGISTER));
}
- InstructionOperand* DefineAsDoubleRegister(Node* node) {
- return Define(node, new (zone())
- UnallocatedOperand(UnallocatedOperand::MUST_HAVE_REGISTER));
- }
-
InstructionOperand* DefineSameAsFirst(Node* result) {
return Define(result, new (zone())
UnallocatedOperand(UnallocatedOperand::SAME_AS_FIRST_INPUT));
Register::ToAllocationIndex(reg)));
}
- InstructionOperand* DefineAsFixedDouble(Node* node, DoubleRegister reg) {
+ InstructionOperand* DefineAsFixed(Node* node, DoubleRegister reg) {
return Define(node, new (zone())
UnallocatedOperand(UnallocatedOperand::FIXED_DOUBLE_REGISTER,
DoubleRegister::ToAllocationIndex(reg)));
return ConstantOperand::Create(node->id(), zone());
}
- InstructionOperand* DefineAsLocation(Node* node, LinkageLocation location) {
- return Define(node, ToUnallocatedOperand(location));
+ InstructionOperand* DefineAsLocation(Node* node, LinkageLocation location,
+ MachineType type) {
+ return Define(node, ToUnallocatedOperand(location, type));
}
InstructionOperand* Use(Node* node) {
UnallocatedOperand::USED_AT_START));
}
- InstructionOperand* UseDoubleRegister(Node* node) {
- return Use(node, new (zone())
- UnallocatedOperand(UnallocatedOperand::MUST_HAVE_REGISTER,
- UnallocatedOperand::USED_AT_START));
- }
-
// Use register or operand for the node. If a register is chosen, it won't
// alias any temporary or output registers.
InstructionOperand* UseUnique(Node* node) {
UnallocatedOperand(UnallocatedOperand::MUST_HAVE_REGISTER));
}
- // Use a unique double register for the node that does not alias any temporary
- // or output double registers.
- InstructionOperand* UseUniqueDoubleRegister(Node* node) {
- return Use(node, new (zone())
- UnallocatedOperand(UnallocatedOperand::MUST_HAVE_REGISTER));
- }
-
InstructionOperand* UseFixed(Node* node, Register reg) {
return Use(node, new (zone())
UnallocatedOperand(UnallocatedOperand::FIXED_REGISTER,
Register::ToAllocationIndex(reg)));
}
- InstructionOperand* UseFixedDouble(Node* node, DoubleRegister reg) {
+ InstructionOperand* UseFixed(Node* node, DoubleRegister reg) {
return Use(node, new (zone())
UnallocatedOperand(UnallocatedOperand::FIXED_DOUBLE_REGISTER,
DoubleRegister::ToAllocationIndex(reg)));
return ImmediateOperand::Create(index, zone());
}
- InstructionOperand* UseLocation(Node* node, LinkageLocation location) {
- return Use(node, ToUnallocatedOperand(location));
+ InstructionOperand* UseLocation(Node* node, LinkageLocation location,
+ MachineType type) {
+ return Use(node, ToUnallocatedOperand(location, type));
}
InstructionOperand* TempRegister() {
static Constant ToConstant(const Node* node) {
switch (node->opcode()) {
case IrOpcode::kInt32Constant:
- return Constant(ValueOf<int32_t>(node->op()));
+ return Constant(OpParameter<int32_t>(node));
case IrOpcode::kInt64Constant:
- return Constant(ValueOf<int64_t>(node->op()));
+ return Constant(OpParameter<int64_t>(node));
case IrOpcode::kNumberConstant:
case IrOpcode::kFloat64Constant:
- return Constant(ValueOf<double>(node->op()));
+ return Constant(OpParameter<double>(node));
case IrOpcode::kExternalConstant:
- return Constant(ValueOf<ExternalReference>(node->op()));
+ return Constant(OpParameter<ExternalReference>(node));
case IrOpcode::kHeapConstant:
- return Constant(ValueOf<Handle<HeapObject> >(node->op()));
+ return Constant(OpParameter<Unique<HeapObject> >(node).handle());
default:
break;
}
return operand;
}
- UnallocatedOperand* ToUnallocatedOperand(LinkageLocation location) {
+ UnallocatedOperand* ToUnallocatedOperand(LinkageLocation location,
+ MachineType type) {
if (location.location_ == LinkageLocation::ANY_REGISTER) {
return new (zone())
UnallocatedOperand(UnallocatedOperand::MUST_HAVE_REGISTER);
return new (zone()) UnallocatedOperand(UnallocatedOperand::FIXED_SLOT,
location.location_);
}
- if (location.rep_ == kMachineFloat64) {
+ if (RepresentationOf(type) == kRepFloat64) {
return new (zone()) UnallocatedOperand(
UnallocatedOperand::FIXED_DOUBLE_REGISTER, location.location_);
}
// The whole instruction is treated as a unit by the register allocator, and
// thus no spills or moves can be introduced between the flags-setting
// instruction and the branch or set it should be combined with.
-class FlagsContinuation V8_FINAL {
+class FlagsContinuation FINAL {
public:
FlagsContinuation() : mode_(kFlags_none) {}
// TODO(bmeurer): Get rid of the CallBuffer business and make
// InstructionSelector::VisitCall platform independent instead.
struct CallBuffer {
- CallBuffer(Zone* zone, CallDescriptor* descriptor);
+ CallBuffer(Zone* zone, CallDescriptor* descriptor,
+ FrameStateDescriptor* frame_state);
- int output_count;
CallDescriptor* descriptor;
- Node** output_nodes;
- InstructionOperand** outputs;
- InstructionOperand** fixed_and_control_args;
- int fixed_count;
- Node** pushed_nodes;
- int pushed_count;
+ FrameStateDescriptor* frame_state_descriptor;
+ NodeVector output_nodes;
+ InstructionOperandVector outputs;
+ InstructionOperandVector instruction_args;
+ NodeVector pushed_nodes;
- int input_count() { return descriptor->InputCount(); }
+ size_t input_count() const { return descriptor->InputCount(); }
- int control_count() { return descriptor->CanLazilyDeoptimize() ? 2 : 0; }
+ size_t frame_state_count() const { return descriptor->FrameStateCount(); }
- int fixed_and_control_count() { return fixed_count + control_count(); }
+ size_t frame_state_value_count() const {
+ return (frame_state_descriptor == NULL)
+ ? 0
+ : (frame_state_descriptor->GetTotalSize() +
+ 1); // Include deopt id.
+ }
};
} // namespace compiler