本文整理汇总了C++中discharge2reg函数的典型用法代码示例。如果您正苦于以下问题:C++ discharge2reg函数的具体用法?C++ discharge2reg怎么用?C++ discharge2reg使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了discharge2reg函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: discharge2anyreg
static void discharge2anyreg(FuncState *fs, expdesc *e)
{
if (e->k != VNONRELOC) {
codegen_reserveregs(fs, 1);
discharge2reg(fs, e, fs->freereg-1);
}
}
开发者ID:WeiY,项目名称:ktap,代码行数:7,代码来源:code.c
示例2: exp2reg
/*
** Ensures final expression result (including results from its jump
** lists) is in register 'reg'.
** If expression has jumps, need to patch these jumps either to
** its final position or to "load" instructions (for those tests
** that do not produce values).
*/
static void exp2reg (FuncState *fs, expdesc *e, int reg) {
discharge2reg(fs, e, reg);
if (e->k == VJMP) /* expression itself is a test? */
luaK_concat(fs, &e->t, e->u.info); /* put this jump in 't' list */
if (hasjumps(e)) {
int final; /* position after whole expression */
int p_f = NO_JUMP; /* position of an eventual LOAD false */
int p_t = NO_JUMP; /* position of an eventual LOAD true */
if (need_value(fs, e->t) || need_value(fs, e->f)) {
int fj = (e->k == VJMP) ? NO_JUMP : luaK_jump(fs);
p_f = code_loadbool(fs, reg, 0, 1);
p_t = code_loadbool(fs, reg, 1, 0);
luaK_patchtohere(fs, fj);
}
final = luaK_getlabel(fs);
patchlistaux(fs, e->f, final, reg, p_f);
patchlistaux(fs, e->t, final, reg, p_t);
}
开发者ID:celskeggs,项目名称:selkie,代码行数:25,代码来源:lcode.c
示例3: exp2reg
static void exp2reg (FuncState *fs, expdesc *e, int reg) {
discharge2reg(fs, e, reg);
if (e->k == VJMP)
luaK_concat(fs, &e->t, e->u.info); /* put this jump in `t' list */
if (hasjumps(e)) {
if (e->k != VJMP)
luaK_goiftrue(fs, e);
int fj = (e->k == VJMP) ? NO_JUMP : luaK_jump(fs);
int p_f = code_label(fs, reg, 0, 1);
luaK_patchtohere(fs, fj);
int p_t = code_label(fs, reg, 1, 0);
patchlistaux(fs, e->f, p_f);
patchlistaux(fs, e->t, p_t);
}
e->f = e->t = NO_JUMP;
e->u.info = reg;
e->k = VNONRELOC;
}
开发者ID:hongzhidao,项目名称:yet-another-lua,代码行数:18,代码来源:lcode.c
示例4: discharge2reg
/*static*/ void FuncState::exp2reg (/*FuncState *fs,*/ expdesc *e, int reg) {
discharge2reg(e, reg);
if (e->k == VJMP)
luaK_concat(&e->t, e->u.info); /* put this jump in 't' list */
if (hasjumps(e)) {
int final; /* position after whole expression */
int p_f = NO_JUMP; /* position of an eventual LOAD false */
int p_t = NO_JUMP; /* position of an eventual LOAD true */
if (need_value(e->t) || need_value(e->f)) {
int fj = (e->k == VJMP) ? NO_JUMP : luaK_jump();
p_f = code_label(reg, 0, 1);
p_t = code_label(reg, 1, 0);
luaK_patchtohere(fj);
}
final = luaK_getlabel();
patchlistaux(e->f, final, reg, p_f);
patchlistaux(e->t, final, reg, p_t);
}
开发者ID:swizl,项目名称:lua,代码行数:18,代码来源:lcode.cpp
示例5: exp2reg
static void exp2reg(ktap_funcstate *fs, ktap_expdesc *e, int reg)
{
discharge2reg(fs, e, reg);
if (e->k == VJMP)
codegen_concat(fs, &e->t, e->u.info); /* put this jump in `t' list */
if (hasjumps(e)) {
int final; /* position after whole expression */
int p_f = NO_JUMP; /* position of an eventual LOAD false */
int p_t = NO_JUMP; /* position of an eventual LOAD true */
if (need_value(fs, e->t) || need_value(fs, e->f)) {
int fj = (e->k == VJMP) ? NO_JUMP : codegen_jump(fs);
p_f = code_label(fs, reg, 0, 1);
p_t = code_label(fs, reg, 1, 0);
codegen_patchtohere(fs, fj);
}
final = codegen_getlabel(fs);
patchlistaux(fs, e->f, final, reg, p_f);
patchlistaux(fs, e->t, final, reg, p_t);
}
开发者ID:unixbhaskar,项目名称:ktap,代码行数:21,代码来源:code.c
示例6: discharge2anyreg
/*
** Ensures expression value is in any register.
*/
static void discharge2anyreg (FuncState *fs, expdesc *e) {
if (e->k != VNONRELOC) { /* no fixed register yet? */
luaK_reserveregs(fs, 1); /* get a register */
discharge2reg(fs, e, fs->freereg-1); /* put value there */
}
}
开发者ID:celskeggs,项目名称:selkie,代码行数:9,代码来源:lcode.c
示例7: discharge2anyreg
static void ICACHE_FLASH_ATTR discharge2anyreg (FuncState *fs, expdesc *e) {
if (e->k != VNONRELOC) {
luaK_reserveregs(fs, 1);
discharge2reg(fs, e, fs->freereg-1);
}
}
开发者ID:Squonk42,项目名称:nodelua,代码行数:6,代码来源:lcode.c
示例8: luaK_reserveregs
/*static*/ void FuncState::discharge2anyreg (/*FuncState *fs,*/ expdesc *e) {
if (e->k != VNONRELOC) {
luaK_reserveregs(1);
discharge2reg(e, free_reg-1);
}
}
开发者ID:swizl,项目名称:lua,代码行数:6,代码来源:lcode.cpp
注:本文中的discharge2reg函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论