예제 #1
0
파일: lcode.cpp 프로젝트: swizl/lua
/*static*/ int FuncState::luaK_code (/*FuncState *fs,*/ Instruction i) {
	//Proto *f = fs->f;
	dischargejpc();  /* 'pc' will change */
	/* put new instruction in code array */
	luaM_growvector(ls->L, f->code, pc, f->sizecode, Instruction, MAX_INT, "opcodes");
	f->code[pc] = i;
	/* save corresponding line information */
	luaM_growvector(ls->L, f->lineinfo, pc, f->sizelineinfo, int, MAX_INT, "opcodes");
	f->lineinfo[pc] = ls->lastline;
	return pc++;
}
예제 #2
0
파일: lcode.c 프로젝트: AlvyPiper/lua-flex
static int luaK_code (FuncState *fs, Instruction i) {
    Proto *f = fs->f;
    dischargejpc(fs);    /* 'pc' will change */
    /* put new instruction in code array */
    luaM_growvector(fs->ls->L, f->code, fs->pc, f->sizecode, Instruction, MAX_INT, "opcodes");
    f->code[fs->pc] = i;
    /* save corresponding line information */
    luaM_growvector(fs->ls->L, f->lineinfo, fs->pc, f->sizelineinfo, int, MAX_INT, "opcodes");
    f->lineinfo[fs->pc] = fs->ls->lastline;
    return fs->pc++;
}
예제 #3
0
파일: code.c 프로젝트: unixbhaskar/ktap
static int codegen_code(ktap_funcstate *fs, ktap_instruction i)
{
	ktap_proto *f = fs->f;

	dischargejpc(fs);  /* `pc' will change */

	/* put new instruction in code array */
	ktapc_growvector(f->code, fs->pc, f->sizecode, ktap_instruction,
			 MAX_INT, "opcodes");
	f->code[fs->pc] = i;

	/* save corresponding line information */
	ktapc_growvector(f->lineinfo, fs->pc, f->sizelineinfo, int,
			 MAX_INT, "opcodes");
	f->lineinfo[fs->pc] = fs->ls->lastline;
	return fs->pc++;
}