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

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

Issue 470593002: Unify MachineType and RepType. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 months 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-type.h ('k') | src/compiler/representation-change.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/machine-type.cc
diff --git a/src/compiler/machine-type.cc b/src/compiler/machine-type.cc
new file mode 100644
index 0000000000000000000000000000000000000000..b02fe293148f5c261b477345fd562b43fc4bd4a4
--- /dev/null
+++ b/src/compiler/machine-type.cc
@@ -0,0 +1,40 @@
+// Copyright 2014 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "src/compiler/machine-type.h"
+#include "src/ostreams.h"
+
+namespace v8 {
+namespace internal {
+namespace compiler {
+
+#define PRINT(bit) \
+ if (type & bit) { \
+ if (before) os << "|"; \
+ os << #bit; \
+ before = true; \
+ }
+
+OStream& operator<<(OStream& os, const MachineType& type) {
+ bool before = false;
+ PRINT(kRepBit);
+ PRINT(kRepWord8);
+ PRINT(kRepWord16);
+ PRINT(kRepWord32);
+ PRINT(kRepWord64);
+ PRINT(kRepFloat64);
+ PRINT(kRepTagged);
+
+ PRINT(kTypeBool);
+ PRINT(kTypeInt32);
+ PRINT(kTypeUint32);
+ PRINT(kTypeInt64);
+ PRINT(kTypeUint64);
+ PRINT(kTypeNumber);
+ PRINT(kTypeAny);
+ return os;
+}
+}
+}
+} // namespace v8::internal::compiler
« no previous file with comments | « src/compiler/machine-type.h ('k') | src/compiler/representation-change.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698