本文整理汇总了C++中StackValue::reg方法的典型用法代码示例。如果您正苦于以下问题:C++ StackValue::reg方法的具体用法?C++ StackValue::reg怎么用?C++ StackValue::reg使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StackValue
的用法示例。
在下文中一共展示了StackValue::reg方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: peek
void
FrameInfo::popValue(ValueOperand dest)
{
StackValue *val = peek(-1);
switch (val->kind()) {
case StackValue::Constant:
masm.moveValue(val->constant(), dest);
break;
case StackValue::LocalSlot:
masm.loadValue(addressOfLocal(val->localSlot()), dest);
break;
case StackValue::ArgSlot:
masm.loadValue(addressOfArg(val->argSlot()), dest);
break;
case StackValue::ThisSlot:
masm.loadValue(addressOfThis(), dest);
break;
case StackValue::Stack:
masm.popValue(dest);
break;
case StackValue::Register:
masm.moveValue(val->reg(), dest);
break;
default:
MOZ_ASSUME_UNREACHABLE("Invalid kind");
}
// masm.popValue already adjusted the stack pointer, don't do it twice.
pop(DontAdjustStack);
}
示例2: stackDepth
void
FrameInfo::popRegsAndSync(uint32_t uses)
{
// x86 has only 3 Value registers. Only support 2 regs here for now,
// so that there's always a scratch Value register for reg -> reg
// moves.
JS_ASSERT(uses > 0);
JS_ASSERT(uses <= 2);
JS_ASSERT(uses <= stackDepth());
syncStack(uses);
switch (uses) {
case 1:
popValue(R0);
break;
case 2: {
// If the second value is in R1, move it to R2 so that it's not
// clobbered by the first popValue.
StackValue *val = peek(-2);
if (val->kind() == StackValue::Register && val->reg() == R1) {
masm.moveValue(R1, R2);
val->setRegister(R2);
}
popValue(R1);
popValue(R0);
break;
}
default:
MOZ_ASSUME_UNREACHABLE("Invalid uses");
}
}