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

Unified Diff: test/cctest/compiler/c-signature.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/machine-type.cc ('k') | test/cctest/compiler/codegen-tester.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/compiler/c-signature.h
diff --git a/test/cctest/compiler/c-signature.h b/test/cctest/compiler/c-signature.h
index 7c537c04ea1e44bed8a53bbf0c54c3f537c81f34..13ef38aaed03b208fe073282ba000b701e854915 100644
--- a/test/cctest/compiler/c-signature.h
+++ b/test/cctest/compiler/c-signature.h
@@ -12,20 +12,20 @@ namespace internal {
namespace compiler {
#define FOREACH_CTYPE_MACHINE_TYPE_MAPPING(V) \
- V(void, kMachNone) \
- V(bool, kMachUint8) \
- V(int8_t, kMachInt8) \
- V(uint8_t, kMachUint8) \
- V(int16_t, kMachInt16) \
- V(uint16_t, kMachUint16) \
- V(int32_t, kMachInt32) \
- V(uint32_t, kMachUint32) \
- V(int64_t, kMachInt64) \
- V(uint64_t, kMachUint64) \
- V(float, kMachFloat32) \
- V(double, kMachFloat64) \
- V(void*, kMachPtr) \
- V(int*, kMachPtr)
+ V(void, MachineType::None()) \
+ V(bool, MachineType::Uint8()) \
+ V(int8_t, MachineType::Int8()) \
+ V(uint8_t, MachineType::Uint8()) \
+ V(int16_t, MachineType::Int16()) \
+ V(uint16_t, MachineType::Uint16()) \
+ V(int32_t, MachineType::Int32()) \
+ V(uint32_t, MachineType::Uint32()) \
+ V(int64_t, MachineType::Int64()) \
+ V(uint64_t, MachineType::Uint64()) \
+ V(float, MachineType::Float32()) \
+ V(double, MachineType::Float64()) \
+ V(void*, MachineType::Pointer()) \
+ V(int*, MachineType::Pointer())
template <typename T>
inline MachineType MachineTypeForC() {
@@ -33,7 +33,7 @@ inline MachineType MachineTypeForC() {
// All other types T must be assignable to Object*
*(static_cast<Object* volatile*>(0)) = static_cast<T>(0);
}
- return kMachAnyTagged;
+ return MachineType::AnyTagged();
}
#define DECLARE_TEMPLATE_SPECIALIZATION(ctype, mtype) \
@@ -64,7 +64,7 @@ class CSignature : public MachineSignature {
if (p < static_cast<int>(parameter_count())) {
CHECK_EQ(GetParam(p), params[p]);
} else {
- CHECK_EQ(kMachNone, params[p]);
+ CHECK_EQ(MachineType::None(), params[p]);
}
}
}
@@ -74,13 +74,15 @@ class CSignature : public MachineSignature {
}
static CSignature* New(Zone* zone, MachineType ret,
- MachineType p1 = kMachNone, MachineType p2 = kMachNone,
- MachineType p3 = kMachNone, MachineType p4 = kMachNone,
- MachineType p5 = kMachNone) {
+ MachineType p1 = MachineType::None(),
+ MachineType p2 = MachineType::None(),
+ MachineType p3 = MachineType::None(),
+ MachineType p4 = MachineType::None(),
+ MachineType p5 = MachineType::None()) {
MachineType* buffer = zone->NewArray<MachineType>(6);
int pos = 0;
size_t return_count = 0;
- if (ret != kMachNone) {
+ if (ret != MachineType::None()) {
buffer[pos++] = ret;
return_count++;
}
@@ -90,14 +92,15 @@ class CSignature : public MachineSignature {
buffer[pos++] = p4;
buffer[pos++] = p5;
size_t param_count = 5;
- if (p5 == kMachNone) param_count--;
- if (p4 == kMachNone) param_count--;
- if (p3 == kMachNone) param_count--;
- if (p2 == kMachNone) param_count--;
- if (p1 == kMachNone) param_count--;
+ if (p5 == MachineType::None()) param_count--;
+ if (p4 == MachineType::None()) param_count--;
+ if (p3 == MachineType::None()) param_count--;
+ if (p2 == MachineType::None()) param_count--;
+ if (p1 == MachineType::None()) param_count--;
for (size_t i = 0; i < param_count; i++) {
- // Check that there are no kMachNone's in the middle of parameters.
- CHECK_NE(kMachNone, buffer[return_count + i]);
+ // Check that there are no MachineType::None()'s in the middle of
+ // parameters.
+ CHECK_NE(MachineType::None(), buffer[return_count + i]);
}
return new (zone) CSignature(return_count, param_count, buffer);
}
@@ -110,8 +113,8 @@ class CSignatureOf : public CSignature {
MachineType storage_[1 + kParamCount];
CSignatureOf()
- : CSignature(MachineTypeForC<Ret>() != kMachNone ? 1 : 0, kParamCount,
- reinterpret_cast<MachineType*>(&storage_)) {
+ : CSignature(MachineTypeForC<Ret>() != MachineType::None() ? 1 : 0,
+ kParamCount, reinterpret_cast<MachineType*>(&storage_)) {
if (return_count_ == 1) storage_[0] = MachineTypeForC<Ret>();
}
void Set(int index, MachineType type) {
« no previous file with comments | « src/machine-type.cc ('k') | test/cctest/compiler/codegen-tester.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698