machine-type.cc 950 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13
// 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) {        \
14
    if (before) os << "|"; \
15 16 17 18
    os << #bit;            \
    before = true;         \
  }

19

20
std::ostream& operator<<(std::ostream& os, const MachineType& type) {
21 22 23 24 25 26
  bool before = false;
  PRINT(kRepBit);
  PRINT(kRepWord8);
  PRINT(kRepWord16);
  PRINT(kRepWord32);
  PRINT(kRepWord64);
27
  PRINT(kRepFloat32);
28 29 30 31 32 33 34 35 36 37 38 39
  PRINT(kRepFloat64);
  PRINT(kRepTagged);

  PRINT(kTypeBool);
  PRINT(kTypeInt32);
  PRINT(kTypeUint32);
  PRINT(kTypeInt64);
  PRINT(kTypeUint64);
  PRINT(kTypeNumber);
  PRINT(kTypeAny);
  return os;
}
40 41 42 43 44 45 46


#undef PRINT

}  // namespace compiler
}  // namespace internal
}  // namespace v8