5 #include "src/interpreter/bytecode-node.h" 8 #include "src/source-position-table.h" 12 namespace interpreter {
14 void BytecodeNode::Print(std::ostream& os)
const {
16 std::ios saved_state(
nullptr);
17 saved_state.copyfmt(os);
18 os << Bytecodes::ToString(bytecode_);
20 for (
int i = 0;
i < operand_count(); ++
i) {
21 os <<
' ' << std::setw(8) << std::setfill(
'0') << std::hex << operands_[
i];
23 os.copyfmt(saved_state);
25 if (source_info_.is_valid()) {
26 os <<
' ' << source_info_;
30 os << static_cast<const void*>(
this);
34 bool BytecodeNode::operator==(
const BytecodeNode& other)
const {
37 }
else if (this->bytecode() != other.bytecode() ||
38 this->source_info() != other.source_info()) {
41 for (
int i = 0;
i < this->operand_count(); ++
i) {
42 if (this->operand(
i) != other.operand(
i)) {
50 std::ostream& operator<<(std::ostream& os,
const BytecodeNode& node) {