📄 loader.h
字号:
/*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: Class loader
/*0022./ * FILE: loader.h
/*0023./ * OVERVIEW: Internal definitions needed for loading
/*0024./ * Java class files (class loader).
/*0025./ * AUTHOR: Antero Taivalsaari, Sun Labs
/*0026./ * Sheng Liang, Frank Yellin, many others...
/*0027./ *=======================================================================*/
/*0028*/
/*0029*//*=========================================================================
/*0030./ * COMMENTS:
/*0031./ * This file defines a JVM Specification compliant classfile reader.
/*0032./ * It is capable of reading any standard Java classfile, and generating
/*0033./ * the necessary corresponding VM runtime structures.
/*0034./ *=======================================================================*/
/*0035*/
/*0036*//*=========================================================================
/*0037./ * Include files
/*0038./ *=======================================================================*/
/*0039*/
/*0040*//*=========================================================================
/*0041./ * Definitions and declarations
/*0042./ *=======================================================================*/
/*0043*/
/*0044*/extern char* UserClassPath; /* set in main() or elsewhere */
/*0045*/
/*0046*/#ifndef PATH_SEPARATOR
/*0047*/# define PATH_SEPARATOR ':'
/*0048*/#endif
/*0049*/
/*0050*//*=========================================================================
/*0051./ * Classfile loading data structures
/*0052./ *=======================================================================*/
/*0053*/
/*0054*//* This structure is used for referring to open "files" when */
/*0055*//* loading Java classfiles from the storage system of the host */
/*0056*//* operating system. It replaces the standard FILE* structure */
/*0057*//* used in C program. We need our own structure, since many of */
/*0058*//* our target devices don't have a regular file system. */
/*0059*/
/*0060*//* FILEPOINTER */
/*0061*/struct filePointerStruct;
/*0062*/
/*0063*/#define SIZEOF_FILEPOINTER StructSizeInCells(filePointerStruct)
/*0064*/
/*0065*//*=========================================================================
/*0066./ * Class file verification operations (performed during class loading)
/*0067./ *=======================================================================*/
/*0068*/
/*0069*/enum verifyName_type {LegalMethod, LegalField, LegalClass};
/*0070*/bool_t verifyName(const char* name, enum verifyName_type, bool_t abortOnError);
/*0071*/
/*0072*//*=========================================================================
/*0073./ * Class loading operations
/*0074./ *=======================================================================*/
/*0075*/
/*0076*/void loadClassfile(INSTANCE_CLASS CurrentClass, bool_t fatalErrorIfFail);
/*0077*/void loadArrayClass(ARRAY_CLASS);
/*0078*/
/*0079*//*=========================================================================
/*0080./ * Generic class file reading operations
/*0081./ *=======================================================================*/
/*0082*/
/*0083*//*
/*0084./ * NOTE: The functions below define an abstract interface for
/*0085./ * reading data from class files. The actual implementations
/*0086./ * of these functions are platform-dependent, and therefore are
/*0087./ * not provided in VmCommon. An implementation of these functions
/*0088./ * must be provided for each platform. A sample implementation
/*0089./ * can be found in VmExtra/src/loaderFile.c.
/*0090./ */
/*0091*/int loadByteNoEOFCheck(FILEPOINTER_HANDLE);
/*0092*/unsigned char loadByte(FILEPOINTER_HANDLE);
/*0093*/unsigned short loadShort(FILEPOINTER_HANDLE);
/*0094*/unsigned long loadCell(FILEPOINTER_HANDLE);
/*0095*/void loadBytes(FILEPOINTER_HANDLE, char *buffer, int length);
/*0096*/void skipBytes(FILEPOINTER_HANDLE, unsigned int i);
/*0097*/
/*0098*/void InitializeClassLoading(void);
/*0099*/void FinalizeClassLoading();
/*0100*/
/*0101*/FILEPOINTER openClassfile(INSTANCE_CLASS clazz);
/*0102*/FILEPOINTER openResourcefile(BYTES resourceName);
/*0103*/void closeClassfile(FILEPOINTER_HANDLE);
/*0104*/
/*0105*//*=========================================================================
/*0106./ * Helper functions
/*0107./ *=======================================================================*/
/*0108*/
/*0109*/char* replaceLetters(char* string, char c1, char c2);
/*0110*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -