2014-08-14 09:19:54 +00:00
|
|
|
// 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.
|
|
|
|
|
2015-12-03 13:33:14 +00:00
|
|
|
#include "src/machine-type.h"
|
2014-08-14 09:19:54 +00:00
|
|
|
#include "src/ostreams.h"
|
|
|
|
|
|
|
|
namespace v8 {
|
|
|
|
namespace internal {
|
|
|
|
|
|
|
|
#define PRINT(bit) \
|
|
|
|
if (type & bit) { \
|
2014-08-25 10:35:38 +00:00
|
|
|
if (before) os << "|"; \
|
2014-08-14 09:19:54 +00:00
|
|
|
os << #bit; \
|
|
|
|
before = true; \
|
|
|
|
}
|
|
|
|
|
2014-08-25 10:35:38 +00:00
|
|
|
|
2014-09-30 10:29:32 +00:00
|
|
|
std::ostream& operator<<(std::ostream& os, const MachineType& type) {
|
2014-08-14 09:19:54 +00:00
|
|
|
bool before = false;
|
|
|
|
PRINT(kRepBit);
|
|
|
|
PRINT(kRepWord8);
|
|
|
|
PRINT(kRepWord16);
|
|
|
|
PRINT(kRepWord32);
|
|
|
|
PRINT(kRepWord64);
|
2014-08-26 08:29:12 +00:00
|
|
|
PRINT(kRepFloat32);
|
2014-08-14 09:19:54 +00:00
|
|
|
PRINT(kRepFloat64);
|
|
|
|
PRINT(kRepTagged);
|
|
|
|
|
|
|
|
PRINT(kTypeBool);
|
|
|
|
PRINT(kTypeInt32);
|
|
|
|
PRINT(kTypeUint32);
|
|
|
|
PRINT(kTypeInt64);
|
|
|
|
PRINT(kTypeUint64);
|
|
|
|
PRINT(kTypeNumber);
|
|
|
|
PRINT(kTypeAny);
|
|
|
|
return os;
|
|
|
|
}
|
2014-08-25 10:35:38 +00:00
|
|
|
|
|
|
|
|
|
|
|
#undef PRINT
|
|
|
|
|
|
|
|
} // namespace internal
|
|
|
|
} // namespace v8
|