This commit is contained in:
parent
23900f2aed
commit
c4b63a3018
@ -1078,7 +1078,7 @@ PH7_PRIVATE sxi32 PH7_CompileVariable(ph7_gen_state *pGen, sxi32 iCompileFlag) {
|
|||||||
}
|
}
|
||||||
p3 = (void *)zName;
|
p3 = (void *)zName;
|
||||||
/* Emit the load instruction */
|
/* Emit the load instruction */
|
||||||
PH7_VmEmitInstr(pGen->pVm, 0, PH7_OP_LOAD, 0, 0, p3, 0);
|
PH7_VmEmitInstr(pGen->pVm, 0, PH7_OP_LOADV, 0, 0, p3, 0);
|
||||||
/* Node successfully compiled */
|
/* Node successfully compiled */
|
||||||
return SXRET_OK;
|
return SXRET_OK;
|
||||||
}
|
}
|
||||||
@ -4679,7 +4679,7 @@ static sxi32 PH7_GenStateEmitExprCode(
|
|||||||
/* Static member access,remember that */
|
/* Static member access,remember that */
|
||||||
iP1 = 1;
|
iP1 = 1;
|
||||||
pInstr = PH7_VmPeekInstr(pGen->pVm);
|
pInstr = PH7_VmPeekInstr(pGen->pVm);
|
||||||
if(pInstr && pInstr->iOp == PH7_OP_LOAD) {
|
if(pInstr && pInstr->iOp == PH7_OP_LOADV) {
|
||||||
p3 = pInstr->p3;
|
p3 = pInstr->p3;
|
||||||
(void)PH7_VmPopInstr(pGen->pVm);
|
(void)PH7_VmPopInstr(pGen->pVm);
|
||||||
}
|
}
|
||||||
|
10
engine/vm.c
10
engine/vm.c
@ -2475,12 +2475,12 @@ static sxi32 VmByteCodeExec(
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* LOAD: * * P3
|
* LOADV: * * P3
|
||||||
*
|
*
|
||||||
* Load a variable where it's name is taken from the top of the stack or
|
* Load a variable where it's name is taken from the top of the stack or
|
||||||
* from the P3 operand.
|
* from the P3 operand.
|
||||||
*/
|
*/
|
||||||
case PH7_OP_LOAD: {
|
case PH7_OP_LOADV: {
|
||||||
ph7_value *pObj;
|
ph7_value *pObj;
|
||||||
SyString sName;
|
SyString sName;
|
||||||
if(pInstr->p3 == 0) {
|
if(pInstr->p3 == 0) {
|
||||||
@ -4485,7 +4485,7 @@ static sxi32 VmByteCodeExec(
|
|||||||
SyString sName;
|
SyString sName;
|
||||||
VmInstr *bInstr = &aInstr[pc - 1];
|
VmInstr *bInstr = &aInstr[pc - 1];
|
||||||
/* Extract function name */
|
/* Extract function name */
|
||||||
if(pTos->iFlags & MEMOBJ_STRING && bInstr->iOp == PH7_OP_LOAD) {
|
if(pTos->iFlags & MEMOBJ_STRING && bInstr->iOp == PH7_OP_LOADV) {
|
||||||
PH7_VmThrowError(&(*pVm), PH7_CTX_ERR, "Calling a non-callable object");
|
PH7_VmThrowError(&(*pVm), PH7_CTX_ERR, "Calling a non-callable object");
|
||||||
} else if((pTos->iFlags & (MEMOBJ_CALL | MEMOBJ_STRING)) == 0) {
|
} else if((pTos->iFlags & (MEMOBJ_CALL | MEMOBJ_STRING)) == 0) {
|
||||||
if(pTos->iFlags & MEMOBJ_HASHMAP) {
|
if(pTos->iFlags & MEMOBJ_HASHMAP) {
|
||||||
@ -5220,8 +5220,8 @@ static const char *VmInstrToString(sxi32 nOp) {
|
|||||||
case PH7_OP_DECLARE:
|
case PH7_OP_DECLARE:
|
||||||
zOp = "DECLARE";
|
zOp = "DECLARE";
|
||||||
break;
|
break;
|
||||||
case PH7_OP_LOAD:
|
case PH7_OP_LOADV:
|
||||||
zOp = "LOAD";
|
zOp = "LOADV";
|
||||||
break;
|
break;
|
||||||
case PH7_OP_LOADC:
|
case PH7_OP_LOADC:
|
||||||
zOp = "LOADC";
|
zOp = "LOADC";
|
||||||
|
@ -1385,7 +1385,7 @@ enum ph7_vm_op {
|
|||||||
PH7_OP_DONE = 1, /* Done */
|
PH7_OP_DONE = 1, /* Done */
|
||||||
PH7_OP_HALT, /* Halt */
|
PH7_OP_HALT, /* Halt */
|
||||||
PH7_OP_DECLARE, /* Declare a variable */
|
PH7_OP_DECLARE, /* Declare a variable */
|
||||||
PH7_OP_LOAD, /* Load memory object */
|
PH7_OP_LOADV, /* Load variable */
|
||||||
PH7_OP_LOADC, /* Load constant */
|
PH7_OP_LOADC, /* Load constant */
|
||||||
PH7_OP_LOAD_IDX, /* Load array entry */
|
PH7_OP_LOAD_IDX, /* Load array entry */
|
||||||
PH7_OP_LOAD_MAP, /* Load hashmap('array') */
|
PH7_OP_LOAD_MAP, /* Load hashmap('array') */
|
||||||
|
Loading…
Reference in New Issue
Block a user