本文整理汇总了C++中VMMethod::set_breakpoint_flags方法的典型用法代码示例。如果您正苦于以下问题:C++ VMMethod::set_breakpoint_flags方法的具体用法?C++ VMMethod::set_breakpoint_flags怎么用?C++ VMMethod::set_breakpoint_flags使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VMMethod
的用法示例。
在下文中一共展示了VMMethod::set_breakpoint_flags方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: test_set_breakpoint_flags
void test_set_breakpoint_flags() {
CompiledMethod* cm = CompiledMethod::create(state);
Tuple* tup = Tuple::from(state, 1, state->symbol("@blah"));
cm->literals(state, tup);
InstructionSequence* iseq = InstructionSequence::create(state, 3);
iseq->opcodes()->put(state, 0, Fixnum::from(InstructionSequence::insn_push_ivar));
iseq->opcodes()->put(state, 1, Fixnum::from(0));
iseq->opcodes()->put(state, 2, Fixnum::from(InstructionSequence::insn_push_nil));
cm->iseq(state, iseq);
VMMethod* vmm = new VMMethod(state, cm);
vmm->set_breakpoint_flags(state, 0, 1 << 24);
TS_ASSERT_EQUALS(vmm->opcodes[0], (1U << 24) | static_cast<unsigned int>(InstructionSequence::insn_push_ivar));
vmm->set_breakpoint_flags(state, 0, 7 << 24);
TS_ASSERT_EQUALS(vmm->opcodes[0], (7U << 24) | static_cast<unsigned int>(InstructionSequence::insn_push_ivar));
vmm->set_breakpoint_flags(state, 0, 0);
TS_ASSERT_EQUALS(vmm->opcodes[0], static_cast<unsigned int>(InstructionSequence::insn_push_ivar));
vmm->set_breakpoint_flags(state, 1, 1);
TS_ASSERT_EQUALS(vmm->opcodes[1], 0U);
}