Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Unified Diff: src/compiler/instruction-selector-impl.h

Issue 1513543003: [turbofan] Make MachineType a pair of enums. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Moar rebase Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/instruction-selector.cc ('k') | src/compiler/interpreter-assembler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/instruction-selector-impl.h
diff --git a/src/compiler/instruction-selector-impl.h b/src/compiler/instruction-selector-impl.h
index 7136de96b1d6bda3d7216e43e675ca3808eef2b5..5cca8880d589696f995b2d488f57ad19494078ea 100644
--- a/src/compiler/instruction-selector-impl.h
+++ b/src/compiler/instruction-selector-impl.h
@@ -68,8 +68,8 @@ class OperandGenerator {
}
InstructionOperand DefineAsLocation(Node* node, LinkageLocation location,
- MachineType type) {
- return Define(node, ToUnallocatedOperand(location, type, GetVReg(node)));
+ MachineRepresentation rep) {
+ return Define(node, ToUnallocatedOperand(location, rep, GetVReg(node)));
}
InstructionOperand DefineAsDualLocation(Node* node,
@@ -129,12 +129,12 @@ class OperandGenerator {
}
InstructionOperand UseExplicit(LinkageLocation location) {
- MachineType machine_type = InstructionSequence::DefaultRepresentation();
+ MachineRepresentation rep = InstructionSequence::DefaultRepresentation();
if (location.IsRegister()) {
- return ExplicitOperand(LocationOperand::REGISTER, machine_type,
+ return ExplicitOperand(LocationOperand::REGISTER, rep,
location.AsRegister());
} else {
- return ExplicitOperand(LocationOperand::STACK_SLOT, machine_type,
+ return ExplicitOperand(LocationOperand::STACK_SLOT, rep,
location.GetLocation());
}
}
@@ -144,19 +144,19 @@ class OperandGenerator {
}
InstructionOperand UseLocation(Node* node, LinkageLocation location,
- MachineType type) {
- return Use(node, ToUnallocatedOperand(location, type, GetVReg(node)));
+ MachineRepresentation rep) {
+ return Use(node, ToUnallocatedOperand(location, rep, GetVReg(node)));
}
// Used to force gap moves from the from_location to the to_location
// immediately before an instruction.
InstructionOperand UsePointerLocation(LinkageLocation to_location,
LinkageLocation from_location) {
- MachineType type = static_cast<MachineType>(kTypeAny | kMachPtr);
+ MachineRepresentation rep = MachineType::PointerRepresentation();
UnallocatedOperand casted_from_operand =
- UnallocatedOperand::cast(TempLocation(from_location, type));
+ UnallocatedOperand::cast(TempLocation(from_location, rep));
selector_->Emit(kArchNop, casted_from_operand);
- return ToUnallocatedOperand(to_location, type,
+ return ToUnallocatedOperand(to_location, rep,
casted_from_operand.virtual_register());
}
@@ -170,7 +170,8 @@ class OperandGenerator {
UnallocatedOperand op = UnallocatedOperand(
UnallocatedOperand::MUST_HAVE_REGISTER,
UnallocatedOperand::USED_AT_START, sequence()->NextVirtualRegister());
- sequence()->MarkAsRepresentation(kRepFloat64, op.virtual_register());
+ sequence()->MarkAsRepresentation(MachineRepresentation::kFloat64,
+ op.virtual_register());
return op;
}
@@ -183,8 +184,9 @@ class OperandGenerator {
return sequence()->AddImmediate(Constant(imm));
}
- InstructionOperand TempLocation(LinkageLocation location, MachineType type) {
- return ToUnallocatedOperand(location, type,
+ InstructionOperand TempLocation(LinkageLocation location,
+ MachineRepresentation rep) {
+ return ToUnallocatedOperand(location, rep,
sequence()->NextVirtualRegister());
}
@@ -250,7 +252,7 @@ class OperandGenerator {
}
UnallocatedOperand ToUnallocatedOperand(LinkageLocation location,
- MachineType type,
+ MachineRepresentation rep,
int virtual_register) {
if (location.IsAnyRegister()) {
// any machine register.
@@ -268,8 +270,7 @@ class OperandGenerator {
location.AsCalleeFrameSlot(), virtual_register);
}
// a fixed register.
- MachineType rep = RepresentationOf(type);
- if (rep == kRepFloat64 || rep == kRepFloat32) {
+ if (IsFloatingPoint(rep)) {
return UnallocatedOperand(UnallocatedOperand::FIXED_DOUBLE_REGISTER,
location.AsRegister(), virtual_register);
}
« no previous file with comments | « src/compiler/instruction-selector.cc ('k') | src/compiler/interpreter-assembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698