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

📄 execute.h

📁 This is a java virtual machine implement in c
💻 H
📖 第 1 页 / 共 2 页
字号:
/*0001*//*
/*0002./ * Copyright (c) 1998-2001 Sun Microsystems, Inc. All Rights Reserved.
/*0003./ *
/*0004./ * This software is the confidential and proprietary information of Sun
/*0005./ * Microsystems, Inc. ("Confidential Information").  You shall not
/*0006./ * disclose such Confidential Information and shall use it only in
/*0007./ * accordance with the terms of the license agreement you entered into
/*0008./ * with Sun.
/*0009./ *
/*0010./ * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
/*0011./ * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
/*0012./ * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
/*0013./ * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
/*0014./ * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
/*0015./ * THIS SOFTWARE OR ITS DERIVATIVES.
/*0016./ *
/*0017./ */
/*0018*/
/*0019*//*=========================================================================
/*0020./ * SYSTEM:    KVM
/*0021./ * SUBSYSTEM: Bytecode interpreter
/*0022./ * FILE:      execute.h
/*0023./ * OVERVIEW:  This file defines macros for the Java interpreter
/*0024./ *            execution loop.  These macros are needed by the
/*0025./ *            redesigned interpreter loop.
/*0026./ * AUTHOR:    Nik Shaylor 9/5/2000
/*0027./ *=======================================================================*/
/*0028*/
/*0029*//*=========================================================================
/*0030./ * Include files
/*0031./ *=======================================================================*/
/*0032*/
/*0033*//*=========================================================================
/*0034./ * Additional build options (standard options are defined in main.h)
/*0035./ *=======================================================================*/
/*0036*/
/*0037*//* The following options are intended for interpreter debugging
/*0038./ * and customization.  Normally you should not change these
/*0039./ * definitions, and that's why they are here instead of
/*0040./ * main.h where the user-level customization options are.
/*0041./ */
/*0042*/
/*0043*//* COMMONBRANCHING effects the BRANCHIF macro. The original macro
/*0044./ * would load the ip in the body of the macro. This option causes a
/*0045./ * branch to a common place where this is done. There seems no
/*0046./ * disadvantage to doing it this way.
/*0047./ */
/*0048*/#ifndef COMMONBRANCHING
/*0049*/#define COMMONBRANCHING 1
/*0050*/#endif
/*0051*/
/*0052*//* Private instrumentation code that is just useful for measuring changed
/*0053./ * to the interpreter.
/*0054./ */
/*0055*/#ifndef INSTRUMENT
/*0056*/#define INSTRUMENT 0
/*0057*/#endif
/*0058*/
/*0059*//* Turn this on to do a GC between every bytecode. (Very slow....)
/*0060./ */
/*0061*/#ifndef VERY_EXCESSIVE_GARBAGE_COLLECTION
/*0062*/#define VERY_EXCESSIVE_GARBAGE_COLLECTION 0
/*0063*/#endif
/*0064*/
/*0065*//*=========================================================================
/*0066./ * Setup default local register values if LOCALVMREGISTERS is enabled
/*0067./ *=======================================================================*/
/*0068*/
/*0069*/#if LOCALVMREGISTERS
/*0070*/
/*0071*//* IP = Instruction pointer */
/*0072*/#ifndef IPISLOCAL
/*0073*/#define IPISLOCAL 1
/*0074*/#endif
/*0075*/
/*0076*//* SP = (Operand) Stack pointer */
/*0077*/#ifndef SPISLOCAL
/*0078*/#define SPISLOCAL 1
/*0079*/#endif
/*0080*/
/*0081*//* LP = Locals Pointer */
/*0082*/#ifndef LPISLOCAL
/*0083*/#define LPISLOCAL 1
/*0084*/#endif
/*0085*/
/*0086*//* FP = Frame Pointer */
/*0087*/#ifndef FPISLOCAL
/*0088*/#define FPISLOCAL 0
/*0089*/#endif
/*0090*/
/*0091*//* CP = Constant Pool Pointer */
/*0092*/#ifndef CPISLOCAL
/*0093*/#define CPISLOCAL 0
/*0094*/#endif
/*0095*/
/*0096*/#else
/*0097*/
/*0098*//*=========================================================================
/*0099./ * Setup default local register values if LOCALVMREGISTERS is not enabled
/*0100./ *=======================================================================*/
/*0101*/
/*0102*/#ifdef IPISLOCAL
/*0103*/#undef IPISLOCAL
/*0104*/#endif
/*0105*/
/*0106*/#ifdef SPISLOCAL
/*0107*/#undef SPISLOCAL
/*0108*/#endif
/*0109*/
/*0110*/#ifdef LPISLOCAL
/*0111*/#undef LPISLOCAL
/*0112*/#endif
/*0113*/
/*0114*/#ifdef FPISLOCAL
/*0115*/#undef FPISLOCAL
/*0116*/#endif
/*0117*/
/*0118*/#ifdef CPISLOCAL
/*0119*/#undef CPISLOCAL
/*0120*/#endif
/*0121*/
/*0122*/#define IPISLOCAL 0
/*0123*/#define FPISLOCAL 0
/*0124*/#define SPISLOCAL 0
/*0125*/#define LPISLOCAL 0
/*0126*/#define CPISLOCAL 0
/*0127*/
/*0128*/#endif /* LOCALVMREGISTERS */
/*0129*/
/*0130*//*=========================================================================
/*0131./ * Extreme debug option to call the garbage collector before every bytecode
/*0132./ *=======================================================================*/
/*0133*/
/*0134*/#if VERY_EXCESSIVE_GARBAGE_COLLECTION
/*0135*/#define DO_VERY_EXCESSIVE_GARBAGE_COLLECTION {  \
/*0136*/    VMSAVE                                      \
/*0137*/    garbageCollect(0);                          \
/*0138*/    VMRESTORE                                   \
/*0139*/}
/*0140*/#else
/*0141*/#if ASYNCHRONOUS_NATIVE_FUNCTIONS && EXCESSIVE_GARBAGE_COLLECTION
/*0142*/#define DO_VERY_EXCESSIVE_GARBAGE_COLLECTION {  \
/*0143*/    extern bool_t veryExcessiveGCrequested;     \
/*0144*/    if (veryExcessiveGCrequested) {             \
/*0145*/        VMSAVE                                  \
/*0146*/        garbageCollect(0);                      \
/*0147*/        VMRESTORE                               \
/*0148*/        veryExcessiveGCrequested = FALSE;       \
/*0149*/    }                                           \
/*0150*/}
/*0151*/#else
/*0152*/#define DO_VERY_EXCESSIVE_GARBAGE_COLLECTION /**/
/*0153*/#endif
/*0154*/#endif
/*0155*/
/*0174*//*=========================================================================
/*0175./ * SELECT - Macros To define bytecode(s)
/*0176./ *=======================================================================*/
/*0177*/
/*0178*/#define SELECT(l1)                      case l1: {
/*0179*/#define SELECT2(l1, l2)                 case l1: case l2: {
/*0180*/#define SELECT3(l1, l2, l3)             case l1: case l2: case l3: {
/*0181*/#define SELECT4(l1, l2, l3, l4)         case l1: case l2: case l3: case l4: {
/*0182*/#define SELECT5(l1, l2, l3, l4, l5)     case l1: case l2: case l3: case l4: case l5: {
/*0183*/#define SELECT6(l1, l2, l3, l4, l5, l6) case l1: case l2: case l3: case l4: case l5: case l6: {
/*0184*/
/*0185*//*=========================================================================
/*0186./ * DONE - To end a bytecode definition and increment ip
/*0187./ *=======================================================================*/
/*0188*/
/*0189*/#define DONE(n)    } goto next##n;
/*0190*/
/*0191*//*=========================================================================
/*0192./ * DONEX - To end a bytecode definition without goto
/*0193./ *=======================================================================*/
/*0194*/
/*0195*/#define DONEX      }
/*0196*/
/*0197*//*=========================================================================
/*0198./ * DONE_R - To end a bytecode definition and test for thread rescheduling
/*0199./ *=======================================================================*/
/*0200*/
/*0201*/#define DONE_R     } goto reschedulePoint;
/*0202*/
/*0203*//*=========================================================================
/*0204./ * CHECKARRAY - To check for valid array access
/*0205./ *=======================================================================*/
/*0206*/

⌨️ 快捷键说明

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