📄 execute.h
字号:
/*0207*/#define CHECKARRAY(thisArray, index) \
/*0208*/ if (thisArray) { \
/*0209*/ /* Check that the given index is within array boundaries */ \
/*0210*/ if (index >= 0 && index < (long)thisArray->length) {
/*0211*/
/*0212*//*=========================================================================
/*0213./ * ENDCHECKARRAY - Finish the check for valid array access
/*0214./ *=======================================================================*/
/*0215*/
/*0216*/#define ENDCHECKARRAY \
/*0217*/ } else goto handleArrayIndexOutOfBoundsException; \
/*0218*/ } else goto handleNullPointerException; \
/*0219*/
/*0220*//*=========================================================================
/*0221./ * CALL_VIRTUAL_METHOD - Branch to common code for Invokevirtual
/*0222./ *=======================================================================*/
/*0223*/
/*0224*/#define CALL_VIRTUAL_METHOD { \
/*0225*/ goto callMethod_virtual; \
/*0226*/}
/*0227*/
/*0228*//*=========================================================================
/*0229./ * CALL_STATIC_METHOD - Branch to common code for Invokestatic
/*0230./ *=======================================================================*/
/*0231*/
/*0232*/#define CALL_STATIC_METHOD { \
/*0233*/ goto callMethod_static; \
/*0234*/}
/*0235*/
/*0236*//*=========================================================================
/*0237./ * CALL_SPECIAL_METHOD - Branch to common code for Invokespecial
/*0238./ *=======================================================================*/
/*0239*/
/*0240*/#define CALL_SPECIAL_METHOD { \
/*0241*/ goto callMethod_special; \
/*0242*/}
/*0243*/
/*0244*//*=========================================================================
/*0245./ * CALL_INTERFACE_METHOD - Branch to common code for Invokeinterface
/*0246./ *=======================================================================*/
/*0247*/
/*0248*/#define CALL_INTERFACE_METHOD { \
/*0249*/ goto callMethod_interface; \
/*0250*/}
/*0251*/
/*0252*//*=========================================================================
/*0253./ * CHECK_NOT_NULL - Throw an exception of an object is null
/*0254./ *
/*0255./ * Use the following macro to place null checks where a NullPointerException
/*0256./ * should be thrown (e.g. invoking a virtual method on a null object).
/*0257./ * As this macro executes a continue statement, it must only be used where
/*0258./ * the continue will effect a jump to the start of the interpreter loop.
/*0259./ *=======================================================================*/
/*0260*/
/*0261*/#define CHECK_NOT_NULL(object) \
/*0262*/ if (object == NIL) { \
/*0263*/ goto handleNullPointerException; \
/*0264*/}
/*0265*/
/*0294*//*=========================================================================
/*0295./ * POP_FRAME - Macro to pop a stack frame
/*0296./ *=======================================================================*/
/*0305*/#define POP_FRAME POPFRAMEMACRO
/*0308*/
/*0309*//*=========================================================================
/*0310./ * INFREQUENTROUTINE - Have bytecode executed by the infrequent routine
/*0311./ *=======================================================================*/
/*0312*/
/*0313*/#if SPLITINFREQUENTBYTECODES
/*0314*/#define INFREQUENTROUTINE(x) case x: { goto callSlowInterpret; }
/*0315*/#else
/*0316*/#define INFREQUENTROUTINE(x) /**/
/*0317*/#endif
/*0318*/
/*0347*//*=========================================================================
/*0348./ * RESCHEDULE - Thread rescheduling
/*0349./ *=======================================================================*/
/*0350*/
/*0403*/
/*0404*//* This routine/macro is called from inside the interpreter */
/*0405*//* to check if it is time to perform thread switching and */
/*0406*//* possibly to check for external events. This routine is */
/*0407*//* very performance critical! Most of the function calls */
/*0408*//* inside this macro definition turn into null statements */
/*0409*//* in production builds when debugger support is turned off */
/*0410*/
/*0411*/#define RESCHEDULE { \
/*0413*/ checkRescheduleValid(); \
/*0414*/ if (isTimeToReschedule()) { \
/*0415*/ VMSAVE \
/*0416*/ reschedule(); \
/*0417*/ VMRESTORE \
/*0418*/ } \
/*0419*/}
/*0422*/
/*0423*//*=========================================================================
/*0424./ * BRANCHIF - Macro to cause a branch if a condition is true
/*0425./ *=======================================================================*/
/*0426*/
/*0427*/#if COMMONBRANCHING
/*0428*/#define BRANCHIF(cond) { if(cond) { goto branchPoint; } else { goto next3; } }
/*0429*/#else
/*0430*/#define BRANCHIF(cond) { ip += (cond) ? getShort(ip + 1) : 3; goto reschedulePoint; }
/*0431*/#endif
/*0432*/
/*0433*//*=========================================================================
/*0434./ * NOTIMPLEMENTED - Macro to pad out the jump table as an option
/*0435./ *=======================================================================*/
/*0436*/
/*0437*/#if PADTABLE
/*0438*/#define NOTIMPLEMENTED(x) case x: { goto notImplemented; }
/*0439*/#else
/*0440*/#define NOTIMPLEMENTED(x) /**/
/*0441*/#endif
/*0442*/
/*0443*//*=========================================================================
/*0444./ * CLEAR - Zero a variable for safety only
/*0445./ *=======================================================================*/
/*0446*/
/*0447*/#if INCLUDEDEBUGCODE
/*0448*/#define CLEAR(x) { (x) = 0; }
/*0449*/#else
/*0450*/#define CLEAR(x) /**/
/*0451*/#endif
/*0452*/
/*0453*//*=========================================================================
/*0454./ * SAVEIP/RESTOREIP - Macros to spill and load the ip machine register
/*0455./ *=======================================================================*/
/*0456*/
/*0457*/#if IPISLOCAL
/*0458*/#define SAVEIP ip_global = ip; CLEAR(ip);
/*0459*/#define RESTOREIP ip = ip_global; CLEAR(ip_global);
/*0460*/#else
/*0461*/#define SAVEIP /**/
/*0462*/#define RESTOREIP /**/
/*0463*/#endif
/*0464*/
/*0465*//*=========================================================================
/*0466./ * SAVEFP/RESTOREFP - Macros to spill and load the fp machine register
/*0467./ *=======================================================================*/
/*0468*/
/*0469*/#if FPISLOCAL
/*0470*/#define SAVEFP fp_global = fp; CLEAR(fp);
/*0471*/#define RESTOREFP fp = fp_global; CLEAR(fp_global);
/*0472*/#else
/*0473*/#define SAVEFP /**/
/*0474*/#define RESTOREFP /**/
/*0475*/#endif
/*0476*/
/*0477*//*=========================================================================
/*0478./ * SAVESP/RESTORESP - Macros to spill and load the sp machine register
/*0479./ *=======================================================================*/
/*0480*/
/*0481*/#if SPISLOCAL
/*0482*/#define SAVESP sp_global = sp; CLEAR(sp);
/*0483*/#define RESTORESP sp = sp_global; CLEAR(sp_global);
/*0484*/#else
/*0485*/#define SAVESP /**/
/*0486*/#define RESTORESP /**/
/*0487*/#endif
/*0488*/
/*0489*//*=========================================================================
/*0490./ * SAVELP/RESTORELP - Macros to spill and load the lp machine register
/*0491./ *=======================================================================*/
/*0492*/
/*0493*/#if LPISLOCAL
/*0494*/#define SAVELP lp_global = lp; CLEAR(lp);
/*0495*/#define RESTORELP lp = lp_global; CLEAR(lp_global);
/*0496*/#else
/*0497*/#define SAVELP /**/
/*0498*/#define RESTORELP /**/
/*0499*/#endif
/*0500*/
/*0501*//*=========================================================================
/*0502./ * SAVECP/RESTORECP - Macros to spill and load the cp machine register
/*0503./ *=======================================================================*/
/*0504*/
/*0505*/#if CPISLOCAL
/*0506*/#define SAVECP cp_global = cp; CLEAR(cp);
/*0507*/#define RESTORECP cp = cp_global; CLEAR(cp_global);
/*0508*/#else
/*0509*/#define SAVECP /**/
/*0510*/#define RESTORECP /**/
/*0511*/#endif
/*0512*/
/*0513*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -