⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 interpret.h

📁 This is a java virtual machine implement in c
💻 H
📖 第 1 页 / 共 2 页
字号:
/*0246*/        F2I         = 0x8B,
/*0247*/        F2L         = 0x8C,
/*0248*/        F2D         = 0x8D,
/*0249*/        D2I         = 0x8E,
/*0250*/        D2L         = 0x8F,
/*0251*/
/*0252*/        D2F         = 0x90,
/*0253*/        I2B         = 0x91,
/*0254*/        I2C         = 0x92,
/*0255*/        I2S         = 0x93,
/*0256*/        LCMP        = 0x94,
/*0257*/        FCMPL       = 0x95,
/*0258*/        FCMPG       = 0x96,
/*0259*/        DCMPL       = 0x97,
/*0260*/
/*0261*/        DCMPG       = 0x98,
/*0262*/        IFEQ        = 0x99,
/*0263*/        IFNE        = 0x9A,
/*0264*/        IFLT        = 0x9B,
/*0265*/        IFGE        = 0x9C,
/*0266*/        IFGT        = 0x9D,
/*0267*/        IFLE        = 0x9E,
/*0268*/        IF_ICMPEQ   = 0x9F,
/*0269*/
/*0270*/        IF_ICMPNE   = 0xA0,
/*0271*/        IF_ICMPLT   = 0xA1,
/*0272*/        IF_ICMPGE   = 0xA2,
/*0273*/        IF_ICMPGT   = 0xA3,
/*0274*/        IF_ICMPLE   = 0xA4,
/*0275*/        IF_ACMPEQ   = 0xA5,
/*0276*/        IF_ACMPNE   = 0xA6,
/*0277*/        GOTO        = 0xA7,
/*0278*/
/*0279*/        JSR          = 0xA8,
/*0280*/        RET          = 0xA9,
/*0281*/        TABLESWITCH  = 0xAA,
/*0282*/        LOOKUPSWITCH = 0xAB,
/*0283*/        IRETURN      = 0xAC,
/*0284*/        LRETURN      = 0xAD,
/*0285*/        FRETURN      = 0xAE,
/*0286*/        DRETURN      = 0xAF,
/*0287*/
/*0288*/        ARETURN       = 0xB0,
/*0289*/        RETURN        = 0xB1,
/*0290*/        GETSTATIC     = 0xB2,
/*0291*/        PUTSTATIC     = 0xB3,
/*0292*/        GETFIELD      = 0xB4,
/*0293*/        PUTFIELD      = 0xB5,
/*0294*/        INVOKEVIRTUAL = 0xB6,
/*0295*/        INVOKESPECIAL = 0xB7,
/*0296*/
/*0297*/        INVOKESTATIC    = 0xB8,
/*0298*/        INVOKEINTERFACE = 0xB9,
/*0299*/        UNUSED_BA       = 0xBA,
/*0300*/        NEW             = 0xBB,
/*0301*/        NEWARRAY        = 0xBC,
/*0302*/        ANEWARRAY       = 0xBD,
/*0303*/        ARRAYLENGTH     = 0xBE,
/*0304*/        ATHROW          = 0xBF,
/*0305*/
/*0306*/        CHECKCAST       = 0xC0,
/*0307*/        INSTANCEOF      = 0xC1,
/*0308*/        MONITORENTER    = 0xC2,
/*0309*/        MONITOREXIT     = 0xC3,
/*0310*/        WIDE            = 0xC4,
/*0311*/        MULTIANEWARRAY  = 0xC5,
/*0312*/        IFNULL          = 0xC6,
/*0313*/        IFNONNULL       = 0xC7,
/*0314*/
/*0315*/        GOTO_W          = 0xC8,
/*0316*/        JSR_W           = 0xC9,
/*0317*/        BREAKPOINT      = 0xCA,
/*0318*/
/*0319*//*=========================================================================
/*0320./ * Fast bytecodes (used internally by the system
/*0321./ *                 only if FASTBYTECODES flag is on)
/*0322./ *=======================================================================*/
/*0323*/
/*0324*/        GETFIELD_FAST         = 0xCB,
/*0325*/        GETFIELDP_FAST        = 0xCC,
/*0326*/        GETFIELD2_FAST        = 0xCD,
/*0327*/        PUTFIELD_FAST         = 0xCE,
/*0328*/        PUTFIELD2_FAST        = 0xCF,
/*0329*/        GETSTATIC_FAST        = 0xD0,
/*0330*/        GETSTATICP_FAST       = 0xD1,
/*0331*/        GETSTATIC2_FAST       = 0xD2,
/*0332*/        PUTSTATIC_FAST        = 0xD3,
/*0333*/        PUTSTATIC2_FAST       = 0xD4,
/*0334*/        UNUSED_D5             = 0xD5,
/*0335*/        INVOKEVIRTUAL_FAST    = 0xD6,
/*0336*/        INVOKESPECIAL_FAST    = 0xD7,
/*0337*/
/*0338*/        INVOKESTATIC_FAST     = 0xD8,
/*0339*/        INVOKEINTERFACE_FAST  = 0xD9,
/*0340*/        NEW_FAST              = 0xDA,
/*0341*/        ANEWARRAY_FAST        = 0xDB,
/*0342*/        MULTIANEWARRAY_FAST   = 0xDC,
/*0343*/        CHECKCAST_FAST        = 0xDD,
/*0344*/        INSTANCEOF_FAST       = 0xDE,
/*0345*/
/*0346*/        CUSTOMCODE            = 0xDF,
/*0347*/
/*0348*/        LASTBYTECODE          = 0xDF
/*0349*/} ByteCode ;
/*0350*/
/*0351*//*=========================================================================
/*0352./ * Callback function for CUSTOMCODE bytecode
/*0353./ *=======================================================================*/
/*0354*/
/*0355*/typedef void (*CustomCodeCallbackFunction)(FRAME_HANDLE exceptionFrame);
/*0356*/
/*0376*/void fatalSlotError(CONSTANTPOOL constantPool, int cpIndex);
/*0377*/
/*0398*//*=========================================================================
/*0399./ * Macros for data alignment
/*0400./ *=======================================================================*/
/*0401*/
/*0402*/#if NEED_LONG_ALIGNMENT
/*0403*/
/*0404*/#define GET_LONG(_addr) ( ((tdub).x[0] = ((long*)(_addr))[0]), \
/*0405*/                          ((tdub).x[1] = ((long*)(_addr))[1]), \
/*0406*/                          (tdub).l )
/*0407*/
/*0408*/#define GET_ULONG(_addr) ( ((tdub).x[0] = ((long*)(_addr))[0]), \
/*0409*/                           ((tdub).x[1] = ((long*)(_addr))[1]), \
/*0410*/                           (tdub).ul )
/*0411*/
/*0412*/#define SET_LONG( _addr, _v) ( (tdub).l = (_v),                   \
/*0413*/                               ((long*)(_addr))[0] = (tdub).x[0], \
/*0414*/                               ((long*)(_addr))[1] = (tdub).x[1] )
/*0415*/
/*0416*/
/*0417*/#define SET_ULONG( _addr, _v) ( (tdub).ul = (_v),                  \
/*0418*/                                ((long*)(_addr))[0] = (tdub).x[0], \
/*0419*/                                ((long*)(_addr))[1] = (tdub).x[1] )
/*0420*/
/*0421*/#define COPY_LONG(_new, _old) ( ((long*)(_new))[0] = ((long*)(_old))[0], \
/*0422*/                                ((long*)(_new))[1] = ((long*)(_old))[1] )
/*0423*/
/*0424*/#else
/*0425*/
/*0426*/#define GET_LONG(_addr) (*(long64*)(_addr))
/*0427*/#define GET_ULONG(_addr) (*(ulong64*)(_addr))
/*0428*/#define SET_LONG(_addr, _v) (*(long64*)(_addr) = (_v))
/*0429*/#define SET_ULONG(_addr, _v) (*(ulong64*)(_addr) = (_v))
/*0430*/#define COPY_LONG(_new, _old) (*(long64*)(_new) = *(long64*)(_old))
/*0431*/
/*0432*/#endif /* NEED_LONG_ALIGNMENT */
/*0433*/
/*0434*/
/*0435*//* If double's must be aligned on doubleword boundaries then define this */
/*0436*/#if NEED_DOUBLE_ALIGNMENT
/*0437*/
/*0438*/#define GET_DOUBLE(_addr) ( ((tdub).x[0] = ((long*)(_addr))[0]), \
/*0439*/                            ((tdub).x[1] = ((long*)(_addr))[1]), \
/*0440*/                            (tdub).d )
/*0441*/#define SET_DOUBLE( _addr, _v) ( (tdub).d = (_v),                   \
/*0442*/                                 ((long*)(_addr))[0] = (tdub).x[0], \
/*0443*/                                 ((long*)(_addr))[1] = (tdub).x[1] )
/*0444*/#define COPY_DOUBLE(_new, _old) ( ((long*)(_new))[0] = ((long*)(_old))[0], \
/*0445*/                                  ((long*)(_new))[1] = ((long*)(_old))[1] )
/*0446*/
/*0447*/#else
/*0448*/
/*0449*/#define GET_DOUBLE(_addr) (*(double*)(_addr))
/*0450*/#define SET_DOUBLE(_addr, _v) (*(double*)(_addr) = (_v))
/*0451*/#define COPY_DOUBLE(_new, _old) (*(double*)(_new) = *(double*)(_old))
/*0452*/
/*0453*/#endif /* NEED_DOUBLE_ALIGNMENT */
/*0454*/
/*0455*/
/*0456*//* Macros for handling endianness of the hardware architecture properly */
/*0457*/#if LITTLE_ENDIAN
/*0458*/#   define SET_LONG_FROM_HALVES(_addr, _hi, _lo) \
/*0459*/        (((long *)_addr)[0] = (_lo), ((long *)_addr)[1] = (_hi))
/*0460*/#elif BIG_ENDIAN
/*0461*/#   define SET_LONG_FROM_HALVES(_addr, _hi, _lo) \
/*0462*/        (((long *)_addr)[0] = (_hi), ((long *)_addr)[1] = (_lo))
/*0463*/#elif COMPILER_SUPPORTS_LONG
/*0464*/#  if NEED_LONG_ALIGNMENT
/*0465*/#     define SET_LONG_FROM_HALVES(_addr, _hi, _lo) \
/*0466*/             do { long64 _tmp = ((((long64)_hi)<<32) | ((unsigned long)_lo)); \
/*0467*/                      COPY_LONG(_addr, &_tmp); } while(0)
/*0468*/#  else
/*0469*/#     define SET_LONG_FROM_HALVES(_addr, _hi, _lo) \
/*0470*/          (*(long64 *)(_addr) = ((((long64)_hi)<<32) | ((unsigned long)_lo)))
/*0471*/#  endif
/*0472*/#else
/*0473*/#   error "You must define LITTLE_ENDIAN or BIG_ENDIAN"
/*0474*/#endif
/*0475*/
/*0476*/
/*0477*//* Macros for popping and pushing 64-bit numbers from/to operand stack */
/*0478*/#define popDouble(_lval) (oneLess, COPY_DOUBLE(&_lval, getSP()), oneLess)
/*0479*/#define popLong(_lval) (oneLess, COPY_LONG(&_lval, getSP()), oneLess)
/*0480*/
/*0481*/#define pushDouble(_lval) (oneMore, COPY_DOUBLE(getSP(), &_lval), oneMore)
/*0482*/#define pushLong(_lval) (oneMore, COPY_LONG(getSP(), &_lval), oneMore)
/*0483*/
/*0484*//*=========================================================================
/*0485./ * The equivalent macros to the above for use when the stack being
/*0486./ * manipulated is not for the currently executing thread. In all cases
/*0487./ * the additional parameter is the THREAD pointer.
/*0488./ *=======================================================================*/
/*0489*/
/*0490*/#define popDoubleForThread( t, _lval) (oneLessForThread(t), COPY_DOUBLE(&_lval, spForThread(t)), oneLessForThread(t))
/*0491*/#define popLongForThread(   t, _lval) (oneLessForThread(t), COPY_LONG(  &_lval, spForThread(t)), oneLessForThread(t))
/*0492*/#define pushDoubleForThread(t, _lval) (oneMoreForThread(t), COPY_DOUBLE(spForThread(t), &_lval), oneMoreForThread(t))
/*0493*/#define pushLongForThread(  t, _lval) (oneMoreForThread(t), COPY_LONG(  spForThread(t), &_lval), oneMoreForThread(t))
/*0494*/
/*0495*//*=========================================================================
/*0496./ * Bytecode interpreter operations
/*0497./ *=======================================================================*/
/*0498*/
/*0499*/void Interpret(void);
/*0500*/void SlowInterpret(ByteCode token);
/*0501*/void FastInterpret(void);
/*0502*/
/*0503*/void InstructionProfile(void);
/*0504*/
/*0505*/typedef union Java8Str {
/*0506*/    long x[2];
/*0507*/#if IMPLEMENTS_FLOAT
/*0508*/    double d;
/*0509*/#endif
/*0510*/    long64 l;
/*0511*/        ulong64 ul;
/*0512*/    void *p;
/*0513*/} Java8;
/*0514*/
/*0515*/
/*0516*/#ifndef DOUBLE_REMAINDER
/*0517*/#define DOUBLE_REMAINDER(a,b) fmod(a,b)
/*0518*/#endif
/*0519*/
/*0520*//*=========================================================================
/*0521./ * Scheduling macros.
/*0522./ * These are here to isolate the scheduling code out of interpret.c
/*0523./ * (now split out into a separate file)
/*0524./ *=======================================================================*/
/*0525*/
/*0526*/#include <events.h>
/*0527*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -