5 #include "src/compiler/operator.h" 16 V8_INLINE N CheckRange(
size_t val) {
20 CHECK_LE(val, std::min(static_cast<size_t>(std::numeric_limits<N>::max()),
21 static_cast<size_t>(kMaxInt)));
22 return static_cast<N
>(val);
27 Operator::Operator(Opcode opcode, Properties properties,
const char* mnemonic,
28 size_t value_in,
size_t effect_in,
size_t control_in,
29 size_t value_out,
size_t effect_out,
size_t control_out)
30 : mnemonic_(mnemonic),
32 properties_(properties),
33 value_in_(CheckRange<
uint32_t>(value_in)),
34 effect_in_(CheckRange<
uint32_t>(effect_in)),
35 control_in_(CheckRange<
uint32_t>(control_in)),
36 value_out_(CheckRange<
uint32_t>(value_out)),
37 effect_out_(CheckRange<uint8_t>(effect_out)),
38 control_out_(CheckRange<
uint32_t>(control_out)) {}
40 std::ostream& operator<<(std::ostream& os,
const Operator& op) {
45 void Operator::PrintToImpl(std::ostream& os, PrintVerbosity verbose)
const {
49 void Operator::PrintPropsTo(std::ostream& os)
const {
50 std::string separator =
"";
52 #define PRINT_PROP_IF_SET(name) \ 53 if (HasProperty(Operator::k##name)) { \ 58 OPERATOR_PROPERTY_LIST(PRINT_PROP_IF_SET)
59 #undef PRINT_PROP_IF_SET