Merge V8 5.3.332.45. DO NOT MERGE
Test: Manual
FPIIM-449
Change-Id: Id3254828b068abdea3cb10442e0172a8c9a98e03
(cherry picked from commit 13e2dadd00298019ed862f2b2fc5068bba730bcf)
diff --git a/src/compiler/instruction.cc b/src/compiler/instruction.cc
index 26aebca..1ef42d6 100644
--- a/src/compiler/instruction.cc
+++ b/src/compiler/instruction.cc
@@ -12,6 +12,7 @@
namespace internal {
namespace compiler {
+const auto GetRegConfig = RegisterConfiguration::Turbofan;
FlagsCondition CommuteFlagsCondition(FlagsCondition condition) {
switch (condition) {
@@ -59,6 +60,16 @@
return condition;
}
+bool InstructionOperand::InterferesWith(const InstructionOperand& that) const {
+ if (!IsFPRegister() || !that.IsFPRegister() || kSimpleFPAliasing)
+ return EqualsCanonicalized(that);
+ // Both operands are fp registers and aliasing is non-simple.
+ const LocationOperand& loc1 = *LocationOperand::cast(this);
+ const LocationOperand& loc2 = LocationOperand::cast(that);
+ return GetRegConfig()->AreAliases(loc1.representation(), loc1.register_code(),
+ loc2.representation(),
+ loc2.register_code());
+}
void InstructionOperand::Print(const RegisterConfiguration* config) const {
OFStream os(stdout);
@@ -68,13 +79,7 @@
os << wrapper << std::endl;
}
-
-void InstructionOperand::Print() const {
- const RegisterConfiguration* config =
- RegisterConfiguration::ArchDefault(RegisterConfiguration::TURBOFAN);
- Print(config);
-}
-
+void InstructionOperand::Print() const { Print(GetRegConfig()); }
std::ostream& operator<<(std::ostream& os,
const PrintableInstructionOperand& printable) {
@@ -95,7 +100,7 @@
<< conf->GetGeneralRegisterName(
unalloc->fixed_register_index())
<< ")";
- case UnallocatedOperand::FIXED_DOUBLE_REGISTER:
+ case UnallocatedOperand::FIXED_FP_REGISTER:
return os << "(="
<< conf->GetDoubleRegisterName(
unalloc->fixed_register_index())
@@ -126,14 +131,21 @@
case InstructionOperand::ALLOCATED: {
LocationOperand allocated = LocationOperand::cast(op);
if (op.IsStackSlot()) {
- os << "[stack:" << LocationOperand::cast(op).index();
+ os << "[stack:" << allocated.index();
} else if (op.IsFPStackSlot()) {
- os << "[fp_stack:" << LocationOperand::cast(op).index();
+ os << "[fp_stack:" << allocated.index();
} else if (op.IsRegister()) {
- os << "[" << LocationOperand::cast(op).GetRegister().ToString() << "|R";
+ os << "["
+ << GetRegConfig()->GetGeneralRegisterName(allocated.register_code())
+ << "|R";
+ } else if (op.IsDoubleRegister()) {
+ os << "["
+ << GetRegConfig()->GetDoubleRegisterName(allocated.register_code())
+ << "|R";
} else {
- DCHECK(op.IsFPRegister());
- os << "[" << LocationOperand::cast(op).GetDoubleRegister().ToString()
+ DCHECK(op.IsFloatRegister());
+ os << "["
+ << GetRegConfig()->GetFloatRegisterName(allocated.register_code())
<< "|R";
}
if (allocated.IsExplicit()) {
@@ -180,7 +192,6 @@
return os;
}
-
void MoveOperands::Print(const RegisterConfiguration* config) const {
OFStream os(stdout);
PrintableInstructionOperand wrapper;
@@ -191,13 +202,7 @@
os << wrapper << std::endl;
}
-
-void MoveOperands::Print() const {
- const RegisterConfiguration* config =
- RegisterConfiguration::ArchDefault(RegisterConfiguration::TURBOFAN);
- Print(config);
-}
-
+void MoveOperands::Print() const { Print(GetRegConfig()); }
std::ostream& operator<<(std::ostream& os,
const PrintableMoveOperands& printable) {
@@ -246,9 +251,11 @@
int index)
: LocationOperand(EXPLICIT, kind, rep, index) {
DCHECK_IMPLIES(kind == REGISTER && !IsFloatingPoint(rep),
- Register::from_code(index).IsAllocatable());
- DCHECK_IMPLIES(kind == REGISTER && IsFloatingPoint(rep),
- DoubleRegister::from_code(index).IsAllocatable());
+ GetRegConfig()->IsAllocatableGeneralCode(index));
+ DCHECK_IMPLIES(kind == REGISTER && rep == MachineRepresentation::kFloat32,
+ GetRegConfig()->IsAllocatableFloatCode(index));
+ DCHECK_IMPLIES(kind == REGISTER && (rep == MachineRepresentation::kFloat64),
+ GetRegConfig()->IsAllocatableDoubleCode(index));
}
Instruction::Instruction(InstructionCode opcode)
@@ -309,13 +316,7 @@
os << wrapper << std::endl;
}
-
-void Instruction::Print() const {
- const RegisterConfiguration* config =
- RegisterConfiguration::ArchDefault(RegisterConfiguration::TURBOFAN);
- Print(config);
-}
-
+void Instruction::Print() const { Print(GetRegConfig()); }
std::ostream& operator<<(std::ostream& os,
const PrintableParallelMove& printable) {
@@ -343,9 +344,7 @@
std::ostream& operator<<(std::ostream& os, const ReferenceMap& pm) {
os << "{";
bool first = true;
- PrintableInstructionOperand poi = {
- RegisterConfiguration::ArchDefault(RegisterConfiguration::TURBOFAN),
- InstructionOperand()};
+ PrintableInstructionOperand poi = {GetRegConfig(), InstructionOperand()};
for (const InstructionOperand& op : pm.reference_operands_) {
if (!first) {
os << ";";
@@ -880,12 +879,7 @@
os << wrapper << std::endl;
}
-
-void InstructionSequence::Print() const {
- const RegisterConfiguration* config =
- RegisterConfiguration::ArchDefault(RegisterConfiguration::TURBOFAN);
- Print(config);
-}
+void InstructionSequence::Print() const { Print(GetRegConfig()); }
void InstructionSequence::PrintBlock(const RegisterConfiguration* config,
int block_id) const {
@@ -939,9 +933,7 @@
}
void InstructionSequence::PrintBlock(int block_id) const {
- const RegisterConfiguration* config =
- RegisterConfiguration::ArchDefault(RegisterConfiguration::TURBOFAN);
- PrintBlock(config, block_id);
+ PrintBlock(GetRegConfig(), block_id);
}
FrameStateDescriptor::FrameStateDescriptor(