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

Unified Diff: src/compiler/machine-operator.cc

Issue 1513383003: [turbofan] Store nodes use only MachineRepresentation, not MachineType. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: please mips64 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/machine-operator.h ('k') | src/compiler/machine-operator-reducer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/machine-operator.cc
diff --git a/src/compiler/machine-operator.cc b/src/compiler/machine-operator.cc
index f50cc9ab7f5f7006c31f1da2ad8aa6e3beab79e7..10f33070a1fc38839e2ab77967c1365f83299421 100644
--- a/src/compiler/machine-operator.cc
+++ b/src/compiler/machine-operator.cc
@@ -47,7 +47,7 @@ std::ostream& operator<<(std::ostream& os, WriteBarrierKind kind) {
bool operator==(StoreRepresentation lhs, StoreRepresentation rhs) {
- return lhs.machine_type() == rhs.machine_type() &&
+ return lhs.representation() == rhs.representation() &&
lhs.write_barrier_kind() == rhs.write_barrier_kind();
}
@@ -58,12 +58,12 @@ bool operator!=(StoreRepresentation lhs, StoreRepresentation rhs) {
size_t hash_value(StoreRepresentation rep) {
- return base::hash_combine(rep.machine_type(), rep.write_barrier_kind());
+ return base::hash_combine(rep.representation(), rep.write_barrier_kind());
}
std::ostream& operator<<(std::ostream& os, StoreRepresentation rep) {
- return os << "(" << rep.machine_type() << " : " << rep.write_barrier_kind()
+ return os << "(" << rep.representation() << " : " << rep.write_barrier_kind()
<< ")";
}
@@ -220,6 +220,16 @@ CheckedStoreRepresentation CheckedStoreRepresentationOf(Operator const* op) {
V(AnyTagged)
+#define MACHINE_REPRESENTATION_LIST(V) \
+ V(kFloat32) \
+ V(kFloat64) \
+ V(kWord8) \
+ V(kWord16) \
+ V(kWord32) \
+ V(kWord64) \
+ V(kTagged)
+
+
struct MachineOperatorGlobalCache {
#define PURE(Name, properties, value_input_count, control_input_count, \
output_count) \
@@ -272,7 +282,8 @@ struct MachineOperatorGlobalCache {
: Operator1<StoreRepresentation>( \
IrOpcode::kStore, Operator::kNoRead | Operator::kNoThrow, \
"Store", 3, 1, 1, 0, 1, 0, \
- StoreRepresentation(MachineType::Type(), write_barrier_kind)) {} \
+ StoreRepresentation(MachineRepresentation::Type, \
+ write_barrier_kind)) {} \
}; \
struct Store##Type##NoWriteBarrier##Operator final \
: public Store##Type##Operator { \
@@ -299,7 +310,8 @@ struct MachineOperatorGlobalCache {
CheckedStore##Type##Operator() \
: Operator1<CheckedStoreRepresentation>( \
IrOpcode::kCheckedStore, Operator::kNoRead | Operator::kNoThrow, \
- "CheckedStore", 4, 1, 1, 0, 1, 0, MachineType::Type()) {} \
+ "CheckedStore", 4, 1, 1, 0, 1, 0, MachineRepresentation::Type) { \
+ } \
}; \
Store##Type##NoWriteBarrier##Operator kStore##Type##NoWriteBarrier; \
Store##Type##MapWriteBarrier##Operator kStore##Type##MapWriteBarrier; \
@@ -307,7 +319,7 @@ struct MachineOperatorGlobalCache {
kStore##Type##PointerWriteBarrier; \
Store##Type##FullWriteBarrier##Operator kStore##Type##FullWriteBarrier; \
CheckedStore##Type##Operator kCheckedStore##Type;
- MACHINE_TYPE_LIST(STORE)
+ MACHINE_REPRESENTATION_LIST(STORE)
#undef STORE
};
@@ -366,22 +378,25 @@ const Operator* MachineOperatorBuilder::Load(LoadRepresentation rep) {
const Operator* MachineOperatorBuilder::Store(StoreRepresentation store_rep) {
- MachineType type = store_rep.machine_type();
-#define STORE(Type) \
- if (type == MachineType::Type()) { \
+ switch (store_rep.representation()) {
+#define STORE(kRep) \
+ case MachineRepresentation::kRep: \
switch (store_rep.write_barrier_kind()) { \
case kNoWriteBarrier: \
- return &cache_.k##Store##Type##NoWriteBarrier; \
+ return &cache_.k##Store##kRep##NoWriteBarrier; \
case kMapWriteBarrier: \
- return &cache_.k##Store##Type##MapWriteBarrier; \
+ return &cache_.k##Store##kRep##MapWriteBarrier; \
case kPointerWriteBarrier: \
- return &cache_.k##Store##Type##PointerWriteBarrier; \
+ return &cache_.k##Store##kRep##PointerWriteBarrier; \
case kFullWriteBarrier: \
- return &cache_.k##Store##Type##FullWriteBarrier; \
+ return &cache_.k##Store##kRep##FullWriteBarrier; \
} \
- }
- MACHINE_TYPE_LIST(STORE)
+ break;
+ MACHINE_REPRESENTATION_LIST(STORE)
#undef STORE
+ default:
+ break;
+ }
UNREACHABLE();
return nullptr;
}
@@ -402,12 +417,15 @@ const Operator* MachineOperatorBuilder::CheckedLoad(
const Operator* MachineOperatorBuilder::CheckedStore(
CheckedStoreRepresentation rep) {
-#define STORE(Type) \
- if (rep == MachineType::Type()) { \
- return &cache_.kCheckedStore##Type; \
- }
- MACHINE_TYPE_LIST(STORE)
+ switch (rep) {
+#define STORE(kRep) \
+ case MachineRepresentation::kRep: \
+ return &cache_.kCheckedStore##kRep;
+ MACHINE_REPRESENTATION_LIST(STORE)
#undef STORE
+ default:
+ break;
+ }
UNREACHABLE();
return nullptr;
}
« no previous file with comments | « src/compiler/machine-operator.h ('k') | src/compiler/machine-operator-reducer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698