• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ GET_OPCODE函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GET_OPCODE函数的典型用法代码示例。如果您正苦于以下问题:C++ GET_OPCODE函数的具体用法?C++ GET_OPCODE怎么用?C++ GET_OPCODE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了GET_OPCODE函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: check_an_msg

//-1 error
//1  tc
//0 normal
//2 retry
int
check_an_msg(ushort flag, uchar * domain, int *bk)
{
    uint get = 0;
    flag = ntohs(flag);
    //printf("flag is 0x%x\n",flag);
    get = GET_QR(flag);
    if (get == QR_Q)            //query
    {
        printf("answer set Q sign\n");
        return -1;
    }
    get = GET_OPCODE(flag);     //ignore.
    get = GET_AA(flag);         //ignore
    get = GET_TC(flag);
    if (get == 1)
        return 1;               //tc
    get = GET_RD(flag);         //ignore
    get = GET_ERROR(flag);
    if ((get != 0) && (get != NAME_ERROR))      //soa
    {
        switch (get) {
        case SERVER_FAIL:
            //printf("2server fail\n");
            break;
            //case NAME_ERROR: SOA
            //*bk = 1;
            //printf("3name error\n");
            //break;
        case FORMAT_ERROR:
            //*bk = 1;
            //printf("1format error\n");
            break;
        case NOT_IMPL:
            //printf("4not implation\n");
            break;
        case REFUSED:
            //printf("5server refused\n");
            break;
        }
        return 2;
    }
    return 0;
}
开发者ID:han4235,项目名称:dnspod-sr,代码行数:48,代码来源:dns.c


示例2: findsetreg

/*
** try to find last instruction before 'lastpc' that modified register 'reg'
*/
static int findsetreg (Proto *p, int lastpc, int reg) {
  int pc;
  int setreg = -1;  /* keep last instruction that changed 'reg' */
  int jmptarget = 0;  /* any code before this address is conditional */
  for (pc = 0; pc < lastpc; pc++) {
    Instruction i = p->code[pc];
    OpCode op = GET_OPCODE(i);
    int a = GETARG_A(i);
    switch (op) {
      case OP_LOADNIL: {
        int b = GETARG_B(i);
        if (a <= reg && reg <= a + b)  /* set registers from 'a' to 'a+b' */
          setreg = filterpc(pc, jmptarget);
        break;
      }
      case OP_TFORCALL: {
        if (reg >= a + 2)  /* affect all regs above its base */
          setreg = filterpc(pc, jmptarget);
        break;
      }
      case OP_CALL:
      case OP_TAILCALL: {
        if (reg >= a)  /* affect all registers above base */
          setreg = filterpc(pc, jmptarget);
        break;
      }
      case OP_JMP: {
        int b = GETARG_sBx(i);
        int dest = pc + 1 + b;
        /* jump is forward and do not skip 'lastpc'? */
        if (pc < dest && dest <= lastpc) {
          if (dest > jmptarget)
            jmptarget = dest;  /* update 'jmptarget' */
        }
        break;
      }
      default:
        if (testAMode(op) && reg == a)  /* any instruction that set A */
          setreg = filterpc(pc, jmptarget);
        break;
    }
  }
  return setreg;
}
开发者ID:Ardakaniz,项目名称:NazaraEngine,代码行数:47,代码来源:ldebug.cpp


示例3: switch

llvm::Value* Logical::PerformIntOp(llvm::Value* a, llvm::Value* b) {
    auto name = "result";
    switch (GET_OPCODE(cs_.instr_)) {
        case OP_BAND:
            return cs_.B_.CreateAnd(a, b, name);
        case OP_BOR:
            return cs_.B_.CreateOr(a, b, name);
        case OP_BXOR:
            return cs_.B_.CreateXor(a, b, name);
        case OP_SHL:
            return cs_.CreateCall("luaV_shiftl", {a, b}, name);
        case OP_SHR:
            return cs_.CreateCall("luaV_shiftl", {a, cs_.B_.CreateNeg(b)}, name);
        default:
            break;
    }
    assert(false);
    return nullptr;
}
开发者ID:gligneul,项目名称:Lua-Low-Level,代码行数:19,代码来源:llllogical.cpp


示例4: PrintCode

static void PrintCode(const Proto* tf)
{
 const Instruction* code=tf->code;
 const Instruction* p=code;
 for (;;)
 {
  int at=p-code+1;
  Instruction i=*p;
  int line=luaG_getline(tf->lineinfo,at-1,1,NULL);
  printf("%6d\t",at);
  if (line>=0) printf("[%d]\t",line); else printf("[-]\t");
  switch (GET_OPCODE(i)) {
#include "print.h"
  }
  printf("\n");
  if (i==OP_END) break;
  p++;
 }
}
开发者ID:jessicah,项目名称:Vision,代码行数:19,代码来源:print.c


示例5: luaK_patchlistaux

static void luaK_patchlistaux (FuncState *fs, int list, int target,
                               OpCode special, int special_target) {
  Instruction *code = fs->f->code;
  while (list != NO_JUMP) {
    int next = luaK_getjump(fs, list);
    Instruction *i = &code[list];
    OpCode op = GET_OPCODE(*i);
    if (op == special)  /* this `op' already has a value */
      luaK_fixjump(fs, list, special_target);
    else {
      luaK_fixjump(fs, list, target);  /* do the patch */
      if (op == OP_JMPONT)  /* remove eventual values */
        SET_OPCODE(*i, OP_JMPT);
      else if (op == OP_JMPONF)
        SET_OPCODE(*i, OP_JMPF);
    }
    list = next;
  }
}
开发者ID:xiaobinshe,项目名称:multitv,代码行数:19,代码来源:lcode.c


示例6: tws_dmamap_data_load_cbfn

static void
tws_dmamap_data_load_cbfn(void *arg, bus_dma_segment_t *segs,
                            int nseg, int error)
{

    struct tws_request *req = (struct tws_request *)arg;
    struct tws_softc *sc = req->sc;
    u_int16_t sgls = nseg;
    void *sgl_ptr;
    struct tws_cmd_generic *gcmd;

    if ( error == EFBIG )
        TWS_TRACE(sc, "not enough data segs", 0, nseg);


    if ( req->flags & TWS_DIR_IN )
        bus_dmamap_sync(req->sc->data_tag, req->dma_map,
                                            BUS_DMASYNC_PREREAD);
    if ( req->flags & TWS_DIR_OUT )
        bus_dmamap_sync(req->sc->data_tag, req->dma_map,
                                        BUS_DMASYNC_PREWRITE);
    if ( segs ) {
        if ( (req->type == TWS_PASSTHRU_REQ &&
             GET_OPCODE(req->cmd_pkt->cmd.pkt_a.res__opcode) !=
                            TWS_FW_CMD_EXECUTE_SCSI) ||
              req->type == TWS_GETSET_PARAM_REQ) {
            gcmd = &req->cmd_pkt->cmd.pkt_g.generic;
            sgl_ptr = (u_int32_t *)(gcmd) + gcmd->size;
            gcmd->size += sgls *
                          ((req->sc->is64bit && !tws_use_32bit_sgls) ? 4 :2 );
            tws_fill_sg_list(req->sc, segs, sgl_ptr, sgls);

        } else {
            tws_fill_sg_list(req->sc, segs,
                      (void *)req->cmd_pkt->cmd.pkt_a.sg_list, sgls);
            req->cmd_pkt->cmd.pkt_a.lun_h4__sgl_entries |= sgls ;
        }
    }


    req->error_code = tws_submit_command(req->sc, req);

}
开发者ID:kusumi,项目名称:DragonFlyBSD,代码行数:43,代码来源:tws_cam.c


示例7: findsetreg

/*
** try to find last instruction before 'lastpc' that modified register 'reg'
*/
static int findsetreg (Proto *p, int lastpc, int reg) {
  int pc;
  int setreg = -1;  /* keep last instruction that changed 'reg' */
  for (pc = 0; pc < lastpc; pc++) {
    Instruction i = p->code[pc];
    OpCode op = GET_OPCODE(i);
    int a = GETARG_A(i);
    switch (op) {
      case OP_LOADNIL: {
        int b = GETARG_B(i);
        if (a <= reg && reg <= a + b)  /* set registers from 'a' to 'a+b' */
          setreg = pc;
        break;
      }
      case OP_TFORCALL: {
        if (reg >= a + 2) setreg = pc;  /* affect all regs above its base */
        break;
      }
      case OP_CALL:
      case OP_TAILCALL: {
        if (reg >= a) setreg = pc;  /* affect all registers above base */
        break;
      }
      case OP_JMP: {
        int b = GETARG_sBx(i);
        int dest = pc + 1 + b;
        /* jump is forward and do not skip `lastpc'? */
        if (pc < dest && dest <= lastpc)
          pc += b;  /* do the jump */
        break;
      }
      case OP_TEST: {
        if (reg == a) setreg = pc;  /* jumped code can change 'a' */
        break;
      }
      default:
        if (testAMode(op) && reg == a)  /* any instruction that set A */
          setreg = pc;
        break;
    }
  }
  return setreg;
}
开发者ID:shitfSign,项目名称:lua4cn,代码行数:46,代码来源:ldebug.c


示例8: luaK_nil

/*
** Create a OP_LOADNIL instruction, but try to optimize: if the previous
** instruction is also OP_LOADNIL and ranges are compatible, adjust
** range of previous instruction instead of emitting a new one. (For
** instance, 'local a; local b' will generate a single opcode.)
*/
void luaK_nil (FuncState *fs, int from, int n) {
  Instruction *previous;
  int l = from + n - 1;  /* last register to set nil */
  if (fs->pc > fs->lasttarget) {  /* no jumps to current position? */
    previous = &fs->f->code[fs->pc-1];
    if (GET_OPCODE(*previous) == OP_LOADNIL) {  /* previous is LOADNIL? */
      int pfrom = GETARG_A(*previous);  /* get previous range */
      int pl = pfrom + GETARG_B(*previous);
      if ((pfrom <= from && from <= pl + 1) ||
          (from <= pfrom && pfrom <= l + 1)) {  /* can connect both? */
        if (pfrom < from) from = pfrom;  /* from = min(from, pfrom) */
        if (pl > l) l = pl;  /* l = max(l, pl) */
        SETARG_A(*previous, from);
        SETARG_B(*previous, l - from);
        return;
      }
    }  /* else go through */
  }
  luaK_codeABC(fs, OP_LOADNIL, from, n - 1, 0);  /* else no optimization */
}
开发者ID:celskeggs,项目名称:selkie,代码行数:26,代码来源:lcode.c


示例9: switch

llvm::Value* Arith::PerformIntOp(llvm::Value* lhs, llvm::Value* rhs) {
    auto name = "result";
    switch (GET_OPCODE(cs_.instr_)) {
        case OP_ADD:
            return cs_.B_.CreateAdd(lhs, rhs, name);
        case OP_SUB:
            return cs_.B_.CreateSub(lhs, rhs, name);
        case OP_MUL:
            return cs_.B_.CreateMul(lhs, rhs, name);
        case OP_MOD:
            return cs_.CreateCall("luaV_mod", {cs_.values_.state, lhs, rhs},
                    name);
        case OP_IDIV:
            return cs_.CreateCall("luaV_div", {cs_.values_.state, lhs, rhs},
                    name);
        default:
            break;
    }
    assert(false);
    return nullptr;
}
开发者ID:gligneul,项目名称:Lua-Low-Level,代码行数:21,代码来源:lllarith.cpp


示例10: tgVM_exec

void tgVM_exec(tgState* T) {
  tgOpcode op;
  tgValue *base = T->stack;
  for (;;) {
    op = GET_OPCODE(T);
    switch (op) {
      case OP_ADDRR:
        arith_op(T, tgAdd);
        break;
      case OP_SUBRR:
        arith_op(T, tgSub);
        break;
      case OP_MULRR:
        arith_op(T, tgMul);
        break;
      case OP_DIVRR:
        arith_op(T, tgDiv);
        break;
    }
  }
}
开发者ID:smorimura,项目名称:tiger,代码行数:21,代码来源:tvm.c


示例11: luaK_nil

void luaK_nil (FuncState *fs, int from, int n) {
    Instruction *previous;
    if (fs->pc > fs->lasttarget) {  /* no jumps to current position? */
        if (fs->pc == 0) {  /* function start? */
            if (from >= fs->nactvar)
                return;  /* positions are already clean */
        } else {
            previous = &fs->f->code[fs->pc - 1];
            if (GET_OPCODE(*previous) == OP_LOADNIL) {
                int pfrom = GETARG_A(*previous);
                int pto = GETARG_B(*previous);
                if (pfrom <= from && from <= pto + 1) { /* can connect both? */
                    if (from + n - 1 > pto)
                        SETARG_B(*previous, from + n - 1);
                    return;
                }
            }
        }
    }
    luaK_codeABC(fs, OP_LOADNIL, from, from + n - 1, 0); /* else no optimization */
}
开发者ID:xiqingping,项目名称:embedded_template,代码行数:21,代码来源:lcode.c


示例12: OptConstants

static void OptConstants(Proto* tf)
{
 Instruction* p;
 int n=tf->nknum+tf->nkstr;
 Hash* map=luaH_new(L,n);
 int m=MapConstants(tf,map);
#ifdef DEBUG
 printf("%p n=%d m=%d %s\n",tf,n,m,(m==n)?"nothing to optimize":"yes!");
#endif
 if (m==n) return;
 for (p=tf->code;; p++)
 {
  Instruction i=*p;
  int op=GET_OPCODE(i);
  switch (op)
  {
   TObject o;
   int j,k;
   case OP_PUSHNUM: case OP_PUSHNEGNUM:
    j=GETARG_U(i);
    ttype(&o)=LUA_TNUMBER; nvalue(&o)=tf->knum[j];
    k=MapConstant(map,-1,&o);
    if (k!=j) *p=CREATE_U(op,k);
    break;
   case OP_PUSHSTRING: case OP_GETGLOBAL: case OP_GETDOTTED:
   case OP_PUSHSELF:   case OP_SETGLOBAL:
    j=GETARG_U(i);
    ttype(&o)=LUA_TSTRING; tsvalue(&o)=tf->kstr[j];
    k=MapConstant(map,-1,&o);
    if (k!=j) *p=CREATE_U(op,k);
    break;
   case OP_END:
    PackConstants(tf,map);
    luaH_free(L,map);
    return;
   default:
    break;
  }
 }
}
开发者ID:jessicah,项目名称:Vision,代码行数:40,代码来源:opt.c


示例13: ci_func

static const char *getobjname (CallInfo *ci, int stackpos, const char **name) {
    if (isLua(ci)) {  /* a Lua function? */
        Proto *p = ci_func(ci)->l.p;
        int pc = currentpc(ci);
        Instruction i;
        *name = luaF_getlocalname(p, stackpos+1, pc);
        if (*name)  /* is a local? */
            return "local";
        i = luaG_symbexec(p, pc, stackpos);  /* try symbolic execution */
        lua_assert(pc != -1);
        switch (GET_OPCODE(i)) {
        case OP_GETGLOBAL: {
            int g = GETARG_Bx(i);  /* global index */
            lua_assert(ttisstring(&p->k[g]));
            *name = svalue(&p->k[g]);
            return "global";
        }
        case OP_MOVE: {
            int a = GETARG_A(i);
            int b = GETARG_B(i);  /* move from `b' to `a' */
            if (b < a)
                return getobjname(ci, b, name);  /* get name for `b' */
            break;
        }
        case OP_GETTABLE: {
            int k = GETARG_C(i);  /* key index */
            *name = kname(p, k);
            return "field";
        }
        case OP_SELF: {
            int k = GETARG_C(i);  /* key index */
            *name = kname(p, k);
            return "method";
        }
        default:
            break;
        }
    }
    return NULL;  /* no useful name found */
}
开发者ID:0xmono,项目名称:miranda-ng,代码行数:40,代码来源:ldebug.c


示例14: TrObject_method

TrCallSite *TrVM::lookup(TrBlock *b, OBJ receiver, OBJ msg, TrInst *ip)
{
   TrVM *vm = this;
   
   OBJ method = TrObject_method(this, receiver, msg);
   
   TrInst *boing = (ip - 1);
   /* TODO: do not prealloc TrCallSite here, every one is a memory leak and a new
    one is created on polymorphic calls. */
   b->sites.emplace_back();
   TrCallSite *s = &b->sites.back();
   s->klass = TR_CLASS(receiver);
   s->miss = 0;
   s->method = method;
   s->message = msg;
   if (unlikely(method == TR_NIL))
   {
      s->method = TrObject_method(this, receiver, tr_intern("method_missing"));
      s->method_missing = 1;
   }
   
   /* Implement Monomorphic method cache by replacing the previous instruction (BOING)
    w/ CACHE that uses the CallSite to find the method instead of doing a full lookup. */
   if (GET_OPCODE(*boing) == TR_OP_CACHE)
   {
      /* Existing call site */
      /* TODO: maybe take existing call site hit miss into consideration to replace it with this one.
       For now, we just don't replace it, the first one is always the cached one. */
   }
   else
   {
      /* New call site, we cache it fo shizzly! */
      SET_OPCODE(*boing, TR_OP_CACHE);
      SETARG_A(*boing, GETARG_A(*ip)); /* receiver register */
      SETARG_B(*boing, 1); /* jmp */
      SETARG_C(*boing, b->sites.size()-1); /* CallSite index */
   }
   
   return s;
}
开发者ID:jtomschroeder,项目名称:tinyrb,代码行数:40,代码来源:vm.cpp


示例15: luaK_nil

/* Emit bytecode to set a range of registers to nil. */
void luaK_nil (FuncState *fs, int from, int n) {
  Instruction *previous;
  int l = from + n - 1;  /* last register to set nil */
  if (fs->pc > fs->lasttarget) {  /* no jumps to current position? */
    previous = &fs->f->code[fs->pc-1];
    if (GET_OPCODE(*previous) == OP_LOADNIL) { /* Try to merge with the previous instruction. */
      int pfrom = GETARG_A(*previous);
      int pl = pfrom + GETARG_B(*previous);
      if ((pfrom <= from && from <= pl + 1) ||
          (from <= pfrom && pfrom <= l + 1)) {  /* can connect both? */
        if (pfrom < from) from = pfrom;  /* from = min(from, pfrom) */
        if (pl > l) l = pl;  /* l = max(l, pl) */
        SETARG_A(*previous, from);
        DEBUG_CODEGEN(raviY_printf(fs, "[%d]* %o ; set A to %d\n", fs->pc - 1, *previous, from));
        SETARG_B(*previous, l - from);
        DEBUG_CODEGEN(raviY_printf(fs, "[%d]* %o ; set B to %d\n", fs->pc - 1, *previous, (l - from)));
        return;
      }
    }  /* else go through */
  }
  luaK_codeABC(fs, OP_LOADNIL, from, n - 1, 0);  /* else no optimization */
}
开发者ID:galek,项目名称:ravi,代码行数:23,代码来源:lcode.c


示例16: OptConstants

static void OptConstants(Proto* tf)
{
	Instruction* p;
	int n=tf->nknum+tf->nkstr;
	Hash* map=luaH_new(compile_lua_state,n);
	int m=MapConstants(tf,map);

	if (m==n) return;
	for (p=tf->code;; p++)
	{
		Instruction i=*p;
		int op=GET_OPCODE(i);
		switch (op)
		{
			TObject o;
			int j,k;
		case OP_PUSHNUM: case OP_PUSHNEGNUM:
			j=GETARG_U(i);
			ttype(&o)=LUA_TNUMBER; nvalue(&o)=tf->knum[j];
			k=MapConstant(map,-1,&o);
			if (k!=j) *p=CREATE_U(op,k);
			break;
		case OP_PUSHSTRING: case OP_GETGLOBAL: case OP_GETDOTTED:
		case OP_PUSHSELF:   case OP_SETGLOBAL:
			j=GETARG_U(i);
			ttype(&o)=LUA_TSTRING; tsvalue(&o)=tf->kstr[j];
			k=MapConstant(map,-1,&o);
			if (k!=j) *p=CREATE_U(op,k);
			break;
		case OP_END:
			PackConstants(tf,map);
			luaH_free(compile_lua_state,map);
			return;
		default:
			break;
		}
	}
}
开发者ID:jcubic,项目名称:ToME,代码行数:38,代码来源:luac.c


示例17: ci_func

static const char *getfuncname (lua_State *L, CallInfo *ci, const char **name) {
  TMS tm;
  Proto *p = ci_func(ci)->p;  /* calling function */
  int pc = currentpc(ci);  /* calling instruction index */
  Instruction i = p->code[pc];  /* calling instruction */
  switch (GET_OPCODE(i)) {
    case OP_CALL:
    case OP_TAILCALL:  /* get function name */
      return getobjname(p, pc, GETARG_A(i), name);
    case OP_TFORCALL: {  /* for iterator */
      *name = "for iterator";
       return "for iterator";
    }
    /* all other instructions can call only through metamethods */
    case OP_SELF:
    case OP_GETTABUP:
    case OP_GETTABLE: tm = TM_INDEX; break;
    case OP_SETTABUP:
    case OP_SETTABLE: tm = TM_NEWINDEX; break;
    case OP_EQ: tm = TM_EQ; break;
    case OP_ADD: tm = TM_ADD; break;
    case OP_SUB: tm = TM_SUB; break;
    case OP_MUL: tm = TM_MUL; break;
    case OP_DIV: tm = TM_DIV; break;
    case OP_IDIV: tm = TM_IDIV; break;
    case OP_MOD: tm = TM_MOD; break;
    case OP_POW: tm = TM_POW; break;
    case OP_UNM: tm = TM_UNM; break;
    case OP_LEN: tm = TM_LEN; break;
    case OP_LT: tm = TM_LT; break;
    case OP_LE: tm = TM_LE; break;
    case OP_CONCAT: tm = TM_CONCAT; break;
    default:
      return NULL;  /* else no useful name can be found */
  }
  *name = getstr(G(L)->tmname[tm]);
  return "metamethod";
}
开发者ID:hongzhidao,项目名称:yet-another-lua,代码行数:38,代码来源:ldebug.c


示例18: check_method_breakpoint

static int32_t
check_method_breakpoint(mrb_state *mrb, mrb_irep *irep, mrb_code *pc, mrb_value *regs)
{
  struct RClass* c;
  mrb_sym sym;
  int32_t bpno;
  mrb_bool isCfunc;

  mrb_debug_context *dbg = mrb_debug_context_get(mrb);

  isCfunc = FALSE;
  bpno = dbg->method_bpno;
  dbg->method_bpno = 0;

  switch(GET_OPCODE(*pc)) {
    case OP_SEND:
    case OP_SENDB:
      c = mrb_class(mrb, regs[GETARG_A(*pc)]);
      sym = irep->syms[GETARG_B(*pc)];
      break;
    case OP_SUPER:
      c = mrb->c->ci->target_class->super;
      sym = mrb->c->ci->mid;
      break;
    default:
      sym = 0;
      break;
  }
  if(sym != 0) {
    dbg->method_bpno = mrb_debug_check_breakpoint_method(mrb, dbg, c, sym, &isCfunc);
    if(isCfunc) {
      bpno = dbg->method_bpno;
      dbg->method_bpno = 0;
    }
  }
  dbg->isCfunc = isCfunc;
  return bpno;
}
开发者ID:Asmod4n,项目名称:mruby,代码行数:38,代码来源:mrdb.c


示例19: getfuncname2

const char* getfuncname2 (LuaThread *L, LuaStackFrame *ci, std::string& name) {
  THREAD_CHECK(L);
  TMS tm;
  LuaProto *p = ci->getFunc()->getLClosure()->proto_;  /* calling function */
  int pc = ci->getCurrentPC();  /* calling instruction index */
  Instruction i = p->instructions_[pc];  /* calling instruction */
  switch (GET_OPCODE(i)) {
    case OP_CALL:
    case OP_TAILCALL:  /* get function name */
      return getobjname2(p, pc, GETARG_A(i), name);
    case OP_TFORCALL: {  /* for iterator */
      name = "for iterator";
      return "for iterator";
    }
    /* all other instructions can call only through metamethods */
    case OP_SELF:
    case OP_GETTABUP:
    case OP_GETTABLE: tm = TM_INDEX; break;
    case OP_SETTABUP:
    case OP_SETTABLE: tm = TM_NEWINDEX; break;
    case OP_EQ: tm = TM_EQ; break;
    case OP_ADD: tm = TM_ADD; break;
    case OP_SUB: tm = TM_SUB; break;
    case OP_MUL: tm = TM_MUL; break;
    case OP_DIV: tm = TM_DIV; break;
    case OP_MOD: tm = TM_MOD; break;
    case OP_POW: tm = TM_POW; break;
    case OP_UNM: tm = TM_UNM; break;
    case OP_LEN: tm = TM_LEN; break;
    case OP_LT: tm = TM_LT; break;
    case OP_LE: tm = TM_LE; break;
    case OP_CONCAT: tm = TM_CONCAT; break;
    default:
      return NULL;  /* else no useful name can be found */
  }
  name = G(L)->tagmethod_names_[tm]->c_str();
  return "metamethod";
}
开发者ID:aappleby,项目名称:Lumina,代码行数:38,代码来源:ldebug.cpp


示例20: luaK_patchlistaux

static void luaK_patchlistaux (FuncState *fs, int list,
          int ttarget, int treg, int ftarget, int freg, int dtarget) {
  while (list != NO_JUMP) {
    int next = luaK_getjump(fs, list);
    Instruction *i = getjumpcontrol(fs, list);
    if (GET_OPCODE(*i) != OP_TEST) {
      lua_assert(dtarget != NO_JUMP);
      luaK_fixjump(fs, list, dtarget);  /* jump to default target */
    }
    else {
      if (GETARG_C(*i)) {
        lua_assert(ttarget != NO_JUMP);
        patchtestreg(i, treg);
        luaK_fixjump(fs, list, ttarget);
      }
      else {
        lua_assert(ftarget != NO_JUMP);
        patchtestreg(i, freg);
        luaK_fixjump(fs, list, ftarget);
      }
    }
    list = next;
  }
}
开发者ID:yuanxiubin1128,项目名称:mmo-resourse,代码行数:24,代码来源:lcode.c



注:本文中的GET_OPCODE函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GET_OVERLAY_PRIV函数代码示例发布时间:2022-05-30
下一篇:
C++ GET_NODE函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap