コード例 #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++;
}