1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "src/compiler/operator.h"
15 static inline N CheckRange(size_t val) {
16 CHECK(val <= std::numeric_limits<N>::max());
17 return static_cast<N>(val);
21 Operator::Operator(Opcode opcode, Properties properties, const char* mnemonic,
22 size_t value_in, size_t effect_in, size_t control_in,
23 size_t value_out, size_t effect_out, size_t control_out)
25 properties_(properties),
27 value_in_(CheckRange<uint32_t>(value_in)),
28 effect_in_(CheckRange<uint16_t>(effect_in)),
29 control_in_(CheckRange<uint16_t>(control_in)),
30 value_out_(CheckRange<uint16_t>(value_out)),
31 effect_out_(CheckRange<uint8_t>(effect_out)),
32 control_out_(CheckRange<uint8_t>(control_out)) {}
35 std::ostream& operator<<(std::ostream& os, const Operator& op) {
41 void Operator::PrintTo(std::ostream& os) const { os << mnemonic(); }
43 } // namespace compiler
44 } // namespace internal