diff options
author | Fedor Indutny <fedor@indutny.com> | 2014-10-10 14:49:02 +0400 |
---|---|---|
committer | Fedor Indutny <fedor@indutny.com> | 2014-10-10 14:49:02 +0400 |
commit | 6bcea4ff932144a5fd02affefd45164fbf471e67 (patch) | |
tree | a8e078c679b12f0daebe10ed254239cb0d79e146 /deps/v8/src/compiler/instruction-selector-impl.h | |
parent | 4fae2356d105e394115188a814097c4a95ae0c5d (diff) | |
download | node-new-6bcea4ff932144a5fd02affefd45164fbf471e67.tar.gz |
deps: update v8 to 3.29.93.1
Diffstat (limited to 'deps/v8/src/compiler/instruction-selector-impl.h')
-rw-r--r-- | deps/v8/src/compiler/instruction-selector-impl.h | 79 |
1 files changed, 35 insertions, 44 deletions
diff --git a/deps/v8/src/compiler/instruction-selector-impl.h b/deps/v8/src/compiler/instruction-selector-impl.h index ac446b38ed..b860bc5187 100644 --- a/deps/v8/src/compiler/instruction-selector-impl.h +++ b/deps/v8/src/compiler/instruction-selector-impl.h @@ -25,11 +25,6 @@ class OperandGenerator { 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)); @@ -41,7 +36,7 @@ class OperandGenerator { 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))); @@ -53,8 +48,9 @@ class OperandGenerator { 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) { @@ -69,12 +65,6 @@ class OperandGenerator { 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) { @@ -88,20 +78,13 @@ class OperandGenerator { 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))); @@ -112,8 +95,9 @@ class OperandGenerator { 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() { @@ -159,16 +143,18 @@ class OperandGenerator { 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())); - case IrOpcode::kNumberConstant: + return Constant(OpParameter<int64_t>(node)); + case IrOpcode::kFloat32Constant: + return Constant(OpParameter<float>(node)); case IrOpcode::kFloat64Constant: - return Constant(ValueOf<double>(node->op())); + case IrOpcode::kNumberConstant: + 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; } @@ -192,7 +178,8 @@ class OperandGenerator { 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); @@ -201,7 +188,7 @@ class OperandGenerator { 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_); } @@ -218,7 +205,7 @@ class OperandGenerator { // 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) {} @@ -346,22 +333,26 @@ class FlagsContinuation V8_FINAL { // 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 |