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

📄 global.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: Global definitions
/*0022./ * FILE:      global.h
/*0023./ * OVERVIEW:  Global system-wide definitions.
/*0024./ * AUTHOR:    Antero Taivalsaari, Sun Labs
/*0025./ *            Many others since then...
/*0026./ *=======================================================================*/
/*0027*/
/*0028*//*=========================================================================
/*0029./ * COMMENT:
/*0030./ * This file contains declarations that do not belong to any
/*0031./ * particular structure or subsystem of the VM. There are many
/*0032./ * other additional global variable declarations in other files.
/*0033./ *=======================================================================*/
/*0034*/
/*0035*//*=========================================================================
/*0036./ * System include files
/*0037./ *=======================================================================*/
/*0038*/
/*0039*//* The performs per-machine initialization */
/*0040*/#include <machine_md.h>
/*0041*/
/*0042*//*=========================================================================
/*0043./ * Global compile-time constants and typedefs
/*0044./ *=======================================================================*/
/*0045*/
/*0046*/#undef  TRUE
/*0047*/#undef  FALSE
/*0048*/
/*0049*/#define NIL   0
/*0050*/
/*0051*/typedef enum {
/*0052*/    FALSE = 0,
/*0053*/    TRUE = 1
/*0054*/} bool_t;
/*0055*/
/*0056*//*=========================================================================
/*0057./ * Global data type declarations
/*0058./ *=======================================================================*/
/*0059*/
/*0060*//*=========================================================================
/*0061./ * NOTE: These type declarations are not quite as portable as they
/*0062./ * could be.  It might be useful to declare specific type names for
/*0063./ * all Java-specific types (e.g., jint instead of normal int, jlong
/*0064./ * instead of long64, and so forth).
/*0065./ *=======================================================================*/
/*0066*/
/*0067*/#define CELL  4        /* Size of a java word (= 4 bytes) */
/*0068*/#define log2CELL 2     /* Shift amount equivalent to dividing by CELL */
/*0069*/#define SHORTSIZE 2
/*0070*/
/*0071*/typedef unsigned char     BYTE;
/*0072*/typedef unsigned long     cell;    /* Must be 32 bits long! */
/*0073*/
/*0074*//*=========================================================================
/*0075./ * System-wide structure declarations
/*0076./ *=======================================================================*/
/*0077*/
/*0078*/typedef struct classStruct*         CLASS; 
						//\\class.h:141
/*0079*/typedef struct instanceClassStruct* INSTANCE_CLASS;
/*0080*/typedef struct arrayClassStruct*    ARRAY_CLASS;
/*0081*/
/*0082*/typedef struct objectStruct*        OBJECT;
/*0083*/typedef struct instanceStruct*      INSTANCE;
/*0084*/typedef struct arrayStruct*         ARRAY;  //\\class.h:244
/*0085*/typedef struct stringInstanceStruct* STRING_INSTANCE;
/*0086*/typedef struct throwableInstanceStruct* THROWABLE_INSTANCE;
/*0087*/typedef struct internedStringInstanceStruct* INTERNED_STRING_INSTANCE;
/*0088*/typedef struct classInstanceStruct* CLASS_INSTANCE;
/*0089*/
/*0090*/typedef struct byteArrayStruct*     BYTEARRAY;
/*0091*/typedef struct shortArrayStruct*    SHORTARRAY;
/*0092*/typedef struct pointerListStruct*   POINTERLIST;
/*0093*/typedef struct weakPointerListStruct* WEAKPOINTERLIST;
/*0094*/
/*0095*/typedef struct fieldStruct*         FIELD;
/*0096*/typedef struct fieldTableStruct*    FIELDTABLE;
/*0097*/typedef struct methodStruct*        METHOD;
/*0098*/typedef struct methodTableStruct*   METHODTABLE;
/*0099*/typedef struct stackMapStruct*      STACKMAP;
/*0100*/typedef struct icacheStruct*        ICACHE;
/*0101*/typedef struct chunkStruct*         CHUNK;
/*0102*/
/*0103*/typedef struct staticChunkStruct*   STATICCHUNK;
/*0104*/typedef struct threadQueue*         THREAD;
/*0105*/typedef struct javaThreadStruct*    JAVATHREAD;
/*0106*/typedef struct monitorStruct*       MONITOR;
/*0107*/
/*0108*/typedef struct stackStruct*         STACK;
/*0109*/
/*0110*/typedef struct frameStruct*            FRAME;
/*0111*/typedef struct exceptionHandlerStruct* HANDLER;
/*0112*/typedef struct exceptionHandlerTableStruct* HANDLERTABLE;
/*0113*/typedef struct filePointerStruct*      FILEPOINTER;
/*0114*/typedef union constantPoolEntryStruct* CONSTANTPOOL_ENTRY;
/*0115*/typedef struct constantPoolStruct*     CONSTANTPOOL;
/*0116*/typedef char* BYTES;
/*0117*/
/*0118*/typedef FILEPOINTER        *FILEPOINTER_HANDLE;
/*0119*/typedef OBJECT             *OBJECT_HANDLE;
/*0120*/typedef INSTANCE           *INSTANCE_HANDLE;
/*0121*/typedef ARRAY              *ARRAY_HANDLE;
/*0122*/typedef POINTERLIST        *POINTERLIST_HANDLE;
/*0123*/typedef WEAKPOINTERLIST    *WEAKPOINTERLIST_HANDLE;
/*0124*/typedef JAVATHREAD         *JAVATHREAD_HANDLE;
/*0125*/typedef BYTES              *BYTES_HANDLE;
/*0126*/typedef METHOD             *METHOD_HANDLE;
/*0127*/typedef FRAME              *FRAME_HANDLE;
/*0128*/typedef const char*        *CONST_CHAR_HANDLE;
/*0129*/typedef unsigned char*     *UNSIGNED_CHAR_HANDLE;
/*0130*/typedef STRING_INSTANCE    *STRING_INSTANCE_HANDLE;
/*0131*/typedef THROWABLE_INSTANCE *THROWABLE_INSTANCE_HANDLE;
/*0132*/typedef THREAD             *THREAD_HANDLE;
/*0133*/
/*0134*/#define ByteSizeToCellSize(n)   (((n) + (CELL - 1)) >> log2CELL)
/*0135*/#define StructSizeInCells(structName) ((sizeof(struct structName) + 3) >> 2)
/*0136*/#define UnionSizeInCells(structName) ((sizeof(union structName) + 3) >> 2)
/*0137*/
/*0138*//* Field and Method key types */
/*0139*/typedef unsigned short NameKey;
/*0140*/typedef unsigned short MethodTypeKey;
/*0141*/typedef unsigned short FieldTypeKey;
/*0142*/
/*0143*/typedef union {
/*0144*/    struct {
/*0145*/        unsigned short nameKey;
/*0146*/        unsigned short typeKey; /* either MethodTypeKey or FieldTypeKey */
/*0147*/    } nt;
/*0148*/    unsigned long i;
/*0149*/} NameTypeKey;
/*0150*/
/*0151*//* Machines such as the Palm that use something other than FILE* for stdin
/*0152./ * and stdout should redefine this in their machine_md.h
/*0153./ */
/*0154*/#ifndef LOGFILEPTR
/*0155*/#define LOGFILEPTR FILE*
/*0156*/#endif
/*0157*/
/*0158*//*=========================================================================
/*0159./ * Locally defined include files
/*0160./ *=======================================================================*/
/*0161*/
/*0162*/#include <messages.h>
/*0163*/
/*0164*/#include <main.h>
/*0165*/#include <long.h>
/*0166*/#include <garbage.h>
/*0167*/#include <interpret.h>
/*0168*/#include <hashtable.h>
/*0169*/
/*0175*/#include <class.h>
/*0176*/#include <thread.h>
/*0177*/#include <pool.h>
/*0178*/#include <fields.h>
/*0179*/#include <frame.h>
/*0180*/#include <loader.h>

⌨️ 快捷键说明

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