5 #include "pcheader.hpp"
7 #define MAX_FUNC_STACKSIZE 0xFF
8 #define MAX_LITERALS ((VXInteger)0x7FFFFFFF)
9 #define NEW_SLVX_OT_ATTRIBUTES_FLAG 0x01
10 #define NEW_SLVX_OT_STATIC_FLAG 0x02
12 #define _FINISH(howmuchtojump) \
14 jump = howmuchtojump; \
18 #define _RET_ON_FAIL(exp) { if(!exp) return false; }
93 _OP_APPENDARRAY
= 0x22,
101 _OP_INSTANCEOF
= 0x2A,
111 _OP_POSTFOREACH
= 0x34,
122 struct VXInstructionDesc
133 VXInstruction(VXOpcode _op
,VXInteger a0
=0,VXInteger a1
=0,VXInteger a2
=0,VXInteger a3
=0)
136 _arg0
= (unsigned char)a0
;
137 _arg1
= (VXInteger
)a1
;
138 _arg2
= (unsigned char)a2
;
139 _arg3
= (unsigned char)a3
;
149 typedef VXVector
<VXInstruction
> VXInstructionVec
;
152 void FindOuter(VXState
* v
, VXObject
&target
, VXObject
*stackindex
);
153 void RelocateOuters(VXState
* v
);
154 void CloseOuters(VXState
* v
, VXObject
*stackindex
);
156 bool CallMetaMethod(VXState
* v
,
162 bool ArithMetaMethod(VXState
* v
,
168 bool Return(VXState
* v
,
173 bool ARITH_OP(VXState
* v
,
174 VXUnsignedInteger op
,
179 bool BW_OP(VXState
* v
,
180 VXUnsignedInteger op
,
185 bool NEG_OP(VXState
* v
,
189 bool CMP_OP(VXState
* v
,
195 bool CLOSURE_OP(VXState
* v
,
197 VXFuncProtoObj
*func
);
199 bool CLASS_OP(VXState
* v
,
203 //return true if the loop is finished
205 bool FOREACH_OP(VXState
* v
,
214 bool PLOCAL_INC(VXState
* v
,
220 bool DerefInc(VXState
* v
,
231 #endif // _VXOPCODES_H_