Source files whose function prototypes are defined herein include:
In order to separate the structure packing demands of typedef struct {} ClassFile
, the following files will not have their prototypes defined here, even though they are utility functions:
Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
Licensed under the Apache License, Version 2.0 ("the License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and limitations under the License.
Definition in file util.h.
Go to the source code of this file.
Defines | |
#define | GETRI4(ptr) bytegames_getri4(ptr) |
#define | GETRL8(ptr) bytegames_getrl8(ptr) |
#define | GETRS2(ptr) bytegames_getrs2(ptr) |
#define | MACHINE_JINT_SWAP(p1) |
#define | MACHINE_JLONG_MIX(p1) |
#define | MACHINE_JLONG_MIX_PTR(p1) |
#define | MACHINE_JLONG_SWAP(p1) |
#define | MACHINE_JLONG_SWAP_PTR(p1) |
#define | MACHINE_JSHORT_SWAP(p1) |
#define | MACHINE_JSHORT_SWAP_PTR(p1) |
Functions | |
ARCH_COPYRIGHT_APACHE (util, h,"$URL: https://svn.apache.org/path/name/util.h $ $Id: util.h 0 09/28/2005 dlydick $") | |
rvoid | argv_copyrightmsg (rvoid) |
Show program copyright message to standard output. | |
rvoid | argv_helpmsg (rvoid) |
Show program syntax and usage message to standard output. | |
rvoid | argv_init (int argc, char **argv, char **envp) |
Parse command line. | |
rvoid | argv_licensemsg (rvoid) |
Show program software license message to standard output. | |
rvoid | argv_showmsg (rvoid) |
Show resolution of command line to standard output. | |
rvoid | argv_shutdown (rvoid) |
Clean up from argv[] setup after JVM execution. | |
rvoid | argv_versionmsg (rvoid) |
Show program version message to standard output. | |
jdouble | bytegames_combine_jdouble (jint msword, jint lsword) |
Combine two jint words into a jdouble. | |
jlong | bytegames_combine_jlong (jint msword, jint lsword) |
Combine two jint words into a jlong. | |
ruint | bytegames_getri4 (ruint *ptr4) |
4-byte version of bytegames_getrs2(), but performs two odd-byte accesses, not just one. | |
rulong | bytegames_getrl8 (rulong *ptr8) |
8-byte version of bytegames_getri4(), but performs four odd-byte accesses, not just one. | |
rushort | bytegames_getrs2 (rushort *ptr2) |
Retrieve any generic 2-byte value (16 bits), whether or not its is aligned on a 2-byte (that is, even address) boundary. | |
rulong | bytegames_mix8 (rulong val) |
Mix up 8 bytes for a little-endian machine rushort value to a big-endian Java real machine implementation rushort value in the same way as bytegames_swap8(), but store the words MS first, LS second. | |
rvoid | bytegames_putri4 (ruint *ptr4, ruint val4) |
Store any generic 4-byte value (32 bits), whether or not its is aligned on a 2-byte (that is, even address) boundary. | |
rvoid | bytegames_putrl8 (rulong *ptr8, rulong val8) |
Store any generic 8-byte value (64 bits), whether or not its is aligned on a 2-byte (that is, even address) boundary.This function is the inverse of bytegames_getrl8() above, which see for further explanation. | |
rvoid | bytegames_putrs2 (rushort *ptr2, rushort val2) |
Store any generic 2-byte value (16 bits), whether or not its is aligned on a 2-byte (that is, even address) boundary. | |
rvoid | bytegames_split_jdouble (jdouble splitdouble, jint *msword, jint *lsword) |
Split a jdouble into two jint words. | |
rvoid | bytegames_split_jlong (jlong splitlong, jint *msword, jint *lsword) |
Split a jlong into two jint words. | |
rushort | bytegames_swap2 (rushort val) |
Swap 2 bytes for a little-endian machine rushort value to a big-endian Java real machine implementation rushort value. | |
ruint | bytegames_swap4 (ruint val) |
Swap 4 bytes for a little-endian machine ruint value to a big-endian Java real machine implementation ruint value. | |
rulong | bytegames_swap8 (rulong val) |
Swap 8 bytes for a little-endian machine rulong value to a big-endian Java real machine implementation rulong value. | |
jvm_debug_level_enum | jvmutil_get_dml (rvoid) |
rvoid | jvmutil_print_error_stack (jvm_thread_index thridx) |
Print basic stack frame summary reporting an error versus an exception. | |
rvoid | jvmutil_print_exception_stack (jvm_thread_index thridx) |
Print basic stack frame summary reporting an exception versus an error. | |
rvoid | jvmutil_print_stack (jvm_thread_index thridx, rchar *pheader) |
Print basic stack frame summary only. | |
rvoid | jvmutil_print_stack_details (jvm_thread_index thridx, rchar *pheader) |
Print stack frame with some details. | |
rvoid | jvmutil_print_stack_locals (jvm_thread_index thridx, rchar *pheader) |
Print stack frame with details and local variables. | |
rvoid | jvmutil_set_dml (jvm_debug_level_enum level) |
Set current debug message level. | |
rchar * | manifest_get_main (rchar *mnfname) |
Search a JAR manifest file for a main class attribute. | |
jlong | timeslice_get_thread_sleeptime (jvm_thread_index thridx) |
Retrieve a thread's sleeptime value safely during read of that variable on a given thread. | |
rvoid | timeslice_init (rvoid) |
void * | timeslice_run (void *dummy) |
Interval timer thread. | |
rvoid | timeslice_shutdown (rvoid) |
Shut down the time slicing mechanism for JVM shutdown. | |
const rchar * | tmparea_get (rvoid) |
rvoid | tmparea_init (char **argv) |
rvoid | tmparea_shutdown (rvoid) |
Shut down the temporary directory area after JVM execution. |
|
For internal use only.
See arch.h for the origin of architecture-specific Definition at line 119 of file util.h. Referenced by cfattrib_loadattribute(), and classfile_loadclassdata(). |
|
Definition at line 120 of file util.h. Referenced by cfattrib_loadattribute(), cfmsgs_typemsg(), and classfile_loadclassdata(). |
|
Definition at line 121 of file util.h. Referenced by cfmsgs_typemsg(). |
|
For internal use only. Big endian architectures do not need to swap anything since the JVM spec declares its (short) and (int) structures as big endian. Definition at line 151 of file util.h. Referenced by cfattrib_loadattribute(), and classfile_loadclassdata(). |
|
Definition at line 152 of file util.h. Referenced by cfattrib_loadattribute(), and classfile_loadclassdata(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
Retrieve any generic 2-byte value (16 bits), whether or not its is aligned on a 2-byte (that is, even address) boundary. This function was written to suppress SIGSEGV issues on GCC -m32 binaries on a Solaris 9. Typical usage is in a situation of: rshort *pshort; ... val = *pshort; ... If pshort is at odd address, throw SIGSEGV. Thus convert to: rshort *pshort; ... val = getrs2(pshort); ... No signal this way. This causes two one-byte accesses to happen instead of a single two-byte access, eliminating the cause of SIGSEGV, unless, of course, the pointer is off in the weeds instead of looking at valid memory.
Definition at line 233 of file bytegames.c. References twobyte::_byteval, and twobyte::_usval. |
|
4-byte version of bytegames_getrs2(), but performs two odd-byte accesses, not just one. This causes four one-byte accesses to happen instead of a single four-byte access, eliminating the cause of SIGSEGV.
Definition at line 302 of file bytegames.c. References fourbyte::_byteval, and fourbyte::_ruival. |
|
8-byte version of bytegames_getri4(), but performs four odd-byte accesses, not just one. This causes eight one-byte accesses to happen instead of a single eight-byte access, eliminating the cause of SIGSEGV.
Definition at line 376 of file bytegames.c. References eightbyte::_byteval, eightbyte::_rulval, and bytegames_swap8(). |
|
Store any generic 2-byte value (16 bits), whether or not its is aligned on a 2-byte (that is, even address) boundary. This function is the inverse of bytegames_getrs2() above, which see for further explanation.
Definition at line 268 of file bytegames.c. References twobyte::_byteval, and twobyte::_usval. |
|
Store any generic 4-byte value (32 bits), whether or not its is aligned on a 2-byte (that is, even address) boundary. This function is the inverse of bytegames_getri4() above, which see for further explanation.
Definition at line 339 of file bytegames.c. References fourbyte::_byteval, and fourbyte::_ruival. |
|
Store any generic 8-byte value (64 bits), whether or not its is aligned on a 2-byte (that is, even address) boundary.This function is the inverse of bytegames_getrl8() above, which see for further explanation.
Definition at line 421 of file bytegames.c. References eightbyte::_byteval, eightbyte::_rulval, and bytegames_swap8(). |
|
Swap 2 bytes for a little-endian machine rushort value to a big-endian Java real machine implementation rushort value. Available but not used in big-endian architectures. This routine is mapped for little-endian machines to MACHINE_JSHORT_SWAP().
INPUT BYTE ORDER: (a) (b) rshort: (ab) OUTPUT BYTE ORDER: (b) (a) rshort: (ba)
Definition at line 497 of file bytegames.c. References twobyte::_byteval, and twobyte::_usval. |
|
Swap 4 bytes for a little-endian machine ruint value to a big-endian Java real machine implementation ruint value. Available but not used in big-endian architectures. This routine is mapped for little-endian machines to MACHINE_JINT_SWAP().
INPUT BYTE ORDER: (a) (b) (c) (d) rint: (abcd) OUTPUT BYTE ORDER: (d) (c) (b) (a) rint: (dcba)
Definition at line 539 of file bytegames.c. References fourbyte::_byteval, and fourbyte::_ruival. |
|
Swap 8 bytes for a little-endian machine rulong value to a big-endian Java real machine implementation rulong value. Available but not used in big-endian architectures. This routine is mapped for little-endian machines to MACHINE_JLONG_SWAP().
INPUT BYTE ORDER: (a) (b) (c) (d) (e) (f) (g) (h) rlong: (abcdefgh) OUTPUT BYTE ORDER: (h) (g) (f) (e) (d) (c) (b) (a) rlong: (hgfedcba)
Definition at line 586 of file bytegames.c. References eightbyte::_byteval, and eightbyte::_rulval. Referenced by bytegames_getrl8(), and bytegames_putrl8(). |
|
Mix up 8 bytes for a little-endian machine rushort value to a big-endian Java real machine implementation rushort value in the same way as bytegames_swap8(), but store the words MS first, LS second. Available but not used in big-endian architectures. This routine is mapped for little-endian machines to MACHINE_JLONG_MIX().
INPUT BYTE ORDER: (a) (b) (c) (d) (e) (f) (g) (h) rlong: (abcdefgh) OUTPUT BYTE ORDER: (d) (c) (b) (a) (h) (g) (f) (e) rlong: (dcbahgfe)
Definition at line 643 of file bytegames.c. References eightbyte::_byteval, and eightbyte::_rulval. |
|
Combine two jint words into a jlong. Pass in two sequential words as jint from the JVM stack frame or operand stack or any other appropriate source and return a result as jlong
Definition at line 722 of file bytegames.c. References eightbyte::_intval, and eightbyte::_julval. |
|
Combine two jint words into a jdouble. Pass in two sequential words as jint from the JVM stack frame or operand stack or any other appropriate source and return a result as jdouble.
Definition at line 752 of file bytegames.c. References eightbyte::_intval, and eightbyte::_jdval. |
|
Split a jlong into two jint words. Pass in a jlong and return two words suitable for storing into a JVM stack frame as a pair of local variables or into the operand stack as two sequential words. The first receives the MS word, the second receives the LS word, which should be the next sequential stack frame local variable or operand stack location.
Definition at line 785 of file bytegames.c. References eightbyte::_intval, and eightbyte::_julval. Referenced by native_run_local_return_jlong(), and opcode_run(). |
|
Split a jdouble into two jint words. Pass in a jlong and return two words suitable for storing into a JVM stack frame as a pair of local variables or into the operand stack as two sequential words. The first receives the MS word, the second receives the LS word, which should be the next sequential stack frame local variable or operand stack location.
Definition at line 820 of file bytegames.c. References eightbyte::_intval, and eightbyte::_jdval. Referenced by native_run_local_return_jdouble(), and opcode_run(). |
|
Parse command line. Retrieve parameters from the program entry point main(int argc, char **argv, char **envp) The syntax for the command line is:
main_pgm_name [{-Xjh | -Xjavahome | -Xjava_home} dir_name] [{-cp | -classpath} dir_name] [{-Xbcp | -Xbootclasspath} dir_name] [{-Xdebug | -Xdebuglevel | -Xdebug_level} level] [-jar any/path/name/jarfilename] start.class.name [java_arg1 [java_arg2 [...]]] main_pgm_name -show -version -copyright -help If more than one '-<token>' or '-X<token>' option entry is found on the command line for a given token type, the last one wins If one of these tokens is the last parameter on a command line, it is ignored. After the option entries are reviewed, the starting class name is specified, preceded by an optional '-jar' modifier which, if present, indicates that the specified jar file should be read to locate the starting class. Any parameters after the starting class name are passed to the JVM as '(String) args[]'.
< Convenient alias for DML1 < Convenient alias for DML10 Definition at line 123 of file argv.c. References rjvm::argc, rjvm::argcj, rjvm::argv, rjvm::argv0, rjvm::argv0name, argv_copyrightmsg(), argv_helpmsg(), argv_licensemsg(), argv_showmsg(), argv_versionmsg(), rjvm::argvj, rjvm::bootclasspath, rjvm::classpath, DMLMAX, DMLMIN, DMLOFF, rjvm::envp, EXIT_ARGV_COPYRIGHT, EXIT_ARGV_HELP, EXIT_ARGV_LICENSE, EXIT_ARGV_VERSION, exit_jvm(), HEAP_GET_DATA, rjvm::java_home, jvm_argv_initialized, JVMCFG_BOOTCLASSPATH_ABBREV_PARM, JVMCFG_BOOTCLASSPATH_DEFAULT, JVMCFG_BOOTCLASSPATH_FULL_PARM, JVMCFG_CLASSPATH_ABBREV_PARM, JVMCFG_CLASSPATH_DEFAULT, JVMCFG_CLASSPATH_FULL_PARM, JVMCFG_COMMAND_LINE_COPYRIGHT_PARM, JVMCFG_COMMAND_LINE_HELP_PARM, JVMCFG_COMMAND_LINE_LICENSE_PARM, JVMCFG_COMMAND_LINE_SHOW_PARM, JVMCFG_COMMAND_LINE_VERSION_PARM, JVMCFG_DEBUGMSGLEVEL_ABBREV_PARM, JVMCFG_DEBUGMSGLEVEL_FULL_PARM, JVMCFG_DEBUGMSGLEVEL_MID_PARM, JVMCFG_ENVIRONMENT_VARIABLE_BOOTCLASSPATH, JVMCFG_ENVIRONMENT_VARIABLE_CLASSPATH, JVMCFG_ENVIRONMENT_VARIABLE_JAVA_HOME, JVMCFG_JARFILE_STARTCLASS_PARM, JVMCFG_JAVA_HOME_ABBREV_PARM, JVMCFG_JAVA_HOME_DEFAULT, JVMCFG_JAVA_HOME_FULL_PARM, JVMCFG_JAVA_HOME_MID_PARM, JVMCFG_PATHNAME_DELIMITER_CHAR, jvmutil_set_dml(), pjvm, rfalse, rnull, rtrue, rjvm::startclass, rjvm::startjar, and sysErrMsg(). |
|
Clean up from argv[] setup after JVM execution. Parameters: rvoid
|
|
Show program version message to standard output. Parameters: rvoid
Definition at line 423 of file argv.c. Referenced by argv_init(). |
|
Show program copyright message to standard output. Parameters: rvoid
Definition at line 442 of file argv.c. Referenced by argv_init(). |
|
Show program software license message to standard output. Parameters: rvoid
Definition at line 465 of file argv.c. Referenced by argv_init(). |
|
Show program syntax and usage message to standard output. Parameters: rvoid
Definition at line 487 of file argv.c. Referenced by argv_init(). |
|
Show resolution of command line to standard output. Parameters: rvoid
Definition at line 624 of file argv.c. Referenced by argv_init(). |
|
Set current debug message level.
Definition at line 96 of file jvmutil.c. References rjvm::debug_message_level, and pjvm. Referenced by argv_init(). |
|
|
|
Print basic stack frame summary only.
Definition at line 284 of file jvmutil.c. References jvmutil_print_stack_common(), and rfalse. Referenced by jvmutil_print_errtype_stack(), object_run_method(), opcode_load_run_throwable(), and opcode_run(). |
|
Print stack frame with some details.
Definition at line 295 of file jvmutil.c. References jvmutil_print_stack_common(), rfalse, and rtrue. |
|
Print stack frame with details and local variables.
Definition at line 307 of file jvmutil.c. References jvmutil_print_stack_common(), and rtrue. |
|
Print basic stack frame summary reporting an error versus an exception.
Definition at line 358 of file jvmutil.c. References jvmutil_print_errtype_stack(). |
|
Print basic stack frame summary reporting an exception versus an error.
Definition at line 370 of file jvmutil.c. References jvmutil_print_errtype_stack(). |
|
Search a JAR manifest file for a main class attribute. This attribute MUST be all on one line and without any line continuations breaking up the class name. Look for a line of text like this, where | indicates that the following character is the first one on the line:
| |Main-Class: name.of.start.class\n | WITHOUT any line continuations, | |Main-Class: name.of.sta\n | rt.class\n |
< Convenient size for any stdio msg Definition at line 90 of file manifest.c. References exit_jvm(), EXIT_MANIFEST_JAR, HEAP_FREE_DATA, HEAP_GET_DATA, JVMCFG_JARFILE_MANIFEST_MAIN_CLASS, JVMCFG_STDIO_BFR, rfalse, rnull, and sysErrMsg(). |
|
Shut down the time slicing mechanism for JVM shutdown. Parameters: rvoid
Definition at line 295 of file timeslice.c. References jvm_timeslice_initialized, posix_thread_id, and rfalse. |
|
Retrieve a thread's sleeptime value safely during read of that variable on a given thread.
Definition at line 133 of file timeslice.c. References pjvm, rjvm::sleeplock, and THREAD. Referenced by threadutil_update_wait(). |
|
Interval timer thread.
Definition at line 230 of file timeslice.c. References exit_jvm(), EXIT_TIMESLICE_START, JVMCFG_TIMESLICE_PERIOD_ENABLE, JVMCFG_TIMESLICE_PERIOD_MICROSECONDS, JVMCFG_TIMESLICE_PERIOD_SECONDS, rnull, rtrue, sysErrMsg(), timeslice_period, and timeslice_tick(). Referenced by timeslice_init(). |
|
|
|
|
|
|
|
Shut down the temporary directory area after JVM execution. Parameters: rvoid
|