本文整理汇总了C++中LBlock::label方法的典型用法代码示例。如果您正苦于以下问题:C++ LBlock::label方法的具体用法?C++ LBlock::label怎么用?C++ LBlock::label使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LBlock
的用法示例。
在下文中一共展示了LBlock::label方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: skipTrivialBlocks
void
CodeGeneratorMIPS64::visitOutOfLineTableSwitch(OutOfLineTableSwitch* ool)
{
MTableSwitch* mir = ool->mir();
masm.haltingAlign(sizeof(void*));
masm.bind(ool->jumpLabel()->target());
masm.addCodeLabel(*ool->jumpLabel());
for (size_t i = 0; i < mir->numCases(); i++) {
LBlock* caseblock = skipTrivialBlocks(mir->getCase(i))->lir();
Label* caseheader = caseblock->label();
uint32_t caseoffset = caseheader->offset();
// The entries of the jump table need to be absolute addresses and thus
// must be patched after codegen is finished. Each table entry uses 8
// instructions (4 for load address, 2 for branch, and 2 padding).
CodeLabel cl;
masm.ma_li(ScratchRegister, cl.patchAt());
masm.branch(ScratchRegister);
masm.as_nop();
masm.as_nop();
cl.target()->bind(caseoffset);
masm.addCodeLabel(cl);
}
}
示例2: if
void
CodeGeneratorX86Shared::emitBranch(Assembler::Condition cond, MBasicBlock *mirTrue,
MBasicBlock *mirFalse, Assembler::NaNCond ifNaN)
{
LBlock *ifTrue = mirTrue->lir();
LBlock *ifFalse = mirFalse->lir();
if (ifNaN == Assembler::NaN_IsFalse)
masm.j(Assembler::Parity, ifFalse->label());
else if (ifNaN == Assembler::NaN_IsTrue)
masm.j(Assembler::Parity, ifTrue->label());
if (isNextBlock(ifFalse)) {
masm.j(cond, ifTrue->label());
} else {
masm.j(Assembler::InvertCondition(cond), ifFalse->label());
if (!isNextBlock(ifTrue))
masm.jmp(ifTrue->label());
}
}