#
# @(#)invokers.txt	1.3 98/03/18
#
# Copyright 1997, 1998 by Sun Microsystems, Inc.,
# 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
# All rights reserved.
#
# This software is the confidential and proprietary information
# of Sun Microsystems, Inc. ("Confidential Information").  You
# shall not disclose such Confidential Information and shall use
# it only in accordance with the terms of the license agreement
# you entered into with Sun.
#

# 
# This file describes which JNI native method
# signatures for which we will generate custom
# invokers.  A custom invoker for a given native
# method signature knows the exact argument and
# return types for the (JNI) native method, and
# can dispatch to the native code directly.  (The
# custom function basically replaces
# invokeJNINativeMethod() in classruntime.c.  This
# is faster than either sysInvokeNative() or old-style
# stubs.  Signatures are specified as in the VM spec:
# Arrays start with '[', class types start with 'L'
# and end with a ';'.  Return type is after the closing ')'.
# For arguments, objects and arrays are treated the same,
# and single-word integral types (boolean, byte, short, char,
# int) are all treated the same, and so share the same
# signature as far as we're concerned.  Thus:
#   (ILjava/lang/Object;Z)V
#   (S[BI)V
#   (B[[[[Ljava/lang/String;C)V
# all share the same effective (I,Object,I)V signature.
# Note however that we cannot collapse return types
# in this way, so:
#   (Ljava/lang/String;)I
#   (Ljava/lang/String;)B
# have different signatures.

# There are ~550 native methods in the JDK, with about 81
# unique signatures.  Each custom invoker costs an
# additional 170-200 bytes of text on x86 and 300-400 bytes
# on sparc.  We'll provide custom invokers for the most
# commonly occurring signatures, as well as for particular
# methods we know to be performance critical.  The
# incremental cost in size of additional invokers is small
# enough that I think this list could be expanded.
#
# the most common native signature (93 times)
()V
# the second most common native signature (77 times)
(Ljava/lang/Object;)V
# third most common (40 times)
()I
# fourth most common (33 times)
(I)V
# fifth most common (26 times)
()Ljava/lang/Object;
# sixth most common (21 times)
(Ljava/lang/Object;)Ljava/lang/Object;
# seventh most common (18 times, lots of AWT)
(IIII)V
# eigth most common (17 times)
(Ljava/lang/Object;II)V
# ninth most common (16 times)
()Z
# tenth most common (15 times, lots of BigNum)
(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object
#
# These are methods that are worth optimizing
#
# System.currentTimeMillis()
()J
# lots of I/O functions
([BII)I
# System.arrayCopy()
(Ljava/lang/Object;ILjava/lang/Object;II)V
# all of the trig functions in java.lang.Math
(D)D
