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

📄 main.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: Main program; compilation options
/*0022./ * FILE:      main.h
/*0023./ * OVERVIEW:  Compilation options setup for fine-tuning the system
/*0024./ *            and for enabling/disabling various execution, configuration,
/*0025./ *            debugging, profiling and tracing options.
/*0026./ * AUTHOR:    Antero Taivalsaari, Sun Labs
/*0027./ *            Edited by Doug Simon 11/1998
/*0028./ *            (and many others since then...)
/*0029./ *=======================================================================*/
/*0030*/
/*0031*//*=========================================================================
/*0032./ * This file gives the >>DEFAULT<< values for various compile time flags.
/*0033./ *
/*0034./ * Any port can override a value given in this file by either:
/*0035./ *      - Giving it that value in its port-specific "machine_md.h" file
/*0036./ *      - Giving it a value in a compiler-specific manner (e.g.,
/*0037./ *        as a command line parameter in a makefile.)
/*0038./ *
/*0039./ * The preferred way of changing the values defined in this file
/*0040./ * is to edit the port-specific "machine_md.h" file rather than
/*0041./ * change the default values here.
/*0042./ *=======================================================================*/
/*0043*/
/*0044*//*=========================================================================
/*0045./ * General compilation options
/*0046./ *=======================================================================*/
/*0047*/
/*0048*//*
/*0049./ * Set this to zero if your compiler does not directly support 64-bit
/*0050./ * integers.
/*0051./ */
/*0052*/#ifndef COMPILER_SUPPORTS_LONG
/*0053*/#define COMPILER_SUPPORTS_LONG 1
/*0054*/#endif
/*0055*/
/*0056*//*
/*0057./ * Set this to a non-zero value if your compiler requires that 64-bit
/*0058./ * integers be aligned on 0 mod 8 boundaries.
/*0059./ */
/*0060*/#ifndef NEED_LONG_ALIGNMENT
/*0061*/#define NEED_LONG_ALIGNMENT 0
/*0062*/#endif
/*0063*/
/*0064*//* Set this to a non-zero value if your compiler requires that double
/*0065./ * precision floating-pointer numbers be aligned on 0 mod 8 boundaries.
/*0066./ */
/*0067*/#ifndef NEED_DOUBLE_ALIGNMENT
/*0068*/#define NEED_DOUBLE_ALIGNMENT 0
/*0069*/#endif
/*0070*/
/*0071*//*=========================================================================
/*0072./ * General system configuration options
/*0073./ * (Note: many of these flags are commonly overridden from makefiles)
/*0074./ *=======================================================================*/
/*0075*/
/*0076*//* Indicates whether floating point operations are supported or not.
/*0077./ * Should be 0 in CLDC Specification compliant implementations.
/*0078./ */
/*0079*/#ifndef IMPLEMENTS_FLOAT
/*0080*/#define IMPLEMENTS_FLOAT 0
/*0081*/#endif
/*0082*/
/*0083*//*
/*0084./ * Turns class prelinking/preloading (JavaCodeCompact) support on or off.
/*0085./ * If this option is on, KVM can prelink system classes into the
/*0086./ * virtual machine executable, speeding up VM startup considerably.
/*0087./ *
/*0088./ * Note: This flag is commonly overridden from the makefile
/*0089./ * in our Windows and Unix ports.
/*0090./ * 
/*0091./ * Note: To generate the necessary ROM images for Palm, go to 
/*0092./ * directory "tools/jcc", and type "gnumake palm".
/*0093./ */
/*0094*/#ifndef ROMIZING
/*0095*/#define ROMIZING 1
/*0096*/#endif
/*0097*/
/*0098*//*
/*0099./ * Includes or excludes the optional Java Application Manager (JAM)
/*0100./ * component in the virtual machine.  Refer to Porting Guide for
/*0101./ * details.
/*0102./ *
/*0103./ * Note: This flag is commonly overridden from the makefile
/*0104./ * in our Windows and Unix ports.
/*0105./ */
/*0106*/#ifndef USE_JAM
/*0107*/#define USE_JAM 0
/*0108*/#endif
/*0109*/
/*0110*//* Indicates that this port utilizes asynchronous native functions.
/*0111./ * Currently, this option is supported only on Win32.
/*0112./ * Refer to KVM Porting Guide for details.
/*0113./ */
/*0114*/#ifndef ASYNCHRONOUS_NATIVE_FUNCTIONS
/*0115*/#define ASYNCHRONOUS_NATIVE_FUNCTIONS 0
/*0116*/#endif
/*0117*/
/*0118*//*=========================================================================
/*0119./ * Palm-related system configuration options
/*0120./ *=======================================================================*/
/*0121*/
/*0122*//* This is a special feature intended mainly for the Palm and similar
/*0123./ * implementations with limited dynamic memory.  Unix and Windows both
/*0124./ * have "fakeStaticMemory.c", but that is intended only to help find bugs
/*0125./ * in the Palm implementation.
/*0126./ *
/*0127./ * If set to a non-zero value, the implementation will try to move field
/*0128./ * tables, method tables, and other immutable structures from dynamic memory
/*0129./ * to "static memory" (storage RAM on Palm), which is easy to read but more
/*0130./ * difficult to write. This frees up valuable space in dynamic RAM.
/*0131./ */
/*0132*/#ifndef USESTATIC
/*0133*/#define USESTATIC 0
/*0134*/#endif
/*0135*/
/*0136*//* Instructs KVM to use an optimization which allows KVM to allocate
/*0137./ * the Java heap in multiple chunks or segments. This makes it possible
/*0138./ * to allocate more Java heap space on memory-constrained target
/*0139./ * platforms such as the Palm.  This option is potentially useful
/*0140./ * also on other target platforms with segmented memory architecture.
/*0141./ */
/*0142*/#ifndef CHUNKY_HEAP
/*0143*/#define CHUNKY_HEAP 0
/*0144*/#endif
/*0145*/
/*0146*//* Instructs KVM to implement a compacting garbage collector
/*0147./ * or to disable compaction. NOTE: Currently compaction cannot
/*0148./ * be used on those platforms that have a segmented memory
/*0149./ * architecture (e.g., Palm OS).
/*0150./ */
/*0151*/#ifndef ENABLE_HEAP_COMPACTION
/*0152*/#define ENABLE_HEAP_COMPACTION !CHUNKY_HEAP
/*0153*/#endif
/*0154*/
/*0155*//* This is a special form of ROMIZING (JavaCodeCompacting) that is used
/*0156./ * only by the Palm. It allows the rom'ed image to be relocatable even
/*0157./ * after it is built.  The ROMIZING flag is commonly provided
/*0158./ * as a command line parameter from a makefile.
/*0159./ */
/*0160*/#ifndef RELOCATABLE_ROM
/*0161*/#define RELOCATABLE_ROM 0
/*0162*/#endif
/*0163*/
/*0164*//*=========================================================================
/*0165./ * Memory allocation settings
/*0166./ *=======================================================================*/
/*0167*/
/*0168*//*=========================================================================
/*0169./ * COMMENT: The default sizes for overall memory allocation and
/*0170./ * resource allocation for individual threads are defined here.
/*0171./ *
/*0172./ * As a general principle, KVM allocates all the memory it needs
/*0173./ * upon virtual machine startup.  At runtime, all memory is allocated
/*0174./ * from within these preallocated areas.  However, note that on
/*0175./ * many platforms the native functions linked into the VM (e.g.,
/*0176./ * graphics operations) often perform dynamic memory allocation
/*0177./ * outside the Java heap.
/*0178./ *=======================================================================*/
/*0179*/
/*0180*//* The Java heap size that KVM will allocate upon virtual machine
/*0181./ * startup (in bytes).  Note that the Palm implementation ignores
/*0182./ * this value and uses an alternative memory allocation strategy.
/*0183./ *
/*0184./ * Also note that this definition is commonly overridden from
/*0185./ * the makefile in the Windows and Unix ports.
/*0186./ */
/*0187*/#ifndef DEFAULTHEAPSIZE
/*0188*/#define DEFAULTHEAPSIZE 65024   /* 0xFE00 */
/*0189*/#endif
/*0190*/
/*0191*//* Maximum size of the master inline cache (# of ICACHE entries)
/*0192./ * Remember that maximum size should not exceed 65535, because the
/*0193./ * length of inlined bytecode parameters is only two bytes (see cache.h).
/*0194./ * This macro is meaningful only if the ENABLEFASTBYTECODES option
/*0195./ * is turned on.
/*0196./ */
/*0197*/#ifndef INLINECACHESIZE
/*0198*/#define INLINECACHESIZE   100
/*0199*/#endif
/*0200*/
/*0201*//* The execution stacks of Java threads in KVM grow and shrink
/*0202./ * at runtime. This value determines the default size of a new
/*0203./ * stack frame chunk when more space is needed.
/*0204./ */
/*0205*/#ifndef STACKCHUNKSIZE
/*0206*/#define STACKCHUNKSIZE    128
/*0207*/#endif
/*0208*/
/*0209*//* The size (in bytes) of a statically allocated area that the
/*0210./ * virtual machine uses internally in various string operations.
/*0211./ * See global.h and global.c.
/*0212./ */
/*0213*/#ifndef STRINGBUFFERSIZE
/*0214*/#define STRINGBUFFERSIZE 512
/*0215*/#endif
/*0216*/
/*0217*//*=========================================================================
/*0218./ * Garbage collection options
/*0219./ *=======================================================================*/
/*0220*/
/*0221*//*
/*0222./ * The following flag is for debugging. If non-zero, it'll cause a
/*0223./ * garbage collection to happen before every memory allocation.
/*0224./ * This will help find those pointers that you're forgetting to
/*0225./ * lock!  Be sure to turn this option off for a production build.
/*0226./ */
/*0227*/#ifndef EXCESSIVE_GARBAGE_COLLECTION
/*0228*/#define EXCESSIVE_GARBAGE_COLLECTION 0
/*0229*/#endif
/*0230*/
/*0231*//*=========================================================================
/*0232./ * Interpreter execution options (KVM 1.0)
/*0233./ *=======================================================================*/
/*0234*/
/*0235*//* Turns runtime bytecode replacement (and Deutsch-Schiffman style
/*0236./ * inline caching) on/off.  The system will run faster with fast
/*0237./ * bytecodes on, but needs a few kilobytes of extra space for
/*0238./ * the additional code. Note that you can't use bytecode replacement
/*0239./ * on those platforms in which bytecodes are stored in non-volatile
/*0240./ * memory (e.g., ROM).  This option does not work on the Palm, because
/*0241./ * we want to save memory and store bytecodes in storage/static memory.
/*0242./ */
/*0243*/#ifndef ENABLEFASTBYTECODES
/*0244*/#define ENABLEFASTBYTECODES 0

⌨️ 快捷键说明

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